MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / CloseWindowById

Function CloseWindowById

src/window.cpp:1195–1201  ·  view source on GitHub ↗

* Close a window by its class and window number (if it is open). * @param cls Window class * @param number Number of the window within the window class * @param force force closing; if false don't close when stickied */

Source from the content-addressed store, hash-verified

1193 * @param force force closing; if false don't close when stickied
1194 */
1195void CloseWindowById(WindowClass cls, WindowNumber number, bool force, int data)
1196{
1197 Window *w = FindWindowById(cls, number);
1198 if (w != nullptr && (force || !w->flags.Test(WindowFlag::Sticky))) {
1199 w->Close(data);
1200 }
1201}
1202
1203/**
1204 * Close all windows of a given class

Callers 15

ShowTerraformToolbarFunction · 0.85
ShowSaveLoadDialogFunction · 0.85
~IndustryMethod · 0.85
IConsoleSwitchFunction · 0.85
SwitchToModeFunction · 0.85
ShowOnScreenKeyboardFunction · 0.85
CloseCompanyWindowsFunction · 0.85
DeleteAllMessagesFunction · 0.85
HideVitalWindowsFunction · 0.85
ShowOrdersWindowFunction · 0.85

Calls 3

FindWindowByIdFunction · 0.85
TestMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected