summaryrefslogtreecommitdiff
path: root/src/widgets/dropdown_type.h
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2009-02-07 00:37:35 +0000
committerpeter1138 <peter1138@openttd.org>2009-02-07 00:37:35 +0000
commit77760a62fd0d926eec7c8807053f8f8d01e14bc1 (patch)
tree584d4432bb4ce7dc8006916467e8222b65332fba /src/widgets/dropdown_type.h
parentdb545373693d8a352879179b143f9b6fd16db51d (diff)
downloadopenttd-77760a62fd0d926eec7c8807053f8f8d01e14bc1.tar.xz
(svn r15387) -Codechange: Add a drop down list item type for char* strings.
Diffstat (limited to 'src/widgets/dropdown_type.h')
-rw-r--r--src/widgets/dropdown_type.h15
1 files changed, 15 insertions, 0 deletions
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
@@ -57,6 +57,21 @@ public:
};
/**
+ * 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.
*/
typedef std::list<DropDownListItem *> DropDownList;