📄 guiclock8_aboutcontainer.cpp
字号:
// GUIClock_CGUIClockAboutContainer.cpp
// ------------------------------
//
// Copyright (c) 2000 Symbian Ltd. All rights reserved.
//
////////////////////////////////////////////////////////////////////////
//
// Source file for the implementation of the
// application view class - CGUIClockAboutContainer
//
////////////////////////////////////////////////////////////////////////
#include "GUIClock8.h"
#include <stringloader.h>
//
// Constructor for the view.
//
CGUIClockAboutContainer::CGUIClockAboutContainer()
{
}
// Static NewL() function to start the standard two
// phase construction.
//
CGUIClockAboutContainer* CGUIClockAboutContainer::NewL(const TRect& aRect)
{
CGUIClockAboutContainer* self = new(ELeave) CGUIClockAboutContainer;
CleanupStack::PushL(self);
self->ConstructL(aRect);
CleanupStack::Pop();
return self;
}
//
// Destructor for the view.
//
CGUIClockAboutContainer::~CGUIClockAboutContainer()
{
if(iAboutString)
delete iAboutString;
}
// Second phase construction.
//
void CGUIClockAboutContainer::ConstructL(const TRect& aRect)
{
iAboutString = StringLoader::LoadL(R_STRING_ABOUT);
// Control is a window owning control
CreateWindowL();
// Extent of the control. This is
// the whole rectangle available to application.
// The rectangle is passed to us from the application UI.
SetRect(aRect);
// At this stage, the control is ready to draw so
// we tell the UI framework by activating it.
ActivateL();
}
// Drawing the view - in this example,
// consists of drawing a simple outline rectangle
// and then drawing the text in the middle.
// We use the Normal font supplied by the UI.
//
// In this example, we don't use the redraw
// region because it's easier to redraw to
// the whole client area.
//
void CGUIClockAboutContainer::Draw(const TRect& /*aRect*/) const
{
CWindowGc& gc = SystemGc();
gc.Clear();
gc.SetPenColor(TRgb(0,0,0));
const CFont* fontUsed = iCoeEnv->NormalFont();
gc.UseFont(fontUsed);
gc.DrawText(*iAboutString,TPoint(5,20));
// Finished using the font
gc.DiscardFont();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -