Skip to content

Instantly share code, notes, and snippets.

@cocoabox
Last active September 30, 2024 13:09
Show Gist options
  • Save cocoabox/e52f3e19119937d7131aa34d7ff9fcb8 to your computer and use it in GitHub Desktop.
Save cocoabox/e52f3e19119937d7131aa34d7ff9fcb8 to your computer and use it in GitHub Desktop.
nostalgic text UI (TUI) in DOS

tl;dr

Because I love TextUI, and TextUI in DOS is beautiful and technically non-trivious, I have gathered some information on the internet, and I want to write a small summary of familiar "frameworks" I encountered, their aesthetics and some technical details if available.

While there are many TextUIs, I focus on mainly aesthetics/frameworks that are used by more than one products.

Table of Contents

Frameworks

These are libraries or frameworks, documented or otherwise, that provide a consistent look-and-feel Text UI.

COW (CW) by Microsoft

image

△ COW, stands for Character Oriented Windows (or CW), is a closed-source framework for TextUI app development - from what I understand, it' a almost like a "stripped-down version" of Windows. It's used in qb, qbasic (also edit.com (which is a launch script for QBASIC.EXE /EDITOR) and help.com (QBASIC.EXE /QHELP)), quickpascal, ms-works for DOS etc. (a full list of users can be found in DOC/USERS.DOC)

Editor/help panes are vertically resizable, but alert/prompt dialogs are not. Widgets provided: Push buttons, radio button, check boxes, combo boxes, menus, msgbox, "dir lists", etc.

Localized versions use localized table-drawing characters.

COW runs on a set of drvice drivers and supports swapped environment and window messages (WM_***). As of DOS-6.0, COW supports graphical drawing (as used in word-5.0) and Kanji drawing, as well as a full-featured MDI user interface. The COW framework offers KERNEL, USER, and SDM (dialog manager) similar to Windows.

image

△ Word-5.5 for offers COW in 25,30,..60 lines graphical drawing.

VB DOS, MS Works for dos and Word for DOS by Microsoft

image

△ Visual Basic for DOS offered an elaborated UI that showcases 3D aesthetics in its widget design, notably push buttons and textboxes are 3D-bordered, with a minimal height of 3 lines. Windows can be customized to whether have a close button or a resizable border, much like their counterpart in Windows. The desktop is now visible.

image

△ Shown here is MS Works 3 for DOS. Notice the graphical, 2-color mouse cursor similar to that found in MS Windows, and the dimmed background dialog box, which is not found in other apps using CW.

Source code

Source code and detailed documentation of COW used in QBASIC, along with the source code of qbasic is bundled in MS-DOS 6.0 Source Code Leaked lzma2.7z.

DOS Shell

image

DOS Shell that bundled with MS-DOS>5.0, features graphics mode with widget designs that resemble Symantec products (see below). However their Push button widgets are different and do not show as many animations as Symantec products do. The 2-color mouse cursor also draws quite differently than Symantec products. DOS Shell offers graphics mode up to 60 lines.

An inspection in the source code and design documentation reveals that DOS Shell is in fact, built using the CW framework. Glyphs are defined and rendered as bitmaps at runtime.

TurboVision by Borland

image

see https://en.wikipedia.org/wiki/Turbo_Vision

Turbovision (tvision) was originally developed and offered by Borland for use with Turbopascal, TurboC++ TextUI app development. There is no graphical drawing, but all windows are movable by mouse. Widgets offered: menus, scroll bars, scollable panes, help windows, status bars, general windows, dialogs, labels, push buttons, command/radio buttons, dropdown boxes.

Source code

Norton Library by Symantec

image

Norton desktop

image

Norton Library or NORTONL.LIB is a framework used by early Norton/Symantec products. No documentation is available. If VGA video is available, it's capable of drawing graphical glyphs by redefining ascii characters on-the-fly (for detailed analysis, read this discussion).

Widget drawing seems to be provided by DRAW.H and standard dialog boxes are provided by STDDLG.H. An app would presumbly set NLibConfigRec.graphicsLevel to GMODE_FULL_GRAPHICS or GMODE_DEFINE_ALL and pass them to StdDlgConfigVideoAndMouse(..) and/or other lib functions to produce the graphical widgets on the screen.

Source code

While old version of norton-utiltiies or pctools are closed source, a snapshot of the Norton_Utilities_2006_SC.7z and Norton_AntiVirus.tar.gz (1.1 GB) offer a precompiled library of Norton-lib as well as some header files if you're interested.

An independent pascal implementation is available here: DOS-GUI-Norton-Style, courtesy of sdancer75. I have a fork of this repo that compiles in dosbox.

Screenshot

image

Not-so-frameworks

Norton Commander (early versions) by Symantec

image

Early Norton Commander (nc) before 5.0 features visual style and UI widgets that are visually distinct from other Symantec products at that time. This aesthetics is later passed onto RAR and TotalCommander.

RAR for DOS showing an alert message in red

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment