Zoom vs Double Click = Maximize

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Mariano
Newbie
Newbie
Posts: 46
Joined: Fri Nov 15, 2002 12:00 am
Location: España

Zoom vs Double Click = Maximize

Post by Mariano » Wed Sep 20, 2006 10:54 am

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,

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Sep 20, 2006 11:06 am

Hi Mariano,

You can disable zoom and then enable it manually:

Code: Select all

  Chart1.Zoom.Allow:=false;
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;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Mariano
Newbie
Newbie
Posts: 46
Joined: Fri Nov 15, 2002 12:00 am
Location: España

Post by Mariano » Wed Sep 20, 2006 12:21 pm

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. :D

Post Reply