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