OpenTTD: src/window_func.h File Reference

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

Functions
window_func.h File Reference

Window functions not directly related to making/drawing windows. More...

`#include "window_type.h"`
`#include "company_type.h"`
`#include "core/geometry_type.hpp"`

Go to the source code of this file.

## Functions
Window * | FindWindowById (WindowClass cls, WindowNumber number)
| Find a window by its class and window number.
Window * | FindWindowByClass (WindowClass cls)
| Find any window by its class.
void | ChangeWindowOwner (Owner old_owner, Owner new_owner)
| Change the owner of all the windows one company can take over from another company in the case of a company merger.
void | ResizeWindow (Window *w, int x, int y, bool clamp_to_screen=true)
| Resize the window.
int | PositionMainToolbar (Window *w)
| (Re)position main toolbar window at the screen.
int | PositionStatusbar (Window *w)
| (Re)position statusbar window at the screen.
int | PositionNewsMessage (Window *w)
| (Re)position news message window at the screen.
int | PositionNetworkChatWindow (Window *w)
| (Re)position network chat window at the screen.
int | GetMainViewTop ()
| Return the top of the main view available for general use.
int | GetMainViewBottom ()
| Return the bottom of the main view available for general use.
void | InitWindowSystem ()
| (re)initialize the windowing system
void | UnInitWindowSystem ()
| Close down the windowing system.
void | ResetWindowSystem ()
| Reset the windowing system, by means of shutting it down followed by re-initialization.
void | SetupColoursAndInitialWindow ()
| Initialise the default colours (remaps and the likes), and load the main windows.
void | InputLoop ()
| Regular call from the global game loop.
void | InvalidateWindowData (WindowClass cls, WindowNumber number, int data=0, bool gui_scope=false)
| Mark window data of the window of a given class and specific window number as invalid (in need of re-computing)
void | InvalidateWindowClassesData (WindowClass cls, int data=0, bool gui_scope=false)
| Mark window data of all windows of a given class as invalid (in need of re-computing) Note that by default the invalidation is not considered to be called from GUI scope.
void | DeleteNonVitalWindows ()
| Try to delete a non-vital window.
void | DeleteAllNonVitalWindows ()
| It is possible that a stickied window gets to a position where the 'close' button is outside the gaming area.
void | DeleteConstructionWindows ()
| Delete all windows that are used for construction of vehicle etc.
void | HideVitalWindows ()
| Delete all always on-top windows to get an empty screen.
void | ShowVitalWindows ()
| Show the vital in-game windows.
void | ReInitAllWindows ()
| Re-initialize all windows.
void | SetWindowWidgetDirty (WindowClass cls, WindowNumber number, byte widget_index)
| Mark a particular widget in a particular window as dirty (in need of repainting)
void | SetWindowDirty (WindowClass cls, WindowNumber number)
| Mark window as dirty (in need of repainting)
void | SetWindowClassesDirty (WindowClass cls)
| Mark all windows of a particular class as dirty (in need of repainting)
void | DeleteWindowById (WindowClass cls, WindowNumber number, bool force=true)
| Delete a window by its class and window number (if it is open).
void | DeleteWindowByClass (WindowClass cls)
| Delete all windows of a given class.
bool | EditBoxInGlobalFocus ()
| Check if an edit box is in global focus.
Point | GetCaretPosition ()

## Detailed Description

Window functions not directly related to making/drawing windows.

Definition in file window_func.h.

## Function Documentation

void ChangeWindowOwner | ( | Owner | old_owner,
|  | Owner | new_owner
| ) |  |

Change the owner of all the windows one company can take over from another company in the case of a company merger.

Do not change ownership of windows that need to be deleted once takeover is complete

Parameters

  old_owner | original owner of the window
  new_owner | the new owner of the window

Definition at line 1193 of file window.cpp.

References Window::owner, WC_AIRCRAFT_LIST, WC_BUY_COMPANY, WC_COMPANY, WC_COMPANY_COLOUR, WC_COMPANY_INFRASTRUCTURE, WC_FINANCES, WC_ROADVEH_LIST, WC_SHIPS_LIST, WC_STATION_LIST, WC_TRAINS_LIST, and Window::window_class.

Referenced by ChangeOwnershipOfCompanyItems().

void DeleteAllNonVitalWindows | ( |  | ) |

It is possible that a stickied window gets to a position where the 'close' button is outside the gaming area.

You cannot close it then; except with this function. It closes all windows calling the standard function, then, does a little hacked loop of closing all stickied windows. Note that standard windows (status bar, etc.) are not stickied, so these aren't affected

Definition at line 3242 of file window.cpp.

References DeleteNonVitalWindows(), Window::flags, and WF_STICKY.

Referenced by GenerateWorld(), and MainWindow::OnHotkey().

void DeleteConstructionWindows | ( |  | ) |

Delete all windows that are used for construction of vehicle etc.

Once done with that invalidate the others to ensure they get refreshed too.

Definition at line 3265 of file window.cpp.

References WindowDesc::flags, Window::SetDirty(), WDF_CONSTRUCTION, and Window::window_desc.

Referenced by SetLocalCompany().

void DeleteNonVitalWindows | ( |  | ) |

Try to delete a non-vital window.

Non-vital windows are windows other than the game selection, main toolbar, status bar, toolbar menu, and tooltip windows. Stickied windows are also considered vital.

Definition at line 3213 of file window.cpp.

References Window::flags, WC_MAIN_TOOLBAR, WC_MAIN_WINDOW, WC_SELECT_GAME, WC_STATUS_BAR, WC_TOOLTIPS, WF_STICKY, and Window::window_class.

Referenced by DeleteAllNonVitalWindows(), and MainWindow::OnHotkey().

void DeleteWindowByClass | ( | WindowClass | cls | ) |

Delete all windows of a given class.

Parameters

  cls | Window class of windows to delete

Definition at line 1145 of file window.cpp.

References Window::window_class.

Referenced by AIListWindow::ChangeAI(), AIDebugWindow::ChangeToAI(), CleanupGeneration(), DoScanNewGRFFiles(), InvalidateNewGRFChangeWindows(), NewGRFConfirmationCallback(), NewGRFWindow::OnClick(), GameOptionsWindow::OnDropdownSelect(), NewGRFWindow::OnDropdownSelect(), VehicleGroupWindow::OnInvalidateData(), NetworkClientListPopupWindow::OnMouseLoop(), BuildDocksToolbarWindow::OnPlaceObjectAbort(), BuildRoadToolbarWindow::OnPlaceObjectAbort(), BuildRailToolbarWindow::OnPlaceObjectAbort(), PopupClientList(), SetupEngines(), ShowAIConfigWindow(), ShowAIListWindow(), ShowAISettingsWindow(), ShowBaseSetTextfileWindow(), ShowBuildAirToolbar(), ShowBuildBridgeWindow(), ShowBuildDocksToolbar(), ShowBuildRailToolbar(), ShowBuildRoadToolbar(), ShowCreateScenario(), ShowEndGameChart(), ShowGameOptions(), ShowGameSettings(), ShowHighscoreTable(), ShowNetworkChatQueryWindow(), ShowNewGRFSettings(), ShowQueryString(), ShowRenameSignWindow(), ShowSavePresetWindow(), ShowScriptTextfileWindow(), and ShowSetDateWindow().

void DeleteWindowById | ( | WindowClass | cls,
|  | WindowNumber | number,
|  | bool | force
| ) |  |

Delete a window by its class and window number (if it is open).

Parameters

  cls | Window class
  number | Number of the window within the window class
  force | force deletion; if false don't delete when stickied

Definition at line 1132 of file window.cpp.

References FindWindowById(), Window::flags, and WF_STICKY.

Referenced by ClientNetworkContentSocketHandler::BeforeDownload(), ClientNetworkGameSocketHandler::ClientError(), ServerNetworkGameSocketHandler::CloseConnection(), CmdCompanyCtrl(), CmdDeleteGroup(), CmdGoalQuestionAnswer(), CmdMoveRailVehicle(), DeleteCompanyWindows(), DeleteNewGRFInspectWindow(), EnginesDailyLoop(), GuiShowTooltips(), HideVitalWindows(), IConsoleSwitch(), MoveToNextItem(), NetworkDisconnect(), NewVehicleAvailable(), BuildRoadToolbarWindow::OnClick(), NetworkGameWindow::OnClick(), BuildRoadStationWindow::OnClick(), BuildRailStationWindow::OnClick(), SelectStationWindow< T >::OnClick(), BuildDocksToolbarWindow::OnInvalidateData(), BuildRoadToolbarWindow::OnInvalidateData(), BuildAirToolbarWindow::OnPlaceObjectAbort(), BuildDocksToolbarWindow::OnPlaceObjectAbort(), TerraformToolbarWindow::OnPlaceObjectAbort(), BuildRoadToolbarWindow::OnPlaceObjectAbort(), ScenarioEditorLandscapeGenerationWindow::OnPlaceObjectAbort(), BuildRailToolbarWindow::OnPlaceObjectAbort(), Vehicle::PreDestructor(), ClientNetworkGameSocketHandler::Receive_SERVER_BANNED(), ClientNetworkGameSocketHandler::Receive_SERVER_ERROR(), ClientNetworkGameSocketHandler::Receive_SERVER_FULL(), ClientNetworkGameSocketHandler::Receive_SERVER_MAP_DONE(), RemoveAirport(), Vehicle::RemoveFromShared(), ShowCheatWindow(), ShowCustCurrency(), ShowDropDownListAt(), ShowLandInfo(), ShowMessageHistory(), ShowNetworkContentListWindow(), ShowNetworkLobbyWindow(), ShowNewsMessage(), ShowOnScreenKeyboard(), ShowReplaceGroupVehicleWindow(), ShowSaveLoadDialog(), ShowTerraformToolbar(), ShowTimetableWindow(), ShowVehicleDetailsWindow(), ShowVehicleRefitWindow(), StartWindowDrag(), StartWindowSizing(), AI::Stop(), ToggleRailButton_Remove(), Depot::~Depot(), Station::~Station(), and Town::~Town().

bool EditBoxInGlobalFocus | ( |  | ) |

Check if an edit box is in global focus.

That is if focused window has a edit box as focused widget, or if a console is focused.

Returns
  returns true if an edit box is in global focus or if the focused window is a console, else false

Definition at line 455 of file window.cpp.

References Window::nested_focus, NWidgetBase::type, WC_CONSOLE, Window::window_class, and WWT_EDITBOX.

Referenced by HandleKeypress(), HandleTextInput(), Window::InitializeData(), VideoDriver_Win32::MainLoop(), SetCandidatePos(), and SetCompositionPos().

Window* FindWindowByClass | ( | WindowClass | cls | ) |

Find any window by its class.

Useful when searching for a window that uses the window number as a #WindowType, like WC_SEND_NETWORK_MSG.

Parameters

  cls | Window class

Returns
  Pointer to the found window, or `NULL` if not available

Definition at line 1116 of file window.cpp.

References Window::window_class.

Referenced by GetAutoPlacePosition(), IsGoodAutoPlace1(), IndustryCargoesWindow::OnClick(), and UpdateNewGRFScanStatus().

Window* FindWindowById | ( | WindowClass | cls,
|  | WindowNumber | number
| ) |  |

Find a window by its class and window number.

Parameters

  cls | Window class
  number | Number of the window within the window class

Returns
  Pointer to the found window, or `NULL` if not available

Definition at line 1100 of file window.cpp.

References Window::window_class, and Window::window_number.

Referenced by BringWindowToFrontById(), ChangeVehicleWindow(), DeleteDepotHighlightOfVehicle(), DeleteRenameSignWindow(), DeleteWindowById(), SmallMapWindow::DrawMapIndicators(), StatusBarWindow::DrawWidget(), EnsureVisibleCaption(), FindVehicleGroupWindow(), Window::FindWindowPlacementAndResize(), GenerateWorld(), GenericPlaceSignals(), TileHighlightData::GetCallbackWnd(), GetLobbyCompanyInfo(), GetMainViewBottom(), GetMainViewTop(), GetToolbarAlignedWindowPosition(), HandleAutoSignalPlacement(), HandleKeypress(), HandleViewportScroll(), IsNewsTickerShown(), IsOSKOpenedFor(), LoadFromConfig(), LocalGetWindowPlacement(), NetworkContentDownloadStatusWindow::NetworkContentDownloadStatusWindow(), ExtraViewportWindow::OnClick(), SmallMapWindow::OnClick(), BuildSignalWindow::OnClick(), SavePresetWindow::OnClick(), VehicleViewWindow::OnClick(), ErrmsgWindow::OnInitialPosition(), NetworkChatWindow::OnInitialPosition(), NetworkContentListWindow::OnInvalidateData(), MainToolbarWindow::OnInvalidateData(), ScenarioEditorToolbarWindow::OnInvalidateData(), DropdownWindow::OnMouseLoop(), BuildRailToolbarWindow::OnPlaceDrag(), PositionWindow(), ReadyForNextItem(), ReinitGuiAfterToggleElrail(), RelocateAllWindows(), ResetSignalVariant(), ScrollMainWindowTo(), SetDefaultRailGui(), SetupScreenshotViewport(), ShowErrorMessage(), ShowExtraViewPortWindow(), ShowLastNewsMessage(), ShowQuery(), SmallMapWindow::SmallMapCenterOnCurrentPos(), StationJoinerNeeded(), UnshowCriticalError(), and UpdateOSKOriginalText().

int GetMainViewBottom | ( |  | ) |

Return the bottom of the main view available for general use.

Returns
  The vertical coordinate of the first unusable row, so 'top + height <= bottom' gives the correct result.

Note
  At and below the bottom y coordinate is often the status bar.

Definition at line 2117 of file window.cpp.

References FindWindowById(), Window::top, and WC_STATUS_BAR.

Referenced by ErrmsgWindow::OnInitialPosition(), BuildBridgeWindow::OnInitialPosition(), TooltipsWindow::OnInitialPosition(), and ShowDropDownListAt().

int GetMainViewTop | ( |  | ) |

Return the top of the main view available for general use.

Returns
  Uppermost vertical coordinate available.

Note
  Above the upper y coordinate is often the main toolbar.

Definition at line 2106 of file window.cpp.

References FindWindowById(), Window::height, Window::top, and WC_MAIN_TOOLBAR.

Referenced by ErrmsgWindow::OnInitialPosition(), BuildBridgeWindow::OnInitialPosition(), TooltipsWindow::OnInitialPosition(), and ShowDropDownListAt().

void InvalidateWindowClassesData | ( | WindowClass | cls,
|  | int | data,
|  | bool | gui_scope
| ) |  |

Mark window data of all windows of a given class as invalid (in need of re-computing) Note that by default the invalidation is not considered to be called from GUI scope.

See InvalidateWindowData() for details on GUI-scope vs. command-scope.

Parameters

  cls | Window class
  data | The data to invalidate with
  gui_scope | Whether the call is done from GUI scope

Definition at line 3185 of file window.cpp.

References Window::InvalidateData(), and Window::window_class.

Referenced by AddRemoveEngineFromAutoreplaceAndBuildWindows(), CcBuildWagon(), AIListWindow::ChangeAI(), ClickChangeDateCheat(), ClickChangeMaxHlCheat(), ClickSetProdCheat(), CmdBuildVehicle(), CmdCloneOrder(), CmdCompanyCtrl(), CmdCreateGoal(), CmdCreateStoryPage(), CmdCreateStoryPageElement(), CmdMoveOrder(), CmdMoveRailVehicle(), CmdRefitVehicle(), CmdRemoveGoal(), CmdRemoveStoryPage(), CmdRemoveStoryPageElement(), CmdRenameVehicle(), CmdSellRailWagon(), CmdSetGoalCompleted(), CmdSetGoalProgress(), CmdSetGoalText(), CmdSetStoryPageDate(), CmdSetStoryPageTitle(), CmdUpdateStoryPageElement(), Vehicle::Crash(), DecloneOrder(), DeleteOrder(), OrderBackup::DoRestore(), DoScanNewGRFFiles(), EnginesMonthlyLoop(), GenerateDesertArea(), InsertOrder(), OrderList::InsertOrderAt(), InvalidateCompanyInfrastructureWindow(), InvalidateCompanyWindow(), InvalidateNewGRFChangeWindows(), MenuClickSettings(), NetworkAfterNewGRFScan(), IndustryCargoesWindow::NotifySmallmap(), SmallMapWindow::OnClick(), OnNewYear(), Vehicle::PreDestructor(), ReadLanguagePack(), ReloadNewGRFData(), AI::Rescan(), RoadVehAccelerationModelChanged(), SetLocalCompany(), SetNewLandscapeType(), StartupEngines(), Order::~Order(), and Station::~Station().

void InvalidateWindowData | ( | WindowClass | cls,
|  | WindowNumber | number,
|  | int | data,
|  | bool | gui_scope
| ) |  |

Mark window data of the window of a given class and specific window number as invalid (in need of re-computing)

Note that by default the invalidation is not considered to be called from GUI scope. That means only a part of invalidation is executed immediately. The rest is scheduled for the next redraw. The asynchronous execution is important to prevent GUI code being executed from command scope. When not in GUI-scope:

- OnInvalidateData() may not do test-runs on commands, as they might affect the execution of the command which triggered the invalidation. (town rating and such)
- OnInvalidateData() may not rely on _current_company == _local_company. This implies that no NewGRF callbacks may be run.

However, when invalidations are scheduled, then multiple calls may be scheduled before execution starts. Earlier scheduled invalidations may be called with invalidation-data, which is already invalid at the point of execution. That means some stuff requires to be executed immediately in command scope, while not everything may be executed in command scope. While GUI-scope calls have no restrictions on what they may do, they cannot assume the game to still be in the state when the invalidation was scheduled; passed IDs may have got invalid in the mean time.

Finally, note that invalidations triggered from commands or the game loop result in OnInvalidateData() being called twice. Once in command-scope, once in GUI-scope. So make sure to not process differential-changes twice.

Parameters

  cls | Window class
  number | Window number within the class
  data | The data to invalidate with
  gui_scope | Whether the call is done from GUI scope

Definition at line 3167 of file window.cpp.

References Window::InvalidateData(), Window::window_class, and Window::window_number.

Referenced by AcceptEnginePreview(), AddRemoveEngineFromAutoreplaceAndBuildWindows(), AircraftLeaveHangar(), Subsidy::AwardTo(), AIListWindow::ChangeAI(), ChangePopulation(), CheckTrainStayInDepot(), CmdAddSharedVehicleGroup(), CmdAddVehicleGroup(), CmdAlterGroup(), CmdBuildAirport(), CmdBuildBuoy(), CmdBuildDock(), CmdBuildRailStation(), CmdBuildRailWagon(), CmdBuildRoadStop(), CmdBuildVehicle(), CmdBuyShareInCompany(), CmdCompanyCtrl(), CmdConvertRail(), CmdCreateGoal(), CmdCreateGroup(), CmdCreateStoryPage(), CmdDeleteGroup(), CmdMoveRailVehicle(), CmdPlaceSign(), CmdRefitVehicle(), CmdRemoveAllVehiclesGroup(), CmdRemoveGoal(), CmdRemoveStoryPage(), CmdRenameSign(), CmdRenameStation(), CmdRenameTown(), CmdSellRailWagon(), CmdSellShareInCompany(), CmdSetCompanyColour(), CmdSetGoalCompleted(), CmdSetGoalProgress(), CmdSetGoalText(), CmdSetGroupReplaceProtection(), CmdTownCargoGoal(), CmdTownGrowthRate(), CmdTownSetText(), Company::Company(), Train::ConsistChanged(), CreateSubsidy(), DeleteNewGRFInspectWindow(), DeleteStationIfEmpty(), DeleteSubsidyWith(), DoCreateNewIndustry(), DoCreateTown(), DoScanNewGRFFiles(), DoStartupNewCompany(), StatusBarWindow::DrawWidget(), HandleMouseEvents(), IndustryDailyLoop(), InvalidateAutoreplaceWindow(), InvalidateNewGRFInspectWindow(), InvalidateVehicleOrder(), LoadUnloadVehicle(), MoveToNextItem(), NetworkChatWindow::NetworkChatWindow(), NewVehicleAvailable(), NormaliseTrainHead(), GraphLegendWindow::OnClick(), MainWindow::OnInvalidateData(), Industry::PostDestructor(), Town::PostDestructor(), BaseStation::PostDestructor(), Company::PostDestructor(), Vehicle::PreDestructor(), RecomputePrices(), ReloadNewGRFData(), RemoveAirport(), RemoveBuoy(), Vehicle::RemoveFromShared(), AI::Rescan(), ReverseTrainDirection(), SaveFileDone(), SaveFileStart(), SetLocalCompany(), ShowTicker(), Game::StartNew(), AI::StartNew(), AI::Stop(), SubsidyMonthlyLoop(), UpdateNetworkGameWindow(), Waypoint::UpdateVirtCoord(), VehicleEnter_Track(), VehicleEnterDepot(), LinkGraphJob::~LinkGraphJob(), NetworkClientInfo::~NetworkClientInfo(), NetworkContentDownloadStatusWindow::~NetworkContentDownloadStatusWindow(), and Station::~Station().

int PositionMainToolbar | ( | Window * | w | ) |

(Re)position main toolbar window at the screen.

Parameters

  w | Window structure of the main toolbar window, may also be `NULL`.

Returns
  X coordinate of left edge of the repositioned toolbar window.

Definition at line 3343 of file window.cpp.

References _settings_client, DEBUG, ClientSettings::gui, PositionWindow(), GUISettings::toolbar_pos, and WC_MAIN_TOOLBAR.

Referenced by RelocateAllWindows(), and v_PositionMainToolbar().

int PositionNetworkChatWindow | ( | Window * | w | ) |

(Re)position network chat window at the screen.

Parameters

  w | Window structure of the network chat window, may also be `NULL`.

Returns
  X coordinate of left edge of the repositioned network chat window.

Definition at line 3376 of file window.cpp.

References _settings_client, DEBUG, ClientSettings::gui, PositionWindow(), GUISettings::statusbar_pos, and WC_SEND_NETWORK_MSG.

Referenced by NetworkChatWindow::NetworkChatWindow(), RelocateAllWindows(), and v_PositionStatusbar().

int PositionNewsMessage | ( | Window * | w | ) |

(Re)position news message window at the screen.

Parameters

  w | Window structure of the news message window, may also be `NULL`.

Returns
  X coordinate of left edge of the repositioned news message.

Definition at line 3365 of file window.cpp.

References _settings_client, DEBUG, ClientSettings::gui, PositionWindow(), GUISettings::statusbar_pos, and WC_NEWS_WINDOW.

Referenced by RelocateAllWindows(), and v_PositionStatusbar().

int PositionStatusbar | ( | Window * | w | ) |

(Re)position statusbar window at the screen.

Parameters

  w | Window structure of the statusbar window, may also be `NULL`.

Returns
  X coordinate of left edge of the repositioned statusbar.

Definition at line 3354 of file window.cpp.

References _settings_client, DEBUG, ClientSettings::gui, PositionWindow(), GUISettings::statusbar_pos, and WC_STATUS_BAR.

Referenced by RelocateAllWindows(), and v_PositionStatusbar().

void ReInitAllWindows | ( |  | ) |

Re-initialize all windows.

Definition at line 3291 of file window.cpp.

References _cur_resolution, InitDepotWindowBlockSizes(), NWidgetLeaf::InvalidateDimensionCache(), MarkWholeScreenDirty(), NetworkReInitChatBoxSize(), Window::ReInit(), and RelocateAllWindows().

Referenced by CheckBlitter(), InvalidateNewGRFChangeWindows(), LoadStringWidthTable(), NewGRFConfirmationCallback(), and GameOptionsWindow::OnDropdownSelect().

void ResizeWindow | ( | Window * | w,
|  | int | delta_x,
|  | int | delta_y,
|  | bool | clamp_to_screen
| ) |  |

Resize the window.

Update all the widgets of a window based on their resize flags Both the areas of the old window and the new sized window are set dirty ensuring proper redrawal.

Parameters

  w | Window to resize
  delta_x | Delta x-size of changed window (positive if larger, etc.)
  delta_y | Delta y-size of changed window
  clamp_to_screen | Whether to make sure the whole window stays visible

Definition at line 2070 of file window.cpp.

References _cur_resolution, _current_text_dir, NWidgetBase::AssignSizePosition(), Ceil(), NWidgetBase::current_x, NWidgetBase::current_y, EnsureVisibleCaption(), Window::height, Window::left, max(), Window::nested_root, Window::OnResize(), NWidgetBase::resize_x, NWidgetBase::resize_y, Window::SetDirty(), NWidgetBase::smallest_x, NWidgetBase::smallest_y, ST_RESIZE, TD_RTL, Window::top, and Window::width.

Referenced by NetworkClientListWindow::CheckClientListHeight(), DispatchLeftClickEvent(), TownAuthorityWindow::DrawRatings(), Window::FindWindowPlacementAndResize(), HandleWindowDragging(), BuildAirportWindow::OnPaint(), BuildDocksStationWindow::OnPaint(), BuildRoadStationWindow::OnPaint(), Window::ReInit(), and RelocateAllWindows().

void SetWindowClassesDirty | ( | WindowClass | cls | ) |

Mark all windows of a particular class as dirty (in need of repainting)

Parameters

  cls | Window class

Definition at line 3095 of file window.cpp.

References Window::SetDirty(), and Window::window_class.

Referenced by AircraftLeaveHangar(), CalcEngineReliability(), CheckTrainStayInDepot(), CmdChangeCompanySetting(), CmdChangeSetting(), CmdRenameDepot(), CmdReverseTrainDirection(), CmdSkipToOrder(), CmdStartStopVehicle(), DoStartupNewCompany(), NetworkServerUpdateCompanyPassworded(), Ship::OnNewDay(), Aircraft::OnNewDay(), RoadVehicle::OnNewDay(), Train::OnNewDay(), OnNewDay(), OnNewMonth(), ProcessOrders(), ClientNetworkGameSocketHandler::Receive_SERVER_COMPANY_UPDATE(), RecomputePrices(), RedrawSmallmap(), RedrawTownAuthority(), AI::Rescan(), RoadVehAccelerationModelChanged(), SetSettingValue(), and VehicleEnterDepot().

void SetWindowDirty | ( | WindowClass | cls,
|  | WindowNumber | number
| ) |  |

Mark window as dirty (in need of repainting)

Parameters

  cls | Window class
  number | Window number in that class

Definition at line 3067 of file window.cpp.

References Window::SetDirty(), Window::window_class, and Window::window_number.

Referenced by ServerNetworkGameSocketHandler::AcceptConnection(), AddNewsItem(), AgeVehicle(), AircraftEventHandler_AtTerminal(), Vehicle::BeginLoading(), ChangeIndustryProduction(), ChangeTimetable(), ChangeTownRating(), CheckTrainStayInDepot(), ClickChangeDateCheat(), ServerNetworkGameSocketHandler::CloseConnection(), CmdAddVehicleGroup(), CmdAlterGroup(), CmdAutofillTimetable(), CmdBuildAirport(), CmdBuildObject(), CmdBuildVehicle(), CmdChangeServiceInt(), CmdDoTownAction(), CmdForceTrainProceed(), CmdMoveRailVehicle(), CmdPause(), CmdRefitVehicle(), CmdRenameDepot(), CmdReverseTrainDirection(), CmdSetAutoReplace(), CmdSetGroupReplaceProtection(), CmdSetTimetableStart(), CmdSetVehicleOnTime(), CmdStartStopVehicle(), CompaniesGenStatistics(), CompaniesYearlyLoop(), Train::ConsistChanged(), Vehicle::Crash(), DecreaseVehicleValue(), DeleteLastWagon(), DeleteNewsItem(), DirtyCompanyInfrastructureWindows(), DoStartupNewCompany(), Vehicle::HandleBreakdown(), IConsoleGUIPrint(), IndustryDailyLoop(), IndustryProductionCallback(), InvalidateCompanyWindows(), InvalidateVehicleOrder(), LoadUnloadVehicle(), NewGRFParametersWindow::OnClick(), BuildSignalWindow::OnClick(), GameOptionsWindow::OnDropdownSelect(), Ship::OnNewDay(), Aircraft::OnNewDay(), RoadVehicle::OnNewDay(), Train::OnNewDay(), OnNewMonth(), GroundVehicle< T, Type >::PowerChanged(), Vehicle::PreDestructor(), ClientNetworkGameSocketHandler::Receive_SERVER_CLIENT_INFO(), ClientNetworkGameSocketHandler::Receive_SERVER_COMPANY_INFO(), ClientNetworkGameSocketHandler::Receive_SERVER_ERROR_QUIT(), ClientNetworkGameSocketHandler::Receive_SERVER_JOIN(), ClientNetworkGameSocketHandler::Receive_SERVER_MAP_BEGIN(), ClientNetworkGameSocketHandler::Receive_SERVER_MAP_DATA(), ClientNetworkGameSocketHandler::Receive_SERVER_MAP_DONE(), ClientNetworkGameSocketHandler::Receive_SERVER_MAP_SIZE(), ClientNetworkGameSocketHandler::Receive_SERVER_QUIT(), ClientNetworkGameSocketHandler::Receive_SERVER_WAIT(), RemoveAirport(), RemoveOrderFromAllVehicles(), ClientNetworkGameSocketHandler::SendCompanyInformationQuery(), ClientNetworkGameSocketHandler::SendJoin(), SetTrainGroupID(), GRFParameterInfo::SetValue(), TrainController(), TrainEnterStation(), TriggerIndustryProduction(), UpdateCompanyRatingAndValue(), UpdateTownGrowRate(), UpdateTrainGroupID(), UpdateVehicleTimetable(), Town::UpdateVirtCoord(), Station::UpdateVirtCoord(), VehicleEnterDepot(), VehicleServiceInDepot(), and NetworkContentDownloadStatusWindow::~NetworkContentDownloadStatusWindow().

void SetWindowWidgetDirty | ( | WindowClass | cls,
|  | WindowNumber | number,
|  | byte | widget_index
| ) |  |

Mark a particular widget in a particular window as dirty (in need of repainting)

Parameters

  cls | Window class
  number | Window number in that class
  widget_index | Index number of the widget that needs repainting

Definition at line 3081 of file window.cpp.

References Window::SetWidgetDirty(), Window::window_class, and Window::window_number.

Referenced by AircraftHandleDestTooFar(), Vehicle::BeginLoading(), CheckIfTrainNeedsService(), CmdBuildDock(), CmdBuildRailStation(), CmdBuildRoadStop(), CmdOpenCloseAirport(), CmdRemoveFromRailStation(), CmdStartStopVehicle(), Vehicle::Crash(), MarkTrainAsStuck(), NormaliseTrainHead(), OnNewDay(), GroundVehicle< T, Type >::PowerChanged(), RemoveDock(), RemoveFromRailBaseStation(), RemoveRoadStop(), ReverseTrainDirection(), Vehicle::SendToDepot(), GroundVehicle< RoadVehicle, VEH_ROAD >::SetLastSpeed(), TryPathReserve(), UpdateAircraftSpeed(), and UpdateStationAcceptance().