Gumbo FxScroller - Functional and Design Specification
Summary and Background
The skinnable FxScroller component displays a pair of scrollbars and a viewport. A viewport is a UIComponent that implements IViewport, like Group or TextView.
The scrollbars control the viewport's vertical and horizontalScrollPosition and they reflect the viewport's actual size and content size. Scrollbars are displayed according to the Scroller's vertical and horizontalScrollPolicy. By default the policy is "auto", which means that scrollbars are displayed when the viewport's content size is larger than its actual size.
This feature adds classes mx.components.FxScroller and mx.skins.FxScrollerSkin, and the FxScrollBar viewport property.
Detailed Description
In Halo, scrollbar support was intrinsic to all container classes. The 14 properties devoted to scrolling, along with the related internal state and logic, added significantly to the size and complexity of Halo containers. Most of the containers in typical applications don't require scrollbars, so the burden was largely unnecessary. For Gumbo we've factored the support for displaying a viewport and scrollbars into a separate skinnable component called FxScroller. FxScroller's skin provides scrollbars and manages layout according to the vertical,horizontalScrollPolicy Scroller properties. These properties have the same meaning as in Halo (and see the API Description section below).
The connections between the FxScroller's viewport and its scrollbars are created by setting the scrollbar's viewport property. The FxVScrollBar and FxHScrollBar classes bind to the viewport's scroll position and actual and content sizes. They also use the viewport's vertical,horizotnalScrollPositionDelta methods to compute the offsets for page and step scrolling.
API Description
Class mx.components.FxScroller
The FxScroller component displays a single scrollable component, called a viewport, and a horizontal and vertical scrollbars. The viewport must implement the IViewport interface. The scrollbars control the viewport's horizontalScrollPosition and verticalScrollPosition properties. Scrollbars make it possible to view the area defined by the viewport's contentWidth and contentHeight properties.
The scrollbars are displayed according to the vertical and horizontal scrollbar policy, which can be auto, on, or off. The auto policy means that the scrollbar will be visible and included in the layout when the viewport's content is larger than the viewport itself.
mx.components.FxScrollBar viewport Property
One property and five methods were added to the FxScrollBar to support linking a scrollbar and a viewport. Most of the linking "work" is done by the vertical and horizontal FxScrollBar subclasses FxVScrollBar and FxHScrollBar.
B Features
Content size changes should be reported with a ResizeEvent, for consistency with changes to a component's acutal size.
Examples and Usage
To make an viewport, like a VGroup, scrollable, add a Scroller parent:
<Scroller width="100%" height="100%">
<VGroup>
.... scrollable items here
</VGroup>
</Scroller>
In this example the scroller's default "auto" scroll policies specify
that the scrollbars will appear as needed.
Additional Implementation Details
None at this time.
|
 |