www.pudn.com > SystemSounds_Example_v1_0.zip > SystemSoundsContainer.cpp


/* 
* ============================================================================ 
*  Name     : CSystemSoundsContainer from SystemSoundsContainer.h 
*  Part of  : SystemSounds 
*  Created  : 06/12/2003 by Forum Nokia 
*  Implementation notes: 
*     Initial content was generated by Nokia Series 60 AppWizard. 
*  Version  : 
*  Copyright: Nokia 
* ============================================================================ 
*/ 
 
// INCLUDE FILES 
#include "SystemSoundsContainer.h" 
 
#include   // for example label control 
 
// ================= MEMBER FUNCTIONS ======================= 
 
// --------------------------------------------------------- 
// CSystemSoundsContainer::ConstructL(const TRect& aRect) 
// EPOC two phased constructor 
// --------------------------------------------------------- 
// 
void CSystemSoundsContainer::ConstructL(const TRect& aRect) 
    { 
    CreateWindowL(); 
 
    iLabel = new (ELeave) CEikLabel; 
    iLabel->SetContainerWindowL( *this ); 
    iLabel->SetTextL( _L("CAknKeySounds") ); 
 
    iToDoLabel = new (ELeave) CEikLabel; 
    iToDoLabel->SetContainerWindowL( *this ); 
    iToDoLabel->SetTextL( _L("example") ); 
 
    SetRect(aRect); 
    ActivateL(); 
    } 
 
// Destructor 
CSystemSoundsContainer::~CSystemSoundsContainer() 
    { 
    delete iLabel; 
    delete iToDoLabel; 
    } 
 
// --------------------------------------------------------- 
// CSystemSoundsContainer::SizeChanged() 
// Called by framework when the view size is changed 
// --------------------------------------------------------- 
// 
void CSystemSoundsContainer::SizeChanged() 
    { 
    // TODO: Add here control resize code etc. 
    iLabel->SetExtent( TPoint(10,10), iLabel->MinimumSize() ); 
    iToDoLabel->SetExtent( TPoint(10,50), iToDoLabel->MinimumSize() ); 
    } 
 
// --------------------------------------------------------- 
// CSystemSoundsContainer::CountComponentControls() const 
// --------------------------------------------------------- 
// 
TInt CSystemSoundsContainer::CountComponentControls() const 
    { 
    return 2; // return nbr of controls inside this container 
    } 
 
// --------------------------------------------------------- 
// CSystemSoundsContainer::ComponentControl(TInt aIndex) const 
// --------------------------------------------------------- 
// 
CCoeControl* CSystemSoundsContainer::ComponentControl(TInt aIndex) const 
    { 
    switch ( aIndex ) 
        { 
        case 0: 
            return iLabel; 
        case 1: 
            return iToDoLabel; 
        default: 
            return NULL; 
        } 
    } 
 
// --------------------------------------------------------- 
// CSystemSoundsContainer::Draw(const TRect& aRect) const 
// --------------------------------------------------------- 
// 
void CSystemSoundsContainer::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); 
    } 
 
// --------------------------------------------------------- 
// CSystemSoundsContainer::HandleControlEventL( 
//     CCoeControl* aControl,TCoeEvent aEventType) 
// --------------------------------------------------------- 
// 
void CSystemSoundsContainer::HandleControlEventL( 
    CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/) 
    { 
    // TODO: Add your control event handler code here 
    } 
 
// End of File