?? customctrldlgcustomcontrol.cpp
字號:
/**
*
* @brief Definition of CCustomCtrlDlgCustomControl
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/
// INCLUDE FILES
// Class include
#include "CustomCtrlDlgCustomControl.h"
// CONSTANTS
const TInt KWidth = 50;
const TInt KHeight = 50;
const TInt KLeft = 0;
const TInt KRight = KWidth;
const TInt KMid = KWidth/2;
const TInt KTop = 0;
const TInt KBottom = KHeight;
//#define is used below because object construction
//occurs at runtime. Therefore, if they were defined
//as "const TPoint" the constructor would effectively
//write const data at runtime, which is not allowed.
#define KTopLeftPoint TPoint(KLeft,KTop)
#define KBottomRightPoint TPoint(KRight,KBottom)
#define KBottomLeftPoint TPoint(KLeft,KBottom)
#define KTopRightPoint TPoint(KRight,KTop)
#define KMidLeftPoint TPoint(KLeft,KMid)
#define KMidRightPoint TPoint(KRight,KMid)
#define KMidTopPoint TPoint(KMid,KTop)
#define KMidBottomPoint TPoint(KMid,KBottom)
// ================= MEMBER FUNCTIONS =======================
/**
* Called by the framework to draw this control. Clears the area in
* aRect and draws a star in it
* @param aRect in which to draw
*/
void CCustomCtrlDlgCustomControl::Draw(const TRect& aRect) const
{
CWindowGc& gc=SystemGc();
gc.SetPenColor(KRgbBlack);
gc.SetBrushColor(KRgbWhite);
gc.Clear(aRect);
gc.DrawRect(aRect);
gc.DrawLine(KBottomLeftPoint, KTopRightPoint);
gc.DrawLine(KTopLeftPoint, KBottomRightPoint);
gc.DrawLine(KMidLeftPoint, KMidRightPoint);
gc.DrawLine(KMidTopPoint, KMidBottomPoint);
}
/**
* Sets the minimum required size for the control.
* It should be overridden if the control is to be displayed
* inside a dialog.
*/
TSize CCustomCtrlDlgCustomControl::MinimumSize()
{
return TSize(KWidth,KHeight);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -