add needed functions
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 19 Dec 2005 12:13:16 +0000 (12:13 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 19 Dec 2005 12:13:16 +0000 (12:13 +0000)
lib/gui/elistbox.cpp
lib/gui/elistbox.h

index 21394de..bfa09b8 100644 (file)
@@ -159,9 +159,19 @@ void eListbox::moveSelection(int dir)
 
 void eListbox::moveSelectionTo(int index)
 {
-       m_content->cursorHome();
-       m_content->cursorMove(index);
-       moveSelection(justCheck);
+       if ( m_content )
+       {
+               m_content->cursorHome();
+               m_content->cursorMove(index);
+               moveSelection(justCheck);
+       }
+}
+
+int eListbox::getCurrentIndex()
+{
+       if ( m_content && m_content->cursorValid() )
+               return m_content->cursorGet();
+       return 0;
 }
 
 void eListbox::updateScrollBar()
index 0e185b4..719b54b 100644 (file)
@@ -72,7 +72,8 @@ public:
                moveEnd,
                justCheck
        }; */
-       
+
+       int getCurrentIndex();
        void moveSelection(int how);
        void moveSelectionTo(int index);