changeset 14036:3bed2b357ff4 draft

(svn r18579) -Codechange: Add orientation to scrollbars.
author alberth <alberth@openttd.org>
date Sun, 20 Dec 2009 20:04:30 +0000
parents 1017887e1560
children ca29deba0f1a
files src/window.cpp src/window_gui.h
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1190,7 +1190,7 @@
 }
 
 /** Empty constructor, initialization has been moved to #InitNested() called from the constructor of the derived class. */
-Window::Window()
+Window::Window() : hscroll(false), vscroll(true), vscroll2(true)
 {
 }
 
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -170,10 +170,16 @@
  */
 class Scrollbar {
 private:
-	uint16 count;  ///< Number of elements in the list
-	uint16 cap;    ///< Number of visible elements of the scroll bar
-	uint16 pos;    ///< Index of first visible item of the list
+	const bool is_vertical; ///< Scrollbar has vertical orientation.
+	uint16 count;           ///< Number of elements in the list.
+	uint16 cap;             ///< Number of visible elements of the scroll bar.
+	uint16 pos;             ///< Index of first visible item of the list.
+
 public:
+	Scrollbar(bool is_vertical) : is_vertical(is_vertical)
+	{
+	}
+
 	/**
 	 * Gets the number of elements in the list
 	 * @return the number of elements