📄 cactivehelloappui.cpp
字号:
// CActiveHelloAppUi.cpp
//
// Copyright (c) 2002 Symbian Ltd. All rights reserved.
#include "cactivehelloappui.h"
#include <eikenv.h>
#include "cactivehelloappview.h"
#include "cdelayedhello.h"
#include "cflashinghello.h"
#include "cmultiparthello.h"
#include <activehello.rsg>
#include "activehello.hrh"
// app UI
void CActiveHelloAppUi::ConstructL()
{
CQikAppUi::ConstructL();
iAppView = CActiveHelloAppView::NewL(ClientRect());
iDelayedHello=CDelayedHello::NewL();
iFlashingHello=CFlashingHello::NewL(iAppView);
iMultiHello=CMultiPartHello::NewL(iAppView);
}
CActiveHelloAppUi::~CActiveHelloAppUi()
{
delete iDelayedHello;
delete iMultiHello; // must delete before iAppView!
delete iFlashingHello; // must delete before iAppView!
delete iAppView;
}
void CActiveHelloAppUi::HandleCommandL(TInt aCommand)
{
switch (aCommand)
{
case EActiveHelloCmdSetHello:
iDelayedHello->Cancel(); // just in case
iDelayedHello->SetHello(3000000); // 3-second delay
break;
case EActiveHelloCmdCancelHello:
iDelayedHello->Cancel();
iEikonEnv->InfoMsg(R_ACTIVEHELLO_TEXT_CANCELLED);
break;
case EActiveHelloCmdStartFlashing:
iMultiHello->Cancel();
iFlashingHello->Cancel(); // just in case
iFlashingHello->Start(1000000); // 1-second half-period
iEikonEnv->InfoMsg(R_ACTIVEHELLO_TEXT_STARTED);
break;
case EActiveHelloCmdStopFlashing:
iFlashingHello->Cancel();
iEikonEnv->InfoMsg(R_ACTIVEHELLO_TEXT_STOPPED);
break;
case EActiveHelloCmdStartMultiHello:
iFlashingHello->Cancel();
iMultiHello->Cancel();
iMultiHello->Start(3000000); // 1-second half-period
iEikonEnv->InfoMsg(R_ACTIVEHELLO_TEXT_MULTI_STARTED);
break;
case EActiveHelloCmdCancelMultiHello:
iMultiHello->Cancel();
iEikonEnv->InfoMsg(R_ACTIVEHELLO_TEXT_MULTI_CANCEL);
break;
case EEikCmdExit:
iFlashingHello->Cancel();
iMultiHello->Cancel();
Exit();
break;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -