mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 01:49:25 +02:00
LCL: fixed drawing TBarChart caption (issue #15997) from Alexander Klenin
git-svn-id: trunk@24058 -
This commit is contained in:
parent
22775e7a58
commit
4e3c6a3371
17
lcl/chart.pp
17
lcl/chart.pp
@ -74,6 +74,7 @@ type
|
||||
FBars: TCollection;
|
||||
FDepth: byte;
|
||||
FLabelPosition:TPosLabel;
|
||||
FIsPainting: Boolean;
|
||||
function GetBars: TCollection;
|
||||
function NormalizeScaleUnits(OldScale: Integer): Integer;
|
||||
procedure SetBars(const AValue: TCollection);
|
||||
@ -82,6 +83,7 @@ type
|
||||
protected
|
||||
procedure Paint; override;
|
||||
class function GetControlClassDefaultSize: TPoint; override;
|
||||
function RealGetText: TCaption; override;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
@ -263,7 +265,12 @@ var
|
||||
end;
|
||||
|
||||
begin
|
||||
inherited Paint;
|
||||
FIsPainting := true;
|
||||
try
|
||||
inherited Paint;
|
||||
finally
|
||||
FIsPainting := false;
|
||||
end;
|
||||
bx:=GetSystemMetrics(SM_CXEDGE);
|
||||
by:=GetSystemMetrics(SM_CYEDGE);
|
||||
hmax:=10;
|
||||
@ -372,6 +379,14 @@ begin
|
||||
Canvas.Pen.Style:=psSolid;
|
||||
end;
|
||||
|
||||
function TCustomBarChart.RealGetText: TCaption;
|
||||
begin
|
||||
if FIsPainting then
|
||||
Result := ''
|
||||
else
|
||||
Result := inherited RealGetText;
|
||||
end;
|
||||
|
||||
class function TCustomBarChart.GetControlClassDefaultSize: TPoint;
|
||||
begin
|
||||
Result.X:=150;
|
||||
|
Loading…
Reference in New Issue
Block a user