📄 blinkcontainer.cpp
字号:
/*
* ============================================================================
* Name : CBlinkContainer from BlinkContainer.h
* 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 "BlinkContainer.h"
#include "BlinkLabel.h"
// ================= MEMBER FUNCTIONS =======================
// ---------------------------------------------------------
// CBlinkContainer::ConstructL(const TRect& aRect)
// EPOC two phased constructor
// ---------------------------------------------------------
//
void CBlinkContainer::ConstructL(const TRect& aRect)
{
CreateWindowL();
iBlinkLabel = new (ELeave) CBlinkLabel;
iBlinkLabel->SetContainerWindowL( *this );
iBlinkLabel->SetTextL( _L("Example View") );
iBlinkLabel->SetBlinkL(ETrue);
SetRect(aRect);
ActivateL();
}
// Destructor
CBlinkContainer::~CBlinkContainer()
{
delete iBlinkLabel;
}
void CBlinkContainer::SetBlinkL()
{
if(iBlinkLabel!=NULL)
{
iBlinkLabel->SetBlinkL(!iBlinkLabel->Blink());
}
}
// ---------------------------------------------------------
// CBlinkContainer::SizeChanged()
// Called by framework when the view size is changed
// ---------------------------------------------------------
//
void CBlinkContainer::SizeChanged()
{
// TODO: Add here control resize code etc.
iBlinkLabel->SetExtent( TPoint(10,10), iBlinkLabel->MinimumSize() );
}
// ---------------------------------------------------------
// CBlinkContainer::CountComponentControls() const
// ---------------------------------------------------------
//
TInt CBlinkContainer::CountComponentControls() const
{
return 1; // return nbr of controls inside this container
}
// ---------------------------------------------------------
// CBlinkContainer::ComponentControl(TInt aIndex) const
// ---------------------------------------------------------
//
CCoeControl* CBlinkContainer::ComponentControl(TInt aIndex) const
{
switch ( aIndex )
{
case 0:
return iBlinkLabel;
default:
return NULL;
}
}
// ---------------------------------------------------------
// CBlinkContainer::Draw(const TRect& aRect) const
// ---------------------------------------------------------
//
void CBlinkContainer::Draw(const TRect& aRect) const
{
CWindowGc& gc = SystemGc();
// TODO: Add your drawing code here
// example code...
gc.SetPenStyle( CGraphicsContext::ENullPen );
gc.SetBrushColor( KRgbGray );
gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
gc.DrawRect( aRect );
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -