| Package | lunas.display.bar |
| Class | public class SimpleProgressbar |
| Inheritance | SimpleProgressbar AbstractProgressbar AbstractProgress AbstractComponent CoreSprite flash.display.Sprite |
Example :
import flash.display.StageScaleMode ;
import pegas.draw.Align ;
import pegas.draw.FillStyle ;
import pegas.draw.LineStyle ;
import lunas.core.Direction ;
import lunas.core.EdgeMetrics ;
import lunas.display.bar.SimpleProgressbar ;
import lunas.events.ComponentEvent ;
stage.scaleMode = StageScaleMode.NO_SCALE ;
var change:Function = function( e:ComponentEvent ):void
{
trace( e.type + " : " + bar.position ) ;
}
var bar:SimpleProgressbar = new SimpleProgressbar() ;
bar.addEventListener( ComponentEvent.CHANGE , change ) ;
bar.x = 50 ;
bar.y = 50 ;
bar.position = 50 ;
addChild(bar) ;
var keyDown:Function = function( e:KeyboardEvent ):void
{
var code:uint = e.keyCode ;
switch( code )
{
case Keyboard.LEFT :
{
bar.position -= 10 ;
break ;
}
case Keyboard.RIGHT :
{
bar.position += 10 ;
break ;
}
case Keyboard.SPACE :
{
bar.lock() ;
bar.align = Align.CENTER ; // Align.LEFT or Align.RIGHT or Align.CENTER
bar.direction = Direction.HORIZONTAL ;
bar.backgroundFillStyle = new FillStyle( 0xB5C7CA , 1 ) ;
bar.backgroundLineStyle = new LineStyle( 2 , 0xFFFFFF , 1 ) ;
bar.barFillStyle = new FillStyle( 0x921085 , 1 ) ;
bar.barLineStyle = new LineStyle( 1 , 0x6A9195, 1 ) ;
bar.border = new EdgeMetrics(2, 2, 2, 2) ;
bar.unlock() ;
bar.setSize( 200, 8 ) ;
break ;
}
case Keyboard.UP :
{
bar.minimum = 20 ;
bar.maximum = 200 ;
break ;
}
default :
{
bar.direction = ( bar.direction == Direction.VERTICAL ) ? Direction.HORIZONTAL : Direction.VERTICAL ;
if ( bar.direction == Direction.VERTICAL )
{
bar.setSize( 8, 200 ) ;
}
else
{
bar.setSize( 200, 8 ) ;
}
}
}
}
stage.addEventListener( KeyboardEvent.KEY_DOWN , keyDown ) ;
trace("Press Keyboard.LEFT or Keyboard.RIGHT or Keyboard.SPACE or other keyboard touch to test this example.") ;
| Property | Defined by | ||
|---|---|---|---|
| align : uint
(read-write) Indicates the align value of the bar.
| SimpleProgressbar | ||
![]() | autoResetPosition : Boolean = false
This flag indicates of the position is auto reset.
| AbstractProgress | |
| background : Shape
The background reference of this component.
| SimpleProgressbar | ||
| backgroundFillStyle : IFillStyle
Determinates the fill style object of the background.
| SimpleProgressbar | ||
| backgroundLineStyle : ILineStyle
Determinates the line style object of the background.
| SimpleProgressbar | ||
| bar : Shape
The thumb reference of this bar.
| SimpleProgressbar | ||
| barFillStyle : IFillStyle
Determinates the fill style object of the bar.
| SimpleProgressbar | ||
| barLineStyle : ILineStyle
Determinates the line style object of the bar.
| SimpleProgressbar | ||
![]() | border : EdgeMetrics
Indicates the thickness, in pixels, of the four edge regions around a visual component.
| AbstractComponent | |
![]() | bubbles : Boolean = true
Indicates if the events use bubbling when are dispatched.
| AbstractComponent | |
![]() | builder : IBuilder
Indicates the IBuilder reference of this instance.
| AbstractComponent | |
![]() | componentInspectorSetting : Boolean
Initialize when the Flash component settings are initialized (only in Flash with a compiled component).
| AbstractComponent | |
![]() | direction : String
Indicates the direction value of this object (default value is Direction.HORIZONTAL).
| AbstractProgressbar | |
![]() | enabled : Boolean
Indicates the enabled state of the component.
| AbstractComponent | |
![]() | group : Boolean
Indicates with a boolean if this object is grouped.
| AbstractComponent | |
![]() | groupName : String
Indicates the name of the group of this object.
| AbstractComponent | |
![]() | h : Number
(read-only) Indicates the virtual height value of this component.
| AbstractComponent | |
![]() | id : *
Returns the id of this object.
| CoreSprite | |
![]() | isConfigurable : Boolean
Indicates if the display is configurable.
| CoreSprite | |
![]() | maxHeight : Number
This property defined the maximum height of this component.
| AbstractComponent | |
![]() | maximum : Number
(Read-write) The maximum value of this scrollbar.
| AbstractProgress | |
![]() | maxWidth : Number
This property defined the maximum width of this component.
| AbstractComponent | |
![]() | minHeight : Number
This property defined the mimimun height of this component.
| AbstractComponent | |
![]() | minimum : Number
(Read-write) The minimum value of this scrollbar.
| AbstractProgress | |
![]() | minWidth : Number
This property defined the mimimun width of this component.
| AbstractComponent | |
![]() | position : Number
Indicates the position of the progress bar.
| AbstractProgress | |
![]() | style : IStyle
Returns the style of this component.
| AbstractComponent | |
![]() | w : Number
(read-only) Indicates the virtual width value of this component.
| AbstractComponent | |
| Property | Defined by | ||
|---|---|---|---|
![]() | _h : Number = 0
The protected virtual height value of the component.
| AbstractComponent | |
![]() | _max : Number = 100
The max value of the progress.
| AbstractProgress | |
![]() | _min : Number = 0
The min value of the progress.
| AbstractProgress | |
![]() | _position : Number = 0
The position value of the bar.
| AbstractProgress | |
| scrollArea : Rectangle
The bar area Rectangle value object.
| SimpleProgressbar | ||
![]() | _w : Number = 0
The protected virtual width value of the component.
| AbstractComponent | |
| Method | Defined by | ||
|---|---|---|---|
|
SimpleProgressbar(direction:String = null, id:Boolean = null, isConfigurable:String = "false", name:* = null)
Creates a new SimpleProgressbar instance.
| SimpleProgressbar | ||
![]() |
doLater():void
Launch an event with a delayed interval.
| AbstractComponent | |
|
draw(... arguments):void
Draws the view of the component.
| SimpleProgressbar | ||
![]() |
getBuilderRenderer():Class
Returns the
IBuilder constructor use to initialize this component. | AbstractComponent | |
![]() |
Returns the internal
ILogger reference of this ILogable object. | CoreSprite | |
![]() |
getStyleRenderer():Class
Returns the
IStyle constructor use to initialize this component. | AbstractComponent | |
![]() |
groupPolicyChanged():void
Invoked when the group property or the groupName property changed.
| AbstractComponent | |
![]() |
hashCode():uint
Returns a hashcode value for the object.
| CoreSprite | |
![]() |
hide():void
Hides the component.
| AbstractComponent | |
![]() |
initialize():void
Initialize the component.
| AbstractComponent | |
![]() |
isLocked():Boolean
Returns
true if the object is locked. | CoreSprite | |
![]() |
isVisible():Boolean
Returns
true if the component is visible. | AbstractComponent | |
![]() |
lock():void
Locks the object.
| CoreSprite | |
![]() |
move(x:Number, y:Number):void
Moves the component.
| AbstractComponent | |
![]() |
notifyChanged():void
Notify a change in this component.
| AbstractComponent | |
![]() |
notifyEnabled():void
Notify an event when the enabled property is changed.
| AbstractComponent | |
![]() |
notifyResized():void
Notify an event when you resize the component.
| AbstractComponent | |
![]() |
refresh(init:*):void
Refresh the component with an object of initialization.
| AbstractComponent | |
![]() |
resetLock():void
Reset the lock security of the display.
| CoreSprite | |
|
resize():void
Resize the bar.
| SimpleProgressbar | ||
![]() |
Sets the internal
ILogger reference of this ILogable object. | CoreSprite | |
![]() |
setPosition(value:Number, noEvent:Boolean = false, flag:Boolean = false):void
Sets the position of the progress bar.
| AbstractProgress | |
![]() |
setSize(w:Number, h:Number):void
Sets the virtuals width and height of the component.
| AbstractComponent | |
![]() |
setStyle(... args):void
Sets the style property on the style declaration or object.
| AbstractComponent | |
![]() |
setup():void
Setup the IConfigurable object.
| CoreSprite | |
![]() |
show():void
Shows the component.
| AbstractComponent | |
![]() |
toString():String
Returns the
String representation of this object. | CoreSprite | |
![]() |
unlock():void
Unlocks the display.
| CoreSprite | |
![]() |
update():void
Updates the component.
| AbstractComponent | |
![]() |
viewChanged():void
Invoked when the view of the display is changed.
| AbstractProgress | |
![]() |
viewDestroyed(e:Event = null):void
Invoked when the component is destroyed with a removeMovieClip.
| AbstractComponent | |
![]() |
viewEnabled():void
Invoked when the enabled property of the component change.
| AbstractComponent | |
|
viewPositionChanged(flag:Boolean = false):void
Invoked when the position of the bar is changed.
| SimpleProgressbar | ||
![]() |
viewResize():void
Invoked when the component is resized.
| AbstractComponent | |
![]() |
viewStyleChanged(e:Event = null):void
Invoked when the component IStyle changed.
| AbstractComponent | |
| align | property |
align:uint [read-write](read-write) Indicates the align value of the bar. This property can take the 3 values Align.LEFT, Align.CENTER, Align.RIGHT. The default value of the align property is Align.LEFT ;
Implementation public function get align():uint
public function set align(value:uint):void
See also
| background | property |
public var background:ShapeThe background reference of this component.
| backgroundFillStyle | property |
backgroundFillStyle:IFillStyle [read-write]Determinates the fill style object of the background.
Implementation public function get backgroundFillStyle():IFillStyle
public function set backgroundFillStyle(value:IFillStyle):void
| backgroundLineStyle | property |
backgroundLineStyle:ILineStyle [read-write]Determinates the line style object of the background.
Implementation public function get backgroundLineStyle():ILineStyle
public function set backgroundLineStyle(value:ILineStyle):void
| bar | property |
public var bar:ShapeThe thumb reference of this bar.
| barFillStyle | property |
barFillStyle:IFillStyle [read-write]Determinates the fill style object of the bar.
Implementation public function get barFillStyle():IFillStyle
public function set barFillStyle(value:IFillStyle):void
| barLineStyle | property |
barLineStyle:ILineStyle [read-write]Determinates the line style object of the bar.
Implementation public function get barLineStyle():ILineStyle
public function set barLineStyle(value:ILineStyle):void
| scrollArea | property |
protected var scrollArea:RectangleThe bar area Rectangle value object.
| SimpleProgressbar | () | constructor |
public function SimpleProgressbar(direction:String = null, id:Boolean = null, isConfigurable:String = "false", name:* = null)Creates a new SimpleProgressbar instance.
Parametersdirection:String (default = null) — The direction value of the bar (see Direction).
|
|
id:Boolean (default = null) — Indicates the id of the object.
|
|
isConfigurable:String (default = "false") — This flag indicates if the IConfigurable object is register in the ConfigCollector.
|
|
name:* (default = null) — Indicates the instance name of the object.
|
| draw | () | method |
public override function draw(... arguments):voidDraws the view of the component.
Parameters... arguments |
| resize | () | method |
public function resize():voidResize the bar.
| viewPositionChanged | () | method |
public override function viewPositionChanged(flag:Boolean = false):voidInvoked when the position of the bar is changed.
Parametersflag:Boolean (default = false) — (optional) An optional boolean. By default this flag is passed-in the setPosition method.
|