summaryrefslogtreecommitdiff
path: root/window.h
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-12-15 23:33:04 +0000
committerdarkvater <darkvater@openttd.org>2004-12-15 23:33:04 +0000
commit83981e40b594af221abf78eab41aa41182003b52 (patch)
tree74df7f1875fe162b316df2d10c6bb505e11cea71 /window.h
parentec94450aef385beb279e5b158389767611112f40 (diff)
downloadopenttd-83981e40b594af221abf78eab41aa41182003b52.tar.xz
(svn r1121) -Feature: Added sticky windows feature. A small pin allows the user to set the window as undeletable and can only be closed by hand. As an example the viewport window has been stickied (thanks to Neko-San)
-To use the feature add WDF_STICKY_BUTTON to the widget description and update all widget-ID's since sticky button will be widget 2.
Diffstat (limited to 'window.h')
-rw-r--r--window.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/window.h b/window.h
index 68a29fa73..4115d97dd 100644
--- a/window.h
+++ b/window.h
@@ -157,11 +157,12 @@ typedef struct WindowDesc {
} WindowDesc;
enum {
- WDF_STD_TOOLTIPS = 1, /* use standard routine when displaying tooltips */
- WDF_DEF_WIDGET = 2, /* default widget control for some widgets in the on click event */
- WDF_STD_BTN = 4, /* default handling for close and drag widgets (widget no 0 and 1) */
+ WDF_STD_TOOLTIPS = 1, /* use standard routine when displaying tooltips */
+ WDF_DEF_WIDGET = 2, /* default widget control for some widgets in the on click event */
+ WDF_STD_BTN = 4, /* default handling for close and drag widgets (widget no 0 and 1) */
WDF_RESTORE_DPARAM = 8, /* when drawing widgets, restore the dparam so all widgets recieve the same set of them */
WDF_UNCLICK_BUTTONS=16, /* Unclick buttons when the window event times out */
+ WDF_STICKY_BUTTON =32, /* Set window to sticky mode; they are not closed unless closed with 'X' (widget 2) */
};
/* can be used as x or y coordinates to cause a specific placement */
@@ -356,7 +357,8 @@ enum WindowWidgetTypes {
WWT_CAPTION = 10,
WWT_HSCROLLBAR = 11,
- WWT_LAST = 12, /* Last Item. use WIDGETS_END to fill up padding!! */
+ WWT_STICKYBOX = 12,
+ WWT_LAST = 13, /* Last Item. use WIDGETS_END to fill up padding!! */
WWT_MASK = 31,
@@ -376,7 +378,8 @@ enum WindowFlags {
WF_SCROLL_MIDDLE = 1 << 6,
WF_HSCROLL = 1 << 7,
WF_SIZING = 1 << 8,
-
+ WF_STICKY = 1 << 9,
+
WF_DISABLE_VP_SCROLL = 1 << 10,
WF_WHITE_BORDER_ONE = 1 << 11,
@@ -458,7 +461,7 @@ Window *GetCallbackWnd();
void DeleteNonVitalWindows();
/* window.c */
-VARDEF Window _windows[20];
+VARDEF Window _windows[25];
VARDEF Window *_last_window;
VARDEF Point _cursorpos_drag_start;