S60 3rd Edition SDK for Symbian OS
Example Applications Guide

CHWRMTestAppContainer Class Reference

#include <HWRMTestAppContainer.h>

List of all members.

Public Member Functions

void ConstructL (const TRect &aRect)
 ~CHWRMTestAppContainer ()
void AddMessageL (const TDesC &aMsg) const
TKeyResponse OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType)

Private Member Functions

void SizeChanged ()
TInt CountComponentControls () const
CCoeControl * ComponentControl (TInt aIndex) const
void Draw (const TRect &aRect) const
virtual void HandleResourceChange (TInt aType)
void HandleControlEventL (CCoeControl *aControl, TCoeEvent aEventType)

Private Attributes

CAknSingleStyleListBox * iListBox
CEikLabel * iLabel


Detailed Description

CHWRMTestAppContainer container control class.

HWRMTestApp.exe

Since:
Series S60 3.0

Definition at line 35 of file HWRMTestAppContainer.h.


Constructor & Destructor Documentation

CHWRMTestAppContainer::~CHWRMTestAppContainer (   ) 
 

Destructor.

Definition at line 58 of file HWRMTestAppContainer.cpp.

References iLabel, and iListBox.

00059     {
00060     delete iListBox;
00061     delete iLabel;
00062     }


Member Function Documentation

void CHWRMTestAppContainer::ConstructL (  const TRect &  aRect  ) 
 

EPOC default constructor.

Parameters:
aRect Frame rectangle for container.

Definition at line 33 of file HWRMTestAppContainer.cpp.

References iLabel, and iListBox.

00034     {
00035     CreateWindowL();
00036 
00037     iListBox = new(ELeave) CAknSingleStyleListBox();
00038     iListBox->ConstructL( this, EEikListBoxMultipleSelection );
00039     
00040     iListBox->CreateScrollBarFrameL(ETrue);
00041     iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOn,
00042                                                         CEikScrollBarFrame::EAuto);
00043     
00044     iLabel = new (ELeave) CEikLabel;
00045     iLabel->SetContainerWindowL( *this );
00046     _LIT( KLabel, "HWRM Test:");
00047     iLabel->SetTextL( KLabel );
00048 
00049     SetRect(aRect);
00050     ActivateL();
00051     }

void CHWRMTestAppContainer::SizeChanged (   )  [private]
 

From CoeControl,SizeChanged.

Definition at line 69 of file HWRMTestAppContainer.cpp.

References iLabel, and iListBox.

00070     {
00071     // set the label position
00072     iLabel->SetExtent( TPoint(0,0), iLabel->MinimumSize() );
00073     
00074     // get the label height so we can position listbox correctly
00075     TInt labelHeight = iLabel->Rect().Height();
00076 
00077     // create a fixed border size
00078     TInt border(5);
00079     // create the listbox size taking into account the border and label size
00080     TSize listBoxSize( Rect().Width() - (2 * border),
00081                        Rect().Height() - labelHeight - (2 * border));
00082     // set the listbox position
00083     iListBox->SetExtent( TPoint(border,labelHeight + border), listBoxSize );
00084     }

TInt CHWRMTestAppContainer::CountComponentControls (   )  const [private]
 

From CoeControl,CountComponentControls.

Definition at line 91 of file HWRMTestAppContainer.cpp.

00092     {
00093     return 2; // return nbr of controls inside this container
00094     }

CCoeControl * CHWRMTestAppContainer::ComponentControl (  TInt  aIndex  )  const [private]
 

From CCoeControl,ComponentControl.

Definition at line 101 of file HWRMTestAppContainer.cpp.

References iLabel, and iListBox.

00102     {
00103     switch ( aIndex )
00104         {
00105         case 0:
00106             return iListBox;
00107         case 1:
00108             return iLabel;
00109         default:
00110             return NULL;
00111         }
00112     }

void CHWRMTestAppContainer::Draw (  const TRect &  aRect  )  const [private]
 

From CCoeControl,Draw.

Definition at line 118 of file HWRMTestAppContainer.cpp.

00119     {
00120     CWindowGc& gc = SystemGc();
00121     gc.SetPenStyle(CGraphicsContext::ENullPen);
00122     gc.SetBrushColor(KRgbGray);
00123     gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
00124     gc.DrawRect(aRect);
00125     }

void CHWRMTestAppContainer::HandleResourceChange (  TInt  aType  )  [private, virtual]
 

From CoeControl, HandleResourceChange. Called by framework when the view layout is changed.

Definition at line 186 of file HWRMTestAppContainer.cpp.

References iListBox.

00187     {
00188     CCoeControl::HandleResourceChange(aType);
00189 
00190     // ADDED FOR SCALABLE UI SUPPORT
00191     // *****************************
00192     if ( aType==KEikDynamicLayoutVariantSwitch )
00193         {
00194         TRect rect;
00195         AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
00196         SetRect(rect);
00197         }
00198     
00199     // Redraw the listbox
00200     iListBox->DrawNow();
00201     }

void CHWRMTestAppContainer::HandleControlEventL (  CCoeControl *  aControl,
TCoeEvent  aEventType
)  [private]
 

From MCoeControlObserver, HandleControlEventL. Handles an event from an observed control.

Definition at line 131 of file HWRMTestAppContainer.cpp.

00133     {
00134     }


© Nokia 2006

Back to top