s60uiexampleappui.cpp

来自「symbianOS第三版开发与实用教程部分源码和部分试验」· C++ 代码 · 共 70 行

CPP
70
字号
// 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

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?