Package | feathers.core |
Class | public class FeathersControl |
Inheritance | FeathersControl ![]() |
Implements | IFeathersControl, ILayoutDisplayObject |
Subclasses | BaseScreenNavigator, BitmapFontTextRenderer, Button, ButtonGroup, Callout, DefaultGroupedListHeaderOrFooterRenderer, Drawers, Header, ImageLoader, Label, LayoutGroup, NumericStepper, PageIndicator, PickerList, ProgressBar, ScrollBar, Scroller, SimpleScrollBar, Slider, SoundChannelPeakVisualizer, SpectrumBarGraphVisualizer, StageTextTextEditor, TabBar, TextBlockTextRenderer, TextFieldTextEditor, TextFieldTextRenderer, TextInput, ToggleSwitch, WebView |
initialize()
and
draw()
.
This is a base class for Feathers components that isn't meant to be
instantiated directly. It should only be subclassed. For a simple
component that will automatically size itself based on its children,
and with optional support for layouts, see LayoutGroup
.
See also
Property | Defined By | ||
---|---|---|---|
defaultTextEditorFactory : Function [static]
A function used by all UI controls that support text editor to
create an ITextEditor instance. | FeathersControl | ||
defaultTextRendererFactory : Function [static]
A function used by all UI controls that support text renderers to
create an ITextRenderer instance. | FeathersControl | ||
depth : int [read-only]
The component's depth in the display list, relative to the stage. | FeathersControl | ||
focusIndicatorSkin : DisplayObject
If this component supports focus, this optional skin will be
displayed above the component when showFocus() is
called. | FeathersControl | ||
focusManager : IFocusManager | FeathersControl | ||
focusOwner : IFocusDisplayObject | FeathersControl | ||
focusPadding : Number
Quickly sets all focus padding properties to the same value. | FeathersControl | ||
focusPaddingBottom : Number
The minimum space, in pixels, between the object's bottom edge and the
bottom edge of the focus indicator skin. | FeathersControl | ||
focusPaddingLeft : Number
The minimum space, in pixels, between the object's left edge and the
left edge of the focus indicator skin. | FeathersControl | ||
focusPaddingRight : Number
The minimum space, in pixels, between the object's right edge and the
right edge of the focus indicator skin. | FeathersControl | ||
focusPaddingTop : Number
The minimum space, in pixels, between the object's top edge and the
top edge of the focus indicator skin. | FeathersControl | ||
height : Number [override]
The height of the component, in pixels. | FeathersControl | ||
includeInLayout : Boolean
Determines if the ILayout should use this object or ignore it. | FeathersControl | ||
isCreated : Boolean [read-only]
Determines if the component has been initialized and validated for
the first time. | FeathersControl | ||
isEnabled : Boolean
Indicates whether the control is interactive or not. | FeathersControl | ||
isFocusEnabled : Boolean | FeathersControl | ||
isInitialized : Boolean [read-only]
Determines if the component has been initialized yet. | FeathersControl | ||
isQuickHitAreaEnabled : Boolean
Similar to mouseChildren on the classic display list. | FeathersControl | ||
layoutData : ILayoutData
Extra parameters associated with this display object that will be
used by the layout algorithm. | FeathersControl | ||
maxHeight : Number
The maximum recommended height to be used for self-measurement and,
optionally, by any code that is resizing this component. | FeathersControl | ||
maxWidth : Number
The maximum recommended width to be used for self-measurement and,
optionally, by any code that is resizing this component. | FeathersControl | ||
minHeight : Number
The minimum recommended height to be used for self-measurement and,
optionally, by any code that is resizing this component. | FeathersControl | ||
minTouchHeight : Number
If using isQuickHitAreaEnabled, and the hit area's
height is smaller than this value, it will be expanded. | FeathersControl | ||
minTouchWidth : Number
If using isQuickHitAreaEnabled, and the hit area's
width is smaller than this value, it will be expanded. | FeathersControl | ||
minWidth : Number
The minimum recommended width to be used for self-measurement and,
optionally, by any code that is resizing this component. | FeathersControl | ||
nextTabFocus : IFocusDisplayObject | FeathersControl | ||
previousTabFocus : IFocusDisplayObject | FeathersControl | ||
styleName : String
The concatenated styleNameList, with values separated
by spaces. | FeathersControl | ||
styleNameList : TokenList [read-only]
Contains a list of all "styles" assigned to this control. | FeathersControl | ||
styleProvider : IStyleProvider
When a component initializes, a style provider may be used to set
properties that affect the component's visual appearance. | FeathersControl | ||
width : Number [override]
The width of the component, in pixels. | FeathersControl |
Property | Defined By | ||
---|---|---|---|
actualHeight : Number = 0
The final height value that should be used for layout. | FeathersControl | ||
actualWidth : Number = 0
The final width value that should be used for layout. | FeathersControl | ||
defaultStyleProvider : IStyleProvider [read-only]
When the FeathersControl constructor is called, the
globalStyleProvider property is set to this value. | FeathersControl | ||
explicitHeight : Number = NaN
The height value explicitly set by calling the height setter or
setSize(). | FeathersControl | ||
explicitWidth : Number = NaN
The width value explicitly set by calling the width setter or
setSize(). | FeathersControl |
Method | Defined By | ||
---|---|---|---|
Constructor. | FeathersControl | ||
hideFocus():void
If the visual indicator of focus has been displayed by
showFocus(), call this function to hide it. | FeathersControl | ||
invalidate(flag:String):void
Call this function to tell the UI control that a redraw is pending. | FeathersControl | ||
isInvalid(flag:String = null):Boolean
Indicates whether the control is pending validation or not. | FeathersControl | ||
move(x:Number, y:Number):void
Sets both the x and the y positions of the control in a single
function call. | FeathersControl | ||
setSize(width:Number, height:Number):void
Sets both the width and the height of the control in a single
function call. | FeathersControl | ||
showFocus():void
If the object has focus, an additional visual indicator may
optionally be displayed to highlight the object. | FeathersControl | ||
validate():void
Immediately validates the display object, if it is invalid. | FeathersControl |
Method | Defined By | ||
---|---|---|---|
clearInvalidationFlag(flag:String):void
Clears an invalidation flag. | FeathersControl | ||
draw():void
Override to customize layout and to adjust properties of children. | FeathersControl | ||
focusInHandler(event:Event):void
Default event handler for FeathersEventType.FOCUS_IN
that may be overridden in subclasses to perform additional actions
when the component receives focus. | FeathersControl | ||
focusOutHandler(event:Event):void
Default event handler for FeathersEventType.FOCUS_OUT
that may be overridden in subclasses to perform additional actions
when the component loses focus. | FeathersControl | ||
initialize():void
Called the first time that the UI control is added to the stage, and
you should override this function to customize the initialization
process. | FeathersControl | ||
refreshFocusIndicator():void
Updates the focus indicator skin by showing or hiding it and
adjusting its position and dimensions. | FeathersControl | ||
setInvalidationFlag(flag:String):void
Sets an invalidation flag. | FeathersControl | ||
setSizeInternal(width:Number, height:Number, canInvalidate:Boolean):Boolean
Sets the width and height of the control, with the option of
invalidating or not. | FeathersControl |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched after the component has validated for the first time. | FeathersControl | |||
Dispatched after initialize() has been called, but before the first time that draw() has been called. | FeathersControl | |||
Dispatched when the width or height of the control changes. | FeathersControl |
Constant | Defined By | ||
---|---|---|---|
INVALIDATION_FLAG_ALL : String = all [static]
Flag to indicate that everything is invalid and should be redrawn. | FeathersControl | ||
INVALIDATION_FLAG_DATA : String = data [static]
Invalidation flag to indicate that the primary data displayed by the
UI control has changed. | FeathersControl | ||
INVALIDATION_FLAG_FOCUS : String = focus [static]
Invalidation flag to indicate that the focus of the UI control has
changed. | FeathersControl | ||
INVALIDATION_FLAG_LAYOUT : String = layout [static]
Invalidation flag to indicate that the layout of the UI control has
changed. | FeathersControl | ||
INVALIDATION_FLAG_SCROLL : String = scroll [static]
Invalidation flag to indicate that the scroll position of the UI
control has changed. | FeathersControl | ||
INVALIDATION_FLAG_SELECTED : String = selected [static]
Invalidation flag to indicate that the selection of the UI control
has changed. | FeathersControl | ||
INVALIDATION_FLAG_SIZE : String = size [static]
Invalidation flag to indicate that the dimensions of the UI control
have changed. | FeathersControl | ||
INVALIDATION_FLAG_SKIN : String = skin [static]
Invalidation flag to indicate that the skin of the UI control has changed. | FeathersControl | ||
INVALIDATION_FLAG_STATE : String = state [static]
Invalidation flag to indicate that the state has changed. | FeathersControl | ||
INVALIDATION_FLAG_STYLES : String = styles [static]
Invalidation flag to indicate that the styles or visual appearance of
the UI control has changed. | FeathersControl |
actualHeight | property |
protected var actualHeight:Number = 0
The final height value that should be used for layout. If the height has been explicitly set, then that value is used. If not, the actual height will be calculated automatically. Each component has different automatic sizing behavior, but it's usually based on the component's skin or content, including text or subcomponents.
actualWidth | property |
protected var actualWidth:Number = 0
The final width value that should be used for layout. If the width has been explicitly set, then that value is used. If not, the actual width will be calculated automatically. Each component has different automatic sizing behavior, but it's usually based on the component's skin or content, including text or subcomponents.
defaultStyleProvider | property |
defaultStyleProvider:IStyleProvider
[read-only]
When the FeathersControl
constructor is called, the
globalStyleProvider
property is set to this value. May be
null
.
Typically, a subclass of FeathersControl
will
override this function to return its static globalStyleProvider
value. For instance, feathers.controls.Button
overrides
this function, and its implementation looks like this:
override protected function get defaultStyleProvider():IStyleProvider { return Button.globalStyleProvider; }
protected function get defaultStyleProvider():IStyleProvider
See also
defaultTextEditorFactory | property |
public static var defaultTextEditorFactory:Function
A function used by all UI controls that support text editor to
create an ITextEditor
instance. You may replace the
default function with your own, if you prefer not to use the
StageTextTextEditor
.
The function is expected to have the following signature:
function():ITextEditor
See also
defaultTextRendererFactory | property |
public static var defaultTextRendererFactory:Function
A function used by all UI controls that support text renderers to create an ITextRenderer instance. You may replace the default function with your own, if you prefer not to use the BitmapFontTextRenderer.
The function is expected to have the following signature:
function():ITextRenderer
See also
depth | property |
depth:int
[read-only]
The component's depth in the display list, relative to the stage. If
the component isn't on the stage, its depth will be -1
.
Used by the validation system to validate components from the top down
. public function get depth():int
explicitHeight | property |
protected var explicitHeight:Number = NaN
The height value explicitly set by calling the height setter or setSize().
explicitWidth | property |
protected var explicitWidth:Number = NaN
The width value explicitly set by calling the width setter or setSize().
focusIndicatorSkin | property |
focusIndicatorSkin:DisplayObject
If this component supports focus, this optional skin will be
displayed above the component when showFocus()
is
called. The focus indicator skin is not always displayed when the
component has focus. Typically, if the component receives focus from
a touch, the focus indicator is not displayed.
The touchable
of this skin will always be set to
false
so that it does not "steal" touches from the
component or its sub-components. This skin will not affect the
dimensions of the component or its hit area. It is simply a visual
indicator of focus.
The implementation of this property is provided for convenience,
but it cannot be used unless a subclass implements the
IFocusDisplayObject
interface.
In the following example, the focus indicator skin is set:
control.focusIndicatorSkin = new Image( texture );
The default value is null
.
public function get focusIndicatorSkin():DisplayObject
public function set focusIndicatorSkin(value:DisplayObject):void
focusManager | property |
focusManager:IFocusManager
The default value is null
.
public function get focusManager():IFocusManager
public function set focusManager(value:IFocusManager):void
focusOwner | property |
focusOwner:IFocusDisplayObject
The default value is null
.
public function get focusOwner():IFocusDisplayObject
public function set focusOwner(value:IFocusDisplayObject):void
focusPadding | property |
focusPadding:Number
Quickly sets all focus padding properties to the same value. The
focusPadding
getter always returns the value of
focusPaddingTop
, but the other focus padding values may
be different.
The implementation of this property is provided for convenience,
but it cannot be used unless a subclass implements the
IFocusDisplayObject
interface.
The following example gives the button 2 pixels of focus padding on all sides:
control.focusPadding = 2;
The default value is 0
.
public function get focusPadding():Number
public function set focusPadding(value:Number):void
See also
focusPaddingBottom | property |
focusPaddingBottom:Number
The minimum space, in pixels, between the object's bottom edge and the bottom edge of the focus indicator skin. A negative value may be used to expand the focus indicator skin outside the bounds of the object.
The implementation of this property is provided for convenience,
but it cannot be used unless a subclass implements the
IFocusDisplayObject
interface.
The following example gives the focus indicator skin -2 pixels of padding on the bottom edge only:
control.focusPaddingBottom = -2;
The default value is 0
.
public function get focusPaddingBottom():Number
public function set focusPaddingBottom(value:Number):void
focusPaddingLeft | property |
focusPaddingLeft:Number
The minimum space, in pixels, between the object's left edge and the left edge of the focus indicator skin. A negative value may be used to expand the focus indicator skin outside the bounds of the object.
The implementation of this property is provided for convenience,
but it cannot be used unless a subclass implements the
IFocusDisplayObject
interface.
The following example gives the focus indicator skin -2 pixels of padding on the right edge only:
control.focusPaddingLeft = -2;
The default value is 0
.
public function get focusPaddingLeft():Number
public function set focusPaddingLeft(value:Number):void
focusPaddingRight | property |
focusPaddingRight:Number
The minimum space, in pixels, between the object's right edge and the right edge of the focus indicator skin. A negative value may be used to expand the focus indicator skin outside the bounds of the object.
The implementation of this property is provided for convenience,
but it cannot be used unless a subclass implements the
IFocusDisplayObject
interface.
The following example gives the focus indicator skin -2 pixels of padding on the right edge only:
control.focusPaddingRight = -2;
The default value is 0
.
public function get focusPaddingRight():Number
public function set focusPaddingRight(value:Number):void
focusPaddingTop | property |
focusPaddingTop:Number
The minimum space, in pixels, between the object's top edge and the top edge of the focus indicator skin. A negative value may be used to expand the focus indicator skin outside the bounds of the object.
The implementation of this property is provided for convenience,
but it cannot be used unless a subclass implements the
IFocusDisplayObject
interface.
The following example gives the focus indicator skin -2 pixels of padding on the top edge only:
control.focusPaddingTop = -2;
The default value is 0
.
public function get focusPaddingTop():Number
public function set focusPaddingTop(value:Number):void
height | property |
height:Number
[override] The height of the component, in pixels. This could be a value that was set explicitly, or the component will automatically resize if no explicit height value is provided. Each component has a different automatic sizing behavior, but it's usually based on the component's skin or content, including text or subcomponents.
Note: Values of the width
and
height
properties may not be accurate until after
validation. If you are seeing width
or height
values of 0
, but you can see something on the screen and
know that the value should be larger, it may be because you asked for
the dimensions before the component had validated. Call
validate()
to tell the component to immediately redraw
and calculate an accurate values for the dimensions.
In the following example, the height is set to 120 pixels:
control.height = 120;
In the following example, the height is cleared so that the component can automatically measure its own height:
control.height = NaN;
public function get height():Number
public function set height(value:Number):void
See also
includeInLayout | property |
includeInLayout:Boolean
Determines if the ILayout should use this object or ignore it.
In the following example, the display object is excluded from the layout:
object.includeInLayout = false;
The default value is true
.
public function get includeInLayout():Boolean
public function set includeInLayout(value:Boolean):void
isCreated | property |
isCreated:Boolean
[read-only] Determines if the component has been initialized and validated for the first time.
In the following example, we check if the component is created or not, and we listen for an event if it isn't:
if( !control.isCreated ) { control.addEventListener( FeathersEventType.CREATION_COMPLETE, creationCompleteHandler ); }
public function get isCreated():Boolean
See also
isEnabled | property |
isEnabled:Boolean
Indicates whether the control is interactive or not.
In the following example, the control is disabled:
control.isEnabled = false;
The default value is true
.
public function get isEnabled():Boolean
public function set isEnabled(value:Boolean):void
isFocusEnabled | property |
isFocusEnabled:Boolean
The default value is true
.
public function get isFocusEnabled():Boolean
public function set isFocusEnabled(value:Boolean):void
isInitialized | property |
isInitialized:Boolean
[read-only]
Determines if the component has been initialized yet. The
initialize()
function is called one time only, when the
Feathers UI control is added to the display list for the first time.
In the following example, we check if the component is initialized or not, and we listen for an event if it isn't:
if( !control.isInitialized ) { control.addEventListener( FeathersEventType.INITIALIZE, initializeHandler ); }
public function get isInitialized():Boolean
See also
isQuickHitAreaEnabled | property |
isQuickHitAreaEnabled:Boolean
Similar to mouseChildren
on the classic display list. If
true
, children cannot dispatch touch events, but hit
tests will be much faster. Easier than overriding
hitTest()
.
In the following example, the quick hit area is enabled:
control.isQuickHitAreaEnabled = true;
The default value is false
.
public function get isQuickHitAreaEnabled():Boolean
public function set isQuickHitAreaEnabled(value:Boolean):void
layoutData | property |
layoutData:ILayoutData
Extra parameters associated with this display object that will be used by the layout algorithm.
The default value is null
.
public function get layoutData():ILayoutData
public function set layoutData(value:ILayoutData):void
maxHeight | property |
maxHeight:Number
The maximum recommended height to be used for self-measurement and,
optionally, by any code that is resizing this component. This value
is not strictly enforced in all cases. An explicit height value that
is larger than maxHeight
may be set and will not be
affected by the maximum.
In the following example, the maximum width of the control is set to 120 pixels:
control.maxWidth = 120;
The default value is Number.POSITIVE_INFINITY
.
public function get maxHeight():Number
public function set maxHeight(value:Number):void
maxWidth | property |
maxWidth:Number
The maximum recommended width to be used for self-measurement and,
optionally, by any code that is resizing this component. This value
is not strictly enforced in all cases. An explicit width value that
is larger than maxWidth
may be set and will not be
affected by the maximum.
In the following example, the maximum width of the control is set to 120 pixels:
control.maxWidth = 120;
The default value is Number.POSITIVE_INFINITY
.
public function get maxWidth():Number
public function set maxWidth(value:Number):void
minHeight | property |
minHeight:Number
The minimum recommended height to be used for self-measurement and,
optionally, by any code that is resizing this component. This value
is not strictly enforced in all cases. An explicit height value that
is smaller than minHeight
may be set and will not be
affected by the minimum.
In the following example, the minimum height of the control is set to 120 pixels:
control.minHeight = 120;
The default value is 0
.
public function get minHeight():Number
public function set minHeight(value:Number):void
minTouchHeight | property |
minTouchHeight:Number
If using isQuickHitAreaEnabled
, and the hit area's
height is smaller than this value, it will be expanded.
In the following example, the minimum height of the hit area is set to 120 pixels:
control.minTouchHeight = 120;
The default value is 0
.
public function get minTouchHeight():Number
public function set minTouchHeight(value:Number):void
minTouchWidth | property |
minTouchWidth:Number
If using isQuickHitAreaEnabled
, and the hit area's
width is smaller than this value, it will be expanded.
In the following example, the minimum width of the hit area is set to 120 pixels:
control.minTouchWidth = 120;
The default value is 0
.
public function get minTouchWidth():Number
public function set minTouchWidth(value:Number):void
minWidth | property |
minWidth:Number
The minimum recommended width to be used for self-measurement and,
optionally, by any code that is resizing this component. This value
is not strictly enforced in all cases. An explicit width value that
is smaller than minWidth
may be set and will not be
affected by the minimum.
In the following example, the minimum width of the control is set to 120 pixels:
control.minWidth = 120;
The default value is 0
.
public function get minWidth():Number
public function set minWidth(value:Number):void
nextTabFocus | property |
nextTabFocus:IFocusDisplayObject
The default value is null
.
public function get nextTabFocus():IFocusDisplayObject
public function set nextTabFocus(value:IFocusDisplayObject):void
previousTabFocus | property |
previousTabFocus:IFocusDisplayObject
The default value is null
.
public function get previousTabFocus():IFocusDisplayObject
public function set previousTabFocus(value:IFocusDisplayObject):void
styleName | property |
styleName:String
The concatenated styleNameList
, with values separated
by spaces. Style names are somewhat similar to classes in CSS
selectors. In Feathers, they are a non-unique identifier that can
differentiate multiple styles of the same type of UI control. A
single control may have many style names, and many controls can share
a single style name. A theme
or another skinning mechanism may use style names to provide a
variety of visual appearances for a single component class.
In general, the styleName
property should not be set
directly on a Feathers component. You should add and remove style
names from the styleNameList
property instead.
The default value is ""
.
public function get styleName():String
public function set styleName(value:String):void
See also
styleNameList | property |
styleNameList:TokenList
[read-only] Contains a list of all "styles" assigned to this control. Names are like classes in CSS selectors. They are a non-unique identifier that can differentiate multiple styles of the same type of UI control. A single control may have many names, and many controls can share a single name. A theme or another skinning mechanism may use style names to provide a variety of visual appearances for a single component class.
Names may be added, removed, or toggled on the
styleNameList
. Names cannot contain spaces.
In the following example, a name is added to the name list:
control.styleNameList.add( "custom-component-name" );
public function get styleNameList():TokenList
See also
styleProvider | property |
styleProvider:IStyleProvider
When a component initializes, a style provider may be used to set properties that affect the component's visual appearance.
You can set or replace an existing style provider at any time before a component initializes without immediately affecting the component's visual appearance. After the component initializes, the style provider may still be changed, but any properties that were set by the previous style provider will not be reset to their default values.
public function get styleProvider():IStyleProvider
public function set styleProvider(value:IStyleProvider):void
See also
width | property |
width:Number
[override] The width of the component, in pixels. This could be a value that was set explicitly, or the component will automatically resize if no explicit width value is provided. Each component has a different automatic sizing behavior, but it's usually based on the component's skin or content, including text or subcomponents.
Note: Values of the width
and
height
properties may not be accurate until after
validation. If you are seeing width
or height
values of 0
, but you can see something on the screen and
know that the value should be larger, it may be because you asked for
the dimensions before the component had validated. Call
validate()
to tell the component to immediately redraw
and calculate an accurate values for the dimensions.
In the following example, the width is set to 120 pixels:
control.width = 120;
In the following example, the width is cleared so that the component can automatically measure its own width:
control.width = NaN;
public function get width():Number
public function set width(value:Number):void
See also
FeathersControl | () | Constructor |
public function FeathersControl()
Constructor.
clearInvalidationFlag | () | method |
protected function clearInvalidationFlag(flag:String):void
Clears an invalidation flag. This will not remove the component from
the validation queue. It only clears the flag. A subclass might use
this function during draw()
to manipulate the flags that
its superclass sees.
Parameters
flag:String |
draw | () | method |
protected function draw():void
Override to customize layout and to adjust properties of children. Called when the component validates, if any flags have been marked to indicate that validation is pending.
focusInHandler | () | method |
protected function focusInHandler(event:Event):void
Default event handler for FeathersEventType.FOCUS_IN
that may be overridden in subclasses to perform additional actions
when the component receives focus.
Parameters
event:Event |
focusOutHandler | () | method |
protected function focusOutHandler(event:Event):void
Default event handler for FeathersEventType.FOCUS_OUT
that may be overridden in subclasses to perform additional actions
when the component loses focus.
Parameters
event:Event |
hideFocus | () | method |
public function hideFocus():void
If the visual indicator of focus has been displayed by
showFocus()
, call this function to hide it.
Important: This function will not clear focus
from the display object if it has focus. To clear focus from the
display object, you should set the focus
property on
the focus manager to null
or another display object.
initialize | () | method |
protected function initialize():void
Called the first time that the UI control is added to the stage, and
you should override this function to customize the initialization
process. Do things like create children and set up event listeners.
After this function is called, FeathersEventType.INITIALIZE
is dispatched.
See also
invalidate | () | method |
public function invalidate(flag:String):void
Call this function to tell the UI control that a redraw is pending. The redraw will happen immediately before Starling renders the UI control to the screen. The validation system exists to ensure that multiple properties can be set together without redrawing multiple times in between each property change.
If you cannot wait until later for the validation to happen, you
can call validate()
to redraw immediately. As an example,
you might want to validate immediately if you need to access the
correct width
or height
values of the UI
control, since these values are calculated during validation.
Parameters
flag:String (default = NaN )
|
See also
isInvalid | () | method |
public function isInvalid(flag:String = null):Boolean
Indicates whether the control is pending validation or not. By
default, returns true
if any invalidation flag has been
set. If you pass in a specific flag, returns true
only
if that flag has been set (others may be set too, but it checks the
specific flag only. If all flags have been marked as invalid, always
returns true
.
Parameters
flag:String (default = null )
|
Boolean |
move | () | method |
public function move(x:Number, y:Number):void
Sets both the x and the y positions of the control in a single function call.
Parameters
x:Number | |
y:Number |
See also
refreshFocusIndicator | () | method |
protected function refreshFocusIndicator():void
Updates the focus indicator skin by showing or hiding it and
adjusting its position and dimensions. This function is not called
automatically. Components that support focus should call this
function at an appropriate point within the draw()
function. This function may be overridden if the default behavior is
not desired.
setInvalidationFlag | () | method |
protected function setInvalidationFlag(flag:String):void
Sets an invalidation flag. This will not add the component to the
validation queue. It only sets the flag. A subclass might use
this function during draw()
to manipulate the flags that
its superclass sees.
Parameters
flag:String |
setSize | () | method |
public function setSize(width:Number, height:Number):void
Sets both the width and the height of the control in a single function call.
Parameters
width:Number | |
height:Number |
See also
setSizeInternal | () | method |
protected function setSizeInternal(width:Number, height:Number, canInvalidate:Boolean):Boolean
Sets the width and height of the control, with the option of
invalidating or not. Intended to be used when the width
and height
values have not been set explicitly, and the
UI control needs to measure itself and choose an "ideal" size.
Parameters
width:Number | |
height:Number | |
canInvalidate:Boolean |
Boolean |
showFocus | () | method |
public function showFocus():void
If the object has focus, an additional visual indicator may optionally be displayed to highlight the object. Calling this function may have no effect. It's merely a suggestion to the object.
Important: This function will not give focus to
the display object if it doesn't have focus. To give focus to the
display object, you should set the focus
property on
the focus manager.
object.focusManager.focus = object;
validate | () | method |
public function validate():void
Immediately validates the display object, if it is invalid. The validation system exists to postpone updating a display object after properties are changed until until the last possible moment the display object is rendered. This allows multiple properties to be changed at a time without requiring a full update every time.
See also
creationComplete | Event |
starling.events.Event
feathers.events.FeathersEventType.CREATION_COMPLETE
Dispatched after the component has validated for the first time. Both
initialize()
and draw()
will have been called,
and all children will have been created.
The properties of the event object have the following values:
Property | Value |
---|---|
bubbles | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget . |
data | null |
target | The Object that dispatched the event;
it is not always the Object listening for the event. Use the
currentTarget property to always access the Object
listening for the event. |
FeathersEventType.CREATION_COMPLETE
event type is
meant to be used when an IFeathersControl
has finished
validating for the first time. A well-designed component will have
created all of its children and it will be fully ready for user
interaction.
initialize | Event |
starling.events.Event
feathers.events.FeathersEventType.INITIALIZE
Dispatched after initialize()
has been called, but before
the first time that draw()
has been called.
The properties of the event object have the following values:
Property | Value |
---|---|
bubbles | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget . |
data | null |
target | The Object that dispatched the event;
it is not always the Object listening for the event. Use the
currentTarget property to always access the Object
listening for the event. |
FeathersEventType.INITIALIZE
event type is meant to
be used when an IFeathersControl
has finished running
its initialize()
function.
resize | Event |
starling.events.Event
feathers.events.FeathersEventType.RESIZE
Dispatched when the width or height of the control changes.
The properties of the event object have the following values:
Property | Value |
---|---|
bubbles | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget . |
data | null |
target | The Object that dispatched the event;
it is not always the Object listening for the event. Use the
currentTarget property to always access the Object
listening for the event. |
FeathersEventType.RESIZE
event type is meant to
be used when an IFeathersControl
has resized.
INVALIDATION_FLAG_ALL | Constant |
public static const INVALIDATION_FLAG_ALL:String = all
Flag to indicate that everything is invalid and should be redrawn.
INVALIDATION_FLAG_DATA | Constant |
public static const INVALIDATION_FLAG_DATA:String = data
Invalidation flag to indicate that the primary data displayed by the UI control has changed.
INVALIDATION_FLAG_FOCUS | Constant |
public static const INVALIDATION_FLAG_FOCUS:String = focus
Invalidation flag to indicate that the focus of the UI control has changed.
INVALIDATION_FLAG_LAYOUT | Constant |
public static const INVALIDATION_FLAG_LAYOUT:String = layout
Invalidation flag to indicate that the layout of the UI control has changed.
INVALIDATION_FLAG_SCROLL | Constant |
public static const INVALIDATION_FLAG_SCROLL:String = scroll
Invalidation flag to indicate that the scroll position of the UI control has changed.
INVALIDATION_FLAG_SELECTED | Constant |
public static const INVALIDATION_FLAG_SELECTED:String = selected
Invalidation flag to indicate that the selection of the UI control has changed.
INVALIDATION_FLAG_SIZE | Constant |
public static const INVALIDATION_FLAG_SIZE:String = size
Invalidation flag to indicate that the dimensions of the UI control have changed.
INVALIDATION_FLAG_SKIN | Constant |
public static const INVALIDATION_FLAG_SKIN:String = skin
Invalidation flag to indicate that the skin of the UI control has changed.
INVALIDATION_FLAG_STATE | Constant |
public static const INVALIDATION_FLAG_STATE:String = state
Invalidation flag to indicate that the state has changed. Used by
isEnabled
, but may be used for other control states too.
See also
INVALIDATION_FLAG_STYLES | Constant |
public static const INVALIDATION_FLAG_STYLES:String = styles
Invalidation flag to indicate that the styles or visual appearance of the UI control has changed.