⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s60uiexamplehighscoreview.cpp

📁 《Symbian S60第3版手机程序开发与实用教程》光盘源代码
💻 CPP
字号:
// Copyright (c) 2006 Nokia Corporation.

#include "S60UIExampleHighScoreContainer.h"
#include "S60UIExampleHighScoreView.h"
#include "S60UIExample.hrh"
#include <S60UIExample.rsg>
#include <aknviewappui.h>

// -----------------------------------------------------------------------------
// CS60UIExampleHighScoreView::NewL()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CS60UIExampleHighScoreView* CS60UIExampleHighScoreView::NewL(CS60UIExampleModel& aModel)
    {
    CS60UIExampleHighScoreView* self = 
            new (ELeave) CS60UIExampleHighScoreView(aModel);
    CleanupStack::PushL (self);
    self->ConstructL();
    CleanupStack::Pop();
    return self;
    }

// -----------------------------------------------------------------------------
// CS60UIExampleHighScoreView::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CS60UIExampleHighScoreView::ConstructL()
    {
    BaseConstructL (R_S60UIEXAMPLE_HIGHSCORE_VIEW);
    }

// -----------------------------------------------------------------------------
// CS60UIExampleHighScoreView::CS60UIExampleHighScoreView()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CS60UIExampleHighScoreView::CS60UIExampleHighScoreView(
                                                CS60UIExampleModel& aModel)
    : iModel(aModel)
    {
    }

// -----------------------------------------------------------------------------
// CS60UIExampleSettingsView::~CS60UIExampleSettingsView()
// Destructor.
// -----------------------------------------------------------------------------
//
CS60UIExampleHighScoreView::~CS60UIExampleHighScoreView()
    {
    delete iContainer;
    }

// -----------------------------------------------------------------------------
// TUid CS60UIExampleHighScoreView::Id()
// Returns the View Id.
// -----------------------------------------------------------------------------
//
TUid CS60UIExampleHighScoreView::Id() const
    {
    return TUid::Uid (ES60UIExampleHighScoreViewId);
    }

// -----------------------------------------------------------------------------
// CS60UIExampleHighScoreView::HandleCommandL()
// Handles the commands.
// -----------------------------------------------------------------------------
//
void CS60UIExampleHighScoreView::HandleCommandL (TInt aCommand)
    {
    switch (aCommand)
        {
        case EAknSoftkeyOk:
            {
            AppUi()->ActivateLocalViewL (TUid::Uid (ES60UIExampleInitialViewId));
            break;
            }

        case EAknSoftkeyCancel:
            {
            AppUi()->ActivateLocalViewL (TUid::Uid (ES60UIExampleInitialViewId));
            break;
            }

        default:
            AppUi()->HandleCommandL (aCommand);	
        } 
    }

// -----------------------------------------------------------------------------
// CS60UIExampleHighScoreView::DoActivateL()
// Creates the Container class object.
// -----------------------------------------------------------------------------
//
void CS60UIExampleHighScoreView::DoActivateL (
                                      const TVwsViewId& /*aPrevViewId*/,
                                      TUid /*aCustomMessageId*/, 
                                      const TDesC8& /*aCustomMessage*/)
    {
    if (!iContainer)
        {
        iContainer = 
                 CS60UIExampleHighScoreContainer::NewL(ClientRect(), iModel);
        iContainer->SetMopParent(this);
        AppUi()->AddToStackL(*this, iContainer);
        }
    }

// -----------------------------------------------------------------------------
// CS60UIExampleHighScoreView::DoDeactivate()
// Deletes the Container class object.
// -----------------------------------------------------------------------------
//
void CS60UIExampleHighScoreView::DoDeactivate()
    {
    if (iContainer)
        {
        // Remove HighScoreView's container from control Stack
        AppUi()->RemoveFromStack(iContainer);
        delete iContainer;
        iContainer = NULL;
        }
    }

// End of File

⌨️ 快捷键说明

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