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()-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->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->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();
更多精彩
赞助商链接