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.     // Transfer ownership to base class
  24.     AddViewL(iAppInitialView);
  25.     SetDefaultViewL(*iAppInitialView);
  26.     }
  27. CS60UIExampleAppUi::~CS60UIExampleAppUi()
  28.     {
  29.     delete iModel;
  30.     }
  31.     
  32. // -----------------------------------------------------------------------------
  33. // CS60UIExampleAppUi::HandleCommandL()
  34. // Takes care of command handling.
  35. // -----------------------------------------------------------------------------
  36. //
  37. void CS60UIExampleAppUi::HandleCommandL(TInt aCommand)
  38.     {
  39.     switch (aCommand)
  40.         {
  41.         case EEikCmdExit:
  42.         case EAknSoftkeyExit:
  43.             Exit();
  44.             break;
  45.             
  46.         default:
  47.             Panic(ES60UIExampleBasicUi);
  48.             break;
  49.             
  50.         }
  51.     }
  52. // End of File