Howdy, Stranger!

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

In this Discussion

Application.MainFormOnTaskBar must be true for conjoined docking to work while over the main form

This may be known "feature", and is no doubt a "feature" of the VCL, but I thought someone else may benefit from my investigation.

After adding LMD docking into an existing product (recently upgraded to Delphi XE3), I came across a particularly frustrating issue. If an floating dock panel was over the application's main form, it was impossible to get any dock sites to appear when attempting to dock another floating panel onto it. All was fine if the floating panels were away from the main form.

After a few frustrating hours, I tracked the problem to the fact that TCustomForm.CreateWnd sets the parent handle of a form with no specified parent to the application's handle if Application.MainFormOnTaskBar is false and to the main form if true. 

Application.MainFormOnTaskBar is by default false for applications created with a Delphi version prior to 2007 (http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/Forms_TApplication_MainFormOnTaskBar.html)

When the VCL is looking for the top-most dock site (in Vcl.Controls.pas), GetDockSiteAtPos uses the TSiteList class to determine which dock site is ontop by checking the z-order of each form's topmost parent. When the floating form's parent is the application's "hidden window" handle, this is UNDERNEATH the main form and therefore ignored in favor of the main form.

Would some sort of assertion/run-time warning be valuable in the LMD code?

Any thoughts?
Tagged:

Comments

Sign In or Register to comment.