ScrollBar has now been re-factored to subclass TrackBase with the following major changes:
trackSize
, thumbSize
, etc…) and methods (value to position conversion methods, etc…) have been pushed into TrackBase.pageSize
property is now part of ScrollBar instead of Range.change
event for user interaction, and the valueCommit
event for a change in value.decrement
/incrementButton
.Also, ScrollBar continues to use its own timer…it may be possible to use the Button's autoRepeat
property of the button later on?
There are minor elements not yet ported that we need to decide upon and then implement. See the "To do" section below for details on these.
Several things didn't make it to the new component, either because they didn't fit with the Gumbo architecture (all of the Halo styles were about skinning the component, and don't apply to the Gumbo architecture), they seemed superfluous (disabling double-click events), or there are better or different ways of accomplishing the same things in the Gumbo component (valueChanged
event vs. the old scroll event). In general, the approach is to only port those items that make sense, and not to drag things forward without a clear reason; we want these components to be as lightweight as possible.
lineScrollSize
, etc: Various properties in the Halo scrollbar have been replaced by properties with different, mostly more generically named, properties in the Gumbo scrollbar (and in Range in particular). This is what we want, since these properties can be re-used by other non-scrolling components. So without a mandate to keep the Halo API as-is, it makes sense for these Halo property names to go away.pageSize
vs pageScrollSize
: There used to be 2 separate page sizes to control the amount that would be scrolled on a paging event. Without a clear reason for this extra flexibility, we will leave this behavior behind and just replace it by the new pageSize
property.setScrollProperties
: We used to have a single method where a developer could set the main properties of scrollbar. But even this convenience method didn't allow setting all of the properties (such as the step size). Rather than having duplicate API (this method plus the individual properties), we're leaving this method behind and now just have the properties themselves as the way of setting the scrollbar behavior.isScrollBarKey()
: This was an mx_internals function in the Halo version. Since the key events should happen at the scrolled-container level (not the scrollbar component itself), it's not clear what purpose this function serves, so it's staying behind.minHeight
vs explicitMinHeight
(and width): The Halo code used the explicit version, but it seems better/simpler to use just the minHeight
property instead (which by default uses the explicit property if set).virtualHeight/Width
: These mx_internals properties were linked to the old scrollbar's constraint of horizontally or vertically aligned scrollbars. In the Gumbo architecture, the Gumbo HScrollBar and Gumbo VScrollBar subclasses take care of this functionality, and there is no longer any need for these Halo properties.valueChanged
event. The new approach means that anyone that wants to know the details that used to be in the ScrollEvent would have to query the Range, but this seems simpler than creating a whole event with details that the user can figure out if they really need it.What parts of the code were ported?
The event handlers were ported very similarly, including the Timer-related code for repetition.
What parts of the code were re-written?
The code responsible for positioning the scroll thumb was mostly re-written, to make it more general and less constrained to a vertical-or-horizontal world.
Halo methods or properties that were mx_internal were rewritten to be either protected (if possible to override) or private (if there were other mechanisms to get the same behavior).
What parts of the code are new?
What issues did you encounter during the port?
repeatDelay
. This meant that if you held the track down a second time, it would start repeating immediately. That's not generally how native scrolling works - there's always an initial delay on a new repeat cycle.The enabled
property functionality is split between stuff that's handled automatically for the sub-components (so when we tell the sub-buttons that they're disabled, they do the right thing for themselves) and stuff that has to be handled manually for ScrollBar.
The prototype relied on the propagation of a changed
event from Range. I changed this to directly set up sizes and positions in the setter for value
. This avoided the problem where thumb dragging circumvented the indirect mechanism and just positioned the button directly; now everyone goes through the same direct mechanism.
\
Did this component implementation lead to any architectural changes in the framework?
No. I added a minor amount of functionality to Range and changed that class slightly.
What items are incomplete?
See below