Page 1 of 1

Reposition Shape Center and Right always

Posted: Fri Jul 26, 2013 1:00 pm
by 10551078
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;

Re: Reposition Shape Center and Right always

Posted: Mon Jul 29, 2013 2:36 pm
by yeray
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;

Re: Reposition Shape Center and Right always

Posted: Thu Aug 08, 2013 1:09 pm
by 10551078
excuse me for later
ok tank