Board index » delphi » Delphi4's main form, drag and dock question

Delphi4's main form, drag and dock question

I'm having problems duplicating the behavior of Delphi 4's main form's drag
and dock behavior.

Here is what I think I know so far...:)

By default, the main form in Delphi4's IDE has several dockable windows, one
for the menu, one for the component pallette, and 3 other dockable windows
for the toolbars/buttons (3 is the default setting; the toolbuttons can be
customized).

Delphi lets us drag these different dockable windows, around on the main
form.  In other words we can drag these windows to different dockable sites
on the main form.

I want to have the same ability in my apps.. but I'm having problems with
the drag-and drop part.

I can easily create a form, that is a dock site, that I can drag other forms
onto.  Once a form is docked though, it can't be dragged around on the dock
site -- its fixed in place.  The docked form has a small 'x' for closing as
well (how do I get rid of that?).  Also, forms that are docked onto the main
form are auto-sized to fit the entire form.

I suspect I'm going to have to override the DockManager's behavior.

Could someone please point me in the right direction?

Thanks in advance
Charles McAllister

 

Re:Delphi4's main form, drag and dock question


Hi,
   You may have set the DockSite property of the form to True, but have you
also enabled DockManager for this form?  It's the UseDockManager property,
and should also be True.  Then DockManager will manage the docking of
forms...

As far as the little "x" goes, it's built in to the docking code in the VCL,
and there is no way of disabling it short of commenting out or rewriting the
relevant code in the VCL (I think it's all in Controls.pas) and recompiling
the VCL, which I've heard of other people doing to get rid of the x.

Regards,

Matt.

Other Threads