aboutsummaryrefslogtreecommitdiff
path: root/lib/components
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2005-11-11 15:11:09 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2005-11-11 15:11:09 +0000
commit243c568781ee71d742b4e1098cf327592220b29d (patch)
treead53997187127a263cd74a545e8019fdba90844b /lib/components
parent8557c3427743ae6bde13fca80e84d3a4d3bde9bb (diff)
downloadenigma2-243c568781ee71d742b4e1098cf327592220b29d.tar.gz
enigma2-243c568781ee71d742b4e1098cf327592220b29d.zip
change interface of getCurrent method for better use from python
change default font size
Diffstat (limited to 'lib/components')
-rw-r--r--lib/components/listboxepg.cpp18
-rw-r--r--lib/components/listboxepg.h63
2 files changed, 8 insertions, 73 deletions
diff --git a/lib/components/listboxepg.cpp b/lib/components/listboxepg.cpp
index b72a6a82..d088006b 100644
--- a/lib/components/listboxepg.cpp
+++ b/lib/components/listboxepg.cpp
@@ -29,12 +29,16 @@ void eListboxEPGContent::setRoot(const eServiceReference &root)
}
}
-void eListboxEPGContent::getCurrent(ePtr<eServiceEvent>& evt)
+RESULT eListboxEPGContent::getCurrent(ePtr<eServiceEvent> &evt)
{
if (cursorValid())
+ {
evt = *m_cursor;
+ return 0;
+ }
else
evt = 0;
+ return -1;
}
void eListboxEPGContent::setElementPosition(int element, eRect where)
@@ -151,10 +155,10 @@ void eListboxEPGContent::setSize(const eSize &size)
eSize s = m_itemsize;
s.setWidth(size.width()/20*5);
m_element_position[celBeginTime] = eRect(ePoint(0, 0), s);
- m_element_font[celBeginTime] = new gFont("Arial", 20);
+ m_element_font[celBeginTime] = new gFont("Arial", 22);
s.setWidth(size.width()/20*15);
m_element_position[celTitle] = eRect(ePoint(size.width()/20*5, 0), s);
- m_element_font[celTitle] = new gFont("Arial", 20);
+ m_element_font[celTitle] = new gFont("Arial", 22);
}
void eListboxEPGContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
@@ -178,13 +182,7 @@ void eListboxEPGContent::paint(gPainter &painter, eWindowStyle &style, const ePo
{
case celBeginTime:
{
- tm t;
- localtime_r(&(*m_cursor)->m_begin, &t);
- char tmp[13];
- snprintf(tmp, 13, "%02d.%02d, %02d:%02d",
- t.tm_mday, t.tm_mon+1,
- t.tm_hour, t.tm_min);
- text=tmp;
+ text=(*m_cursor)->getBeginTimeString();
break;
}
case celTitle:
diff --git a/lib/components/listboxepg.h b/lib/components/listboxepg.h
index abbdc48e..e69de29b 100644
--- a/lib/components/listboxepg.h
+++ b/lib/components/listboxepg.h
@@ -1,63 +0,0 @@
-#ifndef __lib_components_listboxepg_h
-#define __lib_components_listboxepg_h
-
-#include <lib/gui/elistbox.h>
-#include <lib/service/iservice.h>
-
-#include <set>
-
-class eListboxEPGContent: public virtual iListboxContent
-{
- DECLARE_REF(eListboxEPGContent);
-public:
- eListboxEPGContent();
- void setRoot(const eServiceReference &ref);
- void getCurrent(ePtr<eServiceEvent>&);
-
- /* only in complex mode: */
- enum {
- celBeginTime,
- celTitle,
- celElements
- };
-
- void setElementPosition(int element, eRect where);
- void setElementFont(int element, gFont *font);
-
- void sort();
-
-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);
-
- eRect m_element_position[celElements];
- ePtr<gFont> m_element_font[celElements];
-private:
- typedef std::list<ePtr<eServiceEvent> > 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;
-
- eServiceReference m_root;
-};
-
-#endif