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

📄 normaltexteditorappui.cpp

📁 文本输入框事例
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CNormalTextEditorAppUi from NormalTextEditorAppUi.cpp
*  Part of  : NormalTextEditor
*  Created  : 2006-4-7 by hewei
*  Implementation notes:
*     Initial content was generated by Series 60 AppWizard.
*  Version  :
*  Copyright: myself
* ============================================================================
*/

// INCLUDE FILES
#include "NormalTextEditorAppUi.h"
#include "NormalTextEditorContainer.h"
#include "RichTextEditorContainer.h" 
#include <NormalTextEditor.rsg>
#include "normaltexteditor.hrh"

#include <avkon.hrh>

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

    iAppContainer1 = new (ELeave) CNormalTextEditorContainer;
    iAppContainer1->SetMopParent( this );
    iAppContainer1->ConstructL( ClientRect() );
    AddToStackL(iAppContainer1);
}

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

	if (iAppContainer2)
        {
        RemoveFromStack( iAppContainer2 );
        delete iAppContainer2;
        }


   }

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

// ----------------------------------------------------
// CNormalTextEditorAppUi::HandleKeyEventL(
//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// takes care of key event handling
// ----------------------------------------------------
//
TKeyResponse CNormalTextEditorAppUi::HandleKeyEventL(
    const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
    {
    return EKeyWasNotConsumed;
    }

// ----------------------------------------------------
// CNormalTextEditorAppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void CNormalTextEditorAppUi::HandleCommandL(TInt aCommand)
    {
    switch ( aCommand )
        {
        case EAknSoftkeyBack:
        case EEikCmdExit:
            {
            Exit();
            break;
            }
        case ENormalTextEditorCmdAppPlainTextEditor:
            {
			if(!iAppContainer1)
			{
				if(iAppContainer2)
				{
			    RemoveFromStack( iAppContainer2 );
                delete iAppContainer2;
				}
              iAppContainer1 = new (ELeave) CNormalTextEditorContainer;
              iAppContainer1->SetMopParent( this );
              iAppContainer1->ConstructL( ClientRect() );
              AddToStackL( iAppContainer1 );
			}
            break;
            }
        case ENormalTextEditorCmdAppRichTextEditor :
			{
				if(iAppContainer1)
				{
					
				RemoveFromStack( iAppContainer1);
                delete iAppContainer1;
				iAppContainer2=CRichTextEditorContainer::NewL(ClientRect());
                iAppContainer2->SetMopParent( this );
                AddToStackL( iAppContainer2 );
				}
			}
        default:
            break;      
        }
    }

// End of File  

⌨️ 快捷键说明

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