?? hellogui_appview.cpp
字號:
// HelloGui_AppView.cpp
//
// Copyright (c) 2002 Symbian Ltd. All rights reserved.
//
#include "HelloGui.h"
#include "HelloGui_AppView.h"
CHelloGuiAppView* CHelloGuiAppView::NewL(const TRect& aRect)
{
CHelloGuiAppView * self = new(ELeave) CHelloGuiAppView;
CleanupStack::PushL(self);
self->ConstructL(aRect);
CleanupStack::Pop();
return self;
}
CHelloGuiAppView::~CHelloGuiAppView()
{
delete iHelloText;
}
void CHelloGuiAppView::ConstructL(const TRect& aRect)
{
CreateWindowL();
SetRect(aRect);
ActivateL();
// Fetch the text from the resource file.
iHelloText = iEikonEnv->AllocReadResourceL(R_HELLOGUI_TEXT_HELLO);
}
void CHelloGuiAppView::Draw(const TRect& /*aRect*/) const
{
// Window graphics context
CWindowGc& gc = SystemGc();
// Start with a clear screen
gc.Clear();
TRect rect = Rect();
rect.Shrink(10,10);
gc.DrawRect(rect);
rect.Shrink(1,1);
const CFont* font = iEikonEnv->TitleFont();
gc.UseFont(font);
TInt baseline = rect.Height()/2 - font->AscentInPixels()/2;
gc.DrawText(*iHelloText, rect, baseline, CGraphicsContext::ECenter);
gc.DiscardFont();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -