Expand description
The bottom StatusLine — a one-row View at the bottom of the screen
showing the items of the help-context-selected StatusDef.
It draws the items, hit-tests mouse clicks, runs the mouse press-and-hold
drag-highlight, handles the Command::COMMAND_SET_CHANGED
broadcast (regraying its disabled items), and matches keyboard accelerators
against all items (including the hidden, text-less ones).
§Mouse press-and-hold drag-highlight
Pressing the mouse over the status line highlights the item under the cursor and follows it as the cursor moves, firing the item’s command on release only if the cursor is still over an enabled item:
MouseDown: hit-test → setpressed_item, start tracking withTrackMask{ mouse_move: true }. Do NOT post yet.MouseMove(while tracking): re-derive the item under the cursor; updatepressed_item(→Nonewhen off all items). The next redraw shows the new highlight.MouseUp(while tracking): ifpressed_itemisSome(idx)and its command is enabled, post the command. Clearpressed_item/tracking.
The abs_origin field caches the view-local (0, 0) in absolute screen
coords from the last draw, used by the capture to localize events.
§Help-context updates and keyboard accelerators
Program pre-routes key and status-line mouse events
to the status line before normal dispatch, and on idle refreshes its help
context from the topmost view (via set_help_ctx)
so the shown def follows the focused view. A key matching an item’s
accelerator is transformed in place into a command event so it propagates to
the rest of the UI.
§Themes only — no palettes
Colors resolve directly from the Theme via the
Status* Roles (StatusColors), like
MenuColors.
§Turbo Vision heritage
Ports TStatusLine (tstatusl.cpp). The palette-index color indirection
becomes direct theme-role lookups (deviation D7), and the streaming machinery
is dropped (deviation D12). Structurally it embeds a ViewState with
hand-written View methods rather than delegating, like
MenuBar.
Structs§
- Status
Colors - The four
(lo, hi)style pairs a status item is drawn in — normal, selected, normal-disabled, and selected-disabled — resolved once per draw from theThemevia theStatus*Roles. Each pair is(label style, shortcut-highlight style). - Status
Line - The bottom status line. Owns its
defs, caches the selected def index and a command-set snapshot for graying.