Question

I want to add docking capabilities in an application, haven't had a need for that, now I do, but whenever clicking and dragging a panel towards or from a "docksite", the window rectangle is painted ugly(flickering) on the desktop canvas.

So, my question is:

  • any simple and elegant way to overcome this by overriding some method?
Was it helpful?

Solution

There's a brilliant Sample Project available on the Official RAD Studio Demos SVN Repository. This demo does everything you're trying to do with regards to tidy docking without flickering. It perfectly recreates the way Windows can be docked in the RAD Studio IDE itself.

OTHER TIPS

I do a lot of docked UIs, and the only way I've found thus far is by using a third-party docking solution such as found in the JVCL.

If you drop a TJvDockServer on your main form (the one into which other forms will be docked), then drop a TJvDockClient onto each of the aforementioned docked forms, assign both the same Style (such as TJvDockVCStyle), it totally changes the behaviour of docking, including the rendered rect when dragging the windows to dock.

Perhaps you could pull from these components the desired code to draw your own custom rect to represent the forms when dragging to dock.

The emba code sample has moved: svn://svn.code.sf.net/p/radstudiodemos/code/branches/RadStudio_XE/Delphi/VCL/Docking

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top