(svn r6669) -Add: vararg functions to set hidden/disabled/lowered state of multiple widgets in one call

This commit is contained in:
glx
2006-10-06 21:10:14 +00:00
parent 3d821bb328
commit 8f5c6ff3a1
2 changed files with 51 additions and 0 deletions

View File

@@ -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;