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

📄 phonebkexcontainer2.cpp

📁 基于Symbian OS
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CPhoneBkExContainer2 from PhoneBkExContainer2.cpp
*  Part of  : PhoneBkEx
*  Created  : 13/06/2003 by 
*  Implementation notes:
*     Initial content was generated by Series 60 AppWizard.
*  Version  :
*  Copyright: Forum Nokia
* ============================================================================
*/

// INCLUDE FILES
#include "PhoneBkExContainer2.h"

#include <eiklabel.h>  // for example label control
#include <stringloader.h>
#include <PhoneBkEx.rsg>
const TInt KLabelCoOrdinate = 10;
// ================= MEMBER FUNCTIONS =======================

// ---------------------------------------------------------
// CPhoneBkExContainer2::ConstructL(const TRect& aRect)
// EPOC two phased constructor
// ---------------------------------------------------------
//
void CPhoneBkExContainer2::ConstructL(const TRect& aRect)
    {
	HBufC* labelText = StringLoader::LoadLC(R_VIEW2_TEXT);

    CreateWindowL();
	
    iLabel = new (ELeave) CEikLabel;
    iLabel->SetContainerWindowL( *this );
    iLabel->SetTextL(*labelText);
	CleanupStack::PopAndDestroy();
    SetRect(aRect);
    ActivateL();
    }

// Destructor
CPhoneBkExContainer2::~CPhoneBkExContainer2()
    {
    delete iLabel;
    }

// ---------------------------------------------------------
// CPhoneBkExContainer2::SizeChanged()
// Called by framework when the view size is changed
// ---------------------------------------------------------
//
void CPhoneBkExContainer2::SizeChanged()
    {
    iLabel->SetExtent( TPoint(KLabelCoOrdinate,KLabelCoOrdinate), iLabel->MinimumSize() );
    }

// ---------------------------------------------------------
// CPhoneBkExContainer2::CountComponentControls() const
// ---------------------------------------------------------
//
TInt CPhoneBkExContainer2::CountComponentControls() const
    {
    return 1; // return nbr of controls inside this container
    }

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

// ---------------------------------------------------------
// CPhoneBkExContainer2::Draw(const TRect& aRect) const
// ---------------------------------------------------------
//
void CPhoneBkExContainer2::Draw(const TRect& aRect) const
    {
    CWindowGc& gc = SystemGc();
    // example code...
    gc.SetPenStyle(CGraphicsContext::ENullPen);
    gc.SetBrushColor(KRgbGray);
    gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
    gc.DrawRect(aRect);
    }


// End of File  

⌨️ 快捷键说明

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