Class: TextArea

html.TextArea

Class representing a multiline area for text input.

new html.TextArea ()

Properties:
Name Type Description
bold bool

(default: false) Show text in bold face.

color html.Color

The text color.

column number

The column of the current cursor position (the first column is 0).

fontFamily string

The font family.

fontSize number

The font size in CSS pixels.

row number

The row of the current cursor position (the first row is 0).

selectionBackgroundColor html.Color

The background color of selected text.

selectionColor html.Color

The color of selected text.

selectionEnd number

[readonly] The ending position of the text selection. This value is the same as selectionStart if no text is selected.

selectionStart number

[readonly] The starting position of the text selection.

spellCheck bool

(default: false) Whether to enable spell-checking.

text string

(default: "") The text to show.

Extends

Methods

eraseAt (pos, n)

Erases a text string at the given text position.

Name Type Description
pos number

The text position to erase from.

n number

The amount of characters to erase.

See:

insertAt (pos, text)

Inserts a text string at the given text position.

Name Type Description
pos number

The text position to insert at. The text is inserted before the character at this position.

text string

The text to insert.

See:

positionAt (row, column)number

Returns the text position of the given cursor position.

Name Type Description
row number

The row number (the first row is 0).

column number

The column number (the first column is 0).

Returns:
Type Description
number The text position.

rowAt (position)number

Returns the row at the given text position. To get the column, calculate position - positionAt(rowAt(position), 0).

Name Type Description
position number

The text position.

Returns:
Type Description
number The row.

selectRange (begin, end)

Selects the given range.

Name Type Description
begin number

The text position of the begin of the selection.

end number

The text of position of the end of the selection.

setCursor (row, column)

Sets the input cursor position.

Name Type Description
row number

The row number (the first row is 0).

column number

The column number (the first column is 0).

See:

shiftRows (rowStart, rowEnd, by)

Shifts the given rows by an amount.

Name Type Description
rowStart number

The first row to shift.

rowEnd number

The last row to shift.

by number

The positive or negative amount of lines to shift.