[Scummvm-cvs-logs] SF.net SVN: scummvm: [30065] scummvm/trunk/engines/lure
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Sat Dec 29 01:31:15 CET 2007
Revision: 30065
http://scummvm.svn.sourceforge.net/scummvm/?rev=30065&view=rev
Author: dreammaster
Date: 2007-12-28 16:31:15 -0800 (Fri, 28 Dec 2007)
Log Message:
-----------
Added mouse scrolling support to action menus and the save/restore dialog
Modified Paths:
--------------
scummvm/trunk/engines/lure/menu.cpp
scummvm/trunk/engines/lure/surface.cpp
Modified: scummvm/trunk/engines/lure/menu.cpp
===================================================================
--- scummvm/trunk/engines/lure/menu.cpp 2007-12-28 23:03:26 UTC (rev 30064)
+++ scummvm/trunk/engines/lure/menu.cpp 2007-12-29 00:31:15 UTC (rev 30065)
@@ -527,9 +527,20 @@
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)) {
Modified: scummvm/trunk/engines/lure/surface.cpp
===================================================================
--- scummvm/trunk/engines/lure/surface.cpp 2007-12-28 23:03:26 UTC (rev 30064)
+++ scummvm/trunk/engines/lure/surface.cpp 2007-12-29 00:31:15 UTC (rev 30065)
@@ -895,18 +895,30 @@
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)
// Deselect previously selected line
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list