IUP/Controls/IupText

From Vendetta Lua
Revision as of 23:05, 9 May 2023 by Draugath (Talk | contribs) (Created page with "__NOTOC__ __NOEDITSECTION__ Creates an editable field with one line. ===Creation=== :iup.text{} -> ('''elem''': ihandle) :This function returns the identifier of the create...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Creates an editable field with one line.

Creation

iup.text{} -> (elem: ihandle)
This function returns the identifier of the created text, nil if an error occurs.

Attributes

APPEND: Inserts a text at the end of the current text.
INSERT: Inserts a text in the caret's position.
BORDER: Shows a border around the text. Default: "YES".
NC: Maximum number of characters allowed.
CARET: Position of the insertion point.
READONLY: Allows the user only to read the contents, without changing it. Possible values: "YES", "NO" (default).
SIZE: Text size. Default: room for 5 characters.
ALIGNMENT: Label's alignment. Possible values: "ALEFT", "ARIGHT", "ACENTER". Default: "ALEFT".
PASSWORD: Hide the typed character using an "*".
VALUE: Text entered by the user. If the element is already mapped, the string is directly copied to the native control (see IupMap).
The value can be any text, including '\n' characters indicating line change. Default: nil when the element is not yet mapped; "" if it is.

Callbacks

ACTION: Action generated when a keyboard event occurs. The callback also receives the typed key.
elem:action(c: number, after: string) -> (ret: number)
c: Identifier of the typed key. Please refer to the Keyboard Codes table for a list of possible values.
after: Represents the new text value in case the key is validated (i.e. the callback returns IUP_DEFAULT).
If the function returns IUP_IGNORE, the system will ignore the typed character. If the function returns the code of any other key, IUP will treat this new key instead of the one typed by the user.

Notes

Text is always left aligned.
On the Windows driver, the action callback is not called for the function keys (K_F???). (check)

See Also

IupMultiLine