| Package | ardisia.components.buttonBar |
| Class | public class ButtonBarBase |
| Inheritance | ButtonBarBase spark.components.supportClasses.ButtonBarBase |
| Implements | mx.managers.IFocusManagerComponent |
| Subclasses | ButtonBar, TabBar |
The selectedIndex will change as the user rearranges buttons. In other words, if a selected button is moved from its start position, the selectedIndex will update (although no event will dispatch). Keep this in mind if binding to the selectedIndex.
Use the selectedItem property to determine what button is selected.
View the technical documentation on the Ardisia Labs website for more information.
Default MXML PropertydataProvider
| Property | Defined By | ||
|---|---|---|---|
| closableField : String
The field on the data to look for a boolean value if the button can be
closed by clicking the close button skin part. | ButtonBarBase | ||
| duration : Number = 150
The duration of animations in milliseconds. | ButtonBarBase | ||
| easer : IEaser
The default easer to apply to animations. | ButtonBarBase | ||
| isAnimating : Boolean [read-only]
True if a animation is running. | ButtonBarBase | ||
| isDragging : Boolean [read-only]
True if a button is being dragged. | ButtonBarBase | ||
| Method | Defined By | ||
|---|---|---|---|
| ButtonBarBase | |||
addButton(data:Object, selected:Boolean):void
Use this method to add a button via animation. | ButtonBarBase | ||
endButtonDrag():void
End a selected button drag. | ButtonBarBase | ||
removeButton(index:int):void
Use this method to remove a button via animation. | ButtonBarBase | ||
startButtonDrag(initialX:Number):void
Start dragging the selected button. | ButtonBarBase | ||
| Method | Defined By | ||
|---|---|---|---|
commitButtonSnapshot():void
Commits the buttonSnapshot to the underlying collection and updates the
buttons to reflect the buttonSnapshot. | ButtonBarBase | ||
dragHandler(event:Event):void
Handles the events and logic for user initiated dragging. | ButtonBarBase | ||
effectHandler(event:EffectEvent):void
Handles the events and logic for effects. | ButtonBarBase | ||
eventHandler(event:Event):void
Handles events on the control. | ButtonBarBase | ||
finalRemoveAnimation():void
Sets up the final animations after a removeSession is finished. | ButtonBarBase | ||
getFadeButtonEffect(slidingData:ButtonBarButtonData):IEffect
Creates and returns a Fade effect on the passed data. | ButtonBarBase | ||
getMoveButtonEffect(slidingData:ButtonBarButtonData):IEffect
Creates and returns a Move animation to move a button to the new position. | ButtonBarBase | ||
getResizeButtonEffect(slidingData:ButtonBarButtonData):IEffect
Creates and returns a resize effect on the passed data. | ButtonBarBase | ||
rendererHandler(event:Event):void
Handles events on the renderers. | ButtonBarBase | ||
setupFinalRemoveAnimation():void
Setup the final animation for a removal session. | ButtonBarBase | ||
updateButtonSnapshot():void
Creates a vector of SlidingButtonData objects for each button from left
to right. | ButtonBarBase | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when a button is closed via the close button. | ButtonBarBase | |||
| Dispatched when a button is about to be closed via the close button. | ButtonBarBase | |||
| Dispatched when a ButtonBarButton's closeButtonPart is clicked. | ButtonBarBase | |||
| Dispatched when a drag ends. | ButtonBarBase | |||
| Dispatched while a button is dragging. | ButtonBarBase | |||
| Dispatched when a button drag starts. | ButtonBarBase | |||
| Dispatched immediately before a button is dragged. | ButtonBarBase | |||
| closableField | property |
closableField:StringThe field on the data to look for a boolean value if the button can be closed by clicking the close button skin part. If not set, the default behaviour is that all buttons are closable.
The default value is "closable".
public function get closableField():String public function set closableField(value:String):void| duration | property |
public var duration:Number = 150The duration of animations in milliseconds.
Set to 0 to skip animations entirely.
The default value is 150.
| easer | property |
public var easer:IEaserThe default easer to apply to animations.
The default value is spark Linear effect.
| isAnimating | property |
isAnimating:Boolean [read-only] True if a animation is running.
The default value is false.
public function get isAnimating():Boolean| isDragging | property |
isDragging:Boolean [read-only] True if a button is being dragged.
The default value is false.
public function get isDragging():Boolean| ButtonBarBase | () | Constructor |
public function ButtonBarBase()| addButton | () | method |
public function addButton(data:Object, selected:Boolean):voidUse this method to add a button via animation. Use vanilla collection methods to add/edit/remove buttons without animation.
Animated in buttons start with the width defined by the "minWidth" property on the button skin.
Parameters
data:Object — data object to add to the underlying collection
| |
selected:Boolean — use true to select the added button
|
| commitButtonSnapshot | () | method |
protected function commitButtonSnapshot():voidCommits the buttonSnapshot to the underlying collection and updates the buttons to reflect the buttonSnapshot.
Typically called at the end of a user initiated drag.
| dragHandler | () | method |
protected function dragHandler(event:Event):voidHandles the events and logic for user initiated dragging.
Parameters
event:Event — the Event that triggered the handler
|
| effectHandler | () | method |
protected function effectHandler(event:EffectEvent):voidHandles the events and logic for effects.
Parameters
event:EffectEvent — the EffectEvent that triggered the handler
|
| endButtonDrag | () | method |
public function endButtonDrag():voidEnd a selected button drag.
| eventHandler | () | method |
protected function eventHandler(event:Event):voidHandles events on the control.
Parameters
event:Event — the Event that triggered the handler
|
| finalRemoveAnimation | () | method |
protected function finalRemoveAnimation():voidSets up the final animations after a removeSession is finished.
| getFadeButtonEffect | () | method |
protected function getFadeButtonEffect(slidingData:ButtonBarButtonData):IEffectCreates and returns a Fade effect on the passed data.
Parameters
slidingData:ButtonBarButtonData — the SlidingButtonData object that defines the button to be
animated
|
IEffect — the effect
|
| getMoveButtonEffect | () | method |
protected function getMoveButtonEffect(slidingData:ButtonBarButtonData):IEffectCreates and returns a Move animation to move a button to the new position.
Parameters
slidingData:ButtonBarButtonData — the SlidingButtonData object that defines the button to be
animated
|
IEffect — the effect
|
| getResizeButtonEffect | () | method |
protected function getResizeButtonEffect(slidingData:ButtonBarButtonData):IEffectCreates and returns a resize effect on the passed data.
Parameters
slidingData:ButtonBarButtonData — the SlidingButtonData object that defines the button to be
animated
|
IEffect — the effect
|
| removeButton | () | method |
public function removeButton(index:int):voidUse this method to remove a button via animation. Use vanilla collection methods to add/edit/remove buttons without animation.
If the mouse is over the removed button when this method is called, only the buttons to the right of the removed button will be removed, and the remaining buttons will not animate into position until the mouse rolls out of the control. Allows the user to remove multiple buttons without moving the mouse.
If the mouse is not over the removed button, the buttons will immediately animate out of existence.
Parameters
index:int — index of the item to be removed
|
| rendererHandler | () | method |
protected function rendererHandler(event:Event):voidHandles events on the renderers. param event the Event that triggered the handler
Parameters
event:Event |
| setupFinalRemoveAnimation | () | method |
protected function setupFinalRemoveAnimation():voidSetup the final animation for a removal session.
| startButtonDrag | () | method |
public function startButtonDrag(initialX:Number):voidStart dragging the selected button.
Parameters
initialX:Number (default = NaN) — Number the x position to start dragging the button
|
| updateButtonSnapshot | () | method |
protected function updateButtonSnapshot():voidCreates a vector of SlidingButtonData objects for each button from left to right.
This stores a snapshot of the control's state before changes are made via user interaction.
| buttonClose | Event |
ardisia.components.buttonBar.events.ButtonBarEventardisia.components.buttonBar.events.ButtonBarEventDispatched when a button is closed via the close button.
| buttonClosing | Event |
ardisia.components.buttonBar.events.ButtonBarEventardisia.components.buttonBar.events.ButtonBarEventDispatched when a button is about to be closed via the close button. Can be cancelled.
| closeButtonClick | Event |
ardisia.components.buttonBar.events.ButtonBarEventardisia.components.buttonBar.events.ButtonBarEventDispatched when a ButtonBarButton's closeButtonPart is clicked.
| dragEnd | Event |
ardisia.components.buttonBar.events.ButtonBarEventardisia.components.buttonBar.events.ButtonBarEventDispatched when a drag ends.
| dragging | Event |
ardisia.components.buttonBar.events.ButtonBarEventardisia.components.buttonBar.events.ButtonBarEventDispatched while a button is dragging.
| dragStart | Event |
ardisia.components.buttonBar.events.ButtonBarEventardisia.components.buttonBar.events.ButtonBarEventDispatched when a button drag starts.
| dragStarting | Event |
ardisia.components.buttonBar.events.ButtonBarEventardisia.components.buttonBar.events.ButtonBarEventDispatched immediately before a button is dragged. Can be cancelled.