Enum

A choice box that picks one option from a list.

An Enum is a choice box: a dropdown with a list of options, of which one is chosen. Operators use it for modes, such as how a gray value is computed or which unit an angle is in. A new operator starts on the first option.

Some choice boxes take their options from what exists at that moment, such as the data types ZigZag knows or the devices that are plugged in. When the chosen option disappears, for example because a device is unplugged, the choice is kept and shown in a different color. The operator uses a sensible default until the option is back.

Text, or another choice box, drives an Enum by naming an option. A number picks an option by its position, counting from 0, and a position past the end changes nothing. As a source, a choice box sends the name of its option to text and its position to numbers.

Keywords: dropdown, choice, option, mode, select