summaryrefslogtreecommitdiff
path: root/src/gui/widgets/extendedlistbox.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-29 16:02:11 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-29 17:48:19 +0300
commit37f849a6ae4d96a22d7b972d3021c235aa294ad8 (patch)
tree5f6ed8b8ab59ed1cde7019eb9d207cbe348c14ae /src/gui/widgets/extendedlistbox.h
parent80623e124244977c4ba52829fe830fed103532ff (diff)
downloadmanaverse-37f849a6ae4d96a22d7b972d3021c235aa294ad8.tar.gz
manaverse-37f849a6ae4d96a22d7b972d3021c235aa294ad8.tar.bz2
manaverse-37f849a6ae4d96a22d7b972d3021c235aa294ad8.tar.xz
manaverse-37f849a6ae4d96a22d7b972d3021c235aa294ad8.zip
Add support for multilines in extendedlistbox.
Diffstat (limited to 'src/gui/widgets/extendedlistbox.h')
-rw-r--r--src/gui/widgets/extendedlistbox.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gui/widgets/extendedlistbox.h b/src/gui/widgets/extendedlistbox.h
index 9d3394dd4..79fef2f50 100644
--- a/src/gui/widgets/extendedlistbox.h
+++ b/src/gui/widgets/extendedlistbox.h
@@ -23,6 +23,24 @@
#include "gui/widgets/listbox.h"
+struct ExtendedListBoxItem
+{
+ ExtendedListBoxItem(const int row0,
+ const std::string &text0,
+ const bool image0,
+ const int y0) :
+ row(row0),
+ text(text0),
+ image(image0),
+ y(y0)
+ {
+ }
+ int row;
+ std::string text;
+ bool image;
+ int y;
+};
+
class ExtendedListBox final : public ListBox
{
public:
@@ -49,11 +67,18 @@ class ExtendedListBox final : public ListBox
void setRowHeight(unsigned int n)
{ mRowHeight = n; }
+ void adjustSize() override;
+
+ int getSelectionByMouse(const int y) const override;
+
protected:
unsigned int mRowHeight;
int mImagePadding;
int mSpacing;
int mItemPadding;
+ int mHeight;
+ std::vector<ExtendedListBoxItem> mListItems;
+ std::vector<ExtendedListBoxItem> mSelectedItems;
};
#endif // GUI_WIDGETS_EXTENDEDLISTBOX_H