add needed functions
[enigma2.git] / lib / gui / elistbox.cpp
index 21394de5ac4f827d26efe9ffa6f069aad9630cc0..bfa09b88844a649a5147226c92b529b0fd5b5376 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()