aboutsummaryrefslogtreecommitdiff
path: root/lib/gui/elistboxcontent.h
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2005-01-28 23:58:27 +0000
committerFelix Domke <tmbinc@elitedvb.net>2005-01-28 23:58:27 +0000
commit31688e1b8f028059a700a92a8276c97928abd260 (patch)
tree7ef1336cc6a940d530de67dae17d5c6496732093 /lib/gui/elistboxcontent.h
parent8ade23537a682d4b0c9709d533b25702bde2ee23 (diff)
downloadenigma2-31688e1b8f028059a700a92a8276c97928abd260.tar.gz
enigma2-31688e1b8f028059a700a92a8276c97928abd260.zip
- added ListBoxContents: based on std::list<std::string> and PyList with Strings
- used the last one as a test for menulist
Diffstat (limited to 'lib/gui/elistboxcontent.h')
-rw-r--r--lib/gui/elistboxcontent.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/lib/gui/elistboxcontent.h b/lib/gui/elistboxcontent.h
new file mode 100644
index 00000000..6219cec6
--- /dev/null
+++ b/lib/gui/elistboxcontent.h
@@ -0,0 +1,106 @@
+#ifndef __lib_gui_elistboxcontent_h
+#define __lib_gui_elistboxcontent_h
+
+#include <lib/python/python.h>
+
+class eListboxTestContent: public virtual iListboxContent
+{
+ DECLARE_REF;
+public:
+ 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;
+};
+
+class eListboxStringContent: public virtual iListboxContent
+{
+ DECLARE_REF;
+public:
+ eListboxStringContent();
+
+ 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);
+
+ void setList(std::list<std::string> &list);
+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;
+};
+
+class eListboxPythonStringContent: public virtual iListboxContent
+{
+ DECLARE_REF;
+public:
+ eListboxPythonStringContent();
+ ~eListboxPythonStringContent();
+ 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);
+
+ void setList(PyObject *list);
+
+ PyObject *getCurrentSelection();
+
+private:
+ PyObject *m_list;
+ int m_cursor, m_saved_cursor;
+ eSize m_itemsize;
+};
+
+#endif