summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2007-03-11 21:53:46 +0000
committerbjarni <bjarni@openttd.org>2007-03-11 21:53:46 +0000
commit4cc3551ef2f9598a2267bd53cf65f672d4d77da3 (patch)
tree3b2dc7daa60eae1b6aa8a2e76b14a3f46e6f3348
parent3cf65b8a08c51aca91e2d19de8dc625874a58cf1 (diff)
downloadopenttd-4cc3551ef2f9598a2267bd53cf65f672d4d77da3.tar.xz
(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
-rw-r--r--src/lang/english.txt1
-rw-r--r--src/settings.cpp2
-rw-r--r--src/settings_gui.cpp4
-rw-r--r--src/window.cpp13
4 files changed, 11 insertions, 9 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt
index 0fec535fb..e4961c8cf 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -1093,6 +1093,7 @@ STR_CONFIG_PATCHES_PREFER_TEAMCHAT :{LTBLUE}Prefer
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}
diff --git a/src/settings.cpp b/src/settings.cpp
index 4738cd915..08bbedf3d 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -1283,7 +1283,7 @@ const SettingDesc _patch_settings[] = {
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),
/***************************************************************************/
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index b8759c441..a536ad396 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -576,13 +576,11 @@ static const char *_patches_ui[] = {
"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[] = {
diff --git a/src/window.cpp b/src/window.cpp
index 15062ad4b..d38abb4e2 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1665,12 +1665,15 @@ void MouseLoop(int click, int mousewheel)
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);