smallservview.cpp
来自「一个Symbian平台上的serverclient模型的简单示例」· C++ 代码 · 共 56 行
CPP
56 行
// SmallServView.cpp
//
// Copyright 05/03/2001
//
#include "SmallServView.h"
#include "SmallServDoc.h"
#include <eikenv.h>
//
// ConstructL
//
// Initial object setup chores.
void CSmallServView::ConstructL( const TRect& aRect
, CSmallServDocument* aDoc
)
{
iDoc = aDoc;
CreateWindowL();
Window().SetShadowDisabled(ETrue);
SetRect(aRect);
ActivateL();
}
//
// Draw
//
void CSmallServView::Draw(const TRect& /*aRect*/) const
{
CWindowGc& gc = SystemGc();
TRect drawRect = Rect();
gc.Clear();
// Draw an outline rectangle (the default pen
// and brush styles ensure this) slightly
// smaller than the drawing area.
drawRect.Shrink(10,10);
gc.DrawRect(drawRect);
// Use the title font supplied by the UI
const CFont* fontUsed = CEikonEnv::Static()->TitleFont();
gc.UseFont(fontUsed);
// Draw the text in the middle of the rectangle.
TInt baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2;
_LIT(KScreenPrompt, "Small Server App");
gc.DrawText(KScreenPrompt,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
// Finished using the font
gc.DiscardFont();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?