|
Nokia N97 SDK Example Applications Guide |
#include <TextureAppUi.h>
Inheritance diagram for CTextureAppUi:

Definition at line 35 of file TextureAppUi.h.
Public Member Functions |
|
| void | ConstructL () |
| virtual | ~CTextureAppUi () |
Private Member Functions |
|
| void | DynInitMenuPaneL (TInt aResourceId, CEikMenuPane *aMenuPane) |
| void | HandleCommandL (TInt aCommand) |
| virtual TKeyResponse | HandleKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType) |
Private Attributes |
|
| CTextureContainer * | iAppContainer |
|
|
Destructor. Removes CTextureContainer from the control stack and destroys it. Definition at line 46 of file TextureAppUi.cpp. References iAppContainer. 00047 { 00048 if (iAppContainer) 00049 { 00050 RemoveFromStack( iAppContainer ); 00051 delete iAppContainer; 00052 } 00053 }
|
|
|
Second phase constructor. Creates the CTextureContainer and adds it to the control stack. Definition at line 29 of file TextureAppUi.cpp. References CTextureContainer::ConstructL(), and iAppContainer. 00030 { 00031 BaseConstructL(); 00032 00033 iAppContainer = new (ELeave) CTextureContainer; 00034 iAppContainer->SetMopParent(this); 00035 00036 iAppContainer->ConstructL( ClientRect(), this ); 00037 AddToStackL( iAppContainer ); 00038 }
|
|
||||||||||||
|
This method is called by the EIKON framework just before it displays a menu pane. Builds the dynamic menuitems for toggling the various options in the example. Definition at line 63 of file TextureAppUi.cpp. References iAppContainer, CTexture::iPerspectiveCorrEnabled, CTextureContainer::iTexture, and CTexture::iTextureWrapEnabled. 00065 { 00066 /* Texts for menu items. */ 00067 if( aResourceId == R_TEXTURE_MENU ) 00068 { 00069 /* Text for perspective correction. */ 00070 if( iAppContainer->iTexture->iPerspectiveCorrEnabled ) 00071 { 00072 aMenuPane->SetItemTextL( ETexturePerspective, R_PERSPECTIVE_OFF ); 00073 } 00074 else 00075 { 00076 aMenuPane->SetItemTextL( ETexturePerspective, R_PERSPECTIVE_ON ); 00077 } 00078 00079 /* Text for texture wrapping.*/ 00080 if( iAppContainer->iTexture->iTextureWrapEnabled ) 00081 { 00082 aMenuPane->SetItemTextL( ETextureWrapping, R_WRAPPING_OFF ); 00083 } 00084 else 00085 { 00086 aMenuPane->SetItemTextL( ETextureWrapping, R_WRAPPING_ON ); 00087 } 00088 00089 /* Text for lighting.*/ 00090 if( iAppContainer->iTexture->iLightingEnabled ) 00091 { 00092 aMenuPane->SetItemTextL( ETextureLights, R_LIGHTS_OFF ); 00093 } 00094 else 00095 { 00096 aMenuPane->SetItemTextL( ETextureLights, R_LIGHTS_ON ); 00097 } 00098 } 00099 }
|
|
|
CEikAppUi method that is used to handle user commands. Handles menu commands and application exit request.
Definition at line 134 of file TextureAppUi.cpp. References iAppContainer, CTextureContainer::iTexture, CTexture::ToggleLighting(), CTexture::TogglePerspective(), and CTexture::ToggleWrapping(). 00135 { 00136 switch ( aCommand ) 00137 { 00138 case EAknSoftkeyBack: 00139 case EEikCmdExit: 00140 { 00141 Exit(); 00142 break; 00143 } 00144 case ETexturePerspective: 00145 { 00146 iAppContainer->iTexture->TogglePerspective(); 00147 break; 00148 } 00149 case ETextureWrapping: 00150 { 00151 iAppContainer->iTexture->ToggleWrapping(); 00152 break; 00153 } 00154 case ETextureLights: 00155 iAppContainer->iTexture->ToggleLighting(); 00156 break; 00157 default: 00158 break; 00159 } 00160 }
|
|
||||||||||||
|
CEikAppUi method that is used to handle key events. Does nothing in this implemenation.
Definition at line 107 of file TextureAppUi.cpp. References iAppContainer, CTextureContainer::iTexture, and CTexture::ToggleBlending(). 00109 { 00110 if ( iAppContainer->iTexture->GetState() == CTexture::ERunning ) 00111 { 00112 if( aType == EEventKeyDown ) 00113 { 00114 TUint scan = aKeyEvent.iScanCode; 00115 00116 switch(scan) 00117 { 00118 case(167): 00119 iAppContainer->iTexture->ToggleBlending(); 00120 return EKeyWasConsumed; 00121 default: 00122 return EKeyWasNotConsumed; 00123 } 00124 } 00125 } 00126 return EKeyWasNotConsumed; 00127 }
|
|
|
GUI container that resides in this application UI. Definition at line 82 of file TextureAppUi.h. Referenced by ConstructL(), DynInitMenuPaneL(), HandleCommandL(), HandleKeyEventL(), and ~CTextureAppUi(). |
|
© Nokia 2009 |