|
OpenTTD Source 20260311-master-g511d3794ce
|
Base list item class from which others are derived. More...
#include <dropdown_type.h>
Public Member Functions | |
| DropDownListItem (int result, bool masked=false, bool shaded=false) | |
| virtual | ~DropDownListItem ()=default |
| Ensure the destructor of the sub classes are called as well. | |
| virtual void | FilterText (StringFilter &string_filter) const |
| Add text from this dropdown item to a string filter. | |
| virtual bool | Selectable () const |
| Can this dropdown item be selected? | |
| virtual uint | Height () const |
| The height of this item. | |
| virtual uint | Width () const |
| The width of this item. | |
| virtual int | OnClick (const Rect &r, const Point &pt) const |
| Callback when this item is clicked. | |
| virtual void | Draw (const Rect &full, const Rect &r, bool sel, int click_result, Colours bg_colour) const |
| Callback for drawing this item. | |
| TextColour | GetColour (bool sel) const |
| Get the colour of the text. | |
Data Fields | |
| int | result |
| Result value to return to window on selection. | |
| bool | masked |
| Masked and unselectable item. | |
| bool | shaded |
| Shaded item, affects text colour. | |
Base list item class from which others are derived.
Definition at line 24 of file dropdown_type.h.
|
inlineexplicit |
Definition at line 30 of file dropdown_type.h.
|
inlinevirtual |
Callback for drawing this item.
| full | The full bounds of the item including padding. |
| r | The bounds to draw the item in. |
| sel | Whether the item is elected or not. |
| click_result | When selected, the previously set 'click_result' otherwise -1. |
| bg_colour | The background color for the item. |
Definition at line 77 of file dropdown_type.h.
References FILLRECT_CHECKER, GetColourGradient(), GfxFillRect(), and Rect.
|
inlinevirtual |
Add text from this dropdown item to a string filter.
| string_filter | String filter to add text to. |
Reimplemented in DropDownString< DropDownListItem >.
Definition at line 38 of file dropdown_type.h.
Referenced by DropdownWindow::FilterByText().
|
inline |
Get the colour of the text.
| sel | Whether the item is selected or not. |
Definition at line 87 of file dropdown_type.h.
References TC_NO_SHADE.
|
inlinevirtual |
Callback when this item is clicked.
| r | The bounds of this item. |
| pt | The location within the bounds where the item is clicked. |
Definition at line 64 of file dropdown_type.h.
|
inlinevirtual |
Can this dropdown item be selected?
Definition at line 44 of file dropdown_type.h.
|
inlinevirtual |
| bool DropDownListItem::masked |
Masked and unselectable item.
Definition at line 27 of file dropdown_type.h.
| int DropDownListItem::result |
Result value to return to window on selection.
Definition at line 26 of file dropdown_type.h.
| bool DropDownListItem::shaded |
Shaded item, affects text colour.
Definition at line 28 of file dropdown_type.h.