A selection box shows an immediately visible list allowing you to choose one (by default) or more options.
A WSelectionBox corresponds to an HTML
WSelectionBox is a View widget (see also
By default a WStringListModel is used. With this model you can associate a
single column of data to the displayed items. The member
removeItem() manipulate the model. You can set the model
setModel(). See the Combo box section for an example.
A model supports different roles like
Wt::ItemDataRole::UserRole. The suggestion text for an
item in the drop-down box is associated with a
Wt::ItemDataRole::DisplayRole. The value, which will be
inserted in the line-edit, corresponding with a suggestion, is
Wt::ItemDataRole::UserRole) data. If no
UserRole data is available, the behaviour defaults to inserting
the suggestion text itself.
If you want to associate multiple data columns with an item from the combo box then you should assign another model to this control like WStandardItemModel or an implementation of WAbstractTableModel.
Note that there are still other models like WFormModel which and can be used to represent fields in a form.
Use shift and/or ctrl-click to select your pizza toppings...