summaryrefslogtreecommitdiff
path: root/src/window_gui.h
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-12-21 16:06:20 +0000
committeralberth <alberth@openttd.org>2009-12-21 16:06:20 +0000
commitca66652005babd3a45717e00ab89f3653098122a (patch)
treecc797ff9856637b5969a826e33523ee937ea4dea /src/window_gui.h
parentc03aadda08b2a1626aba0a3cd50595df0a368f46 (diff)
downloadopenttd-ca66652005babd3a45717e00ab89f3653098122a.tar.xz
(svn r18583) -Codechange: Add WWT_SHADEBOX widget and its functions (heavily based on code by erikjanp).
Diffstat (limited to 'src/window_gui.h')
-rw-r--r--src/window_gui.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/window_gui.h b/src/window_gui.h
index 967340033..d8d56c923 100644
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -74,6 +74,13 @@ enum WidgetDrawDistances {
WD_MATRIX_TOP = 3, ///< Offset at top of a matrix cell.
WD_MATRIX_BOTTOM = 1, ///< Offset at bottom of a matrix cell.
+ /* WWT_SHADEBOX */
+ WD_SHADEBOX_WIDTH = 12, ///< Width of a standard shade box widget.
+ WD_SHADEBOX_LEFT = 2, ///< Left offset of shade sprite.
+ WD_SHADEBOX_RIGHT = 2, ///< Right offset of shade sprite.
+ WD_SHADEBOX_TOP = 3, ///< Top offset of shade sprite.
+ WD_SHADEBOX_BOTTOM = 3, ///< Bottom offset of shade sprite.
+
/* WWT_STICKYBOX */
WD_STICKYBOX_WIDTH = 12, ///< Width of a standard sticky box widget.
WD_STICKYBOX_LEFT = 2, ///< Left offset of sticky sprite.
@@ -381,6 +388,8 @@ public:
NWidgetBase *nested_root; ///< Root of the nested tree.
NWidgetBase **nested_array; ///< Array of pointers into the tree. Do not access directly, use #Window::GetWidget() instead.
uint nested_array_size; ///< Size of the nested array.
+ NWidgetStacked *shade_select; ///< Selection widget (#NWID_SELECTION) to use for shading the window. If \c NULL, window cannot shade.
+ Dimension unshaded_size; ///< Last known unshaded size (only valid while shaded).
Window *parent; ///< Parent window.
Window *z_front; ///< The window in front of us in z-order.
@@ -528,6 +537,14 @@ public:
void SetDirty() const;
void ReInit(int rx = 0, int ry = 0);
+ /** Is window shaded currently? */
+ inline bool IsShaded() const
+ {
+ return this->shade_select != NULL && this->shade_select->shown_plane == STACKED_SELECTION_ZERO_SIZE;
+ }
+
+ void SetShaded(bool make_shaded);
+
/**
* Mark this window's data as invalid (in need of re-computing)
* @param data The data to invalidate with