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 -
This commit is contained in:
maxim 2014-01-16 21:36:51 +00:00
parent c468ca2f32
commit b82a55b035
3 changed files with 15 additions and 6 deletions

View File

@ -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);

View File

@ -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

View File

@ -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;