Combo Boxes

A combo box is a sort of a compound control, an input field combined with a drop-down list where you can choose a value for the field. Chapter 3 of the tutorial shows an example of such a combo box.

In MoStacks, with a combo box, you cannot write directly into the input field; you have to choose from the available values that are contained in the list. Because of this combo boxes are useful for cases of guided and controlled input, in contrast to free input with a simple input field.

Combo boxes do not have a dedicated field/control type of their own. They are implemented as two fields that are linked: a text field and a list field.

The usual way to define a new combo box with the help of the Edit Controls Window is by creating a text field and setting its Combo text? flag (see Field and Control Flags: Combo text?). MoStacks will then automatically create a second field for you, the list that accompanies the text field.

You can then switch to that list field and configure it further, as you would a "normal" list field that is not part of a combo box. You can use both lists with a static content, or card lists, as explained in chapter Lists.

If you started with a simple input field and want to turn it into a combo box later on, just modify it by setting the Combo text? flag, because this works with an existing field as well as with a new one.

However, if you play around too much with fields and switch from simple input to combo and possibly back again, it probably won't take long to confuse the Windows program and trigger a combination of circumstances that is not yet properly handled.

As explained, in principle at any given time the input field is only allowed to contain one of the values in the list. With some effort however, its possible to violate this consistency condition, by deleting values from the list that are already used in some fields as values.

MoStacks does not detect such cases, at least not yet, and it's undefined what exactly happens in such cases. (Nothing really bad, like stack corruption, must be feared, but input on the combo box will probably react in funny ways.) Actual use of the program will probably show whether this is something that needs improvement or can be allowed to stay as it is, as a rare border case that's not very important.