Managing Fold Up Panel Frames
- Last UpdatedOct 27, 2022
- 2 minute read
FoldUpPanels are provided essentially to support forms which display simple, single column, vertical frame stacks.
The form shown below is a simple resizable dialog with five FoldUpPanel frame gadgets. When first shown, the first and last are expanded and the other three are collapsed.
Each panel has a title bar which displays the frame's tag text, and an 'expander' icon on the right.
You may specify the panel's background color using the <fgcol> graph, e.g. BACKGround lightGold, backg 23, backg FORM etc.
The default state is 'unfolded' and the EXPANDED property allows you to initialize a panel to unfolded (true) or folded (false).
When the panel expands or collapses, any gadgets which lie below the panel will move down or up the form.
For simple dialogs the form will resize to create space when a FoldUpPanel is expanded, and to absorb space when it is collapsed.
For docking dialogs the form will not resize as FoldUpPanels are expanded or collapsed. Generally a scroll bar will automatically appear whenever gadgets have been moved off the bottom of the form, so that the entire form is always accessible.
Care must be exercised when mixing FoldUpPanels at the same level as other gadgets which manage their resize behavior with Anchor or Dock attributes. For example, consider a simple dialog form with a frame gadget which is anchored 'bottom' and vertically below, a FoldUpPanel. When you collapse the panel, the form will not absorb the spare height, because the distance from the frame's bottom edge to the form's bottom edge is fixed by the 'anchor', so the anchored frame has to contract instead, and spare space will appear at the bottom of the form.
