-
Notifications
You must be signed in to change notification settings - Fork 0
/
widgetlist.hpp
42 lines (34 loc) · 1.34 KB
/
widgetlist.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef WIDGETLIST_H
#define WIDGETLIST_H
#include <MultiWidgets/Widget.hpp>
class WidgetList : public MultiWidgets::Widget
{
typedef std::list<Widget*> ItemList;
ItemList m_itemList;
public:
WidgetList(MultiWidgets::Widget * parent = 0);
WidgetList * clone();
static WidgetList * createNiceList(Widget * parent = 0, Widget * content = 0);
virtual void update(float dt);
void layout();
//void processFingers(MultiWidgets::GrabManager &gm, MultiWidgets::FingerArray &fingers, float dt);
/// see if user is trying to split the list
//void handleSplits(MultiWidgets::GrabManager &gm, MultiWidgets::FingerArray &fingers, float dt);
// return the bounding rectangle of widget in list in (common) parent coordinates
/// @param part -1 means left half, 0 full size, 1 right half
Nimble::Rectangle itemRect(const Widget * w, int part=0);
// find item from list which contains local coordinate pos
ItemList::iterator findItem(Nimble::Vector2 pos);
void addItem(Widget * w);
Widget* getItem(size_t idx);
size_t itemCount() const;
void renderContent(Luminous::RenderContext &r);
//virtual void render(Luminous::RenderContext & r);
inline void setType(std::string type)
{ m_type = type; }
virtual const char * type() const;
virtual void recursiveSetAlpha(float alpha);
private:
std::string m_type;
};
#endif // WIDGETLIST_H