In This Topic
The dock layout is a space eating cells layout, which places vertices at per-vertex specified docking areas of the currently available layout area. Its most important properties are:
- HorizontalContentPlacement and VerticalContentPlacement - determine the default placement of the cell content in regards to the X or the Y dimension of the cell bounds.
- HorizontalSpacing and VerticalSpacing - determine the minimal spacing between 2 cells in horizontal and vertical direction respectively.
-
FillMode and FitMode - when the size of the content is smaller than the container size the FillMode property is taken into account. If the content size is greater than the container, then the layout takes the value of the FitMode into account. Possible values are:
- None - the dock layout does not attempt to resolve the available/insufficient area problem
- Equal - the dock inflates/deflates the size of each object with equal amount of space in order to resolve the available/insufficient area problem
- CenterFirst - the dock inflates/deflates the size of the center object in the dock, then the size of the pair formed by the previous and the next one and so on until the available/insufficient area problem is resolved
- SidesFirst - the dock inflates/deflates the size of the pair formed by the first and the last object in the dock, then the size of the pair formed by the next and the previous one and so on until the available/insufficient area problem is resolved
- ForwardOrder - the bodies are resized in the order they were added
- ReverseOrder - the bodies are resized in reverse order to the order they were added
In all cases the minimal and maximal size constraints of each shape are not broken, so it is possible the dock cannot resolve the available/insufficient area problem completely
The following is an example output of the dock layout. The desired size of the final drawing is shown in gray, but note that the fill and fit modes are set to their default value - Equal. That's why in this case the layout inflates the shapes equally to fill the available area.
Supplemental Data
The area at which each cell must be docked is obtained as a per-vertex supplemental data:
- DockArea - a value from the DockArea enumeration.
In Nevron Diagram the DockArea is a member of the NLayoutData class, accessible from the LayoutData property of each shape. The NShapeBodyAdapter adapts the values of the layout data for you.
Related Examples
Windows Forms: Layouts - Dock Layout
See Also