4

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.

  • 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](http://stackoverflow.com/questions/3394289/recommendations-for-a-docking-library-for-delphi-cbuilder) 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 Jun 23 '11 at 01:05

5 Answers5

6

See this old question for docking library.

Recommendations for a docking library for Delphi / C++Builder?

Community
  • 1
  • 1
  • +1 .The automated QA library has exactly that visual appearance. – Warren P Jun 16 '11 at 23:29
  • 1
    Hey, that's my question! +1 :) Btw, it's not very old - as far as I know, its content is still up to date for available releases. Also it looks at every single docking library around for Delphi/C++Builder, so it's a good overview of all options for the OP's question. – David Jun 17 '11 at 00:20
4

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?

Community
  • 1
  • 1
ba__friend
  • 5,783
  • 2
  • 27
  • 20
4

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

norgepaul
  • 6,013
  • 4
  • 43
  • 76
3

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.)

Ken White
  • 123,280
  • 14
  • 225
  • 444
  • 3
    -1. `dockex` sample project only showing how problematic out-of-box functionality is. (shown: 2 glitches, not shown: heavy flicker, dragging artifacts, cpu hogging)(http://i.imgur.com/SLN3z.png) – Premature Optimization Jun 16 '11 at 18:44
  • Delphi only sortof supports it out of the box - there's no widget support (that plus symbol you can drag onto), and it's all a bit clumsy to use. In D2010, at least, it also doesn't drag transparent blue windows, which is surprising since the IDE does. – David Jun 17 '11 at 00:23
  • 4
    Out of the box, Delphi docking support is "vestigial" or "a start", and not complete enough to handle most of what the OP needs. A third party library is essential, either commercial or open source. – Warren P Jun 17 '11 at 00:40
1

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.

Alister
  • 6,527
  • 4
  • 46
  • 70