example2dappui.cpp
来自「Symbian OS S60平台2D游戏引擎案例」· C++ 代码 · 共 78 行
CPP
78 行
/*
============================================================================
* Name : CExample2DAppUi.cpp
* Part of : 2DExample
* Description : Implementation of CExample2DAppUi
* Copyright (c) 2007 Nokia Corporation
============================================================================
*/
#define KLayoutAware 0x08 // ELayoutAwareAppFlag is not defined in pre-FP3 SDK's
// INCLUDE FILES
#include "Example2DAppui.h"
#include "Example2DContainer.h"
#include <aknenv.h>
#include <avkon.hrh>
#include <avkon.rsg>
void CExample2DAppUi::ConstructL()
{
BaseConstructL( ENoAppResourceFile | KLayoutAware );
// On S60, set key block mode to allow multiple simultaneous keypresses
SetKeyBlockMode( ENoKeyBlock );
iAppContainer = new (ELeave) CExample2DContainer;
iAppContainer->ConstructL( ClientRect() );
AddToStackL( iAppContainer );
iEikonEnv->RootWin().EnableScreenChangeEvents();
iSoundSystem = KeySounds();
iSoundSystem->PushContextL( R_AVKON_SILENT_SKEY_LIST );
}
CExample2DAppUi::~CExample2DAppUi()
{
iSoundSystem->PopContext();
if (iAppContainer)
{
RemoveFromStack( iAppContainer );
delete iAppContainer;
}
}
void CExample2DAppUi::HandleCommandL( TInt aCommand )
{
switch ( aCommand )
{
case EEikCmdExit:
{
Exit();
break;
}
default:
break;
}
}
void CExample2DAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aControl)
{
CAknAppUi::HandleWsEventL(aEvent, aControl);
if ( aEvent.Type() == EEventScreenDeviceChanged )
{
iAppContainer->HandleScreenDeviceChanged();
}
}
// End of file
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?