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. // -----------------------------------------------------------------------------
  10. // CS60UIExampleAppUi::ConstructL()
  11. // Symbian 2nd phase constructor can leave.
  12. // -----------------------------------------------------------------------------
  13. //
  14. void CS60UIExampleAppUi::ConstructL()
  15.     {
  16.     // Initialise app UI
  17.     BaseConstructL();
  18.     
  19.     // Create a model to hold data
  20.     iModel = CS60UIExampleModel::NewL();
  21.     
  22.     // Creates views
  23.     iAppInitialView = CS60UIExampleInitialView::NewL(*iModel);
  24.     iAppPlayView = CS60UIExamplePlayView::NewL(*iModel);
  25.     iAppHighScoreView = CS60UIExampleHighScoreView::NewL(*iModel);
  26.     // Transfer ownership to base class
  27.     AddViewL(iAppInitialView);
  28.     AddViewL(iAppPlayView);
  29.     AddViewL(iAppHighScoreView);
  30.     SetDefaultViewL(*iAppInitialView);
  31.     }
  32. CS60UIExampleAppUi::~CS60UIExampleAppUi()
  33.     {
  34.     delete iModel;
  35.     }
  36.     
  37. // -----------------------------------------------------------------------------
  38. // CS60UIExampleAppUi::HandleCommandL()
  39. // Takes care of command handling.
  40. // -----------------------------------------------------------------------------
  41. //
  42. void CS60UIExampleAppUi::HandleCommandL(TInt aCommand)
  43.     {
  44.     switch (aCommand)
  45.         {
  46.         case EEikCmdExit:
  47.         case EAknSoftkeyExit:
  48.             Exit();
  49.             break;
  50.             
  51.         default:
  52.             Panic(ES60UIExampleBasicUi);
  53.             break;
  54.             
  55.         }
  56.     }
  57. // End of File