Nokia N97 SDK
Example Applications Guide

SimpleCubePbufferAppUi.cpp

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

© Nokia 2009

Back to top