From 83dc65144ec5b7d412f959afd2abb947580f7121 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Tue, 13 Dec 2005 15:27:32 +0000 Subject: [PATCH] add option cursorHome to eListbox::entryReset --- lib/gui/elistbox.cpp | 13 ++++++++----- lib/gui/elistbox.h | 2 +- lib/gui/elistboxcontent.cpp | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/gui/elistbox.cpp b/lib/gui/elistbox.cpp index ccd13ff4..013a3103 100644 --- a/lib/gui/elistbox.cpp +++ b/lib/gui/elistbox.cpp @@ -333,14 +333,17 @@ void eListbox::entryChanged(int index) } } -void eListbox::entryReset() +void eListbox::entryReset(bool cursorHome) { m_content_changed=true; m_prev_scrollbar_page=-1; - if (m_content) - m_content->cursorHome(); - m_top = 0; - m_selected = 0; + if ( cursorHome ) + { + if (m_content) + m_content->cursorHome(); + m_top = 0; + m_selected = 0; + } moveSelection(justCheck); invalidate(); } diff --git a/lib/gui/elistbox.h b/lib/gui/elistbox.h index 08f80035..0e185b44 100644 --- a/lib/gui/elistbox.h +++ b/lib/gui/elistbox.h @@ -97,7 +97,7 @@ public: /* entryChanged: the entry with the given index was changed and should be redrawn. */ void entryChanged(int index); /* the complete list changed. you should not attemp to keep the current index. */ - void entryReset(); + void entryReset(bool cursorHome=true); protected: int event(int event, void *data=0, void *data2=0); diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp index dea72a6c..95d92e09 100644 --- a/lib/gui/elistboxcontent.cpp +++ b/lib/gui/elistboxcontent.cpp @@ -246,7 +246,7 @@ void eListboxStringContent::setList(std::list &list) m_list = list; m_size = list.size(); cursorHome(); - m_listbox->entryReset(); + m_listbox->entryReset(false); } ////////////////////////////////////// @@ -368,7 +368,7 @@ void eListboxPythonStringContent::setList(PyObject *list) } if (m_listbox) - m_listbox->entryReset(); + m_listbox->entryReset(false); } PyObject *eListboxPythonStringContent::getCurrentSelection() -- 2.30.2