diff options
author | glx <glx@openttd.org> | 2006-10-06 21:10:14 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2006-10-06 21:10:14 +0000 |
commit | 30e0a8e9522a3ea43fa501cd387ccf8cf962461b (patch) | |
tree | 94b2f19d11771e2c48d38b3bfaed3bc9b878b1e2 /window.c | |
parent | 592ed98a196841d51ce864e6b585bbb73572f689 (diff) | |
download | openttd-30e0a8e9522a3ea43fa501cd387ccf8cf962461b.tar.xz |
(svn r6669) -Add: vararg functions to set hidden/disabled/lowered state of multiple widgets in one call
Diffstat (limited to 'window.c')
-rw-r--r-- | window.c | 43 |
1 files changed, 43 insertions, 0 deletions
@@ -1,6 +1,7 @@ /* $Id$ */ #include "stdafx.h" +#include <stdarg.h> #include "openttd.h" #include "debug.h" #include "functions.h" @@ -17,6 +18,48 @@ // delta between mouse cursor and upper left corner of dragged window static Point _drag_delta; +void CDECL SetWindowWidgetsDisabledState(Window *w, bool disab_stat, int widgets, ...) +{ + va_list wdg_list; + + va_start(wdg_list, widgets); + + while (widgets != WIDGET_LIST_END) { + SetWindowWidgetHiddenState(w, widgets, disab_stat); + widgets = va_arg(wdg_list, int); + } + + va_end(wdg_list); +} + +void CDECL SetWindowWidgetsHiddenState(Window *w, bool hidden_stat, int widgets, ...) +{ + va_list wdg_list; + + va_start(wdg_list, widgets); + + while (widgets != WIDGET_LIST_END) { + SetWindowWidgetHiddenState(w, widgets, hidden_stat); + widgets = va_arg(wdg_list, int); + } + + va_end(wdg_list); +} + +void CDECL SetWindowWidgetsLoweredState(Window *w, bool lowered_stat, int widgets, ...) +{ + va_list wdg_list; + + va_start(wdg_list, widgets); + + while (widgets != WIDGET_LIST_END) { + SetWindowWidgetLoweredState(w, widgets, lowered_stat); + widgets = va_arg(wdg_list, int); + } + + va_end(wdg_list); +} + void RaiseWindowButtons(Window *w) { const Widget *wi = w->widget; |