📄 blinklabel.cpp
字号:
/*
* ============================================================================
* Name : CBlinkLabel from BlinkLabel.cpp
* Part of : Blink
* Created : 05.02.2006 by ToBeReplacedByAuthor
* Implementation notes:
* Initial content was generated by Series 60 Application Wizard.
* Version :
* Copyright: ToBeReplacedByCopyright
* ============================================================================
*/
// INCLUDE FILES
#include "BlinkLabel.h"
// ================= MEMBER FUNCTIONS =======================
// Destructor
CBlinkLabel::~CBlinkLabel()
{
if(iPeriodic!=NULL)
{
iPeriodic->Cancel();
delete iPeriodic;
}
}
// ---------------------------------------------------------
// CBlinkLabel::SetBlinkL()
// ---------------------------------------------------------
//
void CBlinkLabel::SetBlinkL(TBool aBlink)
{
if(aBlink)
{
if(iPeriodic==NULL)
{
iPeriodic = CPeriodic::NewL(CActive::EPriorityStandard);
}
if(!iPeriodic->IsActive())
{
iPeriodic->Start(500000,500000,TCallBack(Tick, this));
}
}
else
{
if(iPeriodic!=NULL)
{
iPeriodic->Cancel();
}
MakeVisible(ETrue);
DrawDeferred();
}
}
// ---------------------------------------------------------
// CBlinkLabel::Blink()
// ---------------------------------------------------------
//
TBool CBlinkLabel::Blink()
{
if(iPeriodic==NULL)
{
return EFalse;
}
return iPeriodic->IsActive();
}
TInt CBlinkLabel::Tick(TAny* aObject)
{
((CBlinkLabel*)aObject)->DoTick(); // cast, and call non-static function
return 1;
}
void CBlinkLabel::DoTick()
{
MakeVisible(!IsVisible());
DrawDeferred();
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -