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

📄 helloappui.cpp

📁 从s60平台移植到UIQ平台的例子代码:In this code we shall consider taking a simple HelloWorld GUI application writte
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CHelloAppUi from HelloAppUi.cpp
*  Part of  : Hello
*  Created  : 21/05/2002 by 
*  Implementation notes:
*     Initial content was generated by Nokia Series 60 AppWizard.
*  Version  :
*  Copyright: 
* ============================================================================
*/

// INCLUDE FILES
#include "HelloAppUi.h"
#include "HelloContainer.h" 
#include <Hello.rsg>
#include "hello.hrh"
#include <eikenv.h> 
#include "HelloDialog.h"


// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CHelloAppUi::ConstructL()
// ?implementation_description
// ----------------------------------------------------------
//
void CHelloAppUi::ConstructL()
    {
    BaseConstructL();
    iAppContainer = new (ELeave) CHelloContainer;
    iAppContainer->ConstructL( ClientRect() );
    AddToStackL( iAppContainer );
    }

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

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

// ----------------------------------------------------
// CHelloAppUi::HandleKeyEventL(
//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// ?implementation_description
// ----------------------------------------------------
//
TKeyResponse CHelloAppUi::HandleKeyEventL(
    const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
    {
    return EKeyWasNotConsumed;
    }

// ----------------------------------------------------
// CHelloAppUi::HandleCommandL(TInt aCommand)
// ?implementation_description
// ----------------------------------------------------
//
void CHelloAppUi::HandleCommandL(TInt aCommand)
    {
    switch ( aCommand )
        {
       
        case EMyToolbarButtonDummy:
		{
        	iEikonEnv->InfoMsg(_L("Button pressed"));
        	break;
		}

        case EHelloCmdAppGoodbye:
            {
            iEikonEnv->InfoMsg(_L("Goodbye"));        
            break;
            }

        case EHelloCmdAppTest:
            {
            iEikonEnv->InfoMsg(_L("Hello Again"));
            break;
            }
            
       case EMyToolbarButtonOptions:
            {
            CEikDialog* dialog = new(ELeave) CHelloDialog();
            dialog->ExecuteLD(R_HELLO_DIALOG);
            break;
            }     

       default:
            break;      
       }
    }


// End of File  

⌨️ 快捷键说明

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