# dropdown_type.h File Reference

Types related to the drop down widget. More...

`#include "../window_type.h"`
`#include "../gfx_func.h"`
`#include <list>`

Go to the source code of this file.

## Data Structures
class | DropDownListItem
| Base list item class from which others are derived. More...
class | DropDownListStringItem
| Common string list item. More...
class | DropDownListParamStringItem
| String list item with parameters. More...
class | DropDownListCharStringItem
| List item containing a C char string. More...
## Typedefs
typedef std::list < DropDownListItem * > | DropDownList
| A drop down list is a collection of drop down list items.
## Functions
void | ShowDropDownList (Window *w, DropDownList *list, int selected, int button, uint width=0, bool auto_width=false, bool instant_close=false)
| Show a drop down list.

## Detailed Description

Types related to the drop down widget.

Definition in file dropdown_type.h.

## Function Documentation

void ShowDropDownList | ( | Window * | w,
|  | DropDownList * | list,
|  | int | selected,
|  | int | button,
|  | uint | width = `0`,
|  | bool | auto_width = `false`,
|  | bool | instant_close = `false` |
| ) |  |  |

Show a drop down list.

Parameters:

  | w | Parent window for the list.
  | list | Prepopulated DropDownList. Will be deleted when the list is closed.
  | selected | The initially selected list item.
  | button | The widget within the parent window that is used to determine the list's location.
  | width | Override the width determined by the selected widget.
  | auto_width | Maximum width is determined by the widest item in the list.
  | instant_close | Set to true if releasing mouse button should close the list regardless of where the cursor is.

Definition at line 328 of file dropdown.cpp.

References _dynlang, NWidgetCore::colour, NWidgetBase::current_x, NWidgetBase::current_y, DeleteWindowById(), NWidgetCore::disp_flags, GetMainViewBottom(), GetMainViewTop(), Window::GetWidget(), Window::left, Window::LowerWidget(), max(), ND_DROPDOWN_ACTIVE, NWID_BUTTON_DROPDOWN, NWidgetBase::pos_x, NWidgetBase::pos_y, Window::SetWidgetDirty(), TD_RTL, DynamicLanguages::text_dir, Window::top, NWidgetBase::type, and WD_VSCROLLBAR_WIDTH.

Referenced by GameOptionsWindow::OnClick(), BuildRailStationWindow::OnClick(), NewGRFWindow::OnClick(), CreateScenarioWindow::OnClick(), GenerateLandscapeWindow::OnClick(), ReplaceVehicleWindow::OnClick(), PopupMainCompanyToolbMenu(), PopupMainToolbMenu(), SetDateWindow::ShowDateDropDown(), ShowDropDownMenu(), ShowGroupActionDropdown(), and ShowTownnameDropdown().