(svn r9126) -Feature: "Function of scrollwheel" can now be set to off as well
authorbjarni
Sun, 11 Mar 2007 21:53:46 +0000
changeset 6622 2ce7ffa9db00
parent 6621 13a96a07a0c0
child 6623 1115fe0767a9
(svn r9126) -Feature: "Function of scrollwheel" can now be set to off as well
Note: since this can be useful for all platforms, the GUI is no longer OSX specific.
Note: scrolling lists is still unaffected by this setting
src/lang/english.txt
src/settings.cpp
src/settings_gui.cpp
src/window.cpp
--- a/src/lang/english.txt	Sun Mar 11 21:39:20 2007 +0000
+++ b/src/lang/english.txt	Sun Mar 11 21:53:46 2007 +0000
@@ -1093,6 +1093,7 @@
 STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Function of scrollwheel: {ORANGE}{STRING1}
 STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Zoom map
 STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Scroll map
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Off
 STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Map scrollwheel speed: {ORANGE}{STRING1}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Max trains per player: {ORANGE}{STRING1}
--- a/src/settings.cpp	Sun Mar 11 21:39:20 2007 +0000
+++ b/src/settings.cpp	Sun Mar 11 21:53:46 2007 +0000
@@ -1283,7 +1283,7 @@
 	SDT_BOOL(Patches, link_terraform_toolbar,        S, 0, false,        STR_CONFIG_PATCHES_LINK_TERRAFORM_TOOLBAR,NULL),
 	 SDT_VAR(Patches, liveries,           SLE_UINT8, S,MS,  2, 0,  2, 0, STR_CONFIG_PATCHES_LIVERIES,              RedrawScreen),
 	SDT_BOOL(Patches, prefer_teamchat,               S, 0, false,        STR_CONFIG_PATCHES_PREFER_TEAMCHAT,       NULL),
-	SDT_VAR(Patches, scrollwheel_scrolling,SLE_UINT8,S,MS, 0,  0,  1, 0, STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING, NULL),
+	SDT_VAR(Patches, scrollwheel_scrolling,SLE_UINT8,S,MS, 0,  0,  2, 0, STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING, NULL),
 	SDT_VAR(Patches,scrollwheel_multiplier,SLE_UINT8,S, 0, 5,  1, 15, 1, STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER,NULL),
 
 	/***************************************************************************/
--- a/src/settings_gui.cpp	Sun Mar 11 21:39:20 2007 +0000
+++ b/src/settings_gui.cpp	Sun Mar 11 21:53:46 2007 +0000
@@ -576,13 +576,11 @@
 	"link_terraform_toolbar",
 	"liveries",
 	"prefer_teamchat",
-#if defined(__APPLE__)
 	/* While the horizontal scrollwheel scrolling is written as general code, only
 	 *  the cocoa (OSX) driver generates input for it.
-	 *  Until some other driver will read this input, we will hide the GUI to control this from other systems. */
+	 *  Since it's also able to completely disable the scrollwheel will we display it on all platforms anyway */
 	"scrollwheel_scrolling",
 	"scrollwheel_multiplier",
-#endif
 };
 
 static const char *_patches_construction[] = {
--- a/src/window.cpp	Sun Mar 11 21:39:20 2007 +0000
+++ b/src/window.cpp	Sun Mar 11 21:53:46 2007 +0000
@@ -1665,12 +1665,15 @@
 	if (vp != NULL && (_game_mode == GM_MENU || IsGeneratingWorld())) return;
 
 	if (mousewheel != 0) {
-		WindowEvent e;
+		if (_patches.scrollwheel_scrolling == 0) {
+			/* Scrollwheel is in zoom mode. Make the zoom event. */
+			WindowEvent e;
 
-		/* Send WE_MOUSEWHEEL event to window */
-		e.event = WE_MOUSEWHEEL;
-		e.we.wheel.wheel = mousewheel;
-		if (!scrollwheel_scrolling) w->wndproc(w, &e);
+			/* Send WE_MOUSEWHEEL event to window */
+			e.event = WE_MOUSEWHEEL;
+			e.we.wheel.wheel = mousewheel;
+			w->wndproc(w, &e);
+		}
 
 		/* Dispatch a MouseWheelEvent for widgets if it is not a viewport */
 		if (vp == NULL) DispatchMouseWheelEvent(w, GetWidgetFromPos(w, x - w->left, y - w->top), mousewheel);