summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-12-20 20:04:30 +0000
committeralberth <alberth@openttd.org>2009-12-20 20:04:30 +0000
commit20debea202d87ce595b2ebc353d22204e9820efc (patch)
tree5105a9070caf4c926bda0addd23062f3084c719b
parentcf2349ae10c57b6b4b171eeeca11382d1d8afa4b (diff)
downloadopenttd-20debea202d87ce595b2ebc353d22204e9820efc.tar.xz
(svn r18579) -Codechange: Add orientation to scrollbars.
-rw-r--r--src/window.cpp2
-rw-r--r--src/window_gui.h12
2 files changed, 10 insertions, 4 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 5e9d22e1b..48f934f7b 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1190,7 +1190,7 @@ void Window::InitNested(const WindowDesc *desc, WindowNumber window_number)
}
/** 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)
{
}
diff --git a/src/window_gui.h b/src/window_gui.h
index 2f5b44d06..3cc9f45ea 100644
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -170,10 +170,16 @@ enum WindowDefaultFlag {
*/
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