Blitz3D+ Command Reference

CreateComboBox ( x,y,width,height,group[,style] )

Parameters

x,y - position of the combo box's top-left corner within the group's client area

width,height - size of the combo box

group - window or gadget group that owns the combo box

style (optional) - 0 (default); other values are reserved

Description

Creates a drop-down combo box gadget and returns its handle.

Requires Extended language mode.

A combo box offers a list of choices while taking up only a single line - the natural control for things like a quality preset, an entity type or a texture filter mode in an options panel. Fill it with AddGadgetItem, and read the user's choice with SelectedGadgetItem and GadgetItemText.

When the user picks an entry, the combo posts a gadget-action event ($401) through the shared event queue with the new selection index in EventData and the combo's handle in EventSource. Item text is UTF-8, items can show icons from a strip assigned with SetGadgetIconStrip, and SetGadgetHint can display grey cue text until a value is chosen - only text fields and combo boxes support hints.

See it working in the layout and controls sample; the world editor shell sample shows the editor pattern around it.

See also: AddGadgetItem, SelectedGadgetItem, GadgetItemText, CreateListBox, SetGadgetHint, SetGadgetIconStrip.

Index