S60MemoryLabAppUi.cpp
上传用户:laixiong
上传日期:2007-03-11
资源大小:2994k
文件大小:3k
源码类别:

Symbian

开发平台:

C/C++

  1. // Copyright: (c) 2006 Nokia Ltd.  All rights reserved.
  2. // INCLUDE FILES
  3. #include "S60MemoryLabAppUi.h"
  4. #include "S60MemoryLabContainer.h" 
  5. #include <S60MemoryLab.rsg>
  6. #include "s60memorylab.hrh"
  7. #include <avkon.hrh>
  8. // ================= MEMBER FUNCTIONS =======================
  9. //
  10. // ----------------------------------------------------------
  11. // CS60MemoryLabAppUi::ConstructL()
  12. // ?implementation_description
  13. // ----------------------------------------------------------
  14. //
  15. void CS60MemoryLabAppUi::ConstructL()
  16.     {
  17.     BaseConstructL();
  18.     iAppContainer = new (ELeave) CS60MemoryLabContainer;
  19.     iAppContainer->SetMopParent(this);
  20.     iAppContainer->ConstructL( ClientRect() );
  21.     AddToStackL( iAppContainer );
  22.     }
  23. // ----------------------------------------------------
  24. // CS60MemoryLabAppUi::~CS60MemoryLabAppUi()
  25. // Destructor
  26. // Frees reserved resources
  27. // ----------------------------------------------------
  28. //
  29. CS60MemoryLabAppUi::~CS60MemoryLabAppUi()
  30.     {
  31.     if (iAppContainer)
  32.         {
  33.         RemoveFromStack( iAppContainer );
  34.         delete iAppContainer;
  35.         }
  36.    }
  37. // ------------------------------------------------------------------------------
  38. // CS60MemoryLabAppUi::::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
  39. //  This function is called by the EIKON framework just before it displays
  40. //  a menu pane. Its default implementation is empty, and by overriding it,
  41. //  the application can set the state of menu items dynamically according
  42. //  to the state of application data.
  43. // ------------------------------------------------------------------------------
  44. //
  45. void CS60MemoryLabAppUi::DynInitMenuPaneL(
  46.     TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
  47.     {
  48.     }
  49. // ----------------------------------------------------
  50. // CS60MemoryLabAppUi::HandleKeyEventL(
  51. //     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
  52. // ?implementation_description
  53. // ----------------------------------------------------
  54. //
  55. TKeyResponse CS60MemoryLabAppUi::HandleKeyEventL(
  56.     const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
  57.     {
  58.     return EKeyWasNotConsumed;
  59.     }
  60. // ----------------------------------------------------
  61. // CS60MemoryLabAppUi::HandleCommandL(TInt aCommand)
  62. // ?implementation_description
  63. // ----------------------------------------------------
  64. //
  65. void CS60MemoryLabAppUi::HandleCommandL(TInt aCommand)
  66.     {
  67.     switch ( aCommand )
  68.         {
  69.         case EAknSoftkeyBack:
  70.         case EEikCmdExit:
  71.             Exit();
  72.             break;
  73.         case ES60MemoryLabCmdToggleLabels:
  74.             iAppContainer->ToggleLabelsL();
  75.             break;
  76.         case ES60MemoryLabCmdCleanupStackTest:
  77.             iAppContainer->CleanupStackTestL();
  78.             break;
  79.         default:
  80.             break;      
  81.         }
  82.     }
  83. // -----------------------------------------------------------------------------
  84. // CS60MemoryLabAppUi::HandleScreenDeviceChangedL
  85. // Handle change in screen resolution.
  86. // -----------------------------------------------------------------------------
  87. //
  88. void CS60MemoryLabAppUi::HandleScreenDeviceChangedL()
  89.     {
  90.     CAknAppUi::HandleScreenDeviceChangedL();
  91.     // Reposition the container
  92.     if ( iAppContainer )
  93.         {
  94.         iAppContainer->SetRect(ClientRect());
  95.         }
  96.     }
  97.     
  98. // End of File