1 #ifndef __lib_gui_elistboxcontent_h
2 #define __lib_gui_elistboxcontent_h
4 #include <lib/python/python.h>
5 #include <lib/gui/elistbox.h>
7 class eListboxPythonStringContent: public virtual iListboxContent
9 DECLARE_REF(eListboxPythonStringContent);
11 eListboxPythonStringContent();
12 ~eListboxPythonStringContent();
14 void setList(SWIG_PYOBJECT(ePyObject) list);
15 PyObject *getCurrentSelection();
16 int getCurrentSelectionIndex() { return m_cursor; }
17 void invalidateEntry(int index);
19 eSize getItemSize() { return m_itemsize; }
24 int cursorMove(int count=1);
28 virtual int currentCursorSelectable();
34 RESULT connectItemChanged(const Slot0<void> &itemChanged, ePtr<eConnection> &connection);
36 // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
37 void setSize(const eSize &size);
39 /* the following functions always refer to the selected item */
40 virtual void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
42 int getItemHeight() { return m_itemheight; }
46 int m_cursor, m_saved_cursor;
52 class eListboxPythonConfigContent: public eListboxPythonStringContent
55 void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
56 void setSeperation(int sep) { m_seperation = sep; }
57 int currentCursorSelectable();
62 class eListboxPythonMultiContent: public eListboxPythonStringContent
64 ePyObject m_buildFunc;
65 eRect m_selection_clip;
68 eListboxPythonMultiContent();
69 ~eListboxPythonMultiContent();
70 enum { TYPE_TEXT, TYPE_PROGRESS, TYPE_PIXMAP, TYPE_PIXMAP_ALPHATEST };
71 void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
72 int currentCursorSelectable();
74 void setFont(int fnt, gFont *fnt);
75 void setBuildFunc(SWIG_PYOBJECT(ePyObject) func);
76 void setItemHeight(int height);
77 void setSelectionClip(eRect &rect, bool update=false);
79 std::map<int, ePtr<gFont> > m_font;
83 #define RT_HALIGN_LEFT 0
84 #define RT_HALIGN_RIGHT 1
85 #define RT_HALIGN_CENTER 2
86 #define RT_HALIGN_BLOCK 4
87 #define RT_VALIGN_TOP 0
88 #define RT_VALIGN_CENTER 8
89 #define RT_VALIGN_BOTTOM 16