|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
00001 /* 00002 * ============================================================================== 00003 * Name : SimpleCubePbufferAppUi.cpp 00004 * Part of : OpenGLEx / SimpleCubePbuffer 00005 * Interface : 00006 * Description : 00007 * Version : 00008 * 00009 * Copyright (c) 2004-2006 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. 00013 * ============================================================================== 00014 */ 00015 00016 00017 // INCLUDE FILES 00018 #include "SimpleCubePbufferAppUi.h" 00019 #include "SimpleCubePbufferContainer.h" 00020 #include <SimpleCubePbuffer.rsg> 00021 #include "simplecubepbuffer.hrh" 00022 00023 #include <avkon.hrh> 00024 00025 // ================= MEMBER FUNCTIONS ======================= 00026 // 00027 // ---------------------------------------------------------- 00028 // CSimpleCubePbufferAppUi::ConstructL 00029 // 00030 // ---------------------------------------------------------- 00031 // 00032 void CSimpleCubePbufferAppUi::ConstructL() 00033 { 00034 BaseConstructL(); 00035 00036 iAppContainer = new (ELeave) CSimpleCubePbufferContainer; 00037 iAppContainer->SetMopParent( this ); 00038 iAppContainer->ConstructL( ClientRect() ); 00039 AddToStackL( iAppContainer ); 00040 } 00041 00042 // ---------------------------------------------------- 00043 // CSimpleCubePbufferAppUi::~CSimpleCubePbufferAppUi 00044 // Destructor 00045 // Frees reserved resources 00046 // ---------------------------------------------------- 00047 // 00048 CSimpleCubePbufferAppUi::~CSimpleCubePbufferAppUi() 00049 { 00050 if ( iAppContainer ) 00051 { 00052 RemoveFromStack( iAppContainer ); 00053 delete iAppContainer; 00054 } 00055 } 00056 00057 // ------------------------------------------------------------------------------ 00058 // CSimpleCubePbufferAppUi::DynInitMenuPaneL 00059 // This function is called by the EIKON framework just before it displays 00060 // a menu pane. Its default implementation is empty, and by overriding it, 00061 // the application can set the state of menu items dynamically according 00062 // to the state of application data. 00063 // ------------------------------------------------------------------------------ 00064 // 00065 void CSimpleCubePbufferAppUi::DynInitMenuPaneL( 00066 TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/) 00067 { 00068 } 00069 00070 // ---------------------------------------------------- 00071 // CSimpleCubePbufferAppUi::HandleKeyEventL 00072 // takes care of key event handling 00073 // ---------------------------------------------------- 00074 // 00075 TKeyResponse CSimpleCubePbufferAppUi::HandleKeyEventL( 00076 const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/) 00077 { 00078 return EKeyWasNotConsumed; 00079 } 00080 00081 // ---------------------------------------------------- 00082 // CSimpleCubePbufferAppUi::HandleCommandL 00083 // takes care of command handling 00084 // ---------------------------------------------------- 00085 // 00086 void CSimpleCubePbufferAppUi::HandleCommandL(TInt aCommand) 00087 { 00088 switch ( aCommand ) 00089 { 00090 case EAknSoftkeyBack: 00091 case EEikCmdExit: 00092 { 00093 Exit(); 00094 break; 00095 } 00096 case ESimpleCubeFlat: 00097 iAppContainer->iSimpleCubePbuffer->FlatShading(); 00098 break; 00099 case ESimpleCubeSmooth: 00100 iAppContainer->iSimpleCubePbuffer->SmoothShading(); 00101 break; 00102 default: 00103 break; 00104 } 00105 } 00106 00107 // End of File
|
© Nokia 2006 |