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

📄 multiviewsview1.cpp

📁 Symbian OS 源码:一个基于Symbian OS UI上面的标准VIEW源码。大家共同努力学好SYMBIAN
💻 CPP
字号:
/* Copyright (c) 2004, Nokia. All rights reserved */


// INCLUDE FILES
#include <aknviewappui.h>
#include <aknconsts.h>
#include <MultiViews.rsg>

#include "MultiViewsView1.h"
#include "MultiViewsContainer1.h"
#include "MultiViews.hrh"


// ========================= MEMBER FUNCTIONS ==================================

// -----------------------------------------------------------------------------
// CMultiViewsView1::CMultiViewsView1()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CMultiViewsView1::CMultiViewsView1()
    {
    // No implementation required
    }


// -----------------------------------------------------------------------------
// CMultiViewsView1::NewL()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CMultiViewsView1* CMultiViewsView1::NewL()
    {
    CMultiViewsView1* self = CMultiViewsView1::NewLC();
    CleanupStack::Pop( self );
    return self;
    }

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

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

// -----------------------------------------------------------------------------
// CMultiViewsView1::~CMultiViewsView1()
// Destructor.
// -----------------------------------------------------------------------------
//
CMultiViewsView1::~CMultiViewsView1()
    {
    // No implementation required
    }

// -----------------------------------------------------------------------------
// CMultiViewsView1::Id()
// Returns View's ID.
// -----------------------------------------------------------------------------
//
TUid CMultiViewsView1::Id() const
    {
    return TUid::Uid( EMultiViewsView1Id );
    }

// -----------------------------------------------------------------------------
// CMultiViewsView1::DoActivateL()
// Activate an MultiView1
// -----------------------------------------------------------------------------
//
void CMultiViewsView1::DoActivateL( const TVwsViewId& /*aPrevViewId*/,
                                    TUid /*aCustomMessageId*/,
                                    const TDesC8& /*aCustomMessage*/)
    {
    iContainer = CMultiViewsContainer1::NewL( ClientRect() );
    }

// -----------------------------------------------------------------------------
// CMultiViewsView1::DoDeactivate()
// DeActivate an MultiView1
// -----------------------------------------------------------------------------
//
void CMultiViewsView1::DoDeactivate()
    {

    if ( iContainer )
        {
        // Remove View1's container form controllStack
        AppUi()->RemoveFromStack( iContainer );
        delete iContainer;
        iContainer = NULL;
        }
    }

// -----------------------------------------------------------------------------
// CMultiViewsView1::HandleCommandL()
// Takes care of Command handling.
// -----------------------------------------------------------------------------
//
void CMultiViewsView1::HandleCommandL( TInt aCommand )
    {

    if ( aCommand == EMultiViewsSwitchToView2 )
        {
        AppUi()->ActivateLocalViewL( TUid::Uid( EMultiViewsView2Id ) );
        }
    else
        {
        AppUi()->HandleCommandL( aCommand );
        }
    }

// End of File

⌨️ 快捷键说明

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