diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2007-04-12 19:47:26 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2007-04-12 19:47:26 +0000 |
| commit | 23375d83d2c191d85e65580d6307c0949b5007e5 (patch) | |
| tree | f9d80eb841d6cdb26004f4262aa91433b86bbb4d /lib/gui | |
| parent | c3e7df23d5424647a8a41c0d9d9aa0fc86f47d0f (diff) | |
| download | enigma2-23375d83d2c191d85e65580d6307c0949b5007e5.tar.gz enigma2-23375d83d2c191d85e65580d6307c0949b5007e5.zip | |
itemheight is now a property of the listbox content
Diffstat (limited to 'lib/gui')
| -rw-r--r-- | lib/gui/elistbox.h | 4 | ||||
| -rw-r--r-- | lib/gui/elistboxcontent.cpp | 10 | ||||
| -rw-r--r-- | lib/gui/elistboxcontent.h | 4 |
3 files changed, 16 insertions, 2 deletions
diff --git a/lib/gui/elistbox.h b/lib/gui/elistbox.h index 2eb54dd9..7538170c 100644 --- a/lib/gui/elistbox.h +++ b/lib/gui/elistbox.h @@ -48,6 +48,8 @@ protected: /* the following functions always refer to the selected item */ virtual void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)=0; + virtual int getItemHeight()=0; + eListbox *m_listbox; #endif }; @@ -95,7 +97,7 @@ public: pageDown, justCheck }; - + void setItemHeight(int h); void setSelectionEnable(int en); #ifndef SWIG diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp index 621fa5cc..4fa5a65e 100644 --- a/lib/gui/elistboxcontent.cpp +++ b/lib/gui/elistboxcontent.cpp @@ -37,6 +37,7 @@ iListboxContent::iListboxContent(): m_listbox(0) void iListboxContent::setListbox(eListbox *lb) { m_listbox = lb; + m_listbox->setItemHeight(getItemHeight()); } int iListboxContent::currentCursorSelectable() @@ -48,7 +49,7 @@ int iListboxContent::currentCursorSelectable() DEFINE_REF(eListboxPythonStringContent); -eListboxPythonStringContent::eListboxPythonStringContent() +eListboxPythonStringContent::eListboxPythonStringContent(): m_itemheight(25) { } @@ -661,3 +662,10 @@ void eListboxPythonMultiContent::setFont(int fnt, gFont *font) else m_font.erase(fnt); } + +void eListboxPythonMultiContent::setItemHeight(int height) +{ + m_itemheight = height; + if (m_listbox) + m_listbox->setItemHeight(height); +} diff --git a/lib/gui/elistboxcontent.h b/lib/gui/elistboxcontent.h index 9c89c658..f934ed59 100644 --- a/lib/gui/elistboxcontent.h +++ b/lib/gui/elistboxcontent.h @@ -38,11 +38,14 @@ protected: /* the following functions always refer to the selected item */ virtual void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected); + + int getItemHeight() { return m_itemheight; } protected: ePyObject m_list; int m_cursor, m_saved_cursor; eSize m_itemsize; + int m_itemheight; #endif }; @@ -68,6 +71,7 @@ public: void setFont(int fnt, gFont *fnt); void setBuildFunc(SWIG_PYOBJECT(ePyObject) func); + void setItemHeight(int height); private: std::map<int, ePtr<gFont> > m_font; }; |
