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

📄 s60uiexamplesettingsview.cpp

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

#include "S60UIExampleList.h"
#include "S60UIExampleSettingsView.h"
#include "S60UIExample.hrh"
#include <S60UIExample.rsg>
#include <aknviewappui.h>

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


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


// -----------------------------------------------------------------------------
// CS60UIExampleSettingsView::CS60UIExampleSettingsView()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CS60UIExampleSettingsView::CS60UIExampleSettingsView() : iList (NULL)
    {
    }


// -----------------------------------------------------------------------------
// CS60UIExampleSettingsView::~CS60UIExampleSettingsView()
// Destructor.
// -----------------------------------------------------------------------------
//
CS60UIExampleSettingsView::~CS60UIExampleSettingsView()
    {
    if (iList)
        {
        AppUi()->RemoveFromStack (iList);
        }
    delete iList;
    }


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


// -----------------------------------------------------------------------------
// CS60UIExampleSettingsView::HandleCommandL()
// Handles the commands.
// -----------------------------------------------------------------------------
//
void CS60UIExampleSettingsView::HandleCommandL (TInt aCommand)
    {
    switch (aCommand)
        {
       	case EEikCmdExit:
        case EAknSoftkeyExit:
        	{	
            AppUi()->Exit();
            break;
        	}
        	
        case ES60UIExampleChange:
        	{
        	TInt index = iList->ListBox()->CurrentItemIndex();
        	iList->EditItemL(index, EFalse);
            break;
            }

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

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

    }


// -----------------------------------------------------------------------------
// CS60UIExampleSettingsView::DoActivateL()
// Creates the Container class object.
// -----------------------------------------------------------------------------
//
void CS60UIExampleSettingsView::DoActivateL (const TVwsViewId& /*aPrevViewId*/,
                                             TUid /*aCustomMessageId*/, 
                                             const TDesC8& /*aCustomMessage*/)
    {
    if (!iList)
        {
        iList = new (ELeave) CS60UIExampleList;
        iList->SetData(iVolume, iSpeed, iBacktrack);
        iList->SetMopParent(this);
        iList->ConstructFromResourceL(R_S60UIEXAMPLE_SETTING_LIST);

        AppUi()->AddToStackL(*this, iList);
        }

    iList->MakeVisible (ETrue);
    iList->SetRect(ClientRect());
    iList->ActivateL();
    iList->DrawNow();
    }


// -----------------------------------------------------------------------------
// CS60UIExampleSettingsView::DoDeactivate()
// Deletes the Container class object.
// -----------------------------------------------------------------------------
//
void CS60UIExampleSettingsView::DoDeactivate()
    {
    if (iList)
        {
        iList->MakeVisible (EFalse);
        }
        
    }

// End of File

⌨️ 快捷键说明

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