4
votes

Take a look at this Open Source Application called Construct .

It uses Panel Docking where you can drag a Panel, and then some on screen visual aids to show where the Panel may be docked, as seen below:

Before Dragging/Docking

enter image description here

During Dragging/Docking stage

When dragging/moving one of the Dock Panels the Window now looks like this:

enter image description here

As you can see, when dragging/moving the Object Panel it displays the visual aids of where the Panel can be docked. It also moves around like a free Window when not in a docking position. The same applies when dragging/moving other Dock Panels such as the Project Panel in this example.

This is an example of an Application using this, I have also seen other Applications employ this too.

Is there a Delphi way of acheiving this behaviour?

I have some panels that take up some space, freely moving or docking them would be useful feature to implement.

Thanks.

UPDATE

It seems the LMD Components offer such a component which I may look into.

5
it's been almost a week since the last activity on this question, and no accepted answer. Can I suggest you check out this question linked by @Neftali below? It examines all docking libraries available for Delphi, and I've been keeping it up to date as things have changed. (Re your update: I personally found the LMD components unreliable, see that question for details.) - David

5 Answers

4
votes

Why there shouldn't be a way of achiving this in Delphi?

I don't know if there are free components around but DevExpress offers a library for it and other vedors for sure have such libraries in there portfolio too.

If you're interested in coding such a thing your self, you might take a look at Dockpanel Suite it is written in C# but the WinAPI fundementals behind it are the same.

Addition:
does anyone know of good delphi docking components?

4
votes

There's a new release of the DevExpress docking components coming soon. It includes the Visual Studio style docking that you show in your image.

See this link for more information: http://community.devexpress.com/blogs/ctodx/archive/2011/04/26/sneak-peek-visual-studio-dock-style-for-vcl-docking-library-coming-in-v2011-1.aspx

3
votes

Delphi supports this out of the box. There's a limited demo (meaning they didn't demonstrate all of the functionality) in the Samples (Demos) folder, depending on which version of Delphi you're using. In Delph7, for instance, it's in $(DELPHI)\Demos\Docking, and in D2007 and up you'll find it in C:\Documents and Settings\All Users\Documents\RAD Studio\x.0\Demos\DelphiWin32\VCLWin32, where x.0 refers to the Delphi version. The locations for D2009 and XE will vary if you've installed on Vista or Win7, but I'll trust you can track them down; if you can't, use the Start Menu's Embarcadero RAD Studio <version>, and choose Samples.

There's also the TDockTabSet component included in later versions of Delphi, and you can find an article and code at Embarcadero Developer Network explaining and demonstrating it's use. (TDockTabSet is pretty much what's used in the IDE for docking now, I believe.)

1
votes

I did a few intro videos on dockable forms in Delphi, there are available here and here. They're also on YouTube - Part 1, and Part 2. They are pretty introductory however.