git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- improved parser
[enigma2.git]
/
lib
/
gui
/
elistboxcontent.cpp
diff --git
a/lib/gui/elistboxcontent.cpp
b/lib/gui/elistboxcontent.cpp
index 2f05f5dcbc523865a4b2b0ce85ecd791a6d6e1fc..209b525094537fd09cec612252f20f79a591a9c7 100644
(file)
--- a/
lib/gui/elistboxcontent.cpp
+++ b/
lib/gui/elistboxcontent.cpp
@@
-29,6
+29,14
@@
iListboxContent::~iListboxContent()
{
}
{
}
+iListboxContent::iListboxContent(): m_listbox(0)
+{
+}
+
+void iListboxContent::setListbox(eListbox *lb)
+{
+ m_listbox = lb;
+}
DEFINE_REF(eListboxTestContent);
DEFINE_REF(eListboxTestContent);
@@
-203,11
+211,6
@@
int eListboxStringContent::size()
return m_size;
}
return m_size;
}
-RESULT eListboxStringContent::connectItemChanged(const Slot0<void> &itemChanged, ePtr<eConnection> &connection)
-{
- return 0;
-}
-
void eListboxStringContent::setSize(const eSize &size)
{
m_itemsize = size;
void eListboxStringContent::setSize(const eSize &size)
{
m_itemsize = size;
@@
-316,11
+319,6
@@
int eListboxPythonStringContent::size()
return PyList_Size(m_list);
}
return PyList_Size(m_list);
}
-RESULT eListboxPythonStringContent::connectItemChanged(const Slot0<void> &itemChanged, ePtr<eConnection> &connection)
-{
- return 0;
-}
-
void eListboxPythonStringContent::setSize(const eSize &size)
{
m_itemsize = size;
void eListboxPythonStringContent::setSize(const eSize &size)
{
m_itemsize = size;
@@
-337,6
+335,10
@@
void eListboxPythonStringContent::paint(gPainter &painter, eWindowStyle &style,
{
PyObject *item = PyList_GetItem(m_list, m_cursor); // borrowed reference!
painter.setFont(fnt);
{
PyObject *item = PyList_GetItem(m_list, m_cursor); // borrowed reference!
painter.setFont(fnt);
+
+ /* the user can supply tuples, in this case the first one will be displayed. */
+ if (PyTuple_Check(item))
+ item = PyTuple_GetItem(item, 0);
const char *string = PyString_Check(item) ? PyString_AsString(item) : "<not-a-string>";
const char *string = PyString_Check(item) ? PyString_AsString(item) : "<not-a-string>";