From f5c6fd1a2582be29c9a5376ccb638781fbf355f7 Mon Sep 17 00:00:00 2001 From: alberth Date: Fri, 26 Nov 2010 15:22:18 +0000 Subject: [PATCH] (svn r21331) -Codechange: Make drawing the widgets default behaviour in OnPaint(). --- src/ai/ai_gui.cpp | 15 --------------- src/airport_gui.cpp | 5 ----- src/bridge_gui.cpp | 5 ----- src/cheat_gui.cpp | 5 ----- src/company_gui.cpp | 5 ----- src/date_gui.cpp | 5 ----- src/dock_gui.cpp | 5 ----- src/engine_gui.cpp | 5 ----- src/genworld_gui.cpp | 5 ----- src/graph_gui.cpp | 16 ---------------- src/industry_gui.cpp | 15 --------------- src/intro_gui.cpp | 5 ----- src/misc_gui.cpp | 26 -------------------------- src/music_gui.cpp | 10 ---------- src/network/network_content_gui.cpp | 5 ----- src/network/network_gui.cpp | 10 ---------- src/newgrf_debug_gui.cpp | 10 ---------- src/newgrf_gui.cpp | 5 ----- src/news_gui.cpp | 10 ---------- src/object_gui.cpp | 5 ----- src/rail_gui.cpp | 15 --------------- src/road_gui.cpp | 10 ---------- src/settings_gui.cpp | 20 -------------------- src/smallmap_gui.cpp | 5 ----- src/station_gui.cpp | 5 ----- src/statusbar_gui.cpp | 5 ----- src/subsidy_gui.cpp | 5 ----- src/terraform_gui.cpp | 6 ------ src/town_gui.cpp | 10 ---------- src/vehicle_gui.cpp | 5 ----- src/viewport_gui.cpp | 5 ----- src/waypoint_gui.cpp | 5 ----- src/widgets/dropdown.cpp | 5 ----- src/window_gui.h | 5 ++++- 34 files changed, 4 insertions(+), 274 deletions(-) diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index bf1357e711..850a0f28c4 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -88,11 +88,6 @@ struct AIListWindow : public Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void DrawWidget(const Rect &r, int widget) const { switch (widget) { @@ -284,11 +279,6 @@ struct AISettingsWindow : public Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void DrawWidget(const Rect &r, int widget) const { if (widget != AIS_WIDGET_BACKGROUND) return; @@ -581,11 +571,6 @@ struct AIConfigWindow : public Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void DrawWidget(const Rect &r, int widget) const { switch (widget) { diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index c518a63b72..a59cd4b1bd 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -94,11 +94,6 @@ struct BuildAirToolbarWindow : Window { if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0, false); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnClick(Point pt, int widget, int click_count) { if (!IsInsideBS(widget, ATW_AIRPORT, lengthof(_build_air_button_proc))) return; diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 7c636928f0..efe1d1636d 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -160,11 +160,6 @@ public: delete bridges; } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp index f9715da855..11aea4fdd0 100644 --- a/src/cheat_gui.cpp +++ b/src/cheat_gui.cpp @@ -270,11 +270,6 @@ struct CheatWindow : Window { size->height = this->header_height + WD_FRAMERECT_TOP + WD_PAR_VSEP_NORMAL + WD_FRAMERECT_BOTTOM + (FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL) * lengthof(_cheats_ui); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnClick(Point pt, int widget, int click_count) { const NWidgetBase *wid = this->GetWidget(CW_PANEL); diff --git a/src/company_gui.cpp b/src/company_gui.cpp index ff10127774..56d6e94a95 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -2084,11 +2084,6 @@ struct BuyCompanyWindow : Window { this->InitNested(desc, window_number); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { diff --git a/src/date_gui.cpp b/src/date_gui.cpp index 22fbc2085b..85e9fcb7a5 100644 --- a/src/date_gui.cpp +++ b/src/date_gui.cpp @@ -146,11 +146,6 @@ struct SetDateWindow : Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnClick(Point pt, int widget, int click_count) { switch (widget) { diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index a89312815c..a0c676a050 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -225,11 +225,6 @@ struct BuildDocksToolbarWindow : Window { WIDGET_LIST_END); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnClick(Point pt, int widget, int click_count) { this->last_clicked_widget = (DockToolbarWidgets)widget; diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index b2bed8cff7..3fd30efd75 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -72,11 +72,6 @@ struct EnginePreviewWindow : Window { this->InitNested(desc, window_number); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != EPW_QUESTION) return; diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index f28306c2a3..c16742fa37 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -1239,11 +1239,6 @@ struct GenerateProgressWindow : public Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index f646bb3180..e5389a51aa 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -61,11 +61,6 @@ struct GraphLegendWindow : Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void DrawWidget(const Rect &r, int widget) const { if (!IsInsideMM(widget, GLW_FIRST_COMPANY, MAX_COMPANIES + GLW_FIRST_COMPANY)) return; @@ -490,11 +485,6 @@ protected: } public: - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != this->graph_widget) return; @@ -1394,12 +1384,6 @@ struct PerformanceRatingDetailWindow : Window { } } - virtual void OnPaint() - { - /* Draw standard stuff */ - this->DrawWidgets(); - } - virtual void DrawWidget(const Rect &r, int widget) const { /* No need to draw when there's nothing to draw */ diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index b574cee061..4f9aecaeca 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -470,11 +470,6 @@ public: } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnClick(Point pt, int widget, int click_count) { switch (widget) { @@ -1234,11 +1229,6 @@ public: if (widget == IDW_DROPDOWN_CRITERIA) SetDParam(0, IndustryDirectoryWindow::sorter_names[this->industries.SortType()]); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void DrawWidget(const Rect &r, int widget) const { switch (widget) { @@ -2585,11 +2575,6 @@ struct IndustryCargoesWindow : public Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnResize() { this->vscroll->SetCapacityFromWidget(this, ICW_PANEL); diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index 9c0b6ce544..abd35de764 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -65,11 +65,6 @@ struct SelectGameWindow : public Window { this->SetWidgetLoweredState(SGI_TOYLAND_LANDSCAPE, _settings_newgame.game_creation.landscape == LT_TOYLAND); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void SetStringParameters(int widget) const { if (widget == SGI_DIFFICULTIES) SetDParam(0, STR_DIFFICULTY_LEVEL_EASY + _settings_newgame.difficulty.diff_level); diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 4316adc7d9..8721d8e803 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -79,11 +79,6 @@ public: char landinfo_data[LAND_INFO_LINE_END][LAND_INFO_LINE_BUFF_SIZE]; TileIndex tile; - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void DrawWidget(const Rect &r, int widget) const { if (widget != LIW_BACKGROUND) return; @@ -473,11 +468,6 @@ struct AboutWindow : public Window { *size = maxdim(*size, d); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void DrawWidget(const Rect &r, int widget) const { if (widget != AW_SCROLLING_TEXT) return; @@ -641,11 +631,6 @@ public: return pt; } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnInvalidateData(int data) { /* If company gets shut down, while displaying an error about it, remove the error message. */ @@ -896,12 +881,6 @@ struct TooltipsWindow : public Window DrawStringMultiLine(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, r.bottom - WD_FRAMERECT_BOTTOM, this->string_id, TC_FROMSTRING, SA_CENTER); } - - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnMouseLoop() { /* Always close tooltips when the cursor is not in our window. */ @@ -1520,11 +1499,6 @@ struct QueryWindow : public Window { DrawStringMultiLine(r.left, r.right, r.top, r.bottom, this->message, TC_FROMSTRING, SA_CENTER); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnClick(Point pt, int widget, int click_count) { switch (widget) { diff --git a/src/music_gui.cpp b/src/music_gui.cpp index 740744e3e5..9f2e49f58c 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -396,11 +396,6 @@ struct MusicTrackSelectionWindow : public Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnClick(Point pt, int widget, int click_count) { switch (widget) { @@ -642,11 +637,6 @@ struct MusicWindow : public Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnInvalidateData(int data = 0) { for (int i = 0; i < 6; i++) { diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 8e5214ebc9..44b37cc4ac 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -138,11 +138,6 @@ public: _network_content_client.RemoveCallback(this); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void DrawWidget(const Rect &r, int widget) const { if (widget != NCDSWW_BACKGROUND) return; diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 6db9f5d1be..6b1c15da7e 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -1937,11 +1937,6 @@ struct NetworkClientListPopupWindow : Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnMouseLoop() { /* We selected an action */ @@ -2163,11 +2158,6 @@ struct NetworkJoinStatusWindow : Window { this->InitNested(desc, 0); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void DrawWidget(const Rect &r, int widget) const { if (widget != NJSW_BACKGROUND) return; diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index 8b2b4bf96a..8504094ad7 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -416,11 +416,6 @@ struct NewGRFInspectWindow : Window { const_cast(this)->vscroll->SetCount(i); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnClick(Point pt, int widget, int click_count) { switch (widget) { @@ -657,11 +652,6 @@ struct SpriteAlignerWindow : Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnClick(Point pt, int widget, int click_count) { switch (widget) { diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 864b2a6006..343c30df9b 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -217,11 +217,6 @@ struct NewGRFParametersWindow : public Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void SetStringParameters(int widget) const { switch (widget) { diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 03033beae5..e848f3dd55 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -348,11 +348,6 @@ struct NewsWindow : Window { return pt; } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { StringID str = STR_NULL; @@ -1136,11 +1131,6 @@ struct MessageOptionsWindow : Window { this->SetWidgetDisabledState(element + WIDGET_NEWSOPT_START_OPTION + 2, value == 2); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void DrawWidget(const Rect &r, int widget) const { if (widget >= WIDGET_NEWSOPT_START_OPTION && widget < WIDGET_NEWSOPT_END_OPTION && (widget - WIDGET_NEWSOPT_START_OPTION) % MOS_WIDG_PER_SETTING == 1) { diff --git a/src/object_gui.cpp b/src/object_gui.cpp index f54492caf4..a56fc051f9 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -205,11 +205,6 @@ public: } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - void SelectOtherObject(int object_index) { _selected_object_index = object_index; diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 78301c0e25..b76067a41d 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -717,11 +717,6 @@ struct BuildRailToolbarWindow : Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnClick(Point pt, int widget, int click_count) { if (widget >= RTW_BUILD_NS) { @@ -1544,11 +1539,6 @@ public: } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void DrawWidget(const Rect &r, int widget) const { if (IsInsideMM(widget, BSW_SEMAPHORE_NORM, BSW_ELECTRIC_PBS_OWAY + 1)) { @@ -1689,11 +1679,6 @@ struct BuildRailDepotWindow : public PickerWindowBase { this->LowerWidget(_build_depot_direction + BRDW_DEPOT_NE); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void DrawWidget(const Rect &r, int widget) const { if (!IsInsideMM(widget, BRDW_DEPOT_NE, BRDW_DEPOT_NW + 1)) return; diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 71a568fcaa..1902123a91 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -527,11 +527,6 @@ struct BuildRoadToolbarWindow : Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnClick(Point pt, int widget, int click_count) { if (widget >= RTW_ROAD_X) { @@ -880,11 +875,6 @@ struct BuildRoadDepotWindow : public PickerWindowBase { this->FinishInitNested(desc, TRANSPORT_ROAD); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void DrawWidget(const Rect &r, int widget) const { if (!IsInsideMM(widget, BRDW_DEPOT_NE, BRDW_DEPOT_NW + 1)) return; diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 8d58d52463..c0f75b9c57 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -202,11 +202,6 @@ struct GameOptionsWindow : Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void DrawWidget(const Rect &r, int widget) const { switch (widget) { @@ -627,11 +622,6 @@ public: } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnClick(Point pt, int widget, int click_count) { if (widget >= GDW_OPTIONS_START) { @@ -1555,11 +1545,6 @@ struct GameSettingsWindow : Window { this->vscroll->GetPosition(), this->vscroll->GetPosition() + this->vscroll->GetCapacity()); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnClick(Point pt, int widget, int click_count) { if (widget != SETTINGSEL_OPTIONSPANEL) return; @@ -1840,11 +1825,6 @@ struct CustomCurrencyWindow : Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnClick(Point pt, int widget, int click_count) { int line = 0; diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 6d7184b3ec..e63c3cc10f 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1130,11 +1130,6 @@ public: } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - /** * Select a new map type. * @param map_type New map type. diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 41194e4b4d..12a103ee37 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -1393,11 +1393,6 @@ struct SelectStationWindow : Window { *size = d; } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void DrawWidget(const Rect &r, int widget) const { if (widget != JSW_PANEL) return; diff --git a/src/statusbar_gui.cpp b/src/statusbar_gui.cpp index 80efb18052..11feeaec0f 100644 --- a/src/statusbar_gui.cpp +++ b/src/statusbar_gui.cpp @@ -104,11 +104,6 @@ struct StatusBarWindow : Window { return pt; } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { Dimension d; diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp index d6fed1c3e7..0b9182fdd2 100644 --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -106,11 +106,6 @@ struct SubsidyListWindow : Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - /** * Count the number of lines in this window. * @return the number of lines diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 349e539baf..5f4d15a44f 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -245,12 +245,6 @@ struct TerraformToolbarWindow : Window { show_object->SetDisplayedPlane(ObjectClass::GetCount() != 0 ? 0 : SZSP_NONE); } - - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnClick(Point pt, int widget, int click_count) { if (widget >= TTW_BUTTONS_START) _terraform_button_proc[widget - TTW_BUTTONS_START](this); diff --git a/src/town_gui.cpp b/src/town_gui.cpp index c3bf703121..7da0528a1e 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -338,11 +338,6 @@ public: this->SetWidgetDisabledState(TVW_CHANGENAME, _networking && !_network_server); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void SetStringParameters(int widget) const { if (widget == TVW_CAPTION) SetDParam(0, this->town->index); @@ -734,11 +729,6 @@ public: this->last_sorting = this->towns.GetListing(); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void SetStringParameters(int widget) const { if (widget == TDW_BOTTOM_TEXT) SetDParam(0, GetWorldPopulation()); diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 4ba023809c..46a4f1b8f4 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -513,11 +513,6 @@ struct RefitWindow : public Window { } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { diff --git a/src/viewport_gui.cpp b/src/viewport_gui.cpp index 9d74a3369d..ef831af39f 100644 --- a/src/viewport_gui.cpp +++ b/src/viewport_gui.cpp @@ -97,11 +97,6 @@ public: } } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnClick(Point pt, int widget, int click_count) { switch (widget) { diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp index 070e4eea7d..b766a81f20 100644 --- a/src/waypoint_gui.cpp +++ b/src/waypoint_gui.cpp @@ -88,11 +88,6 @@ public: if (widget == WAYPVW_CAPTION) SetDParam(0, this->wp->index); } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void OnClick(Point pt, int widget, int click_count) { switch (widget) { diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index 80b06e6f5a..67dca1cd4f 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -219,11 +219,6 @@ struct DropdownWindow : Window { return false; } - virtual void OnPaint() - { - this->DrawWidgets(); - } - virtual void DrawWidget(const Rect &r, int widget) const { if (widget != DDM_ITEMS) return; diff --git a/src/window_gui.h b/src/window_gui.h index d6ef9a0558..b69f012943 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -460,7 +460,10 @@ public: * The window must be repainted. * @note This method should not change any state, it should only use drawing functions. */ - virtual void OnPaint() {} + virtual void OnPaint() + { + this->DrawWidgets(); + } /** * Draw the contents of a nested widget.