qnx.ui.text.TextInputIMF

TextInputIMF

Properties | Methods | Events


Packageqnx.ui.text
Classpublic class TextInputIMF
InheritanceTextInputIMF Inheritance SkinnableComponent Inheritance UIComponent Inheritance flash.display.MovieClip



Class information:
PlayBook Tablet OS Version:   1.0.6



Public Properties

 PropertyDefined By
  autoCapitalize : String
TextInputIMF
  autoCorrect : Boolean
TextInputIMF
  autoSize : String
Deprecated: Deprecated as of version 1.0.1. Value is ignored.
Gets or sets a String that indicates how a label is sized and aligned to fit the value of its text property.
TextInputIMF
  clearIconMode : int
Gets or sets a value that determines how the clear button appears in the text field.
TextInputIMF
 Inheritedcontainment : String
Gets or sets a property that determines how a component is contained within a parent container.
UIComponent
  displayAsPassword : Boolean
Gets or sets a Boolean that determines whether text should be masked.
TextInputIMF
  editing : Boolean
[read-only]
TextInputIMF
  embedFonts : Boolean
Gets or sets the embedFonts property of the internal TextField of the label.
TextInputIMF
  format : TextFormat
Gets or sets the TextFormat object of the label.
TextInputIMF
  keyboardType : String
The virtual keyboard type to use when this text input has focus.
TextInputIMF
  leftIcon : DisplayObject
Gets or sets the left icon for the TextInput component.
TextInputIMF
  leftIconMode : int
Gets or sets a value that controls how the left icon is displayed in the text field.
TextInputIMF
  length : int
[read-only]
TextInputIMF
  maxChars : int
Gets or sets the maximum number of characters that the text field can contain, as entered by a user.
TextInputIMF
  prompt : String
Gets or sets the placeholder text that is displayed in the text field when there is no other text in the text field.
TextInputIMF
  restrict : String
Gets or sets the restrict property of the internal TextField.
TextInputIMF
  returnKeyDisable : Boolean
When set to true the virtual keyboard return key is disabled, when this text input has focus.
TextInputIMF
  returnKeyType : String
The virtual keyboard enter key type to use when this text input has focus.
TextInputIMF
  rightIcon : DisplayObject
Gets or sets the right icon for the TextInput component.
TextInputIMF
  rightIconMode : int
Gets or sets a value that controls how the right icon is displayed in the text field.
TextInputIMF
  selected : Boolean
[read-only]
TextInputIMF
  selectionActiveIndex : int
[read-only]
TextInputIMF
  selectionAnchorIndex : int
[read-only]
TextInputIMF
 Inheritedsize : Number
Gets or sets the size for this component (as a percentage of the container's size, or in pixels).
UIComponent
 InheritedsizeMode : String
Gets or sets the size mode for this component.
UIComponent
 InheritedsizeUnit : String
Gets or sets the unit of measure for the size property.
UIComponent
  spellCheck : Boolean
TextInputIMF
  text : String
Gets or sets the text String of the label.
TextInputIMF
  textHeight : int
[read-only] Returns the height of the text in the label (in pixels).
TextInputIMF
  textWidth : int
[read-only] Returns the width of the text in the label (in pixels).
TextInputIMF

Protected Properties

 PropertyDefined By
  label_txt : SingleLineEditableText
TextInputIMF

Public Methods

 MethodDefined By
  
Creates a TextInputIMF instance.
TextInputIMF
 Inherited
destroy():void
Call this method when you want to have your object collected by the garbage collector.
UIComponent
 Inherited
drawNow():void
Calls the draw() method.
UIComponent
  
getLeftIconRect():Rectangle
Gets the position and size of the left icon.
TextInputIMF
  
getRightIconRect():Rectangle
Gets the position and size of the right icon.
TextInputIMF
  
hasFocus():Boolean
Returns true if the component currently has focus.
TextInputIMF
 Inherited
invalidate(property:String = all, invalidateNow:Boolean = false):void
Marks the property as invalid and the draw() method is called on the next frame or the next render, whichever comes first.
UIComponent
  
replaceText(start:int, end:int, value:String):void
TextInputIMF
 Inherited
setPosition(x:Number, y:Number):void
Sets the x and y position of the component.
UIComponent
  
setSelection(anchorIndex:int, activeIndex:int):void
TextInputIMF
 Inherited
setSize(w:Number, h:Number):void
Sets the width and height of the component.
UIComponent
 Inherited
setSkin(cellSkin:Object):void
Set the skin object on the component for it to render.
SkinnableComponent

Protected Methods

 MethodDefined By
 Inherited
callLater(method:Function):void
Calls the specified method on the next frame or the next render, which ever happens first.
UIComponent
 Inherited
createInstance(linkage:Object):DisplayObject
Calling this method will attempt to create a DisplayObject instance based on the value of the linkage parameter.
UIComponent
 Inherited
draw():void
Called every time you set the width and height of the component.
UIComponent
 Inherited
isInvalid(property:String, ... properties):Boolean
Checks to see if the property is invalid and returns true if it is.
UIComponent
 Inherited
onAdded():void
Called when the instance is added to the stage.
UIComponent
 Inherited
onRemoved():void
Called when the instance is removed from the stage.
UIComponent
 Inherited
setEnabled(val:Boolean):void
Called when the enabled property changes.
UIComponent
 Inherited
validate(property:String = all):void
Lets the component know that the specified property has been validated.
UIComponent

Events

 Event Summary Defined By
  Dispatched when the text in the input field is modified.TextInputIMF

Property Detail

autoCapitalize


autoCapitalize:String


Implementation

public function get autoCapitalize():String
public function set autoCapitalize(value:String):void

autoCorrect


autoCorrect:Boolean


Implementation

public function get autoCorrect():Boolean
public function set autoCorrect(value:Boolean):void

autoSize


autoSize:String
Deprecated: Deprecated as of version 1.0.1. Value is ignored.

Gets or sets a String that indicates how a label is sized and aligned to fit the value of its text property.

NOTE: This value is deprecated and its value is ignored.

The following are valid values:

  • TextFieldAutoSize.NONE: The label is not resized or aligned to fit the text.
  • TextFieldAutoSize.LEFT: The right and bottom sides of the label are resized to fit the text. The left and top sides are not resized.
  • TextFieldAutoSize.CENTER: The left and right sides of the label resize to fit the text. The horizontal center of the label stays anchored at its original horizontal center position.
  • TextFieldAutoSize.RIGHT: The left and bottom sides of the label are resized to fit the text. The top and right sides are not resized.

The default value is The default value is TextFieldAutoSize.NONE..


Implementation

public function get autoSize():String
public function set autoSize(value:String):void

clearIconMode


clearIconMode:int

Gets or sets a value that determines how the clear button appears in the text field.


Implementation

public function get clearIconMode():int
public function set clearIconMode(value:int):void

See also

TextInputIconMode

displayAsPassword


displayAsPassword:Boolean

Gets or sets a Boolean that determines whether text should be masked.

When set to true, any character entered into the TextInput instance will appear as an asterisk.

A textInputfield with the clear text icon enabled.


Implementation

public function get displayAsPassword():Boolean
public function set displayAsPassword(value:Boolean):void

editing


editing:Boolean  [read-only]


Implementation

public function get editing():Boolean

embedFonts


embedFonts:Boolean

Gets or sets the embedFonts property of the internal TextField of the label.

When set to false, fonts are rendered as device fonts. When set to true, you must specify a font using the font property of a TextFormat object and set it to the format property. This font must be included in the in your application. If it is not included, the text will not be rendererd.

The default value is false.


Implementation

public function get embedFonts():Boolean
public function set embedFonts(value:Boolean):void

format


format:TextFormat

Gets or sets the TextFormat object of the label.

The TextFormat object is used to format and style the text of the label. The label has the following default text format:

  • format.size = 16;
  • format.font = "BBAlpha Sans";
  • format.color = 0xFFFFFF;

In the following listing, a TextFormat object is created and applied to the TextInput field by setting the format property.

        
        var myFormat:TextFormat = new TextFormat();
        myFormat.size = 18;
        myFormat.italic = true;
        myFormat.bold = true;
                    
        myInput = new TextInput();
        myInput.setPosition(200, 200);
        myInput.width = 300;
        myInput.format = myFormat;
        this.addChild(myInput);
        


Implementation

public function get format():TextFormat
public function set format(value:TextFormat):void

keyboardType


keyboardType:String

The virtual keyboard type to use when this text input has focus.

When the user touches a TextInput instance and the TextInput gains focus, a virtual keyboard slides in from the bottom of the screen. You can set the KeyboardType property to define the keyboard layout type that best suits the type of data that the TextInput instance will contain. The following virutal keyboard appears by default:


Implementation

public function get keyboardType():String
public function set keyboardType(value:String):void

See also

KeyboardType
ReturnKeyType

label_txt


protected var label_txt:SingleLineEditableText

leftIcon


leftIcon:DisplayObject

Gets or sets the left icon for the TextInput component.

The icon is sized and positioned according to the value that is returned from the getLeftIconRect method.


Implementation

public function get leftIcon():DisplayObject
public function set leftIcon(value:DisplayObject):void

See also

getLeftIconRect()

leftIconMode


leftIconMode:int

Gets or sets a value that controls how the left icon is displayed in the text field.


Implementation

public function get leftIconMode():int
public function set leftIconMode(value:int):void

See also

TextInputIconMode
leftIcon

length


length:int  [read-only]


Implementation

public function get length():int

maxChars


maxChars:int

Gets or sets the maximum number of characters that the text field can contain, as entered by a user. A script can insert more text than maxChars allows; the maxChars property indicates only how much text a user can enter. If the value of this property is 0, a user can enter an unlimited amount of text.

The default value is 0.


Implementation

public function get maxChars():int
public function set maxChars(value:int):void

prompt


prompt:String

Gets or sets the placeholder text that is displayed in the text field when there is no other text in the text field.


Implementation

public function get prompt():String
public function set prompt(value:String):void

restrict


restrict:String

Gets or sets the restrict property of the internal TextField. For more information, see Adobe's TextField ActionScript 3 reference.


Implementation

public function get restrict():String
public function set restrict(value:String):void

returnKeyDisable


returnKeyDisable:Boolean

When set to true the virtual keyboard return key is disabled, when this text input has focus.


Implementation

public function get returnKeyDisable():Boolean
public function set returnKeyDisable(value:Boolean):void

returnKeyType


returnKeyType:String

The virtual keyboard enter key type to use when this text input has focus.


Implementation

public function get returnKeyType():String
public function set returnKeyType(value:String):void

See also

KeyboardType
ReturnKeyType

rightIcon


rightIcon:DisplayObject

Gets or sets the right icon for the TextInput component. The icon is sized and positioned according to the value that is returned from the getRightIconRect method.


Implementation

public function get rightIcon():DisplayObject
public function set rightIcon(value:DisplayObject):void

See also

getRightIconRect()

rightIconMode


rightIconMode:int

Gets or sets a value that controls how the right icon is displayed in the text field.


Implementation

public function get rightIconMode():int
public function set rightIconMode(value:int):void

See also

TextInputIconMode
rightIcon

selected


selected:Boolean  [read-only]


Implementation

public function get selected():Boolean

selectionActiveIndex


selectionActiveIndex:int  [read-only]


Implementation

public function get selectionActiveIndex():int

selectionAnchorIndex


selectionAnchorIndex:int  [read-only]


Implementation

public function get selectionAnchorIndex():int

spellCheck


spellCheck:Boolean


Implementation

public function get spellCheck():Boolean
public function set spellCheck(value:Boolean):void

text


text:String

Gets or sets the text String of the label.


Implementation

public function get text():String
public function set text(value:String):void

textHeight


textHeight:int  [read-only]

Returns the height of the text in the label (in pixels).


Implementation

public function get textHeight():int

textWidth


textWidth:int  [read-only]

Returns the width of the text in the label (in pixels).


Implementation

public function get textWidth():int

Constructor Detail

TextInputIMF()


public function TextInputIMF()

Creates a TextInputIMF instance.

Method Detail

getLeftIconRect()


public function getLeftIconRect():Rectangle

Gets the position and size of the left icon.

Returns

Rectangle — Returns the rectangle in which the left icon occupies.

See also

leftIcon

getRightIconRect()


public function getRightIconRect():Rectangle

Gets the position and size of the right icon.

Returns

Rectangle — Returns the rectangle in which the right icon occupies.

See also

rightIcon

hasFocus()


public function hasFocus():Boolean

Returns true if the component currently has focus. This should be used instead of checking stage.focus as children of this component may have focus.

Returns

Boolean

replaceText()


public function replaceText(start:int, end:int, value:String):void

Parameters

start:int
end:int
value:String

setSelection()


public function setSelection(anchorIndex:int, activeIndex:int):void

Parameters

anchorIndex:int
activeIndex:int

Event Detail

change


Event Object Type: flash.events.Event
Event.type property = flash.events.Event.CHANGE

Dispatched when the text in the input field is modified.