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

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

 2010-02-22 20:53:00 来源:WEB开发网   
核心提示:{gc.SetBrushStyle(CGraphicsContext::ESolidBrush);gc.SetPenStyle(CGraphicsContext::ENullPen);gc.SetBrushColor(KRgbBlue);gc.DrawRect(TRect(TPoint(0,iRect.Height()

{

gc.SetBrushStyle(CGraphicsContext::ESolidBrush);

gc.SetPenStyle(CGraphicsContext::ENullPen);

gc.SetBrushColor(KRgbBlue);

gc.DrawRect(TRect(TPoint(0,iRect.Height()-LASTSPACE),TSize(iRect.Width(),LASTSPACE)));

gc.SetBrushColor(KRgbBlack);

TInt nTrigonWidth = 12; //默认三角宽12个像素

TInt nTrigonHeight = 12; //默认三角高12个像素

//三角形第一的点的横纵坐标

TInt PointX = aRect.Width()/2;

TInt PointY = aRect.Height() - LASTSPACE + (LASTSPACE- 2*nTrigonHeight - 1)/2;

if(iTotalLine >= iStartLine + iMaxDisplayLine && iTotalLine > iMaxDisplayLine)

{

CArrayFixFlat* ArrPoint = new (ELeave) CArrayFixFlat(10);

ArrPoint->AppendL(TPoint(PointX-nTrigonWidth/2,PointY + 1 + nTrigonHeight)); // +1表示 两个三角的间距

ArrPoint->AppendL(TPoint(PointX+nTrigonWidth/2,PointY + 1 + nTrigonHeight)); // +1表示 两个三角的间距

ArrPoint->AppendL(TPoint(PointX,PointY+2*nTrigonHeight));

gc.DrawPolygon(ArrPoint);

delete ArrPoint;

}

if(iStartLine > 0)

{

CArrayFixFlat* ArrPoint = new (ELeave) CArrayFixFlat(10);

ArrPoint->AppendL(TPoint(PointX,PointY));

ArrPoint->AppendL(TPoint(PointX-nTrigonWidth/2,PointY+nTrigonHeight));

ArrPoint->AppendL(TPoint(PointX+nTrigonWidth/2,PointY+nTrigonHeight));

gc.DrawPolygon(ArrPoint);

delete ArrPoint;

}

gc.SetBrushStyle(CGraphicsContext::ENullBrush);

}

}

void CTextDisplay::SetFontColour(TRgb aRgb)

{

iFontColour = aRgb;

}

void CTextDisplay::SetFont(CFont *aFont)

{

iFont = aFont;

iMaxDisplayLine = GetMaxDisplay();

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

Tags:Symbian 大段 文本

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