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

📄 viewexappui.cpp

📁 Symbian OS C++ 程序开发事例
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CViewExAppUi from ViewExAppUi.cpp
*  Part of  : ViewEx
*  Copyright (c) 2004 Symbian Software Ltd. All rights reserved.
* ============================================================================
*/

// INCLUDE FILES
#include "ViewExAppUi.h"
#include "ViewExView.h"
#include <ViewEx.rsg>
#include "viewex.hrh"
#include <eikenv.h>

// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CViewExAppUi::ConstructL()
// 
// ----------------------------------------------------------
//
void CViewExAppUi::ConstructL()
    {
    BaseConstructL();

	// Construct and register all of our views, and set the list view as our default.
    iListView = new (ELeave) CListView;
	RegisterViewL(*iListView);

	iCustomView = new (ELeave) CCustomView;
	RegisterViewL(*iCustomView);

	iEditView = new (ELeave) CEditView;
	RegisterViewL(*iEditView);

    SetDefaultViewL(*iListView);

    }

// ----------------------------------------------------
// CViewExAppUi::~CViewExAppUi()
// Destructor
// Frees reserved resources
// ----------------------------------------------------
//
CViewExAppUi::~CViewExAppUi()
    {
	delete iListView;
	delete iCustomView;
	delete iEditView;
	}

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

// ----------------------------------------------------
// CViewExAppUi::HandleKeyEventL(
//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// takes care of key event handling
// ----------------------------------------------------
//
TKeyResponse CViewExAppUi::HandleKeyEventL(
    const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
    {
    switch ( aKeyEvent.iCode )
        {
        case EKeyLeftArrow:
            break;
        case EKeyRightArrow:
            break;
        default:
            return EKeyWasNotConsumed;
            break;
        }

    return EKeyWasConsumed;
    }

// ----------------------------------------------------
// CViewExAppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void CViewExAppUi::HandleCommandL(TInt aCommand)
    {
    switch ( aCommand )
        {
        case EEikCmdExit:
            {
            Exit();
            break;
            }
        case EViewExCmdAppTest:
            {
            iEikonEnv->InfoMsg(_L("test"));
            break;
            }
        default:
            break;      
        }
    }

// End of File  

⌨️ 快捷键说明

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