User Interface for .NET / User's Guide / Docking Panels / Layout Features

Layout Features
 
 Overview
Layout system introduced in Nevron docking panels is very powerful and extensible. All layout operations are handled by a separate class - NDockZoneLayoutEngine. It works upon a INDockZone object and performs layout logic on its children. By default all layout operations are handled by the layout engine exposed by the dock manager. You may provide your own custom layout engine either at manager's level or per docking zone.
 Size Info

Each INDockZoneChild instance exposes a SizeInfo property which is used by a layout engine to perform layout logic upon it.

 

The following table describes the NSizeInfo object:

 

Property Description

 SizeLogic

Specifies the available types of logic that is applied when resizing layout targets:

 

  • AutoSize - The available autosize is distributed even among all autosizable children.
  • Relative - The child occupies the specified percent of its parent area.
  • Absolute - The child is absolutely sized. 

 

 RelativeSize

Specifies the percentage that should be observed when SizeLogic is Relative.

 AbsoluteSize

Specifies the absolute size to be used when SizeLogic is Absolute.

When there is only one visible child within a zone it will fill its interior regardless of its SizeInfo settings.
 Layout Info

Each INLayoutEngine instance exposes a LayoutInfo property which contains information about a layout operation. A NDockZoneLayoutEngine uses this info to perform its layout logic.

 

The following table describes the NLayoutInfo properties:
 

Property Description

 Targets

Gets the targets for the layout operation. This might differ from the actual children number as some child might be empty (invisible).

 AutoSizable

Gets all children which are to be autosized.

 Bounds

Get the bounds for the layout operation.

 Orientation

Gets the orientation to be used for the layout operation.

 MaximizedChild

Gets (if any) the target that is maximized within its parent bounds.

 AvailableAutoSize

Gets the size that will be distributed even among all autosizable targets.

 Layout Engine

The NDockZoneLayoutEngine object is responsible for adjusting size and location of the children of a INDockZone instance. Every time a zone's bounds are changed it gets its current LayoutEngine instance and asks it to perform layout logic upon its children.

 

The following table describes the layout engine's features:
 

Method Description

 AutoSizeTargets

Calculates the size of all autosizable targets.

 LayoutZone

Performs a layout logic upon a INDockZone instance.

 GetChildWidth

The layout engine calls this method every time when it is about to set a layout target's width.

 GetChildHeight

The layout engine calls this method every time when it is about to set a layout target's height.

See Also