====== List Box ====== {{ :scripting:dialogs:listbox.png|List box example}} List box control with ability to select single item by index. ===== Properties ===== ^ Property ^ Default Value ^ Description ^ | **id** | empty | id (name) of the script data object associated with control | | **align** | stretched | [[scripting:dialogs:align|Alignment]] of the control | | **selected_index** | -1 | Index of selected item. Indicates fixed list. | | **required** | false | required property of the control (if control is initial, "positive" buttons will be disabled) | | **minwidth** | 0 | Minimum width, in characters of the list box control | ===== Items ===== Combo Box is filled by //Items//, defining value set for selection. ==== Item ==== ^ Property ^ Default Value ^ Description ^ | **text** | empty | Item text | For dynamic item list one can use dynamic creation of the dialog XML. See example for [[scripting:dialogs:multi_listbox|multi selection listbox]]. ===== Example ===== var varStorage = new Storage(); var dialog_template = '@ \ \ \ \ \ \ \ \ \ \ \ @'; Output().writeln("Dialog 4 returns: " + dialog(dialog_template, varStorage)); Output().writeln("By Index selection: " + varStorage.byIndex);