TAChart: Use SetPropDefaults in TChartPen

git-svn-id: trunk@31829 -
This commit is contained in:
ask 2011-07-30 16:28:19 +00:00
parent 6227fc5787
commit fb3b94ed21
4 changed files with 10 additions and 20 deletions

View File

@ -422,7 +422,6 @@ begin
inherited Create(ACollection, ACollection.Owner as TCustomChart);
FAxisPen := TChartAxisPen.Create;
FAxisPen.OnChange := @StyleChanged;
FAxisPen.Visible := false;
FListener := TListener.Create(@FTransformations, @StyleChanged);
FMarks := TChartAxisMarks.Create(ACollection.Owner as TCustomChart);
FMinors := TChartMinorAxisList.Create(Self);

View File

@ -78,11 +78,6 @@ type
TChartAxisMarkToTextEvent =
procedure (var AText: String; AMark: Double) of object;
TChartAxisGridPen = class(TChartPen)
published
property Style default psDot;
end;
{$IFNDEF fpdoc} // Workaround for issue #18549.
TBasicChartAxisMarks =
specialize TGenericChartMarks<TChartAxisBrush, TChartPen, TChartAxisFramePen>;
@ -147,7 +142,10 @@ type
property YIndex;
end;
{ TChartBasicAxis }
TChartAxisGridPen = class(TChartPen)
published
property Style default psDot;
end;
TChartBasicAxis = class(TCollectionItem)
strict private
@ -487,7 +485,6 @@ constructor TChartAxisTitle.Create(AOwner: TCustomChart);
begin
inherited Create(AOwner);
FDistance := DEF_TITLE_DISTANCE;
Frame.Style := psClear;
FLabelBrush.Style := bsClear;
FVisible := false;
end;
@ -515,7 +512,6 @@ constructor TCustomChartAxisMarks.Create(AOwner: TCustomChart);
begin
inherited Create(AOwner);
FDistance := 1;
Frame.Style := psClear;
FLabelBrush.Style := bsClear;
end;
@ -624,7 +620,6 @@ begin
FArrow := TChartArrow.Create(AChart);
FGrid := TChartAxisGridPen.Create;
FGrid.OnChange := @StyleChanged;
FGrid.Style := psDot;
// FMarks must be created in descendants.
FTickColor := clBlack;
FVisible := true;

View File

@ -628,7 +628,6 @@ constructor TCubicSplineSeries.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FBadDataPen := TBadDataChartPen.Create;
FBadDataPen.Color := clRed;
FBadDataPen.OnChange := @StyleChanged;
FPen := TChartPen.Create;
FPen.OnChange := @StyleChanged;

View File

@ -57,7 +57,7 @@ type
public
constructor Create; override;
public
procedure Assign(Source: TPersistent); override;
procedure Assign(ASource: TPersistent); override;
published
property Visible: Boolean read FVisible write SetVisible default true;
end;
@ -405,18 +405,17 @@ uses
{ TChartPen }
procedure TChartPen.Assign(Source: TPersistent);
procedure TChartPen.Assign(ASource: TPersistent);
begin
if Source is TChartPen then
with TChartPen(Source) do
FVisible := Visible;
inherited Assign(Source);
if ASource is TChartPen then
FVisible := TChartPen(ASource).Visible;
inherited Assign(ASource);
end;
constructor TChartPen.Create;
begin
inherited Create;
FVisible := true;
SetPropDefaults(Self, ['Color', 'Style', 'Visible']);
end;
procedure TChartPen.SetVisible(AValue: Boolean);
@ -629,7 +628,6 @@ begin
InitHelper(FFont, TFont);
FFont.Color := clBlue;
InitHelper(FFrame, TChartTitleFramePen);
FFrame.Visible := false;
FMargin := DEF_MARGIN;
FText := TStringList.Create;
TStringList(FText).OnChange := @StyleChanged;
@ -901,7 +899,6 @@ begin
inherited Create(AOwner);
FDistance := DEF_MARKS_DISTANCE;
FLabelBrush.Color := clYellow;
FLinkPen.Color := clWhite;
end;
{ TSeriesPointer }