(svn r13322) -Codechange: _no_scroll belongs more with the window code.
authorrubidium
Thu, 29 May 2008 11:13:11 +0000
changeset 10772 24d449dd2907
parent 10771 6c7035d85faf
child 10773 88125a991761
(svn r13322) -Codechange: _no_scroll belongs more with the window code.
src/openttd.cpp
src/openttd.h
src/window.cpp
src/window_gui.h
--- a/src/openttd.cpp	Thu May 29 10:16:59 2008 +0000
+++ b/src/openttd.cpp	Thu May 29 11:13:11 2008 +0000
@@ -347,7 +347,6 @@
 	if (_music_driver->IsSongPlaying()) ResetMusic();
 }
 
-byte _no_scroll;
 byte _savegame_sort_order;
 #if defined(UNIX) && !defined(__MORPHOS__)
 extern void DedicatedFork();
--- a/src/openttd.h	Thu May 29 10:16:59 2008 +0000
+++ b/src/openttd.h	Thu May 29 11:13:11 2008 +0000
@@ -39,17 +39,6 @@
 	DO_WAYPOINTS          = 6,
 };
 
-/* In certain windows you navigate with the arrow keys. Do not scroll the
- * gameview when here. Bitencoded variable that only allows scrolling if all
- * elements are zero */
-enum {
-	SCROLL_CON  = 0,
-	SCROLL_EDIT = 1,
-	SCROLL_SAVE = 2,
-	SCROLL_CHAT = 4,
-};
-extern byte _no_scroll;
-
 extern byte _game_mode;
 extern bool _exit_game;
 extern int8 _pause_game;
--- a/src/window.cpp	Thu May 29 10:16:59 2008 +0000
+++ b/src/window.cpp	Thu May 29 11:13:11 2008 +0000
@@ -37,6 +37,7 @@
 Window *_z_windows[MAX_NUMBER_OF_WINDOWS];
 Window **_last_z_window; ///< always points to the next free space in the z-array
 
+byte _no_scroll;
 Point _cursorpos_drag_start;
 
 int _scrollbar_start_pos;
--- a/src/window_gui.h	Thu May 29 10:16:59 2008 +0000
+++ b/src/window_gui.h	Thu May 29 11:13:11 2008 +0000
@@ -536,6 +536,21 @@
 extern Window **_last_z_window;
 #define FOR_ALL_WINDOWS(wz) for (wz = _z_windows; wz != _last_z_window; wz++)
 
+/**
+ * In certain windows you navigate with the arrow keys. Do not scroll the
+ * gameview when here. Bitencoded variable that only allows scrolling if all
+ * elements are zero
+ */
+enum {
+	SCROLL_CON  = 0,
+	SCROLL_EDIT = 1,
+	SCROLL_SAVE = 2,
+	SCROLL_CHAT = 4,
+};
+
+/** Disable scrolling of the main viewport when an input-window is active. */
+extern byte _no_scroll;
+
 extern Point _cursorpos_drag_start;
 
 extern int _scrollbar_start_pos;