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

📄 aknexeditorappui.cpp

📁 国内著名嵌入式培训机构内部资料,内含一些实例代码,包括技术专题书籍
💻 CPP
字号:
/*
* ==============================================================================
*  Name        : aknexeditorappui.cpp
*  Part of     : Editor example
*  Interface   :
*  Description :
*  Version     :
*
*  Copyright (c) 2004 - 2006 Nokia Corporation.
*  This material, including documentation and any related
*  computer programs, is protected by copyright controlled by
*  Nokia Corporation.
* ==============================================================================
*/

#include <avkon.hrh>
#include <barsread.h>
#include <akntitle.h>
#include <aknnavi.h>
#include <akncontext.h>
#include <akntabgrp.h>
#include <aknnavide.h>

#include <AknExEditor.rsg>
#include "aknexeditor.hrh"
#include "AknExEditorAppUi.h"
#include "AknExEditorView.h"

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

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

// ----------------------------------------------------------------------------
// CAknExEditorAppUi::ConstructL()
// two phased constructor
//-----------------------------------------------------------------------------
//
void CAknExEditorAppUi::ConstructL()
    {
    BaseConstructL( EAknEnableSkin );

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

    // Title
    iTitlePane =  static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );

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

    // Create and view.
    CAknExEditorView* view = new ( ELeave ) CAknExEditorView;
    CleanupStack::PushL( view );
    view->ConstructL();
    CleanupStack::Pop();    // view
    AddViewL( view );        // transfer ownership to CAknViewAppUi
    }

// ----------------------------------------------------------------------------
// CAknExEditorAppUi::~CAknExEditorAppUi()
// Destructor.
// ----------------------------------------------------------------------------
//
CAknExEditorAppUi::~CAknExEditorAppUi()
    {
    }

// ----------------------------------------------------------------------------
// CAknExEditorAppUi::DynInitMenuPaneL()
//  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 CAknExEditorAppUi::DynInitMenuPaneL( 
    TInt /*aResourceId*/, CEikMenuPane* /*aMenuPane*/ )
    {
    }

// ----------------------------------------------------
// CAknExEditorAppUi::HandleCommandL()
// takes care of command handling.
// ----------------------------------------------------
//
void CAknExEditorAppUi::HandleCommandL( TInt aCommand )
    {
    switch ( aCommand )
        {
        case EAknCmdExit:
        case EEikCmdExit:   // Exit application
            Exit();
            break;

        default:
            break;
        }
    }

// ----------------------------------------------------
// CAknExEditorAppUi::HandleKeyEventL
// Handles key events.
// ( other items were commented in a header ).
// ----------------------------------------------------
//
TKeyResponse CAknExEditorAppUi::HandleKeyEventL( 
    const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/ )
    {
    return EKeyWasNotConsumed;
    }

// ----------------------------------------------------------------------------
// void CAknExEditorAppUi::HandleResourceChangeL( TInt aType )
// Handles resource changes.
// ----------------------------------------------------------------------------
//
void CAknExEditorAppUi::HandleResourceChangeL( TInt aType )
    {
    CAknAppUi::HandleResourceChangeL( aType );
    if  ( aType == KEikDynamicLayoutVariantSwitch )
    	{
    	CAknView* view = View( KViewId );
        view->HandleViewRectChange();
        }
    }
    
// End of File

⌨️ 快捷键说明

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