📄 viewservermenuview.cpp
字号:
/* ====================================================================
* File: ViewServerMenuView.cpp
* Created: 07/04/05
* Author:
* Copyright (c): , All rights reserved
* ==================================================================== */
#include <coemain.h>
#include <eikappui.h>
#include <eikenv.h>
#include <barsread.h>
#include <ViewServer.rsg>
#include "ViewServerMenuView.h"
#include "Settings.h"
// Standard construction sequence
CViewServerMenuView* CViewServerMenuView::NewL(const TRect& aRect) {
CViewServerMenuView* self = CViewServerMenuView::NewLC(aRect);
CleanupStack::Pop(self);
return self;
}
CViewServerMenuView* CViewServerMenuView::NewLC(const TRect& aRect) {
CViewServerMenuView* self = new (ELeave) CViewServerMenuView;
CleanupStack::PushL(self);
self->ConstructL(aRect);
return self;
}
CViewServerMenuView::CViewServerMenuView() {
}
CViewServerMenuView::~CViewServerMenuView() {
}
void CViewServerMenuView::ConstructL(const TRect& aRect) {
//create window
CreateWindowL();
//set extent
SetRect(aRect);
//activate
ActivateL();
}
// Draw this application's view to the screen
void CViewServerMenuView::Draw(const TRect& aRect) const {
CWindowGc& gc = SystemGc();
TRect rect = Rect();
TPoint point(0,0);
const CFont* font = iEikonEnv->NormalFont();
_LIT(KTitle,"ViewServer - View Two");
_LIT(KCredit,"by Rawsocket.org");
gc.SetBrushColor(KRgbBlack);
gc.Clear(rect);
gc.SetPenColor(KRgbWhite);
gc.UseFont(font);
point.iX = rect.Width()/2 - font->TextWidthInPixels(KTitle)/2;
point.iY = rect.Height()/2;
gc.DrawText(KTitle,point);
gc.DiscardFont();
font = iEikonEnv->AnnotationFont();
point.iX = rect.Width()/2 - font->TextWidthInPixels(KCredit)/2;
point.iY += font->AscentInPixels() + 10;
gc.UseFont(font);
gc.DrawText(KCredit,point);
gc.DiscardFont();
}
//returns the ViewId for the view server
TVwsViewId CViewServerMenuView::ViewId() const {
return TVwsViewId(KUidViewServerApp,KMenuViewId);
}
//activates this view, called by the framework
void CViewServerMenuView::ViewActivatedL(const TVwsViewId& /*aPrevViewId*/,
TUid /*aCustomMessageId*/,
const TDesC8& /*aCustomMessage*/) {
MakeVisible(ETrue);
}
//deactivates this view, called by the framework
void CViewServerMenuView::ViewDeactivated() {
MakeVisible(EFalse);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -