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

📄 aknexlistflagtestview.cpp

📁 symbian ui的 例子 初学者可以 好好看看,这个是培训的资料,应该比较宝贵
💻 CPP
字号:
/*  Copyright (c) 2005, Nokia. All rights reserved */

// INCLUDE FILES
#include <aknviewappui.h>
#include <aknexlist.rsg>
#include "AknExList.hrh"
#include "AknExListAppUi.h"
#include "AknExListFlagTestView.h"
#include "AknExListFlagTestContainer.h"

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

// ----------------------------------------------------------------------------
// CAknExListFlagTestView::CAknExListFlagTestView()
// Defalut constructor.
// ----------------------------------------------------------------------------
//
CAknExListFlagTestView::CAknExListFlagTestView()
: iContainer( NULL )
    {
    }

// ----------------------------------------------------------------------------
// void CAknExListFlagTestView::ConstructL()
// Symbian constructor.
// ----------------------------------------------------------------------------
//
void CAknExListFlagTestView::ConstructL()
    {
    BaseConstructL( R_AKNEXLIST_VIEW_COLUMNVIEW );
    }

// ----------------------------------------------------------------------------
// CAknExListFlagTestView::~CAknExListFlagTestView()
// Destructor.
// ----------------------------------------------------------------------------
CAknExListFlagTestView::~CAknExListFlagTestView()
    {
    if ( iContainer )
        {
        AppUi()->RemoveFromStack( iContainer );
        }

    delete iContainer; // Deletes container class object.
    }

// ----------------------------------------------------------------------------
// CAknExListFlagTestView::OutlineId()
// Returns current outline ID.
// ----------------------------------------------------------------------------
//
TInt CAknExListFlagTestView::OutlineId() const
    {
    return static_cast<CAknExListAppUi*>( AppUi() )->OutlineId();
    }

// ----------------------------------------------------------------------------
// CAknExListFlagTestView::Id()
// Returns ID of view.
// ----------------------------------------------------------------------------
TUid CAknExListFlagTestView::Id() const
    {
    return KAknExListFlagTestViewId; // Returns ID of FlagTestView.
    }

// ----------------------------------------------------------------------------
// CAknExListFlagTestView::SetTitlePaneL()
// Sets text of title pane.
// ----------------------------------------------------------------------------
//
void CAknExListFlagTestView::SetTitlePaneL( const TInt aOutlineId )
    {
    TInt resourceId = KAknExListInitTitleId;

    // Sets resource Id for title.
    switch ( aOutlineId ) // Outline ID is...
        {
        case EAknExListCmdOutline06: // OUTLINE06 screen.
            resourceId = R_AKNEXLIST_OUTLINE6;
            break;
        case EAknExListCmdOutline88: // OUTLINE88 screen.
            resourceId = R_AKNEXLIST_OUTLINE88;
            break;
        case EAknExListCmdOutline89: // OUTLINE89 screen.
            resourceId = R_AKNEXLIST_OUTLINE89;
            break;
        case EAknExListCmdOutline90: // OUTLINE90 screen.
            resourceId = R_AKNEXLIST_OUTLINE90;
            break;
        case EAknExListCmdOutline91: // OUTLINE91 screen.
            resourceId = R_AKNEXLIST_OUTLINE91;
            break;
        case EAknExListCmdOutline92: // OUTLINE92 screen.
            resourceId = R_AKNEXLIST_OUTLINE92;
            break;
        case EAknExListCmdOutline93: // OUTLINE93 screen.
            resourceId = R_AKNEXLIST_OUTLINE93;
            break;
        case EAknExListCmdOutline94: // OUTLINE94 screen.
            resourceId = R_AKNEXLIST_OUTLINE94;
            break;
        case EAknExListCmdOutline95: // OUTLINE95 screen.
            resourceId = R_AKNEXLIST_OUTLINE95;
            break;
        case EAknExListCmdOutline96: // OUTLINE96 screen.
            resourceId = R_AKNEXLIST_OUTLINE96;
            break;
        case EAknExListCmdOutline97: // OUTLINE97 screen.
            resourceId = R_AKNEXLIST_OUTLINE97;
            break;
        case EAknExListCmdOutline98: // OUTLINE98 screen.
            resourceId = R_AKNEXLIST_OUTLINE98;
            break;
        case EAknExListCmdOutline99: // OUTLINE99 screen.
            resourceId = R_AKNEXLIST_OUTLINE99;
            break;
        case EAknExListCmdOutline102: // OUTLINE102 screen.
            resourceId = R_AKNEXLIST_OUTLINE102;
            break;
        default:
            break;
        }

    IndicateTitlePaneTextL( resourceId ); // Sets text in title pane.
    }

// ----------------------------------------------------------------------------
// CAknExListFlagTestView::DisplayListBoxL()
// Displays the listbox by outline ID.
// ----------------------------------------------------------------------------
void CAknExListFlagTestView::DisplayListBoxL( const TInt aOutlineId )
    {
    if ( iContainer ) // Is container object created?
        {
        iContainer->DisplayListBoxL( aOutlineId );
        }
    }

// ----------------------------------------------------------------------------
// CAknExListFlagTestView::DoActivateL()
// Creates container class object.
// ----------------------------------------------------------------------------
void CAknExListFlagTestView::DoActivateL( 
   const TVwsViewId& /*aPrevViewId*/,
   TUid /*aCustomMessageId*/,
   const TDesC8& /*aCustomMessage*/ )
    {
    // Creates container class object.
    if ( !iContainer )
        {
        iContainer = new ( ELeave ) CAknExListFlagTestContainer( this ) ;
        iContainer->SetMopParent( this );
        iContainer->ConstructL( ClientRect() );

        // Adds container to view control stack.
        AppUi()->AddToStackL( *this, iContainer );

        // Displays outline.
        DisplayInitOutlineL();

        iContainer->MakeVisible( ETrue );
        }
    }

// ----------------------------------------------------------------------------
// CAknExListFlagTestView::DoDeactivate()
// Deletes container class object.
// ----------------------------------------------------------------------------
void CAknExListFlagTestView::DoDeactivate()
    {
    if ( iContainer )
        {
        AppUi()->RemoveFromStack( iContainer );
        }

    delete iContainer; // Deletes the container class object.
    iContainer = NULL;
    }

// End of File

⌨️ 快捷键说明

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