📄 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 + -