?? cactivehelloappview.cpp
字號(hào):
// CActiveHelloAppView.cpp
//
// Copyright (c) 2002 Symbian Ltd. All rights reserved.
#include "cactivehelloappview.h"
#include <eikenv.h>
#include <activehello.rsg>
// app view
CActiveHelloAppView* CActiveHelloAppView::NewL(const TRect& aRect)
{
CActiveHelloAppView* self = new (ELeave) CActiveHelloAppView;
CleanupStack::PushL(self);
self->ConstructL(aRect);
CleanupStack::Pop(self);
return self;
}
CActiveHelloAppView::CActiveHelloAppView()
{
}
void CActiveHelloAppView::ConstructL(const TRect& aRect)
{
CreateWindowL();
SetRect(aRect);
ActivateL();
iText=iEikonEnv->AllocReadResourceL(R_ACTIVEHELLO_TEXT_HELLO);
iShowText=ETrue;
}
CActiveHelloAppView::~CActiveHelloAppView()
{
delete iText;
}
void CActiveHelloAppView::Draw(const TRect& /*aRect*/) const
{
CWindowGc& gc = SystemGc();
gc.Clear();
TRect rect=Rect();
rect.Shrink(10,10);
gc.DrawRect(rect);
if (iShowText)
{
rect.Shrink(1,1);
const CFont* font=iEikonEnv->TitleFont();
gc.UseFont(font);
TInt baseline=rect.Height()/2 + font->AscentInPixels()/2;
gc.DrawText(*iText, rect, baseline, CGraphicsContext::ECenter);
gc.DiscardFont();
}
else
{
rect.Shrink(1,1);
gc.SetPenStyle(CGraphicsContext::ENullPen);
gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
gc.DrawRect(rect);
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -