S60UIExampleappui.cpp
上传用户:laixiong
上传日期:2007-03-11
资源大小:2994k
文件大小:2k
- // Copyright (c) 2006 Nokia Corporation.
- #include <e32std.h>
- #include "S60UIExample.pan"
- #include "S60UIExampleAppUi.h"
- #include "S60UIExampleInitialView.h"
- #include "S60UIExamplePlayView.h"
- #include "S60UIExampleHighScoreView.h"
- #include "S60UIExampleModel.h"
- #include "S60UIExampleSettingsView.h"
- // -----------------------------------------------------------------------------
- // CS60UIExampleAppUi::ConstructL()
- // Symbian 2nd phase constructor can leave.
- // -----------------------------------------------------------------------------
- //
- void CS60UIExampleAppUi::ConstructL()
- {
- // Initialise app UI
- BaseConstructL(CAknAppUi::EAknEnableSkin);
-
- // Create a model to hold data
- iModel = CS60UIExampleModel::NewL();
-
- // Creates views
- iAppInitialView = CS60UIExampleInitialView::NewL(*iModel);
- iAppPlayView = CS60UIExamplePlayView::NewL(*iModel);
- iAppHighScoreView = CS60UIExampleHighScoreView::NewL(*iModel);
- iAppSettingsView = CS60UIExampleSettingsView::NewL();
- // Transfer ownership to base class
- AddViewL(iAppInitialView);
- AddViewL(iAppPlayView);
- AddViewL(iAppHighScoreView);
- AddViewL(iAppSettingsView);
- SetDefaultViewL(*iAppInitialView);
- }
- CS60UIExampleAppUi::~CS60UIExampleAppUi()
- {
- delete iModel;
- }
-
- // -----------------------------------------------------------------------------
- // CS60UIExampleAppUi::HandleCommandL()
- // Takes care of command handling.
- // -----------------------------------------------------------------------------
- //
- void CS60UIExampleAppUi::HandleCommandL(TInt aCommand)
- {
- switch (aCommand)
- {
- case EEikCmdExit:
- case EAknSoftkeyExit:
- Exit();
- break;
-
- default:
- Panic(ES60UIExampleBasicUi);
- break;
-
- }
- }
- // End of File