Import std.term.views
std.term.views
std.term's views for full-screen apps, each drawn on a Canvas in a Region, which take the keys and the mouse's events that are theirs: a TextInput, a line of text that's edited as a shell's is, and a ListView, a list of items with one selected, which scrolls to keep it in view.
std/term/views.fb
Types
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.
-
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.
ListView
class
Public Class ListView
A list of Items, one of which is Selected, which Draw shows in a Region, scrolled to keep the selected one in view, with its Marker before it and drawn in SelectedLook, over ItemLook. HandleKey moves the selection with Up, Down, Page Up, Page Down, Home, and End, and HandleMouse with a click or the wheel.
-
Its items, in order.
-
What's before the selected item, with as many spaces before each other one.
-
How the items look.
-
How the selected item looks.
-
A list of
items, the first selected. -
Which item is selected, from 0, or -1 for an empty list. Setting it keeps it in the list.
-
The selected item, or Null for an empty list.
-
Moves the selection as
keysays, and gives whether it was one of its keys, which an empty list has none of. -
Selects the item a press of the left button in
areais on, or moves the selection three items for the wheel, and gives whether it did. -
Takes a key or the mouse's
eventinarea, and gives whether it took it. -
Draws the items that fit in
area, one a row, scrolled to keep the selected one in view.
Report an issue with this page or with FutureBlitz on GitHub.