Expand description
Widget implementations — the leaf views (buttons, input lines, lists, editors, scrollbars, and more).
Each submodule holds one widget. The canonical embed pattern is:
state: ViewState, impl View returning it from state/state_mut,
implement draw through DrawCtx, and handle events through Context.
Guide: Controls.
§Deliberate omissions
Turbo Vision’s TMonoSelector — a cluster-based picker for monochrome
screen attributes, used only inside the old color dialog — is intentionally
not ported. The color picker was rebuilt (see crate::dialog::ColorPicker)
and needs no mono-attribute selector; the general tabbed-selection idiom is
covered by TabBar.
Re-exports§
pub use list_viewer::FindMode;pub use list_viewer::ListRoles;pub use list_viewer::ListViewer;pub use list_viewer::ListViewerState;pub use outline::Node;pub use outline::Outline;pub use outline::OutlineViewer;pub use outline::OutlineViewerState;pub use outline::ov_update;pub use splitter::Constraints;pub use splitter::DividerStyle;pub use splitter::Orientation;pub use splitter::Splitter;pub use table::Align;pub use table::ColumnSpec;pub use table::ColumnState;pub use table::RowKey;pub use table::SelectionMode;pub use table::Separators;pub use table::SortDir;pub use table::SortKey;pub use table::Table;pub use table::TableModel;pub use table::ValidatorFactory;pub use table::VecModel;pub use terminal::Terminal;pub use terminal::TextDevice;
Modules§
- list_
viewer - The abstract base for every list widget (
ListBox, history viewers, color/file lists). It lays outrangeitems innum_colscolumns, tracks afocuseditem and atop_itemscroll offset, and drives two sibling scroll bars that live on the window frame. - outline
- A collapsible tree view:
Node,OutlineViewer, andOutline. - splitter
- A resizable multi-pane layout:
Splitterarranges N panes along one axis, separated by 1-cell dividers that the user drags (or moves from the keyboard in resize mode) to resize the panes.Constraintsbound each pane’s size,DividerStylesets how each divider looks and whether it moves, andSplitter::joinedconnects the divider lines to the window frame and to each other through thejunctionglyph selectors. - table
- A multi-column table: a column header with click-to-sort over a scrolling row list, with single or multi selection that follows a stable row key across sorting and reloads.
- terminal
- A scrolling text terminal:
TextDevice(the output trait) andTerminal(a ring-buffer view that shows the most recent lines).
Structs§
- Button
- A clickable command button: a 2+-row box with a centered (or
left-justified) title, a drop shadow, and an
~-marked hotkey. Pressing it (mouse, Alt+hotkey, focused-Space, or — for the default button — theCommand::DEFAULTbroadcast) fires itscommand, either posted as anEvent::Commandor broadcast. - Button
Flags - Button flags — the decoration/behavior flags as a struct-of-bools.
- Check
Boxes - A group of independent on/off checkboxes;
cluster.valueis a bitmask where bitiis set when itemiis checked. - Cluster
- The cluster engine (state + layout + nav + draw + events).
- Edit
Window - A
Windowhosting aFileEditorwith two scroll bars and anIndicator. An embed-and-delegate wrapper overWindow; the constructor wires the editor to the (initially hidden) scroll bars and indicator by id. - Editor
- A gap-buffer text editor: a leaf
Viewholding a singleVec<u8>split by a movable gap, with a cursor, a selection, single-level undo, and a viewport (delta) onto a content extent (limit). It references two sibling scroll bars and an indicator on the window frame, runs Find / Replace dialogs, and cuts/copies/pastes through a shared internal clipboard editor. - File
Editor - An
Editorbacked by a file on disk. An embed-and-delegate wrapper; the editor runs in file-editor mode (growable buffer plus save commands). - History
Viewer - A read-only single-column list over the global history store, shown in a modal recall popup when a user drops down an input field.
- History
Window - The modal window hosting a
HistoryViewerrecall list. - Indicator
- A 1-row strip that displays an editor’s current cursor position (row:col).
It is owned by the editor and updated through
Indicator::set_value. - Input
Line - A single-line text-entry field with selection, horizontal scrolling, an
optional
Validator, and the typedvalue/set_valuedata protocol. - Label
- A single-line caption that links to a control: clicking it (or pressing
its
~-marked hotkey) focuses the linked control, and the label highlights while that control is focused. - ListBox
- A concrete list viewer that owns a
Vec<String>as its item source. - Masked
Input - A masked text field with a reveal eye: an
InputLine(masked) plus aRevealEyein its last column, bundled as one group so the eye is its own Tab stop and reveal is wired internally. - Memo
- A single-field multi-line editor for use inside a dialog. An
embed-and-delegate wrapper over
Editor; the only behavioural differences from the base editor are: it swallows a plainTabkeypress (so Tab navigates the dialog rather than inserting), and it exposes its text as a typedFieldValuefor dialog gather/scatter. - Multi
Check Boxes - Checkboxes where each item cycles through more than two states;
cluster.valuepacks an n-bit state field per item into a singleu32. - Page
Stack - A content multiplexer: a group of child “page” Views of which exactly one is visible at a time.
- Param
Text - A dynamic-text variant of
StaticTextwhose content is set at run time. It embeds aStaticTextand delegates everything to it; only the text is replaceable. - Radio
Buttons - A group of mutually-exclusive radio buttons;
cluster.valueis the index of the currently selected button (0-based). - Reveal
Eye - A one-cell focusable “reveal” eye for masked
InputLinefields. - Reveal
EyeConfig - Behaviour of a
RevealEye. The eye glyphs are theme-controlled (Glyphs::reveal_eye_hidden/reveal_eye_revealed), so this config carries only the interaction knobs. - Scroll
Bar - A single-axis scroll-bar widget: a draggable thumb between two step-arrows, with paging troughs on either side.
- Scroller
- The base scrollable-content view.
- Sorted
List Box - A list viewer with incremental type-to-search over a case-insensitively
sorted string list. A direct
ListViewerimpl (likeListBox); the search state machine lives as thesorted_handle_event/sorted_cursorfree functions over theSortedSearchsub-trait, which this widget implements. - Static
Text - A read-only, word-wrapped text block. No events; not selectable.
- THistory
THistory— the dropdown-arrow icon placed next to aInputLine.- TabBar
- A horizontal single-row tab selector: corner-cap active tab (
┌Label┐), ←/→/hotkey/click selection.
Enums§
- Cluster
Kind - Selects which of the three cluster behaviors the
Clusterengine applies. - Encoding
- How multibyte characters are stepped over.
- Limit
Mode - How the
limitconstructor argument is interpreted — which of the three internal caps it sets. - Line
Ending - How line breaks are stored when text is inserted.
- Value
Position - Where
View::set_valueleaves a field: which end of the text is on screen.
Constants§
- SM_
DOUBLE - Word-granular selection (double-click): snap both ends to word boundaries.
- SM_
EXTEND - Extend the current selection to the new cursor position, instead of
collapsing it to a point at
p. - SM_
TRIPLE - Line-granular selection (triple-click): snap both ends to line boundaries.
Functions§
- clear_
history - Remove every stored history entry across all channel ids.
- history_
add - Add
strto the history channel identified byid. - history_
count - Return the number of history entries for
id. - history_
str - Return the entry at
index(oldest-first) forid, orNoneif out of range.