Main Page | Packages | Class Tree | Index | Help

xp.controls

class ScrollBar

MovieClip
  |
  +--xp.system.UIControl
        |
        +--xp.controls.ScrollBar


class ScrollBar
extends UIControl

ScrollBar
A standard scrollbar that can be orientated verticaly or horizontaly.

The ScrollBar scrolls content that conforms to the IScrollTarget interface.
The IScrollTarget interface is the notional interface implemented by the TextField builtIn object to provide scroll support
The standard TextFields implements this Interface but the ScrollBar can work with any custom control as long as it implemement this interface.
In order to simplify the process of adding scroll support to your own controls we provide the ScrolTarget proxy class.
The ScrollTarget class implements the IScrollTarget interface for you and helps to relay events between the two.
To change the scrollbar from a vertical orientated scrollbar to a horizontal scrollbar change the orientation property and then resize the scrollbar to the required dimension.
You do NOT need to rotate the scrollbar.
The horizontal property determines whether the ScrollBar uses the scroll or hscroll properties on the IScrollTarget interface.
It is NOT connected to the physical orientation of the scrollbar, although commonly both indicate the same mode.
It is NOT a requirement that physically horizontally orienatetd scrollbars must use the hscroll property.
At author time you should also alter the dimension of the scrollbar as required.
The properties of the ScrollBar class let you adjust the scroll position and the amount of scrolling that occurs when the user clicks the scroll arrows or the scroll track.
The ScrollBar unlike most other controls does not emit events instead it calls hscroll and scroll methods on the ScrollTarget

If backgroundVisible is set to true, then when the scrollbar is not required(disabled), then a themed gradinet background will be displayed.
If backgroundVisible is false it reverts to the standard mode where it display the button and track but hides the thumb when not required(disabled)

Events:
enabled xp.events.StateEvent


Author:
ProWin Computers Ltd. - Rob Edgar

Version:
3.0.0.000

See also:


Field Summary

public static
classInfo: Object
A static class information object

public
horizontal: Boolean
A Boolean value indicating whether the scroll bar is scrolling the target vertically (false), the default, or horizontally (true).

public
liveDragging: Boolean


public
styleClass: String
The name of the style class this instance will use.

Fields inherited from class xp.system.UIControl

__layout, allowDrop, autoLayout, bindingDefaultValue, bindingFormatter, bindingPath, bindingSource, bindingType, bindingValidator, border, causesValidation, classInfo, clickOnENTER, clickOnSPACE, container, context, data, disableAcceptButton, disableCancelButton, enableBGMouseEvents, enableDblClickEvent, enableKeyDownEvents, enableKeyEvents, enableKeyUpEvents, enableMouseWheelEvents, formatterOptions, horizontalAlignment, index, isBinding, itemId, logEnabled, parent, parentContainer, parentForm, percentageHeight, percentageWidth, styleClass, tabIndex, tabStop, tooltip, tree, verticalAlignment

Property Summary

public
backgroundVisible: Boolean (read, write)
redeclare to change default

public
largeScroll: Number (read, write)
The number of lines or pixels scrolled when the user clicks the track of the scroll bar.


public
mode: String (read, write)
Controls the mode either scroller or slider

public
orientation: String (read, write)
A value indicating whether the scroll bar is oriented vertically (vertical), the default, or horizontally (horizontal).

public
scrollPosition (read, write)
The current scroll position of the scroll bar.

public
smallScroll: Number (read, write)
The number of lines or pixels scrolled when the user clicks the arrow buttons of the scroll bar.

public
virtualWidth: Number (read-only)
calculates the effective space required for the scrollbar

Properties inherited from class xp.system.UIControl

alpha, autosize, background, backgroundVisible, bindings, borderBrush, borderRadius, borderShadow, borderStyle, borderThickness, bottom, dataSource, enableMouseEvents, focusManager, height, id, isEnabled, isFocused, isMouseOver, isPressed, isSelected, isValid, layout, left, margin, maxHeight, maxWidth, measuredHeight, measuredMinHeight, measuredMinWidth, measuredWidth, minHeight, minWidth, padding, readOnly, resources, right, styleName, top, triggers, visible, width, x, y

Constructor

public
ScrollBar ( )
Constructor - This should not be called directly.


Method Summary

public
getClass ( ): Function
Returns a reference to the components static class

public
onChanged ( t )
called by scrolltarget

public
onScroller ( t )
called by the scrolltarget

public
resizeBar ( v: Number )
resize the scrollbar "height" makes allowance for the orientation of the bar

public
setScrollTarget ( t ): Void
Assigns the ScrollBar to a scrollable control

Methods inherited from class xp.system.UIControl

addBinding, addBindings, addEventListener, addPropertyTrigger, applyStyle, beginDeferUpdate, canUpdate, centerContent, checkState, containsFocus, destroy, destroyObject, drawFocus, endDeferUpdate, findFocusFromObject, findFocusInChildren, getBinding, getBounds, getCenter, getClass, getFocus, getFocusManager, getFocusRect, getLocation, getPropertyValue, getSize, getStateName, getTrigger, globalToLocalPoint, invalidate, invalidateLayout, invalidateSize, invalidateSizeAndLayout, invalidChild, isChild, isMouseDirectlyOver, isParent, localToGlobalPoint, localToLocalPoint, measure, mouseWheel, move, onChildFocus, onKillFocus, onSetFocus, processEnterKey, processEscapeKey, processTabKey, redraw, refresh, removeEventListener, routeEvent, setBounds, setFocus, setLocation, setPropertyValue, setSize, setValueChanged, update, validate



Field Documentation

classInfo

public static var classInfo: Object
A static class information object

Every class has an associated classInfo object that holds the version and other static information. The classInfo can be accessed either directly by referencing the static class or by calling getClass() on any class instance.

horizontal

public var horizontal: Boolean
A Boolean value indicating whether the scroll bar is scrolling the target vertically (false), the default, or horizontally (true).

liveDragging

public var liveDragging: Boolean

styleClass

public var styleClass: String
The name of the style class this instance will use.


Property Documentation

backgroundVisible

public backgroundVisible: Boolean (read, write)
redeclare to change default

Overrides:

largeScroll

public largeScroll: Number (read, write)
The number of lines or pixels scrolled when the user clicks the track of the scroll bar.

gets or sets the number of lines or pixels scrolled when the user clicks the track of the ScrollBar component.
If the scroll bar is oriented vertically, the value is a number of lines.
If the scroll bar is oriented horizontally, the value is a number of pixels.
You can also set this value by passing a pageSize parameter with the ScrollBar.setScrollTarget() method.

mode

public mode: String (read, write)
Controls the mode either scroller or slider

The ScrollBar can operate in two mode; The default scroller scrolls content with value ranging between 0 and the maximum number of lines of text In slider mode the ScrollBar varies a value between its min and max which may be negative. Also importantly in slider mode the scroller slides to the maximum value of the range whereas as the scoller stops a page before the maximum.

orientation

public orientation: String (read, write)
A value indicating whether the scroll bar is oriented vertically (vertical), the default, or horizontally (horizontal).

scrollPosition

public scrollPosition (read, write)
The current scroll position of the scroll bar.

Gets or sets the current scroll position of the scrollable object. The position of the scroll thumb also updates when a new scrollPosition value is set. The value of scrollPosition depends on whether the ScrollBar instance is being used for vertical or horizontal scrolling. If the ScrollBar instance is being used for vertical scrolling TextFields (the most common use), the value of scrollPosition is an integer with a range that begins with 0 and ends with a number that is equal to the total number of lines in the text field divided by the number of lines that can be displayed in the text field simultaneously. If scrollPosition is set to a number greater than this range, the text field simply scrolls to the end of the text. To scroll the text to the first line, set scrollPosition to 0. To scroll the text to the end, set scrollPosition to the number of lines of text in the text field minus 1. You can determine the number of lines by retrieving the value of the maxscroll property of the text field. If the ScrollBar instance is being used for horizontally scrolling a TextField, the value of scrollPosition is an integer value ranging from 0 to the width of the text field, in pixels. You can determine the width of the text field in pixels by getting the value of the maxhscroll property of the text field. The default value of scrollPosition is 0.

smallScroll

public smallScroll: Number (read, write)
The number of lines or pixels scrolled when the user clicks the arrow buttons of the scroll bar.

Gets or sets the number of lines or pixels scrolled when the user clicks the arrow buttons of the UIScrollBar component.
If the scroll bar is oriented vertically, the value is a number of lines. If the scroll bar is oriented horizontally, the value is a number of pixels.
The default value is 1.

virtualWidth

public virtualWidth: Number (read-only)
calculates the effective space required for the scrollbar


Constructor Documentation

ScrollBar

public function ScrollBar()
Constructor - This should not be called directly.

If you want to dynamically create a new instance of a control use its static newInstance method


Method Documentation

getClass

public function getClass(): Function
Returns a reference to the components static class

Overrides:

onChanged

public function onChanged(t)
called by scrolltarget

onScroller

public function onScroller(t)
called by the scrolltarget

resizeBar

public function resizeBar(v: Number)
resize the scrollbar "height" makes allowance for the orientation of the bar

setScrollTarget

public function setScrollTarget(t): Void
Assigns the ScrollBar to a scrollable control

Assigns a ScrollBar component to a scrollable instance.
If you need to associate a scrollable object and a ScrollBar component at runtime, use this method.

Parameters:
t
The target control

The documentation was generated from the following file:


Generated on 10/30/2005 9:34:02 PM by AS2Doc