From b82a55b035d52b7baa7d5f3995e73b719ebd93ac Mon Sep 17 00:00:00 2001 From: maxim Date: Thu, 16 Jan 2014 21:36:51 +0000 Subject: [PATCH] Merged revision(s) 43737-43739 #9a1699953a-#9a1699953a from trunk: Components, TAChart: don't crash when making legend for PolarSeries visible, patch from wp, bug #25456 ........ Components, TAChart: don't eat OnMouseMove event when AllowZoom = false, patch from wp, bug #25439 ........ Components, TAChart: fix checkboxes drawing in TChartListbox on Linux and Mac OS X, patch from wp, bug #25452 ........ git-svn-id: branches/fixes_1_2@43742 - --- components/tachart/tachartlistbox.pas | 14 ++++++++------ components/tachart/taradialseries.pas | 6 ++++++ components/tachart/tatools.pas | 1 + 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/components/tachart/tachartlistbox.pas b/components/tachart/tachartlistbox.pas index 4a0e25bfeb..24b48b3fb4 100644 --- a/components/tachart/tachartlistbox.pas +++ b/components/tachart/tachartlistbox.pas @@ -189,6 +189,8 @@ begin RegisterComponents(CHART_COMPONENT_IDE_PAGE, [TChartListbox]); end; +{ TChartListbox } + constructor TChartListbox.Create(AOwner: TComponent); begin inherited Create(AOwner); @@ -213,11 +215,12 @@ var begin ACheckBoxRect := ZeroRect; ASeriesIconRect := ZeroRect; - w := GetSystemMetrics(SM_CYMENUCHECK); - x := 2; + + w := Canvas.TextHeight('Tg'); + x := 4; if cloShowCheckboxes in Options then begin with AItemRect do - ACheckboxRect := Bounds(Left + 1, (Top + Bottom - w) div 2, w, w); + ACheckboxRect := Bounds(Left + 4, (Top + Bottom - w) div 2, w, w); if cloShowIcons in Options then x += ACheckboxRect.Right; end @@ -304,9 +307,8 @@ begin OnDrawItem(Self, AIndex, ARect, AState); exit; end; - if - (odPainted in AState) or (FChart = nil) or not InRange(AIndex, 0, Count - 1) - then exit; + if (FChart = nil) or not InRange(AIndex, 0, Count - 1) then + exit; Canvas.FillRect(ARect); CalcRects(ARect, rcb, ricon); diff --git a/components/tachart/taradialseries.pas b/components/tachart/taradialseries.pas index 21acf2e174..d37dc4ce69 100644 --- a/components/tachart/taradialseries.pas +++ b/components/tachart/taradialseries.pas @@ -123,6 +123,7 @@ type function GraphPoint(AIndex: Integer): TDoublePoint; procedure PrepareAngleCache; protected + procedure GetLegendItems(AItems: TChartLegendItems); override; procedure SourceChanged(ASender: TObject); override; public procedure Assign(ASource: TPersistent); override; @@ -595,6 +596,11 @@ begin ExpandRect(Result, GraphPoint(i)); end; +procedure TPolarSeries.GetLegendItems(AItems: TChartLegendItems); +begin + AItems.Add(TLegendItemLine.Create(LinePen, LegendTextSingle)); +end; + function TPolarSeries.GraphPoint(AIndex: Integer): TDoublePoint; begin with Source[AIndex]^, FAngleCache[AIndex] do diff --git a/components/tachart/tatools.pas b/components/tachart/tatools.pas index 4bf631c1b1..848f4322d7 100644 --- a/components/tachart/tatools.pas +++ b/components/tachart/tatools.pas @@ -1178,6 +1178,7 @@ end; procedure TZoomDragTool.MouseMove(APoint: TPoint); begin + if not IsActive then exit; SelectionRect := Rect(SelectionRect.Left, SelectionRect.Top, APoint.X, APoint.Y); Handled; end;