qnx.ui.progress.PercentageBar

PercentageBar

Properties | Methods


Packageqnx.ui.progress
Classpublic class PercentageBar
InheritancePercentageBar Inheritance ProgressBar Inheritance SkinnableComponent Inheritance UIComponent Inheritance flash.display.MovieClip

The PercentageBar class shows activity progress by percentage.

A percentage bar.

The PercentageBar class extends the ProgressBar class to provide a text label that outputs the current percentage value.



Class information:
PlayBook Tablet OS Version:   1.0.6

See also

ProgressBar
ActivityIndicator



Public Properties

 PropertyDefined By
 Inheritedcontainment : String
Gets or sets a property that determines how a component is contained within a parent container.
UIComponent
  label : String
Sets the label for the progress value.
PercentageBar
 Inheritedprogress : Number
Gets or sets the current progress value as indicated by the progress bar.
ProgressBar
  showPercent : Boolean
[write-only] A Boolean that toggles the percentage value label.
PercentageBar
 Inheritedsize : Number
Gets or sets the size for this component (as a percentage of the container's size, or in pixels).
UIComponent
 InheritedsizeMode : String
Gets or sets the size mode for this component.
UIComponent
 InheritedsizeUnit : String
Gets or sets the unit of measure for the size property.
UIComponent

Public Methods

 MethodDefined By
  
Creates a new ProgressBar instance.
PercentageBar
 Inherited
destroy():void
Call this method when you want to have your object collected by the garbage collector.
UIComponent
 Inherited
drawNow():void
Calls the draw() method.
UIComponent
 Inherited
invalidate(property:String = all, invalidateNow:Boolean = false):void
Marks the property as invalid and the draw() method is called on the next frame or the next render, whichever comes first.
UIComponent
 Inherited
setPosition(x:Number, y:Number):void
Sets the x and y position of the component.
UIComponent
 Inherited
setSize(w:Number, h:Number):void
Sets the width and height of the component.
UIComponent
 Inherited
setSkin(cellSkin:Object):void
Set the skin object on the component for it to render.
SkinnableComponent
  
setTextFormat(format:TextFormat):void
Set the TextFormat for the item.
PercentageBar

Protected Methods

 MethodDefined By
 Inherited
callLater(method:Function):void
Calls the specified method on the next frame or the next render, which ever happens first.
UIComponent
 Inherited
createInstance(linkage:Object):DisplayObject
Calling this method will attempt to create a DisplayObject instance based on the value of the linkage parameter.
UIComponent
 Inherited
draw():void
Called every time you set the width and height of the component.
UIComponent
 Inherited
isInvalid(property:String, ... properties):Boolean
Checks to see if the property is invalid and returns true if it is.
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
setEnabled(val:Boolean):void
Called when the enabled property changes.
UIComponent
 Inherited
validate(property:String = all):void
Lets the component know that the specified property has been validated.
UIComponent

Property Detail

label


label:String

Sets the label for the progress value. If set after the showPercent value, this value will override the showPercent property.

The following listing uses a PercentageBar to display a status message during a load operation:

         myPercentage = new PercentageBar();
         myPercentage.setPosition(400, 300);                
         myPercentage.width = 200;
         myPercentage.height = 30;
         myPercentage.progress = 0;
         myPercentage.setTextFormat(percentFormat);
         myPercentage.label = "Loading..."
         

A percentage bar.


Implementation

public function get label():String
public function set label(value:String):void

showPercent


showPercent:Boolean  [write-only]

A Boolean that toggles the percentage value label.

The default value is true.


Implementation

public function set showPercent(value:Boolean):void

Constructor Detail

PercentageBar()


public function PercentageBar()

Creates a new ProgressBar instance.

Method Detail

setTextFormat()


public function setTextFormat(format:TextFormat):void

Set the TextFormat for the item. The TextFormat object defines the text formatting for the percentage label. In the following listing, a TextFormat object is instantiated and applied to the PercentageBar:

         var percentlFormat:TextFormat = new TextFormat();
         percentlFormat.size = 20;
         percentlFormat.bold = true;
         percentlFormat.italic = true;
         
         myPercentage.setTextFormat(percentlFormat);
         this.addChild(myPercentage); 
         

Parameters

format:TextFormat — The TextFormat object to apply to the label.