Nokia N97 SDK
Example Applications Guide

CPickSelectAppUi Class Reference

#include <PickSelectAppUi.h>

Inheritance diagram for CPickSelectAppUi:

List of all members.

Detailed Description

Application UI class that contains the CPickSelectContainer (as required by the Symbian UI application architecture).

Definition at line 33 of file PickSelectAppUi.h.


Public Member Functions

void  ConstructL ()
virtual  ~CPickSelectAppUi ()

Private Member Functions

void  DynInitMenuPaneL (TInt aResourceId, CEikMenuPane *aMenuPane)
void  HandleCommandL (TInt aCommand)
virtual TKeyResponse  HandleKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType)

Private Attributes

CPickSelectContainer *  iAppContainer


Constructor & Destructor Documentation

CPickSelectAppUi::~CPickSelectAppUi (   )  [virtual]
 

Destructor. Removes CPickSelectContainer from the control stack and destroys it.

Definition at line 38 of file PickSelectAppUi.cpp.

References iAppContainer.

00039     {
00040     if ( iAppContainer )
00041         {
00042         RemoveFromStack( iAppContainer );
00043         delete iAppContainer;
00044         }
00045    }


Member Function Documentation

void CPickSelectAppUi::ConstructL (   ) 
 

Second phase constructor. Creates the CPickSelectContainer and adds it to the control stack.

Definition at line 28 of file PickSelectAppUi.cpp.

References CPickSelectContainer::ConstructL(), and iAppContainer.

00029     {
00030     BaseConstructL();
00031     iAppContainer = new (ELeave) CPickSelectContainer;
00032     iAppContainer->SetMopParent(this);
00033     iAppContainer->ConstructL( ClientRect(), this );
00034     AddToStackL( iAppContainer );
00035     }

void CPickSelectAppUi::DynInitMenuPaneL (  TInt  aResourceId,
CEikMenuPane *  aMenuPane
)  [private]
 

This method is called by the EIKON framework just before it displays a menu pane. Does nothing in this implemenation.

Definition at line 55 of file PickSelectAppUi.cpp.

00057     {
00058     }

void CPickSelectAppUi::HandleCommandL (  TInt  aCommand  )  [private]
 

CEikAppUi method that is used to handle user commands. Handles menu commands and application exit request.

Parameters:
aCommand  Command to be handled.

Definition at line 126 of file PickSelectAppUi.cpp.

References iAppContainer, CPickSelectContainer::iPickSelect, CPickSelect::SetObjectSelection(), and CPickSelect::SetPolygonSelection().

00127     {
00128     switch ( aCommand )
00129         {
00130         case EAknSoftkeyBack:
00131         case EEikCmdExit:
00132             {
00133             Exit();
00134             break;
00135             }
00136         case EPickSelectPolygon:
00137             {
00138             iAppContainer->iPickSelect->SetPolygonSelection();
00139             break;
00140             }
00141         case EPickSelectObject:
00142             {
00143             iAppContainer->iPickSelect->SetObjectSelection();
00144             break;
00145             }
00146         default:
00147             break;
00148         }
00149     }

TKeyResponse CPickSelectAppUi::HandleKeyEventL (  const TKeyEvent &  aKeyEvent,
TEventCode  aType
)  [private, virtual]
 

CEikAppUi method that is used to handle key events. Does nothing in this implemenation.

Parameters:
aKeyEvent  Event to handled (ignored by this implementation).
aType  Type of the key event (ignored by this implementation).
Returns:
Response code. Always EKeyWasNotConsumed in this implementation.

Definition at line 65 of file PickSelectAppUi.cpp.

References iAppContainer, CPickSelectContainer::iPickSelect, CPickSelect::MoveDown(), CPickSelect::MoveLeft(), CPickSelect::MoveRight(), CPickSelect::MoveUp(), and CPickSelect::SelectObject().

00067     {
00068     if ( aType == EEventKeyDown )
00069         {
00070         TUint scan = aKeyEvent.iScanCode;
00071 
00072         switch ( scan )
00073             {
00074             case(EStdKeyUpArrow):
00075                 iAppContainer->iPickSelect->MoveUp(ETrue);
00076                 return EKeyWasConsumed;
00077             case(EStdKeyDownArrow):
00078                 iAppContainer->iPickSelect->MoveDown(ETrue);
00079                 return EKeyWasConsumed;
00080             case(EStdKeyLeftArrow):
00081                 iAppContainer->iPickSelect->MoveLeft(ETrue);
00082                 return EKeyWasConsumed;
00083             case(EStdKeyRightArrow):
00084                 iAppContainer->iPickSelect->MoveRight(ETrue);
00085                 return EKeyWasConsumed;
00086             case(EStdKeyDevice3):  // Rocker Middle Button
00087                 iAppContainer->iPickSelect->SelectObject();
00088                 return EKeyWasConsumed;
00089             default:
00090                 return EKeyWasNotConsumed;
00091             }
00092         }
00093     else if ( aType == EEventKeyUp )
00094         {
00095         TUint scan = aKeyEvent.iScanCode;
00096 
00097         switch ( scan )
00098             {
00099             case(16):
00100                 iAppContainer->iPickSelect->MoveUp(EFalse);
00101                 return EKeyWasConsumed;
00102             case(17):
00103                 iAppContainer->iPickSelect->MoveDown(EFalse);
00104                 return EKeyWasConsumed;
00105             case(14):
00106                 iAppContainer->iPickSelect->MoveLeft(EFalse);
00107                 return EKeyWasConsumed;
00108             case(15):
00109                 iAppContainer->iPickSelect->MoveRight(EFalse);
00110                 return EKeyWasConsumed;
00111             default:
00112                 return EKeyWasNotConsumed;
00113             }
00114         }
00115     else
00116         {
00117         return EKeyWasNotConsumed;
00118         }
00119     }


Member Data Documentation

CPickSelectContainer* CPickSelectAppUi::iAppContainer [private]
 

GUI container that resides in this application UI.

Definition at line 77 of file PickSelectAppUi.h.

Referenced by ConstructL(), HandleCommandL(), HandleKeyEventL(), and ~CPickSelectAppUi().


The documentation for this class was generated from the following files:

© Nokia 2009

Back to top