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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
#ifndef __lib_gui_elistboxcontent_h
#define __lib_gui_elistboxcontent_h
#include <lib/python/python.h>
#include <lib/gui/elistbox.h>
class eListboxTestContent: public virtual iListboxContent
{
DECLARE_REF(eListboxTestContent);
public:
#ifndef SWIG
protected:
void cursorHome();
void cursorEnd();
int cursorMove(int count=1);
int cursorValid();
int cursorSet(int n);
int cursorGet();
void cursorSave();
void cursorRestore();
int size();
RESULT connectItemChanged(const Slot0<void> &itemChanged, ePtr<eConnection> &connection);
// void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
void setSize(const eSize &size);
/* the following functions always refer to the selected item */
void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
private:
int m_cursor, m_saved_cursor;
eSize m_size;
#endif
};
class eListboxStringContent: public virtual iListboxContent
{
DECLARE_REF(eListboxStringContent);
public:
eListboxStringContent();
void setList(std::list<std::string> &list);
#ifndef SWI
protected:
void cursorHome();
void cursorEnd();
int cursorMove(int count=1);
int cursorValid();
int cursorSet(int n);
int cursorGet();
void cursorSave();
void cursorRestore();
int size();
// void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
void setSize(const eSize &size);
/* the following functions always refer to the selected item */
void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
private:
typedef std::list<std::string> list;
list m_list;
list::iterator m_cursor, m_saved_cursor;
int m_cursor_number, m_saved_cursor_number;
int m_size;
eSize m_itemsize;
#endif
};
class eListboxPythonStringContent: public virtual iListboxContent
{
DECLARE_REF(eListboxPythonStringContent);
public:
eListboxPythonStringContent();
~eListboxPythonStringContent();
void setList(PyObject *list);
PyObject *getCurrentSelection();
int getCurrentSelectionIndex() { return m_cursor; }
void invalidateEntry(int index);
void invalidate();
eSize getItemSize() { return m_itemsize; }
#ifndef SWIG
protected:
void cursorHome();
void cursorEnd();
int cursorMove(int count=1);
int cursorValid();
int cursorSet(int n);
int cursorGet();
void cursorSave();
void cursorRestore();
int size();
RESULT connectItemChanged(const Slot0<void> &itemChanged, ePtr<eConnection> &connection);
// void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
void setSize(const eSize &size);
/* the following functions always refer to the selected item */
virtual void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
protected:
PyObject *m_list;
int m_cursor, m_saved_cursor;
eSize m_itemsize;
#endif
};
class eListboxPythonConfigContent: public eListboxPythonStringContent
{
public:
void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
void setSeperation(int sep) { m_seperation = sep; }
private:
int m_seperation;
};
class eListboxPythonMultiContent: public eListboxPythonStringContent
{
public:
enum { TYPE_TEXT, TYPE_PROGRESS, TYPE_PIXMAP, TYPE_PIXMAP_ALPHATEST };
void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
void setFont(int fnt, gFont *fnt);
private:
std::map<int, ePtr<gFont> > m_font;
};
#endif
|