Codechange: Use override specifier in Window-derived classes.

This commit is contained in:
peter1138
2019-03-04 07:49:37 +00:00
committed by Michael Lutz
parent aafce47596
commit 317f69c152
54 changed files with 765 additions and 765 deletions

View File

@@ -1100,7 +1100,7 @@ struct BuildVehicleWindow : Window {
this->eng_list.SetFilterState(this->cargo_filter[this->cargo_filter_criteria] != CF_ANY);
}
void OnInit()
void OnInit() override
{
this->SetCargoFilterArray();
}
@@ -1272,7 +1272,7 @@ struct BuildVehicleWindow : Window {
this->eng_list.RebuildDone();
}
void OnClick(Point pt, int widget, int click_count)
void OnClick(Point pt, int widget, int click_count) override
{
switch (widget) {
case WID_BV_SORT_ASCENDING_DESCENDING:
@@ -1345,7 +1345,7 @@ struct BuildVehicleWindow : Window {
* @param data Information about the changed data.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
void OnInvalidateData(int data = 0, bool gui_scope = true) override
{
if (!gui_scope) return;
/* When switching to original acceleration model for road vehicles, clear the selected sort criteria if it is not available now. */
@@ -1358,7 +1358,7 @@ struct BuildVehicleWindow : Window {
this->eng_list.ForceRebuild();
}
virtual void SetStringParameters(int widget) const
void SetStringParameters(int widget) const override
{
switch (widget) {
case WID_BV_CAPTION:
@@ -1390,7 +1390,7 @@ struct BuildVehicleWindow : Window {
}
}
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
switch (widget) {
case WID_BV_LIST:
@@ -1420,7 +1420,7 @@ struct BuildVehicleWindow : Window {
}
}
virtual void DrawWidget(const Rect &r, int widget) const
void DrawWidget(const Rect &r, int widget) const override
{
switch (widget) {
case WID_BV_LIST:
@@ -1433,7 +1433,7 @@ struct BuildVehicleWindow : Window {
}
}
virtual void OnPaint()
void OnPaint() override
{
this->GenerateBuildList();
this->vscroll->SetCount(this->eng_list.Length());
@@ -1460,14 +1460,14 @@ struct BuildVehicleWindow : Window {
}
}
virtual void OnQueryTextFinished(char *str)
void OnQueryTextFinished(char *str) override
{
if (str == NULL) return;
DoCommandP(0, this->rename_engine, 0, CMD_RENAME_ENGINE | CMD_MSG(STR_ERROR_CAN_T_RENAME_TRAIN_TYPE + this->vehicle_type), NULL, str);
}
virtual void OnDropdownSelect(int widget, int index)
void OnDropdownSelect(int widget, int index) override
{
switch (widget) {
case WID_BV_SORT_DROPDOWN:
@@ -1491,7 +1491,7 @@ struct BuildVehicleWindow : Window {
this->SetDirty();
}
virtual void OnResize()
void OnResize() override
{
this->vscroll->SetCapacityFromWidget(this, WID_BV_LIST);
}