Anchor

From Planimate Knowledge Base
Revision as of 15:43, 1 March 2016 by Rick (talk | contribs) (Created page with "Planimate Table Views, Viewports and Paint Objects have options to control how they are positioned when the panel they are on changes size. These are known as Anchor Options a...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Planimate Table Views, Viewports and Paint Objects have options to control how they are positioned when the panel they are on changes size. These are known as Anchor Options and can be used in various ways.

Anchoring relates to panels which change size because their Panel Option / Engine / Auto Fit Panel To Window is enabled.

Simple Anchoring

Simple Anchoring involves using the "Anchor Left Edge", "Anchor Top Edge" etc options with the "Group Anchoring" options deselected.

When the panel is resized and the Anchor Edge is selected for an edge, Planimate strives to retain the margin between the edge and the edge of the panel. Hence if two opposite edges of a view are anchored (eg: Left and Right), the object will be stretched.

With this approach, you can not have more than one object in a given row or column stretching its size to accomodate available space since they are unaware of each other.

Group Anchoring

Group Anchoring enables Planimate to manage much more sophisticated model UI layouts. Multiple views can scale in a co-ordinated manner to fit the available window area. Selecting the "Group Anchoring" option for an object enables it to be managed but there are some pre-requisites, detailed below.

Group anchoring works by Planimate determining the closest adjacent object to a given object's edge. If there is no adjacent object, then the edge of the panel is used. Thr group anchor manager then strives to maintain the margins between the objects and the edge of the panel and the objects.

To use group anchoring, the panel must have a minimum panel area set and the panel has to be sized at this minimum size. This enables the anchor manager to track a "base", minimally sized layout from which it then creates a scaled layout.

Using The Layout Manager

To add anchoring to a panel, proceed as follows.

  • In Window menu, ensure "Toggle Disable Auto Resize" is selected (ie: auto resize disabled).
  • Use Panel / Work Area to set the panel to minimum size. The panel work area and the mimium area must be the same.
  • Enable Panel Option / Engine / "Auto Fit Panel To Window". At this time the option should not take effect because of the global option Toggle Disable Auto Resize which overrides it.
  • Create a layout of views on the panel. Paint & Viewports are also supported.
  • Set anchors on single edges if you want to retain a margin or both opposite edges to enable scaling.
  • You can access Anchor Options from the object's context menu or in paint mode by alt-clicking on the center of the object. You can toggle anchors by alt-clicking edges in paint mode. You need to select "Group Anchoring" in the anchor options.
  • The anchors should be shown in Blue. If they are red, it indicates the object does not have Group Anchoring selected.
  • Select menubar Window / Toggle Disable Auto Anchor to enable the panel to adapt the layout to its available area. Select menubar Panel / Resize To Minimum For Layout Editing to revert to the base layout.
The layout manager works well for situations for which it is intended. It has known limitations:
  • reflow of objects is not supported (objects rearranging in 2 axes)
  • it does not attempt to handle situations where changes to one axis create/remove a constraint on the other axis
  • Group anchoring and paint on the same object are not supported


Resizing Proportion

Anchor Corner

Size Limiting

Auto Sizing For Table

Anchor Group And Parent