Codechange: Use override specifier in Window-derived classes.
This commit is contained in:
@@ -605,7 +605,7 @@ struct RefitWindow : public Window {
|
||||
this->SetWidgetDisabledState(WID_VR_REFIT, this->sel[0] < 0);
|
||||
}
|
||||
|
||||
virtual void OnInit()
|
||||
void OnInit() override
|
||||
{
|
||||
if (this->cargo != NULL) {
|
||||
/* Store the RefitOption currently in use. */
|
||||
@@ -635,7 +635,7 @@ struct RefitWindow : public Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnPaint()
|
||||
void OnPaint() override
|
||||
{
|
||||
/* Determine amount of items for scroller. */
|
||||
if (this->hscroll != NULL) this->hscroll->SetCount(this->vehicle_width);
|
||||
@@ -656,7 +656,7 @@ struct RefitWindow : public Window {
|
||||
this->DrawWidgets();
|
||||
}
|
||||
|
||||
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_VR_MATRIX:
|
||||
@@ -674,7 +674,7 @@ struct RefitWindow : public Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void SetStringParameters(int widget) const
|
||||
void SetStringParameters(int widget) const override
|
||||
{
|
||||
if (widget == WID_VR_CAPTION) SetDParam(0, Vehicle::Get(this->window_number)->index);
|
||||
}
|
||||
@@ -726,7 +726,7 @@ struct RefitWindow : public Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void DrawWidget(const Rect &r, int widget) const
|
||||
void DrawWidget(const Rect &r, int widget) const override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_VR_VEHICLE_PANEL_DISPLAY: {
|
||||
@@ -808,7 +808,7 @@ struct RefitWindow : public 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
|
||||
{
|
||||
switch (data) {
|
||||
case VIWD_AUTOREPLACE: // Autoreplace replaced the vehicle; selected_vehicle became invalid.
|
||||
@@ -916,7 +916,7 @@ struct RefitWindow : public Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
void OnClick(Point pt, int widget, int click_count) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_VR_VEHICLE_PANEL_DISPLAY: { // Vehicle image.
|
||||
@@ -958,7 +958,7 @@ struct RefitWindow : public Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnMouseDrag(Point pt, int widget)
|
||||
void OnMouseDrag(Point pt, int widget) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_VR_VEHICLE_PANEL_DISPLAY: { // Vehicle image.
|
||||
@@ -971,7 +971,7 @@ struct RefitWindow : public Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnDragDrop(Point pt, int widget)
|
||||
void OnDragDrop(Point pt, int widget) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_VR_VEHICLE_PANEL_DISPLAY: { // Vehicle image.
|
||||
@@ -984,7 +984,7 @@ struct RefitWindow : public Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnResize()
|
||||
void OnResize() override
|
||||
{
|
||||
this->vehicle_width = GetVehicleWidth(Vehicle::Get(this->window_number), EIT_IN_DETAILS);
|
||||
this->vscroll->SetCapacityFromWidget(this, WID_VR_MATRIX);
|
||||
@@ -1485,7 +1485,7 @@ public:
|
||||
*this->sorting = this->vehicles.GetListing();
|
||||
}
|
||||
|
||||
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_VL_LIST:
|
||||
@@ -1522,7 +1522,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void SetStringParameters(int widget) const
|
||||
void SetStringParameters(int widget) const override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_VL_AVAILABLE_VEHICLES:
|
||||
@@ -1565,7 +1565,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void DrawWidget(const Rect &r, int widget) const
|
||||
void DrawWidget(const Rect &r, int widget) const override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_VL_SORT_ORDER:
|
||||
@@ -1579,7 +1579,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnPaint()
|
||||
void OnPaint() override
|
||||
{
|
||||
this->BuildVehicleList();
|
||||
this->SortVehicleList();
|
||||
@@ -1611,7 +1611,7 @@ public:
|
||||
this->DrawWidgets();
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
void OnClick(Point pt, int widget, int click_count) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_VL_SORT_ORDER: // Flip sorting method ascending/descending
|
||||
@@ -1650,7 +1650,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnDropdownSelect(int widget, int index)
|
||||
void OnDropdownSelect(int widget, int index) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_VL_SORT_BY_PULLDOWN:
|
||||
@@ -1676,7 +1676,7 @@ public:
|
||||
this->SetDirty();
|
||||
}
|
||||
|
||||
virtual void OnGameTick()
|
||||
void OnGameTick() override
|
||||
{
|
||||
if (this->vehicles.NeedResort()) {
|
||||
StationID station = (this->vli.type == VL_STATION_LIST) ? this->vli.index : INVALID_STATION;
|
||||
@@ -1686,7 +1686,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnResize()
|
||||
void OnResize() override
|
||||
{
|
||||
this->vscroll->SetCapacityFromWidget(this, WID_VL_LIST);
|
||||
}
|
||||
@@ -1696,7 +1696,7 @@ public:
|
||||
* @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 && HasBit(data, 31) && this->vli.type == VL_SHARED_ORDERS) {
|
||||
/* Needs to be done in command-scope, so everything stays valid */
|
||||
@@ -1886,7 +1886,7 @@ struct VehicleDetailsWindow : 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 (data == VIWD_AUTOREPLACE) {
|
||||
/* Autoreplace replaced the vehicle.
|
||||
@@ -1926,7 +1926,7 @@ struct VehicleDetailsWindow : Window {
|
||||
return desired_height;
|
||||
}
|
||||
|
||||
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_VD_TOP_DETAILS: {
|
||||
@@ -2030,12 +2030,12 @@ struct VehicleDetailsWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void SetStringParameters(int widget) const
|
||||
void SetStringParameters(int widget) const override
|
||||
{
|
||||
if (widget == WID_VD_CAPTION) SetDParam(0, Vehicle::Get(this->window_number)->index);
|
||||
}
|
||||
|
||||
virtual void DrawWidget(const Rect &r, int widget) const
|
||||
void DrawWidget(const Rect &r, int widget) const override
|
||||
{
|
||||
const Vehicle *v = Vehicle::Get(this->window_number);
|
||||
|
||||
@@ -2133,7 +2133,7 @@ struct VehicleDetailsWindow : Window {
|
||||
}
|
||||
|
||||
/** Repaint vehicle details window. */
|
||||
virtual void OnPaint()
|
||||
void OnPaint() override
|
||||
{
|
||||
const Vehicle *v = Vehicle::Get(this->window_number);
|
||||
|
||||
@@ -2158,7 +2158,7 @@ struct VehicleDetailsWindow : Window {
|
||||
this->DrawWidgets();
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
void OnClick(Point pt, int widget, int click_count) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_VD_RENAME_VEHICLE: { // rename
|
||||
@@ -2206,7 +2206,7 @@ struct VehicleDetailsWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnDropdownSelect(int widget, int index)
|
||||
void OnDropdownSelect(int widget, int index) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_VD_SERVICE_INTERVAL_DROPDOWN: {
|
||||
@@ -2220,14 +2220,14 @@ struct VehicleDetailsWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnQueryTextFinished(char *str)
|
||||
void OnQueryTextFinished(char *str) override
|
||||
{
|
||||
if (str == NULL) return;
|
||||
|
||||
DoCommandP(0, this->window_number, 0, CMD_RENAME_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_RENAME_TRAIN + Vehicle::Get(this->window_number)->type), NULL, str);
|
||||
}
|
||||
|
||||
virtual void OnResize()
|
||||
void OnResize() override
|
||||
{
|
||||
NWidgetCore *nwi = this->GetWidget<NWidgetCore>(WID_VD_MATRIX);
|
||||
if (nwi != NULL) {
|
||||
@@ -2515,7 +2515,7 @@ public:
|
||||
DeleteWindowById(WC_VEHICLE_TIMETABLE, this->window_number, false);
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
const Vehicle *v = Vehicle::Get(this->window_number);
|
||||
switch (widget) {
|
||||
@@ -2537,7 +2537,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnPaint()
|
||||
void OnPaint() override
|
||||
{
|
||||
const Vehicle *v = Vehicle::Get(this->window_number);
|
||||
bool is_localcompany = v->owner == _local_company;
|
||||
@@ -2556,7 +2556,7 @@ public:
|
||||
this->DrawWidgets();
|
||||
}
|
||||
|
||||
virtual void SetStringParameters(int widget) const
|
||||
void SetStringParameters(int widget) const override
|
||||
{
|
||||
if (widget != WID_VV_CAPTION) return;
|
||||
|
||||
@@ -2564,7 +2564,7 @@ public:
|
||||
SetDParam(0, v->index);
|
||||
}
|
||||
|
||||
virtual void DrawWidget(const Rect &r, int widget) const
|
||||
void DrawWidget(const Rect &r, int widget) const override
|
||||
{
|
||||
if (widget != WID_VV_START_STOP) return;
|
||||
|
||||
@@ -2663,7 +2663,7 @@ public:
|
||||
DrawString(text_left + lowered, text_right + lowered, r.top + WD_FRAMERECT_TOP + lowered, str, TC_FROMSTRING, SA_HOR_CENTER);
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
void OnClick(Point pt, int widget, int click_count) override
|
||||
{
|
||||
const Vehicle *v = Vehicle::Get(this->window_number);
|
||||
|
||||
@@ -2726,7 +2726,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnResize()
|
||||
void OnResize() override
|
||||
{
|
||||
if (this->viewport != NULL) {
|
||||
NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(WID_VV_VIEWPORT);
|
||||
@@ -2764,7 +2764,7 @@ public:
|
||||
* @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 (data == VIWD_AUTOREPLACE) {
|
||||
/* Autoreplace replaced the vehicle.
|
||||
@@ -2775,12 +2775,12 @@ public:
|
||||
this->UpdateButtonStatus();
|
||||
}
|
||||
|
||||
virtual bool IsNewGRFInspectable() const
|
||||
bool IsNewGRFInspectable() const override
|
||||
{
|
||||
return ::IsNewGRFInspectable(GetGrfSpecFeature(Vehicle::Get(this->window_number)->type), this->window_number);
|
||||
}
|
||||
|
||||
virtual void ShowNewGRFInspectWindow() const
|
||||
void ShowNewGRFInspectWindow() const override
|
||||
{
|
||||
::ShowNewGRFInspectWindow(GetGrfSpecFeature(Vehicle::Get(this->window_number)->type), this->window_number);
|
||||
}
|
||||
|
Reference in New Issue
Block a user