|
OpenTTD Source 20260206-master-g4d4e37dbf1
|
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 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 23 of file dropdown_type.h.
|
inlineexplicit |
Definition at line 29 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 69 of file dropdown_type.h.
References FILLRECT_CHECKER, GetColourGradient(), GfxFillRect(), and Rect.
|
inline |
Get the colour of the text.
| sel | Whether the item is selected or not. |
Definition at line 79 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 56 of file dropdown_type.h.
|
inlinevirtual |
Can this dropdown item be selected?
Definition at line 36 of file dropdown_type.h.
|
inlinevirtual |
| bool DropDownListItem::masked |
Masked and unselectable item.
Definition at line 26 of file dropdown_type.h.
| int DropDownListItem::result |
Result value to return to window on selection.
Definition at line 25 of file dropdown_type.h.
| bool DropDownListItem::shaded |
Shaded item, affects text colour.
Definition at line 27 of file dropdown_type.h.