i have implemented keyboard item scroll like this
Code: Select all
const CEGUI::KeyEventArgs& key = static_cast<const CEGUI::KeyEventArgs&>(arg);
if (key.scancode == CEGUI::Key::ArrowUp)
{
CEGUI::ListboxItem *selecteditem = bag->getFirstSelectedItem();
if(selecteditem == NULL)
return false;
CEGUI::MCLGridRef grid = bag->getItemGridReference(selecteditem);
if(grid.row == 0)
return false;
bag->setItemSelectState(grid, false);
grid.row--;
bag->setItemSelectState(grid, true);
return true;
}
my question is
how can i auto scroll list so that when selected item becomes invisible list scroll automatically?
is there a way to make the list to always show selected item ?