12 #ifndef WIDGETS_DROPDOWN_TYPE_H 13 #define WIDGETS_DROPDOWN_TYPE_H 15 #include "../window_type.h" 16 #include "../gfx_func.h" 17 #include "../core/smallvec_type.hpp" 18 #include "table/strings.h" 29 DropDownListItem(
int result,
bool masked) : result(result), masked(masked) {}
32 virtual bool Selectable()
const {
return false; }
34 virtual uint Width()
const {
return 0; }
35 virtual void Draw(
int left,
int right,
int top,
int bottom,
bool sel,
int bg_colour)
const;
48 virtual bool Selectable()
const {
return true; }
49 virtual uint Width()
const;
50 virtual void Draw(
int left,
int right,
int top,
int bottom,
bool sel,
int bg_colour)
const;
51 virtual StringID String()
const {
return this->string; }
61 uint64 decode_params[10];
67 virtual void SetParam(uint index, uint64 value) { decode_params[index] = value; }
75 const char *raw_string;
void ShowDropDownListAt(Window *w, const DropDownList *list, int selected, int button, Rect wi_rect, Colours wi_colour, bool auto_width=false, bool instant_close=false)
Show a drop down list.
Data structure for an opened window.
#define FONT_HEIGHT_NORMAL
Height of characters in the normal (FS_NORMAL) font.
Simple vector template class, with automatic delete.
bool masked
Masked and unselectable item.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
StringID string
String ID of item.
int result
Result code to return to window on selection.
List item containing a C char string.
Specification of a rectangle with absolute coordinates of all edges.
void ShowDropDownList(Window *w, const DropDownList *list, int selected, int button, uint width=0, bool auto_width=false, bool instant_close=false)
Show a drop down list.
String list item with parameters.
Base list item class from which others are derived.
AutoDeleteSmallVector< const DropDownListItem *, 4 > DropDownList
A drop down list is a collection of drop down list items.