Enumerations

Every finite value set in ManyUI is a module-scoped enum: a module holding an @enum T with SCREAMING_SNAKE_CASE values. They tab-complete (ColorDepth.<TAB>), discriminate by type (d isa ColorDepth.T), and keep their value names out of the package namespace.

ManyUI.AttrModule

Text rendition attributes. Values are powers of two: they are used as bit positions in an AttrMask.

source
ManyUI.CheckStateModule

A Checkbox's state.

AN ENUM AND NOT A Bool BECAUSE OF MIXED, and that value is not decoration: it is the "select all" box over a partially-selected set, which is exactly what a TreeView with checkable nodes needs. Two values would be a Bool and this module would be a lie.

NORMATIVE: toggle! NEVER PRODUCES MIXED. The user has two reachable states; the third is set BY CODE, from a fact the user cannot express with one keystroke. MIXED toggles to CHECKED, because "some are on" answered by a human means "now all of them". A box a PROGRAM set to MIXED must be clickable OUT of it, or "select all" over a partial selection is a dead control.

source
ManyUI.ColorDepthModule

What a target can display. ORDERED, so depth < ColorDepth.TRUECOLOR is a legal capability test.

source
ManyUI.DirtyModule

What is stale about a node. Values are powers of two: they are combined in a DirtyMask.

SUBTREE is a BREADCRUMB, not dirt: it means "a descendant is dirty", and it is what lets a frame pass skip clean subtrees in O(depth) instead of O(n).

source
ManyUI.JustifyModule

Main-axis distribution. Split from Align so that align: space-between is unrepresentable.

source
ManyUI.KeyModule

Logical key identity. CHAR means "see KeyEvent.char".

source
ManyUI.PhaseModule

Where an event is in its propagation. AT_TARGET exists because capture + bubble alone visit the target twice with no way for a handler to tell the two visits apart.

source
ManyUI.PopupPlacementModule

Where a popup sits relative to the widget that opened it.

BELOW and ABOVE are fixed; AUTO prefers BELOW and flips to ABOVE only when the popup would fall off the bottom. CENTER ignores the owner and centres the popup in the viewport, for modal dialogs.

source
ManyUI.ScrollModeModule

When a Scrollbar's track and thumb are drawn.

NOT the same axis of choice as Overflow: Overflow is a CLIPPING policy owned by the box model; this is a scrollbar VISIBILITY policy owned by the widget. Neither implies the other – NEVER still scrolls.

source