equal
deleted
inserted
replaced
243 uint height; ///< Minimum allowed height of the window |
243 uint height; ///< Minimum allowed height of the window |
244 uint step_width; ///< Step-size of width resize changes |
244 uint step_width; ///< Step-size of width resize changes |
245 uint step_height; ///< Step-size of height resize changes |
245 uint step_height; ///< Step-size of height resize changes |
246 }; |
246 }; |
247 |
247 |
|
248 enum SortButtonState { |
|
249 SBS_OFF, |
|
250 SBS_DOWN, |
|
251 SBS_UP, |
|
252 }; |
|
253 |
248 /** |
254 /** |
249 * Data structure for a window viewport |
255 * Data structure for a window viewport |
250 */ |
256 */ |
251 struct ViewportData : ViewPort { |
257 struct ViewportData : ViewPort { |
252 VehicleID follow_vehicle; |
258 VehicleID follow_vehicle; |
320 void CDECL SetWidgetsDisabledState(bool disab_stat, int widgets, ...); |
326 void CDECL SetWidgetsDisabledState(bool disab_stat, int widgets, ...); |
321 void CDECL SetWidgetsHiddenState(bool hidden_stat, int widgets, ...); |
327 void CDECL SetWidgetsHiddenState(bool hidden_stat, int widgets, ...); |
322 void CDECL SetWidgetsLoweredState(bool lowered_stat, int widgets, ...); |
328 void CDECL SetWidgetsLoweredState(bool lowered_stat, int widgets, ...); |
323 void InvalidateWidget(byte widget_index) const; |
329 void InvalidateWidget(byte widget_index) const; |
324 |
330 |
|
331 void DrawWidgets() const; |
|
332 void DrawViewport() const; |
|
333 void DrawSortButtonState(int widget, SortButtonState state) const; |
|
334 |
325 void SetDirty() const; |
335 void SetDirty() const; |
326 |
336 |
327 /*** Event handling ***/ |
337 /*** Event handling ***/ |
328 |
338 |
329 /** |
339 /** |
610 { |
620 { |
611 if (BringWindowToFrontById(desc->cls, window_number)) return NULL; |
621 if (BringWindowToFrontById(desc->cls, window_number)) return NULL; |
612 return new Wcls(desc, window_number); |
622 return new Wcls(desc, window_number); |
613 } |
623 } |
614 |
624 |
615 void DrawWindowViewport(const Window *w); |
|
616 |
|
617 void RelocateAllWindows(int neww, int newh); |
625 void RelocateAllWindows(int neww, int newh); |
618 |
626 |
619 /* misc_gui.cpp */ |
627 /* misc_gui.cpp */ |
620 void GuiShowTooltipsWithArgs(StringID str, uint paramcount, const uint64 params[]); |
628 void GuiShowTooltipsWithArgs(StringID str, uint paramcount, const uint64 params[]); |
621 static inline void GuiShowTooltips(StringID str) |
629 static inline void GuiShowTooltips(StringID str) |
623 GuiShowTooltipsWithArgs(str, 0, NULL); |
631 GuiShowTooltipsWithArgs(str, 0, NULL); |
624 } |
632 } |
625 |
633 |
626 /* widget.cpp */ |
634 /* widget.cpp */ |
627 int GetWidgetFromPos(const Window *w, int x, int y); |
635 int GetWidgetFromPos(const Window *w, int x, int y); |
628 void DrawWindowWidgets(const Window *w); |
|
629 |
|
630 enum SortButtonState { |
|
631 SBS_OFF, |
|
632 SBS_DOWN, |
|
633 SBS_UP, |
|
634 }; |
|
635 |
|
636 void DrawSortButtonState(const Window *w, int widget, SortButtonState state); |
|
637 |
|
638 |
|
639 |
636 |
640 /* window.cpp */ |
637 /* window.cpp */ |
641 extern Window *_z_windows[]; |
638 extern Window *_z_windows[]; |
642 extern Window **_last_z_window; |
639 extern Window **_last_z_window; |
643 #define FOR_ALL_WINDOWS(wz) for (wz = _z_windows; wz != _last_z_window; wz++) |
640 #define FOR_ALL_WINDOWS(wz) for (wz = _z_windows; wz != _last_z_window; wz++) |