|
OpenTTD Source
14.0-beta1
|
#include "../window_type.h"#include "../gfx_func.h"#include "../gfx_type.h"#include "../palette_func.h"#include "../string_func.h"#include "../strings_func.h"#include "../table/strings.h"#include "../window_gui.h"Go to the source code of this file.
Data Structures | |
| class | DropDownListItem |
| Base list item class from which others are derived. More... | |
| class | DropDownDivider< TBase, TFs > |
| Drop down divider component. More... | |
| class | DropDownString< TBase, TFs, TEnd > |
| Drop down string component. More... | |
| class | DropDownIcon< TBase, TEnd > |
| Drop down icon component. More... | |
| class | DropDownCheck< TBase, TEnd, TFs > |
| Drop down checkmark component. More... | |
Typedefs | |
| using | DropDownListDividerItem = DropDownDivider< DropDownListItem > |
| using | DropDownListStringItem = DropDownString< DropDownListItem > |
| using | DropDownListIconItem = DropDownIcon< DropDownString< DropDownListItem > > |
| using | DropDownListCheckedItem = DropDownCheck< DropDownString< DropDownListItem > > |
| typedef std::vector< std::unique_ptr< const DropDownListItem > > | DropDownList |
| A drop down list is a collection of drop down list items. | |
Functions | |
| void | ShowDropDownListAt (Window *w, DropDownList &&list, int selected, WidgetID button, Rect wi_rect, Colours wi_colour, bool instant_close=false) |
| Show a drop down list. More... | |
| void | ShowDropDownList (Window *w, DropDownList &&list, int selected, WidgetID button, uint width=0, bool instant_close=false) |
| Show a drop down list. More... | |
| Dimension | GetDropDownListDimension (const DropDownList &list) |
| Determine width and height required to fully display a DropDownList. More... | |
Types related to the drop down widget.
Definition in file dropdown_type.h.
| Dimension GetDropDownListDimension | ( | const DropDownList & | list | ) |
Determine width and height required to fully display a DropDownList.
| list | The list. |
Definition at line 310 of file dropdown.cpp.
References WidgetDimensions::dropdowntext, RectPadding::Horizontal(), and WidgetDimensions::scaled.
Referenced by DropdownWindow::UpdateSizeAndPosition().
| void ShowDropDownList | ( | Window * | w, |
| DropDownList && | list, | ||
| int | selected, | ||
| WidgetID | button, | ||
| uint | width, | ||
| bool | instant_close | ||
| ) |
Show a drop down list.
| w | Parent window for the list. |
| list | Prepopulated DropDownList. |
| 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 minimum width determined by the selected widget and list contents. |
| instant_close | Set to true if releasing mouse button should close the list regardless of where the cursor is. |
Definition at line 349 of file dropdown.cpp.
References NWidgetCore::colour, Window::GetWidget(), and NWidgetBase::type.
Referenced by GenerateLandscapeWindow::OnClick(), PopupMainToolbarMenu(), and ShowDropDownMenu().
| void ShowDropDownListAt | ( | Window * | w, |
| DropDownList && | list, | ||
| int | selected, | ||
| WidgetID | button, | ||
| Rect | wi_rect, | ||
| Colours | wi_colour, | ||
| bool | instant_close | ||
| ) |
Show a drop down list.
| w | Parent window for the list. |
| list | Prepopulated DropDownList. |
| selected | The initially selected list item. |
| button | The widget which is passed to Window::OnDropdownSelect and OnDropdownClose. Unless you override those functions, this should be then widget index of the dropdown button. |
| wi_rect | Coord of the parent drop down button, used to position the dropdown menu. |
| instant_close | Set to true if releasing mouse button should close the list regardless of where the cursor is. |
Definition at line 332 of file dropdown.cpp.
References CloseWindowByClass(), and WC_DROPDOWN_MENU.