OpenTTD
Functions
dropdown_func.h File Reference

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

#include "../window_gui.h"

Go to the source code of this file.

Functions

void ShowDropDownMenu (Window *w, const StringID *strings, int selected, int button, uint32 disabled_mask, uint32 hidden_mask, uint width=0)
 Show a dropdown menu window near a widget of the parent window. More...
 
int HideDropDownMenu (Window *pw)
 Delete the drop-down menu from window pw. More...
 

Detailed Description

Functions related to the drop down widget.

Definition in file dropdown_func.h.

Function Documentation

◆ HideDropDownMenu()

int HideDropDownMenu ( Window pw)

Delete the drop-down menu from window pw.

Parameters
pwParent window of the drop-down menu window
Returns
Parent widget number if the drop-down was found and closed, -1 if the window was not found.

Definition at line 486 of file dropdown.cpp.

Referenced by NewGRFParametersWindow::OnClick(), OrdersWindow::OnInvalidateData(), VehicleGroupWindow::OnPaint(), and VehicleListWindow::OnPaint().

◆ ShowDropDownMenu()

void ShowDropDownMenu ( Window w,
const StringID strings,
int  selected,
int  button,
uint32  disabled_mask,
uint32  hidden_mask,
uint  width 
)

Show a dropdown menu window near a widget of the parent window.

The result code of the items is their index in the strings list.

Parameters
wParent window that wants the dropdown menu.
stringsMenu list, end with INVALID_STRING_ID
selectedIndex of initial selected item.
buttonButton widget number of the parent window w that wants the dropdown menu.
disabled_maskBitmask for disabled items (items with their bit set are displayed, but not selectable in the dropdown list).
hidden_maskBitmask for hidden items (items with their bit set are not copied to the dropdown list).
widthWidth of the dropdown menu. If 0, use the width of parent widget button.

Definition at line 462 of file dropdown.cpp.

Referenced by BuildBridgeWindow::OnClick(), ReplaceVehicleWindow::OnClick(), VehicleGroupWindow::OnClick(), NetworkGameWindow::OnClick(), TownDirectoryWindow::OnClick(), BuildVehicleWindow::OnClick(), IndustryDirectoryWindow::OnClick(), VehicleListWindow::OnClick(), and VehicleDetailsWindow::OnClick().