Main Page | Packages | Class Tree | Index | Help

xp.controls

class ProgressBar

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


class ProgressBar
extends UIControl

ProgressBar

The ProgressBar component displays the progress of a task usually loading of content.
The loading process can be determinate or indeterminate.
A determinate progress bar is a linear representation of a task’s progress over time and is used when the extent of the task is known.
An indeterminate progress bar is used when the extent of the task is unknown.
You can add a label to display the progress of the task.
It is important to understand that the ProgressBar plays no part in the loading of content or completion of a task, it simply reacts to ntoifications of the progress of the task and updates its display accordingly.
This makes ProgressBar highly flexible and can be used to monitor the progress of any task not simply content loading.
A ProgressBar can operate in 3 modes.
Event Mode - By setting the loader property it operates in events mode and reacts to callback events
Polled Mode - By setting the source property it operates in polled mode and automatically polls the source to update itself
Manual Mode - If neither loader or source are set then by setting manually the min/max and value properties and calling updateDisplay to update the display

Usage:
mcl = new MovieClipLoader(); cll = new ContentLoaderListener(this); mcl.addListener(cll); pBar.loader = cll;
The standard styleClass "ProgressBar" provides a themed progress bar this will override any conflicting author time properties.
To create a custom progress bar based on the controls author time properties change the style to something other than ProgressBar.


Author:
ProWin Computers Ltd. - Rob Edgar

Version:
3.0.0.000

See also:


Field Summary

public
__percent: Number
A number representing the percentage of the task completed.

public
background


public static
classInfo: Object
A static class information object

public
curValueFunction: String
the name of the function to call when in polling mode to get the current value

public
formatString: String
Formatting string to apply to the progress label display text

public
hideOnComplete: Boolean
Controls whether the ProgrssBar and associated label are hidden when the task is completed

public
indeterminate: Boolean
Controls whether a determinate or indeterminate bar is displayed

public
indeterminateMessage: String
Message to display for an indeterminate progress bar

public
indicatorbarDSkin: String
Skin for determinate bar

public
indicatorbarISkin: String
Skin for indeterminate bar

public
interval: Number
the polling interval in ms that the source will be polled

public
labelControl
Pointer to a label control to display progress status

public
max: Number
The maximum value of the progress bar.

public
maxValueFunction: String
the name of the function to call when in polling mode to get the maximum value

public
min: Number
The minimum value of the progress bar. This also indirectly effects when the task is deemed complete.

public
reverse: Boolean
Controls whether we are running down from full to empty

public
stopPollingOnComplete: Boolean
should the poller auotmatically stop when it is complete

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

public
useBarColor: Boolean
Controls whether the indicatorBarColor is applied to the progress bar

public
useSolidBar: Boolean
Use a graphics object or SolidColor bar

public
vertical: Boolean
Orientation of bar

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
indicatorbarColor: Object (read, write)
Solid Color to apply to the bar if useSolidBar is true

public
loader: Object (read, write)
The loader object that will be the source for progress events.

public
source: Object (read, write)
The source object thet will be polled

public
value: Number (read, write)
Indicates the amount of progress that has been made. The current progress position

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
ProgressBar ( )
Constructor - This should not be called directly.


Method Summary

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

public
hide ( )
Hides the progress bar and the associated label control

public static
newInstance ( owner, instanceId, depth, initObj )
Creates a new Instance of this class

public
onPoll ( ): Void
Update the progress bar when in polling mode

public
progressHandler ( e: Event )
Handles callback from a "loader listener"

public
reset ( )
Resets the progress bar prior to use

public
setBarColor ( v: Number ): Void
Applies the indicatorBarColor

public
show ( )
Shows the progress bar and the associated label control

public
start ( )
Called to start the indeterminate bar

public
stop ( )
Called to stop the indeterminate bar

public
updateDisplay ( ): Void
Updates the display to reflect the current progress status

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

__percent

public var __percent: Number
A number representing the percentage of the task completed.

background

public var background

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.

curValueFunction

public var curValueFunction: String
the name of the function to call when in polling mode to get the current value

formatString

public var formatString: String
Formatting string to apply to the progress label display text

This parameter is a string in the format "%1 out of %2 loaded (%3%%)". In this string, %1 is a placeholder for the current value (current bytes loaded), %2 is a placeholder for the maximum (total bytes loaded), %2 is a placeholder for the mainimum, and %4 is a placeholder for the percent of task complete (content loaded).

hideOnComplete

public var hideOnComplete: Boolean
Controls whether the ProgrssBar and associated label are hidden when the task is completed

indeterminate

public var indeterminate: Boolean
Controls whether a determinate or indeterminate bar is displayed

indeterminateMessage

public var indeterminateMessage: String
Message to display for an indeterminate progress bar

This message will be displayed in the label control for indeterminate progress bars whilst the progress bar is visible

indicatorbarDSkin

public var indicatorbarDSkin: String
Skin for determinate bar

indicatorbarISkin

public var indicatorbarISkin: String
Skin for indeterminate bar

interval

public var interval: Number
the polling interval in ms that the source will be polled

labelControl

public var labelControl
Pointer to a label control to display progress status

max

public var max: Number
The maximum value of the progress bar.

Property; the largest value for the progress bar. This also indirectly effects when the task is deemed complete.

maxValueFunction

public var maxValueFunction: String
the name of the function to call when in polling mode to get the maximum value

min

public var min: Number
The minimum value of the progress bar. This also indirectly effects when the task is deemed complete.

reverse

public var reverse: Boolean
Controls whether we are running down from full to empty

stopPollingOnComplete

public var stopPollingOnComplete: Boolean
should the poller auotmatically stop when it is complete

styleClass

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

useBarColor

public var useBarColor: Boolean
Controls whether the indicatorBarColor is applied to the progress bar

useSolidBar

public var useSolidBar: Boolean
Use a graphics object or SolidColor bar

vertical

public var vertical: Boolean
Orientation of bar


Property Documentation

indicatorbarColor

public indicatorbarColor: Object (read, write)
Solid Color to apply to the bar if useSolidBar is true

loader

public loader: Object (read, write)
The loader object that will be the source for progress events.

This is the ContentLoaderListener object that this ProgressBar will listener. The ContentLoaderListener has been designed to mediate between both of the two main Flash loading API's, 1) The MM Loader component progress API (progress / complete) 2) The MM BuiltIn Object MovieClipLoader API (onLoadStart / onLoadProgress / onLoadComplete / onLoadInit / onLoadError) Either of these can be used via CLL as a source for the PorgressBar.

See also:

source

public source: Object (read, write)
The source object thet will be polled

The ProgressBar can operate in 3 mode, manual,event and polled. If the loader property is set it is in event mode and will auotmatically update itself in repsone to progress events If the source property is set it is in polled mode and will auotmatically poll the source to update itself If neither is set it is in manual mode and willnot update until its properties are manually set.

value

public value: Number (read, write)
Indicates the amount of progress that has been made. The current progress position


Constructor Documentation

ProgressBar

public function ProgressBar()
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:

hide

public function hide()
Hides the progress bar and the associated label control

newInstance

public static function newInstance(owner,
 instanceId,
 depth,
 initObj)
Creates a new Instance of this class

Creates an instance of a component at runtime. You need to use the import statement and specify the class package name before calling this method. In addition, the component must be in the FLA file’s library.

Parameters:
owner
A reference to the movie clip or object that will contains the new Instance.
instanceId
A string indicating the instance name of the new instance.(optional)
depth
A number indicating the depth of the new instance.(optional)
initObj
An object containing initialization properties for the new instance.(optional)
Returns:
A object that is an instance of the specified class.

onPoll

public function onPoll(): Void
Update the progress bar when in polling mode

progressHandler

public function progressHandler(e: Event)
Handles callback from a "loader listener"

Parameters:
e
The progress event object

reset

public function reset()
Resets the progress bar prior to use

setBarColor

public function setBarColor(v: Number): Void
Applies the indicatorBarColor

show

public function show()
Shows the progress bar and the associated label control

start

public function start()
Called to start the indeterminate bar

stop

public function stop()
Called to stop the indeterminate bar

updateDisplay

public function updateDisplay(): Void
Updates the display to reflect the current progress status


The documentation was generated from the following file:


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