?? skiingappui.cpp
字號:
/**
*
* @brief Definition of CSkiingAppUi
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/
// INCLUDE FILES
// Class include
#include "SkiingAppUi.h"
// System include
#include <aknquerydialog.h>
#include <Skiing.rsg>
// User includes
#include "SkiingContainer.h" // CSkiingContainer
#include "Skiing.hrh"
// ================= MEMBER FUNCTIONS =======================
/**
* Symbian OS 2nd phase constructor. Constructs the application's container,
* setting itself as the container's MOP parent, and adds it to the control
* stack.
*/
void CSkiingAppUi::ConstructL()
{
BaseConstructL();
iAppContainer = CSkiingContainer::NewL(ApplicationRect());
iAppContainer->SetMopParent(this);
SetKeyBlockMode(ENoKeyBlock);
AddToStackL(iAppContainer);
}
/**
* Destructor.
* Removes the application's container from the stack and deletes it.
*/
CSkiingAppUi::~CSkiingAppUi()
{
if (iAppContainer)
{
RemoveFromStack(iAppContainer);
delete iAppContainer;
}
}
/**
* From CEikAppUi, takes care of command handling.
*
* @param aCommand command to be handled
*/
void CSkiingAppUi::HandleCommandL(TInt aCommand)
{
switch (aCommand)
{
case EAknSoftkeyBack:
case EEikCmdExit:
case EAknSoftkeyExit :
{
Exit();
break;
}
case ESkiingStart:
iAppContainer->StartDSA();
break;
case ESkiingPause:
{
iAppContainer->StopDSA();
iGamePaused = ETrue;
CAknQueryDialog* dlg = CAknQueryDialog::NewL();
dlg->ExecuteLD(R_AKNEXQUERY_CONFIRMATION_QUERY);
iAppContainer->StartDSA();
iGamePaused = EFalse;
break;
}
default:
break;
}
}
/**
* From CEikAppUi, takes care of loss of focus
*
* @param aForeground ETrue if the app has just gained focus, EFalse otherwise
*/
void CSkiingAppUi::HandleForegroundEventL(TBool aForeground)
// This is necessary so that the application behaves itself just in case there's
// another application about that uses direct screen access
{
if (aForeground)
{
if (!iGamePaused)
{
iAppContainer->StartDSA();
}
SetKeyBlockMode(ENoKeyBlock);
}
else
{
iAppContainer->StopDSA();
SetKeyBlockMode(EDefaultBlockMode);
}
}
/**
* From CEikAppUi, handles the emphasising or de-emphasising of a menu window
*
* @param aMenuControl The menu control.
* @param ETrue to emphasize the menu, EFalse otherwise.
*/
void CSkiingAppUi::SetEmphasis(CCoeControl* /*aMenuControl*/,TBool aEmphasis)
{
if (aEmphasis)
{
iMenuDisplay = ETrue;
}
else
{
if (iMenuDisplay)
{
iMenuDisplay = EFalse;
iAppContainer->StartDSA();
}
}
}
// End of File
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -