S60 3rd Edition SDK FP1 for Symbian OS
Example Applications Guide

SimpleCubeAppUi.cpp

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

© Nokia 2006

Back to top