From 05bcfb4a4c870da9e6d94ab98a33213c8cb72193 Mon Sep 17 00:00:00 2001 From: Scott Duensing Date: Sat, 14 Mar 2026 18:10:37 -0500 Subject: [PATCH] Docs updated. --- dvx/README.md | 58 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 8 deletions(-) diff --git a/dvx/README.md b/dvx/README.md index 3f251c7..42c9e5f 100644 --- a/dvx/README.md +++ b/dvx/README.md @@ -7,7 +7,8 @@ Motif-style beveled chrome, dirty-rectangle compositing, draggable and resizable windows, dropdown menus, scrollbars, and a declarative widget/layout system with buttons, checkboxes, radios, text inputs, dropdowns, combo boxes, sliders, progress bars, tab controls, tree views, toolbars, status bars, -images, image buttons, drawable canvases, and an ANSI BBS terminal emulator. +images, image buttons, drawable canvases, password inputs, masked/formatted +inputs, and an ANSI BBS terminal emulator. ## Building @@ -521,10 +522,42 @@ tracks the selected index in `w->as.radioGroup.selectedIdx`. Set ```c WidgetT *wgtTextInput(WidgetT *parent, int32_t maxLen); ``` -Single-line text input field. Supports typing, cursor movement (arrows, -Home, End), backspace, and delete. `maxLen` is the buffer capacity. -Default weight is 100 (stretches to fill). Set `onChange` to be notified -on edits. +Single-line text input field. `maxLen` is the buffer capacity. Default +weight is 100 (stretches to fill). Set `onChange` to be notified on edits. + +Editing features: cursor movement (arrows, Home, End), insert/overwrite, +selection (Shift+arrows, Shift+Home/End, Ctrl+A, double-click word, +triple-click all), clipboard (Ctrl+C copy, Ctrl+V paste, Ctrl+X cut), +single-level undo (Ctrl+Z), and horizontal scrolling when text exceeds +the visible width. Mouse drag selection auto-scrolls when the cursor +reaches the edge of the field. + +```c +WidgetT *wgtPasswordInput(WidgetT *parent, int32_t maxLen); +``` +Password input field. Identical to `wgtTextInput` except characters are +displayed as bullets (CP437 `\xF9`). Copy and cut to clipboard are +disabled; paste is allowed. All other editing features work normally. + +```c +WidgetT *wgtMaskedInput(WidgetT *parent, const char *mask); +``` +Formatted input field with a fixed mask pattern. The mask string defines +the format: `#` accepts a digit, `A` accepts a letter, `*` accepts any +printable character. All other characters in the mask are literals that +are displayed but cannot be edited. The cursor skips over literal +positions automatically. + +Example masks: +- `"(###) ###-####"` -- US phone number +- `"##/##/####"` -- date +- `"###-##-####"` -- SSN + +The buffer always contains the full formatted text including literals. +`wgtGetText()` returns the formatted string. Supports selection +(Shift+arrows, Ctrl+A), clipboard (Ctrl+C, Ctrl+V, Ctrl+X), and +single-level undo (Ctrl+Z). The mask string must remain valid for the +widget's lifetime. ```c WidgetT *wgtListBox(WidgetT *parent); @@ -534,7 +567,12 @@ List box (basic -- set items with `wgtListBoxSetItems()`). ```c WidgetT *wgtTextArea(WidgetT *parent, int32_t maxLen); ``` -Multi-line text area (basic). +Multi-line text editor with vertical and horizontal scrollbars. Supports +all the same editing features as `wgtTextInput` plus multi-line selection +(Shift+Up/Down), Enter for newlines, and vertical/horizontal auto-scroll +during mouse drag selection. A horizontal scrollbar appears automatically +when any line exceeds the visible width. The vertical scrollbar is always +present. ### Dropdown and ComboBox @@ -707,7 +745,10 @@ WidgetT *wgtAnsiTerm(WidgetT *parent, int32_t cols, int32_t rows); ANSI BBS terminal emulator widget. Displays a character grid (default 80x25 if cols/rows are 0) with full ANSI escape sequence support and a 16-color CGA palette. The terminal has a 2px sunken bevel border and a -vertical scrollbar for scrollback history. +vertical scrollbar for scrollback history. Supports mouse text selection +(click and drag), Ctrl+C to copy selected text (sends `^C` to the +terminal when nothing is selected), and Ctrl+V to paste clipboard text +through the comm interface. ANSI escape sequences supported: @@ -828,7 +869,8 @@ determines where children are placed within the extra space. void wgtSetText(WidgetT *w, const char *text); const char *wgtGetText(const WidgetT *w); ``` -Get/set text for labels, buttons, checkboxes, radios, and text inputs. +Get/set text for labels, buttons, checkboxes, radios, text inputs, +password inputs, masked inputs, combo boxes, and dropdowns. ```c void wgtSetEnabled(WidgetT *w, bool enabled);