Follow-up Comment #2, task #4950 (project wormux):
work in progress.
void WidgetList::SetFocusOnNextWidget()
{
printf("Widget = %d\n", (int)current_selected);
// No widget => exit
if(widget_list.size() == 0) {
current_selected = NULL;
return;
}
// Previous selection ?
if(current_selected != NULL)
current_selected->Unselect();
else {
printf("First selection\n");
current_selected = (*widget_list.begin());
current_selected->Select();
return;
}
// Setting previous to NULL and find next widget
std::list<Widget*>::iterator w = widget_list.begin();
for(; w != widget_list.end(); w++) {
printf("one iteration\n");
if(current_selected == (*w))
break;
}
printf("skip one\n");
w++;
// The next widget is not the end ?
if(w != widget_list.end()) {
printf("selection of next\n");
current_selected = (*w);
} else {
printf("selection of first one\n");
current_selected = (*widget_list.begin());
}
current_selected->Select();
}
_______________________________________________________
Reply to this item at:
<http://gna.org/task/?4950>
_______________________________________________
Message posté via/par Gna!
http://gna.org/
_______________________________________________
Wormux-gna mailing list
[email protected]
https://mail.gna.org/listinfo/wormux-gna