| 1 | {{Template:GUI_Object|dropdown|[wiki:GUI_-_Properties#buffer_zone buffer_zone], [wiki:GUI_-_Properties#button_width button_width], [wiki:GUI_-_Properties#cell_id cell_id], [wiki:GUI_-_Properties#dropdown_buffer dropdown_buffer], [wiki:GUI_-_Properties#dropdown_size dropdown_size], [wiki:GUI_-_Properties#font font], [wiki:GUI_-_Properties#list list], [wiki:GUI_-_Properties#scrollbar scrollbar], [wiki:GUI_-_Properties#scrollbar_style scrollbar_style], [wiki:GUI_-_Properties#selected selected], [wiki:GUI_-_Properties#sprite sprite], [wiki:GUI_-_Properties#sprite_list sprite_list], [wiki:GUI_-_Properties#sprite_selectarea sprite_selectarea], [wiki:GUI_-_Properties#sprite2 sprite2], [wiki:GUI_-_Properties#sprite2_over sprite2_over], [wiki:GUI_-_Properties#sprite2_pressed sprite2_pressed], [wiki:GUI_-_Properties#sprite2_disabled sprite2_disabled], [wiki:GUI_-_Properties#text_align text_align], [wiki:GUI_-_Properties#text_valign text_valign], [wiki:GUI_-_Properties#textcolor textcolor], [wiki:GUI_-_Properties#textcolor_selected textcolor_selected]|[wiki:GUI_-_Actions#SelectionChange SelectionChange]}} |
| 2 | '''Not yet implemented.''' This control needs to handle being disabled. Also add textcolor_over/pressed. |
| 3 | A ''dropdown'' box is like a [wiki:GUI_-_List list] (informational), only it hides the unselected items so only one element is visible at a time. |
| 4 | |
| 5 | The control includes a rectangular button to the right, whose sprite can be changed when hovered/pressed/disabled. When pressed, a dropdown area below will appear, graphically equivalent to the ''list'' box (including scrollbar stuff). |
| 6 | |
| 7 | The next time the player clicks, it will either select a new element (if that's where the player clicked) or close the dropdown window and retain the current selection (eg if he clicked outside the dropdown area). |
| 8 | |
| 9 | The ''text_valign'' only applies to the item displayed in the header of the control, i.e. ''Solace'' and ''Salubrious'' in the example below. |
| 10 | |
| 11 | [wiki:Image:gui-object-dropdown.png] |
| 12 | |
| 13 | For information on how to manipulate the data, see [wiki:GUI_-_List List]. |
| 14 | |
| 15 | '''''Code of example dropdown:''''' |
| 16 | {{{ |
| 17 | <object type="dropdown" |
| 18 | size="20 20 170 40" |
| 19 | sprite="gd-input" |
| 20 | sprite_list="gd-input" |
| 21 | sprite2="gd-button-bottom" |
| 22 | sprite2_pressed="gd-button-bottom-pressed" |
| 23 | sprite_selectarea="gd-blue" |
| 24 | button_width="18" |
| 25 | buffer_zone="5" |
| 26 | dropdown_buffer="6" |
| 27 | dropdown_size="130" |
| 28 | scrollbar="true" |
| 29 | scrollbar_style="gd-scrollbar" |
| 30 | font="verdana12" |
| 31 | textcolor="0 0 0" |
| 32 | textcolor_selected="255 255 255" |
| 33 | > |
| 34 | <item>Superfluous</item> |
| 35 | <item>Gregarious</item> |
| 36 | <item>Erudite</item> |
| 37 | <item>Insouciant</item> |
| 38 | <item>Salubrious</item> |
| 39 | <item>Verbiage</item> |
| 40 | <item>Ascribe</item> |
| 41 | <item>Jovial</item> |
| 42 | <item>Adamant</item> |
| 43 | <item>Desideratum</item> |
| 44 | <item>Ersatz</item> |
| 45 | <item>Solace</item> |
| 46 | <item>Triskaidekaphobia</item> |
| 47 | <item>Stoic</item> |
| 48 | <item>Encumbrance</item> |
| 49 | <item>Puerile</item> |
| 50 | </object> |
| 51 | }}} |