OpenTTD Source: Window Struct Reference

OpenTTD Source 15.0-RC2

Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes | Static Private Attributes
Window Struct Reference

Data structure for an opened window. More...

`#include <window_gui.h>`

Inheritance diagram for Window:

## Data Structures
struct | AllWindows
| Iterable ensemble of all valid Windows. More...
struct | WindowIterator
| Iterator to iterate all valid Windows. More...

## Public Types
using | IteratorToFront = WindowIterator< false >
| Iterate in Z order towards front.
using | IteratorToBack = WindowIterator< true >
| Iterate in Z order towards back.
using | Iterate = AllWindows< false >
| Iterate all windows in whatever order is easiest.
using | IterateFromBack = AllWindows< false >
| Iterate all windows in Z order from back to front.
using | IterateFromFront = AllWindows< true >
| Iterate all windows in Z order from front to back.

## Public Member Functions
| Window (WindowDesc &desc)
| Empty constructor, initialization has been moved to InitNested() called from the constructor of the derived class.
void * | operator new[] (size_t size)=delete
| Helper allocation function to disallow something.
template<class NWID >
const NWID * | GetWidget (WidgetID widnum) const
| Get the nested widget with number widnum from the nested widget tree.
template<class NWID >
NWID * | GetWidget (WidgetID widnum)
| Get the nested widget with number widnum from the nested widget tree.
const Scrollbar * | GetScrollbar (WidgetID widnum) const
| Return the Scrollbar to a widget index.
Scrollbar * | GetScrollbar (WidgetID widnum)
| Return the Scrollbar to a widget index.
const QueryString * | GetQueryString (WidgetID widnum) const
| Return the querystring associated to a editbox.
QueryString * | GetQueryString (WidgetID widnum)
| Return the querystring associated to a editbox.
void | UpdateQueryStringSize ()
| Update size of all QueryStrings of this window.
virtual const struct Textbuf * | GetFocusedTextbuf () const
| Get the current input text buffer.
virtual Point | GetCaretPosition () const
| Get the current caret position if an edit box has the focus.
virtual Rect | GetTextBoundingRect (size_t from, size_t to) const
| Get the bounding rectangle for a text range if an edit box has the focus.
virtual ptrdiff_t | GetTextCharacterAtPosition (const Point &pt) const
| Get the character that is rendered at a position by the focused edit box.
void | InitNested (WindowNumber number=0)
| Perform complete initialization of the Window with nested widgets, to allow use.
void | CreateNestedTree ()
| Perform the first part of the initialization of a nested widget tree.
void | FinishInitNested (WindowNumber window_number=0)
| Perform the second part of the initialization of a nested widget tree.
void | SetTimeout ()
| Set the timeout flag of the window and initiate the timer.
void | SetWhiteBorder ()
| Set the timeout flag of the window and initiate the timer.
void | DisableAllWidgetHighlight ()
| Disable the highlighted status of all widgets.
void | SetWidgetHighlight (WidgetID widget_index, TextColour highlighted_colour)
| Sets the highlighted status of a widget.
bool | IsWidgetHighlighted (WidgetID widget_index) const
| Gets the highlighted status of a widget.
void | SetWidgetDisabledState (WidgetID widget_index, bool disab_stat)
| Sets the enabled/disabled status of a widget.
void | DisableWidget (WidgetID widget_index)
| Sets a widget to disabled.
void | EnableWidget (WidgetID widget_index)
| Sets a widget to Enabled.
bool | IsWidgetDisabled (WidgetID widget_index) const
| Gets the enabled/disabled status of a widget.
bool | IsWidgetFocused (WidgetID widget_index) const
| Check if given widget is focused within this window.
bool | IsWidgetGloballyFocused (WidgetID widget_index) const
| Check if given widget has user input focus.
void | SetWidgetLoweredState (WidgetID widget_index, bool lowered_stat)
| Sets the lowered/raised status of a widget.
void | ToggleWidgetLoweredState (WidgetID widget_index)
| Invert the lowered/raised status of a widget.
void | LowerWidget (WidgetID widget_index)
| Marks a widget as lowered.
void | RaiseWidget (WidgetID widget_index)
| Marks a widget as raised.
void | RaiseWidgetWhenLowered (WidgetID widget_index)
| Marks a widget as raised and dirty (redraw), when it is marked as lowered.
bool | IsWidgetLowered (WidgetID widget_index) const
| Gets the lowered state of a widget.
void | UnfocusFocusedWidget ()
| Makes no widget on this window have focus.
bool | SetFocusedWidget (WidgetID widget_index)
| Set focus within this window to the given widget.
EventState | HandleEditBoxKey (WidgetID wid, char32_t key, uint16_t keycode)
| Process keypress for editbox widget.
virtual void | InsertTextString (WidgetID wid, std::string_view str, bool marked, std::optional< size_t > caret, std::optional< size_t > insert_location, std::optional< size_t > replacement_end)
| Insert a text string at the cursor position into the edit box widget.
void | HandleButtonClick (WidgetID widget)
| Do all things to make a button look clicked and mark it to be unclicked in a few ticks.
int | GetRowFromWidget (int clickpos, WidgetID widget, int padding, int line_height=-1) const
| Compute the row of a widget that a user clicked in.
void | RaiseButtons (bool autoraise=false)
| Raise the buttons of the window.
template<typename... Args>
void | SetWidgetsDisabledState (bool disab_stat, Args... widgets)
| Sets the enabled/disabled status of a list of widgets.
template<typename... Args>
void | SetWidgetsLoweredState (bool lowered_stat, Args... widgets)
| Sets the lowered/raised status of a list of widgets.
template<typename... Args>
void | RaiseWidgetsWhenLowered (Args... widgets)
| Raises the widgets and sets widgets dirty that are lowered.
void | SetWidgetDirty (WidgetID widget_index) const
| Invalidate a widget, i.e.
void | DrawWidgets () const
| Paint all widgets of a window.
void | DrawViewport () const
| Draw the viewport of this window.
void | DrawSortButtonState (WidgetID widget, SortButtonState state) const
| Draw a sort button's up or down arrow symbol.
Window * | FindChildWindow (WindowClass wc=WC_INVALID) const
| Find the Window whose parent pointer points to this window.
Window * | FindChildWindowById (WindowClass wc, WindowNumber number) const
| Find the Window whose parent pointer points to this window.
void | CloseChildWindows (WindowClass wc=WC_INVALID) const
| Close all children a window might have in a head-recursive manner.
void | CloseChildWindowById (WindowClass wc, WindowNumber number) const
| Close all children a window might have in a head-recursive manner.
virtual void | Close (int data=0)
| Hide the window and all its child windows, and mark them for a later deletion.
void | SetDirty () const
| Mark entire window as dirty (in need of re-paint)
void | ReInit (int rx=0, int ry=0, bool reposition=false)
| Re-initialize a window, and optionally change its size.
bool | IsShaded () const
| Is window shaded currently?
void | SetShaded (bool make_shaded)
| Set the shaded state of the window to make_shaded.
void | ScheduleResize ()
| Mark this window as resized and in need of OnResize() event.
void | ProcessScheduledResize ()
| Process scheduled OnResize() event.
void | InvalidateData (int data=0, bool gui_scope=true)
| Mark this window's data as invalid (in need of re-computing)
void | ProcessScheduledInvalidations ()
| Process all scheduled invalidations.
void | ProcessHighlightedInvalidations ()
| Process all invalidation of highlighted widgets.
virtual void | OnInit ()
| Notification that the nested widget tree gets initialized.
virtual void | ApplyDefaults ()
| Read default values from WindowDesc configuration an apply them to the window.
virtual Point | OnInitialPosition (int16_t sm_width, int16_t sm_height, int window_number)
| Compute the initial position of the window.
virtual void | OnPaint ()
| The window must be repainted.
virtual void | DrawWidget (const Rect &r, WidgetID widget) const
| Draw the contents of a nested widget.
virtual void | UpdateWidgetSize (WidgetID widget, Dimension &size, const Dimension &padding, Dimension &fill, Dimension &resize)
| Update size and resize step of a widget in the window.
virtual std::string | GetWidgetString (WidgetID widget, StringID stringid) const
| Get the raw string for a widget.
virtual void | OnFocus ()
| The window has gained focus.
virtual void | OnFocusLost (bool closing)
| The window has lost focus.
virtual EventState | OnKeyPress (char32_t key, uint16_t keycode)
| A key has been pressed.
virtual EventState | OnHotkey (int hotkey)
| A hotkey has been pressed.
virtual EventState | OnCTRLStateChange ()
| The state of the control key has changed.
virtual void | OnClick (Point pt, WidgetID widget, int click_count)
| A click with the left mouse button has been made on the window.
virtual bool | OnRightClick (Point pt, WidgetID widget)
| A click with the right mouse button has been made on the window.
virtual void | OnHover (Point pt, WidgetID widget)
| The mouse is hovering over a widget in the window, perform an action for it.
virtual bool | OnTooltip (Point pt, WidgetID widget, TooltipCloseCondition close_cond)
| Event to display a custom tooltip.
virtual void | OnMouseDrag (Point pt, WidgetID widget)
| An 'object' is being dragged at the provided position, highlight the target if possible.
virtual void | OnDragDrop (Point pt, WidgetID widget)
| A dragged 'object' has been released.
virtual void | OnScroll (Point delta)
| Handle the request for (viewport) scrolling.
virtual void | OnScrollbarScroll (WidgetID widget)
| Notify window that a scrollbar position has been updated.
virtual void | OnMouseOver (Point pt, WidgetID widget)
| The mouse is currently moving over the window or has just moved outside of the window.
virtual void | OnMouseWheel (int wheel, WidgetID widget)
| The mouse wheel has been turned.
virtual void | OnMouseLoop ()
| Called for every mouse loop run, which is at least once per (game) tick.
virtual void | OnGameTick ()
| Called once per (game) tick.
virtual void | OnRealtimeTick (uint delta_ms)
| Called periodically.
virtual void | OnTimeout ()
| Called when this window's timeout has been reached.
virtual void | OnResize ()
| Called after the window got resized.
virtual void | OnDropdownSelect (WidgetID widget, int index, int click_result)
| A dropdown option associated to this window has been selected.
virtual void | OnDropdownClose (Point pt, WidgetID widget, int index, int click_result, bool instant_close)
| A dropdown window associated to this window has been closed.
virtual void | OnEditboxChanged (WidgetID widget)
| The text in an editbox has been edited.
virtual void | OnQueryTextFinished (std::optional< std::string > str)
| The query window opened from this window has closed.
virtual void | OnInvalidateData (int data=0, bool gui_scope=true)
| Some data on this window has become invalid.
virtual void | OnPlaceObject (Point pt, TileIndex tile)
| The user clicked some place on the map when a tile highlight mode has been set.
virtual bool | OnVehicleSelect (const struct Vehicle *v)
| The user clicked on a vehicle while HT_VEHICLE has been set.
virtual bool | OnVehicleSelect (VehicleList::const_iterator begin, VehicleList::const_iterator end)
| The user clicked on a vehicle while HT_VEHICLE has been set.
virtual void | OnPlaceObjectAbort ()
| The user cancelled a tile highlight mode that has been set.
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.
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.
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 been set to 'PRESIZE' mode.
virtual bool | IsNewGRFInspectable () const
| Is the data related to this window NewGRF inspectable?
virtual void | ShowNewGRFInspectWindow () const
| Show the NewGRF inspection window.
template<>
const NWidgetBase * | GetWidget (WidgetID widnum) const
| Specialized case of Window::GetWidget for the nested widget base class.

## Static Public Member Functions
static int | SortButtonWidth ()
| Get width of up/down arrow of sort button state.
static void | DeleteClosedWindows ()
| Delete all closed windows.

## Data Fields
WindowDesc & | window_desc
| Window description.
WindowFlags | flags {}
| Window flags.
WindowClass | window_class {}
| Window class.
WindowNumber | window_number = 0
| Window number within the window class.
int | scale = 0
| Scale of this window – used to determine how to resize.
uint8_t | timeout_timer = 0
| Timer value of the WindowFlag::Timeout for flags.
uint8_t | white_border_timer = 0
| Timer value of the WindowFlag::WhiteBorder for flags.
int | left = 0
| x position of left edge of the window
int | top = 0
| y position of top edge of the window
int | width = 0
| width of the window (number of pixels to the right in x direction)
int | height = 0
| Height of the window (number of pixels down in y direction)
ResizeInfo | resize {}
| Resize information.
Owner | owner = INVALID_OWNER
| The owner of the content shown in this window. Company colour is acquired from this variable.
std::unique_ptr< ViewportData > | viewport
| Pointer to viewport data, if present.
const NWidgetCore * | nested_focus = nullptr
| Currently focused nested widget, or `nullptr` if no nested widget has focus.
std::map< WidgetID, QueryString * > | querystrings {}
| QueryString associated to WWT_EDITBOX widgets.
std::unique_ptr< NWidgetBase > | nested_root {}
| Root of the nested tree.
WidgetLookup | widget_lookup {}
| Indexed access to the nested widget tree. Do not access directly, use Window::GetWidget() instead.
NWidgetStacked * | shade_select = nullptr
| Selection widget (NWID_SELECTION) to use for shading the window. If `nullptr`, window cannot shade.
Dimension | unshaded_size {}
| Last known unshaded size (only valid while shaded).
WidgetID | mouse_capture_widget = INVALID_WIDGET
| ID of current mouse capture widget (e.g. dragged scrollbar). `INVALID_WIDGET` if no widget has mouse capture.
Window * | parent = nullptr
| Parent window.
WindowList::iterator | z_position {}

## Protected Member Functions
void | InitializeData (WindowNumber window_number)
| Initializes the data (except the position and initial size) of a new Window.
void | InitializePositionSize (int x, int y, int min_width, int min_height)
| Set the position and smallest size of the window.
virtual void | FindWindowPlacementAndResize (int def_width, int def_height, bool allow_resize)
| Resize window towards the default size.
virtual | ~Window ()
| Remove window and all its child windows from the window stack.

## Protected Attributes
std::vector< int > | scheduled_invalidation_data {}
| Data of scheduled OnInvalidateData() calls.
bool | scheduled_resize = false
| Set if window has been resized.

## Static Private Attributes
static std::vector< Window * > | closed_windows
| List of closed windows to delete.

## Detailed Description

Data structure for an opened window.

Definition at line 274 of file window_gui.h.

## Member Typedef Documentation

## ◆ Iterate

using Window::Iterate = AllWindows<false>

Iterate all windows in whatever order is easiest.

Definition at line 933 of file window_gui.h.

## ◆ IterateFromBack

using Window::IterateFromBack = AllWindows<false>

Iterate all windows in Z order from back to front.

Definition at line 934 of file window_gui.h.

## ◆ IterateFromFront

using Window::IterateFromFront = AllWindows<true>

Iterate all windows in Z order from front to back.

Definition at line 935 of file window_gui.h.

## ◆ IteratorToBack

using Window::IteratorToBack = WindowIterator<true>

Iterate in Z order towards back.

Definition at line 912 of file window_gui.h.

## ◆ IteratorToFront

using Window::IteratorToFront = WindowIterator<false>

Iterate in Z order towards front.

Definition at line 911 of file window_gui.h.

## Constructor & Destructor Documentation

## ◆ ~Window()

Window::~Window | ( |  | ) |
| protectedvirtual

Remove window and all its child windows from the window stack.

Definition at line 1139 of file window.cpp.

## ◆ Window()

Window::Window | ( | WindowDesc & | desc | ) |

Empty constructor, initialization has been moved to InitNested() called from the constructor of the derived class.

Parameters

  desc | The description of the window.

Definition at line 1830 of file window.cpp.

References _z_windows.

## Member Function Documentation

## ◆ ApplyDefaults()

void Window::ApplyDefaults | ( |  | ) |
| virtual

Read default values from WindowDesc configuration an apply them to the window.

Definition at line 193 of file window.cpp.

References flags, nested_root, WindowDesc::pref_sticky, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), Sticky, window_desc, and WWT_STICKYBOX.

Referenced by FinishInitNested().

## ◆ Close()

void Window::Close | ( | int | data = `0` | ) |
| virtual

Hide the window and all its child windows, and mark them for a later deletion.

Reimplemented in SmallMapWindow, AIConfigWindow, BuildAirToolbarWindow, BuildAirportWindow, BootstrapErrorWindow, BootstrapContentDownloadStatusWindow, BootstrapAskForDownloadWindow, IConsoleWindow, DepotWindow, BuildDocksToolbarWindow, BuildDocksStationWindow, DropdownWindow, ErrmsgWindow, SaveLoadWindow, GSConfigWindow, EndGameWindow, HighScoreWindow, QueryStringWindow, QueryWindow, NetworkChatWindow, NetworkContentDownloadStatusWindow, NetworkContentListWindow, BaseNetworkContentDownloadStatusWindow, NetworkAskRelayWindow, NewGRFWindow, PickerWindow, BuildRailToolbarWindow, BuildRailStationWindow, BuildSignalWindow, BuildRoadToolbarWindow, BuildRoadStationWindow, GameOptionsWindow, StationViewWindow, SelectStationWindow< T >, TownViewWindow, VehicleViewWindow, WaypointWindow, and PickerWindowBase.

Definition at line 1102 of file window.cpp.

References _last_scroll_window, _mouseover_last_w, CloseChildWindows(), closed_windows, OnFocusLost(), querystrings, ResetObjectToPlace(), SetDirty(), TileHighlightData::window_class, and TileHighlightData::window_number.

Referenced by CheckSoftLimit(), SmallMapWindow::Close(), AIConfigWindow::Close(), BuildAirToolbarWindow::Close(), BootstrapErrorWindow::Close(), BootstrapAskForDownloadWindow::Close(), IConsoleWindow::Close(), DepotWindow::Close(), BuildDocksToolbarWindow::Close(), DropdownWindow::Close(), ErrmsgWindow::Close(), SaveLoadWindow::Close(), GSConfigWindow::Close(), EndGameWindow::Close(), HighScoreWindow::Close(), QueryStringWindow::Close(), QueryWindow::Close(), NetworkChatWindow::Close(), NetworkContentListWindow::Close(), BaseNetworkContentDownloadStatusWindow::Close(), NetworkAskRelayWindow::Close(), NewGRFWindow::Close(), BuildRailToolbarWindow::Close(), BuildRoadToolbarWindow::Close(), GameOptionsWindow::Close(), StationViewWindow::Close(), SelectStationWindow< T >::Close(), TownViewWindow::Close(), VehicleViewWindow::Close(), WaypointWindow::Close(), PickerWindowBase::Close(), CloseAllNonVitalWindows(), CloseChildWindowById(), CloseChildWindows(), CloseConstructionWindows(), CloseNonVitalWindows(), CloseWindowById(), DeleteRenameSignWindow(), DispatchLeftClickEvent(), DispatchRightClickEvent(), HideActiveNewsMessage(), BuildBridgeWindow::OnClick(), SelectCompanyManagerFaceWindow::OnClick(), BuyCompanyWindow::OnClick(), SetDateWindow::OnClick(), EnginePreviewWindow::OnClick(), GoalQuestionWindow::OnClick(), EndGameHighScoreBaseWindow::OnClick(), NetworkAskSurveyWindow::OnClick(), SavePresetWindow::OnClick(), NewsWindow::OnClick(), OskWindow::OnClick(), ScriptListWindow::OnClick(), SignWindow::OnClick(), RefitWindow::OnClick(), OskWindow::OnFocusLost(), EnginePreviewWindow::OnInvalidateData(), LinkGraphLegendWindow::OnInvalidateData(), ScriptListWindow::OnInvalidateData(), ScriptSettingsWindow::OnInvalidateData(), ScriptTextfileWindow::OnInvalidateData(), BuildBridgeWindow::OnKeyPress(), EndGameHighScoreBaseWindow::OnKeyPress(), TooltipsWindow::OnMouseLoop(), SignWindow::OnPlaceObject(), StationJoinerNeeded(), and UnInitWindowSystem().

## ◆ CloseChildWindowById()

void Window::CloseChildWindowById | ( | WindowClass | wc,
|  | WindowNumber | number
| ) |  | const

Close all children a window might have in a head-recursive manner.

Parameters

  wc | Window class of the window to remove.
  number | Window number of the window to remove.

Definition at line 1090 of file window.cpp.

References Close(), and FindChildWindowById().

Referenced by ShowBaseSetTextfileWindow(), and ShowScriptTextfileWindow().

## ◆ CloseChildWindows()

void Window::CloseChildWindows | ( | WindowClass | wc = `WC_INVALID` | ) | const

Close all children a window might have in a head-recursive manner.

Parameters

  wc | Window class of the window to remove; WC_INVALID if class does not matter

Definition at line 1075 of file window.cpp.

References Close(), and FindChildWindow().

Referenced by NewGRFWindow::AddGRFToActive(), Close(), NewGRFConfirmationCallback(), GSConfigWindow::OnClick(), NewGRFParametersWindow::OnClick(), NewGRFWindow::OnClick(), OrdersWindow::OnClick(), ScriptSettingsWindow::OnClick(), TimetableWindow::OnClick(), BuildVehicleWindow::OnDropdownSelect(), PickerWindow::OnDropdownSelect(), NewGRFWindow::OnDropdownSelect(), CompanyStationsWindow::OnDropdownSelect(), GSConfigWindow::OnInvalidateData(), VehicleGroupWindow::OnInvalidateData(), NewGRFParametersWindow::OnInvalidateData(), OrdersWindow::OnInvalidateData(), ScriptSettingsWindow::OnInvalidateData(), TimetableWindow::OnInvalidateData(), NewGRFWindow::OnKeyPress(), NewGRFWindow::OnNewGRFsScanned(), VehicleGroupWindow::OnPaint(), VehicleListWindow::OnPaint(), and NewGRFWindow::UpgradeCurrent().

## ◆ CreateNestedTree()

void Window::CreateNestedTree | ( |  | ) |

Perform the first part of the initialization of a nested widget tree.

Construct a nested widget tree in nested_root, and optionally fill the widget_lookup array to provide quick access to the uninitialized widgets. This is mainly useful for setting very basic properties.

Parameters

  fill_nested | Fill the widget_lookup (enabling is expensive!).

Note
  Filling the nested array requires an additional traversal through the nested widget tree, and is best performed by FinishInitNested rather than here.

Definition at line 1797 of file window.cpp.

References MakeWindowNWidgetTree(), nested_root, WindowDesc::nwid_parts, widget_lookup, and window_desc.

Referenced by DropdownWindow::DropdownWindow(), InitNested(), NetworkChatWindow::NetworkChatWindow(), NetworkContentListWindow::NetworkContentListWindow(), SavePresetWindow::SavePresetWindow(), ScriptDebugWindow::ScriptDebugWindow(), ScriptListWindow::ScriptListWindow(), ScriptSettingsWindow::ScriptSettingsWindow(), VehicleDetailsWindow::VehicleDetailsWindow(), and WaypointWindow::WaypointWindow().

## ◆ DeleteClosedWindows()

void Window::DeleteClosedWindows | ( |  | ) |
| static

Delete all closed windows.

Definition at line 68 of file window.cpp.

References _z_windows, and closed_windows.

Referenced by InputLoop(), and UnInitWindowSystem().

## ◆ DisableAllWidgetHighlight()

void Window::DisableAllWidgetHighlight | ( |  | ) |

Disable the highlighted status of all widgets.

Definition at line 223 of file window.cpp.

References flags, Highlighted, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), NWidgetBase::SetDirty(), and widget_lookup.

## ◆ DisableWidget()

void Window::DisableWidget | ( | WidgetID | widget_index | ) |
| inline

Sets a widget to disabled.

Parameters

  widget_index | index of this widget in the window

Definition at line 392 of file window_gui.h.

References SetWidgetDisabledState().

Referenced by TextfileWindow::AppendHistory(), CustomCurrencyWindow::OnClick(), NewGRFWindow::OnInvalidateData(), TimetableWindow::OnPaint(), BuildRailToolbarWindow::OnPlaceObjectAbort(), and BuildRoadToolbarWindow::UpdateOptionWidgetStatus().

## ◆ DrawSortButtonState()

void Window::DrawSortButtonState | ( | WidgetID | widget,
|  | SortButtonState | state
| ) |  | const

Draw a sort button's up or down arrow symbol.

Parameters

  widget | Sort button widget
  state | State of sort button

Definition at line 798 of file widget.cpp.

References _current_text_dir, SA_CENTER, SBS_DOWN, SBS_OFF, TD_LTR, widget_lookup, and Rect::WithWidth().

Referenced by ReplaceVehicleWindow::DrawWidget(), BuildBridgeWindow::DrawWidget(), BuildVehicleWindow::DrawWidget(), SaveLoadWindow::DrawWidget(), VehicleGroupWindow::DrawWidget(), IndustryDirectoryWindow::DrawWidget(), NetworkGameWindow::DrawWidget(), CompanyStationsWindow::DrawWidget(), TownDirectoryWindow::DrawWidget(), VehicleListWindow::DrawWidget(), NetworkContentListWindow::OnPaint(), and StationViewWindow::OnPaint().

## ◆ DrawViewport()

void Window::DrawViewport | ( |  | ) | const

Draw the viewport of this window.

Definition at line 1903 of file viewport.cpp.

References left, PFE_DRAWWORLD, top, and viewport.

Referenced by NWidgetViewport::Draw().

## ◆ DrawWidget()

virtual void Window::DrawWidget | ( | const Rect & | r,
|  | WidgetID | widget
| ) |  | const
| inlinevirtual

Draw the contents of a nested widget.

Parameters

  r | Rectangle occupied by the widget.
  widget | Number of the widget to draw.

Note
  This method may not change any state, it may only use drawing functions.

Reimplemented in AIConfigWindow, BuildAirportWindow, ReplaceVehicleWindow, BootstrapErrorWindow, BootstrapAskForDownloadWindow, BuildBridgeWindow, BuildVehicleWindow, CheatWindow, CompanyFinancesWindow, SelectCompanyLiveryWindow, SelectCompanyManagerFaceWindow, CompanyInfrastructureWindow, CompanyWindow, BuyCompanyWindow, DepotWindow, BuildDocksDepotWindow, DropdownWindow, EnginePreviewWindow, ErrmsgWindow, SaveLoadWindow, FramerateWindow, FrametimeGraphWindow, GSConfigWindow, GenerateProgressWindow, GoalQuestionWindow, GraphLegendWindow, BaseGraphWindow, BaseCargoGraphWindow, PerformanceRatingDetailWindow, VehicleGroupWindow, BuildIndustryWindow, IndustryDirectoryWindow, IndustryCargoesWindow, SelectGameWindow, PerformanceLeagueWindow, ScriptLeagueWindow, LinkGraphLegendWindow, LandInfoWindow, AboutWindow, TooltipsWindow, QueryWindow, MusicTrackSelectionWindow, MusicWindow, NetworkContentListWindow, BaseNetworkContentDownloadStatusWindow, NetworkGameWindow, NetworkStartServerWindow, NetworkClientListWindow, NetworkJoinStatusWindow, NetworkAskRelayWindow, NetworkAskSurveyWindow, NewGRFInspectWindow, SpriteAlignerWindow, NewGRFParametersWindow, NewGRFWindow, SavePresetWindow, ScanProgressWindow, NewsWindow, MessageHistoryWindow, BuildObjectWindow, OrdersWindow, OskWindow, PickerWindow, BuildRailStationWindow, BuildSignalWindow, BuildRailDepotWindow, BuildRoadDepotWindow, BuildRoadStationWindow, ScriptListWindow, ScriptSettingsWindow, ScriptDebugWindow, GameOptionsWindow, SignListWindow, SmallMapWindow, CompanyStationsWindow, SelectStationWindow< T >, StatusBarWindow, StoryBookWindow, SubsidyListWindow, ScenarioEditorLandscapeGenerationWindow, TextfileWindow, TimetableWindow, ScenarioEditorToolbarWindow, TownAuthorityWindow, TownViewWindow, TownDirectoryWindow, BuildHouseWindow, TransparenciesWindow, BuildTreesWindow, RefitWindow, VehicleListWindow, VehicleDetailsWindow, VehicleViewWindow, and BootstrapBackground.

Definition at line 607 of file window_gui.h.

Referenced by NWidgetBackground::Draw(), and NWidgetLeaf::Draw().

## ◆ DrawWidgets()

void Window::DrawWidgets | ( |  | ) | const

Paint all widgets of a window.

Definition at line 766 of file widget.cpp.

References _string_colourmap, _window_highlight_colour, BorderOnly, DrawFrameRect(), Rect::Expand(), flags, GfxFillRect(), height, Highlighted, nested_root, WidgetDimensions::scaled, Rect::Shrink(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), WhiteBorder, widget_lookup, and width.

Referenced by OnPaint(), BuildAirportWindow::OnPaint(), ReplaceVehicleWindow::OnPaint(), BuildVehicleWindow::OnPaint(), CompanyFinancesWindow::OnPaint(), SelectCompanyLiveryWindow::OnPaint(), CompanyWindow::OnPaint(), DepotWindow::OnPaint(), BuildDocksStationWindow::OnPaint(), SaveLoadWindow::OnPaint(), GSConfigWindow::OnPaint(), CreateScenarioWindow::OnPaint(), GoalListWindow::OnPaint(), VehicleGroupWindow::OnPaint(), IndustryViewWindow::OnPaint(), IndustryDirectoryWindow::OnPaint(), PerformanceLeagueWindow::OnPaint(), ScriptLeagueWindow::OnPaint(), MainWindow::OnPaint(), NetworkContentListWindow::OnPaint(), NetworkGameWindow::OnPaint(), NewGRFParametersWindow::OnPaint(), OrdersWindow::OnPaint(), BuildRailStationWindow::OnPaint(), BuildRoadStationWindow::OnPaint(), ScreenshotWindow::OnPaint(), ScriptSettingsWindow::OnPaint(), ScriptDebugWindow::OnPaint(), GameOptionsWindow::OnPaint(), SignListWindow::OnPaint(), CompanyStationsWindow::OnPaint(), StationViewWindow::OnPaint(), StoryBookWindow::OnPaint(), ScenarioEditorLandscapeGenerationWindow::OnPaint(), TimetableWindow::OnPaint(), MainToolbarWindow::OnPaint(), ScenarioEditorToolbarWindow::OnPaint(), TownAuthorityWindow::OnPaint(), TownViewWindow::OnPaint(), TownDirectoryWindow::OnPaint(), TransparenciesWindow::OnPaint(), RefitWindow::OnPaint(), VehicleListWindow::OnPaint(), VehicleDetailsWindow::OnPaint(), VehicleViewWindow::OnPaint(), and WaypointWindow::OnPaint().

## ◆ EnableWidget()

void Window::EnableWidget | ( | WidgetID | widget_index | ) |
| inline

Sets a widget to Enabled.

Parameters

  widget_index | index of this widget in the window

Definition at line 401 of file window_gui.h.

References SetWidgetDisabledState().

Referenced by TextfileWindow::AppendHistory(), CustomCurrencyWindow::OnClick(), and SelectCompanyLiveryWindow::OnInvalidateData().

## ◆ FindChildWindow()

Window * Window::FindChildWindow | ( | WindowClass | wc = `WC_INVALID` | ) | const

Find the Window whose parent pointer points to this window.

Parameters

  wc | Window class of the window to find; WC_INVALID if class does not matter

Returns
  a Window pointer that is the child of this window, or `nullptr` otherwise

Definition at line 1047 of file window.cpp.

References WC_INVALID.

Referenced by CloseChildWindows().

## ◆ FindChildWindowById()

Window * Window::FindChildWindowById | ( | WindowClass | wc,
|  | WindowNumber | number
| ) |  | const

Find the Window whose parent pointer points to this window.

Parameters

  wc | Window class of the window to find.
  number | Window number of the window to find.

Returns
  a Window pointer that is the child of this window, or `nullptr` otherwise

Definition at line 1062 of file window.cpp.

Referenced by CloseChildWindowById().

## ◆ FindWindowPlacementAndResize()

void Window::FindWindowPlacementAndResize | ( | int | def_width,
|  | int | def_height,
|  | bool | allow_resize
| ) |  |
| protectedvirtual

Resize window towards the default size.

Prior to construction, a position for the new window (for its default size) has been found with LocalGetWindowPlacement(). Initially, the window is constructed with minimal size. Resizing the window to its default size is done here.

Parameters

  def_width | default width in pixels of the window
  def_height | default height in pixels of the window
  allow_resize | Set if resizing is permitted.

See also
  Window::Window(), Window::InitializeData(), Window::InitializePositionSize()

Reimplemented in CompanyInfrastructureWindow, NetworkChatWindow, StatusBarWindow, MainToolbarWindow, ScenarioEditorToolbarWindow, QueryWindow, NetworkAskRelayWindow, and NetworkAskSurveyWindow.

Definition at line 1474 of file window.cpp.

References FindWindowById(), height, left, OnResize(), resize, ResizeWindow(), SetDirty(), ResizeInfo::step_height, ResizeInfo::step_width, top, viewport, WC_MAIN_TOOLBAR, WC_STATUS_BAR, and width.

Referenced by CompanyInfrastructureWindow::FindWindowPlacementAndResize(), NetworkChatWindow::FindWindowPlacementAndResize(), StatusBarWindow::FindWindowPlacementAndResize(), MainToolbarWindow::FindWindowPlacementAndResize(), ScenarioEditorToolbarWindow::FindWindowPlacementAndResize(), FinishInitNested(), and ReInit().

## ◆ FinishInitNested()

void Window::FinishInitNested | ( | WindowNumber | window_number = `0` | ) |

Perform the second part of the initialization of a nested widget tree.

Parameters

  window_number | Number of the new window.

Definition at line 1807 of file window.cpp.

References ApplyDefaults(), FindWindowPlacementAndResize(), WindowDesc::GetDefaultWidth(), InitializeData(), InitializePositionSize(), nested_root, OnInitialPosition(), window_desc, window_number, Coord2D< T >::x, and Coord2D< T >::y.

Referenced by DropdownWindow::DropdownWindow(), InitNested(), NetworkChatWindow::NetworkChatWindow(), NetworkContentListWindow::NetworkContentListWindow(), SavePresetWindow::SavePresetWindow(), ScriptDebugWindow::ScriptDebugWindow(), ScriptListWindow::ScriptListWindow(), ScriptSettingsWindow::ScriptSettingsWindow(), VehicleDetailsWindow::VehicleDetailsWindow(), and WaypointWindow::WaypointWindow().

## ◆ GetCaretPosition()

Point Window::GetCaretPosition | ( |  | ) | const
| virtual

Get the current caret position if an edit box has the focus.

Returns
  Top-left location of the caret, relative to the window.

Reimplemented in IConsoleWindow.

Definition at line 377 of file window.cpp.

References QueryString::GetCaretPosition(), GetQueryString(), nested_focus, NWidgetBase::type, and WWT_EDITBOX.

Referenced by SetCandidatePos(), and SetCompositionPos().

## ◆ GetFocusedTextbuf()

const Textbuf * Window::GetFocusedTextbuf | ( |  | ) | const
| virtual

Get the current input text buffer.

Returns
  The currently focused input text buffer or nullptr if no input focused.

Reimplemented in IConsoleWindow.

Definition at line 364 of file window.cpp.

References GetQueryString(), nested_focus, NWidgetBase::type, and WWT_EDITBOX.

## ◆ GetQueryString() [1/2]

QueryString * Window::GetQueryString | ( | WidgetID | widnum | ) |

Return the querystring associated to a editbox.

Parameters

  widnum | Editbox widget index

Returns
  QueryString or nullptr.

Definition at line 344 of file window.cpp.

References querystrings.

## ◆ GetQueryString() [2/2]

const QueryString * Window::GetQueryString | ( | WidgetID | widnum | ) | const

Return the querystring associated to a editbox.

Parameters

  widnum | Editbox widget index

Returns
  QueryString or nullptr.

Definition at line 333 of file window.cpp.

References querystrings.

Referenced by DispatchLeftClickEvent(), NWidgetLeaf::Draw(), GetCaretPosition(), GetFocusedTextbuf(), GetTextBoundingRect(), GetTextCharacterAtPosition(), HandleEditBoxKey(), and InsertTextString().

## ◆ GetRowFromWidget()

int Window::GetRowFromWidget | ( | int | clickpos,
|  | WidgetID | widget,
|  | int | padding,
|  | int | line_height = `-1`
| ) |  | const

Compute the row of a widget that a user clicked in.

Parameters

  clickpos | Vertical position of the mouse click.
  widget | Widget number of the widget clicked in.
  padding | Amount of empty space between the widget edge and the top of the first row.
  line_height | Height of a single row. A negative value means using the vertical resize step of the widget.

Returns
  Row number clicked at. If clicked at a wrong position, #INT_MAX is returned.

Note
  The widget does not know where a list printed at the widget ends, so below a list is not a wrong position.

Definition at line 212 of file window.cpp.

References NWidgetBase::pos_y, and NWidgetBase::resize_y.

Referenced by TextfileWindow::GetHyperlink(), Scrollbar::GetScrolledRowFromWidget(), BaseGraphWindow::OnClick(), MusicTrackSelectionWindow::OnClick(), TownAuthorityWindow::OnClick(), BaseGraphWindow::OnMouseOver(), NetworkClientListWindow::OnMouseOver(), and CheatWindow::OnTooltip().

## ◆ GetScrollbar() [1/2]

Scrollbar * Window::GetScrollbar | ( | WidgetID | widnum | ) |

Return the Scrollbar to a widget index.

Parameters

  widnum | Scrollbar widget index

Returns
  Scrollbar to the widget

Definition at line 323 of file window.cpp.

## ◆ GetScrollbar() [2/2]

const Scrollbar * Window::GetScrollbar | ( | WidgetID | widnum | ) | const

Return the Scrollbar to a widget index.

Parameters

  widnum | Scrollbar widget index

Returns
  Scrollbar to the widget

Definition at line 313 of file window.cpp.

Referenced by PickerWindow::BuildPickerClassList(), DispatchMouseWheelEvent(), FramerateWindow::DrawElementTimesColumn(), SelectCompanyManagerFaceWindow::DrawWidget(), CompanyInfrastructureWindow::DrawWidget(), FramerateWindow::DrawWidget(), PickerWindow::DrawWidget(), DropdownWindow::DropdownWindow(), TextfileWindow::GetHyperlink(), TextfileWindow::NavigateHistory(), TextfileWindow::NavigateToFile(), NetworkContentListWindow::NetworkContentListWindow(), SelectCompanyManagerFaceWindow::OnClick(), FramerateWindow::OnClick(), SelectCompanyManagerFaceWindow::OnResize(), CompanyInfrastructureWindow::OnResize(), FramerateWindow::OnResize(), PickerWindow::OnResize(), SavePresetWindow::SavePresetWindow(), ScriptDebugWindow::ScriptDebugWindow(), ScriptListWindow::ScriptListWindow(), ScriptSettingsWindow::ScriptSettingsWindow(), SelectCompanyManagerFaceWindow::UpdateData(), TextfileWindow::UpdateHistoryScrollpos(), and VehicleDetailsWindow::VehicleDetailsWindow().

## ◆ GetTextBoundingRect()

Rect Window::GetTextBoundingRect | ( | size_t | from,
|  | size_t | to
| ) |  | const
| virtual

Get the bounding rectangle for a text range if an edit box has the focus.

Parameters

  from | Start of the string range.
  to | End of the string range.

Returns
  Rectangle encompassing the string range, relative to the window.

Reimplemented in IConsoleWindow.

Definition at line 393 of file window.cpp.

References QueryString::GetBoundingRect(), GetQueryString(), nested_focus, NWidgetBase::type, and WWT_EDITBOX.

## ◆ GetTextCharacterAtPosition()

ptrdiff_t Window::GetTextCharacterAtPosition | ( | const Point & | pt | ) | const
| virtual

Get the character that is rendered at a position by the focused edit box.

Parameters

  pt | The position to test.

Returns
  Index of the character position or -1 if no character is at the position.

Reimplemented in IConsoleWindow.

Definition at line 408 of file window.cpp.

References QueryString::GetCharAtPosition(), GetQueryString(), nested_focus, NWidgetBase::type, and WWT_EDITBOX.

## ◆ GetWidget() [1/3]

template<class NWID >

NWID * Window::GetWidget | ( | WidgetID | widnum | ) |
| inline

Get the nested widget with number widnum from the nested widget tree.

Template Parameters

  NWID | Type of the nested widget.

Parameters

  widnum | Widget number of the widget to retrieve.

Returns
  The requested widget if it is instantiated, `nullptr` otherwise.

Definition at line 958 of file window_gui.h.

References widget_lookup.

## ◆ GetWidget() [2/3]

template<class NWID >

const NWID * Window::GetWidget | ( | WidgetID | widnum | ) | const
| inline

Get the nested widget with number widnum from the nested widget tree.

Template Parameters

  NWID | Type of the nested widget.

Parameters

  widnum | Widget number of the widget to retrieve.

Returns
  The requested widget if it is instantiated, `nullptr` otherwise.

Definition at line 983 of file window_gui.h.

Referenced by AddBadgeDropdownFilters(), DropdownWindow::Close(), QueryString::GetBoundingRect(), QueryString::GetCaretPosition(), QueryString::GetCharAtPosition(), LinkGraphOverlay::GetWidgetDpi(), HandleActiveWidget(), HandleScrollbarScrolling(), Scrollbar::SetCapacityFromWidget(), LinkGraphOverlay::SetCargoMask(), LinkGraphOverlay::SetCompanyMask(), and ShowDropDownList().

## ◆ GetWidget() [3/3]

template<>

const NWidgetBase * Window::GetWidget | ( | WidgetID | widnum | ) | const
| inline

Specialized case of Window::GetWidget for the nested widget base class.

Definition at line 969 of file window_gui.h.

References widget_lookup.

## ◆ GetWidgetString()

std::string Window::GetWidgetString | ( | WidgetID | widget,
|  | StringID | stringid
| ) |  | const
| virtual

Get the raw string for a widget.

Calls to this function are also made during initialization to measure the size (that is as part of InitNested()), during drawing, and while re-initializing the window. Only for widgets that render text initializing is requested.

Parameters

  widget | Widget number.
  stringid | StringID assigned to widget.

Returns
  raw string to display.

Reimplemented in AIConfigWindow, BuildAirportWindow, ReplaceVehicleWindow, BuildVehicleWindow, CompanyFinancesWindow, SelectCompanyLiveryWindow, CompanyInfrastructureWindow, CompanyWindow, BuyCompanyWindow, SetDateWindow, DepotWindow, ErrmsgWindow, FramerateWindow, FrametimeGraphWindow, GenerateLandscapeWindow, CreateScenarioWindow, GoalListWindow, GoalQuestionWindow, IndustryProductionGraphWindow, TownCargoGraphWindow, VehicleGroupWindow, GameManualTextfileWindow, BuildIndustryWindow, IndustryViewWindow, IndustryDirectoryWindow, IndustryCargoesWindow, ScriptLeagueWindow, AboutWindow, QueryStringWindow, QueryWindow, MusicTrackSelectionWindow, NetworkChatWindow, ContentTextfileWindow, NetworkStartServerWindow, NetworkClientListWindow, NewGRFInspectWindow, SpriteAlignerWindow, NewGRFParametersWindow, NewGRFTextfileWindow, NewGRFWindow, NewsWindow, BuildObjectWindow, OrdersWindow, OskWindow, PickerWindow, BuildRailToolbarWindow, BuildSignalWindow, BuildRoadToolbarWindow, ScriptListWindow, ScriptSettingsWindow, ScriptTextfileWindow, ScriptDebugWindow, BaseSetTextfileWindow, GameOptionsWindow, CustomCurrencyWindow, SignListWindow, SignWindow, SmallMapWindow, CompanyStationsWindow, StationViewWindow, StoryBookWindow, TimetableWindow, ScenarioEditorToolbarWindow, TownAuthorityWindow, TownViewWindow, TownDirectoryWindow, RefitWindow, VehicleListWindow, VehicleDetailsWindow, VehicleViewWindow, ExtraViewportWindow, and WaypointWindow.

Definition at line 504 of file window.cpp.

References GetString().

Referenced by AIConfigWindow::GetWidgetString(), BuildAirportWindow::GetWidgetString(), ReplaceVehicleWindow::GetWidgetString(), BuildVehicleWindow::GetWidgetString(), CompanyFinancesWindow::GetWidgetString(), SelectCompanyLiveryWindow::GetWidgetString(), CompanyInfrastructureWindow::GetWidgetString(), CompanyWindow::GetWidgetString(), BuyCompanyWindow::GetWidgetString(), SetDateWindow::GetWidgetString(), DepotWindow::GetWidgetString(), ErrmsgWindow::GetWidgetString(), FramerateWindow::GetWidgetString(), FrametimeGraphWindow::GetWidgetString(), GenerateLandscapeWindow::GetWidgetString(), CreateScenarioWindow::GetWidgetString(), GoalListWindow::GetWidgetString(), GoalQuestionWindow::GetWidgetString(), IndustryProductionGraphWindow::GetWidgetString(), TownCargoGraphWindow::GetWidgetString(), VehicleGroupWindow::GetWidgetString(), GameManualTextfileWindow::GetWidgetString(), BuildIndustryWindow::GetWidgetString(), IndustryViewWindow::GetWidgetString(), IndustryDirectoryWindow::GetWidgetString(), IndustryCargoesWindow::GetWidgetString(), ScriptLeagueWindow::GetWidgetString(), AboutWindow::GetWidgetString(), QueryStringWindow::GetWidgetString(), QueryWindow::GetWidgetString(), MusicTrackSelectionWindow::GetWidgetString(), NetworkChatWindow::GetWidgetString(), ContentTextfileWindow::GetWidgetString(), NetworkStartServerWindow::GetWidgetString(), NetworkClientListWindow::GetWidgetString(), NewGRFInspectWindow::GetWidgetString(), SpriteAlignerWindow::GetWidgetString(), NewGRFParametersWindow::GetWidgetString(), NewGRFTextfileWindow::GetWidgetString(), NewGRFWindow::GetWidgetString(), NewsWindow::GetWidgetString(), OrdersWindow::GetWidgetString(), OskWindow::GetWidgetString(), PickerWindow::GetWidgetString(), BuildRailToolbarWindow::GetWidgetString(), BuildSignalWindow::GetWidgetString(), BuildRoadToolbarWindow::GetWidgetString(), ScriptListWindow::GetWidgetString(), ScriptSettingsWindow::GetWidgetString(), ScriptTextfileWindow::GetWidgetString(), ScriptDebugWindow::GetWidgetString(), BaseSetTextfileWindow::GetWidgetString(), GameOptionsWindow::GetWidgetString(), CustomCurrencyWindow::GetWidgetString(), SignListWindow::GetWidgetString(), SignWindow::GetWidgetString(), SmallMapWindow::GetWidgetString(), CompanyStationsWindow::GetWidgetString(), StationViewWindow::GetWidgetString(), StoryBookWindow::GetWidgetString(), TimetableWindow::GetWidgetString(), ScenarioEditorToolbarWindow::GetWidgetString(), TownAuthorityWindow::GetWidgetString(), TownViewWindow::GetWidgetString(), TownDirectoryWindow::GetWidgetString(), RefitWindow::GetWidgetString(), VehicleListWindow::GetWidgetString(), VehicleDetailsWindow::GetWidgetString(), VehicleViewWindow::GetWidgetString(), ExtraViewportWindow::GetWidgetString(), and WaypointWindow::GetWidgetString().

## ◆ HandleButtonClick()

void Window::HandleButtonClick | ( | WidgetID | widget | ) |

Do all things to make a button look clicked and mark it to be unclicked in a few ticks.

Parameters

  widget | the widget to "click"

Definition at line 595 of file window.cpp.

References IsWidgetLowered(), LowerWidget(), SetTimeout(), SetWidgetDirty(), SndClickBeep(), TIMEOUT_DURATION, and timeout_timer.

Referenced by DispatchLeftClickEvent(), ReplaceVehicleWindow::OnClick(), SaveLoadWindow::OnClick(), GenerateLandscapeWindow::OnClick(), CreateScenarioWindow::OnClick(), BuildIndustryWindow::OnClick(), NetworkStartServerWindow::OnClick(), ScenarioEditorLandscapeGenerationWindow::OnClick(), and DepotWindow::OnDragDrop().

## ◆ HandleEditBoxKey()

EventState Window::HandleEditBoxKey | ( | WidgetID | wid,
|  | char32_t | key,
|  | uint16_t | keycode
| ) |  |

Process keypress for editbox widget.

Parameters

  wid | Editbox widget.
  key | the Unicode value of the key.
  keycode | the untranslated key code including shift state.

Returns
  ES_HANDLED if the key press has been handled and no other window should receive the event.

Definition at line 2561 of file window.cpp.

References QueryString::ACTION_CLEAR, QueryString::ACTION_DESELECT, QueryString::ACTION_NOTHING, QueryString::cancel_button, Textbuf::DeleteAll(), ES_HANDLED, ES_NOT_HANDLED, GetQueryString(), Textbuf::GetText(), HKPR_CANCEL, HKPR_CONFIRM, HKPR_CURSOR, HKPR_EDITING, HKPR_NOT_HANDLED, InvalidateData(), QueryString::ok_button, OnClick(), OnEditboxChanged(), SetWidgetDirty(), UnfocusFocusedWidget(), WC_OSK, WID_OSK_CANCEL, WID_OSK_OK, and window_class.

Referenced by HandleKeypress().

## ◆ InitializeData()

void Window::InitializeData | ( | WindowNumber | window_number | ) |
| protected

Initializes the data (except the position and initial size) of a new Window.

Parameters

  window_number | Number being assigned to the new window

Returns
  Window pointer of the newly created window

Precondition
  If nested widgets are used (widget is `nullptr`), nested_root and #nested_array_size must be initialized. In addition, widget_lookup is either `nullptr`, or already initialized.

Definition at line 1417 of file window.cpp.

References _current_text_dir, BringWindowToFront(), Centred, WindowDesc::cls, WindowDesc::default_pos, EditBoxInGlobalFocus(), flags, INVALID_OWNER, nested_focus, nested_root, OnInit(), owner, resize, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), SetFocusedWindow(), SetWhiteBorder(), ST_SMALLEST, ResizeInfo::step_height, ResizeInfo::step_width, TD_RTL, WC_DROPDOWN_MENU, WDP_CENTER, window_class, window_desc, window_number, and WWT_EDITBOX.

Referenced by FinishInitNested().

## ◆ InitializePositionSize()

void Window::InitializePositionSize | ( | int | x,
|  | int | y,
|  | int | sm_width,
|  | int | sm_height
| ) |  |
| protected

Set the position and smallest size of the window.

Parameters

  x | Offset in pixels from the left of the screen of the new window.
  y | Offset in pixels from the top of the screen of the new window.
  sm_width | Smallest width in pixels of the window.
  sm_height | Smallest height in pixels of the window.

Definition at line 1455 of file window.cpp.

References height, left, top, and width.

Referenced by FinishInitNested(), and ReInit().

## ◆ InitNested()

void Window::InitNested | ( | WindowNumber | window_number = `0` | ) |

Perform complete initialization of the Window with nested widgets, to allow use.

Parameters

  window_number | Number of the new window.

Definition at line 1820 of file window.cpp.

References CreateNestedTree(), and FinishInitNested().

Referenced by BaseNetworkContentDownloadStatusWindow::BaseNetworkContentDownloadStatusWindow(), BootstrapAskForDownloadWindow::BootstrapAskForDownloadWindow(), ScanProgressWindow::ScanProgressWindow(), and SetDateWindow::SetDateWindow().

## ◆ InsertTextString()

void Window::InsertTextString | ( | WidgetID | wid,
|  | std::string_view | str,
|  | bool | marked,
|  | std::optional< size_t > | caret,
|  | std::optional< size_t > | insert_location,
|  | std::optional< size_t > | replacement_end
| ) |  |
| virtual

Insert a text string at the cursor position into the edit box widget.

Parameters

  wid | Edit box widget.
  str | Text string to insert.

Reimplemented in IConsoleWindow.

Definition at line 2719 of file window.cpp.

References GetQueryString(), Textbuf::InsertString(), OnEditboxChanged(), and SetWidgetDirty().

Referenced by HandleTextInput().

## ◆ InvalidateData()

void Window::InvalidateData | ( | int | data = `0`,
|  | bool | gui_scope = `true`
| ) |  |

Mark this window's data as invalid (in need of re-computing)

Parameters

  data | The data to invalidate with
  gui_scope | Whether the function is called from GUI scope.

Definition at line 3234 of file window.cpp.

References OnInvalidateData(), scheduled_invalidation_data, and SetDirty().

Referenced by NewGRFWindow::AddGRFToActive(), ScriptDebugWindow::ChangeToScript(), ChangeVehicleWindow(), DoZoomInOutWindow(), HandleEditBoxKey(), InvalidateWindowClassesData(), InvalidateWindowData(), NetworkContentListWindow::NetworkContentListWindow(), NewGRFConfirmationCallback(), AIConfigWindow::OnClick(), SaveLoadWindow::OnClick(), GSConfigWindow::OnClick(), GenerateLandscapeWindow::OnClick(), BaseGraphWindow::OnClick(), NetworkContentListWindow::OnClick(), NewGRFInspectWindow::OnClick(), SpriteAlignerWindow::OnClick(), NewGRFParametersWindow::OnClick(), NewGRFWindow::OnClick(), OskWindow::OnClick(), BuildSignalWindow::OnClick(), ScriptDebugWindow::OnClick(), GameOptionsWindow::OnClick(), SignListWindow::OnClick(), TextfileWindow::OnClick(), RefitWindow::OnClick(), NetworkContentListWindow::OnConnect(), NetworkContentListWindow::OnDownloadComplete(), NewGRFWindow::OnDragDrop(), RefitWindow::OnDragDrop(), GenerateLandscapeWindow::OnDropdownSelect(), NewGRFWindow::OnDropdownSelect(), GameOptionsWindow::OnDropdownSelect(), BuildVehicleWindow::OnEditboxChanged(), SaveLoadWindow::OnEditboxChanged(), IndustryDirectoryWindow::OnEditboxChanged(), NetworkContentListWindow::OnEditboxChanged(), GameOptionsWindow::OnEditboxChanged(), TownDirectoryWindow::OnEditboxChanged(), NewGRFWindow::OnEditboxChanged(), ScriptDebugWindow::OnInit(), NetworkContentListWindow::OnKeyPress(), NewGRFWindow::OnKeyPress(), GenerateLandscapeWindow::OnQueryTextFinished(), NetworkClientListWindow::OnQueryTextFinished(), NewGRFWindow::OnQueryTextFinished(), NetworkContentListWindow::OnReceiveContentInfo(), ResetAllSettingsConfirmationCallback(), SignListWindow::SetFilterString(), and ShowIndustryCargoesWindow().

## ◆ IsNewGRFInspectable()

virtual bool Window::IsNewGRFInspectable | ( |  | ) | const
| inlinevirtual

Is the data related to this window NewGRF inspectable?

Returns
  true iff it is inspectable.

Reimplemented in IndustryViewWindow, LandInfoWindow, and VehicleViewWindow.

Definition at line 860 of file window_gui.h.

Referenced by NWidgetLeaf::SetupSmallestSize().

## ◆ IsShaded()

bool Window::IsShaded | ( |  | ) | const
| inline

Is window shaded currently?

Definition at line 560 of file window_gui.h.

References NWidgetStacked::shown_plane, and SZSP_HORIZONTAL.

Referenced by BringWindowToFrontById(), DispatchLeftClickEvent(), NWidgetLeaf::Draw(), FramerateWindow::GetWidgetString(), MaybeBringWindowToFront(), CompanyFinancesWindow::OnClick(), OnHotkey(), ReplaceVehicleWindow::OnPaint(), BuildVehicleWindow::OnPaint(), CompanyFinancesWindow::OnPaint(), CompanyWindow::OnPaint(), GoalListWindow::OnPaint(), IndustryViewWindow::OnPaint(), BuildRailStationWindow::OnPaint(), BuildRoadStationWindow::OnPaint(), SignListWindow::OnPaint(), StationViewWindow::OnPaint(), TownAuthorityWindow::OnPaint(), and UpdateWindows().

## ◆ IsWidgetDisabled()

bool Window::IsWidgetDisabled | ( | WidgetID | widget_index | ) | const
| inline

Gets the enabled/disabled status of a widget.

Parameters

  widget_index | index of this widget in the window

Returns
  status of the widget ie: disabled = true, enabled = false

Definition at line 411 of file window_gui.h.

Referenced by BuildRailClick_Remove(), PerformanceRatingDetailWindow::DrawWidget(), LinkGraphLegendWindow::DrawWidget(), ScriptDebugWindow::DrawWidgetCompanyButton(), HandlePlacePushButton(), PerformanceRatingDetailWindow::OnClick(), LinkGraphLegendWindow::OnClick(), NetworkGameWindow::OnClick(), PickerWindow::OnClick(), BuildRoadToolbarWindow::OnClick(), ScriptDebugWindow::OnClick(), MainToolbarWindow::OnClick(), DepotWindow::OnDragDrop(), DepotWindow::OnTimeout(), LinkGraphLegendWindow::OnTooltip(), RailToolbar_CtrlChanged(), RoadToolbar_CtrlChanged(), LinkGraphLegendWindow::SetOverlay(), and LinkGraphLegendWindow::UpdateOverlayCompanies().

## ◆ IsWidgetFocused()

bool Window::IsWidgetFocused | ( | WidgetID | widget_index | ) | const
| inline

Check if given widget is focused within this window.

Parameters

  widget_index | : index of the widget in the window to check

Returns
  true if given widget is the focused window in this window

Definition at line 421 of file window_gui.h.

Referenced by IsWidgetGloballyFocused(), and NetworkContentListWindow::OnKeyPress().

## ◆ IsWidgetGloballyFocused()

bool Window::IsWidgetGloballyFocused | ( | WidgetID | widget_index | ) | const
| inline

Check if given widget has user input focus.

This means that both the window has focus and that the given widget has focus within the window.

Parameters

  widget_index | : index of the widget in the window to check

Returns
  true if given widget is the focused window in this window and this window has focus

Definition at line 432 of file window_gui.h.

References IsWidgetFocused().

## ◆ IsWidgetHighlighted()

bool Window::IsWidgetHighlighted | ( | WidgetID | widget_index | ) | const

Gets the highlighted status of a widget.

Parameters

  widget_index | index of this widget in the window

Returns
  status of the widget ie: highlighted = true, not highlighted = false

Definition at line 271 of file window.cpp.

Referenced by DispatchLeftClickEvent().

## ◆ IsWidgetLowered()

bool Window::IsWidgetLowered | ( | WidgetID | widget_index | ) | const
| inline

Gets the lowered state of a widget.

Parameters

  widget_index | index of this widget in the window

Returns
  status of the widget ie: lowered = true, raised= false

Definition at line 492 of file window_gui.h.

Referenced by BuildRailClick_Remove(), BuildAirToolbarWindow::Close(), BuildDocksToolbarWindow::Close(), BuildRailToolbarWindow::Close(), BuildRoadToolbarWindow::Close(), BuildSignalWindow::DrawWidget(), HandleButtonClick(), HandlePlacePushButton(), IndustryCargoesWindow::NotifySmallmap(), CompanyWindow::OnClick(), DepotWindow::OnClick(), IndustryCargoesWindow::OnClick(), StationViewWindow::OnClick(), TownViewWindow::OnClick(), WaypointWindow::OnClick(), BuildRailToolbarWindow::OnCTRLStateChange(), ScenarioEditorLandscapeGenerationWindow::OnPaint(), BuildRailToolbarWindow::OnPlaceDrag(), BuildRailToolbarWindow::OnPlaceMouseUp(), BuildRoadToolbarWindow::OnPlaceMouseUp(), BuildRoadToolbarWindow::OnPlaceObject(), BuildAirToolbarWindow::OnPlaceObjectAbort(), BuildDocksToolbarWindow::OnPlaceObjectAbort(), BuildRailToolbarWindow::OnPlaceObjectAbort(), BuildRoadToolbarWindow::OnPlaceObjectAbort(), BuildRailToolbarWindow::OnRealtimeTick(), BuildRoadToolbarWindow::OnRealtimeTick(), SaveLoadWindow::OnTimeout(), RailToolbar_CtrlChanged(), RaiseWidgetWhenLowered(), RoadToolbar_CtrlChanged(), ToggleRailButton_Remove(), ToggleRoadButton_Remove(), BuildRoadToolbarWindow::UpdateOptionWidgetStatus(), LinkGraphLegendWindow::UpdateOverlayCargoes(), and LinkGraphLegendWindow::UpdateOverlayCompanies().

## ◆ LowerWidget()

void Window::LowerWidget | ( | WidgetID | widget_index | ) |
| inline

Marks a widget as lowered.

Parameters

  widget_index | index of this widget in the window

Definition at line 461 of file window_gui.h.

References SetWidgetLoweredState().

Referenced by BuildRailStationWindow::CheckSelectedSize(), HandleButtonClick(), HandlePlacePushButton(), SelectCompanyLiveryWindow::OnClick(), CompanyWindow::OnClick(), BuildDocksStationWindow::OnClick(), BuildDocksDepotWindow::OnClick(), PerformanceRatingDetailWindow::OnClick(), SpriteAlignerWindow::OnClick(), BuildRailStationWindow::OnClick(), BuildRailDepotWindow::OnClick(), BuildRoadDepotWindow::OnClick(), BuildRoadStationWindow::OnClick(), CompanyStationsWindow::OnClick(), StationViewWindow::OnClick(), BuildRailStationWindow::OnInit(), PerformanceRatingDetailWindow::OnInvalidateData(), BuildSignalWindow::OnInvalidateData(), VehicleDetailsWindow::OnPaint(), VehicleViewWindow::OnPaint(), and BuildTreesWindow::UpdateMode().

## ◆ OnClick()

virtual void Window::OnClick | ( | Point | pt,
|  | WidgetID | widget,
|  | int | click_count
| ) |  |
| inlinevirtual

A click with the left mouse button has been made on the window.

Parameters

  pt | the point inside the window that has been clicked.
  widget | the clicked widget.
  click_count | Number of fast consecutive clicks at same position

Reimplemented in AIConfigWindow, BuildAirToolbarWindow, BuildAirportWindow, ReplaceVehicleWindow, BootstrapErrorWindow, BootstrapAskForDownloadWindow, BuildBridgeWindow, BuildVehicleWindow, CheatWindow, CompanyFinancesWindow, SelectCompanyLiveryWindow, SelectCompanyManagerFaceWindow, CompanyWindow, BuyCompanyWindow, SetDateWindow, DepotWindow, BuildDocksToolbarWindow, BuildDocksStationWindow, BuildDocksDepotWindow, DropdownWindow, EnginePreviewWindow, SaveLoadWindow, FramerateWindow, GSConfigWindow, GenerateLandscapeWindow, CreateScenarioWindow, GenerateProgressWindow, GoalListWindow, GoalQuestionWindow, GraphLegendWindow, BaseGraphWindow, PerformanceHistoryGraphWindow, BaseCargoGraphWindow, PerformanceRatingDetailWindow, VehicleGroupWindow, HelpWindow, EndGameHighScoreBaseWindow, BuildIndustryWindow, IndustryViewWindow, IndustryDirectoryWindow, IndustryCargoesWindow, SelectGameWindow, ScriptLeagueWindow, LinkGraphLegendWindow, LandInfoWindow, QueryStringWindow, QueryWindow, MusicTrackSelectionWindow, MusicWindow, NetworkChatWindow, NetworkContentDownloadStatusWindow, NetworkContentListWindow, NetworkGameWindow, NetworkStartServerWindow, NetworkClientListWindow, NetworkJoinStatusWindow, NetworkAskRelayWindow, NetworkAskSurveyWindow, NewGRFInspectWindow, SpriteAlignerWindow, NewGRFParametersWindow, NewGRFWindow, SavePresetWindow, NewsWindow, MessageHistoryWindow, BuildObjectWindow, OrdersWindow, OskWindow, PickerWindow, BuildRailToolbarWindow, BuildRailStationWindow, BuildSignalWindow, BuildRailDepotWindow, BuildRoadToolbarWindow, BuildRoadDepotWindow, BuildRoadStationWindow, ScreenshotWindow, ScriptListWindow, ScriptSettingsWindow, ScriptDebugWindow, GameOptionsWindow, CustomCurrencyWindow, SignListWindow, SignWindow, SmallMapWindow, CompanyStationsWindow, StationViewWindow, SelectStationWindow< T >, StatusBarWindow, StoryBookWindow, SubsidyListWindow, TerraformToolbarWindow, ScenarioEditorLandscapeGenerationWindow, TextfileWindow, TimetableWindow, MainToolbarWindow, ScenarioEditorToolbarWindow, TownAuthorityWindow, TownViewWindow, TownDirectoryWindow, FoundTownWindow, BuildHouseWindow, TransparenciesWindow, BuildTreesWindow, RefitWindow, VehicleListWindow, VehicleDetailsWindow, VehicleViewWindow, ExtraViewportWindow, and WaypointWindow.

Definition at line 669 of file window_gui.h.

Referenced by DispatchLeftClickEvent(), HandleActiveWidget(), HandleEditBoxKey(), OskWindow::OnClick(), and OnHotkey().

## ◆ OnCTRLStateChange()

virtual EventState Window::OnCTRLStateChange | ( |  | ) |
| inlinevirtual

The state of the control key has changed.

Returns
  ES_HANDLED if the change has been handled and no other window should receive the event.

Reimplemented in DepotWindow, BuildRailToolbarWindow, and BuildRoadToolbarWindow.

Definition at line 660 of file window_gui.h.

References ES_NOT_HANDLED.

Referenced by HandleCtrlChanged().

## ◆ OnDragDrop()

virtual void Window::OnDragDrop | ( | Point | pt,
|  | WidgetID | widget
| ) |  |
| inlinevirtual

A dragged 'object' has been released.

Parameters

  pt | the point inside the window where the release took place.
  widget | the widget where the release took place.

Reimplemented in DepotWindow, VehicleGroupWindow, NewGRFWindow, OrdersWindow, and RefitWindow.

Definition at line 707 of file window_gui.h.

Referenced by HandleMouseDragDrop().

## ◆ OnDropdownClose()

void Window::OnDropdownClose | ( | Point | pt,
|  | WidgetID | widget,
|  | int | index,
|  | int | click_result,
|  | bool | instant_close
| ) |  |
| virtual

A dropdown window associated to this window has been closed.

Parameters

  pt | the point inside the window the mouse resides on after closure.
  widget | the widget (button) that the dropdown is associated with.
  index | the element in the dropdown that is selected.
  instant_close | whether the dropdown was configured to close on mouse up.

Reimplemented in NetworkClientListWindow, GameOptionsWindow, GSConfigWindow, NewGRFParametersWindow, and ScriptSettingsWindow.

Definition at line 286 of file window.cpp.

References NWidgetCore::disp_flags, DropdownActive, GetWidgetFromPos(), NWID_BUTTON_DROPDOWN, OnDropdownSelect(), RaiseWidget(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), SetWidgetDirty(), NWidgetBase::type, Coord2D< T >::x, and Coord2D< T >::y.

Referenced by DropdownWindow::Close(), NetworkClientListWindow::OnDropdownClose(), and GameOptionsWindow::OnDropdownClose().

## ◆ OnDropdownSelect()

virtual void Window::OnDropdownSelect | ( | WidgetID | widget,
|  | int | index,
|  | int | click_result
| ) |  |
| inlinevirtual

A dropdown option associated to this window has been selected.

Parameters

  widget | the widget (button) that the dropdown is associated with.
  index | the element in the dropdown that is selected.

Reimplemented in BuildVehicleWindow, PickerWindow, BuildAirportWindow, ReplaceVehicleWindow, BuildBridgeWindow, SelectCompanyLiveryWindow, SetDateWindow, GSConfigWindow, GenerateLandscapeWindow, CreateScenarioWindow, VehicleGroupWindow, IndustryDirectoryWindow, IndustryCargoesWindow, MusicTrackSelectionWindow, NetworkStartServerWindow, NetworkClientListWindow, NewGRFParametersWindow, NewGRFWindow, OrdersWindow, ScriptSettingsWindow, GameOptionsWindow, CompanyStationsWindow, StationViewWindow, StoryBookWindow, TextfileWindow, MainToolbarWindow, ScenarioEditorToolbarWindow, TownDirectoryWindow, VehicleListWindow, and VehicleDetailsWindow.

Definition at line 770 of file window_gui.h.

Referenced by OnDropdownClose(), and DropdownWindow::OnMouseLoop().

## ◆ OnEditboxChanged()

virtual void Window::OnEditboxChanged | ( | WidgetID | widget | ) |
| inlinevirtual

The text in an editbox has been edited.

Parameters

  widget | The widget of the editbox.

Reimplemented in BuildVehicleWindow, SaveLoadWindow, IndustryDirectoryWindow, NetworkContentListWindow, NetworkGameWindow, PickerWindow, ScriptDebugWindow, GameOptionsWindow, TownDirectoryWindow, NetworkChatWindow, NewGRFWindow, OskWindow, and SignListWindow.

Definition at line 778 of file window_gui.h.

Referenced by HandleEditBoxKey(), InsertTextString(), and OskWindow::OnEditboxChanged().

## ◆ OnFocus()

void Window::OnFocus | ( |  | ) |
| virtual

The window has gained focus.

Called when window gains focus.

Reimplemented in IConsoleWindow.

Definition at line 513 of file window.cpp.

References VideoDriver::EditBoxGainedFocus(), VideoDriver::GetInstance(), nested_focus, NWidgetBase::type, and WWT_EDITBOX.

Referenced by SetFocusedWindow().

## ◆ OnFocusLost()

void Window::OnFocusLost | ( | bool | closing | ) |
| virtual

The window has lost focus.

Called when window loses focus.

Parameters

  closing | True iff the window has lost focus in the process of closing.

Reimplemented in DropdownWindow, OskWindow, and IConsoleWindow.

Definition at line 521 of file window.cpp.

References VideoDriver::EditBoxLostFocus(), VideoDriver::GetInstance(), nested_focus, NWidgetBase::type, and WWT_EDITBOX.

Referenced by Close(), and SetFocusedWindow().

## ◆ OnGameTick()

virtual void Window::OnGameTick | ( |  | ) |
| inlinevirtual

Called once per (game) tick.

Reimplemented in BaseGraphWindow, PerformanceRatingDetailWindow, VehicleGroupWindow, PerformanceLeagueWindow, CompanyStationsWindow, and VehicleListWindow.

Definition at line 746 of file window_gui.h.

Referenced by CallWindowGameTickEvent().

## ◆ OnHotkey()

EventState Window::OnHotkey | ( | int | hotkey | ) |
| virtual

A hotkey has been pressed.

Parameters

  hotkey | Hotkey index, by default a widget index of a button or editbox.

Returns
  ES_HANDLED if the key press has been handled, and the hotkey is not unavailable for some reason.

Reimplemented in MainWindow, OrdersWindow, PickerWindow, BuildRailToolbarWindow, BuildRoadToolbarWindow, MainToolbarWindow, ScenarioEditorToolbarWindow, and VehicleViewWindow.

Definition at line 570 of file window.cpp.

References ES_HANDLED, ES_NOT_HANDLED, NWidgetCore::IsDisabled(), IsShaded(), OnClick(), SetFocusedWidget(), SetFocusedWindow(), NWidgetBase::type, and WWT_EDITBOX.

Referenced by BuildAirToolbarWindow::AirportToolbarGlobalHotkeys(), BuildObjectWindow::BuildObjectGlobalHotkeys(), BuildRailStationWindow::BuildRailStationGlobalHotkeys(), BuildDocksToolbarWindow::DockToolbarGlobalHotkeys(), HandleKeypress(), HandleToolbarHotkey(), BuildRailToolbarWindow::OnHotkey(), BuildRoadToolbarWindow::OnHotkey(), VehicleViewWindow::OnHotkey(), BuildRailToolbarWindow::RailToolbarGlobalHotkeys(), BuildRoadToolbarWindow::RoadTramToolbarGlobalHotkeys(), ScriptDebugWindow::ScriptDebugGlobalHotkeys(), SignListWindow::SignListGlobalHotkeys(), ScenarioEditorLandscapeGenerationWindow::TerraformToolbarEditorGlobalHotkeys(), and TerraformToolbarWindow::TerraformToolbarGlobalHotkeys().

## ◆ OnHover()

virtual void Window::OnHover | ( | Point | pt,
|  | WidgetID | widget
| ) |  |
| inlinevirtual

The mouse is hovering over a widget in the window, perform an action for it.

Parameters

  pt | The point where the mouse is hovering.
  widget | The widget where the mouse is hovering.

Definition at line 685 of file window_gui.h.

Referenced by DispatchHoverEvent().

## ◆ OnInit()

virtual void Window::OnInit | ( |  | ) |
| inlinevirtual

Notification that the nested widget tree gets initialized.

The event can be used to perform general computations.

Note
  nested_root and/or widget_lookup (normally accessed via GetWidget()) may not exist during this call.

Reimplemented in ReplaceVehicleWindow, BuildVehicleWindow, CheatWindow, SelectCompanyManagerFaceWindow, CompanyInfrastructureWindow, IConsoleWindow, DepotWindow, BaseCargoGraphWindow, IndustryProductionGraphWindow, TownCargoGraphWindow, BuildIndustryWindow, IndustryViewWindow, IndustryDirectoryWindow, IndustryCargoesWindow, SelectGameWindow, LandInfoWindow, NetworkContentListWindow, NetworkGameWindow, NetworkClientListWindow, BuildObjectWindow, PickerWindow, BuildRailToolbarWindow, BuildRailStationWindow, BuildSignalWindow, BuildRoadToolbarWindow, ScriptDebugWindow, GameOptionsWindow, SignListWindow, SmallMapWindow, StationViewWindow, SubsidyListWindow, TerraformToolbarWindow, TextfileWindow, TownAuthorityWindow, FoundTownWindow, BuildHouseWindow, RefitWindow, and BaseVehicleListWindow.

Definition at line 579 of file window_gui.h.

Referenced by InitializeData(), and ReInit().

## ◆ OnInitialPosition()

Point Window::OnInitialPosition | ( | int16_t | sm_width,
|  | int16_t | sm_height,
|  | int | window_number
| ) |  |
| virtual

Compute the initial position of the window.

Parameters

  sm_width | Smallest width of the window.
  sm_height | Smallest height of the window.
  window_number | The window number of the new window.

Returns
  Initial position of the top-left corner of the window.

Reimplemented in BuildAirToolbarWindow, BuildBridgeWindow, SetDateWindow, BuildDocksToolbarWindow, DropdownWindow, ErrmsgWindow, TooltipsWindow, NetworkChatWindow, NewsWindow, BuildRailToolbarWindow, BuildRoadToolbarWindow, StatusBarWindow, TerraformToolbarWindow, and TransparenciesWindow.

Definition at line 1785 of file window.cpp.

References LocalGetWindowPlacement(), window_desc, and window_number.

Referenced by FinishInitNested(), and ReInit().

## ◆ OnInvalidateData()

virtual void Window::OnInvalidateData | ( | int | data = `0`,
|  | bool | gui_scope = `true`
| ) |  |
| inlinevirtual

Some data on this window has become invalid.

Parameters

  data | information about the changed data.
  gui_scope | Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See InvalidateWindowData() for details.

Reimplemented in AIConfigWindow, BuildAirToolbarWindow, ReplaceVehicleWindow, BuildVehicleWindow, SelectCompanyLiveryWindow, CompanyInfrastructureWindow, CompanyWindow, DepotWindow, BuildDocksToolbarWindow, EnginePreviewWindow, ErrmsgWindow, SaveLoadWindow, GSConfigWindow, GenerateLandscapeWindow, GoalListWindow, GraphLegendWindow, BaseGraphWindow, PaymentRatesGraphWindow, PerformanceRatingDetailWindow, VehicleGroupWindow, BuildIndustryWindow, IndustryViewWindow, IndustryDirectoryWindow, IndustryCargoesWindow, PerformanceLeagueWindow, ScriptLeagueWindow, LinkGraphLegendWindow, MainWindow, LandInfoWindow, MusicTrackSelectionWindow, MusicWindow, NetworkChatWindow, NetworkContentListWindow, NetworkGameWindow, NetworkClientListWindow, NewGRFInspectWindow, SpriteAlignerWindow, NewGRFParametersWindow, NewGRFWindow, NewsWindow, MessageHistoryWindow, BuildObjectWindow, OrdersWindow, OskWindow, PickerWindow, BuildRailToolbarWindow, BuildRailStationWindow, BuildSignalWindow, BuildRoadToolbarWindow, BuildRoadStationWindow, ScriptListWindow, ScriptSettingsWindow, ScriptTextfileWindow, ScriptDebugWindow, GameOptionsWindow, SignListWindow, SmallMapWindow, CompanyStationsWindow, StationViewWindow, SelectStationWindow< T >, StatusBarWindow, StoryBookWindow, SubsidyListWindow, TextfileWindow, TimetableWindow, MainToolbarWindow, ScenarioEditorToolbarWindow, TownAuthorityWindow, TownViewWindow, TownDirectoryWindow, FoundTownWindow, BuildHouseWindow, TransparenciesWindow, RefitWindow, VehicleListWindow, VehicleDetailsWindow, VehicleViewWindow, ExtraViewportWindow, WaypointWindow, and CompanyFinancesWindow.

Definition at line 793 of file window_gui.h.

Referenced by InvalidateData(), and ProcessScheduledInvalidations().

## ◆ OnKeyPress()

virtual EventState Window::OnKeyPress | ( | char32_t | key,
|  | uint16_t | keycode
| ) |  |
| inlinevirtual

A key has been pressed.

Parameters

  key | the Unicode value of the key.
  keycode | the untranslated key code including shift state.

Returns
  ES_HANDLED if the key press has been handled and no other window should receive the event.

Reimplemented in BuildBridgeWindow, IConsoleWindow, SaveLoadWindow, EndGameHighScoreBaseWindow, QueryWindow, NetworkChatWindow, NetworkContentListWindow, NetworkGameWindow, and NewGRFWindow.

Definition at line 651 of file window_gui.h.

References ES_NOT_HANDLED.

Referenced by HandleKeypress().

## ◆ OnMouseDrag()

virtual void Window::OnMouseDrag | ( | Point | pt,
|  | WidgetID | widget
| ) |  |
| inlinevirtual

An 'object' is being dragged at the provided position, highlight the target if possible.

Parameters

  pt | The point inside the window that the mouse hovers over.
  widget | The widget the mouse hovers over.

Reimplemented in DepotWindow, VehicleGroupWindow, NewGRFWindow, OrdersWindow, and RefitWindow.

Definition at line 700 of file window_gui.h.

Referenced by HandleMouseDragDrop().

## ◆ OnMouseLoop()

virtual void Window::OnMouseLoop | ( |  | ) |
| inlinevirtual

Called for every mouse loop run, which is at least once per (game) tick.

Reimplemented in IConsoleWindow, DepotWindow, DropdownWindow, ErrmsgWindow, VehicleGroupWindow, TooltipsWindow, GameOptionsWindow, and VehicleListWindow.

Definition at line 741 of file window_gui.h.

## ◆ OnMouseOver()

virtual void Window::OnMouseOver | ( | Point | pt,
|  | WidgetID | widget
| ) |  |
| inlinevirtual

The mouse is currently moving over the window or has just moved outside of the window.

In the latter case pt is (-1, -1).

Parameters

  pt | the point inside the window that the mouse hovers over.
  widget | the widget the mouse hovers over.

Reimplemented in SaveLoadWindow, BaseGraphWindow, NetworkClientListWindow, SmallMapWindow, SelectStationWindow< T >, and VehicleViewWindow.

Definition at line 728 of file window_gui.h.

Referenced by HandleMouseOver().

## ◆ OnMouseWheel()

virtual void Window::OnMouseWheel | ( | int | wheel,
|  | WidgetID | widget
| ) |  |
| inlinevirtual

The mouse wheel has been turned.

Parameters

  wheel | the amount of movement of the mouse wheel.
  widget | the widget the mouse hovers over.

Reimplemented in IConsoleWindow, IndustryViewWindow, MainWindow, SmallMapWindow, TownViewWindow, VehicleViewWindow, and ExtraViewportWindow.

Definition at line 735 of file window_gui.h.

## ◆ OnPaint()

virtual void Window::OnPaint | ( |  | ) |
| inlinevirtual

The window must be repainted.

Note
  This method should not change any state, it should only use drawing functions.

Reimplemented in BuildAirportWindow, ReplaceVehicleWindow, BuildVehicleWindow, CompanyFinancesWindow, SelectCompanyLiveryWindow, CompanyWindow, IConsoleWindow, DepotWindow, BuildDocksStationWindow, SaveLoadWindow, GSConfigWindow, CreateScenarioWindow, GoalListWindow, VehicleGroupWindow, EndGameWindow, HighScoreWindow, IndustryViewWindow, IndustryDirectoryWindow, PerformanceLeagueWindow, ScriptLeagueWindow, MainWindow, NetworkContentListWindow, NetworkGameWindow, NewGRFParametersWindow, OrdersWindow, BuildRailStationWindow, BuildRoadStationWindow, ScreenshotWindow, ScriptSettingsWindow, ScriptDebugWindow, GameOptionsWindow, SignListWindow, SmallMapWindow, CompanyStationsWindow, StationViewWindow, StoryBookWindow, ScenarioEditorLandscapeGenerationWindow, TimetableWindow, MainToolbarWindow, ScenarioEditorToolbarWindow, TownAuthorityWindow, TownViewWindow, TownDirectoryWindow, TransparenciesWindow, RefitWindow, VehicleListWindow, VehicleDetailsWindow, VehicleViewWindow, and WaypointWindow.

Definition at line 596 of file window_gui.h.

References DrawWidgets().

Referenced by DrawOverlappedWindow().

## ◆ OnPlaceDrag()

virtual void Window::OnPlaceDrag | ( | ViewportPlaceMethod | select_method,
|  | ViewportDragDropSelectionProcess | select_proc,
|  | Point | pt
| ) |  |
| inlinevirtual

The user is dragging over the map when the tile highlight mode has been set.

Parameters

  select_method | the method of selection (allowed directions)
  select_proc | what will be created when the drag is over.
  pt | the exact point on the map where the mouse is.

Reimplemented in BuildAirToolbarWindow, BuildDocksToolbarWindow, BuildObjectWindow, BuildRailToolbarWindow, BuildRoadToolbarWindow, TerraformToolbarWindow, ScenarioEditorLandscapeGenerationWindow, and BuildTreesWindow.

Definition at line 832 of file window_gui.h.

Referenced by VpHandlePlaceSizingDrag().

## ◆ OnPlaceMouseUp()

virtual void Window::OnPlaceMouseUp | ( | ViewportPlaceMethod | select_method,
|  | ViewportDragDropSelectionProcess | select_proc,
|  | Point | pt,
|  | TileIndex | start_tile,
|  | TileIndex | end_tile
| ) |  |
| inlinevirtual

The user has dragged over the map when the tile highlight mode has been set.

Parameters

  select_method | the method of selection (allowed directions)
  select_proc | what should be created.
  pt | the exact point on the map where the mouse was released.
  start_tile | the begin tile of the drag.
  end_tile | the end tile of the drag.

Reimplemented in BuildAirToolbarWindow, BuildDocksToolbarWindow, BuildObjectWindow, BuildRailToolbarWindow, BuildRoadToolbarWindow, TerraformToolbarWindow, ScenarioEditorLandscapeGenerationWindow, and BuildTreesWindow.

Definition at line 843 of file window_gui.h.

Referenced by PlaceRail_Bridge(), PlaceRoad_Bridge(), and VpHandlePlaceSizingDrag().

## ◆ OnPlaceObject()

virtual void Window::OnPlaceObject | ( | Point | pt,
|  | TileIndex | tile
| ) |  |
| inlinevirtual

The user clicked some place on the map when a tile highlight mode has been set.

Parameters

  pt | the exact point on the map that has been clicked.
  tile | the tile on the map that has been clicked.

Reimplemented in BuildAirToolbarWindow, CompanyWindow, BuildDocksToolbarWindow, BuildIndustryWindow, QueryStringWindow, BuildObjectWindow, OrdersWindow, BuildRailToolbarWindow, BuildRoadToolbarWindow, SignWindow, StoryBookWindow, TerraformToolbarWindow, ScenarioEditorLandscapeGenerationWindow, MainToolbarWindow, ScenarioEditorToolbarWindow, FoundTownWindow, BuildHouseWindow, and BuildTreesWindow.

Definition at line 801 of file window_gui.h.

## ◆ OnPlaceObjectAbort()

virtual void Window::OnPlaceObjectAbort | ( |  | ) |
| inlinevirtual

The user cancelled a tile highlight mode that has been set.

Reimplemented in BuildAirToolbarWindow, CompanyWindow, DepotWindow, BuildDocksToolbarWindow, VehicleGroupWindow, BuildIndustryWindow, QueryStringWindow, BuildObjectWindow, OrdersWindow, BuildRailToolbarWindow, BuildRoadToolbarWindow, SignWindow, StoryBookWindow, TerraformToolbarWindow, ScenarioEditorLandscapeGenerationWindow, MainToolbarWindow, ScenarioEditorToolbarWindow, FoundTownWindow, and BuildTreesWindow.

Definition at line 822 of file window_gui.h.

Referenced by SetObjectToPlace().

## ◆ OnPlacePresize()

virtual void Window::OnPlacePresize | ( | Point | pt,
|  | TileIndex | tile
| ) |  |
| inlinevirtual

The user moves over the map when a tile highlight mode has been set when the special mouse mode has been set to 'PRESIZE' mode.

An example of this is the tile highlight for dock building.

Parameters

  pt | the exact point on the map where the mouse is.
  tile | the tile on the map where the mouse is.

Reimplemented in BuildRailToolbarWindow, BuildRoadToolbarWindow, and BuildDocksToolbarWindow.

Definition at line 852 of file window_gui.h.

## ◆ OnQueryTextFinished()

virtual void Window::OnQueryTextFinished | ( | std::optional< std::string > | str | ) |
| inlinevirtual

The query window opened from this window has closed.

Parameters

  str | the new value of the string, `std::nullopt` if the window was cancelled or an empty string when the default button was pressed, i.e. `str->empty()`.

Reimplemented in BuildVehicleWindow, CheatWindow, SelectCompanyManagerFaceWindow, CompanyWindow, DepotWindow, GSConfigWindow, GenerateLandscapeWindow, CreateScenarioWindow, VehicleGroupWindow, IndustryViewWindow, NetworkGameWindow, NetworkStartServerWindow, NetworkClientListWindow, NetworkJoinStatusWindow, NewGRFInspectWindow, SpriteAlignerWindow, NewGRFParametersWindow, NewGRFWindow, OrdersWindow, ScriptSettingsWindow, GameOptionsWindow, CustomCurrencyWindow, StationViewWindow, TimetableWindow, ScenarioEditorToolbarWindow, TownViewWindow, FoundTownWindow, VehicleViewWindow, and WaypointWindow.

Definition at line 786 of file window_gui.h.

Referenced by QueryStringWindow::Close(), and SavePresetWindow::OnClick().

## ◆ OnRealtimeTick()

virtual void Window::OnRealtimeTick | ( | uint | delta_ms | ) |
| inlinevirtual

Called periodically.

Reimplemented in BuildAirportWindow, BuildDocksStationWindow, FrametimeGraphWindow, SelectGameWindow, NewsWindow, BuildRailToolbarWindow, BuildRailStationWindow, BuildRoadToolbarWindow, BuildRoadStationWindow, SelectStationWindow< T >, and TextfileWindow.

Definition at line 751 of file window_gui.h.

Referenced by CallWindowRealtimeTickEvent().

## ◆ OnResize()

virtual void Window::OnResize | ( |  | ) |
| inlinevirtual

Called after the window got resized.

For nested windows with a viewport, call NWidgetViewport::UpdateViewportCoordinates.

Reimplemented in ReplaceVehicleWindow, BuildBridgeWindow, BuildVehicleWindow, SelectCompanyLiveryWindow, SelectCompanyManagerFaceWindow, CompanyInfrastructureWindow, CompanyWindow, DepotWindow, SaveLoadWindow, FramerateWindow, GSConfigWindow, GoalListWindow, BaseCargoGraphWindow, VehicleGroupWindow, BuildIndustryWindow, IndustryViewWindow, IndustryDirectoryWindow, IndustryCargoesWindow, SelectGameWindow, MainWindow, NetworkContentListWindow, NetworkGameWindow, NetworkClientListWindow, NewGRFInspectWindow, SpriteAlignerWindow, NewGRFParametersWindow, NewGRFWindow, SavePresetWindow, NewsWindow, MessageHistoryWindow, OrdersWindow, PickerWindow, ScriptListWindow, ScriptSettingsWindow, ScriptDebugWindow, GameOptionsWindow, SignListWindow, CompanyStationsWindow, StationViewWindow, SelectStationWindow< T >, StoryBookWindow, SubsidyListWindow, TextfileWindow, TimetableWindow, TownViewWindow, TownDirectoryWindow, RefitWindow, VehicleListWindow, VehicleDetailsWindow, VehicleViewWindow, ExtraViewportWindow, and WaypointWindow.

Definition at line 763 of file window_gui.h.

Referenced by FindWindowPlacementAndResize(), ProcessScheduledResize(), and ResizeWindow().

## ◆ OnRightClick()

virtual bool Window::OnRightClick | ( | Point | pt,
|  | WidgetID | widget
| ) |  |
| inlinevirtual

A click with the right mouse button has been made on the window.

Parameters

  pt | the point inside the window that has been clicked.
  widget | the clicked widget.

Returns
  true if the click was actually handled, i.e. do not show a tooltip if tooltip-on-right-click is enabled.

Reimplemented in DepotWindow, ExtraViewportWindow, and SmallMapWindow.

Definition at line 678 of file window_gui.h.

Referenced by DispatchRightClickEvent().

## ◆ OnScroll()

virtual void Window::OnScroll | ( | Point | delta | ) |
| inlinevirtual

Handle the request for (viewport) scrolling.

Parameters

  delta | the amount the viewport must be scrolled.

Reimplemented in MainWindow, SmallMapWindow, and ExtraViewportWindow.

Definition at line 713 of file window_gui.h.

Referenced by HandleViewportScroll().

## ◆ OnScrollbarScroll()

virtual void Window::OnScrollbarScroll | ( | WidgetID | widget | ) |
| inlinevirtual

Notify window that a scrollbar position has been updated.

Note
  Only called when the user scrolls, not if a window moves its scrollbar.

Parameters

  widget | the scrollbar widget index.

Reimplemented in TextfileWindow.

Definition at line 720 of file window_gui.h.

Referenced by DispatchMouseWheelEvent(), HandleScrollbarScrolling(), and ScrollbarClickPositioning().

## ◆ OnTimeout()

virtual void Window::OnTimeout | ( |  | ) |
| inlinevirtual

Called when this window's timeout has been reached.

Reimplemented in CheatWindow, SelectCompanyManagerFaceWindow, DepotWindow, SaveLoadWindow, GenerateLandscapeWindow, CreateScenarioWindow, BuildIndustryWindow, IndustryViewWindow, NetworkStartServerWindow, GameOptionsWindow, CustomCurrencyWindow, StoryBookWindow, ScenarioEditorLandscapeGenerationWindow, and ScenarioEditorToolbarWindow.

Definition at line 756 of file window_gui.h.

## ◆ OnTooltip()

virtual bool Window::OnTooltip | ( | Point | pt,
|  | WidgetID | widget,
|  | TooltipCloseCondition | close_cond
| ) |  |
| inlinevirtual

Event to display a custom tooltip.

Parameters

  pt | The point where the mouse is located.
  widget | The widget where the mouse is located.

Returns
  True if the event is handled, false if it is ignored.

Reimplemented in ReplaceVehicleWindow, CheatWindow, IndustryCargoesWindow, LinkGraphLegendWindow, MainWindow, NetworkClientListWindow, BuildRailToolbarWindow, TextfileWindow, and VehicleDetailsWindow.

Definition at line 693 of file window_gui.h.

Referenced by DispatchHoverEvent(), and DispatchRightClickEvent().

## ◆ OnVehicleSelect() [1/2]

virtual bool Window::OnVehicleSelect | ( | const struct Vehicle * | v | ) |
| inlinevirtual

The user clicked on a vehicle while HT_VEHICLE has been set.

Parameters

  v | clicked vehicle

Returns
  true if the click is handled, false if it is ignored

Precondition
  v->IsPrimaryVehicle() == true

Definition at line 809 of file window_gui.h.

Referenced by VehicleClicked(), and VehicleClicked().

## ◆ OnVehicleSelect() [2/2]

virtual bool Window::OnVehicleSelect | ( | VehicleList::const_iterator | begin,
|  | VehicleList::const_iterator | end
| ) |  |
| inlinevirtual

The user clicked on a vehicle while HT_VEHICLE has been set.

Parameters

  v | clicked vehicle

Returns
  True if the click is handled, false if it is ignored

Precondition
  v->IsPrimaryVehicle() == true

Reimplemented in DepotWindow, and OrdersWindow.

Definition at line 817 of file window_gui.h.

## ◆ operator new[]()

void * Window::operator new[] | ( | size_t | size | ) |
| inlinedelete

Helper allocation function to disallow something.

Don't allow arrays; arrays of Windows are pointless as you need to destruct them all at the same time too, which is kinda hard.

Parameters

  size | the amount of space not to allocate

## ◆ ProcessHighlightedInvalidations()

void Window::ProcessHighlightedInvalidations | ( |  | ) |

Process all invalidation of highlighted widgets.

Definition at line 3259 of file window.cpp.

References flags, Highlighted, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and widget_lookup.

Referenced by UpdateWindows().

## ◆ ProcessScheduledInvalidations()

void Window::ProcessScheduledInvalidations | ( |  | ) |

Process all scheduled invalidations.

Definition at line 3247 of file window.cpp.

References OnInvalidateData(), scheduled_invalidation_data, WC_INVALID, and window_class.

Referenced by UpdateWindows().

## ◆ ProcessScheduledResize()

void Window::ProcessScheduledResize | ( |  | ) |

Process scheduled OnResize() event.

Definition at line 3220 of file window.cpp.

References OnResize(), and scheduled_resize.

Referenced by UpdateWindows().

## ◆ RaiseButtons()

void Window::RaiseButtons | ( | bool | autoraise = `false` | ) |

Raise the buttons of the window.

Parameters

  autoraise | Raise only the push buttons of the window.

Definition at line 530 of file window.cpp.

References NWidgetCore::IsLowered(), nested_root, NWidgetBase::SetDirty(), NWidgetCore::SetLowered(), widget_lookup, WWT_DEFSIZEBOX, WWT_EDITBOX, and WWT_LAST.

Referenced by CompanyWindow::OnClick(), BuildIndustryWindow::OnClick(), CompanyWindow::OnPlaceObject(), BuildAirToolbarWindow::OnPlaceObjectAbort(), CompanyWindow::OnPlaceObjectAbort(), BuildDocksToolbarWindow::OnPlaceObjectAbort(), BuildIndustryWindow::OnPlaceObjectAbort(), QueryStringWindow::OnPlaceObjectAbort(), BuildRailToolbarWindow::OnPlaceObjectAbort(), BuildRoadToolbarWindow::OnPlaceObjectAbort(), SignWindow::OnPlaceObjectAbort(), TerraformToolbarWindow::OnPlaceObjectAbort(), ScenarioEditorLandscapeGenerationWindow::OnPlaceObjectAbort(), FoundTownWindow::OnPlaceObjectAbort(), BuildIndustryWindow::OnTimeout(), and BuildTreesWindow::UpdateMode().

## ◆ RaiseWidget()

void Window::RaiseWidget | ( | WidgetID | widget_index | ) |
| inline

Marks a widget as raised.

Parameters

  widget_index | index of this widget in the window

Definition at line 470 of file window_gui.h.

References SetWidgetLoweredState().

Referenced by BuildRailStationWindow::CheckSelectedSize(), SelectCompanyLiveryWindow::OnClick(), BuildDocksStationWindow::OnClick(), BuildDocksDepotWindow::OnClick(), CreateScenarioWindow::OnClick(), PerformanceRatingDetailWindow::OnClick(), BuildRailStationWindow::OnClick(), BuildSignalWindow::OnClick(), BuildRailDepotWindow::OnClick(), BuildRoadDepotWindow::OnClick(), BuildRoadStationWindow::OnClick(), CompanyStationsWindow::OnClick(), OnDropdownClose(), GraphLegendWindow::OnInvalidateData(), PerformanceRatingDetailWindow::OnInvalidateData(), SpriteAlignerWindow::OnInvalidateData(), VehicleGroupWindow::OnPaint(), DepotWindow::OnPlaceObjectAbort(), DepotWindow::OnTimeout(), RaiseWidgetWhenLowered(), ResetSignalVariant(), and BuildRoadToolbarWindow::UpdateOptionWidgetStatus().

## ◆ RaiseWidgetsWhenLowered()

template<typename... Args>

void Window::RaiseWidgetsWhenLowered | ( | Args... | widgets | ) |
| inline

Raises the widgets and sets widgets dirty that are lowered.

Parameters

  widgets | list of widgets

Definition at line 537 of file window_gui.h.

References RaiseWidgetWhenLowered().

Referenced by GenerateLandscapeWindow::OnTimeout(), CreateScenarioWindow::OnTimeout(), and NetworkStartServerWindow::OnTimeout().

## ◆ RaiseWidgetWhenLowered()

void Window::RaiseWidgetWhenLowered | ( | WidgetID | widget_index | ) |
| inline

Marks a widget as raised and dirty (redraw), when it is marked as lowered.

Parameters

  widget_index | index of this widget in the window

Definition at line 479 of file window_gui.h.

References IsWidgetLowered(), RaiseWidget(), and SetWidgetDirty().

Referenced by ViewportData::CancelFollow(), IndustryCargoesWindow::OnInvalidateData(), ScenarioEditorLandscapeGenerationWindow::OnTimeout(), and RaiseWidgetsWhenLowered().

## ◆ ReInit()

void Window::ReInit | ( | int | rx = `0`,
|  | int | ry = `0`,
|  | bool | reposition = `false`
| ) |  |

Re-initialize a window, and optionally change its size.

Parameters

  rx | Horizontal resize of the window.
  ry | Vertical resize of the window.
  reposition | If set, reposition the window to default location.

Note
  For just resizing the window, use ResizeWindow instead.

Definition at line 978 of file window.cpp.

References _current_text_dir, _gui_scale, FindWindowPlacementAndResize(), WindowDesc::GetDefaultWidth(), height, InitializePositionSize(), nested_root, OnInit(), OnInitialPosition(), resize, ResizeWindow(), scale, SetDirty(), ST_SMALLEST, ResizeInfo::step_height, ResizeInfo::step_width, TD_RTL, width, window_desc, window_number, Coord2D< T >::x, and Coord2D< T >::y.

Referenced by TextfileWindow::AfterLoadText(), BuildObjectWindow::DrawWidget(), TextfileWindow::LoadText(), TextfileWindow::LoadTextfile(), BuildRailToolbarWindow::ModifyRailType(), BuildRoadToolbarWindow::ModifyRoadType(), CompanyFinancesWindow::OnClick(), SelectCompanyManagerFaceWindow::OnClick(), PickerWindow::OnClick(), StationViewWindow::OnClick(), BuildVehicleWindow::OnDropdownSelect(), PickerWindow::OnDropdownSelect(), CompanyInfrastructureWindow::OnInvalidateData(), ScriptLeagueWindow::OnInvalidateData(), LandInfoWindow::OnInvalidateData(), MusicTrackSelectionWindow::OnInvalidateData(), MusicWindow::OnInvalidateData(), ScriptDebugWindow::OnInvalidateData(), StationViewWindow::OnInvalidateData(), TimetableWindow::OnInvalidateData(), RefitWindow::OnInvalidateData(), VehicleDetailsWindow::OnInvalidateData(), ReplaceVehicleWindow::OnPaint(), BuildVehicleWindow::OnPaint(), CompanyFinancesWindow::OnPaint(), CompanyWindow::OnPaint(), DepotWindow::OnPaint(), IndustryViewWindow::OnPaint(), NetworkGameWindow::OnPaint(), BuildRailStationWindow::OnPaint(), BuildRoadStationWindow::OnPaint(), StationViewWindow::OnPaint(), SelectCompanyManagerFaceWindow::OnResize(), CompanyWindow::OnResize(), SelectGameWindow::OnResize(), NewsWindow::OnResize(), GameOptionsWindow::OnResize(), and SetShaded().

## ◆ ScheduleResize()

void Window::ScheduleResize | ( |  | ) |

Mark this window as resized and in need of OnResize() event.

Definition at line 3212 of file window.cpp.

References scheduled_resize.

Referenced by ResizeWindow().

## ◆ SetFocusedWidget()

bool Window::SetFocusedWidget | ( | WidgetID | widget_index | ) |

Set focus within this window to the given widget.

The function however doesn't change which window has focus.

Parameters

  widget_index | Index of the widget in the window to set the focus to.

Returns
  Focus has changed.

Definition at line 485 of file window.cpp.

References VideoDriver::EditBoxGainedFocus(), VideoDriver::EditBoxLostFocus(), VideoDriver::GetInstance(), nested_focus, NWidgetBase::SetDirty(), NWidgetBase::type, and WWT_EDITBOX.

Referenced by DispatchLeftClickEvent(), NetworkChatWindow::NetworkChatWindow(), NetworkContentListWindow::NetworkContentListWindow(), FoundTownWindow::OnClick(), OnHotkey(), PickerWindow::OnHotkey(), and SavePresetWindow::SavePresetWindow().

## ◆ SetShaded()

void Window::SetShaded | ( | bool | make_shaded | ) |

Set the shaded state of the window to make_shaded.

Parameters

  make_shaded | If `true`, shade the window (roll up until just the title bar is visible), else unshade/unroll the window to its original size.

Note
  The method uses Window::ReInit(), thus after the call, the whole window should be considered changed.

Definition at line 1021 of file window.cpp.

References height, nested_focus, ReInit(), NWidgetStacked::SetDisplayedPlane(), shade_select, NWidgetStacked::shown_plane, SZSP_HORIZONTAL, UnfocusFocusedWidget(), unshaded_size, and width.

Referenced by BringWindowToFrontById(), DispatchLeftClickEvent(), DispatchMouseWheelEvent(), and CompanyFinancesWindow::OnClick().

## ◆ SetTimeout()

void Window::SetTimeout | ( |  | ) |
| inline

Set the timeout flag of the window and initiate the timer.

Definition at line 356 of file window_gui.h.

References flags, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), Timeout, and TIMEOUT_DURATION.

Referenced by DispatchLeftClickEvent(), HandleButtonClick(), SelectCompanyManagerFaceWindow::OnClick(), IndustryViewWindow::OnClick(), CustomCurrencyWindow::OnClick(), StationViewWindow::OnClick(), and StoryBookWindow::OnPageElementClick().

## ◆ SetWhiteBorder()

void Window::SetWhiteBorder | ( |  | ) |
| inline

Set the timeout flag of the window and initiate the timer.

Definition at line 365 of file window_gui.h.

References flags, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), WHITE_BORDER_DURATION, and WhiteBorder.

Referenced by BringWindowToFrontById(), InitializeData(), and MaybeBringWindowToFront().

## ◆ SetWidgetDirty()

void Window::SetWidgetDirty | ( | WidgetID | widget_index | ) | const

Invalidate a widget, i.e.

mark it as being changed and in need of redraw.

Parameters

  widget_index | the widget to redraw.

Definition at line 556 of file window.cpp.

References widget_lookup.

Referenced by VehicleGroupWindow::DirtyHighlightedGroupWidget(), HandleActiveWidget(), HandleButtonClick(), StationViewWindow::HandleCargoWaitingClick(), HandleEditBoxKey(), HandleZoomMessage(), InsertTextString(), CompanyWindow::OnClick(), DepotWindow::OnClick(), SaveLoadWindow::OnClick(), IndustryCargoesWindow::OnClick(), MusicWindow::OnClick(), SavePresetWindow::OnClick(), GameOptionsWindow::OnClick(), TransparenciesWindow::OnClick(), RefitWindow::OnClick(), DepotWindow::OnCTRLStateChange(), NewGRFWindow::OnDragDrop(), OrdersWindow::OnDragDrop(), OnDropdownClose(), OskWindow::OnEditboxChanged(), GoalListWindow::OnInvalidateData(), OskWindow::OnInvalidateData(), StoryBookWindow::OnInvalidateData(), DepotWindow::OnMouseDrag(), NewGRFWindow::OnMouseDrag(), OrdersWindow::OnMouseDrag(), RefitWindow::OnMouseDrag(), SaveLoadWindow::OnMouseOver(), NetworkClientListWindow::OnMouseOver(), VehicleViewWindow::OnMouseOver(), StoryBookWindow::OnPageElementClick(), StoryBookWindow::OnPaint(), StoryBookWindow::OnPlaceObject(), DepotWindow::OnPlaceObjectAbort(), VehicleGroupWindow::OnPlaceObjectAbort(), OrdersWindow::OnPlaceObjectAbort(), BuildRailToolbarWindow::OnPlaceObjectAbort(), BuildRoadToolbarWindow::OnPlaceObjectAbort(), StoryBookWindow::OnPlaceObjectAbort(), GenerateLandscapeWindow::OnQueryTextFinished(), CreateScenarioWindow::OnQueryTextFinished(), NetworkStartServerWindow::OnQueryTextFinished(), TextfileWindow::OnRealtimeTick(), DepotWindow::OnTimeout(), StoryBookWindow::OnTimeout(), ScenarioEditorToolbarWindow::OnTimeout(), OrdersWindow::OrderClick_Goto(), OrdersWindow::OrderClick_Nonstop(), OrdersWindow::OrderClick_Unload(), RaiseWidgetWhenLowered(), StoryBookWindow::RefreshSelectedPage(), TextfileWindow::SetupScrollbars(), SetWindowWidgetDirty(), BuildBridgeWindow::SortBridgeList(), CompanyStationsWindow::SortStationsList(), ToggleRailButton_Remove(), ToggleRoadButton_Remove(), ScriptDebugWindow::UpdateLogScroll(), BuildRoadToolbarWindow::UpdateOptionWidgetStatus(), and StoryBookWindow::UpdatePrevNextDisabledState().

## ◆ SetWidgetDisabledState()

void Window::SetWidgetDisabledState | ( | WidgetID | widget_index,
|  | bool | disab_stat
| ) |  |
| inline

Sets the enabled/disabled status of a widget.

By default, widgets are enabled. On certain conditions, they have to be disabled.

Parameters

  widget_index | index of this widget in the window
  disab_stat | status to use ie: disabled = true, enabled = false

Definition at line 382 of file window_gui.h.

References NWidgetCore::SetDisabled().

Referenced by NetworkContentListWindow::BuildContentList(), RefitWindow::BuildRefitList(), DisableWidget(), EnableWidget(), HandleZoomMessage(), TextfileWindow::NavigateHistory(), NetworkContentListWindow::NetworkContentListWindow(), GameOptionsWindow::OnClick(), RefitWindow::OnClick(), AIConfigWindow::OnInvalidateData(), BuildAirToolbarWindow::OnInvalidateData(), SaveLoadWindow::OnInvalidateData(), GSConfigWindow::OnInvalidateData(), GenerateLandscapeWindow::OnInvalidateData(), GoalListWindow::OnInvalidateData(), PerformanceRatingDetailWindow::OnInvalidateData(), LinkGraphLegendWindow::OnInvalidateData(), MusicTrackSelectionWindow::OnInvalidateData(), NetworkContentListWindow::OnInvalidateData(), NetworkClientListWindow::OnInvalidateData(), NewGRFInspectWindow::OnInvalidateData(), NewGRFParametersWindow::OnInvalidateData(), NewGRFWindow::OnInvalidateData(), PickerWindow::OnInvalidateData(), BuildRailToolbarWindow::OnInvalidateData(), BuildSignalWindow::OnInvalidateData(), ScriptDebugWindow::OnInvalidateData(), GameOptionsWindow::OnInvalidateData(), StoryBookWindow::OnInvalidateData(), BuildHouseWindow::OnInvalidateData(), WaypointWindow::OnInvalidateData(), ReplaceVehicleWindow::OnPaint(), BuildVehicleWindow::OnPaint(), CompanyFinancesWindow::OnPaint(), SelectCompanyLiveryWindow::OnPaint(), CompanyWindow::OnPaint(), CreateScenarioWindow::OnPaint(), NetworkGameWindow::OnPaint(), BuildRailStationWindow::OnPaint(), StationViewWindow::OnPaint(), TimetableWindow::OnPaint(), MainToolbarWindow::OnPaint(), ScenarioEditorToolbarWindow::OnPaint(), TownAuthorityWindow::OnPaint(), VehicleListWindow::OnPaint(), VehicleDetailsWindow::OnPaint(), VehicleViewWindow::OnPaint(), WaypointWindow::OnPaint(), BuildRoadToolbarWindow::OnPlaceObjectAbort(), BuildIndustryWindow::SetButtons(), TextfileWindow::SetupScrollbars(), SetWidgetsDisabledState(), BuildRoadToolbarWindow::UpdateOptionWidgetStatus(), OskWindow::UpdateOskState(), and StoryBookWindow::UpdatePrevNextDisabledState().

## ◆ SetWidgetHighlight()

void Window::SetWidgetHighlight | ( | WidgetID | widget_index,
|  | TextColour | highlighted_colour
| ) |  |

Sets the highlighted status of a widget.

Parameters

  widget_index | index of this widget in the window
  highlighted_colour | Colour of highlight, or TC_INVALID to disable.

Definition at line 241 of file window.cpp.

References flags, Highlighted, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), NWidgetBase::SetDirty(), and widget_lookup.

Referenced by DispatchLeftClickEvent().

## ◆ SetWidgetLoweredState()

void Window::SetWidgetLoweredState | ( | WidgetID | widget_index,
|  | bool | lowered_stat
| ) |  |
| inline

Sets the lowered/raised status of a widget.

Parameters

  widget_index | index of this widget in the window
  lowered_stat | status to use ie: lowered = true, raised = false

Definition at line 442 of file window_gui.h.

Referenced by LowerWidget(), BuildAirportWindow::OnClick(), ReplaceVehicleWindow::OnClick(), BuildVehicleWindow::OnClick(), LinkGraphLegendWindow::OnClick(), MusicWindow::OnClick(), SpriteAlignerWindow::OnClick(), BuildRailStationWindow::OnClick(), GameOptionsWindow::OnClick(), SignListWindow::OnClick(), TownAuthorityWindow::OnClick(), FoundTownWindow::OnClick(), BuildHouseWindow::OnClick(), BuildRailStationWindow::OnInit(), GenerateLandscapeWindow::OnInvalidateData(), MusicTrackSelectionWindow::OnInvalidateData(), MusicWindow::OnInvalidateData(), PickerWindow::OnInvalidateData(), BuildSignalWindow::OnInvalidateData(), ScriptDebugWindow::OnInvalidateData(), GameOptionsWindow::OnInvalidateData(), BuildHouseWindow::OnInvalidateData(), TransparenciesWindow::OnInvalidateData(), DepotWindow::OnMouseDrag(), GameOptionsWindow::OnMouseLoop(), CreateScenarioWindow::OnPaint(), NetworkGameWindow::OnPaint(), OrdersWindow::OnPaint(), StationViewWindow::OnPaint(), TimetableWindow::OnPaint(), TownAuthorityWindow::OnPaint(), TownViewWindow::OnPaint(), VehicleViewWindow::OnPaint(), WaypointWindow::OnPaint(), DepotWindow::OnPlaceObjectAbort(), RaiseWidget(), LinkGraphLegendWindow::SetOverlay(), SetWidgetsLoweredState(), BuildRoadToolbarWindow::UpdateOptionWidgetStatus(), and OskWindow::UpdateOskState().

## ◆ SetWidgetsDisabledState()

template<typename... Args>

void Window::SetWidgetsDisabledState | ( | bool | disab_stat,
|  | Args... | widgets
| ) |  |
| inline

Sets the enabled/disabled status of a list of widgets.

By default, widgets are enabled. On certain conditions, they have to be disabled.

Parameters

  disab_stat | status to use ie: disabled = true, enabled = false
  widgets | list of widgets

Definition at line 516 of file window_gui.h.

References SetWidgetDisabledState().

Referenced by ScriptDebugWindow::OnInit(), SelectCompanyLiveryWindow::OnInvalidateData(), BuildDocksToolbarWindow::OnInvalidateData(), GenerateLandscapeWindow::OnInvalidateData(), SpriteAlignerWindow::OnInvalidateData(), NewGRFWindow::OnInvalidateData(), BuildRoadToolbarWindow::OnInvalidateData(), GameOptionsWindow::OnInvalidateData(), BuildVehicleWindow::OnPaint(), DepotWindow::OnPaint(), VehicleGroupWindow::OnPaint(), MainToolbarWindow::OnPaint(), VehicleListWindow::OnPaint(), VehicleDetailsWindow::OnPaint(), and ScriptDebugWindow::UpdateLogScroll().

## ◆ SetWidgetsLoweredState()

template<typename... Args>

void Window::SetWidgetsLoweredState | ( | bool | lowered_stat,
|  | Args... | widgets
| ) |  |
| inline

Sets the lowered/raised status of a list of widgets.

Parameters

  lowered_stat | status to use ie: lowered = true, raised = false
  widgets | list of widgets

Definition at line 527 of file window_gui.h.

References SetWidgetLoweredState().

Referenced by VehicleDetailsWindow::OnClick(), SpriteAlignerWindow::OnInvalidateData(), and ScenarioEditorToolbarWindow::OnTimeout().

## ◆ ShowNewGRFInspectWindow()

virtual void Window::ShowNewGRFInspectWindow | ( |  | ) | const
| inlinevirtual

Show the NewGRF inspection window.

When this function is called it is up to the window to call and pass the right parameters to the ShowInspectWindow function.

Precondition
  this->IsNewGRFInspectable()

Reimplemented in IndustryViewWindow, LandInfoWindow, and VehicleViewWindow.

Definition at line 868 of file window_gui.h.

Referenced by DispatchLeftClickEvent(), and NewGRFInspectWindow::OnClick().

## ◆ SortButtonWidth()

int Window::SortButtonWidth | ( |  | ) |
| static

Get width of up/down arrow of sort button state.

Returns
  Width of space required by sort button arrow.

Definition at line 815 of file widget.cpp.

Referenced by ReplaceVehicleWindow::UpdateWidgetSize(), BuildBridgeWindow::UpdateWidgetSize(), BuildVehicleWindow::UpdateWidgetSize(), SaveLoadWindow::UpdateWidgetSize(), VehicleGroupWindow::UpdateWidgetSize(), IndustryDirectoryWindow::UpdateWidgetSize(), NetworkContentListWindow::UpdateWidgetSize(), NetworkGameWindow::UpdateWidgetSize(), CompanyStationsWindow::UpdateWidgetSize(), TownDirectoryWindow::UpdateWidgetSize(), and VehicleListWindow::UpdateWidgetSize().

## ◆ ToggleWidgetLoweredState()

void Window::ToggleWidgetLoweredState | ( | WidgetID | widget_index | ) |
| inline

Invert the lowered/raised status of a widget.

Parameters

  widget_index | index of this widget in the window

Definition at line 451 of file window_gui.h.

Referenced by DepotWindow::OnClick(), GraphLegendWindow::OnClick(), IndustryCargoesWindow::OnClick(), LinkGraphLegendWindow::OnClick(), BuildRailStationWindow::OnClick(), BuildRoadToolbarWindow::OnClick(), CompanyStationsWindow::OnClick(), TextfileWindow::OnClick(), ToggleRailButton_Remove(), and ToggleRoadButton_Remove().

## ◆ UnfocusFocusedWidget()

void Window::UnfocusFocusedWidget | ( |  | ) |

Makes no widget on this window have focus.

The function however doesn't change which window has focus.

Definition at line 469 of file window.cpp.

References VideoDriver::EditBoxLostFocus(), VideoDriver::GetInstance(), nested_focus, NWidgetBase::SetDirty(), NWidgetBase::type, and WWT_EDITBOX.

Referenced by HandleEditBoxKey(), SetShaded(), and NWidgetContainer::UnfocusWidgets().

## ◆ UpdateQueryStringSize()

void Window::UpdateQueryStringSize | ( |  | ) |

Update size of all QueryStrings of this window.

Definition at line 353 of file window.cpp.

References querystrings, and Textbuf::UpdateSize().

## ◆ UpdateWidgetSize()

virtual void Window::UpdateWidgetSize | ( | WidgetID | widget,
|  | Dimension & | size,
|  | const Dimension & | padding,
|  | Dimension & | fill,
|  | Dimension & | resize
| ) |  |
| inlinevirtual

Update size and resize step of a widget in the window.

After retrieval of the minimal size and the resize-steps of a widget, this function is called to allow further refinement, typically by computing the real maximal size of the content. Afterwards, size is taken to be the minimal size of the widget and resize is taken to contain the resize steps. For the convenience of the callee, padding contains the amount of padding between the content and the edge of the widget. This should be added to the returned size.

Parameters

  | widget | Widget number.
  [in,out] | size | Size of the widget.
  | padding | Recommended amount of space between the widget content and the widget edge.
  [in,out] | fill | Fill step of the widget.
  [in,out] | resize | Resize step of the widget.

Reimplemented in AIConfigWindow, BuildAirportWindow, ReplaceVehicleWindow, BootstrapErrorWindow, BootstrapAskForDownloadWindow, BuildBridgeWindow, BuildVehicleWindow, CheatWindow, CompanyFinancesWindow, SelectCompanyLiveryWindow, SelectCompanyManagerFaceWindow, CompanyInfrastructureWindow, CompanyWindow, BuyCompanyWindow, SetDateWindow, DepotWindow, BuildDocksDepotWindow, DropdownWindow, EnginePreviewWindow, ErrmsgWindow, SaveLoadWindow, FramerateWindow, FrametimeGraphWindow, GSConfigWindow, GenerateLandscapeWindow, CreateScenarioWindow, GenerateProgressWindow, GoalListWindow, GoalQuestionWindow, BaseGraphWindow, BaseCargoGraphWindow, PerformanceRatingDetailWindow, VehicleGroupWindow, BuildIndustryWindow, IndustryViewWindow, IndustryDirectoryWindow, IndustryCargoesWindow, PerformanceLeagueWindow, ScriptLeagueWindow, LinkGraphLegendWindow, LandInfoWindow, AboutWindow, TooltipsWindow, QueryWindow, MusicTrackSelectionWindow, MusicWindow, NetworkContentListWindow, BaseNetworkContentDownloadStatusWindow, NetworkGameWindow, NetworkStartServerWindow, NetworkClientListWindow, NetworkJoinStatusWindow, NetworkAskRelayWindow, NetworkAskSurveyWindow, NewGRFInspectWindow, SpriteAlignerWindow, NewGRFParametersWindow, NewGRFWindow, SavePresetWindow, ScanProgressWindow, NewsWindow, MessageHistoryWindow, BuildObjectWindow, OrdersWindow, PickerWindow, BuildRailStationWindow, BuildSignalWindow, BuildRailDepotWindow, BuildRoadDepotWindow, BuildRoadStationWindow, ScriptListWindow, ScriptSettingsWindow, ScriptDebugWindow, GameOptionsWindow, CustomCurrencyWindow, SignListWindow, CompanyStationsWindow, StationViewWindow, SelectStationWindow< T >, StatusBarWindow, StoryBookWindow, SubsidyListWindow, ScenarioEditorLandscapeGenerationWindow, TextfileWindow, TimetableWindow, ScenarioEditorToolbarWindow, TownAuthorityWindow, TownViewWindow, TownDirectoryWindow, BuildTreesWindow, RefitWindow, VehicleListWindow, VehicleDetailsWindow, and VehicleViewWindow.

Definition at line 621 of file window_gui.h.

Referenced by NWidgetStacked::SetupSmallestSize(), NWidgetMatrix::SetupSmallestSize(), NWidgetBackground::SetupSmallestSize(), and NWidgetLeaf::SetupSmallestSize().

## Field Documentation

## ◆ closed_windows

std::vector< Window * > Window::closed_windows
| staticprivate

List of closed windows to delete.

Definition at line 276 of file window_gui.h.

Referenced by Close(), and DeleteClosedWindows().

## ◆ flags

WindowFlags Window::flags {}

Window flags.

Definition at line 301 of file window_gui.h.

Referenced by ApplyDefaults(), CheckSoftLimit(), CloseNonVitalWindows(), CloseWindowById(), DisableAllWidgetHighlight(), DispatchLeftClickEvent(), DispatchRightClickEvent(), NWidgetLeaf::Draw(), DrawWidgets(), DropdownWindow::DropdownWindow(), StoryBookWindow::GetPageElementFloat(), HandleAutoscroll(), HandleWindowDragging(), InitializeData(), GenerateLandscapeWindow::OnClick(), CreateScenarioWindow::OnClick(), NetworkStartServerWindow::OnClick(), VehicleGroupWindow::OnPaint(), SelectGameWindow::OnResize(), GameOptionsWindow::OnResize(), ProcessHighlightedInvalidations(), SelectGameWindow::ReadIntroGameViewportCommands(), RelocateAllWindows(), SetTimeout(), SetWhiteBorder(), SetWidgetHighlight(), StartWindowDrag(), StartWindowSizing(), and WaypointWindow::WaypointWindow().

## ◆ height

int Window::height = 0

Height of the window (number of pixels down in y direction)

Definition at line 313 of file window_gui.h.

Referenced by GameOptionsWindow::BuildDropDownList(), VehicleGroupWindow::ComputeGroupInfoSize(), DispatchLeftClickEvent(), BaseGraphWindow::DrawGraph(), DrawOverlappedWindow(), IndustryCargoesWindow::DrawWidget(), ScenarioEditorToolbarWindow::DrawWidget(), RefitWindow::DrawWidget(), DrawWidgets(), StoryBookWindow::EnsureStoryPageElementLayout(), FindWindowFromPt(), FindWindowPlacementAndResize(), CompanyInfrastructureWindow::FindWindowPlacementAndResize(), QueryWindow::FindWindowPlacementAndResize(), NetworkAskRelayWindow::FindWindowPlacementAndResize(), NetworkAskSurveyWindow::FindWindowPlacementAndResize(), GetAutoPlacePosition(), IConsoleWindow::GetCaretPosition(), StoryBookWindow::GetHeadHeight(), GetMainViewTop(), IConsoleWindow::GetTextBoundingRect(), GetToolbarAlignedWindowPosition(), GameOptionsWindow::GetWidgetString(), HandleWindowDragging(), IConsoleResize(), InitializePositionSize(), IsGoodAutoPlace1(), IsGoodAutoPlace2(), LocalGetWindowPlacement(), MaybeBringWindowToFront(), NetworkChatWindow::NetworkChatWindow(), GameOptionsWindow::OnDropdownSelect(), IndustryCargoesWindow::OnInit(), SetDateWindow::OnInitialPosition(), NetworkChatWindow::OnInitialPosition(), IConsoleWindow::OnKeyPress(), IConsoleWindow::OnPaint(), MainWindow::OnPaint(), PositionWindow(), PreventHiding(), ReInit(), RelocateAllWindows(), ResizeWindow(), IConsoleWindow::Scroll(), SetCandidatePos(), SetDirty(), SetShaded(), NewsWindow::SetWindowTop(), BuildIndustryWindow::UpdateWidgetSize(), NetworkClientListWindow::UpdateWidgetSize(), and NewGRFInspectWindow::UpdateWidgetSize().

## ◆ left

int Window::left = 0

x position of left edge of the window

Definition at line 310 of file window_gui.h.

Referenced by AlignInitialConstructionToolbar(), DropdownWindow::Close(), DrawOverlappedWindow(), DrawViewport(), RefitWindow::DrawWidget(), EnsureVisibleCaption(), FindWindowFromPt(), FindWindowPlacementAndResize(), QueryWindow::FindWindowPlacementAndResize(), NetworkAskRelayWindow::FindWindowPlacementAndResize(), NetworkAskSurveyWindow::FindWindowPlacementAndResize(), GetAutoPlacePosition(), DropdownWindow::GetDropDownItem(), GetToolbarAlignedWindowPosition(), HandleActiveWidget(), HandleMouseDragDrop(), HandleMouseOver(), HandleWindowDragging(), InitializePositionSize(), InitializeWindowViewport(), IsGoodAutoPlace1(), IsGoodAutoPlace2(), LocalGetWindowPlacement(), MaybeBringWindowToFront(), SetDateWindow::OnInitialPosition(), PositionWindow(), PreventHiding(), RelocateAllWindows(), ResizeWindow(), SetCandidatePos(), SetCompositionPos(), SetDirty(), NWidgetBase::SetDirty(), SetScreenshotWindowVisibility(), NewsWindow::SetWindowTop(), ShowTerraformToolbar(), StartWindowDrag(), DropdownWindow::UpdateSizeAndPosition(), NWidgetViewport::UpdateViewportCoordinates(), and PerformanceRatingDetailWindow::UpdateWidgetSize().

## ◆ mouse_capture_widget

WidgetID Window::mouse_capture_widget = INVALID_WIDGET

ID of current mouse capture widget (e.g. dragged scrollbar). `INVALID_WIDGET` if no widget has mouse capture.

Definition at line 327 of file window_gui.h.

Referenced by NWidgetScrollbar::Draw(), HandleActiveWidget(), HandleScrollbarScrolling(), MusicWindow::OnClick(), GameOptionsWindow::OnClick(), and ScrollbarClickPositioning().

## ◆ nested_focus

const NWidgetCore* Window::nested_focus = nullptr

Currently focused nested widget, or `nullptr` if no nested widget has focus.

Definition at line 320 of file window_gui.h.

Referenced by EditBoxInGlobalFocus(), GetCaretPosition(), GetFocusedTextbuf(), GetTextBoundingRect(), GetTextCharacterAtPosition(), HandleKeypress(), HandleTextInput(), InitializeData(), OnFocus(), OnFocusLost(), PickerWindow::OnHotkey(), SetCandidatePos(), SetFocusedWidget(), SetFocusedWindow(), SetShaded(), UnfocusFocusedWidget(), and NWidgetContainer::UnfocusWidgets().

## ◆ nested_root

std::unique_ptr<NWidgetBase> Window::nested_root {}

Root of the nested tree.

Definition at line 322 of file window_gui.h.

Referenced by ApplyDefaults(), CreateNestedTree(), DispatchHoverEvent(), DispatchLeftClickEvent(), DispatchRightClickEvent(), DrawWidgets(), EnsureVisibleCaption(), FinishInitNested(), GetWidgetFromPos(), HandleMouseOver(), HandleWindowDragging(), InitializeData(), BuildVehicleWindow::OnInit(), PickerWindow::OnInit(), RaiseButtons(), ReInit(), and ResizeWindow().

## ◆ owner

Owner Window::owner = INVALID_OWNER

The owner of the content shown in this window. Company colour is acquired from this variable.

Definition at line 317 of file window_gui.h.

Referenced by CompanyStationsWindow::BuildStationsList(), DepotWindow::Close(), StationViewWindow::Close(), WaypointWindow::Close(), NWidgetLeaf::Draw(), NewsWindow::DrawWidget(), CompanyStationsWindow::DrawWidget(), InitializeData(), DepotWindow::OnClick(), VehicleGroupWindow::OnClick(), StationViewWindow::OnClick(), VehicleGroupWindow::OnPaint(), VehicleListWindow::OnPaint(), CompanyWindow::OnResize(), VehicleGroupWindow::SelectGroup(), VehicleDetailsWindow::VehicleDetailsWindow(), and WaypointWindow::WaypointWindow().

## ◆ parent

Window* Window::parent = nullptr

Parent window.

Definition at line 329 of file window_gui.h.

Referenced by DropdownWindow::Close(), QueryStringWindow::Close(), QueryWindow::Close(), DropdownWindow::DropdownWindow(), QueryWindow::FindWindowPlacementAndResize(), NetworkAskRelayWindow::FindWindowPlacementAndResize(), NetworkAskSurveyWindow::FindWindowPlacementAndResize(), ReplaceVehicleWindow::GenerateReplaceVehList(), IsOSKOpenedFor(), MaybeBringWindowToFront(), QueryStringWindow::OnClick(), QueryWindow::OnClick(), OskWindow::OnClick(), StationViewWindow::OnClick(), WaypointWindow::OnClick(), OskWindow::OnEditboxChanged(), SetDateWindow::OnInitialPosition(), OskWindow::OnInvalidateData(), QueryWindow::OnKeyPress(), VehicleGroupWindow::OnMouseDrag(), DropdownWindow::OnMouseLoop(), QueryStringWindow::OnPlaceObject(), QueryStringWindow::OnPlaceObjectAbort(), StationViewWindow::SearchNonStop(), SetDateWindow::SetDateWindow(), StationViewWindow::SetDisplayedRow(), ShowQuery(), ShowVehicleRefitWindow(), UpdateOSKOriginalText(), and DropdownWindow::UpdateSizeAndPosition().

## ◆ querystrings

std::map<WidgetID, QueryString*> Window::querystrings {}

QueryString associated to WWT_EDITBOX widgets.

Definition at line 321 of file window_gui.h.

Referenced by Close(), GetQueryString(), GetQueryString(), NetworkChatWindow::NetworkChatWindow(), NetworkContentListWindow::NetworkContentListWindow(), SavePresetWindow::SavePresetWindow(), ScriptDebugWindow::ScriptDebugWindow(), and UpdateQueryStringSize().

## ◆ resize

ResizeInfo Window::resize {}

Resize information.

Definition at line 315 of file window_gui.h.

Referenced by DispatchLeftClickEvent(), BaseGraphWindow::DrawGraph(), TownAuthorityWindow::DrawRatings(), NetworkGameWindow::DrawServerLine(), BuildBridgeWindow::DrawWidget(), SelectCompanyLiveryWindow::DrawWidget(), DepotWindow::DrawWidget(), SaveLoadWindow::DrawWidget(), VehicleGroupWindow::DrawWidget(), BuildIndustryWindow::DrawWidget(), IndustryDirectoryWindow::DrawWidget(), NetworkGameWindow::DrawWidget(), SignListWindow::DrawWidget(), SelectStationWindow< T >::DrawWidget(), TextfileWindow::DrawWidget(), TownDirectoryWindow::DrawWidget(), VehicleListWindow::DrawWidget(), ScriptDebugWindow::DrawWidgetLog(), FindWindowPlacementAndResize(), HandleWindowDragging(), InitializeData(), BuildVehicleWindow::OnPaint(), ReInit(), TextfileWindow::SetupScrollbars(), AIConfigWindow::UpdateWidgetSize(), ReplaceVehicleWindow::UpdateWidgetSize(), BuildBridgeWindow::UpdateWidgetSize(), BuildVehicleWindow::UpdateWidgetSize(), SelectCompanyLiveryWindow::UpdateWidgetSize(), SelectCompanyManagerFaceWindow::UpdateWidgetSize(), CompanyInfrastructureWindow::UpdateWidgetSize(), DepotWindow::UpdateWidgetSize(), SaveLoadWindow::UpdateWidgetSize(), FramerateWindow::UpdateWidgetSize(), GSConfigWindow::UpdateWidgetSize(), GoalListWindow::UpdateWidgetSize(), BaseGraphWindow::UpdateWidgetSize(), BaseCargoGraphWindow::UpdateWidgetSize(), VehicleGroupWindow::UpdateWidgetSize(), BuildIndustryWindow::UpdateWidgetSize(), IndustryDirectoryWindow::UpdateWidgetSize(), IndustryCargoesWindow::UpdateWidgetSize(), NetworkContentListWindow::UpdateWidgetSize(), NetworkGameWindow::UpdateWidgetSize(), NetworkClientListWindow::UpdateWidgetSize(), NewGRFInspectWindow::UpdateWidgetSize(), SpriteAlignerWindow::UpdateWidgetSize(), NewGRFParametersWindow::UpdateWidgetSize(), NewGRFWindow::UpdateWidgetSize(), SavePresetWindow::UpdateWidgetSize(), MessageHistoryWindow::UpdateWidgetSize(), BuildObjectWindow::UpdateWidgetSize(), OrdersWindow::UpdateWidgetSize(), PickerWindow::UpdateWidgetSize(), BuildRailStationWindow::UpdateWidgetSize(), BuildRoadStationWindow::UpdateWidgetSize(), ScriptListWindow::UpdateWidgetSize(), ScriptSettingsWindow::UpdateWidgetSize(), ScriptDebugWindow::UpdateWidgetSize(), GameOptionsWindow::UpdateWidgetSize(), SignListWindow::UpdateWidgetSize(), CompanyStationsWindow::UpdateWidgetSize(), StationViewWindow::UpdateWidgetSize(), SelectStationWindow< T >::UpdateWidgetSize(), SubsidyListWindow::UpdateWidgetSize(), TextfileWindow::UpdateWidgetSize(), TimetableWindow::UpdateWidgetSize(), TownAuthorityWindow::UpdateWidgetSize(), TownDirectoryWindow::UpdateWidgetSize(), RefitWindow::UpdateWidgetSize(), VehicleListWindow::UpdateWidgetSize(), and VehicleDetailsWindow::UpdateWidgetSize().

## ◆ scale

int Window::scale = 0

Scale of this window – used to determine how to resize.

Definition at line 305 of file window_gui.h.

Referenced by BaseGraphWindow::DrawWidget(), BaseGraphWindow::OnClick(), and ReInit().

## ◆ scheduled_invalidation_data

std::vector<int> Window::scheduled_invalidation_data {}
| protected

Data of scheduled OnInvalidateData() calls.

Definition at line 283 of file window_gui.h.

Referenced by InvalidateData(), and ProcessScheduledInvalidations().

## ◆ scheduled_resize

bool Window::scheduled_resize = false
| protected

Set if window has been resized.

Definition at line 284 of file window_gui.h.

Referenced by ProcessScheduledResize(), and ScheduleResize().

## ◆ shade_select

NWidgetStacked* Window::shade_select = nullptr

Selection widget (NWID_SELECTION) to use for shading the window. If `nullptr`, window cannot shade.

Definition at line 324 of file window_gui.h.

Referenced by SetShaded().

## ◆ timeout_timer

uint8_t Window::timeout_timer = 0

Timer value of the WindowFlag::Timeout for flags.

Definition at line 307 of file window_gui.h.

Referenced by HandleButtonClick().

## ◆ top

int Window::top = 0

y position of top edge of the window

Definition at line 311 of file window_gui.h.

Referenced by AlignInitialConstructionToolbar(), DropdownWindow::Close(), DrawOverlappedWindow(), DrawViewport(), NewGRFWindow::DrawWidget(), OrdersWindow::DrawWidget(), TextfileWindow::DrawWidget(), EnsureVisibleCaption(), FindWindowFromPt(), FindWindowPlacementAndResize(), QueryWindow::FindWindowPlacementAndResize(), NetworkAskRelayWindow::FindWindowPlacementAndResize(), NetworkAskSurveyWindow::FindWindowPlacementAndResize(), GetAutoPlacePosition(), DropdownWindow::GetDropDownItem(), GetMainViewBottom(), GetMainViewTop(), GetToolbarAlignedWindowPosition(), HandleActiveWidget(), HandleMouseDragDrop(), HandleMouseOver(), HandleWindowDragging(), InitializePositionSize(), InitializeWindowViewport(), IsGoodAutoPlace1(), IsGoodAutoPlace2(), LocalGetWindowPlacement(), MaybeBringWindowToFront(), SetDateWindow::OnInitialPosition(), NewsWindow::OnInvalidateData(), PositionWindow(), PreventHiding(), RelocateAllWindows(), ResizeWindow(), SetCandidatePos(), SetCompositionPos(), SetDirty(), NWidgetBase::SetDirty(), NewsWindow::SetWindowTop(), IndustryCargoesWindow::ShortenCargoColumn(), ShowTerraformToolbar(), StartWindowDrag(), and NWidgetViewport::UpdateViewportCoordinates().

## ◆ unshaded_size

Dimension Window::unshaded_size {}

Last known unshaded size (only valid while shaded).

Definition at line 325 of file window_gui.h.

Referenced by MaybeBringWindowToFront(), and SetShaded().

## ◆ viewport

std::unique_ptr<ViewportData> Window::viewport

Pointer to viewport data, if present.

Definition at line 319 of file window_gui.h.

Referenced by ChangeVehicleViewports(), ChangeVehicleWindow(), ConZoomToLevel(), DoZoomInOutWindow(), SmallMapWindow::DrawMapIndicators(), DrawViewport(), EnsureVisibleCaption(), FindWindowPlacementAndResize(), LinkGraphOverlay::GetStationMiddle(), HandleAutoscroll(), HandleViewportScroll(), InitializeWindowViewport(), IsPtInWindowViewport(), ViewportSign::MarkDirty(), VehicleViewWindow::OnClick(), ExtraViewportWindow::OnClick(), MainWindow::OnHotkey(), VehicleViewWindow::OnHotkey(), MainToolbarWindow::OnInvalidateData(), ScenarioEditorToolbarWindow::OnInvalidateData(), ExtraViewportWindow::OnInvalidateData(), MainWindow::OnMouseWheel(), VehicleViewWindow::OnPaint(), SelectGameWindow::OnRealtimeTick(), IndustryViewWindow::OnResize(), MainWindow::OnResize(), NewsWindow::OnResize(), TownViewWindow::OnResize(), VehicleViewWindow::OnResize(), ExtraViewportWindow::OnResize(), WaypointWindow::OnResize(), MainWindow::OnScroll(), ExtraViewportWindow::OnScroll(), MainWindow::OnTooltip(), PositionWindow(), MainWindow::RefreshLinkGraph(), ScrollWindowTo(), SetupScreenshotViewport(), NewsWindow::SetWindowTop(), SmallMapWindow::SmallMapCenterOnCurrentPos(), NWidgetViewport::UpdateViewportCoordinates(), UpdateViewportPosition(), and UpdateWindows().

## ◆ white_border_timer

uint8_t Window::white_border_timer = 0

Timer value of the WindowFlag::WhiteBorder for flags.

Definition at line 308 of file window_gui.h.

## ◆ widget_lookup

WidgetLookup Window::widget_lookup {}

Indexed access to the nested widget tree. Do not access directly, use Window::GetWidget() instead.

Definition at line 323 of file window_gui.h.

Referenced by CreateNestedTree(), DisableAllWidgetHighlight(), DrawSortButtonState(), DrawWidgets(), GetWidget(), GetWidget(), BuildVehicleWindow::OnInit(), PickerWindow::OnInit(), ScenarioEditorLandscapeGenerationWindow::OnTimeout(), ProcessHighlightedInvalidations(), RaiseButtons(), SetWidgetDirty(), and SetWidgetHighlight().

## ◆ width

int Window::width = 0

width of the window (number of pixels to the right in x direction)

Definition at line 312 of file window_gui.h.

Referenced by AlignInitialConstructionToolbar(), GameOptionsWindow::BuildDropDownList(), IndustryCargoesWindow::CalculatePositionInWidget(), VehicleGroupWindow::ComputeGroupInfoSize(), DispatchLeftClickEvent(), NWidgetLeaf::Draw(), StoryBookWindow::DrawActionElement(), StationViewWindow::DrawCargoIcons(), VehicleGroupWindow::DrawGroupInfo(), DrawOverlappedWindow(), TimetableWindow::DrawTimetablePanel(), NewGRFInspectWindow::DrawVehicleChainWidget(), OrdersWindow::DrawWidget(), PickerWindow::DrawWidget(), RefitWindow::DrawWidget(), DrawWidgets(), FindWindowFromPt(), FindWindowPlacementAndResize(), QueryWindow::FindWindowPlacementAndResize(), NetworkAskRelayWindow::FindWindowPlacementAndResize(), NetworkAskSurveyWindow::FindWindowPlacementAndResize(), GetAutoPlacePosition(), IConsoleWindow::GetCaretPosition(), TownViewWindow::GetDesiredInfoHeight(), IndustryDirectoryWindow::GetIndustryListWidth(), IConsoleWindow::GetTextBoundingRect(), IConsoleWindow::GetTextCharacterAtPosition(), GetToolbarAlignedWindowPosition(), GameOptionsWindow::GetWidgetString(), HandleWindowDragging(), IConsoleResize(), InitializePositionSize(), IsGoodAutoPlace1(), IsGoodAutoPlace2(), LocalGetWindowPlacement(), MaybeBringWindowToFront(), VehicleGroupWindow::OnClick(), GameOptionsWindow::OnDropdownSelect(), BaseVehicleListWindow::OnInit(), SetDateWindow::OnInitialPosition(), IConsoleWindow::OnPaint(), DepotWindow::OnPaint(), MainWindow::OnPaint(), PositionWindow(), PreventHiding(), ReInit(), RelocateAllWindows(), ResizeWindow(), SetCandidatePos(), SetDirty(), SetShaded(), NewsWindow::SetWindowTop(), ShowTerraformToolbar(), VehicleGroupWindow::UpdateColumnRects(), BuildVehicleWindow::UpdateWidgetSize(), CompanyFinancesWindow::UpdateWidgetSize(), SelectCompanyLiveryWindow::UpdateWidgetSize(), CompanyWindow::UpdateWidgetSize(), GenerateProgressWindow::UpdateWidgetSize(), PerformanceRatingDetailWindow::UpdateWidgetSize(), VehicleGroupWindow::UpdateWidgetSize(), PerformanceLeagueWindow::UpdateWidgetSize(), ScriptLeagueWindow::UpdateWidgetSize(), LandInfoWindow::UpdateWidgetSize(), AboutWindow::UpdateWidgetSize(), TooltipsWindow::UpdateWidgetSize(), ScanProgressWindow::UpdateWidgetSize(), GameOptionsWindow::UpdateWidgetSize(), TimetableWindow::UpdateWidgetSize(), ScenarioEditorToolbarWindow::UpdateWidgetSize(), TownAuthorityWindow::UpdateWidgetSize(), VehicleListWindow::UpdateWidgetSize(), and VehicleDetailsWindow::UpdateWidgetSize().

## ◆ window_class

WindowClass Window::window_class {}

Window class.

Definition at line 302 of file window_gui.h.

Referenced by BringWindowToFront(), ViewportData::CancelFollow(), CheckSoftLimit(), QueryStringWindow::Close(), DispatchLeftClickEvent(), BuildRoadStationWindow::DrawWidget(), EditBoxInGlobalFocus(), FocusedWindowIsConsole(), GetAutoPlacePosition(), BuildRoadStationWindow::GetRoadStationTypeByWindowClass(), HandleAutoscroll(), HandleEditBoxKey(), HandleKeypress(), HandlePlacePushButton(), HandleTextInput(), InitializeData(), InvalidateWindowClassesData(), InvalidateWindowData(), IsGoodAutoPlace1(), IsGoodAutoPlace2(), MaybeBringWindowToFront(), MayBeShown(), StationViewWindow::OnClick(), WaypointWindow::OnClick(), BuildRoadStationWindow::OnPaint(), PositionWindow(), ProcessScheduledInvalidations(), ReInitAllWindows(), RelocateAllWindows(), SetCandidatePos(), SetFocusedWindow(), SetObjectToPlaceWnd(), SetWindowClassesDirty(), SetWindowDirty(), SetWindowWidgetDirty(), ShowQuery(), ShowScriptDebugWindow(), and BuildTreesWindow::UpdateMode().

## ◆ window_desc

WindowDesc& Window::window_desc

Window description.

Definition at line 300 of file window_gui.h.

Referenced by ApplyDefaults(), CloseAllNonVitalWindows(), CloseConstructionWindows(), CloseNonVitalWindows(), CreateNestedTree(), DispatchLeftClickEvent(), DispatchRightClickEvent(), FinishInitNested(), HandleKeypress(), HandleToolbarHotkey(), InitializeData(), MaybeBringWindowToFront(), OnInitialPosition(), and ReInit().

## ◆ window_number

WindowNumber Window::window_number = 0

Window number within the window class.

Definition at line 303 of file window_gui.h.

Referenced by RefitWindow::BuildRefitList(), ChangeVehicleWindow(), DepotWindow::Close(), EndGameWindow::Close(), QueryStringWindow::Close(), TownViewWindow::Close(), WaypointWindow::Close(), DispatchLeftClickEvent(), DoSelectCompanyManagerFace(), IndustryViewWindow::DrawInfo(), NewGRFInspectWindow::DrawMainPanelWidget(), NewGRFInspectWindow::DrawVehicleChainWidget(), ReplaceVehicleWindow::DrawWidget(), CompanyFinancesWindow::DrawWidget(), SelectCompanyLiveryWindow::DrawWidget(), SelectCompanyManagerFaceWindow::DrawWidget(), CompanyWindow::DrawWidget(), EnginePreviewWindow::DrawWidget(), RefitWindow::DrawWidget(), FinishInitNested(), ReplaceVehicleWindow::GenerateReplaceVehList(), DepotWindow::GetDestinationIndex(), NewGRFInspectWindow::GetFeatureIndex(), ReplaceVehicleWindow::GetWidgetString(), CompanyFinancesWindow::GetWidgetString(), SelectCompanyLiveryWindow::GetWidgetString(), CompanyInfrastructureWindow::GetWidgetString(), CompanyWindow::GetWidgetString(), GoalListWindow::GetWidgetString(), IndustryViewWindow::GetWidgetString(), NewGRFInspectWindow::GetWidgetString(), TownAuthorityWindow::GetWidgetString(), RefitWindow::GetWidgetString(), GoalListWindow::HandleClick(), HandlePlacePushButton(), NewGRFInspectWindow::HasChainIndex(), InitializeData(), InvalidateWindowData(), IndustryViewWindow::IsNewGRFInspectable(), ReplaceVehicleWindow::OnClick(), CompanyFinancesWindow::OnClick(), SelectCompanyLiveryWindow::OnClick(), CompanyWindow::OnClick(), DepotWindow::OnClick(), IndustryViewWindow::OnClick(), QueryStringWindow::OnClick(), NewGRFInspectWindow::OnClick(), StationViewWindow::OnClick(), TownViewWindow::OnClick(), RefitWindow::OnClick(), WaypointWindow::OnClick(), ReplaceVehicleWindow::OnDropdownSelect(), SelectCompanyLiveryWindow::OnDropdownSelect(), VehicleViewWindow::OnHotkey(), OnInitialPosition(), SelectCompanyLiveryWindow::OnInvalidateData(), EnginePreviewWindow::OnInvalidateData(), IndustryViewWindow::OnInvalidateData(), OrdersWindow::OnInvalidateData(), TimetableWindow::OnInvalidateData(), RefitWindow::OnInvalidateData(), StoryBookWindow::OnPageElementClick(), CompanyFinancesWindow::OnPaint(), SelectCompanyLiveryWindow::OnPaint(), CompanyWindow::OnPaint(), DepotWindow::OnPaint(), HighScoreWindow::OnPaint(), QueryStringWindow::OnPlaceObject(), QueryStringWindow::OnPlaceObjectAbort(), CompanyWindow::OnQueryTextFinished(), IndustryViewWindow::OnQueryTextFinished(), NewGRFInspectWindow::OnQueryTextFinished(), TownViewWindow::OnQueryTextFinished(), WaypointWindow::OnQueryTextFinished(), IndustryViewWindow::OnResize(), RefitWindow::OnResize(), DepotWindow::OnVehicleSelect(), ReInit(), SetObjectToPlaceWnd(), CompanyFinancesWindow::SetupWidgets(), SetWindowDirty(), SetWindowWidgetDirty(), IndustryViewWindow::ShowNewGRFInspectWindow(), ShowScriptDebugWindow(), BuildVehicleWindow::UpdateFilterByTile(), BuildTreesWindow::UpdateMode(), ReplaceVehicleWindow::UpdateWidgetSize(), EnginePreviewWindow::UpdateWidgetSize(), NewGRFInspectWindow::UpdateWidgetSize(), RefitWindow::UpdateWidgetSize(), NewGRFInspectWindow::ValidateChainIndex(), VehicleDetailsWindow::VehicleDetailsWindow(), and WaypointWindow::WaypointWindow().

## ◆ z_position

WindowList::iterator Window::z_position {}

Definition at line 330 of file window_gui.h.

The documentation for this struct was generated from the following files:

- src/window_gui.h
- src/viewport.cpp
- src/widget.cpp
- src/window.cpp