S60 3rd Edition SDK for Symbian OS
Example Applications Guide

SimpleCubeAppUi.cpp

00001 /*
00002 * ==============================================================================
00003 *  Name        : SimpleCubeAppUi.cpp
00004 *  Part of     : OpenGLEx / SimpleCube
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 "SimpleCubeAppUi.h"
00019 #include "SimpleCubeContainer.h" 
00020 #include <SimpleCube.rsg>
00021 #include "simplecube.hrh"
00022 
00023 #include <avkon.hrh>
00024 
00025 // ================= MEMBER FUNCTIONS =======================
00026 //
00027 // ----------------------------------------------------------
00028 // CSimpleCubeAppUi::ConstructL()
00029 // ----------------------------------------------------------
00030 //
00031 void CSimpleCubeAppUi::ConstructL()
00032     {
00033     BaseConstructL();
00034     iAppContainer = new (ELeave) CSimpleCubeContainer;
00035     iAppContainer->SetMopParent(this);
00036     iAppContainer->ConstructL( ClientRect() );
00037     AddToStackL( iAppContainer );
00038     }
00039 
00040 // ----------------------------------------------------
00041 // CSimpleCubeAppUi::~CSimpleCubeAppUi()
00042 // Destructor
00043 // Frees reserved resources
00044 // ----------------------------------------------------
00045 //
00046 CSimpleCubeAppUi::~CSimpleCubeAppUi()
00047 {
00048     if ( iAppContainer )
00049         {
00050         RemoveFromStack( iAppContainer );
00051         delete iAppContainer;
00052         }
00053 }
00054 
00055 // ------------------------------------------------------------------------------
00056 // CSimpleCubeAppUi::::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
00057 //  This function is called by the EIKON framework just before it displays
00058 //  a menu pane. Its default implementation is empty, and by overriding it,
00059 //  the application can set the state of menu items dynamically according
00060 //  to the state of application data.
00061 // ------------------------------------------------------------------------------
00062 //
00063 void CSimpleCubeAppUi::DynInitMenuPaneL(
00064     TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
00065     {
00066     }
00067 
00068 // ----------------------------------------------------
00069 // CSimpleCubeAppUi::HandleKeyEventL(
00070 //     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
00071 // Key event handler
00072 // ----------------------------------------------------
00073 //
00074 TKeyResponse CSimpleCubeAppUi::HandleKeyEventL(
00075     const TKeyEvent& /*aKeyEvent*/ ,TEventCode /*aType*/)
00076 {
00077     return EKeyWasNotConsumed;
00078 }
00079 
00080 // ----------------------------------------------------
00081 // CSimpleCubeAppUi::HandleCommandL(TInt aCommand)
00082 // Command handler
00083 // ----------------------------------------------------
00084 //
00085 void CSimpleCubeAppUi::HandleCommandL(TInt aCommand)
00086     {
00087     switch ( aCommand )
00088         {
00089         case EAknSoftkeyBack:
00090         case EEikCmdExit:
00091             {
00092             Exit();
00093             break;
00094             }
00095         case ESimpleCubeFlat:
00096             iAppContainer->iSimpleCube->FlatShading();
00097             break;
00098         case ESimpleCubeSmooth:
00099             iAppContainer->iSimpleCube->SmoothShading();
00100             break;
00101         case ESimpleCubeTriangles:
00102             iAppContainer->iSimpleCube->TriangleMode();
00103             break;
00104         case ESimpleCubeTriangleFans:
00105             iAppContainer->iSimpleCube->TriangleFanMode();
00106             break;
00107         default:
00108             break;      
00109         }
00110     }
00111 
00112 // End of File  

© Nokia 2006

Back to top