class FeathersControl
package feathers.core
extends MeasureSprite › ValidatingSprite
implements ILayoutObject, IVariantStyleObject, IUIControl
extended by BaseNavigator, BaseDividedBox, BaseProgressBar, BaseScrollBar, BaseScrollContainer, BaseSlider, TextFieldViewPort, ActivityIndicator, AssetLoader, BasicButton, BasicToggleButton, ButtonBar, Callout, Collapsible, ComboBox, DatePicker, Drawer, FormItem, Header, Label, LayoutGroup, NumericStepper, PageIndicator, PopUpDatePicker, PopUpListView, TabBar, TextInput, ToggleSwitch
Base class for all Feathers UI controls. Implements invalidation for changed
properties and sets up some basic template functions for component
lifecycle, like initialize()
and update()
.
This is a base class for Feathers UI components, and it isn't meant to be
instantiated directly. It should only be subclassed. For a simple
component that will automatically measure itself based on its children
(including optional support for layouts), see
feathers.controls.LayoutGroup
.
Events:
feathers.events.FeathersEvent.INITIALIZE | Dispatched after the
component's |
---|---|
feathers.events.FeathersEvent.ENABLE | Dispatched when
|
feathers.events.FeathersEvent.DISABLE | Dispatched when
|
feathers.events.FeathersEvent.CREATION_COMPLETE | Dispatched after the
component's |
feathers.events.FeathersEvent.LAYOUT_DATA_CHANGE | Dispatched when
|
feathers.events.FeathersEvent.STATE_CHANGE | Dispatched when
|
1.0.0
.See also:
Variables
alwaysShowFocus:Bool
Indicates if the focusRectSkin
should always be displayed when the
component is focused, or only after keyboard focus changes.
1.3.0
.read onlycreated:Bool
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.created)
{
control.addEventListener(FeathersEventType.CREATION_COMPLETE, creationCompleteHandler);
}
1.0.0
.See also:
disabledAlpha:Null<Float>
When disabledAlpha
is not null
, sets the alpha
property to this
value when the the enabled
property is set to false
.
1.0.0
.focusPaddingBottom:Float
Optional padding outside the bottom edge of this UI component when the
focusRectSkin
is visible.
1.0.0
.focusPaddingLeft:Float
Optional padding outside the left edge of this UI component when the
focusRectSkin
is visible.
1.0.0
.focusPaddingRight:Float
Optional padding outside the right edge of this UI component when the
focusRectSkin
is visible.
1.0.0
.focusPaddingTop:Float
Optional padding outside the top edge of this UI component when the
focusRectSkin
is visible.
1.0.0
.focusRectSkin:DisplayObject
An optional skin to display when an IFocusObject
component receives
focus.
1.0.0
.read onlyinitialized:Bool
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 initialized:
if(!control.initialized)
{
control.addEventListener(FeathersEvent.INITIALIZE, initializeHandler);
}
1.0.0
.See also:
read onlystyleContext:Class<IStyleObject>
The class used as the context for styling the component. If a subclass
of a component should have different styles than its superclass, it
should override the get_styleContext
getter. However, if a subclass
should continue using the same styles as its superclass, it happens
automatically.
1.0.0
.styleProvider:IStyleProvider
Typically used by the theme to provide styles to each component, but a custom style provider may be provided that will take precedence over the theme's style provider.
When a component initializes, its style provider sets properties that
affect the component's visual appearance. If the style provider
dispatches StyleProviderEvent.STYLES_CHANGE
after the component has
initialized, the original properties set by the style provider will be
reset to their default values and before applying the new property
values.
Setting the style provider or replacing an existing style provider
before a component initializes will queue up the style changes until after
initialization. Once a component initializes, the style provider
may be changed, but the changes will be applied immediately. Similarly
to when a style provider dispatcches StyleProviderEvent.STYLES_CHANGE
,
any properties that were set by the previous style provider will be
reset to their default values before applying the new style provider.
If the themeEnabled
property is false
, the current theme's style
provider will be ignored. However, if a custom style provider was
provided from outside of the theme, it will still be used.
1.0.0
.See also:
variant:String
May be used to provide multiple different variations of the same UI component, each with a different appearance.
1.0.0
.Methods
privateinitialize():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, `FeathersEvent.INITIALIZE is dispatched.
The following example overrides initialization:
override private function initialize():Void {
super.initialize();
}
1.0.0
.See also:
move(x:Float, y:Float):Void
Sets both the x
and y
positions of the control in a single function
call.
1.0.0
.See also:
DisplayObject.x
DisplayObject.y
setFocusPadding(value:Float):Void
Sets all four padding properties to the same value.
1.0.0
.See also:
setSize(width:Float, height:Float):Void
Sets both the width
and height
dimensions of the control in a single
function call.
1.0.0
.See also:
DisplayObject.width
DisplayObject.height
privatesetStyle(styleName:String, ?state:EnumValue):Bool
Determines if a style may be changed, and restricts the style from being changed in the future, if necessary.
1.0.0
.