A docking manager base class, implementing some default functionality.
The DockMaster base class, managing docking and screen layout issues in an application.

The global DockLoader variable represents the installed DockMaster singleton.

It provides means to make forms dockable on all platforms (MakeDockable), and to save and reload screen layouts.

Indicates whether the DockMaster should try to create docked controls himself, when a layout is restored.
Makes a form dockable, on all platforms.

All docking-related properties of the given form are set to appropriate values.

fWrap indicates whether the form shall be wrapped into a FloatHost site. The Result is that FloatHost form, always Nil in the default implementation.

fVisible indicates whether the form shall be made visible immediately. Leave the form invisible when otherwise further customization would cause the form to flicker.

Returns an string, containing all required information for reloading the control later.

The content of the string is not restricted in any way, it only must be understood by ReloadControl.

1. When the control is a TCustomDockSite, its SaveSite method can provide the string;
2. else an installed AppLoadStore callback can provide the string;
3. else an OnSave handler can provide the string.
4. When no string has been provided so far, a default control-descriptor string is created.

Provides a docked control when a layout is restored.

The descriptor string is parsed into ControlDescriptor, accessible to the subsequently called procedures.

1. When the string begins with a CustomDockSiteID, it is passed to TCustomDockSite.ReloadSite.
2. Else an AppLoadStore or OnRestore handler is invoked, if installed.
3. When no control has been provided, FindOwnedComponent is invoked.
4. When TryCreateControls is True, the control is created from its registered ClassName.
5. As a last resort the site.ReloadDockedControl is invoked.

Application handler for SaveControl.
Application handler for ReloadControl.
Descriptor of the control, that currently shall be restored.
A general persistent docksite.
Restores a docksite from its description.
This is a class function, because it will create and return a new docksite.
Returns the docksite descriptor as a string.
The string begins with the CustomDockSiteID, to distinguish a docksite from any other docked control. The rest is added by SaveToStream.
Reloads the docked controls from a stream.

The DockManager is asked to restore the docked controls.

Unmanaged docksites must overwrite this method, to process their own descriptor string.

Saves the docksite description to the stream.

The description actually is saved by the DockManager.

Unmanaged docksites must overwrite this method, to provide their own descriptor string.

The marker for an docksite layout descriptor.

This marker is used in layout descriptor strings, to distinguish docksites from other controls.

Default descriptor strings start with the control name, so that values in the range 2..32 can be used as markers for special docksites, like custom docksites (1) or notebooks (2). These non-standard markers must be handled by application specific loaders, e.g. DockMaster.OnRestore handlers.

Event handler type for the DockMaster OnReload event.

The handler creates the docked control from the descriptor in AName.

AOwner is the default owner for the new control.

When the handler returns Nil, the DockMaster tries to create the control by default procedures. I.e. an application specific handler must only handle non-standard situations.

Event handler type for the DockMaster OnSave event.

The handler must handle all non-standard situations, when a specific control requires special construction or configuration. When an empty string is returned, the DockMaster creates an standard descriptor for the control.

The result is a descriptor string, that is passed to the OnReload handler when the layout is restored later. It's suggested to prefix the string with a special marker byte, in the range 3..32.

Class type of a persistent docksite.
Docksites derived from this type are handled automatically be the DockMaster, when a docking layout is saved and reloaded.