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

📄 dirscraccappui.cpp

📁 symbian平台上如何在屏幕上快速的显示图片
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CDirScrAccAppUi from DirScrAccAppUi.cpp
*  Part of  : DirScrAcc
*  Created  : 06/11/2003 by Forum Nokia
*  Implementation notes:
*     Initial content was generated by Nokia Series 60 AppWizard.
*  Version  :
*  Copyright: Nokia Corporation
* ============================================================================
*/

// INCLUDE FILES
#include "DirScrAccAppUi.h"
#include "DirScrAccView1.h" 
#include "DirScrAccView2.h" 
#include "DirScrAccView3.h" 
#include <DirScrAcc.rsg>
#include "dirscracc.hrh"

#include <avkon.hrh>

// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CDirScrAccAppUi::ConstructL()
// ?implementation_description
// ----------------------------------------------------------
//
void CDirScrAccAppUi::ConstructL()
    {
    //Initialises this app UI with standard values. 
    //The application抯 standard resource file will be read unless 
    //the ENoAppResourceFile or ENonStandardResourceFile flags are passed.
    BaseConstructL();

    // Show tabs for main views from resources
    CEikStatusPane* sp = StatusPane();

    // Fetch pointer to the default navi pane control
    iNaviPane = (CAknNavigationControlContainer*)sp->ControlL( 
        TUid::Uid(EEikStatusPaneUidNavi));

    // Tabgroup has been read from resource and it was pushed to the navi pane. 
    // Get pointer to the navigation decorator with the ResourceDecorator() function. 
    // Application owns the decorator and it has responsibility to delete the object.
    iDecoratedTabGroup = iNaviPane->ResourceDecorator();
    if (iDecoratedTabGroup)
        {
        iTabGroup = (CAknTabGroup*) iDecoratedTabGroup->DecoratedControl();
        }

    CDirScrAccView1* view1 = new (ELeave) CDirScrAccView1;

    CleanupStack::PushL( view1 );
    view1->ConstructL(/*iTabGroup*/);
    AddViewL( view1 );        // transfer ownership to CAknViewAppUi
    CleanupStack::Pop();    // view1

    CDirScrAccView2* view2 = new (ELeave) CDirScrAccView2;

    CleanupStack::PushL( view2 );
    view2->ConstructL();
    AddViewL( view2 );      // transfer ownership to CAknViewAppUi
    CleanupStack::Pop();    // view2

    CDirScrAccView3* view3 = new (ELeave) CDirScrAccView3;

    CleanupStack::PushL( view3 );
    view3->ConstructL();
    AddViewL( view3 );      // transfer ownership to CAknViewAppUi
    CleanupStack::Pop();    // view3

    SetDefaultViewL(*view1);

/*    
    BaseConstructL();
    iAppContainer = new (ELeave) CDirScrAccContainer;
    iAppContainer->SetMopParent(this);
    iAppContainer->ConstructL( ClientRect() );
    AddToStackL( iAppContainer );
*/    }

// ----------------------------------------------------
// CDirScrAccAppUi::~CDirScrAccAppUi()
// Destructor
// Frees reserved resources
// ----------------------------------------------------
//
CDirScrAccAppUi::~CDirScrAccAppUi()
    {
        delete iDecoratedTabGroup;
    }

// ------------------------------------------------------------------------------
// CDirScrAccAppUi::::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
//  This function is called by the EIKON framework just before it displays
//  a menu pane. Its default implementation is empty, and by overriding it,
//  the application can set the state of menu items dynamically according
//  to the state of application data.
// ------------------------------------------------------------------------------
//
void CDirScrAccAppUi::DynInitMenuPaneL(
    TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
    {
    }

// ----------------------------------------------------
// CDirScrAccAppUi::HandleKeyEventL(
//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// ?implementation_description
// ----------------------------------------------------
//
TKeyResponse CDirScrAccAppUi::HandleKeyEventL(
    const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
    {
    
    if ( iTabGroup == NULL )
        {
        return EKeyWasNotConsumed;
        }

    TInt active = iTabGroup->ActiveTabIndex();
    TInt count = iTabGroup->TabCount();

    switch ( aKeyEvent.iCode )
        {
        case EKeyLeftArrow:
            if ( active > 0 )
                {
                active--;
                iTabGroup->SetActiveTabByIndex( active );
                // ActivateLocalViewL() is used to change the view. 
                // To change view from another application we would use ActivateViewL()
                // Send an empty message
                ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(active)));
                }
            break;
        case EKeyRightArrow:
            if( (active + 1) < count )
                {
                active++;
                iTabGroup->SetActiveTabByIndex( active );
                // ActivateLocalViewL() is used to change the view. 
                // To change view from another application we would use ActivateViewL()
                ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(active)));
                }
            break;
        default:
            return EKeyWasNotConsumed;
            break;
        }
    return EKeyWasNotConsumed;
    }


// ----------------------------------------------------
// CDirScrAccAppUi::HandleCommandL(TInt aCommand)
// ?implementation_description
// ----------------------------------------------------
//
void CDirScrAccAppUi::HandleCommandL(TInt aCommand)
    {
    switch ( aCommand )
        {
        case EAknSoftkeyBack:
        case EAknSoftkeyExit:
        case EEikCmdExit:
            {
            Exit();
            break;
            }

        default:
            break;
        }
    }

// End of File  

⌨️ 快捷键说明

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