Import std.term.views
TextInput
class
Public Class TextInput
A line of text to type in, edited as a shell's line is (see LineEditor's Handle), which Draw shows in a Region's first row, scrolled sideways to keep its cursor in view. A Placeholder shows while it's empty, and a Mask, like "•", in place of each character, as for a password.
Examples
Local input = TextInput()
input.HandleKey(KeyEvent('h'))
input.HandleKey(KeyEvent('i'))
input.HandleKey(KeyEvent(KeyCode.BACKSPACE))
Expect(input.Text == "h" && input.Cursor == 1)-
What shows while it's empty.
-
What shows in place of each character, like "•", or "" for the characters themselves.
-
How its text looks, and its placeholder.
-
How its placeholder looks.
-
An input holding
text, its cursor after it. -
What's typed; setting it puts the cursor at its end.
-
Where the cursor is, a byte position in Text.
-
Edits it as
keysays, and gives whether thekeywas one it takes. -
Takes a key, or what's pasted, its line breaks as spaces, and gives whether it took it.
-
Draws it in
area's first row, and gives the column its cursor is at, for a Screen's ShowCursor.
Report an issue with this page or with FutureBlitz on GitHub.