Jump to page content

Controls

Caveat

If, from reading these notes, you conclude that I am off my rocker, you won’t be the first, and you may even be right.

No doubt there is a dozen and one reasons why none of this would ever work, but perhaps somewhere deep down there is a tiny fragment that could be used for something.

Contents

Contents

A comprehensive controls library is a fundamental requirement to any good graphical user interface.

Control types

Text

Text boxes will support proper multi-level undo (not the single “flip-flop” undo as in Windows) as well as triple-click for line select.

Undo will be per-stride, not per character. There is a horrible habit with some software where undo reverts every last thing you typed, rather than the most recent word, paragraph or the most recent few seconds.

Delimited text

Various systems and applications present fields for entering delimited text. Examples of such fields include credit card numbers, dates, times, IPv4 addresses and serial numbers. Almost invariably the implementation of such fields is terrible. Commonly a separate text box will be used for each field, preventing the overall value from being copied. In some instances the software is clever enough to paste a single value across all the text boxes (often seen with application serial numbers) but not always.

Delimited fields will be a standard option. They will use only a single box with pre-filled delimiters. This means that the user interface must use a typeface with monospace digits (common but not true of all typefaces). These controls will treat the delimiters as regular characters for the purposes of select and copy, allowing copy and paste to function as close to normally as possible. Pasting a value will fill as many fields as possible. When typing, pressing a delimiter character will simply move the text cursor to the next field except where it is already at the start of a field, in which case the keystroke will be ignored. The delimiters will be included when the value is copied.

Such controls will offer clarity to the user without impeding their ability to use them effectively.

Validation

Potentially each control could provide a set of validation options, including the possibility of regular expression matching or a callback for greater flexibility.

Validation options include input type (integer, positive integer, positive integer or zero) and input limits (character limit, numeric limit).

Validation errors will prevent a form from being submitted, but switching tab within a dialog box will emphatically not be blocked by the control validator, as this is needless and extremely irritating.