SetPanelScroll panel[,enabled]

Parameters

panel - panel gadget

enabled (optional) - True to let the panel scroll its children vertically (default); False to stop

Description

Lets a panel hold more than fits in it, scrolling its children vertically.

Use it for a property inspector with many sections, a long settings page or a list of tools. The content ends at the bottom of the lowest visible child. A vertical scroll bar appears only while that is below the panel's bottom edge, and the children's right-anchored layouts shrink to leave room for it.

The range follows the children automatically: showing, hiding, moving or resizing a child updates it, so expanding or collapsing a section needs no extra calls. Gadget coordinates never change while scrolling. GadgetY still reports a child's unscrolled position; only the native windows move.

The mouse wheel scrolls anywhere over the panel. Over an unfocused combo box, trackbar, slider or spin box, it scrolls the panel instead of changing that control's value. A control that receives keyboard focus, for example with Tab, scrolls into view.

Give the children top-anchored layouts with fixed heights, such as SetGadgetLayout gadget,1,1,1,0. Use PanelScrollY and SetPanelScrollY to read or set the position. Calling SetPanelScroll panel,False removes the scroll bar and returns the children to their places.

The World Editor's inspector uses a scrolling panel for its sections.


See also: CreatePanel, PanelScrollY, SetPanelScrollY, SetGadgetLayout.

Index