add option cursorHome to eListbox::entryReset
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 13 Dec 2005 15:27:32 +0000 (15:27 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 13 Dec 2005 15:27:32 +0000 (15:27 +0000)
lib/gui/elistbox.cpp
lib/gui/elistbox.h
lib/gui/elistboxcontent.cpp

index ccd13ff4f51ad628b69b136971159632be2b8059..013a31036eb618d5835187368666094415be4c1c 100644 (file)
@@ -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();
 }
index 08f8003527f3ce5e515165549d13cfed84960fd4..0e185b44b8e28f08ab3608c658c75799e94b44b5 100644 (file)
@@ -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);
index dea72a6c98bc9721a79623caacbd6a4bf0ce6c1d..95d92e09c74172b184fdbff1764e7e7844144ba7 100644 (file)
@@ -246,7 +246,7 @@ void eListboxStringContent::setList(std::list<std::string> &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()