/* $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, ...)
SetWindowWidgetHiddenState(w, widgets, hidden_stat);
void CDECL SetWindowWidgetsLoweredState(Window *w, bool lowered_stat, int widgets, ...)
SetWindowWidgetLoweredState(w, widgets, lowered_stat);
void RaiseWindowButtons(Window *w)
const Widget *wi = w->widget;
@@ -62,6 +62,11 @@ enum ResizeFlags {
WIDG_LOWERED = 6, // widget is paint lowered, a pressed button in fact
} ResizeFlag;
/* used to indicate the end of widgets' list for vararg functions */
enum {
WIDGET_LIST_END = -1,
};
typedef struct Widget {
byte type; ///< Widget type, see @WindowWidgetTypes
byte display_flags; ///< Resize direction, alignment, etc. during resizing, see @ResizeFlags
@@ -783,6 +788,9 @@ void InvalidateWindowData(WindowClass cl
void RaiseWindowButtons(Window *w);
void RelocateAllWindows(int neww, int newh);
int PositionMainToolbar(Window *w);
void CDECL SetWindowWidgetsDisabledState(Window *w, bool disab_stat, int widgets, ...);
void CDECL SetWindowWidgetsHiddenState(Window *w, bool hidden_stat, int widgets, ...);
void CDECL SetWindowWidgetsLoweredState(Window *w, bool lowered_stat, int widgets, ...);
/* misc_gui.c*/
void GuiShowTooltips(StringID string_id);
Status change: