From 6a03559a2394e65f10b7cecc6ec7205cea96fb6b Mon Sep 17 00:00:00 2001 From: vincents Date: Wed, 20 Jun 2007 22:05:55 +0000 Subject: [PATCH] LCL: added TCustomLabel.GetLabelText (issue #9121) from Laurent git-svn-id: trunk@11339 - --- lcl/include/customlabel.inc | 11 +++++++++-- lcl/stdctrls.pp | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lcl/include/customlabel.inc b/lcl/include/customlabel.inc index 6d3aa95148..aa2145ac89 100644 --- a/lcl/include/customlabel.inc +++ b/lcl/include/customlabel.inc @@ -136,6 +136,11 @@ begin Result := FAlignment; end; +function TCustomLabel.GetLabelText: string; +begin + Result := Caption; +end; + Procedure TCustomLabel.SetShowAccelChar(Value : Boolean); begin If FShowAccelChar <> Value then begin @@ -355,6 +360,7 @@ var R : TRect; TextLeft, TextTop: integer; lTextWidth, lTextHeight: integer; + LabelText: string; begin R := Rect(0,0,Width,Height); With Canvas do begin @@ -411,12 +417,13 @@ begin end; end; //debugln('TCustomLabel.Paint ',dbgs(Alignment=tacenter),' ',dbgs(Layout=tlCenter),' ',dbgs(TextLeft),' TextTop=',dbgs(TextTop),' ',dbgs(R)); + LabelText := GetLabelText; if not Enabled then begin Font.Color := clBtnHighlight; - TextRect(R, TextLeft + 1, TextTop + 1, Caption, TR); + TextRect(R, TextLeft + 1, TextTop + 1, LabelText, TR); Font.color := clBtnShadow; end; - TextRect(R, TextLeft, TextTop, Caption, TR) + TextRect(R, TextLeft, TextTop, LabelText, TR) end; end; diff --git a/lcl/stdctrls.pp b/lcl/stdctrls.pp index 444b5ab7eb..f81e7179f5 100644 --- a/lcl/stdctrls.pp +++ b/lcl/stdctrls.pp @@ -1256,6 +1256,7 @@ type function GetShowAccelChar: Boolean; function GetAlignment: TAlignment; + function GetLabelText: string; virtual; function GetTransparent: boolean; procedure SetAlignment(Value: TAlignment); procedure SetColor(NewColor: TColor); override;