qnx.fuse.ui.progress.ProgressBar

ProgressBar

Properties | Methods | Examples


Packageqnx.fuse.ui.progress
Classpublic class ProgressBar
InheritanceProgressBar Inheritance SkinnableComponent Inheritance UIComponent Inheritance flash.display.MovieClip
Implements IProgress
Subclasses PercentageBar

The ProgressBar class shows progress by percentage:

A progress bar.

The ProgressBar class provides the temporal feedback functionality for the API. You can use the progress bar to show progress information for processor-intensive operations or to show progress information whenever data is being loaded. This feedback ensures the user that the operating system remains responsive during complex operations.



Class information:
PlayBook Tablet OS Version:   1.0.6

View the examples

See also

PercentageBar
ActivityIndicator



Public Properties

 PropertyDefined By
 InheritedexplicitHeight : Number
[read-only] Returns the explicit height (actual height, in pixels) of the UI component.
UIComponent
 InheritedexplicitWidth : Number
[read-only] Returns the explicit width (actual width, in pixels) of the UI component.
UIComponent
 InheritedincludeInLayout : Boolean
Specifies whether or not the component should be included in its parent container's layout.
UIComponent
 InheritedlayoutData : Object
Returns the layout data for the object.
UIComponent
 InheritedminHeight : Number
Gets or sets the minimum preferred height of the control.
UIComponent
 InheritedminWidth : Number
Gets or sets the minimum preferred width of the control.
UIComponent
  progress : Number
Gets or sets the current progress value as indicated by the progress bar.
ProgressBar
 Inheritedstate : String
Gets or sets the state of the component.
SkinnableComponent

Public Methods

 MethodDefined By
  
Creates a new ProgressBar instance.
ProgressBar
 Inherited
childChanged(resizedChild:DisplayObject = null):Boolean
Notifies the UIComponent that one or more of its children has changed in a manner that may affect this object's layout.
UIComponent
 Inherited
destroy():void
Call this method when you want to have your object collected by the garbage collector.
UIComponent
 Inherited
Returns the size options for the given control.
UIComponent
 Inherited
Calling this method results in a call to the components validateDisplayList() method before the display list is rendered.
UIComponent
 Inherited
Calling this method results in a call to the components validateProperties() method before the display list is rendered.
UIComponent
 Inherited
measure(availableWidth:Number, availableHeight:Number):LayoutMeasurement
This method calls doMeasure() in order to calculate the preferred size of the control.
UIComponent
 Inherited
setActualSize(w:Number, h:Number):void
Sets the width and height of the object without setting the explicitWidth and explicitHeight.
UIComponent
 Inherited
setLayoutBounds(bounds:Rectangle):void
Sets the receiver's size and location to the rectangular area specified by the arguments.
UIComponent
 Inherited
setPosition(x:Number, y:Number):void
Sets the x and y position of the component.
UIComponent
  
setSkin(newSkin:Object):void
[override] Set the skin object on the progress bar for it to render.
ProgressBar
 Inherited
Validates the display list of the component by calling the updateDisplayList().
UIComponent
 Inherited
Validates the component immediately by calling validateProperties(), validateSizes(), and validateDisplayList() if necessary.
UIComponent
 Inherited
Validates the properties of the component by calling the commitProperties() method.
UIComponent

Protected Methods

 MethodDefined By
 Inherited
Process properties of the component.
UIComponent
 Inherited
Process the state of the component.
UIComponent
 Inherited
doMeasure(availableWidth:Number, availableHeight:Number):LayoutMeasurement
Performs a measurement on the control, and returns a LayoutMeasurement instance containing the available width and height within the layout.
UIComponent
 Inherited
flushCache():void
Invoked as part of parentLayoutChanged.
UIComponent
 Inherited
onAdded():void
Called when the instance is added to the stage.
UIComponent
 Inherited
onRemoved():void
Called when the instance is removed from the stage.
UIComponent
 Inherited
Invalidates the parent's size and display list if includeInLayout property is set to true.
UIComponent
 Inherited
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
Sets the size and position of the children of the component.
UIComponent
 Inherited
updateSkin(unscaledWidth:Number, unscaledHeight:Number):void
Updates the skin.
SkinnableComponent

Property Detail

progress


progress:Number

Gets or sets the current progress value as indicated by the progress bar. This property takes a value between 0 and 1.

For example, the following listing uses a counter to update the progress property. The counter value is divided by 100 in order to specify a percentage:

        private function handleTimerTick( e:TimerEvent ):void
        {
            counter++;
            myProgress.progress = counter/100;
        }
         


Implementation

public function get progress():Number
public function set progress(value:Number):void

Constructor Detail

ProgressBar()


public function ProgressBar()

Creates a new ProgressBar instance.

Method Detail

setSkin()


override public function setSkin(newSkin:Object):void

Set the skin object on the progress bar for it to render.

Skins must implement the IProgress and ISkin interfaces.

Parameters

newSkin:Object

See also

SkinnableComponent
ISkin

Examples

The following listing creates a ProgressBar instance. It contains a simple timer routine that is used to update the progress value.
package
{
    import flash.display.Sprite;
    import flash.events.TimerEvent;
    import flash.utils.Timer;
    
    import qnx.fuse.ui.progress.ProgressBar;
    
    [SWF(height="600", width="1024", 
    frameRate="30", backgroundColor="#FFFFFF")]
    public class myProgressSample extends Sprite
    {
        private var myProgress:ProgressBar;
        private var timer:Timer;
        private var counter:int;
        
        public function myProgressSample()
        {
            initializeUI();
        }
        
        private function initializeUI():void{
            
            
            myProgress = new ProgressBar();
            myProgress.setPosition(400, 300);                
            myProgress.width = 200;    
            myProgress.height = 10;
            myProgress.progress = 0;            
            
            this.addChild(myProgress);
            
            // counter to keep track of how many times the timer has ticked
            counter = 0;
            timer  = new Timer(100,100);
            timer.addEventListener(TimerEvent.TIMER,handleTimerTick);
            timer.addEventListener(TimerEvent.TIMER_COMPLETE,handleTimerComplete);
            timer.start();
            
        }
        
        private function handleTimerComplete(e:TimerEvent):void
        {
            timer.removeEventListener(TimerEvent.TIMER,handleTimerTick);
            timer.removeEventListener(TimerEvent.TIMER_COMPLETE,handleTimerComplete);
            counter = 0;
        }
        
        private function handleTimerTick( e:TimerEvent ):void
        {
            counter++;
            myProgress.progress = counter/100;
        }
        
    }
}