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

My team is currently thinking of moving our existing MDI-based application to a more modern, docking-based approach. We're still thinking, but we'd like to move it to something like VS2010's docking and visual look:
This has the following features:
Shows a blended outline where the window will dock
Docks into tabs, as well as side-by-side
Allows docking by dragging and releasing over an image showing the dock position (I call this a 'docking widget' below)
Looks pretty good too (theme / UI-wise)
I am having trouble finding a good-quality docking library to use with RAD Studio 2010 and am seeking advice on either what library/ies I haven't found, or how to use the ones I have found to achieve something like this.
Update: I ended up buying AutomatedQA's docking library. I think it's the best. More details below in the section about it.
Update 2, July 2011: This question looked at every single docking library available for Delphi/C++Builder, so I'm trying to keep it up to date. Two changes that I'm aware of:
SmartBear, who now own AutomatedQA, have end-of-lifed AutomatedQA's docking library. This the one one I recommended buying. They are considering open-sourcing it.
The one problem I had with DevExpress docking (that made it not worthy buying) was its lack of support for VS2008/10-style docking, with a docking widget, transparent overlay as you dragged, etc. They are now implementing it. Because of this, and since AQDocking is no longer being sold, if I asked this question now my accepted answer would be to buy DevExpress Docking.
I've found the following libraries. Here's an overview:
Inbuilt VCL docking
This allows forms to be docked on other forms or TWinControls, but appears to be quite basic. Forms drag using an XOR painted outline, which works very badly on Vista and Win7. There is a TTabDockSet control for tabbed docked forms, but I can't figure out how to control how the docked forms' titles render once docked. I think implementing docking side-by-side will have to be done manually, creating new docksite panels on the fly. The RAD Studio IDE's docking windows are a bit slicker than this (transparent rectangles when dragging a form, for example) which is odd, since I thought it used the VCL docking support.
JVCL docking
This looks a bit more of a decent solution that the inbuilt VCL docking. It supports docking on any edge or the client, and shows an alphablended rectangle where the form will dock.
It appears to be quite buggy (dropping a second form on top of a first is allowed, but freezes the program) and has no inbuilt tabbed dock support or any kind of drop-location widget.
LMD Docking Pack
This looks promising: while it doesn't seem to directly dock forms, it has docking panels and controls / frames are placed on that. Existing forms could be migrated to frames. It also has a docking widget and tabbed dock support.
However, the demo seems to be quite unreliable. I've got the latest evaluation version installed, and creating a new project with a dock site and several panels and pressing Run causes the following:
This is crashing in the form component streaming. Visually examining the DFM file doesn't show anything wrong, but there's an opaque binary blob for the layout information that may be causing it. This is not especially encouraging in an evaluation version.
DevExpress ExpressDocking
I had high hopes for this: I've never used any DevExpress controls before but they have a good reputation. But their demo program was really disappointing:
The control is flickery and doesn't seem to theme well with Windows, even using the XP style. It does have tabbed docking but it uses an XOR-ed outline - something that doesn't work well on XP or Vista. It also does not have any sort of docking widget. Frankly, it looks like it hasn't been updated since the Windows XP days. Update July 2011: This is being improved.
AutomatedQA / SmartBear docking library
This is the most promising of all the libraries so far.
I regularly use AQTime, an excellent profiler which appears to be written using their own docking library, and it works well. However, the latest version of the docking library trial download is for RAD Studio 2009, and the advice given for installing into 2010 is that it's unsupported, and you should recompile the source. The demo doesn't come with source, and we don't have RS2009, and the installer refuses to install unless we do, and even if we manged to get it to install we can't use it since we would need to recompile the non-existent source.
I've been in touch with their support team, and they pointed me to this thread. I also found another thread with customers asking much the same thing. I've replied and hope to hear better news. I'm not keen to recommend we buy a product I can't evaluate, especially when it's not supported for our IDE.
Update: I have ended up buying this library. In spite of problems evaluating (it works in D2007, and I had a copy of that) it seems the easiest to use of all the libraries, and also the most powerful - it's easy to write a theme for it, for example. I'd definitely recommend it if you need to select a docking library too.
Update July 2011: This library is no longer being sold, but may be open-sourced soon.
What have I missed?
That's everything I've found so far. What now?
Have I missed any good docking libraries for Delphi / C++ Builder / RAD Studio 2010?
Have I missed any features in the libraries I've lookd at so far? An answer like "You missed FooBar" or "JVCL does indeed have a docking widget, and you can use it like so..." would be pretty awesome to hear.
What would you recommend as my next step?
Thanks for your input :)

I am a jedi JVCL developer, and I have used JvDocking in my own commercial in-house projects, and found it to be solid and reliable.
Also, it's free. It's easy to extend. It creates a look and feel about the same as visual studio 2008 era docking.

I haven't found a single library that does everything that I would like, so after doing some experimenting I found that I could do almost everything I wanted by using the Native VCL Docking (NVCLD) controls with a series of custom modifications and some additional controls.
The following is a list things that I've run across in getting the NVCLD to work the way I wanted. I haven't had many problems porting between versions, but that's because I've got the src as well.
If your not looking to roll your own or you really want to use a 3rd party library then you can probably stop reading the rest of this. :)
Additional Components:
TDockPanel
This heavily modified docking panel is the workhorse my system. I found the original on the net but have modified it since to provide a little greater flexibility for my needs.
Custom Docking Forms (Base form)
By using a custom base class for my docking forms and inheriting it when needed I have less modifications to do on all of the descendant forms.
Custom Modifications
These are modifications to the .pas files of the NVCLD components themselves. Most of these modifications no longer have to be done because of some enhancements made to the base controls starting with D2009. You should be able to just create a new descendant and implement the changes in the there instead of modifying the default src files directly.
Transparent Docking Forms
By default (pre-2009 for sure) the NVCLD doesn't support the transparent form movement. There was a JVCL patch released a couple of years back that added that support to the JVCL which was simple to incorporate into a NVLCD patch.
Docking Manager
The default docking manager (pre-2009 for sure) didn't allow for newer/custom button images or docking header changes. This was rectified in D2009 I believe when the necessary methods where made virtual.
Tabbed Docking
To support the Additional docking components I needed to modify the DockTabSet.pas file to support additional docking properties used by the additional components. Most of this was corrected when the Docking Manager was modified as mentions previously.
As I stated most of these changes I made directly to the Delphi Src files and you shouldn't need to do that for newer versions of Delphi. My point is that with a little bit of work up front you can have a fairly robust docking system with out resorting to using a 3rd party library. Not that there is anything wrong with any of them, but I prefer not to use them unless I have no other choice or don't have the time to make it work my way.

I have used JCL, I have LMD, DevExpress and Automated QA Docking Library.
The closest you will find that will meet your need is the AutomatedQA Docking Library. I use it in my work for one of my projects.
Your next step, buy the AutomatedQA Library :)
from a Happy Customer.

Related

Form/Button/other component styles

Ok, so I downloaded a .zip file of all different kinds of examples from embarcadero... the way the buttons look and among other things are completely different from when I just create an application within my Delphi 7. I believe these examples were made for or made at a new time... because the button look way different from the way the button when I put them on my application. the buttons from the example look very modern and sleek and have mouse over effects (This applies for all the examples..its not a custom component ) I was wondering I can get this effect in my own applications within Delphi 7.. I can do this by opening one of the examples and just erasing all the code... but that's not what im trying to do..im wondering how I can accomplish these styles.. how come the examples have these nice looking buttons and such..but when I make an app within D7 its much older looking and such..
I apologize if my question is hard to understand.. and I appreciate any help on this.
Thank you in advance.. I appreciate it.
If I understand your question correctly, you're asking about the native control appearance changes that were added by the addition of Windows Themes in Windows XP.
Delphi 7 supported themes by use of the XPManifest component, which does nothing but add a manifest to your application which tells Windows your app is theme-aware and therefore it should load a more recent version of the common controls library. You can find the XPManifest component in the VCL component palette on the Win32 tab, or simply add the XPMan.pas unit to your uses clause. Note that the themed drawing does not work for all controls (grids, for instance, are not drawn using themes, and IIRC neither is TSpeedButton - it's been a long time since I used D7, so I'm not sure exactly what is and isn't supported, but the support is limited).
Starting with Delphi 2007, there is built-in support for Windows Themes, which is available by default in new projects. It can also be enabled in older projects using a checkbox in the Project->Options->Application dialog.
(Of course the real answer is that if you want your app to have the features included in modern versions of Windows, you should upgrade from your Windows-95 era version of Delphi to one that is more recent.)

How do I do Drag and Dock like the Delphi IDE with pins and tabs?

I would like to make Drag and Dock work as well in my applications as it does in the Delphi IDE (i.e. being able to drag around the Object Inspector / Structure View and Dock them at suitable sites). I've had pretty good success with docking forms into a PageControl, but was wondering if anyone knows how to get it to work with the the little close buttons and pins and so on.
I'd also be interested to know what components the Delphi IDE uses to achieve this.
The reason for my question is I want to make much more advanced videos on how to do this, the two that I have done previously are here and here.
You can use JVCL JvDocking components to drag and dock, in almost any version of Delphi. It's free and open source. The style with pins and close buttons is available using a docking style called the VID (visual interdev) style, that comes with JvDocking.
There are already a bunch of commercial alternatives also, and there is some support built into Delphi, which I find insufficient for my needs. While the Delphi IDE has its own internal docking library, tab support is very limited, slow, and in my subjective opinion, broken.
However, even on ancient delphi versions, Delphi 7 and up, JvDocking, provides all the functionality that the VCL's docking provides, plus more, so there's no problem ignoring the built in VCL functionality, which is to docking as TStringGrid is to real Grids.
Steps with JvDocking:
Drop dock server and dock style object on main (host form) and connect them.
Drop dock client component on the client (form to be docked) and connect it to the dockstyle.
Configure properties of dock server.
Run app. Have it create a form. Now drag the client form to an area that is made dockable by the dock server. Watch it dock nicely.
For docking in code demos see the JvDocking demos in the JVCL Examples folder.
Update
Or you can use what is built into the Delphi VCL since XE and XE2. XE and XE2 include a docking demo project named dockex.dpr.
On Win7/Vista the demo is located at:
C:\Users\Public\Documents\RAD Studio\9.0\Samples\Delphi\VCL\Docking
Look here for the demo on Win XP:
C:\Documents and Settings\All Users\Documents\RAD Studio\9.0\Samples\Delphi\VCL\Docking
You should also check out the documentation for TDockTabSet in the VCL, and the EDN article linked in the comments, which has source code you can download here. In my humble opinion, the Jedi JvDocking stuff is more professional and slick than the Docking Demo that ships with Delphi, but the built in stuff has the advantage of working without installing anything additional. I just tried the DockTabSet demo and the built in docking demos, and they are slow, and the painting is ugly and flickers. JvDocking looks professional. It's your call.

How to implement this type of Docking?

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
During Dragging/Docking stage
When dragging/moving one of the Dock Panels the Window now looks like this:
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.
See this old question for docking library.
Recommendations for a docking library for Delphi / C++Builder?
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?
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
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.)
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.

Transparent checkbox with theme-support?

I'm looking for a simple, transparent checkbox component that properly supports XP/Vista/7 theming.
It should also work with Delphi 7.
I've found a component on Torry's that's not working properly, and I know that Raize components has a transparent checkbox - but I'm obviously not going to pay $300 for the entire package just to get this single component.
I've also found many other solutions, but none of them support theming.
The main problem is that TCustomCheckBox is a TWinControl descendant, and in order to implement transparency, you need to make a new TGraphic descendant control from ground up.
Any ideas?
LMD-Tools SE is free, works great on Delphi 7 and has a checkbox component that has a transparency property. I've recently used TLMDCheckbox with its transparency property enabled with Delphi 7.
http://www.lmdinnovative.com/download/index.php#LMD
Download file: setupse10d7.zip. Sorry, I can't post the whole path (url) since I don't have enough juice yet.
This should fix you up :).
ShawnH.
Raize Components is overkill for just this component, but much more capable and supports transparency in a whole load more components. Once you have it, you'll appreciate the other items greatly. I'd say it is the solution you are looking for.
If you can accept an alternative control there is JvXPCheckCtrls.pas with its TJvXPCheckbox component in the JVCL library. http://jvcl.delphi-jedi.org
I think (if I remember correct) it is transparent when themes are used.
It's quite a large package which will add to vcl with the installation of Jvcl. And it doesn't cost you a cent.
But remember, the TJvXPCheckbox component is part of their XP-controls package and you cannot simply lift out the component as a standalone. You will need the installation of Jedi and to get the core code and necessary theme handling to use it.
- Its Mozilla Public Licence ("MPL") version 1.1.
I use AlphaControls for some of my programs - all of their components are skinnable and have reasonably powerful graphics handling options. A lot of the components also have more features than their corresponding Delphi standard components - some I just use for those functions alone. There's a free Lite version available at www.alphaskins.com - it may just be what you're after. It's not Vista/7 theme-aware, mind you. We use Delphi 2010 and vista/7 theme awareness is built into the standard VCL there, although that's probably not the solution you were hoping for.
Not sure if this will help, but I ran into what I think is the same problem when working with the TMSSmooth controls: the label of a checkbox place on a form looked terrible because it was not transparent.
Their demo/example programs had nice looking checkboxes so I took a look at their sample code.
Turns out they reduced the width of the checkbox component to 13 so that only the box itself and no caption shows. Then they added a TLabel for the caption.
Seemed like a clever workaround to me.
Hope this helps.

Switch GUI application behavior between SDI and MDI

I currently have an SDI application that is build with Delphi 7, I want the final user to choose the type of interface between SDI and MDI at runtime. my question is how can I change the behavior of the application between SDI and MDI at runtime?
Currently I know a couple of applications build with delphi that allow this: EMS SQL Manager and TOAD.
thanks in advance.
Download the Jedi JVCL and install it and look at the Demos for JvDocking "docking in code". They do this exactly.
They mean that you do not actually use the FormStyle=fsMDIChild unless you want lots of problems. MDI is "emulated" when you need it by docking in code.
Do not convert windows into frames. This is a bad solution.
For an MDI-like environment, that does not have the MDI problems, use a docking solution (components either commercial or open source that support docking). I use JvDocking which is included in the JEDI JVCL, which is free and open source.
You use your forms in both "docked" and "undocked" (floating) modes, and this gives you a docked IDE look and feel (VIsual Studio and RAD Studio), and an undocked IDE Look and feel (RAD Studio in undocked, or classic delphi 7).
I would convert my current windows into frames and put these frames with align=alClient into either mdi child windows or normal windows as configured.
But beware: I have never actually done this, so there might be problems that I don't know about.
At runtime set TForm.FormStyle either to fsNormal or fsMDIChild depending on if you want SDI or MDI.
Like #WarrenP's solution, I strongly recommend a docking-based solution. It should be said that you don't need to use Jedi VCL to achieve this. As an example, here's a very simple (all-native-vcl) component I've produced which allows you to simply drop on as many instances to your form(s) and set their alignment to enable docking (and tabbed docking) in those regions.
MDI itself is an accident waiting for a place to happen. There are solutions available to achieve the "MDI look and feel" without using MDI itself, though I've yet to encounter one I'd consider "neat" (probably for a lack of looking).
Ultimately you should probably question the wisdom in providing MDI as an option. Docking (with or without the ability to undock, and especially when Tabbed Docking is a user-determined choice) feels more modern, and (done properly) can be far more flexible and intuitive than MDI ever was.
Just my 2-pence worth.

Resources