Floating a Docking Control

To float a docking control

  1. Left-click the mouse on any part of the docking control.

  2. Drag the control to a non-docking position (indicated by a double dotted border on the dragging rectangle).

  3. Release the mouse.

Alternatively, you can also float a control by clicking on the docking control, dragging the control while holding down the Ctrl or Shift key, and then releasing the mouse. The Ctrl key causes the floating window to adopt its current horizontal size and the Shift key causes the floating window to adopt the smallest possible horizontal size.

The JadeDockBase class drawGrip property optionally displays a grip bar on the control so that it is easier for the user to click on the control. It can also indicate to the user that the control can be dragged.

Pressing the Esc key before releasing the mouse abandons the dragging process so that docking or floating does not occur.

A docking control can be floated only if its floatingStyle property is not FloatingStyle_None (0) and it has visible children. If the floating style is FloatingStyle_None (0), the control is then effectively just another container with additional alignment capabilities.

Floating a docking control causes the following actions.

Floating a docking control causes the form to re-evaluate the alignment of controls affected by the control that is being removed from the form. Floating a control does not cause the form size to be changed or non-aligned controls to be repositioned.

The userResize event method is called on a floating JadeDockBar or JadeDockContainer control if a user resizes a floating form (JadeDockBase control). If you want to differentiate between the userResize event being called when the user drags the resize bar of a control and when the user has resized the floating window, call the isFloating method.

To handle the removal of the docking control from the form, you should place other non-aligned controls on a Frame control that has the alignContainer property set to AlignContainer_All (5) and that is a sibling of the docking control. The alignContainer property automatically handles many floating and docking requirements. (For details, see the alignContainer property.)

If the form is an MDI frame, by default, the MDI client window that hosts the MDI child forms is automatically repositioned and resized (unless Form::moveMdiClient has been called, in which case it is your responsibility to handle this in your logic).

When floating docking controls, you should be aware of the following.