diff options
author | peter1138 <peter1138@openttd.org> | 2019-03-10 02:10:40 +0000 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2019-03-10 10:31:37 +0000 |
commit | b56ea5ca27440fd8023bfecf8299422c93eb05c3 (patch) | |
tree | 38d7f340afd0377ec6dc5b561cf0106e3814c168 /src/widgets/dropdown_type.h | |
parent | fb35cb5ed2735ad22d8a2bee9df2a174994ed319 (diff) | |
download | openttd-b56ea5ca27440fd8023bfecf8299422c93eb05c3.tar.xz |
Add: Generic drop down list string item with icon.
Diffstat (limited to 'src/widgets/dropdown_type.h')
-rw-r--r-- | src/widgets/dropdown_type.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/widgets/dropdown_type.h b/src/widgets/dropdown_type.h index a5fe27f64..8300dd26d 100644 --- a/src/widgets/dropdown_type.h +++ b/src/widgets/dropdown_type.h @@ -78,6 +78,24 @@ public: }; /** + * List item with icon and string. + */ +class DropDownListIconItem : public DropDownListParamStringItem { + SpriteID sprite; + PaletteID pal; + Dimension dim; + uint sprite_y; + uint text_y; +public: + DropDownListIconItem(SpriteID sprite, PaletteID pal, StringID string, int result, bool masked); + + /* virtual */ uint Height(uint width) const; + /* virtual */ uint Width() const; + /* virtual */ void Draw(int left, int right, int top, int bottom, bool sel, Colours bg_colour) const; + void SetDimension(Dimension d); +}; + +/** * A drop down list is a collection of drop down list items. */ typedef AutoDeleteSmallVector<const DropDownListItem *, 4> DropDownList; |