⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 customctrldlgcustomcontrol.cpp

📁 series60 应用程序开发的源代码 series60 应用程序开发的源代码
💻 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 + -