Page 1 of 1
Zoom vs Double Click = Maximize
Posted: Wed Sep 20, 2006 10:54 am
by 9333771
hi,
I got a Chart (alClient) on some MDI form (MDiForm.Left > 0).
I want to maximize the MDI by double clicking on the chart, But it's provoc a zoom.
Any Idea how to avoid it?
thx in advance,
Posted: Wed Sep 20, 2006 11:06 am
by narcis
Hi Mariano,
You can disable zoom and then enable it manually:
Or you can try doing something like this:
Code: Select all
procedure TForm1.Chart1DblClick(Sender: TObject);
begin
if Chart1.Align=alClient then
Chart1.Zoom.Allow:=true
else
Chart1.Align:=alClient;
end;
Posted: Wed Sep 20, 2006 12:21 pm
by 9333771
hi,
thanks, I didn't thought about this (simple) way...
Code: Select all
procedure TFrmCompare.ChartDblClick(Sender: TObject);
begin
fDblClick := true;
fOldZoomAllow := Chart.Zoom.Allow;
Chart.Zoom.Allow := false;
// ...
end;
procedure TFrmCompare.ChartMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if fDblClick then begin
fDblClick := false;
Chart.Zoom.Allow := fOldZoomAllow;
end;
//...
end;
it's work great.