diff options
author | Paul Gilbert | 2007-12-29 00:31:15 +0000 |
---|---|---|
committer | Paul Gilbert | 2007-12-29 00:31:15 +0000 |
commit | 52dc147f8c950007e8b49c0e130e256ef5520af8 (patch) | |
tree | 918c8ceeb3668509bb4bf9bbc3aa685a44d5281f /engines/lure | |
parent | 16b610068db2a67e5ce0b156df87e0a4df23373b (diff) | |
download | scummvm-rg350-52dc147f8c950007e8b49c0e130e256ef5520af8.tar.gz scummvm-rg350-52dc147f8c950007e8b49c0e130e256ef5520af8.tar.bz2 scummvm-rg350-52dc147f8c950007e8b49c0e130e256ef5520af8.zip |
Added mouse scrolling support to action menus and the save/restore dialog
svn-id: r30065
Diffstat (limited to 'engines/lure')
-rw-r--r-- | engines/lure/menu.cpp | 15 | ||||
-rw-r--r-- | engines/lure/surface.cpp | 30 |
2 files changed, 34 insertions, 11 deletions
diff --git a/engines/lure/menu.cpp b/engines/lure/menu.cpp index 41e505bf5d..2699d4847d 100644 --- a/engines/lure/menu.cpp +++ b/engines/lure/menu.cpp @@ -527,9 +527,20 @@ uint16 PopupMenu::Show(int numEntries, const char *actions[]) { if (e.quitFlag) { selectedIndex = 0xffff; goto bail_out; - } - else if (e.type() == Common::EVENT_KEYDOWN) { + } else if (e.type() == Common::EVENT_WHEELUP) { + // Scroll upwards + if (selectedIndex > 0) { + --selectedIndex; + refreshFlag = true; + } + } else if (e.type() == Common::EVENT_WHEELDOWN) { + // Scroll downwards + if (selectedIndex < numEntries - 1) { + ++selectedIndex; + refreshFlag = true; + } + } else if (e.type() == Common::EVENT_KEYDOWN) { uint16 keycode = e.event().kbd.keycode; if (((keycode == Common::KEYCODE_KP8) || (keycode == Common::KEYCODE_UP)) && (selectedIndex > 0)) { diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp index ac5716f676..10526f8469 100644 --- a/engines/lure/surface.cpp +++ b/engines/lure/surface.cpp @@ -895,17 +895,29 @@ bool SaveRestoreDialog::show(bool saveDialog) { abortFlag = true; break; } - if (events.type() == Common::EVENT_MOUSEMOVE) { + if (events.type() == Common::EVENT_MOUSEMOVE || + events.type() == Common::EVENT_WHEELUP || events.type() == Common::EVENT_WHEELDOWN) { // Mouse movement int lineNum; - if ((mouse.x() < (SAVE_DIALOG_X + DIALOG_EDGE_SIZE)) || - (mouse.x() >= (SAVE_DIALOG_X + s->width() - DIALOG_EDGE_SIZE)) || - (mouse.y() < SAVE_DIALOG_Y + SR_SAVEGAME_NAMES_Y) || - (mouse.y() >= SAVE_DIALOG_Y + SR_SAVEGAME_NAMES_Y + numSaves * FONT_HEIGHT)) - // Outside displayed lines - lineNum = -1; - else - lineNum = (mouse.y() - (SAVE_DIALOG_Y + SR_SAVEGAME_NAMES_Y)) / FONT_HEIGHT; + + if (events.type() == Common::EVENT_MOUSEMOVE) { + if ((mouse.x() < (SAVE_DIALOG_X + DIALOG_EDGE_SIZE)) || + (mouse.x() >= (SAVE_DIALOG_X + s->width() - DIALOG_EDGE_SIZE)) || + (mouse.y() < SAVE_DIALOG_Y + SR_SAVEGAME_NAMES_Y) || + (mouse.y() >= SAVE_DIALOG_Y + SR_SAVEGAME_NAMES_Y + numSaves * FONT_HEIGHT)) + // Outside displayed lines + lineNum = -1; + else + lineNum = (mouse.y() - (SAVE_DIALOG_Y + SR_SAVEGAME_NAMES_Y)) / FONT_HEIGHT; + } else if (events.type() == Common::EVENT_WHEELUP) { + if (selectedLine > 0) { + lineNum = selectedLine - 1; + } + } else if (events.type() == Common::EVENT_WHEELDOWN) { + if (selectedLine < numSaves - 1) { + lineNum = selectedLine + 1; + } + } if (lineNum != selectedLine) { if (selectedLine != -1) |