?? drawing_appview.cpp
字號:
// Drawing_AppView.cpp
// ------------------------------
//
// Copyright (c) 2002 Symbian Ltd. All rights reserved.
//
////////////////////////////////////////////////////////////////////////
//
// Source file for the implementation of the
// application view class - CExampleAppView
//
////////////////////////////////////////////////////////////////////////
#include "Drawing.h"
void CExampleAppView::ConstructL(const TRect& aRect)
{
// give myself a window: the control is a window-owning control
CreateWindowL();
SetRect(aRect); // Extent of the control, passed to us from the application UI.
// The rectangle available for drawing, with co-ordinates which
// are relative to the whole screen. The control has to have
// this area set.
TRect drawingRect=Rect(); // The rectangle available for drawing, with the top left
// and bottom right co-ordinates relating only to this area (i.e.
// the top left point of the drawing area has the co-ordinate (0,0)).
// This makes the division of the drawing area into two areas,
// each with its own control, simpler.
// vertical mid-point coordinate
TInt midY=(drawingRect.iTl.iY+drawingRect.iBr.iY)/2;
// construct upper control
TRect upper=drawingRect;
upper.iBr.iY=midY;
iControl0=CExampleHelloControl::NewL(*this, upper);
iControl0->SetFullRedraw(EFalse);
// construct lower control
TRect lower=drawingRect;
lower.iTl.iY=midY;
iControl1=CExampleHelloControl::NewL(*this, lower);
// At this stage, the control is ready to draw so
// we tell the UI framework by activating it.
ActivateL();
}
CExampleAppView::~CExampleAppView()
{
delete iControl0;
delete iControl1;
}
void CExampleAppView::ZoomInL()
{
iControl0->SetZoomInL();
iControl0->DrawNow();
iControl1->SetZoomInL();
iControl1->DrawNow();
}
void CExampleAppView::ZoomOutL()
{
iControl0->SetZoomOutL();
iControl0->DrawNow();
iControl1->SetZoomOutL();
iControl1->DrawNow();
}
TInt CExampleAppView::CountComponentControls() const
{
return 2;
}
CCoeControl* CExampleAppView::ComponentControl(TInt aIndex) const
{
switch (aIndex)
{
case 0: return iControl0;
case 1: return iControl1;
default: return 0;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -