class FeathersControl
package feathers.core
extends MeasureSprite › ValidatingSprite
implements ILayoutObject, IVariantStyleObject, IUIControl
extended by BaseNavigator, BaseDividedBox, BaseProgressBar, BaseScrollBar, BaseScrollContainer, BaseSlider, TextFieldViewPort, AssetLoader, BasicButton, BasicToggleButton, CalendarGrid, Callout, ComboBox, Drawer, Label, LayoutGroup, PageIndicator, 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
.
1.0.0
.See also:
Variables
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);
}
See also:
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
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, and any properties that were set by the previous style provider will be reset to their default values before applying the new style provider.
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, Event.INIT
is dispatched.
The following example overrides initialization:
override private function initialize():Void {
super.initialize();
}
1.0.0
.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
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
.