Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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 T prefix and namespace under tv::: TButton → tv::Button.
  • cmFoo / hcFoo constant families become associated consts on an open newtype: cmOK → tv::Command::OK, hcNoContext → tv::HelpCtx::NO_CONTEXT.

Core types

C++ Turbo Visiontvision-rs (Rust)notes
TViewView (trait) + ViewState (data)behaviour is a trait; data is composed in, not inherited
TGroupGroupowns Vec<Box<dyn View>>
TFrameFrame
TWindowWindow
TDialogDialog
TDeskTopDesktop
TProgramProgramthe engine: tree + event loop + backend
TApplicationApplicationthin wrapper over Program

See The application skeleton for the Program / Application split.

Controls & widgets

C++ Turbo Visiontvision-rs (Rust)
TButtonButton
TStaticTextStaticText
TParamTextParamText
TLabelLabel
TInputLineInputLine
TClusterCluster
TCheckBoxesCheckBoxes
TRadioButtonsRadioButtons
TScrollBarScrollBar
TScrollerScroller
TListViewerListViewer (trait)
TListBoxListBox
TSortedListBoxSortedListBox
TOutlineOutline / OutlineViewer
TEditorEditor
TEditWindowEditWindow
TMenuBarMenuBar
TMenu / TMenuItemMenu / MenuItem
TStatusLine / TStatusItemStatusLine / StatusItem
TValidator familyValidator trait + impls

The full set is in Controls and Menus, status line & help.

Events, keys & commands

C++ Turbo Visiontvision-rs (Rust)notes
TEvent / event.what == evXEvent enum, matchedevKeyDown → Event::KeyDown(..), evCommand → Event::Command(..)
KeyDownEventKeyEvent
MouseEventTypeMouseEvent
kbEnter, kbF1, …Key enum (Key::Enter, Key::F(1))combined codes decompose
kbCtrlC, kbShiftTabbase Key + KeyModifiersKey::Char('c') + ctrl
clearEvent(event)*ev = Event::Nothing
cmOK, cmCancel, …Command assoc constsopen newtype, namespaced
TCommandSet (256-bit)CommandSetProgram 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
putEventctx.put_event(ev); from outside a view Program::put_event / Program::broadcastevents queue in order; none is overwritten
TEventQueue::doubleDelayProgram::set_double_delay_msdefault 440 ms
message(...) expecting a resulttargeted 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 Visiontvision-rs (Rust)
state & sfFocusedself.state().focused / StateFlag::Focused
options & ofSelectableself.state().options.selectable (Options)
growMode / dragModeGrowMode / DragMode
helpCtx / hcNoContextViewState.help_ctx / HelpCtx::NO_CONTEXT
owner / current / selectedViewId 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 Visiontvision-rs (Rust)notes
getColor / getPalettectx.theme.style(Role::…)Role / Theme
TColorAttrStyle
TColorDesiredColor4-variant enum
hardcoded glyph tablesfields on theme::Glyphs, via ctx.glyphs()
TDrawBufferDrawBuffer
THardwareInfo / TScreenBackend traitCrosstermBackend / HeadlessBackend

See Palettes & glyphs → Theme/Role, The draw model, and Drawing & backends.

C++ Turbo Visiontvision-rs (Rust)notes
execView (from a Program/Application method)Program::exec_view_withresult returned by value from an extract closure
execView (from within a view's handleEvent)Context::request_exec_viewqueues Deferred::OpenModal; record (getData) routed to requester via View::set_modal_data unless cancelled, close command via View::set_modal_answer
dragView / press-trackingcapture-stack handlerssee The event loop
getData / setData / dataSizetyped value / set_valuecurrency is FieldValue

The modal model is in Modal execView → one loop + capture, the data protocol in Dialogs & data.

Dropped or replaced

C++ Turbo Visiontvision-rs (Rust)
drawHide / drawShow / drawUnder* / buffered groupdropped (whole-tree redraw + diff)
TStreamable / TResourceFiledropped (serde if revived)
TColorDialog and its selector classesreplaced by ColorPicker / Program::color_dialog
forEach / firstThat / TSortedCollectioniterators / 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 as Table, Splitter or Keymap, are not in this table; they are listed on Extensions beyond Turbo Vision.