From 7bc4a59528ab13f3062dc1520e76f9ecedd87400 Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Sat, 14 May 2005 15:23:23 +0000 Subject: - work on timers - add eInput widget - add python/Tools - add flexible listbox content --- lib/gui/elistbox.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib/gui/elistbox.cpp') diff --git a/lib/gui/elistbox.cpp b/lib/gui/elistbox.cpp index ba2e3522..4598fa09 100644 --- a/lib/gui/elistbox.cpp +++ b/lib/gui/elistbox.cpp @@ -9,6 +9,8 @@ eListbox::eListbox(eWidget *parent): eWidget(parent) ePtr ptr; eActionMap::getInstance(ptr); + m_itemheight = 20; + ptr->bindAction("ListboxActions", 0, 0, this); } @@ -146,11 +148,19 @@ int eListbox::event(int event, void *data, void *data2) void eListbox::recalcSize() { - m_itemheight = 20; m_content->setSize(eSize(size().width(), m_itemheight)); m_items_per_page = size().height() / m_itemheight; } +void eListbox::setItemHeight(int h) +{ + if (h) + m_itemheight = h; + else + m_itemheight = 20; + recalcSize(); +} + void eListbox::entryAdded(int index) { /* manage our local pointers. when the entry was added before the current position, we have to advance. */ -- cgit v1.2.3