📄 cflashinghello.cpp
字号:
// CFlashingHello.cpp
//
// Copyright (c) 2002 Symbian Ltd. All rights reserved.
#include "cflashinghello.h"
#include "cactivehelloappview.h"
// flashing hello
// construct/destruct
CFlashingHello* CFlashingHello::NewL(CActiveHelloAppView* aAppView)
{
CFlashingHello* self=new(ELeave) CFlashingHello;
CleanupStack::PushL(self);
self->ConstructL(aAppView);
CleanupStack::Pop(self);
return self;
}
CFlashingHello::CFlashingHello()
: CActive(0)
{
CActiveScheduler::Add(this);
}
void CFlashingHello::ConstructL(CActiveHelloAppView* aAppView)
{
iAppView=aAppView;
User::LeaveIfError(iTimer.CreateLocal());
}
CFlashingHello::~CFlashingHello()
{
Cancel();
iTimer.Close();
}
// request
void CFlashingHello::Start(TTimeIntervalMicroSeconds32 aHalfPeriod)
{
_LIT(KFlashingHelloPeriodPanic, "CFlashingHello");
__ASSERT_ALWAYS(!IsActive(), User::Panic(KFlashingHelloPeriodPanic, 1));
// Remember half-period
iHalfPeriod=aHalfPeriod;
// Hide the text, to begin with
ShowText(EFalse);
// Issue request
iTimer.After(iStatus, iHalfPeriod);
SetActive();
}
// from CActive
void CFlashingHello::RunL()
{
// Change visibility of app view text
ShowText(!iAppView->iShowText);
// Re-issue request
iTimer.After(iStatus, iHalfPeriod);
SetActive();
}
void CFlashingHello::DoCancel()
{
// Ensure text is showing
ShowText(ETrue);
// Cancel timer
iTimer.Cancel();
}
void CFlashingHello::ShowText(TBool aShowText)
{
iAppView->iShowText=aShowText;
iAppView->DrawNow();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -