WEB开发网
开发学院手机开发Symbian 开发 Symbian 中大段文本显示控件详解 阅读

Symbian 中大段文本显示控件详解

 2010-02-22 20:53:00 来源:WEB开发网   
核心提示:#include "TextDisplay.h"//#include "AuditionContainer.h"_LIT(KLineStart,"");_LIT(KLineEnd,"");#define MAXDISPLAYLINE 10#

#include "TextDisplay.h"

//#include "AuditionContainer.h"

_LIT(KLineStart,"");

_LIT(KLineEnd,"");

#define MAXDISPLAYLINE 10

#define LINESPACE 3

#define LASTSPACE 25

CTextDisplay::CTextDisplay()

{

// No implementation required

// iBackGroundBitmap = NULL;

iStartLine = 0;

iTotalLine = 0;

iFontColour = KRgbBlack; // default

iStartPoit = TPoint(3,5);

iLineToLineSpace = LINESPACE;

iScrollBarWidth = 10;

}

CTextDisplay::~CTextDisplay()

{

if (iDisplayContent)

{

iDisplayContent->ResetAndDestroy();

delete iDisplayContent;

iDisplayContent = NULL;

}

if(iSBFrame)

{

delete iSBFrame;

iSBFrame = NULL;

}

}

CTextDisplay* CTextDisplay::NewLC(const TRect &aRect,CCoeControl* aParent)

{

CTextDisplay* self = new (ELeave)CTextDisplay();

CleanupStack::PushL(self);

self->ConstructL(aRect,aParent);

return self;

}

CTextDisplay* CTextDisplay::NewL(const TRect &aRect,CCoeControl* aParent)

{

CTextDisplay* self=CTextDisplay::NewLC(aRect,aParent);

CleanupStack::Pop(); // self;

return self;

}

void CTextDisplay::ConstructL(const TRect &aRect,CCoeControl* aParent)

{

// SetRect(aRect);

iRect = aRect;

TFontSpec fontSpec = iEikonEnv->DenseFont()->FontSpecInTwips();

fontSpec.iHeight *= 1;

iCoeEnv->ScreenDevice()->GetNearestFontInTwips(iFont,fontSpec);

iMaxDisplayLine = GetMaxDisplay();

iParent = aParent;

}

TKeyResponse CTextDisplay::OfferKeyEventL(const TKeyEvent &aKeyEvent,

上一页  1 2 3 4 5 6 7 8  下一页

Tags:Symbian 大段 文本

编辑录入:coldstar [复制链接] [打 印]
赞助商链接