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. | |
int | HideDropDownMenu (Window *pw) |
Delete the drop-down menu from window pw. |
Functions related to the drop down widget.
Definition in file dropdown_func.h.
int HideDropDownMenu | ( | Window * | pw | ) |
Delete the drop-down menu from window pw.
pw | Parent window of the drop-down menu window |
-1
if the window was not found. Definition at line 483 of file dropdown.cpp.
References DropdownWindow::parent_button, DropdownWindow::parent_wnd_class, DropdownWindow::parent_wnd_num, WC_DROPDOWN_MENU, Window::window_class, and Window::window_number.
Referenced by DispatchLeftClickEvent(), GameSettingsWindow::OnClick(), OrdersWindow::OnClick(), NewGRFParametersWindow::OnClick(), AISettingsWindow::OnClick(), OrdersWindow::OnInvalidateData(), VehicleGroupWindow::OnInvalidateData(), VehicleListWindow::OnPaint(), and VehicleGroupWindow::OnPaint().
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.
w | Parent window that wants the dropdown menu. | |
strings | Menu list, end with INVALID_STRING_ID | |
selected | Index of initial selected item. | |
button | Button widget number of the parent window w that wants the dropdown menu. | |
disabled_mask | Bitmask for disabled items (items with their bit set are not copied to the dropdown list). | |
hidden_mask | Bitmask for hidden items (items with their bit set are displayed, but not selectable in the dropdown list). | |
width | Width of the dropdown menu. If 0 , use the width of parent widget button. |
Definition at line 459 of file dropdown.cpp.
References DeleteDropDownList(), HasBit(), INVALID_STRING_ID, and ShowDropDownList().
Referenced by VehicleDetailsWindow::OnClick(), VehicleListWindow::OnClick(), StationViewWindow::OnClick(), CompanyStationsWindow::OnClick(), OrdersWindow::OnClick(), NetworkStartServerWindow::OnClick(), NetworkGameWindow::OnClick(), IndustryDirectoryWindow::OnClick(), VehicleGroupWindow::OnClick(), GenerateLandscapeWindow::OnClick(), BuildVehicleWindow::OnClick(), BuildBridgeWindow::OnClick(), and ReplaceVehicleWindow::OnClick().