/* now, look wether the current selection is out of screen */
m_selected = m_content->cursorGet();
-
- if (m_selected < m_top)
+
+ while (m_selected < m_top)
{
m_top -= m_items_per_page;
if (m_top < 0)
m_top = 0;
- } else if (m_selected >= m_top + m_items_per_page)
- {
- /* m_top should be always valid here as it's selected */
- m_top += m_items_per_page;
}
+ while (m_selected >= m_top + m_items_per_page)
+ /* m_top should be always valid here as it's selected */
+ m_top += m_items_per_page;
if (m_top != oldtop)
invalidate();
void eListbox::moveSelectionTo(int index)
{
printf("Moving to listbox-entry with index %d\n", index);
- // TODO: implement it
+ m_content->cursorHome();
+ m_content->cursorMove(index);
+ moveSelection(justCheck);
}
int eListbox::event(int event, void *data, void *data2)