Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

How to dock a panel inside another dock?

When i start my program, I make a panel float. I also would like to make another floating panel to be docked inside the first one. How do I do that?
Like that I will have one floating dock with 2 tabs inside.
Thanks.
P

Comments

  • 5 Comments sorted by Votes Date Added
  • Hmm.... Every floating panel is docked into special floating site. Its a descendant from TLMDDockSite class. Basically, you can easily find it iterating all panel's parent controls. After that, use site's DockControl method to dock another one panel into it.
  • Could i get some code with that? I have no idea on how to do that and I do not see anything in the small manual.
    I have a panel called brush.
    I make it float at run time .
    Then i have another panel called textures that i make float too. At design time, they are both docked together and they look like tabs.
    I would like at runtime to make textures dock inside the floating brush panel.
    Could you show me on how to code that?
    Thanks.
  • Hi,

    You can use code like this:

    var
      c: TWinControl;
    begin
      brush.ManualFloat(Rect(...));

      c := brush;
      while (c <> nil) and not (c is TLMDDockSite) do
        c := c.Parent;
      Assert(c <> nil);

      TLMDDockSite(c).DockControl(textures, brush.Zone, alClient);
    end;
  • edited December 2012 Posts: 0Vote Up0Vote Down
    Ohhh... Its possible to do it much simpler :) 

    begin
      brush.ManualFloat(Rect(...));
      brush.Site.DockControl(textures, brush.Zone, alClient);
    end;
Sign In or Register to comment.