{{Template:GUI_Object|dropdown|[wiki:GUI_-_Properties#buffer_zone buffer_zone], button_width, cell_id, dropdown_buffer, dropdown_size, font, list, scrollbar, scrollbar_style, selected, sprite, sprite_list, sprite_selectarea, sprite2, sprite2_over, sprite2_pressed, sprite2_disabled, text_align, text_valign, textcolor, textcolor_selected|SelectionChange}} Not yet implemented. This control needs to handle being disabled. Also add textcolor_over/pressed. A dropdown box is like a list (informational), only it hides the unselected items so only one element is visible at a time.

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).

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).

The text_valign only applies to the item displayed in the header of the control, i.e. Solace and Salubrious in the example below.

Image:gui-object-dropdown.png

For information on how to manipulate the data, see List.

Code of example dropdown:

  <object type="dropdown" 
          size="20 20 170 40" 
          sprite="gd-input"
          sprite_list="gd-input"
          sprite2="gd-button-bottom"
          sprite2_pressed="gd-button-bottom-pressed"
          sprite_selectarea="gd-blue"
          button_width="18"
          buffer_zone="5"
          dropdown_buffer="6"
          dropdown_size="130"
          scrollbar="true"
          scrollbar_style="gd-scrollbar"
          font="verdana12"
          textcolor="0 0 0"
          textcolor_selected="255 255 255"			
  >
          <item>Superfluous</item>
          <item>Gregarious</item>
          <item>Erudite</item>
          <item>Insouciant</item>
          <item>Salubrious</item>
          <item>Verbiage</item>
          <item>Ascribe</item>
          <item>Jovial</item>
          <item>Adamant</item>
          <item>Desideratum</item>
          <item>Ersatz</item>
          <item>Solace</item>
          <item>Triskaidekaphobia</item>
          <item>Stoic</item>
          <item>Encumbrance</item>
          <item>Puerile</item>
  </object>
Last modified 16 years ago Last modified on Feb 23, 2008, 4:19:00 AM
Note: See TracWiki for help on using the wiki.