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

📄 chinesedisplayappui.cpp

📁 symbian的Carbide C++编程
💻 CPP
字号:
/*
* ============================================================================
*  Name     : ChineseDisplayAppUi from ChineseDisplayAppUi.cpp
*  Part of  : ChineseDisplay
*  Created  : 18.3.2003 by Forum Nokia
*  Implementation notes:
*  Version  :
*  Copyright: Nokia Corporation, 2003
* ============================================================================
*/

// INCLUDE FILES
#include "ChineseDisplayAppUi.h"
#include "ChineseDisplayContainer.h" 
#include <ChineseDisplay.rsg>
#include "ChineseDisplay.hrh"
#include <aknnotewrappers.h>

#include <avkon.hrh>

// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// ChineseDisplayAppAppUi::ConstructL()
// Second-phase constructor
// ----------------------------------------------------------
//
void CChineseDisplayAppUi::ConstructL()
    {
    BaseConstructL();
    iAppContainer = new (ELeave) CChineseDisplayContainer;
    iAppContainer->SetMopParent(this);
    iAppContainer->ConstructL(ClientRect());
    AddToStackL(iAppContainer);
    }

// ----------------------------------------------------
// ChineseDisplayAppAppUi::~ChineseDisplayAppAppUi()
// Destructor
// Frees reserved resources
// ----------------------------------------------------
//
CChineseDisplayAppUi::~CChineseDisplayAppUi()
    {
    if (iAppContainer)
        {
        RemoveFromStack(iAppContainer);
        delete iAppContainer;
        }
   }

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

// ----------------------------------------------------
// ChineseDisplayAppAppUi::HandleKeyEventL(
//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// Handles the key events
// ----------------------------------------------------
//
TKeyResponse CChineseDisplayAppUi::HandleKeyEventL(
    const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
    {
    return EKeyWasNotConsumed;
    }

// ----------------------------------------------------
// ChineseDisplayAppAppUi::HandleCommandL(TInt aCommand)
// handle menu commands
// ----------------------------------------------------
//
void CChineseDisplayAppUi::HandleCommandL(TInt aCommand)
    {
    switch (aCommand)
        {
        case EAknSoftkeyBack:
        case EEikCmdExit:
            Exit();
            break;

        case EAknCmdExit:
            iEikonEnv->InfoMsg(_L("hotkey"));
            break;

		// The following code will only work in WINS build
        case EChineseDisplayCmdTest:
            {
			HBufC* helloText;

			// now reads the text from resource file to helloText
			helloText = iEikonEnv->AllocReadResourceL( R_EXAMPLE_TEXT_HELLO );
			iEikonEnv->InfoMsg( *helloText );
			delete helloText;
            break;
			}

		case EChineseDisplayCmdChangeLabels:
			{
            iAppContainer->ChangeLabelsL();
			break;
			}
        
        case EChineseDisplayCmdHello:
			{
			HBufC* helloText;

			// now reads the text from resource file to helloText
			helloText = iEikonEnv->AllocReadResourceL( R_EXAMPLE_TEXT_HELLO );
			CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
				informationNote->ExecuteLD( *helloText );
			delete helloText;
			}
            break;

        default:
            break;      
        }
    }

// End of File  

⌨️ 快捷键说明

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