C++ Turbo Vision → tv:: symbol map
A lookup table for translating a C++ Turbo Vision symbol into its tvision-rs
equivalent (the tvision-rs crate, imported as tv). This is the what; the why
lives in The Idiomatic Port and the summary in
Differences from C++ Turbo Vision.
Two mechanical rules cover most of the table:
- Drop the
Tprefix and namespace undertv:::TButton→tv::Button. cmFoo/hcFooconstant families become associated consts on an open newtype:cmOK→tv::Command::OK,hcNoContext→tv::HelpCtx::NO_CONTEXT.
Core types
| C++ Turbo Vision | tvision-rs (Rust) | notes |
|---|---|---|
TView | View (trait) + ViewState (data) | behaviour is a trait; data is composed in, not inherited |
TGroup | Group | owns Vec<Box<dyn View>> |
TFrame | Frame | |
TWindow | Window | |
TDialog | Dialog | |
TDeskTop | Desktop | |
TProgram | Program | the engine: tree + event loop + backend |
TApplication | Application | thin wrapper over Program |
See The application skeleton for the
Program / Application split.
Controls & widgets
| C++ Turbo Vision | tvision-rs (Rust) |
|---|---|
TButton | Button |
TStaticText | StaticText |
TParamText | ParamText |
TLabel | Label |
TInputLine | InputLine |
TCluster | Cluster |
TCheckBoxes | CheckBoxes |
TRadioButtons | RadioButtons |
TScrollBar | ScrollBar |
TScroller | Scroller |
TListViewer | ListViewer (trait) |
TListBox | ListBox |
TSortedListBox | SortedListBox |
TOutline | Outline / OutlineViewer |
TEditor | Editor |
TEditWindow | EditWindow |
TMenuBar | MenuBar |
TMenu / TMenuItem | Menu / MenuItem |
TStatusLine / TStatusItem | StatusLine / StatusItem |
TValidator family | Validator trait + impls |
The full set is in Controls and Menus, status line & help.
Events, keys & commands
| C++ Turbo Vision | tvision-rs (Rust) | notes |
|---|---|---|
TEvent / event.what == evX | Event enum, matched | evKeyDown → Event::KeyDown(..), evCommand → Event::Command(..) |
KeyDownEvent | KeyEvent | |
MouseEventType | MouseEvent | |
kbEnter, kbF1, … | Key enum (Key::Enter, Key::F(1)) | combined codes decompose |
kbCtrlC, kbShiftTab | base Key + KeyModifiers | Key::Char('c') + ctrl |
clearEvent(event) | *ev = Event::Nothing | |
cmOK, cmCancel, … | Command assoc consts | open newtype, namespaced |
TCommandSet (256-bit) | CommandSet | Program stores the disabled set (denylist) |
message(rcvr, evBroadcast, cmX, p) | ctx.broadcast(Command::X, source) | source: Option<ViewId> stands in for p; queued, not synchronous |
putEvent | ctx.put_event(ev); from outside a view Program::put_event / Program::broadcast | events queue in order; none is overwritten |
TEventQueue::doubleDelay | Program::set_double_delay_ms | default 440 ms |
message(...) expecting a result | targeted query → Option<T> |
How events route is covered in Events → enum + match and Commands & events.
State, options & layout flags
The ushort flag words become named booleans, reached through the
Context and a view's ViewState.
| C++ Turbo Vision | tvision-rs (Rust) |
|---|---|
state & sfFocused | self.state().focused / StateFlag::Focused |
options & ofSelectable | self.state().options.selectable (Options) |
growMode / dragMode | GrowMode / DragMode |
helpCtx / hcNoContext | ViewState.help_ctx / HelpCtx::NO_CONTEXT |
owner / current / selected | ViewId handles |
The flag-word translation is detailed in Flag words → struct-of-bools, the handle model in Pointers & infoPtr → handles.
Color, drawing & backend
| C++ Turbo Vision | tvision-rs (Rust) | notes |
|---|---|---|
getColor / getPalette | ctx.theme.style(Role::…) | Role / Theme |
TColorAttr | Style | |
TColorDesired | Color | 4-variant enum |
| hardcoded glyph tables | fields on theme::Glyphs, via ctx.glyphs() | |
TDrawBuffer | DrawBuffer | |
THardwareInfo / TScreen | Backend trait | CrosstermBackend / HeadlessBackend |
See Palettes & glyphs → Theme/Role, The draw model, and Drawing & backends.
Modal flow & data
| C++ Turbo Vision | tvision-rs (Rust) | notes |
|---|---|---|
execView (from a Program/Application method) | Program::exec_view_with | result returned by value from an extract closure |
execView (from within a view's handleEvent) | Context::request_exec_view | queues Deferred::OpenModal; record (getData) routed to requester via View::set_modal_data unless cancelled, close command via View::set_modal_answer |
dragView / press-tracking | capture-stack handlers | see The event loop |
getData / setData / dataSize | typed value / set_value | currency is FieldValue |
The modal model is in Modal execView → one loop + capture, the data protocol in Dialogs & data.
Dropped or replaced
| C++ Turbo Vision | tvision-rs (Rust) |
|---|---|
drawHide / drawShow / drawUnder* / buffered group | dropped (whole-tree redraw + diff) |
TStreamable / TResourceFile | dropped (serde if revived) |
TColorDialog and its selector classes | replaced by ColorPicker / Program::color_dialog |
forEach / firstThat / TSortedCollection | iterators / Vec<T: Ord> |
Rationale for each removal is in Dropped & changed.
Anything not in this table ports verbatim: same name (minus the
T), same method, same behaviour. For the differences that do change a symbol, see Differences from C++ Turbo Vision. Types and methods with no C++ counterpart, such asTable,SplitterorKeymap, are not in this table; they are listed on Extensions beyond Turbo Vision.