diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -422,7 +422,7 @@ public: this->SetupArrays(); } - void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override + void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override { switch (widget) { case WID_DPI_MATRIX_WIDGET: { @@ -494,7 +494,7 @@ public: } } - void SetStringParameters(int widget) const override + void SetStringParameters(WidgetID widget) const override { switch (widget) { case WID_DPI_FUND_WIDGET: @@ -515,7 +515,7 @@ public: } } - void DrawWidget(const Rect &r, int widget) const override + void DrawWidget(const Rect &r, WidgetID widget) const override { switch (widget) { case WID_DPI_MATRIX_WIDGET: { @@ -626,7 +626,7 @@ public: MarkWholeScreenDirty(); } - void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override + void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override { switch (widget) { case WID_DPI_CREATE_RANDOM_INDUSTRIES_WIDGET: { @@ -981,17 +981,17 @@ public: return ir.top - 1 + WidgetDimensions::scaled.framerect.bottom; } - void SetStringParameters(int widget) const override + void SetStringParameters(WidgetID widget) const override { if (widget == WID_IV_CAPTION) SetDParam(0, this->window_number); } - void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override + void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override { if (widget == WID_IV_INFO) size->height = this->info_height; } - void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override + void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override { switch (widget) { case WID_IV_INFO: { @@ -1646,7 +1646,7 @@ public: this->SetCargoFilterArray(); } - void SetStringParameters(int widget) const override + void SetStringParameters(WidgetID widget) const override { switch (widget) { case WID_ID_DROPDOWN_CRITERIA: @@ -1663,7 +1663,7 @@ public: } } - void DrawWidget(const Rect &r, int widget) const override + void DrawWidget(const Rect &r, WidgetID widget) const override { switch (widget) { case WID_ID_DROPDOWN_ORDER: @@ -1709,7 +1709,7 @@ public: } } - void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override + void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override { switch (widget) { case WID_ID_DROPDOWN_ORDER: { @@ -1761,7 +1761,7 @@ public: return list; } - void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override + void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override { switch (widget) { case WID_ID_DROPDOWN_ORDER: @@ -1795,7 +1795,7 @@ public: } } - void OnDropdownSelect(int widget, int index) override + void OnDropdownSelect(WidgetID widget, int index) override { switch (widget) { case WID_ID_DROPDOWN_CRITERIA: { @@ -1826,7 +1826,7 @@ public: this->hscroll->SetCapacityFromWidget(this, WID_ID_INDUSTRY_LIST); } - void OnEditboxChanged(int wid) override + void OnEditboxChanged(WidgetID wid) override { if (wid == WID_ID_FILTER) { this->string_filter.SetFilterTerm(this->industry_editbox.text.buf); @@ -2626,7 +2626,7 @@ struct IndustryCargoesWindow : public Wi CargoesField::cargo_field_width = CargoesField::cargo_border.width * 2 + CargoesField::cargo_line.width * CargoesField::max_cargoes + CargoesField::cargo_space.width * (CargoesField::max_cargoes - 1); } - void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override + void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override { switch (widget) { case WID_IC_PANEL: @@ -2647,7 +2647,7 @@ struct IndustryCargoesWindow : public Wi CargoesFieldType type; ///< Type of field. - void SetStringParameters (int widget) const override + void SetStringParameters (WidgetID widget) const override { if (widget != WID_IC_CAPTION) return; @@ -2976,7 +2976,7 @@ struct IndustryCargoesWindow : public Wi this->ComputeIndustryDisplay(data); } - void DrawWidget(const Rect &r, int widget) const override + void DrawWidget(const Rect &r, WidgetID widget) const override { if (widget != WID_IC_PANEL) return; @@ -3061,7 +3061,7 @@ struct IndustryCargoesWindow : public Wi return true; } - void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override + void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override { switch (widget) { case WID_IC_PANEL: { @@ -3134,7 +3134,7 @@ struct IndustryCargoesWindow : public Wi } } - void OnDropdownSelect(int widget, int index) override + void OnDropdownSelect(WidgetID widget, int index) override { if (index < 0) return; @@ -3149,7 +3149,7 @@ struct IndustryCargoesWindow : public Wi } } - bool OnTooltip([[maybe_unused]] Point pt, int widget, TooltipCloseCondition close_cond) override + bool OnTooltip([[maybe_unused]] Point pt, WidgetID widget, TooltipCloseCondition close_cond) override { if (widget != WID_IC_PANEL) return false;