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

Function BringWindowToFrontById

src/window.cpp:1278–1291  ·  view source on GitHub ↗

* Find a window and make it the relative top-window on the screen. * The window gets unshaded if it was shaded, and a white border is drawn at its edges for a brief period of time to visualize its "activation". * @param cls WindowClass of the window to activate * @param number WindowNumber of the window to activate * @return a pointer to the window thus activated */

Source from the content-addressed store, hash-verified

1276 * @return a pointer to the window thus activated
1277 */
1278Window *BringWindowToFrontById(WindowClass cls, WindowNumber number)
1279{
1280 Window *w = FindWindowById(cls, number);
1281
1282 if (w != nullptr) {
1283 if (w->IsShaded()) w->SetShaded(false); // Restore original window size if it was shaded.
1284
1285 w->SetWhiteBorder();
1286 BringWindowToFront(w);
1287 w->SetDirty();
1288 }
1289
1290 return w;
1291}
1292
1293static inline bool IsVitalWindow(const Window *w)
1294{

Callers 14

ShowOrdersWindowFunction · 0.85
ShowBuildIndustryWindowFunction · 0.85
ShowTownDirectoryFunction · 0.85
ShowBuildHousePickerFunction · 0.85
ShowDepotWindowFunction · 0.85
ShowCompanyFinancesFunction · 0.85
ShowCompanyLiveryWindowFunction · 0.85
ShowBuyCompanyDialogFunction · 0.85
AllocateWindowDescFrontFunction · 0.85

Calls 6

FindWindowByIdFunction · 0.85
BringWindowToFrontFunction · 0.85
IsShadedMethod · 0.80
SetShadedMethod · 0.80
SetWhiteBorderMethod · 0.80
SetDirtyMethod · 0.45

Tested by

no test coverage detected