Replace TeeTree after Zoom

TeeTree VCL for Borland Delphi and C++ Builder.
Post Reply
mivchart
Newbie
Newbie
Posts: 31
Joined: Thu Dec 04, 2008 12:00 am

Replace TeeTree after Zoom

Post by mivchart » Tue May 18, 2010 2:53 pm

Hi ,

D2007 + VLC 8.04

How to keep the tree on Top an Left = 0 after Zooming ??

I find the code But, without result

{ var tmpPos : Integer;
begin
tmpPos := (Tree1.HorzScrollBar.Max-Tree1.HorzScrollBar.Min) div 2;
tmpPos := tmpPos - (Tree1.HorzScrollBar.PageSize div 2);
Tree1.View3DOptions.HorizOffset := -tmpPos;
end;
}
E

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Replace TeeTree after Zoom

Post by Yeray » Thu May 20, 2010 11:45 am

Hi mivchart,

I'm not sure what are you exactly trying to align on the top-left. Could you please send us a complete and simple example project we can run as-is to reproduce the issue here?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

mivchart
Newbie
Newbie
Posts: 31
Joined: Thu Dec 04, 2008 12:00 am

Re: Replace TeeTree after Zoom

Post by mivchart » Fri May 21, 2010 6:51 am

Hi,


it's simple, i join project with post

exmple code =========================


procedure TForm1.Track_ZoomChange(Sender: TObject); //Not result !
begin
// Change zoom
Tree1.View3DOptions.Zoom:=Track_Zoom.Position;

LabelZoom.Caption:=TeeStr(Tree1.View3DOptions.Zoom)+'%';

//<<<< HERE when i Zoom, the tree create offset on TOP and Left, it's no goodg for user !!!

end;


procedure TForm1.BtAlignTopLeftClick(Sender: TObject);
begin

Track_Zoom.Position:=100; //If Zoom return in 100% > ok Vetical Ofset =0
Tree1.View3DOptions.Zoom:=100; //<<< How take for align on TOP and LEFT=0 if Zoom <> 100%
Tree1.View3DOptions.HorizOffset:=0;
Tree1.View3DOptions.VertOffset:=0;

end;
Attachments
TreeZoom.zip
Porject exmple Zoom tree
(32.39 KiB) Downloaded 1311 times

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Replace TeeTree after Zoom

Post by Yeray » Mon May 24, 2010 2:59 pm

Hi mivchart,

Apparently it seems to be a problem with the Horizontal and Vertical scrollbars that should be reset to 0. The problem then is that the Position property is read-only so the following code isn't accepted:

Code: Select all

procedure TForm1.Track_ZoomChange(Sender: TObject);
begin
  // Change zoom
  Tree1.View3DOptions.Zoom:=Track_Zoom.Position;
  LabelZoom.Caption:=TeeStr(Tree1.View3DOptions.Zoom)+'%';

  Tree1.Draw();
  Tree1.Draw();
end;

procedure TForm1.Tree1AfterDraw(Sender: TObject);
begin
  Tree1.VertScrollBar.Position:=0;
  Tree1.HorzScrollBar.Position:=0;
end;
But it will be accepted if you change TTreeScrollBar's Position property definition TeeTree.pas from:

Code: Select all

property Position:Integer read GetPosition;
To this:

Code: Select all

property Position:Integer read GetPosition write SetPosition default 0;
I've seen that you are source code customer so, please, try with the changes above and tell us if it works better.

Also note that 8.04 is not the latest version available so, please, try with the latest (8.07).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

mivchart
Newbie
Newbie
Posts: 31
Joined: Thu Dec 04, 2008 12:00 am

Re: Replace TeeTree after Zoom

Post by mivchart » Tue May 25, 2010 7:07 am

Hi,
sorry , but no result.

i have changed the code in unit Teetree.pas with example

Code: Select all

property Position:Integer read GetPosition write SetPosition default 0;
i have changed my code > but without effect !

Code: Select all

procedure TFrameEfcTree.Tree1AfterDraw(Sender: TObject);
begin
Tree1.VertScrollBar.Position :=0;
Tree1.HorzScrollBar.Position :=0;
end;

My request is simple, if I zoom I want to keep the position and left top = 0 = 0 of my tree for the good look user ?

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Replace TeeTree after Zoom

Post by Yeray » Tue May 25, 2010 7:42 am

Hi mivchart,

Have you assigned the AfterDraw event correctly? I haven't posted the code because I've created it at design time.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

mivchart
Newbie
Newbie
Posts: 31
Joined: Thu Dec 04, 2008 12:00 am

Re: Replace TeeTree after Zoom

Post by mivchart » Tue May 25, 2010 7:59 am

i have this code in my form

Code: Select all

procedure TFrameEfcTree.Tree1AfterDraw(Sender: TObject);
begin
Tree1.VertScrollBar.Position :=0;   //no result !!
Tree1.HorzScrollBar.Position :=0;
end;

procedure TFrameEfcTree.Tree1Zoom(Sender: TObject);
begin

  if not ZoomChange then begin
    // Show % percent of zoom in label
    LabelZoom.Caption:=TeeStr(Tree1.View3DOptions.Zoom)+'%';

    Tree1.draw();
    Tree1.draw();
  end;
end;

in my unit teetree, only

Code: Select all

    property Position:Integer read GetPosition write SetPosition default 0;   //MD  4.215 

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Replace TeeTree after Zoom

Post by Yeray » Tue May 25, 2010 9:52 am

Hi mivchart,

I see you've included the Tree1Zoom event that wasn't in the project you sent.
I've added this to the defect list to be revised in future releases (TV52014910) but in the meanwhile please, try with event like Zoom, AfterDraw,... as you do.
I've seen that the Horizontal and Vertical ScrollBars are changing their Min and Max values when zooming. The problem could come from here.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply