Websites Navigation: Airbit | Shop | m-shell.net
Languages: EN | DE

Class abgui.TextField

is abgui.Label is abguibase.Widget
Known direct subclasses: abgui.TextArea
An input field widget allowing to edit a line of text.

Constructor

function init(textOrWidth=10, align=LEFT|VCENTER)
Overridesabgui.Label.init()
Initialize a new text field.
Parameters:
textOrWidth – the initial text for the field, or the desired width of the field in characters.
align – the horizontal and vertical alignment flags.

Fields

cursor The cursor position within the text.
desiredWidth The desired width of the field in characters. null for no desired width.
selColor The background color for the selected text.
selection The selection position within the text. The selected range always covers the region between cursor and selection.
start The start position of the text in the display.

Functions

drawText(x, y) Draw the text at a specific position, including selection and cursor.
focusable() A TextField is focusable.
gotFocus() [Inherited comment] Called when this widget got the focus.
handled(event) Handle keystrokes and cursor positioning and selection via the pointer.
lostFocus() [Inherited comment] Called when this widget lost the focus.
pointToPos(dx, dy) Compute the text position corresponding to certain coordinates.
setCursor(pos) Set the cursor position.
setText(text) Set the text to display.
function setCursor(pos)
Set the cursor position.
function setText(text)
Overridesabgui.Label.setText()
Set the text to display. This sets to cursor to the text end.
Parameters:
text – the text. Must not be null.
function focusable()
Overridesabguibase.Widget.focusable()
A TextField is focusable.
Returns:true
function drawText(x, y)
Overridesabgui.Label.drawText()
Draw the text at a specific position, including selection and cursor.
Parameters:
x – the x coordinate of the start of the text.
y – the y coordinate of the baseline of the text.
function pointToPos(dx, dy)
Compute the text position corresponding to certain coordinates.
Parameters:
dx – the x coordinate relative to the start of the displayed text.
dy – the y coordinate relative to the start of the displayed text.
Returns:the position at or just before the coordinates.
function gotFocus()
Overridesabguibase.Widget.gotFocus()
[Inherited comment] Called when this widget got the focus. The default implementation does nothing.
function lostFocus()
Overridesabguibase.Widget.lostFocus()
[Inherited comment] Called when this widget lost the focus. The default implementation does nothing.
function handled(event)
Overridesabguibase.Widget.handled()
Handle keystrokes and cursor positioning and selection via the pointer.
Parameters:
event – the event.
Returns:true if the event was handled.
mShell Home  > Documentation  > mdoc