| Package | org.openPyro.controls |
| Class | public class Button |
| Inheritance | Button UIControl MeasurableControl flash.display.Sprite |
| Property | Defined by | ||
|---|---|---|---|
![]() | backgroundPainter : IPainter
UIControls can have a backgroundPainter object attached that is
triggered everytime updateDisplayList is called.
| UIControl | |
![]() | creationCompleteFired : Boolean | MeasurableControl | |
| currentState : String | Button | ||
![]() | displayListInvalidated : Boolean = true
Flag to mark a dirty displaylist.
| MeasurableControl | |
![]() | dragData : Object | UIControl | |
![]() | dragEnabled : Boolean | UIControl | |
![]() | dropEnabled : Boolean | UIControl | |
![]() | explicitWidth : Number The height set in terms of actual pixels.
| MeasurableControl | |
![]() | forceInvalidateDisplayList : Boolean = false | MeasurableControl | |
![]() | height : Number
Set/get the height of the control.
| MeasurableControl | |
![]() | includeInLayout : Boolean
Specifies whether this control participates in the
layout system in OpenPyro.
| MeasurableControl | |
![]() | initialized : Boolean = false
Property indicates whether a control has been initialized
or not.
| MeasurableControl | |
| label : String | Button | ||
![]() | maximumHeight : Number | MeasurableControl | |
![]() | maximumWidth : Number | MeasurableControl | |
![]() | measuredHeight : Number
Overrides the set measuredHeight property from
MeasurableControl to invalidate children
(UIControl acknowledges that it can have children whose
dimensions are based on its own)
| UIControl | |
![]() | measuredWidth : Number
Overrides the set measuredWidth property from
MeasurableControl to invalidate children
(UIControl acknowledges that it can have children whose
dimensions are based on its own)
| UIControl | |
![]() | mouseActionsDisabled : Boolean | MeasurableControl | |
| mouseOutHandler : Function
Buttons by default return to their 'up' state when
the mouse moves out, but buttons can be used as elements
in sliders, scrollbars etc where mouseOut should be
handled differently.
| Button | ||
![]() | needsMeasurement : Boolean = true
Only setting percent width/heights changes the
needsMeasurement flag which makes its parent
container call measure on it.
| MeasurableControl | |
| padding : Padding
[write-only]
IMPORTANT
The Button control is different from basic UIControls.
| Button | ||
![]() | parentContainer : UIControl | MeasurableControl | |
![]() | percentHeight : Number | MeasurableControl | |
![]() | percentUnusedHeight : Number
Set/get the percent height.
| MeasurableControl | |
![]() | percentUnusedWidth : Number
Set/get the percent width.
| MeasurableControl | |
![]() | percentWidth : Number | MeasurableControl | |
| selected : Boolean | Button | ||
![]() | sizeInvalidated : Boolean = false
The flag to mark that the control's size
has been invalidated.
| MeasurableControl | |
| skin : ISkin
[write-only]
| Button | ||
![]() | skinnedControl : UIControl | UIControl | |
![]() | styleName : String
Defines the skin this component is registered to.
| UIControl | |
| toggle : Boolean
Sets whether a button is set as togglable or not.
| Button | ||
![]() | toolTip : * | UIControl | |
![]() | usesMeasurementStrategy : Boolean
This property defines whether measure() will be called during
validateSize() or not.
| MeasurableControl | |
![]() | visible : Boolean | MeasurableControl | |
![]() | width : Number
Set/get the width of the control.
| MeasurableControl | |
| Method | Defined by | ||
|---|---|---|---|
|
Button()
| Button | ||
![]() |
addChild(child:DisplayObject):DisplayObject
| UIControl | |
![]() |
addChildAt(child:DisplayObject, index:int):DisplayObject
| UIControl | |
![]() |
cancelMouseEvents():void
| MeasurableControl | |
|
changeState(fromState:String, toState:String):void
| Button | ||
![]() |
checkDisplayListValidation():void
Calls the queueValidateDisplayList if measure causes
_dimensionsChanged to change to true.
| UIControl | |
![]() |
dispose():void
| UIControl | |
![]() |
doLayoutChildren():void
| UIControl | |
![]() |
doOnAdded():void
[Temp] This function is called automatically
by a parent UIControl if this is created as a
child of a UIControl.
| MeasurableControl | |
![]() |
enableMouseEvents():void
| MeasurableControl | |
![]() |
getExplicitOrMeasuredHeight():Number
Returns the explicitly defined height or the measured
height computed by the
measure function. | MeasurableControl | |
![]() |
getExplicitOrMeasuredWidth():Number
Returns the explicitly defined width or the measured
number computed by the
measure function. | MeasurableControl | |
![]() |
heightForMeasurement():Number
When measure is called, it uses the widthForMeasurement and
heightForMeasurement to calculate the sizes for
percent-dimension based children
| UIControl | |
|
initialize():void
| Button | ||
![]() |
invalidateSize(event:PyroEvent = null):void
Marks itself dirty and waits till either the container
to validateSize or validates itself at the next enterframe
if it has no parent container.
| MeasurableControl | |
![]() |
isMouseOver(event:MouseEvent):Boolean
Utility function to check if a mouseEvent happened
while the mouse was over the displayObject
| MeasurableControl | |
![]() |
measure():void
Measure is called during the validateSize if
the needsmeasurement flag is set.
| UIControl | |
![]() | UIControl | ||
![]() |
queueValidateDisplayList(event:PyroEvent = null):void
This function is called if the framework determines that dimensions of the
control have changed.
| MeasurableControl | |
![]() |
removeBackgroundPainter():void
| UIControl | |
![]() |
removeChild(d:DisplayObject):DisplayObject
| UIControl | |
![]() |
resizeHandler():void
| MeasurableControl | |
![]() |
Convinience function for setting width and height
in one call.
| UIControl | |
![]() |
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
The updateDisplayList is triggered everytime the framework
determines that some event has taken place that needs the
UI to be refreshed.
| UIControl | |
![]() |
validateDisplayList(event:Event = null):void
validateDisplayList is called as a response to invalidateDisplayList.
| MeasurableControl | |
![]() |
validateSize():void
The validateSize function is called in response to
a component declaring its size invalid (usually
by calling invalidateSize()).
| MeasurableControl | |
![]() |
widthForMeasurement():Number
When measure is called, it uses the widthForMeasurement and
heightForMeasurement to calculate the sizes for
percent-dimension based children
| UIControl | |
| Method | Defined by | ||
|---|---|---|---|
![]() |
calculateMeasuredHeight():void
Calculates the measuredHeight property.
| MeasurableControl | |
![]() |
calculateMeasuredWidth():void
Calculates the measuredWidth property.
| MeasurableControl | |
![]() |
createChildren():void
This is where the new children should
be created and then added to the displaylist.
| MeasurableControl | |
![]() |
disableEvent(event:Event):void
| MeasurableControl | |
![]() |
dispatchDragStart(event:MouseEvent):void
| UIControl | |
![]() |
dispatchUpdateComplete():void
Dispatches the UpdateComplete event
| MeasurableControl | |
![]() |
doChildBasedValidation():void
While UIControls can be sized based on the dimensions of the parent
container, if the explicit or percent dimension values are not specified,
the UIControl can look at its children's dimensions and base its
sizing off them.
| UIControl | |
![]() |
doQueuedValidateSize(event:Event):void
doQueueValidateSize is executed by the top level UIControl.
| MeasurableControl | |
![]() |
handlePreDragMouseDown(event:Event):void
This function is called if the UIControl instance is drag enabled
and the user clicks the mouse down.
| UIControl | |
![]() |
invalidateDisplayList():void
| MeasurableControl | |
![]() |
onAddedToParent(event:Event):void
The event listener executed when this component
has been added to the parent.
| MeasurableControl | |
|
onMouseUpOutside(event:MouseEvent):void
| Button | ||
![]() |
onSkinnedControlResize(event:Event):void
Event handler for when the UIControl is applied as a Skin
and the control it is skinning is resized.
| UIControl | |
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Dispatched when a toggleable button's state changes from selected to deselected or vice versa. | Button | |||
| Button | ||||
![]() | UIControl | |||
![]() | MeasurableControl | |||
| Button | ||||
![]() | MeasurableControl | |||
![]() | MeasurableControl | |||
![]() | MeasurableControl | |||
![]() | MeasurableControl | |||
![]() | MeasurableControl | |||
![]() | MeasurableControl | |||
| Button | ||||
![]() | MeasurableControl | |||
| currentState | property |
public var currentState:String
| _isPressed | property |
protected var _isPressed:Boolean = false
| label | property |
label:String [read-write]Implementation
public function get label():String
public function set label(value:String):void
| mouseOutHandler | property |
public var mouseOutHandler:FunctionButtons by default return to their 'up' state when the mouse moves out, but buttons can be used as elements in sliders, scrollbars etc where mouseOut should be handled differently. Having the function referenced like this lets you override the mouseOut behavior
See also
| padding | property |
padding:Padding [write-only]IMPORTANT The Button control is different from basic UIControls. If there is a skin applied to the Button, changing the Padding property dispatches an event that the skin can react to, otherwise the Button does what UIControls do by default (so for example, that if a background painter is on it, it can repaint accordingly) Not sure how I like this, have to rethink Button as a pure interaction controller with no UI?
Implementation public function set padding(value:Padding):void
| _selected | property |
protected var _selected:Boolean = false
| selected | property |
selected:Boolean [read-write]Implementation
public function get selected():Boolean
public function set selected(value:Boolean):void
| skin | property |
| _toggle | property |
protected var _toggle:Boolean = false
| toggle | property |
toggle:Boolean [read-write]Sets whether a button is set as togglable or not. If true, the button can be set in a selected or deselected state
Implementation public function get toggle():Boolean
public function set toggle(value:Boolean):void
| Button | () | constructor |
public function Button()
| changeState | () | method |
public function changeState(fromState:String, toState:String):voidParameters
fromState:String |
|
toState:String |
| initialize | () | method |
public override function initialize():void
| onMouseUpOutside | () | method |
protected function onMouseUpOutside(event:MouseEvent):voidParameters
event:MouseEvent |
| change | event |
flash.events.Event
Dispatched when a toggleable button's state changes from selected to deselected or vice versa.
| down | event |
| over | event |
| up | event |