summaryrefslogtreecommitdiff
path: root/src/window_gui.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-28 14:42:35 +0000
committerrubidium <rubidium@openttd.org>2009-11-28 14:42:35 +0000
commit293dfd7c3e754b846b745d80fa4ca6795b9f7ed0 (patch)
tree4fc72c84fc5875eb2719f9a9cbf4d9a458fb2f12 /src/window_gui.h
parentb58b058e2b254cb375ebc2ec67c1ac307e6aeb87 (diff)
downloadopenttd-293dfd7c3e754b846b745d80fa4ca6795b9f7ed0.tar.xz
(svn r18322) -Codechange: remove the WDP duplication; no need to tell the same twice.
Diffstat (limited to 'src/window_gui.h')
-rw-r--r--src/window_gui.h28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/window_gui.h b/src/window_gui.h
index 0495bcd8f..65019d296 100644
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -123,19 +123,29 @@ extern Window *_z_front_window;
extern Window *_z_back_window;
extern Window *_focused_window;
+
+/** How do we the window to be placed? */
+enum WindowPosition {
+ WDP_MANUAL, ///< Manually align the window (so no automatic location finding)
+ WDP_AUTO, ///< Find a place automatically
+ WDP_CENTER, ///< Center the window
+ WDP_ALIGN_TOOLBAR, ///< Align toward the toolbar
+};
+
+Point GetToolbarAlignedWindowPosition(int window_width);
+
/**
* High level window description
*/
struct WindowDesc : ZeroedMemoryAllocator {
- WindowDesc(int16 left, int16 top, int16 def_width, int16 def_height,
+ WindowDesc(WindowPosition default_pos, int16 def_width, int16 def_height,
WindowClass window_class, WindowClass parent_class, uint32 flags,
const NWidgetPart *nwid_parts = NULL, int16 nwid_length = 0);
~WindowDesc();
- int16 left; ///< Prefered x position of left edge of the window. @see WindowDefaultPosition()
- int16 top; ///< Prefered y position of the top of the window. @see WindowDefaultPosition()
+ WindowPosition default_pos; ///< Prefered position of the window. @see WindowPosition()
int16 default_width; ///< Prefered initial width of the window.
int16 default_height; ///< Prefered initial height of the window.
WindowClass cls; ///< Class of the window, @see WindowClass.
@@ -156,18 +166,6 @@ enum WindowDefaultFlag {
};
/**
- * Special values for 'left' and 'top' to cause a specific placement
- */
-enum WindowDefaultPosition {
- WDP_MANUAL, ///< Manually align the window (so no automatic location finding)
- WDP_AUTO = -1, ///< Find a place automatically
- WDP_CENTER = -2, ///< Center the window (left/right or top/bottom)
- WDP_ALIGN_TOOLBAR = -3, ///< Align to the main toolbar
-};
-
-Point GetToolbarAlignedWindowPosition(int window_width);
-
-/**
* Scrollbar data structure
*/
class Scrollbar {