Reposition Shape Center and Right always

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

Reposition Shape Center and Right always

Post by mivchart » Fri Jul 26, 2013 1:00 pm

hello,

I work with Delphi 2007 and vcl8.04

I draw a tree with multiple page (several of node) with Scroll and it 's ok.

I need to have an independent shape at always (center and right panel not tree), even if I move with the scroll.
How to reposition the middle after draw tree ?

Code: Select all

procedure TFrmAssistantEFC.CalculRePositionShapeLink;
begin

    //V6001(MD) Reposition Shape center and Right of tree (always, even scroll)
   if Assigned(ShapeCenter) then begin
        ShapeCenter.Top :=round(Tree1.Height/2);                                // ??? no result
        ShapeCenter.Left :=round(Tree1.Width-ShapeCenter.Width);      // ??? result 
   end;

end;

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

Re: Reposition Shape Center and Right always

Post by Yeray » Mon Jul 29, 2013 2:36 pm

Hi,

Try using the Tree View3DOptions.VertOffset/View3DOptions.HorizOffset properties. The following seems to work fine for me here:

Code: Select all

procedure TForm1.Tree1Scroll(Sender: TObject);
begin
  if Assigned(ShapeCenter) then
  begin
    ShapeCenter.Top:=round(Tree1.Height/2-ShapeCenter.Height/2) - Tree1.View3DOptions.VertOffset;
    ShapeCenter.Left:=round(Tree1.Width/2-ShapeCenter.Width/2) - Tree1.View3DOptions.HorizOffset;
  end;
end;
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: Reposition Shape Center and Right always

Post by mivchart » Thu Aug 08, 2013 1:09 pm

excuse me for later
ok tank

Post Reply