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

📄 basicdrawcontainer3.cpp

📁 《基于symbian os的手机开发与应用》
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CBasicDrawContainer3 from BasicDrawContainer2.cpp
*  Part of  : BasicDraw
*  Created  : 2006-4-15 by Hewei
*  Implementation notes:
*     Initial content was generated by Series 60 AppWizard.
*  Version  :
*  Copyright: Myself
* ============================================================================
*/

// INCLUDE FILES
#include "BasicDrawContainer3.h"
#include <gdi.h>
#include <aknutils.h> 
#include <stringloader.h>
#include <basicdraw.rsg>
//color:
const TInt KColorBlue=210;
const TInt KColorRed=35;
const TInt KColorGreen=185;
const TInt KColorYellow=5;
const TInt KColorBlack=215;

// ================= MEMBER FUNCTIONS =======================

// ---------------------------------------------------------
// CBasicDrawContainer2::ConstructL(const TRect& aRect)
// EPOC two phased constructor
// ---------------------------------------------------------
//
void CBasicDrawContainer3::ConstructL(const TRect& aRect)
    {
    CreateWindowL();


    SetRect(aRect);
    ActivateL();
    }

// Destructor
CBasicDrawContainer3::~CBasicDrawContainer3()
    {
    }

// ---------------------------------------------------------
// CBasicDrawContainer3::SizeChanged()
// Called by framework when the view size is changed
// ---------------------------------------------------------
//
void CBasicDrawContainer3::SizeChanged()
    {
    

    }

// ---------------------------------------------------------
// CBasicDrawContainer2::CountComponentControls() const
// ---------------------------------------------------------
//
TInt CBasicDrawContainer3::CountComponentControls() const
    {
    return 0; // return nbr of controls inside this container
    }

// ---------------------------------------------------------
// CBasicDrawContainer3::ComponentControl(TInt aIndex) const
// ---------------------------------------------------------
//
CCoeControl* CBasicDrawContainer3::ComponentControl(TInt aIndex) const
    {
    switch ( aIndex )
        {
        case 0:
         
        default:
            return NULL;
        }
    }

// ---------------------------------------------------------
// CBasicDrawContainer3::Draw(const TRect& aRect) const
// ---------------------------------------------------------
//
void CBasicDrawContainer3::Draw(const TRect& aRect) const
    {
    CWindowGc& gc = SystemGc();
    gc.Clear(aRect);
    
	TRgb colorRed=AKN_LAF_COLOR(KColorRed);
    gc.SetPenStyle( CGraphicsContext::ENullPen );
    gc.SetPenColor( colorRed );
    gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
    //Draw Text
    TPoint textPoint(aRect.Width()/3,aRect.Height()/3);
	TBuf<20> text;
	StringLoader::Load(text,R_APP_TEXT);
	const CFont* normalFont=iEikonEnv->NormalFont();
	gc.UseFont(normalFont);
	gc.DrawText(text,textPoint);
    gc.DiscardFont();
    

    }

// ---------------------------------------------------------
// CBasicDrawContainer3::HandleControlEventL(
//     CCoeControl* aControl,TCoeEvent aEventType)
// ---------------------------------------------------------
//
void CBasicDrawContainer3::HandleControlEventL(
    CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
    {
    // TODO: Add your control event handler code here
    }


// End of File  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -