Codechange: Use override specifier in Window-derived classes.
This commit is contained in:
@@ -363,14 +363,14 @@ struct NewGRFInspectWindow : Window {
|
||||
this->OnInvalidateData(0, true);
|
||||
}
|
||||
|
||||
virtual void SetStringParameters(int widget) const
|
||||
void SetStringParameters(int widget) const override
|
||||
{
|
||||
if (widget != WID_NGRFI_CAPTION) return;
|
||||
|
||||
GetFeatureHelper(this->window_number)->SetStringParameters(this->GetFeatureIndex());
|
||||
}
|
||||
|
||||
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_NGRFI_VEH_CHAIN: {
|
||||
@@ -410,7 +410,7 @@ struct NewGRFInspectWindow : Window {
|
||||
::DrawString(r.left + LEFT_OFFSET, r.right - RIGHT_OFFSET, r.top + TOP_OFFSET + (offset * this->resize.step_height), buf, TC_BLACK);
|
||||
}
|
||||
|
||||
virtual void DrawWidget(const Rect &r, int widget) const
|
||||
void DrawWidget(const Rect &r, int widget) const override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_NGRFI_VEH_CHAIN: {
|
||||
@@ -550,7 +550,7 @@ struct NewGRFInspectWindow : Window {
|
||||
const_cast<NewGRFInspectWindow*>(this)->vscroll->SetCount(i);
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
void OnClick(Point pt, int widget, int click_count) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_NGRFI_PARENT: {
|
||||
@@ -600,7 +600,7 @@ struct NewGRFInspectWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnQueryTextFinished(char *str)
|
||||
void OnQueryTextFinished(char *str) override
|
||||
{
|
||||
if (StrEmpty(str)) return;
|
||||
|
||||
@@ -608,7 +608,7 @@ struct NewGRFInspectWindow : Window {
|
||||
this->SetDirty();
|
||||
}
|
||||
|
||||
virtual void OnResize()
|
||||
void OnResize() override
|
||||
{
|
||||
this->vscroll->SetCapacityFromWidget(this, WID_NGRFI_MAINPANEL, TOP_OFFSET + BOTTOM_OFFSET);
|
||||
}
|
||||
@@ -618,7 +618,7 @@ struct NewGRFInspectWindow : 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;
|
||||
if (this->HasChainIndex()) {
|
||||
@@ -822,7 +822,7 @@ struct SpriteAlignerWindow : Window {
|
||||
while (GetSpriteType(this->current_sprite) != ST_NORMAL) this->current_sprite++;
|
||||
}
|
||||
|
||||
virtual void SetStringParameters(int widget) const
|
||||
void SetStringParameters(int widget) const override
|
||||
{
|
||||
const Sprite *spr = GetSprite(this->current_sprite, ST_NORMAL);
|
||||
switch (widget) {
|
||||
@@ -856,7 +856,7 @@ struct SpriteAlignerWindow : 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
|
||||
{
|
||||
if (widget != WID_SA_LIST) return;
|
||||
|
||||
@@ -867,7 +867,7 @@ struct SpriteAlignerWindow : Window {
|
||||
size->height = (1 + 200 / resize->height) * resize->height;
|
||||
}
|
||||
|
||||
virtual void DrawWidget(const Rect &r, int widget) const
|
||||
void DrawWidget(const Rect &r, int widget) const override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_SA_SPRITE: {
|
||||
@@ -908,7 +908,7 @@ struct SpriteAlignerWindow : 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_SA_PREVIOUS:
|
||||
@@ -992,7 +992,7 @@ struct SpriteAlignerWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnQueryTextFinished(char *str)
|
||||
void OnQueryTextFinished(char *str) override
|
||||
{
|
||||
if (StrEmpty(str)) return;
|
||||
|
||||
@@ -1009,7 +1009,7 @@ struct SpriteAlignerWindow : 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;
|
||||
if (data == 1) {
|
||||
@@ -1019,7 +1019,7 @@ struct SpriteAlignerWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnResize()
|
||||
void OnResize() override
|
||||
{
|
||||
this->vscroll->SetCapacityFromWidget(this, WID_SA_LIST);
|
||||
}
|
||||
|
Reference in New Issue
Block a user