void List::button_press(int x, int y, unsigned btn)
{
- Container::button_press(x, y, btn);
- if(click_focus && btn==1)
+ if(btn==4 || btn==5)
{
- for(unsigned i=first; (i<items.size() && items[i]->is_visible()); ++i)
- if(click_focus==items[i])
- {
- set_selected_index(i);
- break;
- }
+ unsigned change = 3;
+ if(btn==4)
+ {
+ change = min(first, change);
+ slider.set_value(max_scroll-(first-change));
+ }
+ else if(btn==5)
+ {
+ change = min(max_scroll-first, change);
+ slider.set_value(max_scroll-(first+change));
+ }
+ }
+ else
+ {
+ Container::button_press(x, y, btn);
+ if(click_focus && btn==1)
+ {
+ for(unsigned i=first; (i<items.size() && items[i]->is_visible()); ++i)
+ if(click_focus==items[i])
+ {
+ set_selected_index(i);
+ break;
+ }
+ }
}
}