?? richtexteditorcontainer.h
字號:
#ifndef RTECONTAINER_H
#define RTECONTAINER_H
#include <coecntrl.h>
#include <eikrted.h>
#include "eiklabel.h"
#include <uikon.hrh>
#include "mypicture.h"
#include <aknnotewrappers.h>
#include <e32math.h>
_LIT( KImageBitmapFile, "picture.mbm");
_LIT( KAdd, "+");
_LIT( KSub, "-");
_LIT( KMult, "*");
_LIT( KDiv, "/");
_LIT( KTab, "\t");
_LIT( KZero,"0");
_LIT( KOne,"1");
_LIT( KPoint,".");
_LIT( KEqual,"=");
_LIT( KNull,"");
_LIT( KError1, "Please enter a Operand!" );
_LIT( KError2, "Maxmium 20 digits!" );
//_LIT( KError3, "璇瘋緭鍏ュ悎娉曟暟瀛楋紒" );_LIT( KError4, "Can't be divided by Zero!" );
static enum TOperator { EOpAdd = 0, EOpSub, EOpMult, EOpDiv } CurOp;
static TBuf<200> bufResult;
class CRTEContainer : public CCoeControl
{
public:
void ConstructL(const TRect& aRect);
~CRTEContainer();
void InsertTab();
void SetHorizontalAlignment(CParaFormat::TAlignment );
void SetVerticalAlignment(CParaFormat::TAlignment );
void SetSelectionL(TInt,TInt);
void SetRightTab();
void SetCharacterBIUAttribL(CEikGlobalTextEditor::TFontStyleFlags );
#ifdef __SERIES60_3X__
/**
* Change the text's font from 3rd Edition onwards
*/
void SetFont(TInt aFontId);
#else
//! Change the text's font
void SetFont(const CFont* );
#endif
#ifdef __SERIES60_3X__
/**
* Change the text's font from 3rd Edition onwards
*/
void SetFont(TInt aFontId, TInt, TInt);
#else
//! Change the text's font
void SetFont(const CFont*, TInt, TInt );
#endif
void SetColor(TRgb );
void SetColor(TRgb , TInt, TInt);
void Strike();
void UpdateText();
void AboutL();
void Operate( TInt ); void Equal( TBool aIstemp = EFalse ); TBool GetOperand( TBuf<100> & aBuf, TBool &aFlag ); TBool IsMinor();
//重載描述符型無符號大浮點數比較
friend TBool operator >=( const TBuf<100>, const TBuf<100>);
//浮點數求極限
template <class T>
friend void Limit( T &);
//重載描述符型無符號大浮點數相加
template <class T>
friend T operator + ( const T, const T );
//重載描述符型無符號大浮點數相減
template <class T>
friend T operator - ( const T, const T );
//重載描述符型無符號大浮點數相乘
template <class T>
friend T operator * ( const T, const T );
//重載描述符型無符號大浮點數相除
template <class T>
friend T operator / ( const T, const T );
//重載描述符型大浮點數規范化
template <class T>
friend void operator ~ ( T &);
//重載描述符型無符號大浮點數求倒數
template <class T>
friend void operator ! ( T &);
public: // Functions from base classes
CEikRichTextEditor* iRtEd; // Rich Text Editor
private: TInt iPosStart;
TInt iPosEnd;
TBuf<100> iOperand1;
TBuf<100> iOperand2;
TBuf<100> iResult;
TBuf<200> iCurrentBuf;
TBool iIsOperand1;
TBool iIsMinor1;
TBool iIsMinor2;
TBool iIsComplete;
TBool iIsAbout; TBool iCanDecimal;
TTabStop tabstop;
private:
void Prepare();
void SetupL();
void Echo(TInt );
void SizeChanged();
TInt CountComponentControls() const;
CCoeControl* ComponentControl(TInt aIndex) const;
void Draw(const TRect& aRect) const;
TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
void SetBKColor( TRgb );
CEikLabel* iStatusLine; // 狀態行標記
};
#endif
// End of File
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -