class FormItem
package feathers.controls
extends FeathersControl › MeasureSprite › ValidatingSprite
implements IFocusManagerAware, ITextControl
Displays text next to a control in a form.
1.0.0
.Constructor
Variables
backgroundSkin:DisplayObject
The default background skin to display behind the form item's content.
The following example passes a bitmap for the form item to use as a background skin:
formItem.backgroundSkin = new Bitmap(bitmapData);
1.0.0
.See also:
content:DisplayObject
The content displayed by the form item.
The following example sets the form item's content:
var nameInput = new TextInput();
nameInput.prompt = "First and last name";
formItem.content = nameInput;
1.0.0
.See also:
disabledBackgroundSkin:DisplayObject
A background skin to display behind the form item's content when the form item is disabled.
The following example gives the form item a disabled background skin:
formItem.disabledBackgroundSkin = new Bitmap(bitmapData);
formItem.enabled = false;
1.0.0
.See also:
disabledTextFormat:AbstractTextFormat
The font styles used to render the form item's text when the form item is disabled.
In the following example, the form item's disabled text formatting is customized:
formItem.enabled = false;
formItem.disabledTextFormat = new TextFormat("Helvetica", 20, 0xee0000);
1.0.0
.See also:
embedFonts:Bool
Determines if an embedded font is used or not.
In the following example, the form item uses embedded fonts:
formItem.embedFonts = true;
1.0.0
.See also:
gap:Float
The space, measured in pixels, between the form item's text and its
content. Applies to either horizontal or vertical spacing, depending on
the value of textPosition
.
The following example creates a gap of 20 pixels between the text and the content:
formItem.text = "Name";
formItem.content = new TextInput();
formItem.gap = 20.0;
1.0.0
.horizontalAlign:HorizontalAlign
How the content
is positioned horizontally (along the x-axis) within
the available space next to the form item's text.
The following example aligns the form item's content to the right:
formItem.verticalAlign = RIGHT;
1.0.0
.See also:
htmlText:String
Text displayed by the label that is parsed as a simple form of HTML.
The following example sets the label's HTML text:
label.htmlText = "<b>Hello</b> <i>World</i>";
1.0.0
.See also:
paddingBottom:Float
The minimum space, in pixels, between the form item's bottom edge and the form item's content.
In the following example, the form item's bottom padding is set to 20 pixels:
formItem.paddingBottom = 20.0;
1.0.0
.paddingLeft:Float
The minimum space, in pixels, between the form item's left edge and the form item's content.
In the following example, the form item's left padding is set to 20 pixels:
formItem.paddingLeft = 20.0;
1.0.0
.paddingRight:Float
The minimum space, in pixels, between the form item's right edge and the form item's content.
In the following example, the form item's right padding is set to 20 pixels:
formItem.paddingRight = 20.0;
1.0.0
.paddingTop:Float
The minimum space, in pixels, between the form item's top edge and the form item's content.
In the following example, the form item's top padding is set to 20 pixels:
formItem.paddingTop = 20.0;
1.0.0
.required:Bool
Indicates if the form item is required. This is purely a visual indicator, and it will not prevent the form from being submitted.
In the following example, the form item is required:
formItem.required = true;
1.0.0
.See also:
requiredSkin:DisplayObject
The symbol displayed if the required
property is true
.
In the following example, the form item's required skin is set to a bitmap:
formItem.requiredSkin = new Bitmap(bitmapData);
1.0.0
.See also:
selectable:Bool
Indicates if the form item's text may be selected or not.
In the following example, the form item's text is selectable:
formItem.selectable = true;
1.0.0
.read onlyselectionBeginIndex:Int
The start index of the selection.
If selectable
is false
, returns -1
.
1.0.0
.read onlyselectionEndIndex:Int
The end index of the selection.
If selectable
is false
, returns -1
.
1.0.0
.styleSheet:StyleSheet
A custom stylesheet to use with htmlText
.
If the styleSheet
style is not null
, the textFormat
style will
be ignored.
1.0.0
.See also:
submitOnEnterEnabled:Bool = true
Set to false to prevent Keyboard.ENTER
from submitting the Form
that
contains this item.
In the following example, the form item does not submit when pressing the enter key:
formItem.submitOnEnterEnabled = false;
1.0.0
.text:String
The text displayed by the form item.
The following example sets the form item's text:
formItem.text = "Address";
1.0.0
.See also:
textFormat:AbstractTextFormat
The font styles used to render the form item's text.
In the following example, the form item's text formatting is customized:
formItem.textFormat = new TextFormat("Helvetica", 20, 0xcc0000);
1.0.0
.See also:
textPosition:RelativePosition
The location of the form item's text, relative to its content.
The following example positions the text to the left of the text:
formItem.text = "Click Me";
formItem.content = new TextInput();
formItem.textPosition = LEFT;
1.0.0
.See also:
verticalAlign:VerticalAlign
How the content
is positioned vertically (along the y-axis) within the
available space next to the form item's text.
The following example aligns the form item's content to the bottom:
formItem.verticalAlign = BOTTOM;
1.0.0
.See also:
wordWrap:Bool
Determines if the text is displayed on a single line, or if it wraps.
In the following example, the form item's text wraps:
formItem.wordWrap = true;
1.0.0
.Methods
getTextMeasuredWidth():Float
Returns the measured width of the form item's text. Used by Form
to
position all form items correctly.
1.0.0
.setPadding(value:Float):Void
Sets all four padding properties to the same value.
1.0.0
.See also: