#define KListPosition TPoint(0,0)
#define KNumberStepToComplete 10
const TInt KNumberOfStepsToSaveGame(5);
void CWAPServContainerApplication::ConstructL(const TRect& aRect)
{
iTimeWaster.CreateLocal();
CreateWindowL();
iItemList = new (ELeave) CAknDoubleStyleListBox();
iItemList->SetContainerWindowL(*this);
iItemList->SetMopParent(this);
iItemList->ConstructL(this,EAknListBoxViewerFlags);
InitListBox(); // my function to prepare the list box with txt file.
iItemList->MakeVisible(true);
iItemList->SetRect(aRect);
iItemList->ActivateL();
iItemList->DrawNow();
SetRect(aRect);
ActivateL();
}
TInt CWAPServContainerApplication::CountComponentControls() const
{
return 1;
}
CCoeControl* CWAPServContainerApplication::ComponentControl(TInt aIndex) const
{
switch (aIndex)
{
case 0:
return iItemList;
default:
return NULL;
}
}
void CWAPServContainerApplication::Draw(const TRect& /*aRect*/) const
{
// Get the standard graphics context
CWindowGc& gc = SystemGc();
// Gets the control's extent
TRect rect = Rect();
// Clears the screen
gc.Clear(rect);
}
CWAPServContainerApplication::~CWAPServContainerApplication()
{
delete iItemList;
iTimeWaster.Close();
}
void CWAPServContainerApplication::SizeChanged()
{
iItemList->SetExtent (KListPosition, iItemList->MinimumSize());
}
void CWAPServContainerApplication::StartingProgram()
{
CAknWaitNoteWrapper* waitNoteWrapper = CAknWaitNoteWrapper::NewL();
CleanupStack::PushL(reinterpret_cast<CBase*>(waitNoteWrapper)); // Required reinterpret_cast as CAknWaitNoteWrapper inherits privately from CActive
waitNoteWrapper->ExecuteL(R_WAPSERV_STARTING_PROGRAM, *this);
CleanupStack::PopAndDestroy(waitNoteWrapper);
}
void CWAPServContainerApplication::DialogDismissedL(TInt /*aButtonId*/)
{
//no implementationrequire
}
TBool CWAPServContainerApplication::IsProcessDone() const
{
return (iStepsCompleted == KNumberStepToComplete);
}
void CWAPServContainerApplication::ProcessFinished()
{
iTimeWaster.Cancel();
iStepsCompleted = 0;
}
void CWAPServContainerApplication::StepL()
{
TRequestStatus status;
TInt delay = 1000000; // 1 second
iTimeWaster.After(status, delay);
User::WaitForRequest(status);
iStepsCompleted++;
}