|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
#include <SimpleLightAppUi.h>
Public Member Functions | |
| void | ConstructL () |
| virtual | ~CSimpleLightAppUi () |
Private Member Functions | |
| void | DynInitMenuPaneL (TInt aResourceId, CEikMenuPane *aMenuPane) |
| void | HandleCommandL (TInt aCommand) |
| virtual TKeyResponse | HandleKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType) |
Private Attributes | |
| CSimpleLightContainer * | iAppContainer |
Definition at line 36 of file SimpleLightAppUi.h.
|
|
Destructor. Removes CSimpleLightContainer from the control stack and destroys it. Definition at line 42 of file SimpleLightAppUi.cpp. References iAppContainer. 00043 { 00044 if ( iAppContainer ) 00045 { 00046 RemoveFromStack( iAppContainer ); 00047 delete iAppContainer; 00048 } 00049 }
|
|
|
Second phase constructor. Creates the CSimpleLightContainer and adds it to the control stack. Definition at line 32 of file SimpleLightAppUi.cpp. References CSimpleLightContainer::ConstructL(), and iAppContainer. 00033 { 00034 BaseConstructL(); 00035 iAppContainer = new (ELeave) CSimpleLightContainer; 00036 iAppContainer->SetMopParent(this); 00037 iAppContainer->ConstructL( ClientRect() ); 00038 AddToStackL( iAppContainer ); 00039 }
|
|
||||||||||||
|
This method is called by the EIKON framework just before it displays a menu pane. Builds the dynamic menuitems for toggling the lights on and off in the example. Definition at line 59 of file SimpleLightAppUi.cpp. References iAppContainer, CSimpleLight::iLampEnabled, CSimpleLight::iLightingEnabled, CSimpleLightContainer::iSimpleLight, and CSimpleLight::iSpotEnabled. 00061 { 00062 // Item texts for the lighting menu. 00063 if ( aResourceId == R_SIMPLELIGHT_LIGHTING_MENU ) 00064 { 00065 // Text for switching the lights on/off. 00066 if ( iAppContainer->iSimpleLight->iLightingEnabled ) 00067 { 00068 aMenuPane->SetItemTextL( ESimpleLightLights, R_LIGHTS_OFF ); 00069 } 00070 else 00071 { 00072 aMenuPane->SetItemTextL( ESimpleLightLights, R_LIGHTS_ON ); 00073 } 00074 00075 // Text for switching the lamp on/off. 00076 if ( iAppContainer->iSimpleLight->iLampEnabled ) 00077 { 00078 aMenuPane->SetItemTextL( ESimpleLightLamp, R_LAMP_OFF ); 00079 } 00080 else 00081 { 00082 aMenuPane->SetItemTextL( ESimpleLightLamp, R_LAMP_ON ); 00083 } 00084 00085 // Text for switching the spot on/off. 00086 if ( iAppContainer->iSimpleLight->iSpotEnabled ) 00087 { 00088 aMenuPane->SetItemTextL( ESimpleLightSpot, R_SPOT_OFF ); 00089 } 00090 else 00091 { 00092 aMenuPane->SetItemTextL( ESimpleLightSpot, R_SPOT_ON ); 00093 } 00094 } 00095 }
|
|
|
CEikAppUi method that is used to handle user commands. Handles menu commands and application exit request.
Definition at line 113 of file SimpleLightAppUi.cpp. References CSimpleLight::DuckModel(), CSimpleLight::HeadModel(), iAppContainer, CSimpleLightContainer::iSimpleLight, CSimpleLight::ToggleLamp(), CSimpleLight::ToggleLighting(), and CSimpleLight::ToggleSpot(). 00114 { 00115 switch ( aCommand ) 00116 { 00117 case EAknSoftkeyBack: 00118 case EEikCmdExit: 00119 { 00120 Exit(); 00121 break; 00122 } 00123 case ESimpleLightLights: 00124 iAppContainer->iSimpleLight->ToggleLighting(); 00125 break; 00126 case ESimpleLightLamp: 00127 iAppContainer->iSimpleLight->ToggleLamp(); 00128 break; 00129 case ESimpleLightSpot: 00130 iAppContainer->iSimpleLight->ToggleSpot(); 00131 break; 00132 case ESimpleLightDuck: 00133 iAppContainer->iSimpleLight->DuckModel(); 00134 break; 00135 case ESimpleLightHead: 00136 iAppContainer->iSimpleLight->HeadModel(); 00137 break; 00138 default: 00139 break; 00140 } 00141 }
|
|
||||||||||||
|
CEikAppUi method that is used to handle key events. Does nothing in this implemenation.
Definition at line 102 of file SimpleLightAppUi.cpp.
|
|
|
GUI container that resides in this application UI. Definition at line 81 of file SimpleLightAppUi.h. |
|
© Nokia 2006 |