OpenTTD

window_gui.h
Go to the documentation of this file.
1 /* $Id: window_gui.h 27147 2015-02-13 21:25:48Z frosch $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 */
9
12 #ifndef WINDOW_GUI_H
13 #define WINDOW_GUI_H
14
15 #include "vehicle_type.h"
16 #include "viewport_type.h"
17 #include "company_type.h"
18 #include "tile_type.h"
19 #include "widget_type.h"
20 #include "core/smallvec_type.hpp"
21 #include "core/smallmap_type.hpp"
22 #include "string_type.h"
23
27 enum FrameFlags {
28 FR_NONE = 0,
29 FR_TRANSPARENT = 1 << 0,
30 FR_BORDERONLY = 1 << 4,
31 FR_LOWERED = 1 << 5,
32 FR_DARKENED = 1 << 6,
33 };
34
35 DECLARE_ENUM_AS_BIT_SET(FrameFlags)
36
37
38 enum WidgetDrawDistances {
39 /* WWT_IMGBTN(_2) */
40 WD_IMGBTN_LEFT = 1,
41 WD_IMGBTN_RIGHT = 2,
42 WD_IMGBTN_TOP = 1,
43 WD_IMGBTN_BOTTOM = 2,
44
45 /* WWT_INSET */
46 WD_INSET_LEFT = 2,
47 WD_INSET_RIGHT = 2,
48 WD_INSET_TOP = 1,
49
50 WD_SCROLLBAR_LEFT = 2,
51 WD_SCROLLBAR_RIGHT = 2,
52 WD_SCROLLBAR_TOP = 2,
53 WD_SCROLLBAR_BOTTOM = 2,
54
55 /* Size of the pure frame bevel without any padding. */
56 WD_BEVEL_LEFT = 1,
57 WD_BEVEL_RIGHT = 1,
58 WD_BEVEL_TOP = 1,
59 WD_BEVEL_BOTTOM = 1,
60
61 /* FrameRect widgets, all text buttons, panel, editbox */
62 WD_FRAMERECT_LEFT = 2,
63 WD_FRAMERECT_RIGHT = 2,
64 WD_FRAMERECT_TOP = 1,
65 WD_FRAMERECT_BOTTOM = 1,
66
67 /* Extra space at top/bottom of text panels */
68 WD_TEXTPANEL_TOP = 6,
69 WD_TEXTPANEL_BOTTOM = 6,
70
71 /* WWT_FRAME */
72 WD_FRAMETEXT_LEFT = 6,
73 WD_FRAMETEXT_RIGHT = 6,
74 WD_FRAMETEXT_TOP = 6,
75 WD_FRAMETEXT_BOTTOM = 6,
76
77 /* WWT_MATRIX */
78 WD_MATRIX_LEFT = 2,
79 WD_MATRIX_RIGHT = 2,
80 WD_MATRIX_TOP = 3,
81 WD_MATRIX_BOTTOM = 1,
82
83 /* WWT_SHADEBOX */
84 WD_SHADEBOX_WIDTH = 12,
85 WD_SHADEBOX_LEFT = 2,
86 WD_SHADEBOX_RIGHT = 2,
87 WD_SHADEBOX_TOP = 3,
88 WD_SHADEBOX_BOTTOM = 3,
89
90 /* WWT_STICKYBOX */
91 WD_STICKYBOX_WIDTH = 12,
92 WD_STICKYBOX_LEFT = 2,
93 WD_STICKYBOX_RIGHT = 2,
94 WD_STICKYBOX_TOP = 3,
95 WD_STICKYBOX_BOTTOM = 3,
96
97 /* WWT_DEBUGBOX */
98 WD_DEBUGBOX_WIDTH = 12,
99 WD_DEBUGBOX_LEFT = 2,
100 WD_DEBUGBOX_RIGHT = 2,
101 WD_DEBUGBOX_TOP = 3,
102 WD_DEBUGBOX_BOTTOM = 3,
103
104 /* WWT_DEFSIZEBOX */
105 WD_DEFSIZEBOX_WIDTH = 12,
106 WD_DEFSIZEBOX_LEFT = 2,
107 WD_DEFSIZEBOX_RIGHT = 2,
108 WD_DEFSIZEBOX_TOP = 3,
109 WD_DEFSIZEBOX_BOTTOM = 3,
110
111 /* WWT_RESIZEBOX */
112 WD_RESIZEBOX_WIDTH = 12,
113 WD_RESIZEBOX_LEFT = 3,
114 WD_RESIZEBOX_RIGHT = 2,
115 WD_RESIZEBOX_TOP = 3,
116 WD_RESIZEBOX_BOTTOM = 2,
117
118 /* WWT_CLOSEBOX */
119 WD_CLOSEBOX_WIDTH = 11,
120 WD_CLOSEBOX_LEFT = 2,
121 WD_CLOSEBOX_RIGHT = 1,
122 WD_CLOSEBOX_TOP = 2,
123 WD_CLOSEBOX_BOTTOM = 2,
124
125 /* WWT_CAPTION */
126 WD_CAPTION_HEIGHT = 14,
127 WD_CAPTIONTEXT_LEFT = 2,
128 WD_CAPTIONTEXT_RIGHT = 2,
129 WD_CAPTIONTEXT_TOP = 2,
130 WD_CAPTIONTEXT_BOTTOM = 2,
131
132 /* Dropdown widget. */
133 WD_DROPDOWN_HEIGHT = 12,
134 WD_DROPDOWNTEXT_LEFT = 2,
135 WD_DROPDOWNTEXT_RIGHT = 2,
136 WD_DROPDOWNTEXT_TOP = 1,
137 WD_DROPDOWNTEXT_BOTTOM = 1,
138
139 WD_PAR_VSEP_NORMAL = 2,
140 WD_PAR_VSEP_WIDE = 8,
141 };
142
143 /* widget.cpp */
144 void DrawFrameRect(int left, int top, int right, int bottom, Colours colour, FrameFlags flags);
145 void DrawCaption(const Rect &r, Colours colour, Owner owner, StringID str);
146
147 /* window.cpp */
148 extern Window *_z_front_window;
149 extern Window *_z_back_window;
150 extern Window *_focused_window;
151
152
154 enum WindowPosition {
155 WDP_MANUAL,
156 WDP_AUTO,
157 WDP_CENTER,
158 WDP_ALIGN_TOOLBAR,
159 };
160
161 Point GetToolbarAlignedWindowPosition(int window_width);
162
163 struct HotkeyList;
164
168 struct WindowDesc : ZeroedMemoryAllocator {
169
170 WindowDesc(WindowPosition default_pos, const char *ini_key, int16 def_width_trad, int16 def_height_trad,
171 WindowClass window_class, WindowClass parent_class, uint32 flags,
172 const NWidgetPart *nwid_parts, int16 nwid_length, HotkeyList *hotkeys = NULL);
173
174 ~WindowDesc();
175
176 WindowPosition default_pos;
177 WindowClass cls;
178 WindowClass parent_cls;
179 const char *ini_key;
180 uint32 flags;
181 const NWidgetPart *nwid_parts;
182 int16 nwid_length;
183 HotkeyList *hotkeys;
184
185 bool pref_sticky;
186 int16 pref_width;
187 int16 pref_height;
188
189 int16 GetDefaultWidth() const;
190 int16 GetDefaultHeight() const;
191
192 static void LoadFromConfig();
193 static void SaveToConfig();
194
195 private:
196 int16 default_width_trad;
197 int16 default_height_trad;
198
203 WindowDesc(const WindowDesc &other);
204 };
205
209 enum WindowDefaultFlag {
210 WDF_CONSTRUCTION = 1 << 0,
211 WDF_MODAL = 1 << 1,
212 WDF_NO_FOCUS = 1 << 2,
213 };
214
218 struct ResizeInfo {
219 uint step_width;
220 uint step_height;
221 };
222
224 enum SortButtonState {
225 SBS_OFF,
226 SBS_DOWN,
227 SBS_UP,
228 };
229
233 enum WindowFlags {
234 WF_TIMEOUT = 1 << 0,
235
236 WF_DRAGGING = 1 << 3,
237 WF_SIZING_RIGHT = 1 << 4,
238 WF_SIZING_LEFT = 1 << 5,
239 WF_SIZING = WF_SIZING_RIGHT | WF_SIZING_LEFT,
240 WF_STICKY = 1 << 6,
241 WF_DISABLE_VP_SCROLL = 1 << 7,
242 WF_WHITE_BORDER = 1 << 8,
243 WF_HIGHLIGHTED = 1 << 9,
244 WF_CENTERED = 1 << 10,
245 };
246 DECLARE_ENUM_AS_BIT_SET(WindowFlags)
247
248 static const int TIMEOUT_DURATION = 7;
249 static const int WHITE_BORDER_DURATION = 3;
250
258 struct ViewportData : ViewPort {
259 VehicleID follow_vehicle;
260 int32 scrollpos_x;
261 int32 scrollpos_y;
262 int32 dest_scrollpos_x;
263 int32 dest_scrollpos_y;
264 };
265
266 struct QueryString;
267
271 struct Window : ZeroedMemoryAllocator {
272 protected:
273 void InitializeData(WindowNumber window_number);
274 void InitializePositionSize(int x, int y, int min_width, int min_height);
275 virtual void FindWindowPlacementAndResize(int def_width, int def_height);
276
277 SmallVector<int, 4> scheduled_invalidation_data;
278
279 public:
280 Window(WindowDesc *desc);
281
282 virtual ~Window();
283
290 inline void *operator new[](size_t size)
291 {
292 NOT_REACHED();
293 }
294
300 inline void operator delete(void *ptr)
301 {
302 }
303
304 WindowDesc *window_desc;
305 WindowFlags flags;
306 WindowClass window_class;
307 WindowNumber window_number;
308
309 uint8 timeout_timer;
310 uint8 white_border_timer;
311
312 int left;
313 int top;
314 int width;
315 int height;
316
317 ResizeInfo resize;
318
319 Owner owner;
320
321 ViewportData *viewport;
322 const NWidgetCore *nested_focus;
323 SmallMap<int, QueryString*> querystrings;
324 NWidgetBase *nested_root;
325 NWidgetBase **nested_array;
326 uint nested_array_size;
327 NWidgetStacked *shade_select;
328 Dimension unshaded_size;
329
330 int scrolling_scrollbar;
331
332 Window *parent;
333 Window *z_front;
334 Window *z_back;
335
336 template <class NWID>
337 inline const NWID *GetWidget(uint widnum) const;
338 template <class NWID>
339 inline NWID *GetWidget(uint widnum);
340
341 const Scrollbar *GetScrollbar(uint widnum) const;
342 Scrollbar *GetScrollbar(uint widnum);
343
344 const QueryString *GetQueryString(uint widnum) const;
345 QueryString *GetQueryString(uint widnum);
346
347 virtual const char *GetFocusedText() const;
348 virtual const char *GetCaret() const;
349 virtual const char *GetMarkedText(size_t *length) const;
350 virtual Point GetCaretPosition() const;
351 virtual Rect GetTextBoundingRect(const char *from, const char *to) const;
352 virtual const char *GetTextCharacterAtPosition(const Point &pt) const;
353
354 void InitNested(WindowNumber number = 0);
355 void CreateNestedTree(bool fill_nested = true);
356 void FinishInitNested(WindowNumber window_number = 0);
357
361 inline void SetTimeout()
362 {
363 this->flags |= WF_TIMEOUT;
364 this->timeout_timer = TIMEOUT_DURATION;
365 }
366
370 inline void SetWhiteBorder()
371 {
372 this->flags |= WF_WHITE_BORDER;
373 this->white_border_timer = WHITE_BORDER_DURATION;
374 }
375
376 void DisableAllWidgetHighlight();
377 void SetWidgetHighlight(byte widget_index, TextColour highlighted_colour);
378 bool IsWidgetHighlighted(byte widget_index) const;
379
387 inline void SetWidgetDisabledState(byte widget_index, bool disab_stat)
388 {
389 assert(widget_index < this->nested_array_size);
390 if (this->nested_array[widget_index] != NULL) this->GetWidget<NWidgetCore>(widget_index)->SetDisabled(disab_stat);
391 }
392
397 inline void DisableWidget(byte widget_index)
398 {
399 SetWidgetDisabledState(widget_index, true);
400 }
401
406 inline void EnableWidget(byte widget_index)
407 {
408 SetWidgetDisabledState(widget_index, false);
409 }
410
416 inline bool IsWidgetDisabled(byte widget_index) const
417 {
418 assert(widget_index < this->nested_array_size);
419 return this->GetWidget<NWidgetCore>(widget_index)->IsDisabled();
420 }
421
427 inline bool IsWidgetFocused(byte widget_index) const
428 {
429 return this->nested_focus != NULL && this->nested_focus->index == widget_index;
430 }
431
438 inline bool IsWidgetGloballyFocused(byte widget_index) const
439 {
440 return _focused_window == this && IsWidgetFocused(widget_index);
441 }
442
448 inline void SetWidgetLoweredState(byte widget_index, bool lowered_stat)
449 {
450 assert(widget_index < this->nested_array_size);
451 this->GetWidget<NWidgetCore>(widget_index)->SetLowered(lowered_stat);
452 }
453
458 inline void ToggleWidgetLoweredState(byte widget_index)
459 {
460 assert(widget_index < this->nested_array_size);
461 bool lowered_state = this->GetWidget<NWidgetCore>(widget_index)->IsLowered();
462 this->GetWidget<NWidgetCore>(widget_index)->SetLowered(!lowered_state);
463 }
464
469 inline void LowerWidget(byte widget_index)
470 {
471 SetWidgetLoweredState(widget_index, true);
472 }
473
478 inline void RaiseWidget(byte widget_index)
479 {
480 SetWidgetLoweredState(widget_index, false);
481 }
482
488 inline bool IsWidgetLowered(byte widget_index) const
489 {
490 assert(widget_index < this->nested_array_size);
491 return this->GetWidget<NWidgetCore>(widget_index)->IsLowered();
492 }
493
494 void UnfocusFocusedWidget();
495 bool SetFocusedWidget(int widget_index);
496
497 EventState HandleEditBoxKey(int wid, WChar key, uint16 keycode);
498 virtual void InsertTextString(int wid, const char *str, bool marked, const char *caret, const char *insert_location, const char *replacement_end);
499
500 void HandleButtonClick(byte widget);
501 int GetRowFromWidget(int clickpos, int widget, int padding, int line_height = -1) const;
502
503 void RaiseButtons(bool autoraise = false);
504 void CDECL SetWidgetsDisabledState(bool disab_stat, int widgets, ...);
505 void CDECL SetWidgetsLoweredState(bool lowered_stat, int widgets, ...);
506 void SetWidgetDirty(byte widget_index) const;
507
508 void DrawWidgets() const;
509 void DrawViewport() const;
510 void DrawSortButtonState(int widget, SortButtonState state) const;
511 static int SortButtonWidth();
512
513 void DeleteChildWindows(WindowClass wc = WC_INVALID) const;
514
515 void SetDirty() const;
516 void ReInit(int rx = 0, int ry = 0);
517
519 inline bool IsShaded() const
520 {
521 return this->shade_select != NULL && this->shade_select->shown_plane == SZSP_HORIZONTAL;
522 }
523
524 void SetShaded(bool make_shaded);
525
526 void InvalidateData(int data = 0, bool gui_scope = true);
527 void ProcessScheduledInvalidations();
528 void ProcessHighlightedInvalidations();
529
530 /*** Event handling ***/
531
536 virtual void OnInit() { }
537
538 virtual void ApplyDefaults();
539
547 virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number);
548
553 virtual void OnPaint()
554 {
555 this->DrawWidgets();
556 }
557
564 virtual void DrawWidget(const Rect &r, int widget) const {}
565
578 virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) {}
579
586 virtual void SetStringParameters(int widget) const {}
587
591 virtual void OnFocus() {}
592
593 virtual void OnFocusLost();
594
602 virtual EventState OnKeyPress(WChar key, uint16 keycode) { return ES_NOT_HANDLED; }
603
604 virtual EventState OnHotkey(int hotkey);
605
611 virtual EventState OnCTRLStateChange() { return ES_NOT_HANDLED; }
612
613
620 virtual void OnClick(Point pt, int widget, int click_count) {}
621
629 virtual bool OnRightClick(Point pt, int widget) { return false; }
630
636 virtual void OnHover(Point pt, int widget) {}
637
643 virtual void OnMouseDrag(Point pt, int widget) {}
644
650 virtual void OnDragDrop(Point pt, int widget) {}
651
656 virtual void OnScroll(Point delta) {}
657
664 virtual void OnMouseOver(Point pt, int widget) {}
665
670 virtual void OnMouseWheel(int wheel) {}
671
672
676 virtual void OnMouseLoop() {}
677
681 virtual void OnTick() {}
682
686 virtual void OnHundredthTick() {}
687
691 virtual void OnTimeout() {}
692
693
698 virtual void OnResize() {}
699
705 virtual void OnDropdownSelect(int widget, int index) {}
706
707 virtual void OnDropdownClose(Point pt, int widget, int index, bool instant_close);
708
713 virtual void OnEditboxChanged(int widget) {}
714
721 virtual void OnQueryTextFinished(char *str) {}
722
728 virtual void OnInvalidateData(int data = 0, bool gui_scope = true) {}
729
736 virtual void OnPlaceObject(Point pt, TileIndex tile) {}
737
743 virtual bool OnVehicleSelect(const struct Vehicle *v) { return false; }
744
748 virtual void OnPlaceObjectAbort() {}
749
750
758 virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) {}
759
769 virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) {}
770
778 virtual void OnPlacePresize(Point pt, TileIndex tile) {}
779
780 /*** End of the event handling ***/
781
786 virtual bool IsNewGRFInspectable() const { return false; }
787
794 virtual void ShowNewGRFInspectWindow() const { NOT_REACHED(); }
795 };
796
803 template <class NWID>
804 inline NWID *Window::GetWidget(uint widnum)
805 {
806 if (widnum >= this->nested_array_size || this->nested_array[widnum] == NULL) return NULL;
807 NWID *nwid = dynamic_cast<NWID *>(this->nested_array[widnum]);
808 assert(nwid != NULL);
809 return nwid;
810 }
811
813 template <>
814 inline const NWidgetBase *Window::GetWidget<NWidgetBase>(uint widnum) const
815 {
816 if (widnum >= this->nested_array_size) return NULL;
817 return this->nested_array[widnum];
818 }
819
826 template <class NWID>
827 inline const NWID *Window::GetWidget(uint widnum) const
828 {
829 return const_cast<Window *>(this)->GetWidget<NWID>(widnum);
830 }
831
832
836 class PickerWindowBase : public Window {
837
838 public:
839 PickerWindowBase(WindowDesc *desc, Window *parent) : Window(desc)
840 {
841 this->parent = parent;
842 }
843
844 virtual ~PickerWindowBase();
845 };
846
847 Window *BringWindowToFrontById(WindowClass cls, WindowNumber number);
848 Window *FindWindowFromPt(int x, int y);
849
858 template <typename Wcls>
859 Wcls *AllocateWindowDescFront(WindowDesc *desc, int window_number, bool return_existing = false)
860 {
861 Wcls *w = static_cast<Wcls *>(BringWindowToFrontById(desc->cls, window_number));
862 if (w != NULL) return return_existing ? w : NULL;
863 return new Wcls(desc, window_number);
864 }
865
866 void RelocateAllWindows(int neww, int newh);
867
868 /* misc_gui.cpp */
869 enum TooltipCloseCondition {
870 TCC_RIGHT_CLICK,
871 TCC_LEFT_CLICK,
872 TCC_HOVER,
873 };
874
875 void GuiShowTooltips(Window *parent, StringID str, uint paramcount = 0, const uint64 params[] = NULL, TooltipCloseCondition close_tooltip = TCC_HOVER);
876
877 /* widget.cpp */
878 int GetWidgetFromPos(const Window *w, int x, int y);
879
881 #define FOR_ALL_WINDOWS_FROM_BACK_FROM(w, start) for (w = start; w != NULL; w = w->z_front) if (w->window_class != WC_INVALID)
882 #define FOR_ALL_WINDOWS_FROM_FRONT_FROM(w, start) for (w = start; w != NULL; w = w->z_back) if (w->window_class != WC_INVALID)
883 #define FOR_ALL_WINDOWS_FROM_BACK(w) FOR_ALL_WINDOWS_FROM_BACK_FROM(w, _z_back_window)
884 #define FOR_ALL_WINDOWS_FROM_FRONT(w) FOR_ALL_WINDOWS_FROM_FRONT_FROM(w, _z_front_window)
885
886 extern Point _cursorpos_drag_start;
887
888 extern int _scrollbar_start_pos;
889 extern int _scrollbar_size;
890 extern byte _scroller_click_timeout;
891
892 extern bool _scrolling_viewport;
893 extern bool _mouse_hovering;
894
896 enum SpecialMouseMode {
897 WSM_NONE,
898 WSM_DRAGDROP,
899 WSM_SIZING,
900 WSM_PRESIZE,
901 };
902 extern SpecialMouseMode _special_mouse_mode;
903
904 void SetFocusedWindow(Window *w);
905
906 void ScrollbarClickHandler(Window *w, NWidgetCore *nw, int x, int y);
907
908 #endif /* WINDOW_GUI_H */
EventState
EventState
State of handling an event.
Definition: window_type.h:701
ViewportDragDropSelectionProcess
ViewportDragDropSelectionProcess
Drag and drop selection process, or, what to do with an area of land when you&#39;ve selected it...
Definition: viewport_type.h:97
Window::OnQueryTextFinished
virtual void OnQueryTextFinished(char *str)
The query window opened from this window has closed.
Definition: window_gui.h:721
SpecialMouseMode
SpecialMouseMode
Mouse modes.
Definition: window_gui.h:896
Window::OnPlacePresize
virtual void OnPlacePresize(Point pt, TileIndex tile)
The user moves over the map when a tile highlight mode has been set when the special mouse mode has b...
Definition: window_gui.h:778
WD_STICKYBOX_LEFT
Left offset of sticky sprite.
Definition: window_gui.h:92
_z_front_window
Window * _z_front_window
List of windows opened at the screen sorted from the front.
Definition: window.cpp:55
DECLARE_ENUM_AS_BIT_SET
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Definition: company_manager_face.h:31
Window::OnScroll
virtual void OnScroll(Point delta)
Handle the request for (viewport) scrolling.
Definition: window_gui.h:656
Window::resize
ResizeInfo resize
Resize information.
Definition: window_gui.h:317
WindowDesc::WindowDesc
WindowDesc(WindowPosition default_pos, const char *ini_key, int16 def_width_trad, int16 def_height_trad, WindowClass window_class, WindowClass parent_class, uint32 flags, const NWidgetPart *nwid_parts, int16 nwid_length, HotkeyList *hotkeys=NULL)
Window description constructor.
Definition: window.cpp:90
Window::SetWidgetDisabledState
void SetWidgetDisabledState(byte widget_index, bool disab_stat)
Sets the enabled/disabled status of a widget.
Definition: window_gui.h:387
WD_MATRIX_RIGHT
Offset at right of a matrix cell.
Definition: window_gui.h:79
WSM_NONE
No special mouse mode.
Definition: window_gui.h:897
Window::nested_focus
const NWidgetCore * nested_focus
Currently focused nested widget, or NULL if no nested widget has focus.
Definition: window_gui.h:322
Window::SetWidgetLoweredState
void SetWidgetLoweredState(byte widget_index, bool lowered_stat)
Sets the lowered/raised status of a widget.
Definition: window_gui.h:448
Window::SetTimeout
void SetTimeout()
Set the timeout flag of the window and initiate the timer.
Definition: window_gui.h:361
WD_CLOSEBOX_RIGHT
Right offset of closebox string.
Definition: window_gui.h:121
Window::parent
Window * parent
Parent window.
Definition: window_gui.h:332
WindowDesc
High level window description.
Definition: window_gui.h:168
DrawFrameRect
void DrawFrameRect(int left, int top, int right, int bottom, Colours colour, FrameFlags flags)
Draw frame rectangle.
Definition: widget.cpp:177
Window::OnDragDrop
virtual void OnDragDrop(Point pt, int widget)
A dragged &#39;object&#39; has been released.
Definition: window_gui.h:650
WF_SIZING_RIGHT
Window is being resized towards the right.
Definition: window_gui.h:237
smallvec_type.hpp
Simple vector class that allows allocating an item without the need to copy this->data needlessly...
Window::flags
WindowFlags flags
Window flags.
Definition: window_gui.h:305
Window::left
int left
x position of left edge of the window
Definition: window_gui.h:312
WD_BEVEL_LEFT
Width of left bevel border.
Definition: window_gui.h:56
WD_SCROLLBAR_LEFT
Left offset of scrollbar.
Definition: window_gui.h:50
WD_DEBUGBOX_RIGHT
Right offset of debug sprite.
Definition: window_gui.h:100
_scrolling_viewport
bool _scrolling_viewport
A viewport is being scrolled with the mouse.
Definition: window.cpp:75
WindowDesc::pref_height
int16 pref_height
User-preferred height of the window. Zero if unset.
Definition: window_gui.h:187
WD_DROPDOWN_HEIGHT
Height of a drop down widget.
Definition: window_gui.h:133
Scrollbar
Scrollbar data structure.
Definition: widget_type.h:589
NWidgetStacked
Stacked widgets, widgets all occupying the same space in the window.
Definition: widget_type.h:405
WD_SCROLLBAR_TOP
Top offset of scrollbar.
Definition: window_gui.h:52
WD_FRAMERECT_TOP
Offset at top to draw the frame rectangular area.
Definition: window_gui.h:64
WD_PAR_VSEP_NORMAL
Normal amount of vertical space between two paragraphs of text.
Definition: window_gui.h:139
WSM_DRAGDROP
Dragging an object.
Definition: window_gui.h:898
ES_NOT_HANDLED
The passed event is not handled.
Definition: window_type.h:703
Window::unshaded_size
Dimension unshaded_size
Last known unshaded size (only valid while shaded).
Definition: window_gui.h:328
WD_SHADEBOX_BOTTOM
Bottom offset of shade sprite.
Definition: window_gui.h:88
ScrollbarClickHandler
void ScrollbarClickHandler(Window *w, NWidgetCore *nw, int x, int y)
Special handling for the scrollbar widget type.
Definition: widget.cpp:138
WD_SHADEBOX_LEFT
Left offset of shade sprite.
Definition: window_gui.h:85
SmallMap
Implementation of simple mapping class.
Definition: smallmap_type.hpp:42
widget_type.h
Definitions about widgets.
FR_DARKENED
If set the background is darker, allows for lowered frames with normal background colour when used wi...
Definition: window_gui.h:32
_special_mouse_mode
SpecialMouseMode _special_mouse_mode
Mode of the mouse.
Definition: window.cpp:78
Vehicle
Vehicle data structure.
Definition: vehicle_base.h:212
Window::top
int top
y position of top edge of the window
Definition: window_gui.h:313
Window::OnTick
virtual void OnTick()
Called once per (game) tick.
Definition: window_gui.h:681
Window::ToggleWidgetLoweredState
void ToggleWidgetLoweredState(byte widget_index)
Invert the lowered/raised status of a widget.
Definition: window_gui.h:458
Window::OnEditboxChanged
virtual void OnEditboxChanged(int widget)
The text in an editbox has been edited.
Definition: window_gui.h:713
WD_BEVEL_RIGHT
Width of right bevel border.
Definition: window_gui.h:57
WD_MATRIX_TOP
Offset at top of a matrix cell.
Definition: window_gui.h:80
Window::shade_select
NWidgetStacked * shade_select
Selection widget (NWID_SELECTION) to use for shading the window. If NULL, window cannot shade...
Definition: window_gui.h:327
WD_DEFSIZEBOX_WIDTH
Width of a standard defsize box widget.
Definition: window_gui.h:105
Window::OnMouseLoop
virtual void OnMouseLoop()
Called for every mouse loop run, which is at least once per (game) tick.
Definition: window_gui.h:676
WD_DEFSIZEBOX_BOTTOM
Bottom offset of defsize sprite.
Definition: window_gui.h:109
SmallVector< int, 4 >
WindowClass
WindowClass
Window classes.
Definition: window_type.h:39
Window::DisableWidget
void DisableWidget(byte widget_index)
Sets a widget to disabled.
Definition: window_gui.h:397
WindowDesc::default_width_trad
int16 default_width_trad
Preferred initial width of the window (pixels at 1x zoom).
Definition: window_gui.h:196
TIMEOUT_DURATION
static const int TIMEOUT_DURATION
The initial timeout value for WF_TIMEOUT.
Definition: window_gui.h:248
Window::OnPlaceDrag
virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt)
The user is dragging over the map when the tile highlight mode has been set.
Definition: window_gui.h:758
WC_INVALID
Invalid window.
Definition: window_type.h:684
WD_DEBUGBOX_TOP
Top offset of debug sprite.
Definition: window_gui.h:101
Window::OnPlaceObjectAbort
virtual void OnPlaceObjectAbort()
The user cancelled a tile highlight mode that has been set.
Definition: window_gui.h:748
WD_DEBUGBOX_LEFT
Left offset of debug sprite.
Definition: window_gui.h:99
Window::RaiseWidget
void RaiseWidget(byte widget_index)
Marks a widget as raised.
Definition: window_gui.h:478
WindowDesc::cls
WindowClass cls
Class of the window,.
Definition: window_gui.h:177
WF_STICKY
Window is made sticky by user.
Definition: window_gui.h:240
WSM_PRESIZE
Presizing mode (docks, tunnels).
Definition: window_gui.h:900
Window::OnTimeout
virtual void OnTimeout()
Called when this window&#39;s timeout has been reached.
Definition: window_gui.h:691
WF_SIZING_LEFT
Window is being resized towards the left.
Definition: window_gui.h:238
WD_PAR_VSEP_WIDE
Large amount of vertical space between two paragraphs of text.
Definition: window_gui.h:140
Window::OnVehicleSelect
virtual bool OnVehicleSelect(const struct Vehicle *v)
The user clicked on a vehicle while HT_VEHICLE has been set.
Definition: window_gui.h:743
Window::IsNewGRFInspectable
virtual bool IsNewGRFInspectable() const
Is the data related to this window NewGRF inspectable?
Definition: window_gui.h:786
FrameFlags
FrameFlags
Flags to describe the look of the frame.
Definition: window_gui.h:27
WD_CLOSEBOX_WIDTH
Width of a close box widget.
Definition: window_gui.h:119
smallmap_type.hpp
Simple mapping class targeted for small sets of data.
WHITE_BORDER_DURATION
static const int WHITE_BORDER_DURATION
The initial timeout value for WF_WHITE_BORDER.
Definition: window_gui.h:249
NWidgetPart
Partial widget specification to allow NWidgets to be written nested.
Definition: widget_type.h:910
Window::UpdateWidgetSize
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
Update size and resize step of a widget in the window.
Definition: window_gui.h:578
viewport_type.h
Types related to viewports.
WindowDesc::ini_key
const char * ini_key
Key to store window defaults in openttd.cfg. NULL if nothing shall be stored.
Definition: window_gui.h:179
Window
Data structure for an opened window.
Definition: window_gui.h:271
WD_IMGBTN_BOTTOM
Bottom offset of image in the button.
Definition: window_gui.h:43
WidgetDrawDistances
WidgetDrawDistances
Distances used in drawing widgets.
Definition: window_gui.h:38
WD_FRAMETEXT_BOTTOM
Bottom offset of the text of the frame.
Definition: window_gui.h:75
SetFocusedWindow
void SetFocusedWindow(Window *w)
Set the window that has the focus.
Definition: window.cpp:432
WindowDesc::GetDefaultHeight
int16 GetDefaultHeight() const
Determine default height of window.
Definition: window.cpp:131
WindowDesc::default_height_trad
int16 default_height_trad
Preferred initial height of the window (pixels at 1x zoom).
Definition: window_gui.h:197
Window::nested_array
NWidgetBase ** nested_array
Array of pointers into the tree. Do not access directly, use Window::GetWidget() instead.
Definition: window_gui.h:325
ResizeInfo
Data structure for resizing a window.
Definition: window_gui.h:218
WD_RESIZEBOX_RIGHT
Right offset of resize sprite.
Definition: window_gui.h:114
GetToolbarAlignedWindowPosition
Point GetToolbarAlignedWindowPosition(int window_width)
Computer the position of the top-left corner of a window to be opened right under the toolbar...
Definition: window.cpp:1708
WD_SHADEBOX_WIDTH
Width of a standard shade box widget.
Definition: window_gui.h:84
WD_MATRIX_BOTTOM
Offset at bottom of a matrix cell.
Definition: window_gui.h:81
WD_DEFSIZEBOX_RIGHT
Right offset of defsize sprite.
Definition: window_gui.h:107
Window::OnKeyPress
virtual EventState OnKeyPress(WChar key, uint16 keycode)
A key has been pressed.
Definition: window_gui.h:602
Window::OnInit
virtual void OnInit()
Notification that the nested widget tree gets initialized.
Definition: window_gui.h:536
WDF_CONSTRUCTION
This window is used for construction; close it whenever changing company.
Definition: window_gui.h:210
Window::IsWidgetLowered
bool IsWidgetLowered(byte widget_index) const
Gets the lowered state of a widget.
Definition: window_gui.h:488
WindowDesc::GetDefaultWidth
int16 GetDefaultWidth() const
Determine default width of window.
Definition: window.cpp:121
_z_back_window
Window * _z_back_window
List of windows opened at the screen sorted from the back.
Definition: window.cpp:57
Window::OnFocus
virtual void OnFocus()
Called when window gains focus.
Definition: window_gui.h:591
SBS_UP
Sort descending.
Definition: window_gui.h:227
VehicleID
uint32 VehicleID
The type all our vehicle IDs have.
Definition: vehicle_type.h:18
WF_DRAGGING
Window is being dragged.
Definition: window_gui.h:236
ViewportPlaceMethod
ViewportPlaceMethod
Viewport place method (type of highlighted area and placed objects)
Definition: viewport_type.h:78
Window::querystrings
SmallMap< int, QueryString * > querystrings
QueryString associated to WWT_EDITBOX widgets.
Definition: window_gui.h:323
Window::DrawWidget
virtual void DrawWidget(const Rect &r, int widget) const
Draw the contents of a nested widget.
Definition: window_gui.h:564
QueryString
Data stored about a string that can be modified in the GUI.
Definition: querystring_gui.h:22
SZSP_HORIZONTAL
Display plane with zero size vertically, and filling and resizing horizontally.
Definition: widget_type.h:389
WD_INSET_LEFT
Left offset of string.
Definition: window_gui.h:46
WD_RESIZEBOX_BOTTOM
Bottom offset of resize sprite.
Definition: window_gui.h:116
Window::scheduled_invalidation_data
SmallVector< int, 4 > scheduled_invalidation_data
Data of scheduled OnInvalidateData() calls.
Definition: window_gui.h:277
WindowDesc::default_pos
WindowPosition default_pos
Preferred position of the window.
Definition: window_gui.h:176
WF_CENTERED
Window is centered and shall stay centered after ReInit.
Definition: window_gui.h:244
WD_BEVEL_BOTTOM
Height of bottom bevel border.
Definition: window_gui.h:59
Window::SetWhiteBorder
void SetWhiteBorder()
Set the timeout flag of the window and initiate the timer.
Definition: window_gui.h:370
TextColour
TextColour
Colour of the strings, see _string_colourmap in table/string_colours.h or docs/ottd-colourtext-palett...
Definition: gfx_type.h:247
HotkeyList
List of hotkeys for a window.
Definition: hotkeys.h:42
DrawCaption
void DrawCaption(const Rect &r, Colours colour, Owner owner, StringID str)
Draw a caption bar.
Definition: widget.cpp:540
AllocateWindowDescFront
Wcls * AllocateWindowDescFront(WindowDesc *desc, int window_number, bool return_existing=false)
Open a new window.
Definition: window_gui.h:859
GetWidgetFromPos
int GetWidgetFromPos(const Window *w, int x, int y)
Returns the index for the widget located at the given position relative to the window.
Definition: widget.cpp:162
WD_DEFSIZEBOX_LEFT
Left offset of defsize sprite.
Definition: window_gui.h:106
WD_CAPTION_HEIGHT
Height of a title bar.
Definition: window_gui.h:126
WindowDesc::SaveToConfig
static void SaveToConfig()
Save all WindowDesc settings to _windows_file.
Definition: window.cpp:162
Window::IsWidgetDisabled
bool IsWidgetDisabled(byte widget_index) const
Gets the enabled/disabled status of a widget.
Definition: window_gui.h:416
WD_TEXTPANEL_BOTTOM
Offset at bottom to draw below the text.
Definition: window_gui.h:69
Window::nested_array_size
uint nested_array_size
Size of the nested array.
Definition: window_gui.h:326
WindowDesc::nwid_parts
const NWidgetPart * nwid_parts
Nested widget parts describing the window.
Definition: window_gui.h:181
WindowDefaultFlag
WindowDefaultFlag
Window default widget/window handling flags.
Definition: window_gui.h:209
Window::OnHover
virtual void OnHover(Point pt, int widget)
The mouse is hovering over a widget in the window, perform an action for it, like opening a custom to...
Definition: window_gui.h:636
WF_TIMEOUT
Window timeout counter.
Definition: window_gui.h:234
ViewportData
Data structure for a window viewport.
Definition: window_gui.h:258
WindowDesc::nwid_length
int16 nwid_length
Length of the nwid_parts array.
Definition: window_gui.h:182
ViewportData::scrollpos_x
int32 scrollpos_x
Currently shown x coordinate (virtual screen coordinate of topleft corner of the viewport).
Definition: window_gui.h:260
ResizeInfo::step_height
uint step_height
Step-size of height resize changes.
Definition: window_gui.h:220
Window::LowerWidget
void LowerWidget(byte widget_index)
Marks a widget as lowered.
Definition: window_gui.h:469
WD_MATRIX_LEFT
Offset at left of a matrix cell.
Definition: window_gui.h:78
Window::OnMouseOver
virtual void OnMouseOver(Point pt, int widget)
The mouse is currently moving over the window or has just moved outside of the window.
Definition: window_gui.h:664
WD_RESIZEBOX_TOP
Top offset of resize sprite.
Definition: window_gui.h:115
GuiShowTooltips
void GuiShowTooltips(Window *parent, StringID str, uint paramcount=0, const uint64 params[]=NULL, TooltipCloseCondition close_tooltip=TCC_HOVER)
Shows a tooltip.
Definition: misc_gui.cpp:743
Window::OnDropdownSelect
virtual void OnDropdownSelect(int widget, int index)
A dropdown option associated to this window has been selected.
Definition: window_gui.h:705
WDP_CENTER
Center the window.
Definition: window_gui.h:157
SortButtonState
SortButtonState
State of a sort direction button.
Definition: window_gui.h:224
WD_STICKYBOX_RIGHT
Right offset of sticky sprite.
Definition: window_gui.h:93
WD_FRAMERECT_BOTTOM
Offset at bottom to draw the frame rectangular area.
Definition: window_gui.h:65
WSM_SIZING
Sizing mode.
Definition: window_gui.h:899
NWidgetBase
Baseclass for nested widgets.
Definition: widget_type.h:126
Window::white_border_timer
uint8 white_border_timer
Timer value of the WF_WHITE_BORDER for flags.
Definition: window_gui.h:310
WD_CAPTIONTEXT_LEFT
Offset of the caption text at the left.
Definition: window_gui.h:127
WD_FRAMETEXT_RIGHT
Right offset of the text of the frame.
Definition: window_gui.h:73
ViewportData::follow_vehicle
VehicleID follow_vehicle
VehicleID to follow if following a vehicle, INVALID_VEHICLE otherwise.
Definition: window_gui.h:259
WD_IMGBTN_RIGHT
Right offset of the image in the button.
Definition: window_gui.h:41
WD_FRAMETEXT_TOP
Top offset of the text of the frame.
Definition: window_gui.h:74
WD_FRAMETEXT_LEFT
Left offset of the text of the frame.
Definition: window_gui.h:72
WD_DEFSIZEBOX_TOP
Top offset of defsize sprite.
Definition: window_gui.h:108
WF_HIGHLIGHTED
Window has a widget that has a highlight.
Definition: window_gui.h:243
ZeroedMemoryAllocator
Base class that provides memory initialization on dynamically created objects.
Definition: alloc_type.hpp:150
WindowDesc::pref_sticky
bool pref_sticky
Preferred stickyness.
Definition: window_gui.h:185
WindowFlags
WindowFlags
Window flags.
Definition: window_gui.h:233
StringID
uint32 StringID
Numeric value that represents a string, independent of the selected language.
Definition: strings_type.h:18
WF_SIZING
Window is being resized.
Definition: window_gui.h:239
FindWindowFromPt
Window * FindWindowFromPt(int x, int y)
Do a search for a window at specific coordinates.
Definition: window.cpp:1854
WD_RESIZEBOX_LEFT
Left offset of resize sprite.
Definition: window_gui.h:113
WD_CLOSEBOX_BOTTOM
Bottom offset of closebox string.
Definition: window_gui.h:123
ViewportData::dest_scrollpos_y
int32 dest_scrollpos_y
Current destination y coordinate to display (virtual screen coordinate of topleft corner of the viewp...
Definition: window_gui.h:263
FR_BORDERONLY
Draw border only, no background.
Definition: window_gui.h:30
WD_TEXTPANEL_TOP
Offset at top to draw above the text.
Definition: window_gui.h:68
WDF_MODAL
The window is a modal child of some other window, meaning the parent is &#39;inactive&#39;.
Definition: window_gui.h:211
WindowDesc::flags
uint32 flags
Flags.
Definition: window_gui.h:180
Window::IsWidgetGloballyFocused
bool IsWidgetGloballyFocused(byte widget_index) const
Check if given widget has user input focus.
Definition: window_gui.h:438
WD_CAPTIONTEXT_TOP
Offset of the caption text at the top.
Definition: window_gui.h:129
Window::z_back
Window * z_back
The window behind us in z-order.
Definition: window_gui.h:334
Window::scrolling_scrollbar
int scrolling_scrollbar
Widgetindex of just being dragged scrollbar. -1 if none is active.
Definition: window_gui.h:330
WD_DEBUGBOX_WIDTH
Width of a standard debug box widget.
Definition: window_gui.h:98
RelocateAllWindows
void RelocateAllWindows(int neww, int newh)
Relocate all windows to fit the new size of the game application screen.
Definition: window.cpp:3458
Window::OnRightClick
virtual bool OnRightClick(Point pt, int widget)
A click with the right mouse button has been made on the window.
Definition: window_gui.h:629
WD_SHADEBOX_TOP
Top offset of shade sprite.
Definition: window_gui.h:87
WD_STICKYBOX_WIDTH
Width of a standard sticky box widget.
Definition: window_gui.h:91
WD_SCROLLBAR_BOTTOM
Bottom offset of scrollbar.
Definition: window_gui.h:53
Window::OnPaint
virtual void OnPaint()
The window must be repainted.
Definition: window_gui.h:553
ViewportData::dest_scrollpos_x
int32 dest_scrollpos_x
Current destination x coordinate to display (virtual screen coordinate of topleft corner of the viewp...
Definition: window_gui.h:262
WD_BEVEL_TOP
Height of top bevel border.
Definition: window_gui.h:58
WDP_ALIGN_TOOLBAR
Align toward the toolbar.
Definition: window_gui.h:158
ViewPort
Data structure for viewport, display of a part of the world.
Definition: viewport_type.h:24
FR_LOWERED
If set the frame is lowered and the background colour brighter (ie. buttons when pressed) ...
Definition: window_gui.h:31
WD_STICKYBOX_BOTTOM
Bottom offset of sticky sprite.
Definition: window_gui.h:95
WD_CAPTIONTEXT_BOTTOM
Offset of the caption text at the bottom.
Definition: window_gui.h:130
WD_DEBUGBOX_BOTTOM
Bottom offset of debug sprite.
Definition: window_gui.h:102
TileIndex
uint32 TileIndex
The index/ID of a Tile.
Definition: tile_type.h:80
Window::z_front
Window * z_front
The window in front of us in z-order.
Definition: window_gui.h:333
WindowDesc::parent_cls
WindowClass parent_cls
Class of the parent window.
Definition: window_gui.h:178
Window::OnCTRLStateChange
virtual EventState OnCTRLStateChange()
The state of the control key has changed.
Definition: window_gui.h:611
Window::ShowNewGRFInspectWindow
virtual void ShowNewGRFInspectWindow() const
Show the NewGRF inspection window.
Definition: window_gui.h:794
Window::SetStringParameters
virtual void SetStringParameters(int widget) const
Initialize string parameters for a widget.
Definition: window_gui.h:586
WDF_NO_FOCUS
This window won&#39;t get focus/make any other window lose focus when click.
Definition: window_gui.h:212
SBS_DOWN
Sort ascending.
Definition: window_gui.h:226
WindowDesc::LoadFromConfig
static void LoadFromConfig()
Load all WindowDesc settings from _windows_file.
Definition: window.cpp:139
NWidgetCore::index
int index
Index of the nested widget in the widget array of the window (-1 means &#39;not used&#39;).
Definition: widget_type.h:304
WD_IMGBTN_TOP
Top offset of image in the button.
Definition: window_gui.h:42
vehicle_type.h
Types related to vehicles.
NWidgetStacked::shown_plane
int shown_plane
Plane being displayed (for NWID_SELECTION only).
Definition: widget_type.h:420
WD_INSET_RIGHT
Right offset of string.
Definition: window_gui.h:47
WD_STICKYBOX_TOP
Top offset of sticky sprite.
Definition: window_gui.h:94
ResizeInfo::step_width
uint step_width
Step-size of width resize changes.
Definition: window_gui.h:219
WindowDesc::hotkeys
HotkeyList * hotkeys
Hotkeys for the window.
Definition: window_gui.h:183
WD_DROPDOWNTEXT_BOTTOM
Bottom offset of the dropdown widget string.
Definition: window_gui.h:137
WD_SCROLLBAR_RIGHT
Right offset of scrollbar.
Definition: window_gui.h:51
Point
Coordinates of a point in 2D.
Definition: geometry_type.hpp:28
WindowDesc::pref_width
int16 pref_width
User-preferred width of the window. Zero if unset.
Definition: window_gui.h:186
company_type.h
Types related to companies.
WF_DISABLE_VP_SCROLL
Window does not do autoscroll,.
Definition: window_gui.h:241
Window::owner
Owner owner
The owner of the content shown in this window. Company colour is acquired from this variable...
Definition: window_gui.h:319
Window::OnMouseDrag
virtual void OnMouseDrag(Point pt, int widget)
An &#39;object&#39; is being dragged at the provided position, highlight the target if possible.
Definition: window_gui.h:643
WD_SHADEBOX_RIGHT
Right offset of shade sprite.
Definition: window_gui.h:86
WD_RESIZEBOX_WIDTH
Width of a resize box widget.
Definition: window_gui.h:112
WD_FRAMERECT_RIGHT
Offset at right to draw the frame rectangular area.
Definition: window_gui.h:63
Window::OnClick
virtual void OnClick(Point pt, int widget, int click_count)
A click with the left mouse button has been made on the window.
Definition: window_gui.h:620
Window::width
int width
width of the window (number of pixels to the right in x direction)
Definition: window_gui.h:314
string_type.h
Types for strings.
Window::OnResize
virtual void OnResize()
Called after the window got resized.
Definition: window_gui.h:698
WindowNumber
int32 WindowNumber
Number to differentiate different windows of the same class.
Definition: window_type.h:695
Window::window_class
WindowClass window_class
Window class.
Definition: window_gui.h:306
Window::OnMouseWheel
virtual void OnMouseWheel(int wheel)
The mouse wheel has been turned.
Definition: window_gui.h:670
Rect
Specification of a rectangle with absolute coordinates of all edges.
Definition: geometry_type.hpp:40
Window::OnPlaceObject
virtual void OnPlaceObject(Point pt, TileIndex tile)
The user clicked some place on the map when a tile highlight mode has been set.
Definition: window_gui.h:736
Window::IsShaded
bool IsShaded() const
Is window shaded currently?
Definition: window_gui.h:519
Window::window_number
WindowNumber window_number
Window number within the window class.
Definition: window_gui.h:307
WD_DROPDOWNTEXT_LEFT
Left offset of the dropdown widget string.
Definition: window_gui.h:134
Owner
Owner
Enum for all companies/owners.
Definition: company_type.h:20
WDP_AUTO
Find a place automatically.
Definition: window_gui.h:156
tile_type.h
Types related to tiles.
WDP_MANUAL
Manually align the window (so no automatic location finding)
Definition: window_gui.h:155
Window::OnHundredthTick
virtual void OnHundredthTick()
Called once every 100 (game) ticks.
Definition: window_gui.h:686
FR_TRANSPARENT
Makes the background transparent if set.
Definition: window_gui.h:29
Window::viewport
ViewportData * viewport
Pointer to viewport data, if present.
Definition: window_gui.h:321
Window::timeout_timer
uint8 timeout_timer
Timer value of the WF_TIMEOUT for flags.
Definition: window_gui.h:309
WChar
uint32 WChar
Type for wide characters, i.e.
Definition: string_type.h:35
Window::IsWidgetFocused
bool IsWidgetFocused(byte widget_index) const
Check if given widget is focused within this window.
Definition: window_gui.h:427
Window::GetWidget
const NWID * GetWidget(uint widnum) const
Get the nested widget with number widnum from the nested widget tree.
Definition: window_gui.h:827
SBS_OFF
Do not sort (with this button).
Definition: window_gui.h:225
_mouse_hovering
bool _mouse_hovering
The mouse is hovering over the same point.
Definition: window.cpp:76
WF_WHITE_BORDER
Window white border counter bit mask.
Definition: window_gui.h:242
WD_IMGBTN_LEFT
Left offset of the image in the button.
Definition: window_gui.h:40
ViewportData::scrollpos_y
int32 scrollpos_y
Currently shown y coordinate (virtual screen coordinate of topleft corner of the viewport).
Definition: window_gui.h:261
WD_CLOSEBOX_LEFT
Left offset of closebox string.
Definition: window_gui.h:120
WindowPosition
WindowPosition
How do we the window to be placed?
Definition: window_gui.h:154
Window::nested_root
NWidgetBase * nested_root
Root of the nested tree.
Definition: window_gui.h:324
Dimension
Dimensions (a width and height) of a rectangle in 2D.
Definition: geometry_type.hpp:34
WD_FRAMERECT_LEFT
Offset at left to draw the frame rectangular area.
Definition: window_gui.h:62
Window::window_desc
WindowDesc * window_desc
Window description.
Definition: window_gui.h:304
PickerWindowBase
Base class for windows opened from a toolbar.
Definition: window_gui.h:836
WD_DROPDOWNTEXT_RIGHT
Right offset of the dropdown widget string.
Definition: window_gui.h:135
WD_DROPDOWNTEXT_TOP
Top offset of the dropdown widget string.
Definition: window_gui.h:136
WD_CAPTIONTEXT_RIGHT
Offset of the caption text at the right.
Definition: window_gui.h:128
Window::OnPlaceMouseUp
virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile)
The user has dragged over the map when the tile highlight mode has been set.
Definition: window_gui.h:769
BringWindowToFrontById
Window * BringWindowToFrontById(WindowClass cls, WindowNumber number)
Find a window and make it the relative top-window on the screen.
Definition: window.cpp:1234
WD_CLOSEBOX_TOP
Top offset of closebox string.
Definition: window_gui.h:122
Window::height
int height
Height of the window (number of pixels down in y direction)
Definition: window_gui.h:315
Window::EnableWidget
void EnableWidget(byte widget_index)
Sets a widget to Enabled.
Definition: window_gui.h:406
Window::OnInvalidateData
virtual void OnInvalidateData(int data=0, bool gui_scope=true)
Some data on this window has become invalid.
Definition: window_gui.h:728
WD_INSET_TOP
Top offset of string.
Definition: window_gui.h:48
NWidgetCore
Base class for a &#39;real&#39; widget.
Definition: widget_type.h:284