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

📄 toneplayercontainer.cpp

📁 《基于Symbian OS的手机开发与应用实践》这本书的配套源码。
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CTonePlayerContainer from TonePlayerContainer.h
*  Part of  : TonePlayer
*  Created  : 31.01.2006 by ToBeReplacedByAuthor
*  Implementation notes:
*     Initial content was generated by Series 60 Application Wizard.
*  Version  :
*  Copyright: ToBeReplacedByCopyright
* ============================================================================
*/

// INCLUDE FILES
#include <coemain.h>
#include <eiklabel.h>
#include <TonePlayer.rsg>

#include "TonePlayerContainer.h"


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

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

    HBufC* tip = iCoeEnv->AllocReadResourceLC(R_QTN_APPL_HOWTOPLAY);
    iLabel = new (ELeave) CEikLabel;
    iLabel->SetContainerWindowL( *this );
    iLabel->SetTextL(*tip);
    CleanupStack::PopAndDestroy(); // tip

    SetRect(aRect);
    ActivateL();
    }

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


// ---------------------------------------------------------
// CTonePlayerContainer::SizeChanged()
// Called by framework when the view size is changed
// ---------------------------------------------------------
//
void CTonePlayerContainer::SizeChanged()
    {
    // TODO: Add here control resize code etc.
    iLabel->SetExtent( TPoint(10,10), iLabel->MinimumSize() );
    }

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

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

// ---------------------------------------------------------
// CTonePlayerContainer::Draw(const TRect& aRect) const
// ---------------------------------------------------------
//
void CTonePlayerContainer::Draw(const TRect& aRect) const
    {
    CWindowGc& gc = SystemGc();
    // TODO: Add your drawing code here
    // 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 + -