TAChart: Add TChartAxis.Marks property, use it to control marks font

git-svn-id: trunk@24130 -
This commit is contained in:
ask 2010-03-21 05:40:05 +00:00
parent 6b4119e9ac
commit 289d06d85d

View File

@ -118,6 +118,7 @@ type
FAlignment: TChartAxisAlignment;
FGrid: TChartAxisPen;
FInverted: Boolean;
FMarks: TChartMarks;
FOnMarkToText: TChartAxisMarkToTextEvent;
FTickColor: TColor;
FTickLength: Integer;
@ -128,6 +129,7 @@ type
procedure SetAlignment(AValue: TChartAxisAlignment);
procedure SetGrid(AValue: TChartAxisPen);
procedure SetInverted(AValue: Boolean);
procedure SetMarks(const AValue: TChartMarks);
procedure SetOnMarkToText(const AValue: TChartAxisMarkToTextEvent);
procedure SetTickColor(AValue: TColor);
procedure SetTickLength(AValue: Integer);
@ -168,6 +170,7 @@ type
read FTransformation write SetTransformation;
property Visible: Boolean read FVisible write SetVisible default true;
published
property Marks: TChartMarks read FMarks write SetMarks;
property OnMarkToText: TChartAxisMarkToTextEvent
read FOnMarkToText write SetOnMarkToText;
end;
@ -277,6 +280,7 @@ begin
FGrid := TChartAxisPen.Create;
FGrid.OnChange := @StyleChanged;
FGrid.Style := psDot;
FMarks := TChartMarks.Create(ACollection.Owner as TCustomChart);
FTickColor := clBlack;
FTickLength := DEF_TICK_LENGTH;
FTitle := TChartAxisTitle.Create(ACollection.Owner as TCustomChart);
@ -289,6 +293,7 @@ destructor TChartAxis.Destroy;
begin
FTransformation.Free;
FTitle.Free;
FMarks.Free;
FGrid.Free;
inherited;
end;
@ -378,6 +383,7 @@ procedure TChartAxis.Draw(
begin
if not Visible then exit;
ACanvas.Font := Marks.LabelFont;
if IsVertical then
DoDraw(AExtent.a.Y, AExtent.b.Y)
else
@ -517,6 +523,7 @@ begin
FSize := 0;
FTitleSize := 0;
if not Visible then exit;
ACanvas.Font := Marks.LabelFont;
digitSize := ACanvas.TextExtent(SOME_DIGIT);
if IsVertical then
CalcVertSize
@ -545,6 +552,13 @@ begin
StyleChanged(Self);
end;
procedure TChartAxis.SetMarks(const AValue: TChartMarks);
begin
if FMarks = AValue then exit;
FMarks := AValue;
StyleChanged(Self);
end;
procedure TChartAxis.SetOnMarkToText(const AValue: TChartAxisMarkToTextEvent);
begin
if FOnMarkToText = AValue then exit;