OpenTTD Source
20240915-master-g3784a3d3d6
|
Go to the documentation of this file.
10 #ifndef DROPDOWN_TYPE_H
11 #define DROPDOWN_TYPE_H
31 virtual bool Selectable()
const {
return true; }
32 virtual uint
Height()
const {
return 0; }
33 virtual uint Width()
const {
return 0; }
35 virtual void Draw(
const Rect &full,
const Rect &,
bool, Colours bg_colour)
const
42 if (this->shaded)
return (sel ? TC_SILVER : TC_GREY) |
TC_NO_SHADE;
43 return sel ? TC_WHITE : TC_BLACK;
50 typedef std::vector<std::unique_ptr<const DropDownListItem>>
DropDownList;
void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, WidgetID button, Rect wi_rect, Colours wi_colour, bool instant_close=false, bool persist=false)
Show a drop down list.
uint8_t GetColourGradient(Colours colour, ColourShade shade)
Get colour gradient palette index.
int result
Result value to return to window on selection.
int16_t Height
Fixed point type for heights.
Dimensions (a width and height) of a rectangle in 2D.
std::vector< std::unique_ptr< const DropDownListItem > > DropDownList
A drop down list is a collection of drop down list items.
Dimension GetDropDownListDimension(const DropDownList &list)
Determine width and height required to fully display a DropDownList.
@ FILLRECT_CHECKER
Draw only every second pixel, used for greying-out.
TextColour
Colour of the strings, see _string_colourmap in table/string_colours.h or docs/ottd-colourtext-palett...
Base list item class from which others are derived.
bool shaded
Shaded item, affects text colour.
@ TC_NO_SHADE
Do not add shading to this text colour.
void GfxFillRect(int left, int top, int right, int bottom, int colour, FillRectMode mode)
Applies a certain FillRectMode-operation to a rectangle [left, right] x [top, bottom] on the screen.
Data structure for an opened window.
void ShowDropDownList(Window *w, DropDownList &&list, int selected, WidgetID button, uint width=0, bool instant_close=false, bool persist=false)
Show a drop down list.
Specification of a rectangle with absolute coordinates of all edges.
bool masked
Masked and unselectable item.