mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-08 02:20:04 +01:00
TAChart: Use SetPropDefaults in TChartPen
git-svn-id: trunk@31829 -
This commit is contained in:
parent
6227fc5787
commit
fb3b94ed21
@ -422,7 +422,6 @@ begin
|
|||||||
inherited Create(ACollection, ACollection.Owner as TCustomChart);
|
inherited Create(ACollection, ACollection.Owner as TCustomChart);
|
||||||
FAxisPen := TChartAxisPen.Create;
|
FAxisPen := TChartAxisPen.Create;
|
||||||
FAxisPen.OnChange := @StyleChanged;
|
FAxisPen.OnChange := @StyleChanged;
|
||||||
FAxisPen.Visible := false;
|
|
||||||
FListener := TListener.Create(@FTransformations, @StyleChanged);
|
FListener := TListener.Create(@FTransformations, @StyleChanged);
|
||||||
FMarks := TChartAxisMarks.Create(ACollection.Owner as TCustomChart);
|
FMarks := TChartAxisMarks.Create(ACollection.Owner as TCustomChart);
|
||||||
FMinors := TChartMinorAxisList.Create(Self);
|
FMinors := TChartMinorAxisList.Create(Self);
|
||||||
|
|||||||
@ -78,11 +78,6 @@ type
|
|||||||
TChartAxisMarkToTextEvent =
|
TChartAxisMarkToTextEvent =
|
||||||
procedure (var AText: String; AMark: Double) of object;
|
procedure (var AText: String; AMark: Double) of object;
|
||||||
|
|
||||||
TChartAxisGridPen = class(TChartPen)
|
|
||||||
published
|
|
||||||
property Style default psDot;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{$IFNDEF fpdoc} // Workaround for issue #18549.
|
{$IFNDEF fpdoc} // Workaround for issue #18549.
|
||||||
TBasicChartAxisMarks =
|
TBasicChartAxisMarks =
|
||||||
specialize TGenericChartMarks<TChartAxisBrush, TChartPen, TChartAxisFramePen>;
|
specialize TGenericChartMarks<TChartAxisBrush, TChartPen, TChartAxisFramePen>;
|
||||||
@ -147,7 +142,10 @@ type
|
|||||||
property YIndex;
|
property YIndex;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TChartBasicAxis }
|
TChartAxisGridPen = class(TChartPen)
|
||||||
|
published
|
||||||
|
property Style default psDot;
|
||||||
|
end;
|
||||||
|
|
||||||
TChartBasicAxis = class(TCollectionItem)
|
TChartBasicAxis = class(TCollectionItem)
|
||||||
strict private
|
strict private
|
||||||
@ -487,7 +485,6 @@ constructor TChartAxisTitle.Create(AOwner: TCustomChart);
|
|||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
FDistance := DEF_TITLE_DISTANCE;
|
FDistance := DEF_TITLE_DISTANCE;
|
||||||
Frame.Style := psClear;
|
|
||||||
FLabelBrush.Style := bsClear;
|
FLabelBrush.Style := bsClear;
|
||||||
FVisible := false;
|
FVisible := false;
|
||||||
end;
|
end;
|
||||||
@ -515,7 +512,6 @@ constructor TCustomChartAxisMarks.Create(AOwner: TCustomChart);
|
|||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
FDistance := 1;
|
FDistance := 1;
|
||||||
Frame.Style := psClear;
|
|
||||||
FLabelBrush.Style := bsClear;
|
FLabelBrush.Style := bsClear;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -624,7 +620,6 @@ begin
|
|||||||
FArrow := TChartArrow.Create(AChart);
|
FArrow := TChartArrow.Create(AChart);
|
||||||
FGrid := TChartAxisGridPen.Create;
|
FGrid := TChartAxisGridPen.Create;
|
||||||
FGrid.OnChange := @StyleChanged;
|
FGrid.OnChange := @StyleChanged;
|
||||||
FGrid.Style := psDot;
|
|
||||||
// FMarks must be created in descendants.
|
// FMarks must be created in descendants.
|
||||||
FTickColor := clBlack;
|
FTickColor := clBlack;
|
||||||
FVisible := true;
|
FVisible := true;
|
||||||
|
|||||||
@ -628,7 +628,6 @@ constructor TCubicSplineSeries.Create(AOwner: TComponent);
|
|||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
FBadDataPen := TBadDataChartPen.Create;
|
FBadDataPen := TBadDataChartPen.Create;
|
||||||
FBadDataPen.Color := clRed;
|
|
||||||
FBadDataPen.OnChange := @StyleChanged;
|
FBadDataPen.OnChange := @StyleChanged;
|
||||||
FPen := TChartPen.Create;
|
FPen := TChartPen.Create;
|
||||||
FPen.OnChange := @StyleChanged;
|
FPen.OnChange := @StyleChanged;
|
||||||
|
|||||||
@ -57,7 +57,7 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create; override;
|
constructor Create; override;
|
||||||
public
|
public
|
||||||
procedure Assign(Source: TPersistent); override;
|
procedure Assign(ASource: TPersistent); override;
|
||||||
published
|
published
|
||||||
property Visible: Boolean read FVisible write SetVisible default true;
|
property Visible: Boolean read FVisible write SetVisible default true;
|
||||||
end;
|
end;
|
||||||
@ -405,18 +405,17 @@ uses
|
|||||||
|
|
||||||
{ TChartPen }
|
{ TChartPen }
|
||||||
|
|
||||||
procedure TChartPen.Assign(Source: TPersistent);
|
procedure TChartPen.Assign(ASource: TPersistent);
|
||||||
begin
|
begin
|
||||||
if Source is TChartPen then
|
if ASource is TChartPen then
|
||||||
with TChartPen(Source) do
|
FVisible := TChartPen(ASource).Visible;
|
||||||
FVisible := Visible;
|
inherited Assign(ASource);
|
||||||
inherited Assign(Source);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TChartPen.Create;
|
constructor TChartPen.Create;
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
FVisible := true;
|
SetPropDefaults(Self, ['Color', 'Style', 'Visible']);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChartPen.SetVisible(AValue: Boolean);
|
procedure TChartPen.SetVisible(AValue: Boolean);
|
||||||
@ -629,7 +628,6 @@ begin
|
|||||||
InitHelper(FFont, TFont);
|
InitHelper(FFont, TFont);
|
||||||
FFont.Color := clBlue;
|
FFont.Color := clBlue;
|
||||||
InitHelper(FFrame, TChartTitleFramePen);
|
InitHelper(FFrame, TChartTitleFramePen);
|
||||||
FFrame.Visible := false;
|
|
||||||
FMargin := DEF_MARGIN;
|
FMargin := DEF_MARGIN;
|
||||||
FText := TStringList.Create;
|
FText := TStringList.Create;
|
||||||
TStringList(FText).OnChange := @StyleChanged;
|
TStringList(FText).OnChange := @StyleChanged;
|
||||||
@ -901,7 +899,6 @@ begin
|
|||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
FDistance := DEF_MARKS_DISTANCE;
|
FDistance := DEF_MARKS_DISTANCE;
|
||||||
FLabelBrush.Color := clYellow;
|
FLabelBrush.Color := clYellow;
|
||||||
FLinkPen.Color := clWhite;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSeriesPointer }
|
{ TSeriesPointer }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user