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

Symbian

开发平台:

C/C++

  1. // Copyright (c) 2006 Nokia Corporation.
  2. #include <e32std.h>
  3. #include "S60UIExample.pan"
  4. #include "S60UIExampleAppUi.h"
  5. #include "S60UIExampleInitialView.h"
  6. #include "S60UIExamplePlayView.h"
  7. #include "S60UIExampleHighScoreView.h"
  8. #include "S60UIExampleModel.h"
  9. #include "S60UIExampleSettingsView.h"
  10. // -----------------------------------------------------------------------------
  11. // CS60UIExampleAppUi::ConstructL()
  12. // Symbian 2nd phase constructor can leave.
  13. // -----------------------------------------------------------------------------
  14. //
  15. void CS60UIExampleAppUi::ConstructL()
  16.     {
  17.     // Initialise app UI
  18.     BaseConstructL(CAknAppUi::EAknEnableSkin);
  19.     
  20.     // Create a model to hold data
  21.     iModel = CS60UIExampleModel::NewL();
  22.     
  23.     // Creates views
  24.     iAppInitialView = CS60UIExampleInitialView::NewL(*iModel);
  25.     iAppPlayView = CS60UIExamplePlayView::NewL(*iModel);
  26.     iAppHighScoreView = CS60UIExampleHighScoreView::NewL(*iModel);
  27.     iAppSettingsView = CS60UIExampleSettingsView::NewL();
  28.     // Transfer ownership to base class
  29.     AddViewL(iAppInitialView);
  30.     AddViewL(iAppPlayView);
  31.     AddViewL(iAppHighScoreView);
  32.     AddViewL(iAppSettingsView);
  33.     SetDefaultViewL(*iAppInitialView);
  34.     }
  35. CS60UIExampleAppUi::~CS60UIExampleAppUi()
  36.     {
  37.     delete iModel;
  38.     }
  39.     
  40. // -----------------------------------------------------------------------------
  41. // CS60UIExampleAppUi::HandleCommandL()
  42. // Takes care of command handling.
  43. // -----------------------------------------------------------------------------
  44. //
  45. void CS60UIExampleAppUi::HandleCommandL(TInt aCommand)
  46.     {
  47.     switch (aCommand)
  48.         {
  49.         case EEikCmdExit:
  50.         case EAknSoftkeyExit:
  51.             Exit();
  52.             break;
  53.             
  54.         default:
  55.             Panic(ES60UIExampleBasicUi);
  56.             break;
  57.             
  58.         }
  59.     }
  60. // End of File