~ubuntu-branches/ubuntu/trusty/manaplus/trusty-proposed

« back to all changes in this revision

Viewing changes to src/gui/widgets/extendedlistbox.h

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2013-07-11 10:09:41 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20130711100941-f0rwuvcwgl8ulqo8
Tags: 1.3.7.7.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include "gui/widgets/listbox.h"
25
25
 
 
26
struct ExtendedListBoxItem
 
27
{
 
28
    ExtendedListBoxItem(const int row0,
 
29
                        const std::string &text0,
 
30
                        const bool image0,
 
31
                        const int y0) :
 
32
        row(row0),
 
33
        text(text0),
 
34
        image(image0),
 
35
        y(y0)
 
36
    {
 
37
    }
 
38
    int row;
 
39
    std::string text;
 
40
    bool image;
 
41
    int y;
 
42
};
 
43
 
26
44
class ExtendedListBox final : public ListBox
27
45
{
28
46
    public:
49
67
        void setRowHeight(unsigned int n)
50
68
        { mRowHeight = n; }
51
69
 
 
70
        void adjustSize() override;
 
71
 
 
72
        int getSelectionByMouse(const int y) const override;
 
73
 
52
74
    protected:
53
75
        unsigned int mRowHeight;
54
76
        int mImagePadding;
55
77
        int mSpacing;
56
78
        int mItemPadding;
 
79
        int mHeight;
 
80
        std::vector<ExtendedListBoxItem> mListItems;
 
81
        std::vector<ExtendedListBoxItem> mSelectedItems;
57
82
};
58
83
 
59
84
#endif  // GUI_WIDGETS_EXTENDEDLISTBOX_H