add support for scrolling the list with mouse wheel by given number of lines

This commit is contained in:
Andrzej Rybczak
2009-11-11 00:31:03 +01:00
parent c6e26e121f
commit 35a182d79e
6 changed files with 30 additions and 2 deletions

View File

@@ -239,13 +239,21 @@ template <typename WindowType> void Screen<WindowType>::Scroll(Where where, cons
template <typename WindowType> void Screen<WindowType>::MouseButtonPressed(MEVENT me)
{
List *list = Config.mouse_list_scroll_whole_page ? 0 : dynamic_cast<List *>(w);
if (me.bstate & BUTTON2_PRESSED)
{
Scroll(wPageDown);
if (list)
list->Highlight(list->Choice()+Config.lines_scrolled);
else
Scroll(wPageDown);
}
else if (me.bstate & BUTTON4_PRESSED)
{
Scroll(wPageUp);
if (list)
list->Highlight(list->Choice() > Config.lines_scrolled ? list->Choice()-Config.lines_scrolled : 0);
else
Scroll(wPageUp);
}
}