📄 retroappui.cpp
字号:
////////////////////////////////////////////////////////////////////////
//
// RetroAppUi.cpp
//
// Copyright (c) 2003 Nokia Mobile Phones. All rights reserved.
//
////////////////////////////////////////////////////////////////////////
#include <avkon.hrh>
#include <eikmenup.h>
#include "RetroAppUi.h"
#include "RetroAppView.h"
#include "Retroblaster.h"
//#include "Retroblaster_AppView.h"
#include "RetroBlaster.hrh"
#include <RetroBlaster.rsg>
// Construction:
// -------------
CRetroAppUi::CRetroAppUi()
{
}
// ConstructL is called by the application framework
void CRetroAppUi::ConstructL()
{
BaseConstructL();
// Create the application view
// iAppView = CRetroAppViewOld::NewL(ApplicationRect());
iAppView = CRetroAppView::NewL(ApplicationRect());
AddToStackL(iAppView);
}
// Destruction:
// ------------
CRetroAppUi::~CRetroAppUi()
{
if (iAppView)
{
RemoveFromStack(iAppView);
delete iAppView;
iAppView = NULL;
}
}
// Handle any menu commands:
// -------------------------
void CRetroAppUi::HandleCommandL(TInt aCommand)
{
switch(aCommand)
{
case EAknSoftkeyExit:
Exit();
break;
case ERetroGameStart:
static_cast<CRetroAppView*>(iAppView)->StartGameL();
break;
case ERetroGameStop:
static_cast<CRetroAppView*>(iAppView)->StopGame();
break;
default:
break;
}
}
// Set up the menu:
// ----------------
// The Uikon framework calls this function immediately before the menu pane is activated
void CRetroAppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
{
if (aResourceId == R_RETRO_MENUPANE)
{
if (static_cast<CRetroAppView*>(iAppView)->IsPlaying())
{
aMenuPane->SetItemDimmed(ERetroGameStart, ETrue);
aMenuPane->SetItemDimmed(ERetroGameStop, EFalse);
}
else
{
aMenuPane->SetItemDimmed(ERetroGameStart, EFalse);
aMenuPane->SetItemDimmed(ERetroGameStop, ETrue);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -