From 77760a62fd0d926eec7c8807053f8f8d01e14bc1 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sat, 7 Feb 2009 00:37:35 +0000 Subject: (svn r15387) -Codechange: Add a drop down list item type for char* strings. --- src/widgets/dropdown_type.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/widgets/dropdown_type.h') diff --git a/src/widgets/dropdown_type.h b/src/widgets/dropdown_type.h index 086e5717d..607799656 100644 --- a/src/widgets/dropdown_type.h +++ b/src/widgets/dropdown_type.h @@ -56,6 +56,21 @@ public: virtual void SetParam(uint index, uint64 value) { decode_params[index] = value; } }; +/** + * List item containing a C char string. + */ +class DropDownListCharStringItem : public DropDownListItem { +public: + const char *string; + + DropDownListCharStringItem(const char *string, int result, bool masked) : DropDownListItem(result, masked), string(string) {} + virtual ~DropDownListCharStringItem() {} + + virtual bool Selectable() const { return true; } + virtual uint Width() const; + virtual void Draw(int x, int y, uint width, uint height, bool sel, int bg_colour) const; +}; + /** * A drop down list is a collection of drop down list items. */ -- cgit v1.2.3-54-g00ecf