From cfc45e97ab94c6d96f32b3397201c003b61ccd75 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Fri, 23 May 2008 23:02:13 +0000 Subject: (svn r13225) -Fix (r13041): Missing calls to FindWindowPlacementAndResize() from lots of windows causing 'two stage' opening effect. --- src/cheat_gui.cpp | 1 + src/engine_gui.cpp | 1 + src/genworld_gui.cpp | 6 +++++- src/graph_gui.cpp | 1 + src/news_gui.cpp | 2 ++ src/player_gui.cpp | 7 ++++++- src/station_gui.cpp | 2 ++ src/subsidy_gui.cpp | 1 + src/timetable_gui.cpp | 2 ++ src/toolbar_gui.cpp | 2 ++ src/town_gui.cpp | 1 + src/vehicle_gui.cpp | 4 ++++ 12 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp index 67d191cb4..42b8ca470 100644 --- a/src/cheat_gui.cpp +++ b/src/cheat_gui.cpp @@ -125,6 +125,7 @@ struct CheatWindow : Window { CheatWindow(const WindowDesc *desc) : Window(desc) { + this->FindWindowPlacementAndResize(desc); } virtual void OnPaint() diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index b5a2c79c3..a67d23fcb 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -69,6 +69,7 @@ static const DrawEngineInfo _draw_engine_list[4] = { struct EnginePreviewWindow : Window { EnginePreviewWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number) { + this->FindWindowPlacementAndResize(desc); } virtual void OnPaint() diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index 6d5ab4dc0..42336d9f9 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -645,6 +645,7 @@ struct CreateScenarioWindow : public Window CreateScenarioWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number) { this->LowerWidget(_opt_newgame.landscape + CSCEN_TEMPERATE); + this->FindWindowPlacementAndResize(desc); } virtual void OnPaint() @@ -850,7 +851,10 @@ private: }; public: - GenerateProgressWindow() : Window(&_generate_progress_desc) {}; + GenerateProgressWindow() : Window(&_generate_progress_desc) + { + this->FindWindowPlacementAndResize(&_generate_progress_desc); + } virtual void OnClick(Point pt, int widget) { diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 2cc1fe12d..69264ec9b 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -769,6 +769,7 @@ static int CDECL PerfHistComp(const void* elem1, const void* elem2) struct CompanyLeagueWindow : Window { CompanyLeagueWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number) { + this->FindWindowPlacementAndResize(desc); } virtual void OnPaint() diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 3b2b250a5..41b2e9daf 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -795,6 +795,8 @@ struct MessageOptionsWindow : Window { } /* If all values are the same value, the ALL-button will take over this value */ this->state = all_val; + + this->FindWindowPlacementAndResize(desc); } /** diff --git a/src/player_gui.cpp b/src/player_gui.cpp index 3c611b005..f08b5c332 100644 --- a/src/player_gui.cpp +++ b/src/player_gui.cpp @@ -165,6 +165,8 @@ struct PlayerFinancesWindow : Window { this->top = top; this->left = left; } + + this->FindWindowPlacementAndResize(desc); } virtual void OnPaint() @@ -758,7 +760,6 @@ public: SelectPlayerFaceWindow(const WindowDesc *desc, Window *parent, bool advanced, int top, int left) : Window(desc, parent->window_number) { this->parent = parent; - this->FindWindowPlacementAndResize(desc); this->caption_color = this->window_number; this->face = GetPlayer((PlayerID)this->window_number)->face; this->advanced = advanced; @@ -770,6 +771,8 @@ public: this->top = top; this->left = left; } + + this->FindWindowPlacementAndResize(desc); } virtual void OnPaint() @@ -1167,6 +1170,7 @@ struct PlayerCompanyWindow : Window PlayerCompanyWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number) { this->caption_color = this->window_number; + this->FindWindowPlacementAndResize(desc); } virtual void OnPaint() @@ -1357,6 +1361,7 @@ void ShowPlayerCompany(PlayerID player) struct BuyCompanyWindow : Window { BuyCompanyWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number) { + this->FindWindowPlacementAndResize(desc); } virtual void OnPaint() diff --git a/src/station_gui.cpp b/src/station_gui.cpp index ba2abc5ee..4086f9ad8 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -318,6 +318,8 @@ struct PlayerStationsWindow : public Window, public GUIStationList /* set up resort timer */ this->resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS; + + this->FindWindowPlacementAndResize(desc); } virtual void OnPaint() diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp index ed03ba1a4..ca81c0271 100644 --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -22,6 +22,7 @@ struct SubsidyListWindow : Window { SubsidyListWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number) { + this->FindWindowPlacementAndResize(desc); } virtual void OnClick(Point pt, int widget) diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 0052a5f09..1a4f7d75b 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -56,6 +56,8 @@ struct TimetableWindow : Window { this->vscroll.cap = 8; this->resize.step_height = 10; this->sel_index = -1; + + this->FindWindowPlacementAndResize(desc); } int GetOrderFromTimetableWndPt(int y, const Vehicle *v) diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index 80d9af408..7cc462cbd 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -1322,6 +1322,8 @@ struct ToolbarPlayerMenuWindow : Window { this->sel_index = 0; } } + + this->FindWindowPlacementAndResize(width, height); } ~ToolbarPlayerMenuWindow() diff --git a/src/town_gui.cpp b/src/town_gui.cpp index f0afdf253..46a7e8890 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -640,6 +640,7 @@ public: ScenarioEditorTownGenerationWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number) { this->LowerWidget(_scengen_town_size + TSEW_SMALLTOWN); + this->FindWindowPlacementAndResize(desc); } virtual void OnPaint() diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 1e8af36af..422fd9671 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1401,6 +1401,8 @@ struct VehicleDetailsWindow : Window { this->caption_color = v->owner; this->tab = 0; + + this->FindWindowPlacementAndResize(desc); } /** Checks whether service interval is enabled for the vehicle. */ @@ -1873,6 +1875,8 @@ struct VehicleViewWindow : Window { default: NOT_REACHED(); } + + this->FindWindowPlacementAndResize(desc); } ~VehicleViewWindow() -- cgit v1.2.3-70-g09d2