OpenTTD Source 20241224-master-gf74b0cf984
Window Struct Reference

Data structure for an opened window. More...

#include <window_gui.h>

Inheritance diagram for Window:
ZeroedMemoryAllocator AIConfigWindow AboutWindow BaseGraphWindow BaseNetworkContentDownloadStatusWindow BaseVehicleListWindow BootstrapAskForDownloadWindow BootstrapBackground BootstrapErrorWindow BuildAirToolbarWindow BuildBridgeWindow BuildDocksToolbarWindow BuildIndustryWindow BuildRailToolbarWindow BuildRoadToolbarWindow BuildTreesWindow BuildVehicleWindow BuyCompanyWindow CheatWindow CompanyFinancesWindow CompanyInfrastructureWindow CompanyStationsWindow CompanyWindow CreateScenarioWindow CustomCurrencyWindow DepotWindow DropdownWindow EndGameHighScoreBaseWindow EnginePreviewWindow ErrmsgWindow ExtraViewportWindow FoundTownWindow FramerateWindow FrametimeGraphWindow GSConfigWindow GameOptionsWindow GameSettingsWindow GenerateLandscapeWindow GenerateProgressWindow GoalListWindow GoalQuestionWindow GraphLegendWindow HelpWindow IConsoleWindow IndustryCargoesWindow IndustryDirectoryWindow IndustryViewWindow LandInfoWindow LinkGraphLegendWindow MainToolbarWindow MainWindow MessageHistoryWindow MusicTrackSelectionWindow MusicWindow NetworkAskRelayWindow NetworkAskSurveyWindow NetworkChatWindow NetworkClientListWindow NetworkContentListWindow NetworkGameWindow NetworkJoinStatusWindow NetworkStartServerWindow NewGRFInspectWindow NewGRFParametersWindow NewGRFWindow NewsWindow OrdersWindow OskWindow PerformanceLeagueWindow PerformanceRatingDetailWindow PickerWindowBase QueryStringWindow QueryWindow RefitWindow ReplaceVehicleWindow SaveLoadWindow SavePresetWindow ScanProgressWindow ScenarioEditorLandscapeGenerationWindow ScenarioEditorToolbarWindow ScreenshotWindow ScriptDebugWindow ScriptLeagueWindow ScriptListWindow ScriptSettingsWindow SelectCompanyLiveryWindow SelectCompanyManagerFaceWindow SelectGameWindow SelectStationWindow< T > SetDateWindow SignListWindow SignWindow SmallMapWindow SpriteAlignerWindow StationViewWindow StatusBarWindow StoryBookWindow SubsidyListWindow TerraformToolbarWindow TextfileWindow TimetableWindow TooltipsWindow TownAuthorityWindow TownDirectoryWindow TownViewWindow TransparenciesWindow VehicleDetailsWindow VehicleViewWindow WaypointWindow

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.
 
voidoperator 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 ScrollbarGetScrollbar (WidgetID widnum) const
 Return the Scrollbar to a widget index.
 
ScrollbarGetScrollbar (WidgetID widnum)
 Return the Scrollbar to a widget index.
 
const QueryStringGetQueryString (WidgetID widnum) const
 Return the querystring associated to a editbox.
 
QueryStringGetQueryString (WidgetID widnum)
 Return the querystring associated to a editbox.
 
void UpdateQueryStringSize ()
 Update size of all QueryStrings of this window.
 
virtual const struct TextbufGetFocusedTextbuf () 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 (const char *from, const char *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.
 
template<typename T , std::enable_if_t< std::is_base_of< StrongTypedefBase, T >::value, int > = 0>
void FinishInitNested (T number)
 
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, const char *str, bool marked, const char *caret, const char *insert_location, const char *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.
 
WindowFindChildWindow (WindowClass wc=WC_INVALID) 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.
 
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 void SetStringParameters (WidgetID widget) const
 Initialize string parameters 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 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)
 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)
 A dropdown option associated to this window has been selected.
 
virtual void OnDropdownClose (Point pt, WidgetID widget, int index, 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 NWidgetBaseGetWidget (WidgetID widnum) const
 Specialized case of Window::GetWidget for the nested widget base class.
 
- Public Member Functions inherited from ZeroedMemoryAllocator
void * operator new (size_t size)
 Memory allocator for a single class instance.
 
void * operator new[] (size_t size)
 Memory allocator for an array of class instances.
 
void operator delete (void *ptr)
 Memory release for a single class instance.
 
void operator delete[] (void *ptr)
 Memory release for an array of class instances.
 

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

WindowDescwindow_desc
 Window description.
 
WindowFlags flags
 Window flags.
 
WindowClass window_class
 Window class.
 
WindowNumber window_number
 Window number within the window class.
 
int scale
 Scale of this window – used to determine how to resize.
 
uint8_t timeout_timer
 Timer value of the WF_TIMEOUT for flags.
 
uint8_t white_border_timer
 Timer value of the WF_WHITE_BORDER for flags.
 
int left
 x position of left edge of the window
 
int top
 y position of top edge of the window
 
int width
 width of the window (number of pixels to the right in x direction)
 
int height
 Height of the window (number of pixels down in y direction)
 
ResizeInfo resize
 Resize information.
 
Owner owner
 The owner of the content shown in this window. Company colour is acquired from this variable.
 
ViewportDataviewport
 Pointer to viewport data, if present.
 
const NWidgetCorenested_focus
 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< NWidgetBasenested_root
 Root of the nested tree.
 
WidgetLookup widget_lookup
 Indexed access to the nested widget tree. Do not access directly, use Window::GetWidget() instead.
 
NWidgetStackedshade_select
 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
 ID of current mouse capture widget (e.g. dragged scrollbar). -1 if no widget has mouse capture.
 
Windowparent
 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)
 Resize window towards the default size.
 
virtual ~Window ()
 Remove window and all its child windows from the window stack.
 

Protected Attributes

std::vector< intscheduled_invalidation_data
 Data of scheduled OnInvalidateData() calls.
 
bool scheduled_resize
 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 273 of file window_gui.h.

Member Typedef Documentation

◆ Iterate

Iterate all windows in whatever order is easiest.

Definition at line 927 of file window_gui.h.

◆ IterateFromBack

Iterate all windows in Z order from back to front.

Definition at line 928 of file window_gui.h.

◆ IterateFromFront

Iterate all windows in Z order from front to back.

Definition at line 929 of file window_gui.h.

◆ IteratorToBack

Iterate in Z order towards back.

Definition at line 906 of file window_gui.h.

◆ IteratorToFront

Iterate in Z order towards front.

Definition at line 905 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 1084 of file window.cpp.

References GetWidget(), and viewport.

◆ Window()

Window::Window ( WindowDesc desc)

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

Parameters
descThe description of the window.

Definition at line 1756 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 194 of file window.cpp.

References flags, nested_root, WindowDesc::pref_sticky, WF_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 1047 of file window.cpp.

References _last_scroll_window, _mouseover_last_w, CloseChildWindows(), closed_windows, GetWidget(), 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(), CloseChildWindows(), CloseConstructionWindows(), CloseNonVitalWindows(), CloseWindowById(), DeleteRenameSignWindow(), DispatchLeftClickEvent(), DispatchRightClickEvent(), HideActiveNewsMessage(), BuildBridgeWindow::OnClick(), SelectCompanyManagerFaceWindow::OnClick(), BuyCompanyWindow::OnClick(), SetDateWindow::OnClick(), EnginePreviewWindow::OnClick(), GoalQuestionWindow::OnClick(), EndGameHighScoreBaseWindow::OnClick(), NetworkAskSurveyWindow::OnClick(), NewGRFParametersWindow::OnClick(), SavePresetWindow::OnClick(), NewsWindow::OnClick(), OskWindow::OnClick(), ScriptListWindow::OnClick(), ScriptSettingsWindow::OnClick(), SignWindow::OnClick(), RefitWindow::OnClick(), OskWindow::OnFocusLost(), EnginePreviewWindow::OnInvalidateData(), LinkGraphLegendWindow::OnInvalidateData(), ScriptListWindow::OnInvalidateData(), ScriptSettingsWindow::OnInvalidateData(), ScriptTextfileWindow::OnInvalidateData(), BuildBridgeWindow::OnKeyPress(), EndGameHighScoreBaseWindow::OnKeyPress(), TooltipsWindow::OnMouseLoop(), StationJoinerNeeded(), and UnInitWindowSystem().

◆ CloseChildWindows()

◆ 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_nestedFill 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 1723 of file window.cpp.

References GetWidget(), 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 65 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 224 of file window.cpp.

References CLRBITS, flags, GetWidget(), WF_HIGHLIGHTED, and widget_lookup.

◆ DisableWidget()

void Window::DisableWidget ( WidgetID  widget_index)
inline

◆ DrawSortButtonState()

◆ DrawViewport()

void Window::DrawViewport ( ) const

Draw the viewport of this window.

Definition at line 1832 of file viewport.cpp.

References GetWidget(), 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
rRectangle occupied by the widget.
widgetNumber 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, PaymentRatesGraphWindow, PerformanceRatingDetailWindow, IndustryProductionGraphWindow, 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, GameSettingsWindow, 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 610 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 732 of file widget.cpp.

References _string_colourmap, _window_highlight_colour, DrawFrameRect(), Rect::Expand(), flags, FR_BORDERONLY, GetWidget(), GfxFillRect(), height, nested_root, WidgetDimensions::scaled, Rect::Shrink(), WF_HIGHLIGHTED, WF_WHITE_BORDER, widget_lookup, and width.

Referenced by OnPaint(), BuildAirportWindow::OnPaint(), ReplaceVehicleWindow::OnPaint(), BuildVehicleWindow::OnPaint(), CompanyFinancesWindow::OnPaint(), SelectCompanyLiveryWindow::OnPaint(), SelectCompanyManagerFaceWindow::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(), GameSettingsWindow::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_indexindex of this widget in the window

Definition at line 406 of file window_gui.h.

References GetWidget(), and 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
wparent Window to find child of
wcWindow class of the window to remove; WC_INVALID if class does not matter
Returns
a Window pointer that is the child of w, or nullptr otherwise

Definition at line 1022 of file window.cpp.

References GetWidget(), and WC_INVALID.

Referenced by CloseChildWindows().

◆ FindWindowPlacementAndResize()

void Window::FindWindowPlacementAndResize ( int  def_width,
int  def_height 
)
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_widthdefault width in pixels of the window
def_heightdefault height in pixels of the window
See also
Window::Window(), Window::InitializeData(), Window::InitializePositionSize()

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

Definition at line 1420 of file window.cpp.

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

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

◆ FinishInitNested() [1/2]

template<typename T , std::enable_if_t< std::is_base_of< StrongTypedefBase, T >::value, int > = 0>
void Window::FinishInitNested ( number)
inline

Definition at line 353 of file window_gui.h.

◆ FinishInitNested() [2/2]

◆ 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 378 of file window.cpp.

References QueryString::GetCaretPosition(), GetQueryString(), GetWidget(), NWidgetCore::index, 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 365 of file window.cpp.

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

◆ GetQueryString() [1/2]

QueryString * Window::GetQueryString ( WidgetID  widnum)

Return the querystring associated to a editbox.

Parameters
widnumEditbox widget index
Returns
QueryString or nullptr.

Definition at line 345 of file window.cpp.

References querystrings.

◆ GetQueryString() [2/2]

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

Return the querystring associated to a editbox.

Parameters
widnumEditbox widget index
Returns
QueryString or nullptr.

Definition at line 334 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
clickposVertical position of the mouse click.
widgetWidget number of the widget clicked in.
paddingAmount of empty space between the widget edge and the top of the first row.
line_heightHeight 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 213 of file window.cpp.

References GetWidget().

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

◆ GetScrollbar() [1/2]

Scrollbar * Window::GetScrollbar ( WidgetID  widnum)

Return the Scrollbar to a widget index.

Parameters
widnumScrollbar widget index
Returns
Scrollbar to the widget

Definition at line 324 of file window.cpp.

References GetWidget().

◆ GetScrollbar() [2/2]

◆ GetTextBoundingRect()

Rect Window::GetTextBoundingRect ( const char from,
const char to 
) const
virtual

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

Parameters
fromStart of the string range.
toEnd of the string range.
Returns
Rectangle encompassing the string range, relative to the window.

Reimplemented in IConsoleWindow.

Definition at line 394 of file window.cpp.

References QueryString::GetBoundingRect(), GetQueryString(), NWidgetCore::index, 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
ptThe position to test.
Returns
Index of the character position or -1 if no character is at the position.

Reimplemented in IConsoleWindow.

Definition at line 409 of file window.cpp.

References QueryString::GetCharAtPosition(), GetQueryString(), NWidgetCore::index, 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
NWIDType of the nested widget.
Parameters
widnumWidget number of the widget to retrieve.
Returns
The requested widget if it is instantiated, nullptr otherwise.

Definition at line 952 of file window_gui.h.

References GetWidget(), and 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
NWIDType of the nested widget.
Parameters
widnumWidget number of the widget to retrieve.
Returns
The requested widget if it is instantiated, nullptr otherwise.

Definition at line 977 of file window_gui.h.

References GetWidget().

Referenced by NewGRFWindow::AddGRFToActive(), GameManualTextfileWindow::AfterLoadChangelog(), TextfileWindow::AfterLoadMarkdown(), TextfileWindow::AfterLoadText(), BuildAirToolbarWindow::AirportToolbarGlobalHotkeys(), TextfileWindow::AppendHistory(), BaseVehicleListWindow::BuildActionDropdownList(), TimetableWindow::BuildArrivalDepartureList(), BaseVehicleListWindow::BuildCargoDropDownList(), StationViewWindow::BuildCargoList(), NetworkContentListWindow::BuildContentList(), StoryBookWindow::BuildDropDownList(), GameOptionsWindow::BuildDropDownList(), StationViewWindow::BuildFlowList(), NetworkGameWindow::BuildGUINetworkGameList(), BuildObjectWindow::BuildObjectGlobalHotkeys(), PickerWindow::BuildPickerClassList(), PickerWindow::BuildPickerTypeList(), BuildRailStationWindow::BuildRailStationGlobalHotkeys(), RefitWindow::BuildRefitList(), CompanyStationsWindow::BuildStationsList(), ScriptLeagueWindow::BuildTable(), IndustryCargoesWindow::CalculatePositionInWidget(), NewGRFWindow::CanUpgradeCurrent(), ScriptDebugWindow::ChangeToScript(), TextfileWindow::CheckHyperlinkClick(), BuildRailStationWindow::CheckSelectedSize(), Close(), DropdownWindow::Close(), QueryStringWindow::Close(), NetworkContentDownloadStatusWindow::Close(), SelectStationWindow< T >::Close(), IndustryCargoesWindow::ComputeCargoDisplay(), VehicleGroupWindow::ComputeGroupInfoSize(), IndustryCargoesWindow::ComputeIndustryDisplay(), GoalListWindow::CountLines(), SubsidyListWindow::CountLines(), IndustryCargoesWindow::CountMatchingAcceptingIndustries(), IndustryCargoesWindow::CountMatchingProducingIndustries(), CreateNestedTree(), DepotWindow::DepotClick(), DisableAllWidgetHighlight(), DisableWidget(), BuildDocksToolbarWindow::DockToolbarGlobalHotkeys(), StationViewWindow::DrawAcceptedCargo(), StoryBookWindow::DrawActionElement(), TownAuthorityWindow::DrawActions(), TimetableWindow::DrawArrivalDeparturePanel(), NetworkClientListWindow::DrawButtons(), StationViewWindow::DrawCargoRatings(), NetworkClientListWindow::DrawCompany(), CompanyInfrastructureWindow::DrawCountLine(), NetworkContentListWindow::DrawDetails(), FramerateWindow::DrawElementTimesColumn(), StationViewWindow::DrawEntries(), BaseGraphWindow::DrawGraph(), VehicleGroupWindow::DrawGroupInfo(), IndustryViewWindow::DrawInfo(), GoalListWindow::DrawListColumn(), NewGRFInspectWindow::DrawMainPanelWidget(), NetworkContentListWindow::DrawMatrix(), TownAuthorityWindow::DrawRatings(), NetworkGameWindow::DrawServerLine(), BuildSignalWindow::DrawSignalSprite(), DrawSortButtonState(), NewGRFInspectWindow::DrawString(), TimetableWindow::DrawSummaryPanel(), TimetableWindow::DrawTimetablePanel(), NewGRFInspectWindow::DrawVehicleChainWidget(), VehicleDetailsWindow::DrawVehicleDetails(), DepotWindow::DrawVehicleInDepot(), BaseVehicleListWindow::DrawVehicleListItems(), DrawViewport(), AIConfigWindow::DrawWidget(), BuildAirportWindow::DrawWidget(), ReplaceVehicleWindow::DrawWidget(), BootstrapErrorWindow::DrawWidget(), BootstrapAskForDownloadWindow::DrawWidget(), BuildBridgeWindow::DrawWidget(), CheatWindow::DrawWidget(), CompanyFinancesWindow::DrawWidget(), SelectCompanyLiveryWindow::DrawWidget(), CompanyInfrastructureWindow::DrawWidget(), CompanyWindow::DrawWidget(), BuyCompanyWindow::DrawWidget(), DepotWindow::DrawWidget(), BuildDocksDepotWindow::DrawWidget(), DropdownWindow::DrawWidget(), EnginePreviewWindow::DrawWidget(), ErrmsgWindow::DrawWidget(), SaveLoadWindow::DrawWidget(), FramerateWindow::DrawWidget(), FrametimeGraphWindow::DrawWidget(), GSConfigWindow::DrawWidget(), GenerateProgressWindow::DrawWidget(), GoalQuestionWindow::DrawWidget(), GraphLegendWindow::DrawWidget(), BaseGraphWindow::DrawWidget(), PaymentRatesGraphWindow::DrawWidget(), PerformanceRatingDetailWindow::DrawWidget(), IndustryProductionGraphWindow::DrawWidget(), VehicleGroupWindow::DrawWidget(), BuildIndustryWindow::DrawWidget(), IndustryDirectoryWindow::DrawWidget(), IndustryCargoesWindow::DrawWidget(), SelectGameWindow::DrawWidget(), PerformanceLeagueWindow::DrawWidget(), ScriptLeagueWindow::DrawWidget(), LinkGraphLegendWindow::DrawWidget(), LandInfoWindow::DrawWidget(), AboutWindow::DrawWidget(), TooltipsWindow::DrawWidget(), MusicTrackSelectionWindow::DrawWidget(), MusicWindow::DrawWidget(), BaseNetworkContentDownloadStatusWindow::DrawWidget(), NetworkGameWindow::DrawWidget(), NetworkStartServerWindow::DrawWidget(), NetworkClientListWindow::DrawWidget(), NetworkJoinStatusWindow::DrawWidget(), NetworkAskRelayWindow::DrawWidget(), NetworkAskSurveyWindow::DrawWidget(), SpriteAlignerWindow::DrawWidget(), NewGRFParametersWindow::DrawWidget(), NewGRFWindow::DrawWidget(), SavePresetWindow::DrawWidget(), ScanProgressWindow::DrawWidget(), NewsWindow::DrawWidget(), MessageHistoryWindow::DrawWidget(), BuildObjectWindow::DrawWidget(), OrdersWindow::DrawWidget(), PickerWindow::DrawWidget(), BuildRailStationWindow::DrawWidget(), BuildRailDepotWindow::DrawWidget(), BuildRoadDepotWindow::DrawWidget(), BuildRoadStationWindow::DrawWidget(), ScriptListWindow::DrawWidget(), ScriptSettingsWindow::DrawWidget(), GameOptionsWindow::DrawWidget(), GameSettingsWindow::DrawWidget(), SignListWindow::DrawWidget(), CompanyStationsWindow::DrawWidget(), SelectStationWindow< T >::DrawWidget(), StatusBarWindow::DrawWidget(), StoryBookWindow::DrawWidget(), SubsidyListWindow::DrawWidget(), ScenarioEditorLandscapeGenerationWindow::DrawWidget(), TextfileWindow::DrawWidget(), ScenarioEditorToolbarWindow::DrawWidget(), TownAuthorityWindow::DrawWidget(), TownViewWindow::DrawWidget(), TownDirectoryWindow::DrawWidget(), TransparenciesWindow::DrawWidget(), RefitWindow::DrawWidget(), VehicleDetailsWindow::DrawWidget(), VehicleViewWindow::DrawWidget(), ScriptDebugWindow::DrawWidgetCompanyButton(), ScriptDebugWindow::DrawWidgetLog(), DrawWidgets(), DropdownWindow::DropdownWindow(), EnableWidget(), StoryBookWindow::EnsureStoryPageElementLayout(), StationViewWindow::EstimateDestinations(), BuildVehicleWindow::FilterByText(), NetworkContentListWindow::FilterContentList(), BuildVehicleWindow::FilterSingleEngine(), FindChildWindow(), TextfileWindow::FindHyperlinksInMarkdown(), FindWindowPlacementAndResize(), QueryWindow::FindWindowPlacementAndResize(), NetworkAskRelayWindow::FindWindowPlacementAndResize(), NetworkAskSurveyWindow::FindWindowPlacementAndResize(), StatusBarWindow::FindWindowPlacementAndResize(), FinishInitNested(), DropdownWindow::FitAvailableHeight(), ReplaceVehicleWindow::GenerateLists(), ReplaceVehicleWindow::GenerateReplaceRailList(), ReplaceVehicleWindow::GenerateReplaceVehList(), BaseVehicleListWindow::GetActionDropdownSize(), StoryBookWindow::GetAvailablePageContentWidth(), QueryString::GetBoundingRect(), BuildBridgeWindow::GetBridgeSelectString(), NetworkClientListWindow::GetButtonAtPoint(), RefitWindow::GetCapacityString(), GetCaretPosition(), IConsoleWindow::GetCaretPosition(), QueryString::GetCaretPosition(), IndustryDirectoryWindow::GetCargoTransportedSortValue(), WaypointWindow::GetCenterTile(), QueryString::GetCharAtPosition(), StoryBookWindow::GetContentHeight(), BaseGraphWindow::GetDataSetRange(), TownViewWindow::GetDesiredInfoHeight(), DropdownWindow::GetDropDownItem(), NewGRFParametersWindow::GetDummyParameterInfo(), StationViewWindow::GetEntryString(), NewGRFInspectWindow::GetFeatureIndex(), StoryBookWindow::GetHeadHeight(), BuildHouseWindow::GetHouseInformation(), BuildHouseWindow::GetHouseYear(), IndustryDirectoryWindow::GetIndustryListWidth(), IndustryDirectoryWindow::GetIndustryString(), OrdersWindow::GetOrderFromPt(), StoryBookWindow::GetPageElementHeight(), NewGRFParametersWindow::GetParameterInfo(), VehicleDetailsWindow::GetRoadVehDetailsHeight(), GetRowFromWidget(), GetScrollbar(), GetScrollbar(), StoryBookWindow::GetSelPageNum(), IConsoleWindow::GetTextBoundingRect(), IConsoleWindow::GetTextCharacterAtPosition(), EndGameHighScoreBaseWindow::GetTopLeft(), CompanyInfrastructureWindow::GetTotalMaintenanceCost(), TownDirectoryWindow::GetTownString(), BaseGraphWindow::GetValuesInterval(), GetWidget(), GetWidget(), LinkGraphOverlay::GetWidgetDpi(), BaseGraphWindow::GetYLabelWidth(), HandleActiveWidget(), StationViewWindow::HandleCargoWaitingClick(), GoalListWindow::HandleClick(), HandleScrollbarScrolling(), IndustryCargoesWindow::HasCommonValidCargo(), NewGRFParametersWindow::HasParameterInfo(), IndustryCargoesWindow::HousesCanAccept(), IndustryCargoesWindow::HousesCanSupply(), IndustryDirectoryWindow::IndustryProductionSorter(), IndustryDirectoryWindow::IndustryTypeSorter(), InitializeData(), InitializePositionSize(), InsertTextString(), IConsoleWindow::InsertTextString(), InvalidateData(), StoryBookWindow::IsFirstPageSelected(), StoryBookWindow::IsLastPageSelected(), VehicleDetailsWindow::IsVehicleServiceIntervalEnabled(), IsWidgetDisabled(), IsWidgetFocused(), IsWidgetGloballyFocused(), IsWidgetHighlighted(), IsWidgetLowered(), TextfileWindow::LoadText(), TextfileWindow::LoadTextfile(), LowerWidget(), BuildIndustryWindow::MakeCargoListString(), TextfileWindow::NavigateToFile(), NetworkChatWindow::NetworkChatWindow(), NetworkContentListWindow::NetworkContentListWindow(), AIConfigWindow::OnClick(), BuildAirportWindow::OnClick(), ReplaceVehicleWindow::OnClick(), BuildBridgeWindow::OnClick(), BuildVehicleWindow::OnClick(), CheatWindow::OnClick(), CompanyFinancesWindow::OnClick(), SelectCompanyLiveryWindow::OnClick(), SelectCompanyManagerFaceWindow::OnClick(), CompanyWindow::OnClick(), BuyCompanyWindow::OnClick(), SetDateWindow::OnClick(), DepotWindow::OnClick(), EnginePreviewWindow::OnClick(), SaveLoadWindow::OnClick(), FramerateWindow::OnClick(), GSConfigWindow::OnClick(), GenerateLandscapeWindow::OnClick(), CreateScenarioWindow::OnClick(), GenerateProgressWindow::OnClick(), GoalListWindow::OnClick(), BaseGraphWindow::OnClick(), PerformanceHistoryGraphWindow::OnClick(), PaymentRatesGraphWindow::OnClick(), IndustryProductionGraphWindow::OnClick(), VehicleGroupWindow::OnClick(), BuildIndustryWindow::OnClick(), IndustryViewWindow::OnClick(), IndustryDirectoryWindow::OnClick(), IndustryCargoesWindow::OnClick(), SelectGameWindow::OnClick(), ScriptLeagueWindow::OnClick(), QueryStringWindow::OnClick(), MusicTrackSelectionWindow::OnClick(), MusicWindow::OnClick(), NetworkChatWindow::OnClick(), NetworkContentListWindow::OnClick(), NetworkGameWindow::OnClick(), NetworkStartServerWindow::OnClick(), NetworkClientListWindow::OnClick(), NewGRFInspectWindow::OnClick(), SpriteAlignerWindow::OnClick(), NewGRFParametersWindow::OnClick(), NewGRFWindow::OnClick(), SavePresetWindow::OnClick(), NewsWindow::OnClick(), MessageHistoryWindow::OnClick(), BuildObjectWindow::OnClick(), OrdersWindow::OnClick(), OskWindow::OnClick(), PickerWindow::OnClick(), BuildRailToolbarWindow::OnClick(), BuildRailStationWindow::OnClick(), BuildRoadStationWindow::OnClick(), ScriptListWindow::OnClick(), ScriptSettingsWindow::OnClick(), ScriptDebugWindow::OnClick(), GameOptionsWindow::OnClick(), GameSettingsWindow::OnClick(), CustomCurrencyWindow::OnClick(), SignListWindow::OnClick(), SignWindow::OnClick(), CompanyStationsWindow::OnClick(), StationViewWindow::OnClick(), SelectStationWindow< T >::OnClick(), StoryBookWindow::OnClick(), SubsidyListWindow::OnClick(), ScenarioEditorLandscapeGenerationWindow::OnClick(), TextfileWindow::OnClick(), TimetableWindow::OnClick(), ScenarioEditorToolbarWindow::OnClick(), TownAuthorityWindow::OnClick(), TownViewWindow::OnClick(), TownDirectoryWindow::OnClick(), FoundTownWindow::OnClick(), TransparenciesWindow::OnClick(), BuildTreesWindow::OnClick(), RefitWindow::OnClick(), VehicleListWindow::OnClick(), VehicleDetailsWindow::OnClick(), VehicleViewWindow::OnClick(), WaypointWindow::OnClick(), NetworkClientListWindow::OnClickClientAdmin(), NetworkClientListWindow::OnClickCompanyAdmin(), NetworkClientListWindow::OnClickCompanyChat(), NetworkClientListWindow::OnClickCompanyJoin(), NetworkContentListWindow::OnConnect(), NetworkContentDownloadStatusWindow::OnDownloadProgress(), BaseNetworkContentDownloadStatusWindow::OnDownloadProgress(), DepotWindow::OnDragDrop(), VehicleGroupWindow::OnDragDrop(), NewGRFWindow::OnDragDrop(), OrdersWindow::OnDragDrop(), RefitWindow::OnDragDrop(), OnDropdownClose(), NetworkClientListWindow::OnDropdownClose(), GameSettingsWindow::OnDropdownClose(), GSConfigWindow::OnDropdownClose(), NewGRFParametersWindow::OnDropdownClose(), ScriptSettingsWindow::OnDropdownClose(), CompanyStationsWindow::OnDropdownSelect(), ReplaceVehicleWindow::OnDropdownSelect(), SelectCompanyLiveryWindow::OnDropdownSelect(), GSConfigWindow::OnDropdownSelect(), GenerateLandscapeWindow::OnDropdownSelect(), VehicleGroupWindow::OnDropdownSelect(), NetworkClientListWindow::OnDropdownSelect(), NewGRFParametersWindow::OnDropdownSelect(), NewGRFWindow::OnDropdownSelect(), OrdersWindow::OnDropdownSelect(), ScriptSettingsWindow::OnDropdownSelect(), GameOptionsWindow::OnDropdownSelect(), GameSettingsWindow::OnDropdownSelect(), MainToolbarWindow::OnDropdownSelect(), ScenarioEditorToolbarWindow::OnDropdownSelect(), VehicleListWindow::OnDropdownSelect(), VehicleDetailsWindow::OnDropdownSelect(), BuildVehicleWindow::OnEditboxChanged(), SaveLoadWindow::OnEditboxChanged(), IndustryDirectoryWindow::OnEditboxChanged(), NetworkContentListWindow::OnEditboxChanged(), NetworkGameWindow::OnEditboxChanged(), PickerWindow::OnEditboxChanged(), ScriptDebugWindow::OnEditboxChanged(), GameSettingsWindow::OnEditboxChanged(), TownDirectoryWindow::OnEditboxChanged(), DropdownWindow::OnFocusLost(), OskWindow::OnFocusLost(), VehicleGroupWindow::OnGameTick(), CompanyStationsWindow::OnGameTick(), VehicleListWindow::OnGameTick(), OnHotkey(), BuildVehicleWindow::OnHotkey(), IndustryDirectoryWindow::OnHotkey(), MainWindow::OnHotkey(), OrdersWindow::OnHotkey(), PickerWindow::OnHotkey(), BuildRailToolbarWindow::OnHotkey(), BuildRoadToolbarWindow::OnHotkey(), SignListWindow::OnHotkey(), MainToolbarWindow::OnHotkey(), ScenarioEditorToolbarWindow::OnHotkey(), TownDirectoryWindow::OnHotkey(), VehicleViewWindow::OnHotkey(), TextfileWindow::OnHyperlinkClick(), SelectCompanyManagerFaceWindow::OnInit(), IndustryCargoesWindow::OnInit(), SelectGameWindow::OnInit(), LandInfoWindow::OnInit(), BuildObjectWindow::OnInit(), BuildRailToolbarWindow::OnInit(), BuildSignalWindow::OnInit(), BuildRoadToolbarWindow::OnInit(), ScriptDebugWindow::OnInit(), SignListWindow::OnInit(), TerraformToolbarWindow::OnInit(), FoundTownWindow::OnInit(), BaseVehicleListWindow::OnInit(), OnInitialPosition(), BuildBridgeWindow::OnInitialPosition(), SetDateWindow::OnInitialPosition(), ErrmsgWindow::OnInitialPosition(), TooltipsWindow::OnInitialPosition(), NetworkChatWindow::OnInitialPosition(), NewsWindow::OnInitialPosition(), StatusBarWindow::OnInitialPosition(), TerraformToolbarWindow::OnInitialPosition(), TransparenciesWindow::OnInitialPosition(), AIConfigWindow::OnInvalidateData(), BuildAirToolbarWindow::OnInvalidateData(), BuildVehicleWindow::OnInvalidateData(), SelectCompanyLiveryWindow::OnInvalidateData(), CompanyInfrastructureWindow::OnInvalidateData(), CompanyWindow::OnInvalidateData(), BuildDocksToolbarWindow::OnInvalidateData(), EnginePreviewWindow::OnInvalidateData(), SaveLoadWindow::OnInvalidateData(), GSConfigWindow::OnInvalidateData(), GenerateLandscapeWindow::OnInvalidateData(), GoalListWindow::OnInvalidateData(), GraphLegendWindow::OnInvalidateData(), BaseGraphWindow::OnInvalidateData(), PaymentRatesGraphWindow::OnInvalidateData(), PerformanceRatingDetailWindow::OnInvalidateData(), VehicleGroupWindow::OnInvalidateData(), BuildIndustryWindow::OnInvalidateData(), IndustryViewWindow::OnInvalidateData(), IndustryCargoesWindow::OnInvalidateData(), SelectGameWindow::OnInvalidateData(), MainWindow::OnInvalidateData(), LandInfoWindow::OnInvalidateData(), MusicTrackSelectionWindow::OnInvalidateData(), MusicWindow::OnInvalidateData(), NetworkContentListWindow::OnInvalidateData(), NetworkClientListWindow::OnInvalidateData(), NewGRFInspectWindow::OnInvalidateData(), SpriteAlignerWindow::OnInvalidateData(), NewGRFParametersWindow::OnInvalidateData(), NewGRFWindow::OnInvalidateData(), NewsWindow::OnInvalidateData(), MessageHistoryWindow::OnInvalidateData(), BuildObjectWindow::OnInvalidateData(), OrdersWindow::OnInvalidateData(), OskWindow::OnInvalidateData(), PickerWindow::OnInvalidateData(), BuildRailToolbarWindow::OnInvalidateData(), BuildRailStationWindow::OnInvalidateData(), BuildSignalWindow::OnInvalidateData(), BuildRoadToolbarWindow::OnInvalidateData(), BuildRoadStationWindow::OnInvalidateData(), ScriptListWindow::OnInvalidateData(), ScriptTextfileWindow::OnInvalidateData(), ScriptDebugWindow::OnInvalidateData(), GameOptionsWindow::OnInvalidateData(), GameSettingsWindow::OnInvalidateData(), StationViewWindow::OnInvalidateData(), SelectStationWindow< T >::OnInvalidateData(), StatusBarWindow::OnInvalidateData(), StoryBookWindow::OnInvalidateData(), SubsidyListWindow::OnInvalidateData(), TextfileWindow::OnInvalidateData(), TimetableWindow::OnInvalidateData(), MainToolbarWindow::OnInvalidateData(), ScenarioEditorToolbarWindow::OnInvalidateData(), TownAuthorityWindow::OnInvalidateData(), TownViewWindow::OnInvalidateData(), FoundTownWindow::OnInvalidateData(), BuildHouseWindow::OnInvalidateData(), TransparenciesWindow::OnInvalidateData(), RefitWindow::OnInvalidateData(), VehicleListWindow::OnInvalidateData(), VehicleDetailsWindow::OnInvalidateData(), ExtraViewportWindow::OnInvalidateData(), WaypointWindow::OnInvalidateData(), BuildBridgeWindow::OnKeyPress(), IConsoleWindow::OnKeyPress(), QueryWindow::OnKeyPress(), NetworkContentListWindow::OnKeyPress(), NetworkGameWindow::OnKeyPress(), NewGRFWindow::OnKeyPress(), DepotWindow::OnMouseDrag(), VehicleGroupWindow::OnMouseDrag(), NewGRFWindow::OnMouseDrag(), OrdersWindow::OnMouseDrag(), RefitWindow::OnMouseDrag(), DropdownWindow::OnMouseLoop(), SaveLoadWindow::OnMouseOver(), SelectStationWindow< T >::OnMouseOver(), VehicleViewWindow::OnMouseOver(), MainWindow::OnMouseWheel(), BuildAirportWindow::OnPaint(), ReplaceVehicleWindow::OnPaint(), BuildVehicleWindow::OnPaint(), CompanyFinancesWindow::OnPaint(), SelectCompanyLiveryWindow::OnPaint(), CompanyWindow::OnPaint(), IConsoleWindow::OnPaint(), DepotWindow::OnPaint(), BuildDocksStationWindow::OnPaint(), GoalListWindow::OnPaint(), VehicleGroupWindow::OnPaint(), EndGameWindow::OnPaint(), HighScoreWindow::OnPaint(), IndustryViewWindow::OnPaint(), MainWindow::OnPaint(), NetworkContentListWindow::OnPaint(), NetworkGameWindow::OnPaint(), BuildRailStationWindow::OnPaint(), BuildRoadStationWindow::OnPaint(), GameSettingsWindow::OnPaint(), StationViewWindow::OnPaint(), StoryBookWindow::OnPaint(), TimetableWindow::OnPaint(), RefitWindow::OnPaint(), VehicleListWindow::OnPaint(), VehicleDetailsWindow::OnPaint(), VehicleViewWindow::OnPaint(), BuildAirToolbarWindow::OnPlaceDrag(), BuildDocksToolbarWindow::OnPlaceDrag(), BuildObjectWindow::OnPlaceDrag(), BuildRailToolbarWindow::OnPlaceDrag(), BuildRoadToolbarWindow::OnPlaceDrag(), TerraformToolbarWindow::OnPlaceDrag(), ScenarioEditorLandscapeGenerationWindow::OnPlaceDrag(), BuildTreesWindow::OnPlaceDrag(), BuildAirToolbarWindow::OnPlaceMouseUp(), BuildDocksToolbarWindow::OnPlaceMouseUp(), BuildObjectWindow::OnPlaceMouseUp(), BuildRailToolbarWindow::OnPlaceMouseUp(), BuildRoadToolbarWindow::OnPlaceMouseUp(), TerraformToolbarWindow::OnPlaceMouseUp(), ScenarioEditorLandscapeGenerationWindow::OnPlaceMouseUp(), BuildTreesWindow::OnPlaceMouseUp(), CompanyWindow::OnPlaceObject(), BuildDocksToolbarWindow::OnPlaceObject(), BuildIndustryWindow::OnPlaceObject(), BuildObjectWindow::OnPlaceObject(), OrdersWindow::OnPlaceObject(), BuildRailToolbarWindow::OnPlaceObject(), BuildRoadToolbarWindow::OnPlaceObject(), FoundTownWindow::OnPlaceObject(), BuildHouseWindow::OnPlaceObject(), BuildDocksToolbarWindow::OnPlacePresize(), BuildVehicleWindow::OnQueryTextFinished(), CheatWindow::OnQueryTextFinished(), SelectCompanyManagerFaceWindow::OnQueryTextFinished(), CompanyWindow::OnQueryTextFinished(), DepotWindow::OnQueryTextFinished(), GSConfigWindow::OnQueryTextFinished(), GenerateLandscapeWindow::OnQueryTextFinished(), CreateScenarioWindow::OnQueryTextFinished(), VehicleGroupWindow::OnQueryTextFinished(), IndustryViewWindow::OnQueryTextFinished(), NetworkStartServerWindow::OnQueryTextFinished(), NetworkJoinStatusWindow::OnQueryTextFinished(), SpriteAlignerWindow::OnQueryTextFinished(), NewGRFParametersWindow::OnQueryTextFinished(), NewGRFWindow::OnQueryTextFinished(), OrdersWindow::OnQueryTextFinished(), ScriptSettingsWindow::OnQueryTextFinished(), GameSettingsWindow::OnQueryTextFinished(), CustomCurrencyWindow::OnQueryTextFinished(), StationViewWindow::OnQueryTextFinished(), TimetableWindow::OnQueryTextFinished(), ScenarioEditorToolbarWindow::OnQueryTextFinished(), TownViewWindow::OnQueryTextFinished(), VehicleViewWindow::OnQueryTextFinished(), WaypointWindow::OnQueryTextFinished(), FramerateWindow::OnRealtimeTick(), SelectGameWindow::OnRealtimeTick(), NewsWindow::OnRealtimeTick(), NetworkContentListWindow::OnReceiveContentInfo(), CompanyWindow::OnResize(), DepotWindow::OnResize(), FramerateWindow::OnResize(), IndustryViewWindow::OnResize(), SelectGameWindow::OnResize(), MainWindow::OnResize(), NewsWindow::OnResize(), GameOptionsWindow::OnResize(), TownViewWindow::OnResize(), VehicleDetailsWindow::OnResize(), VehicleViewWindow::OnResize(), ExtraViewportWindow::OnResize(), WaypointWindow::OnResize(), DepotWindow::OnRightClick(), MainWindow::OnScroll(), ExtraViewportWindow::OnScroll(), DepotWindow::OnTimeout(), SaveLoadWindow::OnTimeout(), ScenarioEditorLandscapeGenerationWindow::OnTimeout(), ReplaceVehicleWindow::OnTooltip(), IndustryCargoesWindow::OnTooltip(), LinkGraphLegendWindow::OnTooltip(), NetworkClientListWindow::OnTooltip(), BuildRailToolbarWindow::OnTooltip(), VehicleDetailsWindow::OnTooltip(), DepotWindow::OnVehicleSelect(), DepotWindow::OnVehicleSelect(), OrdersWindow::OnVehicleSelect(), NetworkContentListWindow::OpenExternalSearch(), OrdersWindow::OrderClick_Delete(), OrdersWindow::OrderClick_FullLoad(), OrdersWindow::OrderClick_Goto(), OrdersWindow::OrderClick_NearestDepot(), OrdersWindow::OrderClick_Nonstop(), OrdersWindow::OrderClick_Refit(), OrdersWindow::OrderClick_Service(), OrdersWindow::OrderClick_Skip(), OrdersWindow::OrderClick_StopSharing(), OrdersWindow::OrderClick_Unload(), OrdersWindow::OrderGetSel(), PerformanceLeagueWindow::PerformanceSorter(), IndustryCargoesWindow::PlaceIndustry(), ProcessHighlightedInvalidations(), BuildRailToolbarWindow::RailToolbarGlobalHotkeys(), RaiseButtons(), RaiseWidget(), RaiseWidgetsWhenLowered(), SelectGameWindow::ReadIntroGameViewportCommands(), NetworkClientListWindow::RebuildList(), NetworkClientListWindow::RebuildListCompany(), GSConfigWindow::RebuildVisibleSettings(), ScriptSettingsWindow::RebuildVisibleSettings(), StationViewWindow::RecalcDestinations(), TextfileWindow::ReflowContent(), MainWindow::RefreshLinkGraph(), RefitWindow::RefreshScrollbar(), StoryBookWindow::RefreshSelectedPage(), ReInit(), ReplaceVehicleWindow::ReplaceClick_StartReplace(), BuildRoadToolbarWindow::RoadTramToolbarGlobalHotkeys(), SavePresetWindow::SavePresetWindow(), FrametimeGraphWindow::Scinterlate(), ScriptDebugWindow::ScriptDebugGlobalHotkeys(), ScriptDebugWindow::ScriptDebugWindow(), IConsoleWindow::Scroll(), StationViewWindow::SearchNonStop(), SelectCompanyManagerFaceWindow::SelectDisplayPlanes(), BuildAirportWindow::SelectFirstAvailableAirport(), VehicleGroupWindow::SelectGroup(), StationViewWindow::SelectGroupBy(), StoryBookWindow::SelectNextPage(), VehicleViewWindow::SelectPlane(), StoryBookWindow::SelectPrevPage(), StationViewWindow::SelectSortBy(), IndustryDirectoryWindow::SetAcceptedCargoFilter(), Scrollbar::SetCapacityFromWidget(), BaseVehicleListWindow::SetCargoFilter(), IndustryDirectoryWindow::SetCargoFilterArray(), LinkGraphOverlay::SetCargoMask(), LinkGraphOverlay::SetCompanyMask(), SetDateWindow::SetDateWindow(), SelectCompanyManagerFaceWindow::SetFaceStringParameters(), SignListWindow::SetFilterString(), SetFocusedWidget(), TextfileWindow::SetFontNames(), IndustryDirectoryWindow::SetProducedCargoFilter(), StoryBookWindow::SetSelectedPage(), RefitWindow::SetSelection(), SetShaded(), BuildSignalWindow::SetSignalUIMode(), BuildAirportWindow::SetStringParameters(), ReplaceVehicleWindow::SetStringParameters(), BuildVehicleWindow::SetStringParameters(), SelectCompanyLiveryWindow::SetStringParameters(), CompanyWindow::SetStringParameters(), BuyCompanyWindow::SetStringParameters(), SetDateWindow::SetStringParameters(), FrametimeGraphWindow::SetStringParameters(), GenerateLandscapeWindow::SetStringParameters(), GoalListWindow::SetStringParameters(), GoalQuestionWindow::SetStringParameters(), VehicleGroupWindow::SetStringParameters(), BuildIndustryWindow::SetStringParameters(), IndustryCargoesWindow::SetStringParameters(), MusicTrackSelectionWindow::SetStringParameters(), NetworkStartServerWindow::SetStringParameters(), NetworkClientListWindow::SetStringParameters(), SpriteAlignerWindow::SetStringParameters(), NewGRFTextfileWindow::SetStringParameters(), NewGRFWindow::SetStringParameters(), BuildObjectWindow::SetStringParameters(), OrdersWindow::SetStringParameters(), BuildRailToolbarWindow::SetStringParameters(), BuildRoadToolbarWindow::SetStringParameters(), ScriptListWindow::SetStringParameters(), ScriptSettingsWindow::SetStringParameters(), ScriptTextfileWindow::SetStringParameters(), ScriptDebugWindow::SetStringParameters(), GameOptionsWindow::SetStringParameters(), GameSettingsWindow::SetStringParameters(), CustomCurrencyWindow::SetStringParameters(), CompanyStationsWindow::SetStringParameters(), StoryBookWindow::SetStringParameters(), TimetableWindow::SetStringParameters(), VehicleListWindow::SetStringParameters(), TextfileWindow::SetupScrollbars(), DepotWindow::SetupWidgetData(), CompanyFinancesWindow::SetupWidgets(), SetWidgetDisabledState(), SetWidgetHighlight(), SetWidgetLoweredState(), SetWidgetsDisabledState(), SetWidgetsLoweredState(), NewsWindow::SetWindowTop(), IndustryCargoesWindow::ShortenCargoColumn(), StationViewWindow::ShowCargo(), SetDateWindow::ShowDateDropDown(), ShowDropDownList(), SignListWindow::SignListGlobalHotkeys(), BuildBridgeWindow::SortBridgeList(), NetworkContentListWindow::SortContentList(), CompanyStationsWindow::StationRatingMaxSorter(), CompanyStationsWindow::StationRatingMinSorter(), CompanyStationsWindow::StationWaitingAvailableSorter(), CompanyStationsWindow::StationWaitingTotalSorter(), ScenarioEditorLandscapeGenerationWindow::TerraformToolbarEditorGlobalHotkeys(), TerraformToolbarWindow::TerraformToolbarGlobalHotkeys(), ToggleWidgetLoweredState(), TownDirectoryWindow::TownPopulationSorter(), TownDirectoryWindow::TownRatingSorter(), ScriptDebugWindow::UpdateAIButtonsState(), BuildObjectWindow::UpdateButtons(), NetworkContentListWindow::UpdateFilterState(), ScriptDebugWindow::UpdateGSButtonState(), ScriptDebugWindow::UpdateLogScroll(), BuildTreesWindow::UpdateMode(), ScanProgressWindow::UpdateNewGRFScanStatus(), OskWindow::UpdateOskState(), LinkGraphLegendWindow::UpdateOverlayCargoes(), LinkGraphLegendWindow::UpdateOverlayCompanies(), PaymentRatesGraphWindow::UpdatePaymentRates(), StoryBookWindow::UpdatePrevNextDisabledState(), FrametimeGraphWindow::UpdateScale(), TimetableWindow::UpdateSelectionStates(), DropdownWindow::UpdateSizeAndPosition(), BaseGraphWindow::UpdateStatistics(), IndustryProductionGraphWindow::UpdateStatistics(), BuildAirportWindow::UpdateWidgetSize(), ReplaceVehicleWindow::UpdateWidgetSize(), BootstrapErrorWindow::UpdateWidgetSize(), BootstrapAskForDownloadWindow::UpdateWidgetSize(), BuildBridgeWindow::UpdateWidgetSize(), BuildVehicleWindow::UpdateWidgetSize(), CheatWindow::UpdateWidgetSize(), CompanyFinancesWindow::UpdateWidgetSize(), SelectCompanyLiveryWindow::UpdateWidgetSize(), SelectCompanyManagerFaceWindow::UpdateWidgetSize(), CompanyInfrastructureWindow::UpdateWidgetSize(), CompanyWindow::UpdateWidgetSize(), BuyCompanyWindow::UpdateWidgetSize(), SetDateWindow::UpdateWidgetSize(), DepotWindow::UpdateWidgetSize(), EnginePreviewWindow::UpdateWidgetSize(), ErrmsgWindow::UpdateWidgetSize(), SaveLoadWindow::UpdateWidgetSize(), FramerateWindow::UpdateWidgetSize(), FrametimeGraphWindow::UpdateWidgetSize(), GenerateLandscapeWindow::UpdateWidgetSize(), CreateScenarioWindow::UpdateWidgetSize(), GenerateProgressWindow::UpdateWidgetSize(), GoalListWindow::UpdateWidgetSize(), GoalQuestionWindow::UpdateWidgetSize(), BaseGraphWindow::UpdateWidgetSize(), PaymentRatesGraphWindow::UpdateWidgetSize(), PerformanceRatingDetailWindow::UpdateWidgetSize(), IndustryProductionGraphWindow::UpdateWidgetSize(), VehicleGroupWindow::UpdateWidgetSize(), BuildIndustryWindow::UpdateWidgetSize(), IndustryDirectoryWindow::UpdateWidgetSize(), IndustryCargoesWindow::UpdateWidgetSize(), PerformanceLeagueWindow::UpdateWidgetSize(), ScriptLeagueWindow::UpdateWidgetSize(), LinkGraphLegendWindow::UpdateWidgetSize(), LandInfoWindow::UpdateWidgetSize(), AboutWindow::UpdateWidgetSize(), QueryStringWindow::UpdateWidgetSize(), MusicTrackSelectionWindow::UpdateWidgetSize(), MusicWindow::UpdateWidgetSize(), NetworkContentListWindow::UpdateWidgetSize(), BaseNetworkContentDownloadStatusWindow::UpdateWidgetSize(), NetworkGameWindow::UpdateWidgetSize(), NetworkStartServerWindow::UpdateWidgetSize(), NetworkClientListWindow::UpdateWidgetSize(), NetworkJoinStatusWindow::UpdateWidgetSize(), NetworkAskRelayWindow::UpdateWidgetSize(), NetworkAskSurveyWindow::UpdateWidgetSize(), NewGRFInspectWindow::UpdateWidgetSize(), SpriteAlignerWindow::UpdateWidgetSize(), NewGRFParametersWindow::UpdateWidgetSize(), NewGRFWindow::UpdateWidgetSize(), SavePresetWindow::UpdateWidgetSize(), ScanProgressWindow::UpdateWidgetSize(), NewsWindow::UpdateWidgetSize(), MessageHistoryWindow::UpdateWidgetSize(), BuildObjectWindow::UpdateWidgetSize(), OrdersWindow::UpdateWidgetSize(), PickerWindow::UpdateWidgetSize(), BuildRailStationWindow::UpdateWidgetSize(), BuildSignalWindow::UpdateWidgetSize(), BuildRoadStationWindow::UpdateWidgetSize(), GameOptionsWindow::UpdateWidgetSize(), GameSettingsWindow::UpdateWidgetSize(), CustomCurrencyWindow::UpdateWidgetSize(), SignListWindow::UpdateWidgetSize(), CompanyStationsWindow::UpdateWidgetSize(), StationViewWindow::UpdateWidgetSize(), SelectStationWindow< T >::UpdateWidgetSize(), StatusBarWindow::UpdateWidgetSize(), StoryBookWindow::UpdateWidgetSize(), SubsidyListWindow::UpdateWidgetSize(), TimetableWindow::UpdateWidgetSize(), ScenarioEditorToolbarWindow::UpdateWidgetSize(), TownAuthorityWindow::UpdateWidgetSize(), TownDirectoryWindow::UpdateWidgetSize(), BuildTreesWindow::UpdateWidgetSize(), VehicleListWindow::UpdateWidgetSize(), VehicleDetailsWindow::UpdateWidgetSize(), NewGRFWindow::UpgradeCurrent(), NewGRFInspectWindow::ValidateChainIndex(), WaypointWindow::WaypointWindow(), and ~Window().

◆ 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 963 of file window_gui.h.

References widget_lookup.

◆ HandleButtonClick()

void Window::HandleButtonClick ( WidgetID  widget)

◆ HandleEditBoxKey()

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

Process keypress for editbox widget.

Parameters
widEditbox widget.
keythe Unicode value of the key.
keycodethe 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 2480 of file window.cpp.

References QueryString::ACTION_CLEAR, QueryString::ACTION_DESELECT, QueryString::ACTION_NOTHING, Textbuf::bytes, QueryString::cancel_button, Textbuf::DeleteAll(), ES_HANDLED, ES_NOT_HANDLED, GetQueryString(), 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_numberNumber 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 1364 of file window.cpp.

References _current_text_dir, BringWindowToFront(), WindowDesc::cls, WindowDesc::default_pos, EditBoxInGlobalFocus(), flags, GetWidget(), INVALID_OWNER, nested_focus, nested_root, OnInit(), owner, resize, SetFocusedWindow(), SetWhiteBorder(), ST_SMALLEST, ResizeInfo::step_height, ResizeInfo::step_width, TD_RTL, WC_DROPDOWN_MENU, WDP_CENTER, WF_CENTERED, 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
xOffset in pixels from the left of the screen of the new window.
yOffset in pixels from the top of the screen of the new window.
sm_widthSmallest width in pixels of the window.
sm_heightSmallest height in pixels of the window.

Definition at line 1402 of file window.cpp.

References GetWidget(), 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_numberNumber of the new window.

Definition at line 1746 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,
const char str,
bool  marked,
const char caret,
const char insert_location,
const char replacement_end 
)
virtual

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

Parameters
widEdit box widget.
strText string to insert.

Reimplemented in IConsoleWindow.

Definition at line 2638 of file window.cpp.

References GetQueryString(), GetWidget(), 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
dataThe data to invalidate with
gui_scopeWhether the function is called from GUI scope.

Definition at line 3159 of file window.cpp.

References GetWidget(), 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(), NetworkContentListWindow::OnClick(), NewGRFInspectWindow::OnClick(), SpriteAlignerWindow::OnClick(), NewGRFParametersWindow::OnClick(), NewGRFWindow::OnClick(), BuildObjectWindow::OnClick(), OskWindow::OnClick(), PickerWindow::OnClick(), BuildSignalWindow::OnClick(), ScriptDebugWindow::OnClick(), GameSettingsWindow::OnClick(), SignListWindow::OnClick(), TextfileWindow::OnClick(), RefitWindow::OnClick(), NetworkContentListWindow::OnConnect(), NetworkContentListWindow::OnDownloadComplete(), NewGRFWindow::OnDragDrop(), RefitWindow::OnDragDrop(), GenerateLandscapeWindow::OnDropdownSelect(), NewGRFWindow::OnDropdownSelect(), GameOptionsWindow::OnDropdownSelect(), GameSettingsWindow::OnDropdownSelect(), BuildVehicleWindow::OnEditboxChanged(), SaveLoadWindow::OnEditboxChanged(), IndustryDirectoryWindow::OnEditboxChanged(), NetworkContentListWindow::OnEditboxChanged(), PickerWindow::OnEditboxChanged(), GameSettingsWindow::OnEditboxChanged(), TownDirectoryWindow::OnEditboxChanged(), NewGRFWindow::OnEditboxChanged(), ScriptDebugWindow::OnInit(), NetworkContentListWindow::OnKeyPress(), NewGRFWindow::OnKeyPress(), GenerateLandscapeWindow::OnQueryTextFinished(), NetworkClientListWindow::OnQueryTextFinished(), NewGRFWindow::OnQueryTextFinished(), NetworkContentListWindow::OnReceiveContentInfo(), SaveLoadWindow::OnTimeout(), 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 853 of file window_gui.h.

Referenced by NWidgetLeaf::SetupSmallestSize().

◆ IsShaded()

◆ IsWidgetDisabled()

◆ 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 426 of file window_gui.h.

References GetWidget(), and NWidgetCore::index.

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 437 of file window_gui.h.

References GetWidget(), and IsWidgetFocused().

◆ IsWidgetHighlighted()

bool Window::IsWidgetHighlighted ( WidgetID  widget_index) const

Gets the highlighted status of a widget.

Parameters
widget_indexindex of this widget in the window
Returns
status of the widget ie: highlighted = true, not highlighted = false

Definition at line 272 of file window.cpp.

References GetWidget().

Referenced by DispatchLeftClickEvent().

◆ IsWidgetLowered()

bool Window::IsWidgetLowered ( WidgetID  widget_index) const
inline

Gets the lowered state of a widget.

Parameters
widget_indexindex of this widget in the window
Returns
status of the widget ie: lowered = true, raised= false

Definition at line 497 of file window_gui.h.

References GetWidget().

Referenced by BuildRailClick_Remove(), TextfileWindow::CheckHyperlinkClick(), BuildAirToolbarWindow::Close(), BuildDocksToolbarWindow::Close(), BuildRailToolbarWindow::Close(), BuildRoadToolbarWindow::Close(), BuildSignalWindow::DrawWidget(), TextfileWindow::DrawWidget(), 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(), TextfileWindow::ReflowContent(), RoadToolbar_CtrlChanged(), TextfileWindow::SetupScrollbars(), ToggleRailButton_Remove(), ToggleRoadButton_Remove(), BuildRoadToolbarWindow::UpdateOptionWidgetStatus(), LinkGraphLegendWindow::UpdateOverlayCargoes(), and LinkGraphLegendWindow::UpdateOverlayCompanies().

◆ LowerWidget()

◆ 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
ptthe point inside the window that has been clicked.
widgetthe clicked widget.
click_countNumber 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, PaymentRatesGraphWindow, PerformanceRatingDetailWindow, IndustryProductionGraphWindow, 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, GameSettingsWindow, CustomCurrencyWindow, SignListWindow, SignWindow, SmallMapWindow, CompanyStationsWindow, StationViewWindow, SelectStationWindow< T >, StatusBarWindow, StoryBookWindow, SubsidyListWindow, TerraformToolbarWindow, ScenarioEditorLandscapeGenerationWindow, TextfileWindow, TimetableWindow, MainToolbarWindow, ScenarioEditorToolbarWindow, TownAuthorityWindow, TownViewWindow, TownDirectoryWindow, FoundTownWindow, TransparenciesWindow, BuildTreesWindow, RefitWindow, VehicleListWindow, VehicleDetailsWindow, VehicleViewWindow, ExtraViewportWindow, and WaypointWindow.

Definition at line 670 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 661 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
ptthe point inside the window where the release took place.
widgetthe widget where the release took place.

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

Definition at line 708 of file window_gui.h.

Referenced by HandleMouseDragDrop().

◆ OnDropdownClose()

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

A dropdown window associated to this window has been closed.

Parameters
ptthe point inside the window the mouse resides on after closure.
widgetthe widget (button) that the dropdown is associated with.
indexthe element in the dropdown that is selected.
instant_closewhether the dropdown was configured to close on mouse up.

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

Definition at line 287 of file window.cpp.

References GetWidget(), GetWidgetFromPos(), NWID_BUTTON_DROPDOWN, OnDropdownSelect(), RaiseWidget(), and SetWidgetDirty().

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

◆ OnDropdownSelect()

◆ OnEditboxChanged()

virtual void Window::OnEditboxChanged ( WidgetID  widget)
inlinevirtual

◆ OnFocus()

void Window::OnFocus ( )
virtual

The window has gained focus.

Called when window gains focus.

Reimplemented in IConsoleWindow.

Definition at line 508 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
closingTrue iff the window has lost focus in the process of closing.

Reimplemented in DropdownWindow, OskWindow, and IConsoleWindow.

Definition at line 516 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

◆ OnHotkey()

◆ 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
ptThe point where the mouse is hovering.
widgetThe widget where the mouse is hovering.

Definition at line 686 of file window_gui.h.

Referenced by DispatchHoverEvent().

◆ OnInit()

◆ 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_widthSmallest width of the window.
sm_heightSmallest height of the window.
window_numberThe window number of the new window.
Returns
Initial position of the top-left corner of the window.

Reimplemented in BuildBridgeWindow, SetDateWindow, DropdownWindow, ErrmsgWindow, TooltipsWindow, NetworkChatWindow, NewsWindow, StatusBarWindow, TerraformToolbarWindow, and TransparenciesWindow.

Definition at line 1711 of file window.cpp.

References GetWidget(), 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
datainformation about the changed data.
gui_scopeWhether 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, SelectGameWindow, 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, GameSettingsWindow, 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 786 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
keythe Unicode value of the key.
keycodethe 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 652 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
ptThe point inside the window that the mouse hovers over.
widgetThe widget the mouse hovers over.

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

Definition at line 701 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 734 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
ptthe point inside the window that the mouse hovers over.
widgetthe widget the mouse hovers over.

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

Definition at line 722 of file window_gui.h.

Referenced by HandleMouseOver().

◆ OnMouseWheel()

virtual void Window::OnMouseWheel ( int  wheel)
inlinevirtual

The mouse wheel has been turned.

Parameters
wheelthe amount of movement of the mouse wheel.

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

Definition at line 728 of file window_gui.h.

◆ OnPaint()

◆ 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_methodthe method of selection (allowed directions)
select_procwhat will be created when the drag is over.
ptthe exact point on the map where the mouse is.

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

Definition at line 825 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_methodthe method of selection (allowed directions)
select_procwhat should be created.
ptthe exact point on the map where the mouse was released.
start_tilethe begin tile of the drag.
end_tilethe end tile of the drag.

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

Definition at line 836 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
ptthe exact point on the map that has been clicked.
tilethe tile on the map that has been clicked.

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

Definition at line 794 of file window_gui.h.

◆ OnPlaceObjectAbort()

◆ 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
ptthe exact point on the map where the mouse is.
tilethe tile on the map where the mouse is.

Reimplemented in BuildRailToolbarWindow, BuildRoadToolbarWindow, and BuildDocksToolbarWindow.

Definition at line 845 of file window_gui.h.

◆ OnQueryTextFinished()

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

◆ OnRealtimeTick()

◆ OnResize()

◆ OnRightClick()

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

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

Parameters
ptthe point inside the window that has been clicked.
widgetthe 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 679 of file window_gui.h.

Referenced by DispatchRightClickEvent().

◆ OnScroll()

virtual void Window::OnScroll ( Point  delta)
inlinevirtual

Handle the request for (viewport) scrolling.

Parameters
deltathe amount the viewport must be scrolled.

Reimplemented in MainWindow, SmallMapWindow, and ExtraViewportWindow.

Definition at line 714 of file window_gui.h.

Referenced by HandleViewportScroll().

◆ OnTimeout()

◆ OnTooltip()

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

Event to display a custom tooltip.

Parameters
ptThe point where the mouse is located.
widgetThe widget where the mouse is located.
Returns
True if the event is handled, false if it is ignored.

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

Definition at line 694 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
vclicked vehicle
Returns
true if the click is handled, false if it is ignored
Precondition
v->IsPrimaryVehicle() == true

Definition at line 802 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
vclicked 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 810 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
sizethe amount of space not to allocate

◆ ProcessHighlightedInvalidations()

void Window::ProcessHighlightedInvalidations ( )

Process all invalidation of highlighted widgets.

Definition at line 3184 of file window.cpp.

References flags, GetWidget(), WF_HIGHLIGHTED, and widget_lookup.

Referenced by UpdateWindows().

◆ ProcessScheduledInvalidations()

void Window::ProcessScheduledInvalidations ( )

Process all scheduled invalidations.

Definition at line 3172 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 3145 of file window.cpp.

References OnResize(), and scheduled_resize.

Referenced by UpdateWindows().

◆ RaiseButtons()

◆ RaiseWidget()

◆ RaiseWidgetsWhenLowered()

template<typename... Args>
void Window::RaiseWidgetsWhenLowered ( Args...  widgets)
inline

Raises the widgets and sets widgets dirty that are lowered.

Parameters
widgetslist of widgets

Definition at line 542 of file window_gui.h.

References GetWidget(), and 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_indexindex of this widget in the window

Definition at line 484 of file window_gui.h.

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

Referenced by IndustryCargoesWindow::OnInvalidateData(), ScenarioEditorLandscapeGenerationWindow::OnTimeout(), MainToolbarWindow::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
rxHorizontal resize of the window.
ryVertical resize of the window.
repositionIf set, reposition the window to default location.
Note
For just resizing the window, use ResizeWindow instead.

Definition at line 952 of file window.cpp.

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

Referenced by TextfileWindow::AfterLoadText(), TextfileWindow::LoadText(), TextfileWindow::LoadTextfile(), BuildRailToolbarWindow::ModifyRailType(), BuildRoadToolbarWindow::ModifyRoadType(), CompanyFinancesWindow::OnClick(), SelectCompanyManagerFaceWindow::OnClick(), BuildSignalWindow::OnClick(), StationViewWindow::OnClick(), 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(), 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 3137 of file window.cpp.

References scheduled_resize.

Referenced by ResizeWindow().

◆ SetFocusedWidget()

bool Window::SetFocusedWidget ( WidgetID  widget_index)

◆ SetShaded()

void Window::SetShaded ( bool  make_shaded)

Set the shaded state of the window to make_shaded.

Parameters
make_shadedIf 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 995 of file window.cpp.

References GetWidget(), 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().

◆ SetStringParameters()

virtual void Window::SetStringParameters ( WidgetID  widget) const
inlinevirtual

Initialize string parameters for a widget.

Calls to this function are 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
widgetWidget number.

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

Definition at line 632 of file window_gui.h.

Referenced by NWidgetBackground::Draw(), NWidgetLeaf::Draw(), BuildObjectWindow::SetStringParameters(), NWidgetBackground::SetupSmallestSize(), and NWidgetLeaf::SetupSmallestSize().

◆ SetTimeout()

◆ SetWhiteBorder()

void Window::SetWhiteBorder ( )
inline

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

Definition at line 370 of file window_gui.h.

References WF_WHITE_BORDER, and WHITE_BORDER_DURATION.

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_indexthe widget to redraw.

Definition at line 551 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(), DepotWindow::OnTimeout(), StoryBookWindow::OnTimeout(), ScenarioEditorToolbarWindow::OnTimeout(), OrdersWindow::OrderClick_Goto(), OrdersWindow::OrderClick_Nonstop(), OrdersWindow::OrderClick_Unload(), RaiseWidgetWhenLowered(), StoryBookWindow::RefreshSelectedPage(), 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_indexindex of this widget in the window
disab_statstatus to use ie: disabled = true, enabled = false

Definition at line 387 of file window_gui.h.

References GetWidget().

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(), BuildRailToolbarWindow::OnInvalidateData(), BuildSignalWindow::OnInvalidateData(), ScriptDebugWindow::OnInvalidateData(), GameOptionsWindow::OnInvalidateData(), GameSettingsWindow::OnInvalidateData(), StoryBookWindow::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(), 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_indexindex of this widget in the window
highlighted_colourColour of highlight, or TC_INVALID to disable.

Definition at line 242 of file window.cpp.

References CLRBITS, flags, GetWidget(), valid, WF_HIGHLIGHTED, 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_indexindex of this widget in the window
lowered_statstatus to use ie: lowered = true, raised = false

Definition at line 447 of file window_gui.h.

References GetWidget().

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(), BuildRailStationWindow::OnInit(), GenerateLandscapeWindow::OnInvalidateData(), SelectGameWindow::OnInvalidateData(), MusicTrackSelectionWindow::OnInvalidateData(), MusicWindow::OnInvalidateData(), PickerWindow::OnInvalidateData(), BuildSignalWindow::OnInvalidateData(), ScriptDebugWindow::OnInvalidateData(), GameOptionsWindow::OnInvalidateData(), TransparenciesWindow::OnInvalidateData(), DepotWindow::OnMouseDrag(), GameOptionsWindow::OnMouseLoop(), SelectCompanyManagerFaceWindow::OnPaint(), 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

◆ 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_statstatus to use ie: lowered = true, raised = false
widgetslist of widgets

Definition at line 532 of file window_gui.h.

References GetWidget(), and SetWidgetLoweredState().

Referenced by VehicleDetailsWindow::OnClick(), SpriteAlignerWindow::OnInvalidateData(), SelectCompanyManagerFaceWindow::OnPaint(), 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 861 of file window_gui.h.

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

◆ SortButtonWidth()

◆ ToggleWidgetLoweredState()

void Window::ToggleWidgetLoweredState ( WidgetID  widget_index)
inline

◆ 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 470 of file window.cpp.

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

Referenced by HandleEditBoxKey(), and SetShaded().

◆ UpdateQueryStringSize()

void Window::UpdateQueryStringSize ( )

Update size of all QueryStrings of this window.

Definition at line 354 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
widgetWidget number.
[in,out]sizeSize of the widget.
paddingRecommended amount of space between the widget content and the widget edge.
[in,out]fillFill step of the widget.
[in,out]resizeResize 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, PaymentRatesGraphWindow, PerformanceRatingDetailWindow, IndustryProductionGraphWindow, VehicleGroupWindow, BuildIndustryWindow, IndustryViewWindow, IndustryDirectoryWindow, IndustryCargoesWindow, SelectGameWindow, PerformanceLeagueWindow, ScriptLeagueWindow, LinkGraphLegendWindow, LandInfoWindow, AboutWindow, TooltipsWindow, QueryStringWindow, 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, GameSettingsWindow, 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 624 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 275 of file window_gui.h.

Referenced by Close(), and DeleteClosedWindows().

◆ flags

◆ height

int Window::height

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

Definition at line 312 of file window_gui.h.

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

◆ left

◆ mouse_capture_widget

WidgetID Window::mouse_capture_widget

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

Definition at line 326 of file window_gui.h.

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

◆ nested_focus

◆ nested_root

◆ owner

◆ parent

◆ querystrings

◆ resize

ResizeInfo Window::resize

Resize information.

Definition at line 314 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(), TownDirectoryWindow::DrawWidget(), VehicleListWindow::DrawWidget(), ScriptDebugWindow::DrawWidgetLog(), FindWindowPlacementAndResize(), HandleWindowDragging(), InitializeData(), BuildVehicleWindow::OnPaint(), ReInit(), AIConfigWindow::UpdateWidgetSize(), ReplaceVehicleWindow::UpdateWidgetSize(), BuildBridgeWindow::UpdateWidgetSize(), BuildVehicleWindow::UpdateWidgetSize(), SelectCompanyLiveryWindow::UpdateWidgetSize(), DepotWindow::UpdateWidgetSize(), SaveLoadWindow::UpdateWidgetSize(), FramerateWindow::UpdateWidgetSize(), GSConfigWindow::UpdateWidgetSize(), GoalListWindow::UpdateWidgetSize(), BaseGraphWindow::UpdateWidgetSize(), PaymentRatesGraphWindow::UpdateWidgetSize(), IndustryProductionGraphWindow::UpdateWidgetSize(), VehicleGroupWindow::UpdateWidgetSize(), BuildIndustryWindow::UpdateWidgetSize(), IndustryDirectoryWindow::UpdateWidgetSize(), IndustryCargoesWindow::UpdateWidgetSize(), QueryStringWindow::UpdateWidgetSize(), NetworkContentListWindow::UpdateWidgetSize(), NetworkGameWindow::UpdateWidgetSize(), NetworkClientListWindow::UpdateWidgetSize(), NewGRFInspectWindow::UpdateWidgetSize(), SpriteAlignerWindow::UpdateWidgetSize(), NewGRFParametersWindow::UpdateWidgetSize(), NewGRFWindow::UpdateWidgetSize(), SavePresetWindow::UpdateWidgetSize(), NewsWindow::UpdateWidgetSize(), MessageHistoryWindow::UpdateWidgetSize(), BuildObjectWindow::UpdateWidgetSize(), OrdersWindow::UpdateWidgetSize(), PickerWindow::UpdateWidgetSize(), BuildRailStationWindow::UpdateWidgetSize(), BuildRoadStationWindow::UpdateWidgetSize(), ScriptListWindow::UpdateWidgetSize(), ScriptSettingsWindow::UpdateWidgetSize(), ScriptDebugWindow::UpdateWidgetSize(), GameSettingsWindow::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

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

Definition at line 304 of file window_gui.h.

Referenced by ReInit().

◆ scheduled_invalidation_data

std::vector<int> Window::scheduled_invalidation_data
protected

Data of scheduled OnInvalidateData() calls.

Definition at line 282 of file window_gui.h.

Referenced by InvalidateData(), and ProcessScheduledInvalidations().

◆ scheduled_resize

bool Window::scheduled_resize
protected

Set if window has been resized.

Definition at line 283 of file window_gui.h.

Referenced by ProcessScheduledResize(), and ScheduleResize().

◆ shade_select

NWidgetStacked* Window::shade_select

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

Definition at line 323 of file window_gui.h.

Referenced by SetShaded().

◆ timeout_timer

uint8_t Window::timeout_timer

Timer value of the WF_TIMEOUT for flags.

Definition at line 306 of file window_gui.h.

Referenced by GenerateLandscapeWindow::OnClick(), CreateScenarioWindow::OnClick(), NetworkStartServerWindow::OnClick(), and GameSettingsWindow::OnClick().

◆ top

◆ unshaded_size

Dimension Window::unshaded_size

Last known unshaded size (only valid while shaded).

Definition at line 324 of file window_gui.h.

Referenced by MaybeBringWindowToFront(), and SetShaded().

◆ viewport

◆ white_border_timer

uint8_t Window::white_border_timer

Timer value of the WF_WHITE_BORDER for flags.

Definition at line 307 of file window_gui.h.

◆ widget_lookup

◆ width

int Window::width

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

Definition at line 311 of file window_gui.h.

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

◆ window_class

◆ window_desc

◆ window_number

WindowNumber Window::window_number

Window number within the window class.

Definition at line 302 of file window_gui.h.

Referenced by RefitWindow::BuildRefitList(), ChangeTimetableStartCallback(), ChangeVehicleWindow(), DepotWindow::Close(), EndGameWindow::Close(), TownViewWindow::Close(), WaypointWindow::Close(), DispatchLeftClickEvent(), DoSelectCompanyManagerFace(), IndustryViewWindow::DrawInfo(), NewGRFInspectWindow::DrawMainPanelWidget(), NewGRFInspectWindow::DrawVehicleChainWidget(), ReplaceVehicleWindow::DrawWidget(), CompanyFinancesWindow::DrawWidget(), SelectCompanyLiveryWindow::DrawWidget(), SelectCompanyManagerFaceWindow::DrawWidget(), CompanyInfrastructureWindow::DrawWidget(), CompanyWindow::DrawWidget(), EnginePreviewWindow::DrawWidget(), RefitWindow::DrawWidget(), ReplaceVehicleWindow::GenerateReplaceVehList(), DepotWindow::GetDepotIndex(), NewGRFInspectWindow::GetFeatureIndex(), CompanyInfrastructureWindow::GetTotalMaintenanceCost(), GoalListWindow::HandleClick(), HandlePlacePushButton(), NewGRFInspectWindow::HasChainIndex(), InitializeData(), InvalidateWindowData(), IndustryViewWindow::IsNewGRFInspectable(), ReplaceVehicleWindow::OnClick(), CompanyFinancesWindow::OnClick(), SelectCompanyLiveryWindow::OnClick(), CompanyWindow::OnClick(), DepotWindow::OnClick(), GoalQuestionWindow::OnClick(), IndustryViewWindow::OnClick(), NewGRFInspectWindow::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(), CompanyWindow::OnQueryTextFinished(), IndustryViewWindow::OnQueryTextFinished(), NewGRFInspectWindow::OnQueryTextFinished(), TownViewWindow::OnQueryTextFinished(), WaypointWindow::OnQueryTextFinished(), IndustryViewWindow::OnResize(), RefitWindow::OnResize(), ReInit(), SetObjectToPlaceWnd(), ReplaceVehicleWindow::SetStringParameters(), CompanyFinancesWindow::SetStringParameters(), SelectCompanyLiveryWindow::SetStringParameters(), CompanyInfrastructureWindow::SetStringParameters(), CompanyWindow::SetStringParameters(), GoalListWindow::SetStringParameters(), IndustryViewWindow::SetStringParameters(), NewGRFInspectWindow::SetStringParameters(), TownAuthorityWindow::SetStringParameters(), RefitWindow::SetStringParameters(), CompanyFinancesWindow::SetupWidgets(), SetWindowDirty(), SetWindowWidgetDirty(), IndustryViewWindow::ShowNewGRFInspectWindow(), ShowScriptDebugWindow(), BuildVehicleWindow::UpdateFilterByTile(), BuildTreesWindow::UpdateMode(), ReplaceVehicleWindow::UpdateWidgetSize(), SelectCompanyLiveryWindow::UpdateWidgetSize(), CompanyInfrastructureWindow::UpdateWidgetSize(), EnginePreviewWindow::UpdateWidgetSize(), NewGRFInspectWindow::UpdateWidgetSize(), RefitWindow::UpdateWidgetSize(), NewGRFInspectWindow::ValidateChainIndex(), VehicleDetailsWindow::VehicleDetailsWindow(), and WaypointWindow::WaypointWindow().

◆ z_position

WindowList::iterator Window::z_position

Definition at line 329 of file window_gui.h.


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