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

📄 richtexteditorappui.cpp

📁 在syambian s60 3rd上开发的超级计算器 可实现大浮点数的计算
💻 CPP
字号:
 /*
* ============================================================================
*  Name     : CRTEAppUi from RichTextEditorAppUi.cpp
*  Part of  : RichTextEditor
*  Created  : 05/08/2006 by Forum Nokia
*  Version  : 2.0
*
*  Copyright (c) 2006 - 2007 Nokia Corporation.
*  This material, including documentation and any related
*  computer programs, is protected by copyright controlled by
*  Nokia Corporation.
* ============================================================================
*/

// INCLUDE FILES

#include "RichTextEditorAppUi.h"
#include "RichTextEditorContainer.h"
//#include <RichTextEditor.rsg>
#ifdef __SERIES60_3X__
#include <avkon.hrh> //Font ids
#else
#include <AknUtils.h> //Defined font name
#endif
#include "RichTextEditor.hrh"

#define KEnableSkinFlag 0x1000
#define KLayoutAwareApp 0x08

extern

/*extern TOperator CurOp;
extern TBuf<100> bufResult; */
// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CRTEAppUi::ConstructL()
//
// ----------------------------------------------------------
//
void CRTEAppUi::ConstructL()
    {
    #ifdef __SERIES60_3X__
	BaseConstructL(EAknEnableSkin);
	#else
	BaseConstructL(KEnableSkinFlag | KLayoutAwareApp);
	#endif
    iAppContainer = new (ELeave) CRTEContainer;
    CleanupStack::PushL(iAppContainer);
    iAppContainer->SetMopParent(this);
    iAppContainer->ConstructL( ClientRect() );
   /* iAppContainer->SetColor(KRgbBlack);
	#ifdef __SERIES60_3X__
    iAppContainer->SetFont(EAknLogicalFontPrimarySmallFont);
	#else
    iAppContainer->SetFont(CalcOperBold21());
	#endif*/
    
    

    AddToStackL( iAppContainer );
    //TO DO:
    
 /*   iAppContainer->SetVerticalAlignment(CParaFormat::EBottomAlign);
    iAppContainer->SetHorizontalAlignment(CParaFormat::ELeftAlign);
    iAppContainer->SetRightTab();
    iAppContainer->SetCharacterBIUAttribL(CEikGlobalTextEditor::EBold);*/
//  iAppContainer->InsertTab();
//  iAppContainer->iRtEd->RichText()->InsertL(iAppContainer->iRtEd->RichText()->DocumentLength(), '\t');
    //   iAppContainer->iRtEd->RichText()->RemoveSpecificCharFormatL(iAppContainer->iRtEd->RichText()->DocumentLength()-1,1);
    CleanupStack::Pop();
    }

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

// ----------------------------------------------------
// CRTEAppUi::HandleCommandL(TInt aCommand)
//
// ----------------------------------------------------
//
void CRTEAppUi::HandleCommandL(TInt aCommand)
    { 
        switch ( aCommand )
        {
     	case EAknSoftkeyBack:
            {
            Exit();
            break;
            }
		case EEqual:
			{
			iAppContainer->Equal();
			break;
			}
		case EAdd:
			{
			iAppContainer->Operate( EOpAdd );
			break;
			}	
		case ESub:
			{
			iAppContainer->Operate( EOpSub );
			break;
			}
		case EMult:
			{
			iAppContainer->Operate( EOpMult );
			break;
			}	
		case EDiv:
			{
			iAppContainer->Operate( EOpDiv );
			break;
			}
 		case ERichTextCmdAppAbout:
			iAppContainer->AboutL();
			break;
        default:
            break;
        }
    }

// -----------------------------------------------------------------------------
//  Called by framework when layout is changed.
//  Passes the new client rectangle to the AppContainer
// -----------------------------------------------------------------------------
//
void CRTEAppUi::HandleResourceChangeL( TInt aType )
    {
    // base-class call also
    CAknAppUi::HandleResourceChangeL(aType);
    if (aType == KEikDynamicLayoutVariantSwitch)
        {
    	if(iAppContainer)
    		iAppContainer->SetRect( ClientRect() );
        }
    }

// End of File

⌨️ 快捷键说明

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