| Package | qnx.fuse.ui.text |
| Class | public class TextBase |
| Inheritance | TextBase UIComponent flash.display.MovieClip |
| Subclasses | EditableText |
| Property | Defined By | ||
|---|---|---|---|
![]() | explicitHeight : Number [read-only] | UIComponent | |
![]() | explicitWidth : Number [read-only] | UIComponent | |
| format : TextFormat
Gets or sets the format of the text. | TextBase | ||
![]() | includeInLayout : Boolean
Specifies if the component should be included in it's parent containers layout. | UIComponent | |
![]() | layoutData : Object
Returns the layout data for the object. | UIComponent | |
| length : int [read-only]
Returns the length of the text that is being rendered. | TextBase | ||
| locale : String
Gets or sets the current locale of the text. | TextBase | ||
| maxLines : int
Gets or sets the maximum number of lines to measured by a layout. | TextBase | ||
![]() | minHeight : Number
Sets the minimum preferred height of the control. | UIComponent | |
| minLines : int
Gets or sets the minimum number of lines to measured by a layout. | TextBase | ||
![]() | minWidth : Number
Sets the minimum preferred width of the control. | UIComponent | |
| selectable : Boolean
Gets or sets whether text can be selected. | TextBase | ||
| selected : Boolean [read-only]
Returns true if the component has a text selection and false if it does not. | TextBase | ||
| selectionActiveIndex : int [read-only]
Returns the zero-based index of the first character in the selection. | TextBase | ||
| selectionAnchorIndex : int [read-only]
Returns the zero-based index of the last character in the selection. | TextBase | ||
| selectionImageBitmap : BitmapData [static] | TextBase | ||
| text : String
Gets or sets the text of the component. | TextBase | ||
| textHeight : Number [read-only]
Gets the current height of the text. | TextBase | ||
| textWidth : Number [read-only]
Gets the current width of the text. | TextBase | ||
| Property | Defined By | ||
|---|---|---|---|
![]() | displayListIsInvalid : Boolean = false | UIComponent | |
| enableEmoticons : Boolean
Enables or disables emoticons from being displayed. | TextBase | ||
![]() | propertiesAreInvalid : Boolean = false | UIComponent | |
![]() | sizeChange : Boolean | UIComponent | |
![]() | stateChanged : Boolean | UIComponent | |
| Method | Defined By | ||
|---|---|---|---|
TextBase() | TextBase | ||
![]() | childChanged(resizedChild:DisplayObject = null):Boolean
Notifies the UIComponent that one or more of its children has changed in a manner
that may affect this object's layout. | UIComponent | |
![]() | destroy():void
Call this method when you want to have your object collected by the garbage collector. | UIComponent | |
![]() | getSizeOptions():int | UIComponent | |
getTextLineAt(index:int):TextLine
Gets a TextLine at a specific index. | TextBase | ||
![]() | invalidateDisplayList():void
Calling this method results in a call to the components validateDisplayList() method before the display list is rendered. | UIComponent | |
![]() | invalidateProperties():void
Calling this method results in a call to the components validateProperties() method before the display list is rendered. | UIComponent | |
![]() | measure(availableWidth:Number, availableHeight:Number):LayoutMeasurement | UIComponent | |
mouseFocusChange(event:FocusEvent):void
Checks to see if focus is about to be lost when interacting with an object in the control. | TextBase | ||
registerEmoticons(emoticons:Vector.<Emoticon>):void
Registers a set of emoticons with the text component. | TextBase | ||
scrollInView(position:int, immediate:Boolean = false):void
Scrolls the position into view. | TextBase | ||
![]() | setActualSize(w:Number, h:Number):void
Sets the width and height of the object without setting
the explicitWidth and explicitHeight. | UIComponent | |
![]() | setLayoutBounds(bounds:Rectangle):void
Sets the receiver's size and location to the rectangular area specified
by the arguments. | UIComponent | |
![]() | setPosition(x:Number, y:Number):void
Sets the x and y position of the component. | UIComponent | |
setSelection(anchorIndex:int, activeIndex:int):void
Sets the selection of the text within a given range. | TextBase | ||
![]() | validateDisplayList():void
Validates the display list of the component by calling the updateDisplayList(). | UIComponent | |
![]() | validateNow():void
Validates the component immediately by calling validateProperties(), validateSizes(), and validateDisplayList() if necessary. | UIComponent | |
![]() | validateProperties():void
Validates the properties of the component by calling the commitProperties() method. | UIComponent | |
| Method | Defined By | ||
|---|---|---|---|
![]() | commitProperties():void
Process properties of the component. | UIComponent | |
![]() | commitState():void
Process the state of the component. | UIComponent | |
composeLines(width:Number, height:Number):Boolean
Creates all of the text lines given the specified width and height. | TextBase | ||
createTextLines(width:Number, height:Number):void
Renders the text at the specified width and height. | TextBase | ||
cursor2linePos(cursor:Cursor, consumer:Function):void
Given a specified cursor, this method calls the consumer parameter with TextLine and the x position of the cursor. | TextBase | ||
![]() | doMeasure(availableWidth:Number, availableHeight:Number):LayoutMeasurement | UIComponent | |
event2cursor(stageX:Number, stageY:Number, rail:TextLine):Cursor
Gets a cursor given x and y cordinates of the component, expressed in the stage corrdinate system. | TextBase | ||
event2word(stageX:Number, stageY:Number, consumer:Function):void
Based on x and y positions in the stage corrdinate system, call the consumer with the logical start and end of the word in the text. | TextBase | ||
![]() | flushCache():void
Invoked as part of parentLayoutChanged. | UIComponent | |
getTextAlignment():String
Gets the text alignment for laying out the text. | TextBase | ||
getTextLine(block:TextBlock = null, previousLine:TextLine = null, width:Number = 1000000, lineOffset:Number = 0.0, fitSomething:Boolean = false):TextLine
This method creates the text line. | TextBase | ||
getTextToDisplay():String
Gets the text to be rendered by the component. | TextBase | ||
lineFragment2rectangle(line:TextLine, left:Number, right:Number, consumer:Function):void
Given a line fragement, call the consumer with the corresponding rectangle. | TextBase | ||
![]() | onAdded():void
Called when the instance is added to the stage. | UIComponent | |
![]() | onRemoved():void
Called when the instance is removed from the stage. | UIComponent | |
![]() | parentLayoutChanged():void
Invalidates the parent's size and display list if includeInLayout property is set to true. | UIComponent | |
position2cursor(position:int):Cursor
Return a Cursor object given the specified position in the text. | TextBase | ||
positionLines(width:Number, height:Number, lines:Vector.<TextLine>):Point
Positions all of the created text lines given a specified width and height. | TextBase | ||
range2lineFragments(start:int, limit:int, consumer:Function):void
Given a range in the text, call the consumer with the corresponding line fragments. | TextBase | ||
range2rectangles(start:int, limit:int, consumer:Function):void
Given a range in the text, call the consumer with the corresponding values for the rectangle. | TextBase | ||
removeLines():void
Removes the current TextLines from the display list. | TextBase | ||
scrollUpdate():void
Called when the text is moving during a scroll. | TextBase | ||
![]() | updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
Sets the size and position of the children of the component. | UIComponent | |
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when text is laid out and the text dimensions have changed. | TextBase | |||
| Dispatched when a text selection has changed. | TextBase | |||
| enableEmoticons | property |
enableEmoticons:BooleanEnables or disables emoticons from being displayed. This is set by the registerEmoticons() method. Passing in a Vector with a length bigger then 0 will result in this property being set to true. Otherwise it is set to false.
protected function get enableEmoticons():Boolean protected function set enableEmoticons(value:Boolean):void| format | property |
format:TextFormatGets or sets the format of the text.
public function get format():TextFormat public function set format(value:TextFormat):void| length | property |
length:int [read-only] Returns the length of the text that is being rendered. This may be different then calling text.length; Emoticons in the text count as 1 character.
public function get length():int| locale | property |
locale:StringGets or sets the current locale of the text. The locale property controls whether text is rendered left to right or right to left.
The default value is en_US.
public function get locale():String public function set locale(value:String):void| maxLines | property |
maxLines:intGets or sets the maximum number of lines to measured by a layout. The text component will render additional lines, if necessary, and will be clipped from view. Setting this value to 0 causes all lines to be measured.
The default value is 0;.
public function get maxLines():int public function set maxLines(value:int):void| minLines | property |
minLines:intGets or sets the minimum number of lines to measured by a layout. If the full text results in less lines then the minimum number of lines, the size of the minimum number of lines will be returned when measuring the text. Setting this value less then 1 will have no effect and will be constrained to 1.
The default value is 1;.
public function get minLines():int public function set minLines(value:int):void| selectable | property |
selectable:BooleanGets or sets whether text can be selected.
The default value is true.
public function get selectable():Boolean public function set selectable(value:Boolean):void| selected | property |
selected:Boolean [read-only] Returns true if the component has a text selection and false if it does not.
public function get selected():Boolean| selectionActiveIndex | property |
selectionActiveIndex:int [read-only] Returns the zero-based index of the first character in the selection.
public function get selectionActiveIndex():int| selectionAnchorIndex | property |
selectionAnchorIndex:int [read-only] Returns the zero-based index of the last character in the selection.
public function get selectionAnchorIndex():int| selectionImageBitmap | property |
public static var selectionImageBitmap:BitmapData| text | property |
text:StringGets or sets the text of the component.
public function get text():String public function set text(value:String):void| textHeight | property |
textHeight:Number [read-only] Gets the current height of the text.
public function get textHeight():Number| textWidth | property |
textWidth:Number [read-only] Gets the current width of the text.
public function get textWidth():Number| urlBarMode | property |
urlBarMode:Boolean qnx_internal function get urlBarMode():Boolean qnx_internal function set urlBarMode(value:Boolean):void| TextBase | () | Constructor |
public function TextBase()| composeLines | () | method |
protected function composeLines(width:Number, height:Number):BooleanCreates all of the text lines given the specified width and height. This method is responsible for adding the text lines to the display list of the textHolder property. This method is responsible for adding the text lines to the textLines vector. Overriding this method and failing to do either of these items will cause undesired behavior.
Parameters
width:Number | |
height:Number |
Boolean — Returns true if all of the text lines where created.
|
| createTextLines | () | method |
protected final function createTextLines(width:Number, height:Number):voidRenders the text at the specified width and height.
Parameters
width:Number — The available width to render text into.
| |
height:Number — The available height to render text into.
|
| cursor2linePos | () | method |
protected final function cursor2linePos(cursor:Cursor, consumer:Function):voidGiven a specified cursor, this method calls the consumer parameter with TextLine and the x position of the cursor. The consumer function should be the following. function( line:TextLine, x:Number ):void
Parameters
cursor:Cursor | |
consumer:Function |
| event2cursor | () | method |
protected final function event2cursor(stageX:Number, stageY:Number, rail:TextLine):CursorGets a cursor given x and y cordinates of the component, expressed in the stage corrdinate system. If rail is non-null, it is a TextLine that acts as a rail. If the point is in the rail or in the top half of the following line, then it is "moved" in the rail before being interpreted.
Parameters
stageX:Number | |
stageY:Number | |
rail:TextLine |
Cursor |
| event2word | () | method |
protected final function event2word(stageX:Number, stageY:Number, consumer:Function):voidBased on x and y positions in the stage corrdinate system, call the consumer with the logical start and end of the word in the text. The consumer should look like the following. function ( wordStart:int, wordEnd:int ):void
Parameters
stageX:Number | |
stageY:Number | |
consumer:Function |
| getTextAlignment | () | method |
protected function getTextAlignment():StringGets the text alignment for laying out the text. When the format.align property is set to "start", "left" is returned when the text is rendered left to right, and "right" when the text is rendered right to left. When the format.align property is set to "end", "left" is returned when the text is rendered right to left, and "right" when the text is rendered left to right.
ReturnsString |
| getTextLine | () | method |
protected final function getTextLine(block:TextBlock = null, previousLine:TextLine = null, width:Number = 1000000, lineOffset:Number = 0.0, fitSomething:Boolean = false):TextLineThis method creates the text line. This method calls TextBlock.createTextLine.
Parameters
block:TextBlock (default = null) | |
previousLine:TextLine (default = null) | |
width:Number (default = 1000000) | |
lineOffset:Number (default = 0.0) | |
fitSomething:Boolean (default = false) |
TextLine |
| getTextLineAt | () | method |
public function getTextLineAt(index:int):TextLineGets a TextLine at a specific index.
Parameters
index:int — The index of the TextLine to return.
|
TextLine |
| getTextToDisplay | () | method |
protected function getTextToDisplay():StringGets the text to be rendered by the component. Component developers can override this method in order to modify the text before rendering it.
ReturnsString |
| lineFragment2rectangle | () | method |
protected final function lineFragment2rectangle(line:TextLine, left:Number, right:Number, consumer:Function):voidGiven a line fragement, call the consumer with the corresponding rectangle. The coordinates of the rectangle are in the same coordinate space as the TextLine. The consumer should look like the following. function( xLeft:Number, xRight:Number, yBottom:Number, yTop:Number ):void
Parameters
line:TextLine | |
left:Number | |
right:Number | |
consumer:Function |
| mouseFocusChange | () | method |
public function mouseFocusChange(event:FocusEvent):voidChecks to see if focus is about to be lost when interacting with an object in the control.
Parameters
event:FocusEvent |
| position2cursor | () | method |
protected final function position2cursor(position:int):CursorReturn a Cursor object given the specified position in the text.
Parameters
position:int — The position in the text to place the cursor.
|
Cursor |
| positionLines | () | method |
protected function positionLines(width:Number, height:Number, lines:Vector.<TextLine>):PointPositions all of the created text lines given a specified width and height. This method is responsible for setting the actualTextWidth and actualTextHeight properties, which are returned in the public textWidth and textHeight properties of the component. These values are used to measure the width and height of the text once it is all laid out.
Parameters
width:Number — The width to position the text lines within.
| |
height:Number — The height to position the text lines within.
| |
lines:Vector.<TextLine> — A Vector of TextLines that represent all of the created lines that are to be laid out.
|
Point — A Point where the x value is the width of the text and the y value is the height of the text.
|
| range2lineFragments | () | method |
protected final function range2lineFragments(start:int, limit:int, consumer:Function):voidGiven a range in the text, call the consumer with the corresponding line fragments. The consumer should look like the following. function( line:TextLine, left:Number, right:Number ):void
Parameters
start:int | |
limit:int | |
consumer:Function |
| range2rectangles | () | method |
protected final function range2rectangles(start:int, limit:int, consumer:Function):voidGiven a range in the text, call the consumer with the corresponding values for the rectangle. The consumer should look like the following. function( xLeft:Number, xRight:Number, yBottom:Number, yTop:Number ):void
Parameters
start:int | |
limit:int | |
consumer:Function |
| registerEmoticons | () | method |
public function registerEmoticons(emoticons:Vector.<Emoticon>):voidRegisters a set of emoticons with the text component. If there are already emoticons set they are replaced with the specified set. If the emoticons parameter is set to null it will remove all previously registered emoticons. By default no emoticons are registered with the component.
Parameters
emoticons:Vector.<Emoticon> |
See also
| removeLines | () | method |
protected function removeLines():voidRemoves the current TextLines from the display list.
| scrollInView | () | method |
public function scrollInView(position:int, immediate:Boolean = false):voidScrolls the position into view.
Parameters
position:int — The index in the text to scroll into view.
| |
immediate:Boolean (default = false) — When set to true the position is immediately scrolled into view. By default this argument is set to false and will scroll the text into view when the component has been validated.
|
| scrollUpdate | () | method |
protected function scrollUpdate():voidCalled when the text is moving during a scroll.
| setSelection | () | method |
public function setSelection(anchorIndex:int, activeIndex:int):voidSets the selection of the text within a given range. The selectable and enabled property must both be set to true in order to create a selection.
Parameters
anchorIndex:int — The first position of the selection.
| |
activeIndex:int — The last position of the seletion.
|
ArgumentError — When the anchorIndex is bigger then the activeIndex.
|
See also
| layoutEstimateChange | Event |
qnx.fuse.ui.events.TextEventqnx.fuse.ui.events.TextEvent.LAYOUT_ESTIMATE_CHANGEDispatched when text is laid out and the text dimensions have changed.
This event is fired when the dimensions of the text have changed.| selectionChanged | Event |
qnx.fuse.ui.events.TextEventqnx.fuse.ui.events.TextEvent.SELECTION_CHANGEDDispatched when a text selection has changed.
This event is fired when a selection change on the component occurs. This will also fire when a selection is cleared.