From 55e607494294f68cc34d4e0511689d60c20ab78f Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sat, 9 Mar 2019 20:42:54 -0500 Subject: [PATCH] use override in all possible places --- generator.py | 2 +- src/Activity.h | 6 +- src/debug/DebugLines.h | 2 +- src/debug/DebugParts.h | 2 +- src/debug/ElementPopulation.h | 2 +- src/debug/ParticleDebug.h | 2 +- src/gui/colourpicker/ColourPickerActivity.cpp | 4 +- src/gui/colourpicker/ColourPickerActivity.h | 12 +-- src/gui/console/ConsoleView.cpp | 2 +- src/gui/dialogues/ConfirmPrompt.cpp | 6 +- src/gui/dialogues/ConfirmPrompt.h | 2 +- src/gui/dialogues/ErrorMessage.cpp | 4 +- src/gui/dialogues/ErrorMessage.h | 2 +- src/gui/dialogues/InformationMessage.cpp | 2 +- src/gui/dialogues/InformationMessage.h | 2 +- src/gui/dialogues/SaveIDMessage.cpp | 2 +- src/gui/dialogues/SaveIDMessage.h | 4 +- src/gui/dialogues/TextPrompt.cpp | 4 +- src/gui/dialogues/TextPrompt.h | 2 +- .../elementsearch/ElementSearchActivity.cpp | 8 +- src/gui/elementsearch/ElementSearchActivity.h | 10 +-- src/gui/filebrowser/FileBrowserActivity.cpp | 14 ++-- src/gui/filebrowser/FileBrowserActivity.h | 16 ++-- src/gui/font/FontEditor.cpp | 18 ++--- src/gui/font/FontEditor.h | 6 +- src/gui/game/BitmapBrush.h | 2 +- src/gui/game/DecorationTool.h | 8 +- src/gui/game/EllipseBrush.h | 2 +- src/gui/game/GameController.cpp | 30 ++++---- src/gui/game/GameController.h | 6 +- src/gui/game/GameModelException.h | 4 +- src/gui/game/GameView.cpp | 66 ++++++++-------- src/gui/game/GameView.h | 38 +++++----- src/gui/game/PropertyTool.cpp | 10 +-- src/gui/game/QuickOptions.h | 24 +++--- src/gui/game/SignTool.cpp | 42 ++++++---- src/gui/game/Tool.h | 76 +++++++++---------- src/gui/game/ToolButton.h | 8 +- src/gui/game/TriangleBrush.h | 2 +- src/gui/interface/ContextMenu.cpp | 2 +- src/gui/interface/DropDown.cpp | 6 +- src/gui/interface/Engine.cpp | 2 +- src/gui/interface/Panel.h | 30 ++++---- src/gui/interface/Textbox.h | 4 +- .../localbrowser/LocalBrowserController.cpp | 8 +- src/gui/localbrowser/LocalBrowserView.cpp | 12 +-- src/gui/localbrowser/LocalBrowserView.h | 8 +- src/gui/login/LoginView.cpp | 4 +- src/gui/login/LoginView.h | 8 +- src/gui/options/OptionsView.cpp | 52 +++++++++---- src/gui/options/OptionsView.h | 4 +- src/gui/preview/PreviewController.h | 2 +- src/gui/preview/PreviewModelException.h | 4 +- src/gui/preview/PreviewView.cpp | 18 ++--- src/gui/preview/PreviewView.h | 14 ++-- src/gui/profile/ProfileActivity.cpp | 8 +- src/gui/profile/ProfileActivity.h | 6 +- src/gui/render/RenderView.cpp | 8 +- src/gui/render/RenderView.h | 12 +-- src/gui/save/LocalSaveActivity.cpp | 6 +- src/gui/save/LocalSaveActivity.h | 6 +- src/gui/save/ServerSaveActivity.cpp | 18 ++--- src/gui/save/ServerSaveActivity.h | 16 ++-- src/gui/search/SearchController.cpp | 14 ++-- src/gui/search/SearchView.cpp | 32 ++++---- src/gui/search/SearchView.h | 14 ++-- src/gui/tags/TagsView.cpp | 6 +- src/gui/tags/TagsView.h | 4 +- src/gui/update/UpdateActivity.cpp | 8 +- src/json/json.h | 8 +- src/json/jsoncpp.cpp | 8 +- src/lua/LuaButton.cpp | 2 +- src/lua/LuaCheckbox.cpp | 2 +- src/lua/LuaScriptInterface.h | 12 +-- src/lua/LuaSlider.cpp | 2 +- src/lua/LuaTextbox.cpp | 2 +- src/lua/LuaWindow.cpp | 28 +++---- src/lua/TPTScriptInterface.h | 5 +- src/simulation/CoordStack.h | 2 +- src/tasks/AbandonableTask.h | 4 +- src/tasks/Task.h | 4 +- src/tasks/TaskWindow.h | 14 ++-- 82 files changed, 457 insertions(+), 426 deletions(-) diff --git a/generator.py b/generator.py index eb105625e..ecc133cf2 100644 --- a/generator.py +++ b/generator.py @@ -194,7 +194,7 @@ class {0}: public SimTool public: {0}(); virtual ~{0}(); - virtual int Perform(Simulation * sim, Particle * cpart, int x, int y, int brushX, int brushY, float strength); + int Perform(Simulation * sim, Particle * cpart, int x, int y, int brushX, int brushY, float strength) override; }}; """.format(className, str.join("\n", classMembers)) diff --git a/src/Activity.h b/src/Activity.h index 4bdc999fe..563314ae6 100644 --- a/src/Activity.h +++ b/src/Activity.h @@ -19,16 +19,16 @@ public: { Show(); } - virtual void Exit() + void Exit() override { Hide(); SelfDestruct(); } - virtual void Show() + void Show() override { MakeActiveWindow(); } - virtual void Hide() + void Hide() override { CloseActiveWindow(); } diff --git a/src/debug/DebugLines.h b/src/debug/DebugLines.h index c835aa36d..359810a8e 100644 --- a/src/debug/DebugLines.h +++ b/src/debug/DebugLines.h @@ -10,6 +10,6 @@ class DebugLines : public DebugInfo GameController * controller; public: DebugLines(unsigned int id, GameView * view, GameController * controller); - virtual void Draw(); + void Draw() override; virtual ~DebugLines(); }; diff --git a/src/debug/DebugParts.h b/src/debug/DebugParts.h index 77cd6d8df..e44bd87a9 100644 --- a/src/debug/DebugParts.h +++ b/src/debug/DebugParts.h @@ -8,6 +8,6 @@ class DebugParts : public DebugInfo Simulation * sim; public: DebugParts(unsigned int id, Simulation * sim); - virtual void Draw(); + void Draw() override; virtual ~DebugParts(); }; diff --git a/src/debug/ElementPopulation.h b/src/debug/ElementPopulation.h index 64de0674f..0728870b7 100644 --- a/src/debug/ElementPopulation.h +++ b/src/debug/ElementPopulation.h @@ -9,6 +9,6 @@ class ElementPopulationDebug : public DebugInfo float maxAverage; public: ElementPopulationDebug(unsigned int id, Simulation * sim); - virtual void Draw(); + void Draw() override; virtual ~ElementPopulationDebug(); }; diff --git a/src/debug/ParticleDebug.h b/src/debug/ParticleDebug.h index 19ef0d613..c6a3d3f36 100644 --- a/src/debug/ParticleDebug.h +++ b/src/debug/ParticleDebug.h @@ -12,7 +12,7 @@ class ParticleDebug : public DebugInfo public: ParticleDebug(unsigned int id, Simulation * sim, GameModel * model); void Debug(int mode, int x, int y); - virtual bool KeyPress(int key, int scan, bool shift, bool ctrl, bool alt, ui::Point currentMouse); + bool KeyPress(int key, int scan, bool shift, bool ctrl, bool alt, ui::Point currentMouse) override; virtual ~ParticleDebug(); }; diff --git a/src/gui/colourpicker/ColourPickerActivity.cpp b/src/gui/colourpicker/ColourPickerActivity.cpp index e99302b3c..9893bbb6f 100644 --- a/src/gui/colourpicker/ColourPickerActivity.cpp +++ b/src/gui/colourpicker/ColourPickerActivity.cpp @@ -25,7 +25,7 @@ ColourPickerActivity::ColourPickerActivity(ui::Colour initialColour, ColourPicke public: ColourChange(ColourPickerActivity * a) : a(a) {} - void TextChangedCallback(ui::Textbox * sender) + void TextChangedCallback(ui::Textbox * sender) override { int r, g, b, alpha; r = a->rValue->GetText().ToNumber(true); @@ -79,7 +79,7 @@ ColourPickerActivity::ColourPickerActivity(ui::Colour initialColour, ColourPicke ColourPickerActivity * a; public: OkayAction(ColourPickerActivity * a) : a(a) { } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { int Red, Green, Blue; Red = a->rValue->GetText().ToNumber(true); diff --git a/src/gui/colourpicker/ColourPickerActivity.h b/src/gui/colourpicker/ColourPickerActivity.h index 4aac2f726..8e2b4b845 100644 --- a/src/gui/colourpicker/ColourPickerActivity.h +++ b/src/gui/colourpicker/ColourPickerActivity.h @@ -33,12 +33,12 @@ class ColourPickerActivity: public WindowActivity { void UpdateTextboxes(int r, int g, int b, int a); public: - virtual void OnMouseMove(int x, int y, int dx, int dy); - virtual void OnMouseDown(int x, int y, unsigned button); - virtual void OnMouseUp(int x, int y, unsigned button); - virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); - virtual void OnTryExit(ExitMethod method); + void OnMouseMove(int x, int y, int dx, int dy) override; + void OnMouseDown(int x, int y, unsigned button) override; + void OnMouseUp(int x, int y, unsigned button) override; + void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; + void OnTryExit(ExitMethod method) override; ColourPickerActivity(ui::Colour initialColour, ColourPickedCallback * callback = NULL); virtual ~ColourPickerActivity(); - virtual void OnDraw(); + void OnDraw() override; }; diff --git a/src/gui/console/ConsoleView.cpp b/src/gui/console/ConsoleView.cpp index 984830946..fb1a0bc75 100644 --- a/src/gui/console/ConsoleView.cpp +++ b/src/gui/console/ConsoleView.cpp @@ -10,7 +10,7 @@ ConsoleView::ConsoleView(): ConsoleView * v; public: CommandHighlighter(ConsoleView * v_) { v = v_; } - virtual void TextChangedCallback(ui::Textbox * sender) + void TextChangedCallback(ui::Textbox * sender) override { sender->SetDisplayText(v->c->FormatCommand(sender->GetText())); } diff --git a/src/gui/dialogues/ConfirmPrompt.cpp b/src/gui/dialogues/ConfirmPrompt.cpp index f7ea37f8b..4b8a8efe4 100644 --- a/src/gui/dialogues/ConfirmPrompt.cpp +++ b/src/gui/dialogues/ConfirmPrompt.cpp @@ -39,7 +39,7 @@ ConfirmPrompt::ConfirmPrompt(String title, String message, ConfirmDialogueCallba ConfirmPrompt * prompt; DialogueResult result; CloseAction(ConfirmPrompt * prompt_, DialogueResult result_) { prompt = prompt_; result = result_; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { prompt->CloseActiveWindow(); if(prompt->callback) @@ -101,7 +101,7 @@ ConfirmPrompt::ConfirmPrompt(String title, String message, String buttonText, Co ConfirmPrompt * prompt; DialogueResult result; CloseAction(ConfirmPrompt * prompt_, DialogueResult result_) { prompt = prompt_; result = result_; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { prompt->CloseActiveWindow(); if(prompt->callback) @@ -136,7 +136,7 @@ bool ConfirmPrompt::Blocking(String title, String message, String buttonText) public: bool & outputResult; BlockingPromptCallback(bool & output): outputResult(output) {} - virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) { + void ConfirmCallback(ConfirmPrompt::DialogueResult result) override { if (result == ConfirmPrompt::ResultOkay) outputResult = true; else diff --git a/src/gui/dialogues/ConfirmPrompt.h b/src/gui/dialogues/ConfirmPrompt.h index a1fcd33b4..6796868cf 100644 --- a/src/gui/dialogues/ConfirmPrompt.h +++ b/src/gui/dialogues/ConfirmPrompt.h @@ -11,7 +11,7 @@ public: ConfirmPrompt(String title, String message, ConfirmDialogueCallback * callback_ = NULL); ConfirmPrompt(String title, String message, String buttonText, ConfirmDialogueCallback * callback_ = NULL); static bool Blocking(String title, String message, String buttonText = String("Confirm")); - virtual void OnDraw(); + void OnDraw() override; virtual ~ConfirmPrompt(); ConfirmDialogueCallback * callback; }; diff --git a/src/gui/dialogues/ErrorMessage.cpp b/src/gui/dialogues/ErrorMessage.cpp index 394a9aa08..bf7ffad30 100644 --- a/src/gui/dialogues/ErrorMessage.cpp +++ b/src/gui/dialogues/ErrorMessage.cpp @@ -29,7 +29,7 @@ ErrorMessage::ErrorMessage(String title, String message, ErrorMessageCallback * ErrorMessage * message; public: DismissAction(ErrorMessage * message_) { message = message_; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { message->CloseActiveWindow(); if(message->callback) @@ -55,7 +55,7 @@ void ErrorMessage::Blocking(String title, String message) class BlockingDismissCallback: public ErrorMessageCallback { public: BlockingDismissCallback() {} - virtual void DismissCallback() { + void DismissCallback() override { ui::Engine::Ref().Break(); } virtual ~BlockingDismissCallback() { } diff --git a/src/gui/dialogues/ErrorMessage.h b/src/gui/dialogues/ErrorMessage.h index b5468ac27..6f38a81e7 100644 --- a/src/gui/dialogues/ErrorMessage.h +++ b/src/gui/dialogues/ErrorMessage.h @@ -9,7 +9,7 @@ class ErrorMessage: public ui::Window { public: ErrorMessage(String title, String message, ErrorMessageCallback * callback_ = NULL); static void Blocking(String title, String message); - virtual void OnDraw(); + void OnDraw() override; virtual ~ErrorMessage(); }; diff --git a/src/gui/dialogues/InformationMessage.cpp b/src/gui/dialogues/InformationMessage.cpp index 8e29d5c55..233782217 100644 --- a/src/gui/dialogues/InformationMessage.cpp +++ b/src/gui/dialogues/InformationMessage.cpp @@ -57,7 +57,7 @@ InformationMessage::InformationMessage(String title, String message, bool large) InformationMessage * message; public: DismissAction(InformationMessage * message_) { message = message_; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { message->CloseActiveWindow(); message->SelfDestruct(); //TODO: Fix component disposal diff --git a/src/gui/dialogues/InformationMessage.h b/src/gui/dialogues/InformationMessage.h index 2f13a9419..020c70272 100644 --- a/src/gui/dialogues/InformationMessage.h +++ b/src/gui/dialogues/InformationMessage.h @@ -6,7 +6,7 @@ class InformationMessage: public ui::Window { public: InformationMessage(String title, String message, bool large); - virtual void OnDraw(); + void OnDraw() override; virtual ~InformationMessage(); }; diff --git a/src/gui/dialogues/SaveIDMessage.cpp b/src/gui/dialogues/SaveIDMessage.cpp index 53b922f04..5c1c702e0 100644 --- a/src/gui/dialogues/SaveIDMessage.cpp +++ b/src/gui/dialogues/SaveIDMessage.cpp @@ -37,7 +37,7 @@ SaveIDMessage::SaveIDMessage(int id): SaveIDMessage * message; public: DismissAction(SaveIDMessage * message_) { message = message_; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { message->CloseActiveWindow(); message->SelfDestruct(); diff --git a/src/gui/dialogues/SaveIDMessage.h b/src/gui/dialogues/SaveIDMessage.h index 78414dca5..ff3243930 100644 --- a/src/gui/dialogues/SaveIDMessage.h +++ b/src/gui/dialogues/SaveIDMessage.h @@ -6,8 +6,8 @@ class SaveIDMessage: public ui::Window { public: SaveIDMessage(int id); - virtual void OnDraw(); - virtual void OnTryExit(ExitMethod method); + void OnDraw() override; + void OnTryExit(ExitMethod method) override; virtual ~SaveIDMessage(); }; diff --git a/src/gui/dialogues/TextPrompt.cpp b/src/gui/dialogues/TextPrompt.cpp index 24febf2ea..c56e4093c 100644 --- a/src/gui/dialogues/TextPrompt.cpp +++ b/src/gui/dialogues/TextPrompt.cpp @@ -12,7 +12,7 @@ public: TextPrompt * prompt; TextPrompt::DialogueResult result; CloseAction(TextPrompt * prompt_, TextPrompt::DialogueResult result_) { prompt = prompt_; result = result_; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { prompt->CloseActiveWindow(); if(prompt->callback) @@ -85,7 +85,7 @@ String TextPrompt::Blocking(String title, String message, String text, String pl String & outputString; public: BlockingTextCallback(String & output) : outputString(output) {} - virtual void TextCallback(TextPrompt::DialogueResult result, String resultText) { + void TextCallback(TextPrompt::DialogueResult result, String resultText) override { if(result == ResultOkay) outputString = resultText; else diff --git a/src/gui/dialogues/TextPrompt.h b/src/gui/dialogues/TextPrompt.h index 5b99d4ac5..3ca7f7942 100644 --- a/src/gui/dialogues/TextPrompt.h +++ b/src/gui/dialogues/TextPrompt.h @@ -13,7 +13,7 @@ public: enum DialogueResult { ResultCancel, ResultOkay }; TextPrompt(String title, String message, String text, String placeholder, bool multiline, TextDialogueCallback * callback_); static String Blocking(String title, String message, String text, String placeholder, bool multiline); - virtual void OnDraw(); + void OnDraw() override; virtual ~TextPrompt(); TextDialogueCallback * callback; }; diff --git a/src/gui/elementsearch/ElementSearchActivity.cpp b/src/gui/elementsearch/ElementSearchActivity.cpp index 827704b8c..40ce13c78 100644 --- a/src/gui/elementsearch/ElementSearchActivity.cpp +++ b/src/gui/elementsearch/ElementSearchActivity.cpp @@ -15,7 +15,7 @@ class ElementSearchActivity::ToolAction: public ui::ButtonAction public: Tool * tool; ToolAction(ElementSearchActivity * a, Tool * tool) : a(a), tool(tool) { } - void ActionCallback(ui::Button * sender_) + void ActionCallback(ui::Button * sender_) override { ToolButton *sender = (ToolButton*)sender_; if(sender->GetSelectionState() >= 0 && sender->GetSelectionState() <= 2) @@ -47,7 +47,7 @@ ElementSearchActivity::ElementSearchActivity(GameController * gameController, st ElementSearchActivity * a; public: SearchAction(ElementSearchActivity * a) : a(a) {} - virtual void TextChangedCallback(ui::Textbox * sender) { + void TextChangedCallback(ui::Textbox * sender) override { a->searchTools(sender->GetText()); } }; @@ -63,7 +63,7 @@ ElementSearchActivity::ElementSearchActivity(GameController * gameController, st ElementSearchActivity * a; public: CloseAction(ElementSearchActivity * a) : a(a) { } - void ActionCallback(ui::Button * sender_) + void ActionCallback(ui::Button * sender_) override { a->exit = true; } @@ -74,7 +74,7 @@ ElementSearchActivity::ElementSearchActivity(GameController * gameController, st ElementSearchActivity * a; public: OKAction(ElementSearchActivity * a) : a(a) { } - void ActionCallback(ui::Button * sender_) + void ActionCallback(ui::Button * sender_) override { if(a->GetFirstResult()) a->SetActiveTool(0, a->GetFirstResult()); diff --git a/src/gui/elementsearch/ElementSearchActivity.h b/src/gui/elementsearch/ElementSearchActivity.h index 7b29bb024..e17ce44e2 100644 --- a/src/gui/elementsearch/ElementSearchActivity.h +++ b/src/gui/elementsearch/ElementSearchActivity.h @@ -32,11 +32,11 @@ public: ElementSearchActivity(GameController * gameController, std::vector tools); void SetActiveTool(int selectionState, Tool * tool); virtual ~ElementSearchActivity(); - virtual void OnTick(float dt); - virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); - virtual void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); - virtual void OnDraw(); - virtual void ToolTip(ui::Point senderPosition, String ToolTip); + void OnTick(float dt) override; + void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; + void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; + void OnDraw() override; + void ToolTip(ui::Point senderPosition, String ToolTip) override; }; #endif /* ELEMENTSEARCHACTIVITY_H_ */ diff --git a/src/gui/filebrowser/FileBrowserActivity.cpp b/src/gui/filebrowser/FileBrowserActivity.cpp index 48e0e6672..a395a6197 100644 --- a/src/gui/filebrowser/FileBrowserActivity.cpp +++ b/src/gui/filebrowser/FileBrowserActivity.cpp @@ -21,15 +21,15 @@ class SaveSelectedAction: public ui::SaveButtonAction FileBrowserActivity * a; public: SaveSelectedAction(FileBrowserActivity * _a) { a = _a; } - virtual void ActionCallback(ui::SaveButton * sender) + void ActionCallback(ui::SaveButton * sender) override { a->SelectSave(sender->GetSaveFile()); } - virtual void AltActionCallback(ui::SaveButton * sender) + void AltActionCallback(ui::SaveButton * sender) override { a->RenameSave(sender->GetSaveFile()); } - virtual void AltActionCallback2(ui::SaveButton * sender) + void AltActionCallback2(ui::SaveButton * sender) override { a->DeleteSave(sender->GetSaveFile()); } @@ -42,17 +42,17 @@ class LoadFilesTask: public Task ByteString search; std::vector saveFiles; - virtual void before() + void before() override { } - virtual void after() + void after() override { } - virtual bool doWork() + bool doWork() override { std::vector files = Client::Ref().DirectorySearch(directory, search, ".cps"); std::sort(files.rbegin(), files.rend(), [](ByteString a, ByteString b) { return a.ToLower() < b.ToLower(); }); @@ -99,7 +99,7 @@ class FileBrowserActivity::SearchAction: public ui::TextboxAction public: FileBrowserActivity * a; SearchAction(FileBrowserActivity * a) : a(a) {} - virtual void TextChangedCallback(ui::Textbox * sender) { + void TextChangedCallback(ui::Textbox * sender) override { a->DoSearch(sender->GetText().ToUtf8()); } }; diff --git a/src/gui/filebrowser/FileBrowserActivity.h b/src/gui/filebrowser/FileBrowserActivity.h index 2cfe0d339..be9ddf64b 100644 --- a/src/gui/filebrowser/FileBrowserActivity.h +++ b/src/gui/filebrowser/FileBrowserActivity.h @@ -47,10 +47,10 @@ class FileBrowserActivity: public TaskListener, public WindowActivity void populateList(); public: FileBrowserActivity(ByteString directory, FileSelectedCallback * callback); - virtual void OnDraw(); - virtual void OnTick(float dt); - virtual void OnTryExit(ExitMethod method); - virtual void OnMouseDown(int x, int y, unsigned button); + void OnDraw() override; + void OnTick(float dt) override; + void OnTryExit(ExitMethod method) override; + void OnMouseDown(int x, int y, unsigned button) override; void loadDirectory(ByteString directory, ByteString search); void SelectSave(SaveFile * file); void DeleteSave(SaveFile * file); @@ -58,8 +58,8 @@ public: void DoSearch(ByteString search); virtual ~FileBrowserActivity(); - virtual void NotifyDone(Task * task); - virtual void NotifyError(Task * task); - virtual void NotifyProgress(Task * task); - virtual void NotifyStatus(Task * task); + void NotifyDone(Task * task) override; + void NotifyError(Task * task) override; + void NotifyProgress(Task * task) override; + void NotifyStatus(Task * task) override; }; diff --git a/src/gui/font/FontEditor.cpp b/src/gui/font/FontEditor.cpp index 571c62c78..0bdb80ce8 100644 --- a/src/gui/font/FontEditor.cpp +++ b/src/gui/font/FontEditor.cpp @@ -583,28 +583,28 @@ void FontEditor::OnMouseDown(int x, int y, unsigned button) } } -void FontEditor::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt) +void FontEditor::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) { - if(IsFocused(NULL)) + if (IsFocused(NULL)) { - switch(key) + switch(scan) { - case SDLK_LEFT: + case SDL_SCANCODE_LEFT: PrevChar(); break; - case SDLK_RIGHT: + case SDL_SCANCODE_RIGHT: PrevChar(); break; - case SDLK_ESCAPE: - case 'q': + case SDL_SCANCODE_ESCAPE: + case SDL_SCANCODE_Q: if(savedButton->GetToggleState()) ui::Engine::Ref().Exit(); else ui::Engine::Ref().ConfirmExit(); break; - case 'c': + case SDL_SCANCODE_C: clipboardWidth = fontWidths[currentChar]; clipboardPixels = fontPixels[currentChar]; break; - case 'v': + case SDL_SCANCODE_V: fontWidths[currentChar] = clipboardWidth; fontPixels[currentChar] = clipboardPixels; break; diff --git a/src/gui/font/FontEditor.h b/src/gui/font/FontEditor.h index 84ac69b1a..5643188c1 100644 --- a/src/gui/font/FontEditor.h +++ b/src/gui/font/FontEditor.h @@ -67,9 +67,9 @@ private: public: FontEditor(ByteString header); - void OnDraw(); - void OnMouseDown(int x, int y, unsigned button); - void OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt); + void OnDraw() override; + void OnMouseDown(int x, int y, unsigned button) override; + void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; }; #endif diff --git a/src/gui/game/BitmapBrush.h b/src/gui/game/BitmapBrush.h index 4a4f2fe24..174b4c69b 100644 --- a/src/gui/game/BitmapBrush.h +++ b/src/gui/game/BitmapBrush.h @@ -47,7 +47,7 @@ public: SetRadius(radius); }; - virtual void GenerateBitmap() + void GenerateBitmap() override { if(origBitmap) { diff --git a/src/gui/game/DecorationTool.h b/src/gui/game/DecorationTool.h index 80d0201a4..ebfe4dce7 100644 --- a/src/gui/game/DecorationTool.h +++ b/src/gui/game/DecorationTool.h @@ -68,16 +68,16 @@ public: { } virtual ~DecorationTool() {} - virtual void Draw(Simulation * sim, Brush * brush, ui::Point position){ + void Draw(Simulation * sim, Brush * brush, ui::Point position) override{ sim->ApplyDecorationPoint(position.X, position.Y, Red, Green, Blue, Alpha, toolID, brush); } - virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging) { + void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging) override { sim->ApplyDecorationLine(position1.X, position1.Y, position2.X, position2.Y, Red, Green, Blue, Alpha, toolID, brush); } - virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { + void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override { sim->ApplyDecorationBox(position1.X, position1.Y, position2.X, position2.Y, Red, Green, Blue, Alpha, toolID); } - virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { + void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override { pixel loc = ren->vid[position.X+position.Y*WINDOWW]; if (toolID == DECO_CLEAR) sim->ApplyDecorationFill(ren, position.X, position.Y, 0, 0, 0, 0, PIXR(loc), PIXG(loc), PIXB(loc)); diff --git a/src/gui/game/EllipseBrush.h b/src/gui/game/EllipseBrush.h index 7d681a3a8..3d8c56ba0 100644 --- a/src/gui/game/EllipseBrush.h +++ b/src/gui/game/EllipseBrush.h @@ -12,7 +12,7 @@ public: { SetRadius(size_); } - virtual void GenerateBitmap() + void GenerateBitmap() override { delete[] bitmap; bitmap = new unsigned char[size.X*size.Y]; diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index 5a9942972..3b88ed819 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -46,7 +46,7 @@ class GameController::SearchCallback: public ControllerCallback GameController * cc; public: SearchCallback(GameController * cc_) { cc = cc_; } - virtual void ControllerExit() + void ControllerExit() override { if(cc->search->GetLoadedSave()) { @@ -69,7 +69,7 @@ class GameController::SaveOpenCallback: public ControllerCallback GameController * cc; public: SaveOpenCallback(GameController * cc_) { cc = cc_; } - virtual void ControllerExit() + void ControllerExit() override { if(cc->activePreview->GetDoOpen() && cc->activePreview->GetSaveInfo()) { @@ -91,7 +91,7 @@ class GameController::OptionsCallback: public ControllerCallback GameController * cc; public: OptionsCallback(GameController * cc_) { cc = cc_; } - virtual void ControllerExit() + void ControllerExit() override { cc->gameModel->UpdateQuickOptions(); Client::Ref().WritePrefs(); @@ -103,7 +103,7 @@ class GameController::TagsCallback: public ControllerCallback GameController * cc; public: TagsCallback(GameController * cc_) { cc = cc_; } - virtual void ControllerExit() + void ControllerExit() override { cc->gameView->NotifySaveChanged(cc->gameModel); } @@ -114,7 +114,7 @@ class GameController::StampsCallback: public ControllerCallback GameController * cc; public: StampsCallback(GameController * cc_) { cc = cc_; } - virtual void ControllerExit() + void ControllerExit() override { SaveFile *file = cc->localBrowser->GetSave(); if (file) @@ -351,7 +351,7 @@ void GameController::Install() public: GameController * c; InstallConfirmation(GameController * c_) { c = c_; } - virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) { + void ConfirmCallback(ConfirmPrompt::DialogueResult result) override { if (result == ConfirmPrompt::ResultOkay) { if(Client::Ref().DoInstallation()) @@ -1246,7 +1246,7 @@ void GameController::OpenLocalSaveWindow(bool asCurrent) public: LocalSaveCallback(GameController * _c): c(_c) {} virtual ~LocalSaveCallback() {} - virtual void FileSaved(SaveFile* file) + void FileSaved(SaveFile* file) override { c->gameModel->SetSaveFile(file); } @@ -1311,7 +1311,7 @@ void GameController::OpenLocalBrowse() public: LocalSaveOpenCallback(GameController * _c): c(_c) {} virtual ~LocalSaveOpenCallback() {}; - virtual void FileSelected(SaveFile* file) + void FileSelected(SaveFile* file) override { c->HistorySnapshot(); c->LoadSaveFile(file); @@ -1364,8 +1364,8 @@ void GameController::OpenColourPicker() GameController * c; public: ColourPickerCallback(GameController * _c): c(_c) {} - virtual ~ColourPickerCallback() {}; - virtual void ColourPicked(ui::Colour colour) + virtual ~ColourPickerCallback() {} + void ColourPicked(ui::Colour colour) override { c->SetColour(colour); } @@ -1429,7 +1429,7 @@ void GameController::OpenSaveWindow() public: SaveUploadedCallback(GameController * _c): c(_c) {} virtual ~SaveUploadedCallback() {} - virtual void SaveUploaded(SaveInfo save) + void SaveUploaded(SaveInfo save) override { save.SetVote(1); save.SetVotesUp(1); @@ -1477,7 +1477,7 @@ void GameController::SaveAsCurrent() public: SaveUploadedCallback(GameController * _c): c(_c) {} virtual ~SaveUploadedCallback() {} - virtual void SaveUploaded(SaveInfo save) + void SaveUploaded(SaveInfo save) override { c->LoadSave(&save); } @@ -1616,7 +1616,7 @@ void GameController::NotifyNewNotification(Client * sender, std::pairRunUpdater(); @@ -1646,7 +1646,7 @@ void GameController::NotifyUpdateAvailable(Client * sender) UpdateNotification(GameController * c, String message) : Notification(message), c(c) {} virtual ~UpdateNotification() {} - virtual void Action() + void Action() override { UpdateInfo info = Client::Ref().GetUpdateInfo(); StringBuilder updateMessage; diff --git a/src/gui/game/GameController.h b/src/gui/game/GameController.h index dc020b6f3..761d89705 100644 --- a/src/gui/game/GameController.h +++ b/src/gui/game/GameController.h @@ -165,9 +165,9 @@ public: void RemoveNotification(Notification * notification); - virtual void NotifyUpdateAvailable(Client * sender); - virtual void NotifyAuthUserChanged(Client * sender); - virtual void NotifyNewNotification(Client * sender, std::pair notification); + void NotifyUpdateAvailable(Client * sender) override; + void NotifyAuthUserChanged(Client * sender) override; + void NotifyNewNotification(Client * sender, std::pair notification) override; void RunUpdater(); }; diff --git a/src/gui/game/GameModelException.h b/src/gui/game/GameModelException.h index 30961901a..309a3f63c 100644 --- a/src/gui/game/GameModelException.h +++ b/src/gui/game/GameModelException.h @@ -8,11 +8,11 @@ struct GameModelException: public exception { String message; public: GameModelException(String message_): message(message_) {} - const char * what() const throw() + const char * what() const throw() override { return message.ToUtf8().c_str(); } - ~GameModelException() throw() {}; + ~GameModelException() throw() {} }; #endif /* GAMEMODELEXCEPTION_H_ */ diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp index 2f894071f..a2f7f6cbf 100644 --- a/src/gui/game/GameView.cpp +++ b/src/gui/game/GameView.cpp @@ -72,7 +72,7 @@ public: } } } - virtual void OnMouseUnclick(int x, int y, unsigned int button) + void OnMouseUnclick(int x, int y, unsigned int button) override { if(isButtonDown) { @@ -84,22 +84,18 @@ public: ui::Button::OnMouseUnclick(x, y, button); } - virtual void OnMouseHover(int x, int y, int dx, int dy) + void OnMouseHover(int x, int y) override { SetToolTip(x, y); } - virtual void OnMouseHover(int x, int y) - { - SetToolTip(x, y); - } - virtual void OnMouseEnter(int x, int y) + void OnMouseEnter(int x, int y) override { isMouseInside = true; if(!Enabled) return; SetToolTip(x, y); } - virtual void TextPosition(String ButtonText) + void TextPosition(String ButtonText) override { ui::Button::TextPosition(ButtonText); textPosition.X += 3; @@ -109,7 +105,7 @@ public: toolTip = newToolTip1; toolTip2 = newToolTip2; } - virtual void OnMouseClick(int x, int y, unsigned int button) + void OnMouseClick(int x, int y, unsigned int button) override { ui::Button::OnMouseClick(x, y, button); rightDown = false; @@ -133,7 +129,7 @@ public: if(splitActionCallback) splitActionCallback->ActionCallbackLeft(this); } - void Draw(const ui::Point& screenPos) + void Draw(const ui::Point& screenPos) override { ui::Button::Draw(screenPos); Graphics * g = GetGraphics(); @@ -213,7 +209,7 @@ GameView::GameView(): GameView * v; public: SearchAction(GameView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { if(v->CtrlBehaviour()) v->c->OpenLocalBrowse(); @@ -241,11 +237,11 @@ GameView::GameView(): GameView * v; public: ReloadAction(GameView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->ReloadSim(); } - void AltActionCallback(ui::Button * sender) + void AltActionCallback(ui::Button * sender) override { v->c->OpenSavePreview(); } @@ -262,14 +258,14 @@ GameView::GameView(): GameView * v; public: SaveSimulationAction(GameView * _v) { v = _v; } - void ActionCallbackRight(ui::Button * sender) + void ActionCallbackRight(ui::Button * sender) override { if(v->CtrlBehaviour() || !Client::Ref().GetAuthUser().UserID) v->c->OpenLocalSaveWindow(false); else v->c->OpenSaveWindow(); } - void ActionCallbackLeft(ui::Button * sender) + void ActionCallbackLeft(ui::Button * sender) override { if(v->CtrlBehaviour() || !Client::Ref().GetAuthUser().UserID) v->c->OpenLocalSaveWindow(true); @@ -290,7 +286,7 @@ GameView::GameView(): GameView * v; public: UpVoteAction(GameView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->Vote(1); } @@ -308,7 +304,7 @@ GameView::GameView(): GameView * v; public: DownVoteAction(GameView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->Vote(-1); } @@ -326,7 +322,7 @@ GameView::GameView(): GameView * v; public: TagSimulationAction(GameView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->OpenTags(); } @@ -343,7 +339,7 @@ GameView::GameView(): GameView * v; public: ClearSimAction(GameView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->ClearSim(); } @@ -359,11 +355,11 @@ GameView::GameView(): GameView * v; public: LoginAction(GameView * _v) { v = _v; } - void ActionCallbackLeft(ui::Button * sender) + void ActionCallbackLeft(ui::Button * sender) override { v->c->OpenLogin(); } - void ActionCallbackRight(ui::Button * sender) + void ActionCallbackRight(ui::Button * sender) override { v->c->OpenProfile(); } @@ -379,7 +375,7 @@ GameView::GameView(): GameView * v; public: SimulationOptionAction(GameView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->OpenOptions(); } @@ -395,7 +391,7 @@ GameView::GameView(): GameView * v; public: DisplayModeAction(GameView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->OpenRenderOptions(); } @@ -411,7 +407,7 @@ GameView::GameView(): GameView * v; public: PauseAction(GameView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->SetPaused(sender->GetToggleState()); } @@ -427,7 +423,7 @@ GameView::GameView(): GameView * v; public: ElementSearchAction(GameView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->OpenElementSearch(); } @@ -442,7 +438,7 @@ GameView::GameView(): GameView * v; public: ColourPickerAction(GameView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->OpenColourPicker(); } @@ -484,7 +480,7 @@ public: else needsClick = false; } - void MouseEnterCallback(ui::Button * sender) + void MouseEnterCallback(ui::Button * sender) override { // don't immediately change the active menu, the actual set is done inside GameView::OnMouseMove // if we change it here it causes components to be removed, which causes the window to stop sending events @@ -492,7 +488,7 @@ public: if(!needsClick && !v->GetMouseDown()) v->SetActiveMenuDelayed(menuID); } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { if (needsClick) v->c->SetActiveMenu(menuID); @@ -506,7 +502,7 @@ class GameView::OptionAction: public ui::ButtonAction QuickOption * option; public: OptionAction(QuickOption * _option) { option = _option; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { option->Perform(); } @@ -517,7 +513,7 @@ class GameView::OptionListener: public QuickOptionListener ui::Button * button; public: OptionListener(ui::Button * _button) { button = _button; } - virtual void OnValueChanged(QuickOption * option) + void OnValueChanged(QuickOption * option) override { switch(option->GetType()) { @@ -537,7 +533,7 @@ class GameView::ToolAction: public ui::ButtonAction public: Tool * tool; ToolAction(GameView * _v, Tool * tool_) { v = _v; tool = tool_; } - void ActionCallback(ui::Button * sender_) + void ActionCallback(ui::Button * sender_) override { ToolButton *sender = (ToolButton*)sender_; if (v->ShiftBehaviour() && v->CtrlBehaviour() && !v->AltBehaviour()) @@ -832,7 +828,7 @@ void GameView::NotifyColourPresetsChanged(GameModel * sender) public: int preset; ColourPresetAction(GameView * _v, int preset) : preset(preset) { v = _v; } - void ActionCallback(ui::Button * sender_) + void ActionCallback(ui::Button * sender_) override { v->c->SetActiveColourPreset(preset); v->c->SetColour(sender_->Appearance.BackgroundInactive); @@ -1871,7 +1867,7 @@ void GameView::NotifyNotificationsChanged(GameModel * sender) Notification * notification; public: NotificationButtonAction(Notification * notification) : notification(notification) { } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { notification->Action(); //v->c->RemoveNotification(notification); @@ -1883,11 +1879,11 @@ void GameView::NotifyNotificationsChanged(GameModel * sender) Notification * notification; public: CloseNotificationButtonAction(GameView * v, Notification * notification) : v(v), notification(notification) { } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->RemoveNotification(notification); } - void AltActionCallback(ui::Button * sender) + void AltActionCallback(ui::Button * sender) override { v->c->RemoveNotification(notification); } diff --git a/src/gui/game/GameView.h b/src/gui/game/GameView.h index 203106bda..dbe1feabd 100644 --- a/src/gui/game/GameView.h +++ b/src/gui/game/GameView.h @@ -185,28 +185,28 @@ public: void NotifyLastToolChanged(GameModel * sender); - virtual void ToolTip(ui::Point senderPosition, String toolTip); + void ToolTip(ui::Point senderPosition, String toolTip) override; - virtual void OnMouseMove(int x, int y, int dx, int dy); - virtual void OnMouseDown(int x, int y, unsigned button); - virtual void OnMouseUp(int x, int y, unsigned button); - virtual void OnMouseWheel(int x, int y, int d); - virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); - virtual void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); - virtual void OnTick(float dt); - virtual void OnDraw(); - virtual void OnBlur(); + void OnMouseMove(int x, int y, int dx, int dy) override; + void OnMouseDown(int x, int y, unsigned button) override; + void OnMouseUp(int x, int y, unsigned button) override; + void OnMouseWheel(int x, int y, int d) override; + void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; + void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; + void OnTick(float dt) override; + void OnDraw() override; + void OnBlur() override; //Top-level handlers, for Lua interface - virtual void DoExit(); - virtual void DoDraw(); - virtual void DoMouseMove(int x, int y, int dx, int dy); - virtual void DoMouseDown(int x, int y, unsigned button); - virtual void DoMouseUp(int x, int y, unsigned button); - virtual void DoMouseWheel(int x, int y, int d); - virtual void DoTextInput(String text); - virtual void DoKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); - virtual void DoKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); + void DoExit() override; + void DoDraw() override; + void DoMouseMove(int x, int y, int dx, int dy) override; + void DoMouseDown(int x, int y, unsigned button) override; + void DoMouseUp(int x, int y, unsigned button) override; + void DoMouseWheel(int x, int y, int d) override; + void DoTextInput(String text) override; + void DoKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; + void DoKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; class MenuAction; class ToolAction; diff --git a/src/gui/game/PropertyTool.cpp b/src/gui/game/PropertyTool.cpp index 09f6ece7c..84caba967 100644 --- a/src/gui/game/PropertyTool.cpp +++ b/src/gui/game/PropertyTool.cpp @@ -22,16 +22,16 @@ public: std::vector properties; PropertyWindow(PropertyTool *tool_, Simulation *sim); void SetProperty(); - virtual void OnDraw(); - virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); - virtual void OnTryExit(ExitMethod method); + void OnDraw() override; + void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; + void OnTryExit(ExitMethod method) override; virtual ~PropertyWindow() {} class OkayAction: public ui::ButtonAction { public: PropertyWindow * prompt; OkayAction(PropertyWindow * prompt_) { prompt = prompt_; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { prompt->CloseActiveWindow(); if(prompt->textField->GetText().length()) @@ -68,7 +68,7 @@ sim(sim_) PropertyWindow * w; public: PropertyChanged(PropertyWindow * w): w(w) { } - virtual void OptionChanged(ui::DropDown * sender, std::pair option) + void OptionChanged(ui::DropDown * sender, std::pair option) override { w->FocusComponent(w->textField); } diff --git a/src/gui/game/QuickOptions.h b/src/gui/game/QuickOptions.h index fda29bf13..3ce1313b6 100644 --- a/src/gui/game/QuickOptions.h +++ b/src/gui/game/QuickOptions.h @@ -9,11 +9,11 @@ public: { } - virtual bool GetToggle() + bool GetToggle() override { return m->GetSimulation()->pretty_powder; } - virtual void perform() + void perform() override { m->GetSimulation()->pretty_powder = !m->GetSimulation()->pretty_powder; } @@ -27,11 +27,11 @@ public: { } - virtual bool GetToggle() + bool GetToggle() override { return m->GetGravityGrid(); } - virtual void perform() + void perform() override { m->ShowGravityGrid(!m->GetGravityGrid()); } @@ -45,11 +45,11 @@ public: { } - virtual bool GetToggle() + bool GetToggle() override { return m->GetDecoration(); } - virtual void perform() + void perform() override { m->SetDecoration(!m->GetDecoration()); } @@ -63,11 +63,11 @@ public: { } - virtual bool GetToggle() + bool GetToggle() override { return m->GetNewtonianGrvity(); } - virtual void perform() + void perform() override { m->SetNewtonianGravity(!m->GetNewtonianGrvity()); } @@ -81,11 +81,11 @@ public: { } - virtual bool GetToggle() + bool GetToggle() override { return m->GetAHeatEnable(); } - virtual void perform() + void perform() override { m->SetAHeatEnable(!m->GetAHeatEnable()); } @@ -100,11 +100,11 @@ public: { c = c_; } - virtual bool GetToggle() + bool GetToggle() override { return 0; } - virtual void perform() + void perform() override { c->ShowConsole(); } diff --git a/src/gui/game/SignTool.cpp b/src/gui/game/SignTool.cpp index c77439840..db9688981 100644 --- a/src/gui/game/SignTool.cpp +++ b/src/gui/game/SignTool.cpp @@ -21,22 +21,38 @@ public: int signID; ui::Point signPosition; SignWindow(SignTool * tool_, Simulation * sim_, int signID_, ui::Point position_); - virtual void OnDraw(); - virtual void DoDraw(); - virtual void DoMouseMove(int x, int y, int dx, int dy); - virtual void DoMouseDown(int x, int y, unsigned button); - virtual void DoMouseUp(int x, int y, unsigned button) { if(!signMoving) ui::Window::DoMouseUp(x, y, button); } - virtual void DoMouseWheel(int x, int y, int d) { if(!signMoving) ui::Window::DoMouseWheel(x, y, d); } - virtual void DoKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) { if(!signMoving) ui::Window::DoKeyPress(key, scan, repeat, shift, ctrl, alt); } - virtual void DoKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) { if(!signMoving) ui::Window::DoKeyRelease(key, scan, repeat, shift, ctrl, alt); } + void OnDraw() override; + void DoDraw() override; + void DoMouseMove(int x, int y, int dx, int dy) override; + void DoMouseDown(int x, int y, unsigned button) override; + void DoMouseUp(int x, int y, unsigned button) override + { + if(!signMoving) + ui::Window::DoMouseUp(x, y, button); + } + void DoMouseWheel(int x, int y, int d) override + { + if(!signMoving) + ui::Window::DoMouseWheel(x, y, d); + } + void DoKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override + { + if(!signMoving) + ui::Window::DoKeyPress(key, scan, repeat, shift, ctrl, alt); + } + void DoKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override + { + if(!signMoving) + ui::Window::DoKeyRelease(key, scan, repeat, shift, ctrl, alt); + } virtual ~SignWindow() {} - virtual void OnTryExit(ui::Window::ExitMethod method); + void OnTryExit(ui::Window::ExitMethod method) override; class OkayAction: public ui::ButtonAction { public: SignWindow * prompt; OkayAction(SignWindow * prompt_) { prompt = prompt_; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { prompt->CloseActiveWindow(); if(prompt->signID==-1 && prompt->textField->GetText().length()) @@ -55,7 +71,7 @@ public: public: SignWindow * prompt; DeleteAction(SignWindow * prompt_) { prompt = prompt_; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { prompt->CloseActiveWindow(); if(prompt->signID!=-1) @@ -71,7 +87,7 @@ public: public: SignWindow * prompt; SignTextAction(SignWindow * prompt_) { prompt = prompt_; } - virtual void TextChangedCallback(ui::Textbox * sender) + void TextChangedCallback(ui::Textbox * sender) override { if(prompt->signID!=-1) { @@ -86,7 +102,7 @@ public: public: SignWindow * prompt; MoveAction(SignWindow * prompt_) { prompt = prompt_; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { if(prompt->signID!=-1) { diff --git a/src/gui/game/Tool.h b/src/gui/game/Tool.h index f0224bf87..7b415d14c 100644 --- a/src/gui/game/Tool.h +++ b/src/gui/game/Tool.h @@ -55,11 +55,11 @@ public: } static VideoBuffer * GetIcon(int toolID, int width, int height); virtual ~SignTool() {} - virtual void Click(Simulation * sim, Brush * brush, ui::Point position); - virtual void Draw(Simulation * sim, Brush * brush, ui::Point position) { } - virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) { } - virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { } - virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { } + void Click(Simulation * sim, Brush * brush, ui::Point position) override; + void Draw(Simulation * sim, Brush * brush, ui::Point position) override { } + void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override { } + void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override { } + void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override { } }; class SampleTool: public Tool @@ -73,11 +73,11 @@ public: } static VideoBuffer * GetIcon(int toolID, int width, int height); virtual ~SampleTool() {} - virtual void Click(Simulation * sim, Brush * brush, ui::Point position) { } - virtual void Draw(Simulation * sim, Brush * brush, ui::Point position); - virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) { } - virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { } - virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { } + void Click(Simulation * sim, Brush * brush, ui::Point position) override { } + void Draw(Simulation * sim, Brush * brush, ui::Point position) override; + void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override { } + void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override { } + void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override { } }; class PropertyTool: public Tool @@ -94,11 +94,11 @@ public: void OpenWindow(Simulation *sim); virtual ~PropertyTool() {} virtual void SetProperty(Simulation *sim, ui::Point position); - virtual void Click(Simulation * sim, Brush * brush, ui::Point position) { } - virtual void Draw(Simulation *sim, Brush *brush, ui::Point position); - virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false); - virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2); - virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position); + void Click(Simulation * sim, Brush * brush, ui::Point position) override { } + void Draw(Simulation *sim, Brush *brush, ui::Point position) override; + void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override; + void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override; + void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override; }; @@ -107,10 +107,10 @@ class ElementTool: public Tool public: ElementTool(int id, ByteString name, String description, int r, int g, int b, ByteString identifier, VideoBuffer * (*textureGen)(int, int, int) = NULL); virtual ~ElementTool(); - virtual void Draw(Simulation * sim, Brush * brush, ui::Point position); - virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false); - virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2); - virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position); + void Draw(Simulation * sim, Brush * brush, ui::Point position) override; + void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override; + void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override; + void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override; }; class Element_LIGH_Tool: public ElementTool @@ -120,10 +120,10 @@ public: ElementTool(id, name, description, r, g, b, identifier, textureGen) { } virtual ~Element_LIGH_Tool() { } - virtual void Click(Simulation * sim, Brush * brush, ui::Point position) { } - virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false); - virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { } - virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { } + void Click(Simulation * sim, Brush * brush, ui::Point position) override { } + void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override; + void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override { } + void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override { } }; class Element_TESC_Tool: public ElementTool @@ -133,8 +133,8 @@ public: ElementTool(id, name, description, r, g, b, identifier, textureGen) { } virtual ~Element_TESC_Tool() {} - virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2); - virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position); + void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override; + void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override; }; class PlopTool: public ElementTool @@ -144,11 +144,11 @@ public: ElementTool(id, name, description, r, g, b, identifier, textureGen) { } virtual ~PlopTool() { } - virtual void Draw(Simulation * sim, Brush * brush, ui::Point position) { } - virtual void Click(Simulation * sim, Brush * brush, ui::Point position); - virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) { } - virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { } - virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { } + void Draw(Simulation * sim, Brush * brush, ui::Point position) override { } + void Click(Simulation * sim, Brush * brush, ui::Point position) override; + void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override { } + void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override { } + void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override { } }; class WallTool: public Tool @@ -156,10 +156,10 @@ class WallTool: public Tool public: WallTool(int id, ByteString name, String description, int r, int g, int b, ByteString identifier, VideoBuffer * (*textureGen)(int, int, int) = NULL); virtual ~WallTool(); - virtual void Draw(Simulation * sim, Brush * brush, ui::Point position); - virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false); - virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2); - virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position); + void Draw(Simulation * sim, Brush * brush, ui::Point position) override; + void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override; + void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override; + void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override; }; class WindTool: public Tool @@ -167,10 +167,10 @@ class WindTool: public Tool public: WindTool(int id, ByteString name, String description, int r, int g, int b, ByteString identifier, VideoBuffer * (*textureGen)(int, int, int) = NULL); virtual ~WindTool() { } - virtual void Draw(Simulation * sim, Brush * brush, ui::Point position) { } - virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false); - virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { } - virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { } + void Draw(Simulation * sim, Brush * brush, ui::Point position) override { } + void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override; + void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override { } + void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override { } }; #endif /* TOOL_H_ */ diff --git a/src/gui/game/ToolButton.h b/src/gui/game/ToolButton.h index 8a5cd7820..e4992aa44 100644 --- a/src/gui/game/ToolButton.h +++ b/src/gui/game/ToolButton.h @@ -9,10 +9,10 @@ class ToolButton: public ui::Button ByteString toolIdentifier; public: ToolButton(ui::Point position, ui::Point size, ByteString text_, ByteString toolIdentifier, String toolTip = String()); - virtual void OnMouseUnclick(int x, int y, unsigned int button); - virtual void OnMouseUp(int x, int y, unsigned int button); - virtual void OnMouseClick(int x, int y, unsigned int button); - virtual void Draw(const ui::Point& screenPos); + void OnMouseUnclick(int x, int y, unsigned int button) override; + void OnMouseUp(int x, int y, unsigned int button) override; + void OnMouseClick(int x, int y, unsigned int button) override; + void Draw(const ui::Point& screenPos) override; void SetSelectionState(int state); int GetSelectionState(); virtual ~ToolButton(); diff --git a/src/gui/game/TriangleBrush.h b/src/gui/game/TriangleBrush.h index fcb3bc127..43a300d40 100644 --- a/src/gui/game/TriangleBrush.h +++ b/src/gui/game/TriangleBrush.h @@ -19,7 +19,7 @@ public: { SetRadius(size_); }; - virtual void GenerateBitmap() + void GenerateBitmap() override { delete[] bitmap; bitmap = new unsigned char[size.X*size.Y]; diff --git a/src/gui/interface/ContextMenu.cpp b/src/gui/interface/ContextMenu.cpp index d4b89c78e..77f2a103c 100644 --- a/src/gui/interface/ContextMenu.cpp +++ b/src/gui/interface/ContextMenu.cpp @@ -10,7 +10,7 @@ class ContextMenu::ItemSelectedAction: public ButtonAction int item; public: ItemSelectedAction(ContextMenu * window, int itemID): window(window), item(itemID) { } - virtual void ActionCallback(ui::Button *sender) + void ActionCallback(ui::Button *sender) override { window->ActionCallbackItem(sender, item); } diff --git a/src/gui/interface/DropDown.cpp b/src/gui/interface/DropDown.cpp index f91ba5891..0692b40c1 100644 --- a/src/gui/interface/DropDown.cpp +++ b/src/gui/interface/DropDown.cpp @@ -21,7 +21,7 @@ public: String option; public: ItemSelectedAction(DropDownWindow * window, String option): window(window), option(option) { } - virtual void ActionCallback(ui::Button *sender) + void ActionCallback(ui::Button *sender) override { window->CloseActiveWindow(); window->setOption(option); @@ -45,7 +45,7 @@ public: currentY += 16; } } - virtual void OnDraw() + void OnDraw() override { Graphics * g = GetGraphics(); g->clearrect(Position.X, Position.Y, Size.X, Size.Y); @@ -64,7 +64,7 @@ public: dropDown->callback->OptionChanged(dropDown, dropDown->options[optionIndex]); } } - virtual void OnTryExit(ExitMethod method) + void OnTryExit(ExitMethod method) override { CloseActiveWindow(); SelfDestruct(); diff --git a/src/gui/interface/Engine.cpp b/src/gui/interface/Engine.cpp index a7407430a..56cafe339 100644 --- a/src/gui/interface/Engine.cpp +++ b/src/gui/interface/Engine.cpp @@ -81,7 +81,7 @@ void Engine::ConfirmExit() class ExitConfirmation: public ConfirmDialogueCallback { public: ExitConfirmation() {} - virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) { + void ConfirmCallback(ConfirmPrompt::DialogueResult result) override { if (result == ConfirmPrompt::ResultOkay) { ui::Engine::Ref().Exit(); diff --git a/src/gui/interface/Panel.h b/src/gui/interface/Panel.h index fe9070aec..f3033a4f5 100644 --- a/src/gui/interface/Panel.h +++ b/src/gui/interface/Panel.h @@ -58,22 +58,22 @@ class Component; //Get child of this component by index. Component* GetChild(unsigned idx); - void Tick(float dt); - void Draw(const Point& screenPos); + void Tick(float dt) override; + void Draw(const Point& screenPos) override; - void OnMouseHover(int localx, int localy); - void OnMouseMoved(int localx, int localy, int dx, int dy); - void OnMouseMovedInside(int localx, int localy, int dx, int dy); - void OnMouseEnter(int localx, int localy); - void OnMouseLeave(int localx, int localy); - void OnMouseDown(int x, int y, unsigned button); - void OnMouseUp(int x, int y, unsigned button); - void OnMouseClick(int localx, int localy, unsigned button); - void OnMouseUnclick(int localx, int localy, unsigned button); - void OnMouseWheel(int localx, int localy, int d); - void OnMouseWheelInside(int localx, int localy, int d); - void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); - void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); + void OnMouseHover(int localx, int localy) override; + void OnMouseMoved(int localx, int localy, int dx, int dy) override; + void OnMouseMovedInside(int localx, int localy, int dx, int dy) override; + void OnMouseEnter(int localx, int localy) override; + void OnMouseLeave(int localx, int localy) override; + void OnMouseDown(int x, int y, unsigned button) override; + void OnMouseUp(int x, int y, unsigned button) override; + void OnMouseClick(int localx, int localy, unsigned button) override; + void OnMouseUnclick(int localx, int localy, unsigned button) override; + void OnMouseWheel(int localx, int localy, int d) override; + void OnMouseWheelInside(int localx, int localy, int d) override; + void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; + void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; protected: // child components diff --git a/src/gui/interface/Textbox.h b/src/gui/interface/Textbox.h index 0f633896f..da8baf045 100644 --- a/src/gui/interface/Textbox.h +++ b/src/gui/interface/Textbox.h @@ -54,11 +54,11 @@ public: void OnContextMenuAction(int item) override; void OnMouseClick(int x, int y, unsigned button) override; void OnMouseUp(int x, int y, unsigned button) override; - void OnMouseMoved(int localx, int localy, int dx, int dy); + void OnMouseMoved(int localx, int localy, int dx, int dy) override; void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; void OnVKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; - void OnTextInput(String text); + void OnTextInput(String text) override; void Draw(const Point& screenPos) override; protected: diff --git a/src/gui/localbrowser/LocalBrowserController.cpp b/src/gui/localbrowser/LocalBrowserController.cpp index 323daebcd..1550012e0 100644 --- a/src/gui/localbrowser/LocalBrowserController.cpp +++ b/src/gui/localbrowser/LocalBrowserController.cpp @@ -37,7 +37,7 @@ void LocalBrowserController::RemoveSelected() public: LocalBrowserController * c; RemoveSelectedConfirmation(LocalBrowserController * c_) { c = c_; } - virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) { + void ConfirmCallback(ConfirmPrompt::DialogueResult result) override { if (result == ConfirmPrompt::ResultOkay) c->removeSelectedC(); } @@ -60,7 +60,7 @@ void LocalBrowserController::removeSelectedC() LocalBrowserController * c; public: RemoveSavesTask(LocalBrowserController * c, std::vector saves_) : c(c) { saves = saves_; } - virtual bool doWork() + bool doWork() override { for (size_t i = 0; i < saves.size(); i++) { @@ -70,7 +70,7 @@ void LocalBrowserController::removeSelectedC() } return true; } - virtual void after() + void after() override { Client::Ref().updateStamps(); c->RefreshSavesList(); @@ -87,7 +87,7 @@ void LocalBrowserController::RescanStamps() public: LocalBrowserController * c; RescanConfirmation(LocalBrowserController * c_) { c = c_; } - virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) { + void ConfirmCallback(ConfirmPrompt::DialogueResult result) override { if (result == ConfirmPrompt::ResultOkay) c->rescanStampsC(); } diff --git a/src/gui/localbrowser/LocalBrowserView.cpp b/src/gui/localbrowser/LocalBrowserView.cpp index bdb52b97b..8fa7faf89 100644 --- a/src/gui/localbrowser/LocalBrowserView.cpp +++ b/src/gui/localbrowser/LocalBrowserView.cpp @@ -33,7 +33,7 @@ LocalBrowserView::LocalBrowserView(): LocalBrowserView * v; public: PageNumAction(LocalBrowserView * _v) { v = _v; } - void TextChangedCallback(ui::Textbox * sender) + void TextChangedCallback(ui::Textbox * sender) override { v->textChanged(); } @@ -55,7 +55,7 @@ LocalBrowserView::LocalBrowserView(): int offset; public: RelativePageAction(LocalBrowserView * _v, int _offset): v(_v), offset(_offset) {} - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->SetPageRelative(offset); } @@ -73,7 +73,7 @@ LocalBrowserView::LocalBrowserView(): LocalBrowserView * v; public: UndeleteAction(LocalBrowserView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->RescanStamps(); } @@ -85,7 +85,7 @@ LocalBrowserView::LocalBrowserView(): LocalBrowserView * v; public: RemoveSelectedAction(LocalBrowserView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->RemoveSelected(); } @@ -182,12 +182,12 @@ void LocalBrowserView::NotifySavesListChanged(LocalBrowserModel * sender) LocalBrowserView * v; public: SaveOpenAction(LocalBrowserView * _v) { v = _v; } - virtual void ActionCallback(ui::SaveButton * sender) + void ActionCallback(ui::SaveButton * sender) override { if(sender->GetSaveFile()) v->c->OpenSave(sender->GetSaveFile()); } - virtual void SelectedCallback(ui::SaveButton * sender) + void SelectedCallback(ui::SaveButton * sender) override { if(sender->GetSaveFile()) v->c->Selected(sender->GetSaveFile()->GetName(), sender->GetSelected()); diff --git a/src/gui/localbrowser/LocalBrowserView.h b/src/gui/localbrowser/LocalBrowserView.h index ec6a4e732..225cdced8 100644 --- a/src/gui/localbrowser/LocalBrowserView.h +++ b/src/gui/localbrowser/LocalBrowserView.h @@ -32,14 +32,14 @@ class LocalBrowserView: public ui::Window { public: LocalBrowserView(); //virtual void OnDraw(); - virtual void OnTick(float dt); + void OnTick(float dt) override; void AttachController(LocalBrowserController * c_) { c = c_; } void NotifyPageChanged(LocalBrowserModel * sender); void NotifySavesListChanged(LocalBrowserModel * sender); void NotifySelectedChanged(LocalBrowserModel * sender); - virtual void OnMouseWheel(int x, int y, int d); - virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); - virtual void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); + void OnMouseWheel(int x, int y, int d) override; + void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; + void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; virtual ~LocalBrowserView(); }; diff --git a/src/gui/login/LoginView.cpp b/src/gui/login/LoginView.cpp index 29e087397..f7712fd0c 100644 --- a/src/gui/login/LoginView.cpp +++ b/src/gui/login/LoginView.cpp @@ -12,7 +12,7 @@ class LoginView::LoginAction : public ui::ButtonAction LoginView * v; public: LoginAction(LoginView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->Login(v->usernameField->GetText().ToUtf8(), v->passwordField->GetText().ToUtf8()); } @@ -23,7 +23,7 @@ class LoginView::CancelAction : public ui::ButtonAction LoginView * v; public: CancelAction(LoginView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->Exit(); } diff --git a/src/gui/login/LoginView.h b/src/gui/login/LoginView.h index fab947a12..0f2801a59 100644 --- a/src/gui/login/LoginView.h +++ b/src/gui/login/LoginView.h @@ -27,12 +27,12 @@ public: class LoginAction; class CancelAction; LoginView(); - virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); - virtual void OnTryExit(ExitMethod method); + void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; + void OnTryExit(ExitMethod method) override; void AttachController(LoginController * c_) { c = c_; } void NotifyStatusChanged(LoginModel * sender); - virtual void OnDraw(); - virtual void OnTick(float dt); + void OnDraw() override; + void OnTick(float dt) override; virtual ~LoginView(); }; diff --git a/src/gui/options/OptionsView.cpp b/src/gui/options/OptionsView.cpp index 3b26cab70..ee1a728ee 100644 --- a/src/gui/options/OptionsView.cpp +++ b/src/gui/options/OptionsView.cpp @@ -29,7 +29,9 @@ OptionsView::OptionsView(): OptionsView * v; public: HeatSimulationAction(OptionsView * v_){ v = v_; } - virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetHeatSimulation(sender->GetChecked()); } + void ActionCallback(ui::Checkbox * sender) override { + v->c->SetHeatSimulation(sender->GetChecked()); + } }; heatSimulation = new ui::Checkbox(ui::Point(8, 23), ui::Point(Size.X-6, 16), "Heat simulation \bgIntroduced in version 34", ""); @@ -44,7 +46,9 @@ OptionsView::OptionsView(): OptionsView * v; public: AmbientHeatSimulationAction(OptionsView * v_){ v = v_; } - virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetAmbientHeatSimulation(sender->GetChecked()); } + void ActionCallback(ui::Checkbox * sender) override { + v->c->SetAmbientHeatSimulation(sender->GetChecked()); + } }; ambientHeatSimulation = new ui::Checkbox(ui::Point(8, 53), ui::Point(Size.X-6, 16), "Ambient heat simulation \bgIntroduced in version 50", ""); @@ -59,7 +63,9 @@ OptionsView::OptionsView(): OptionsView * v; public: NewtonianGravityAction(OptionsView * v_){ v = v_; } - virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetNewtonianGravity(sender->GetChecked()); } + void ActionCallback(ui::Checkbox * sender) override { + v->c->SetNewtonianGravity(sender->GetChecked()); + } }; newtonianGravity = new ui::Checkbox(ui::Point(8, 83), ui::Point(Size.X-6, 16), "Newtonian gravity \bgIntroduced in version 48", ""); @@ -74,7 +80,9 @@ OptionsView::OptionsView(): OptionsView * v; public: WaterEqualisationAction(OptionsView * v_){ v = v_; } - virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetWaterEqualisation(sender->GetChecked()); } + void ActionCallback(ui::Checkbox * sender) override { + v->c->SetWaterEqualisation(sender->GetChecked()); + } }; waterEqualisation = new ui::Checkbox(ui::Point(8, 113), ui::Point(Size.X-6, 16), "Water equalisation \bgIntroduced in version 61", ""); @@ -89,7 +97,9 @@ OptionsView::OptionsView(): OptionsView * v; public: AirModeChanged(OptionsView * v): v(v) { } - virtual void OptionChanged(ui::DropDown * sender, std::pair option) { v->c->SetAirMode(option.second); } + void OptionChanged(ui::DropDown * sender, std::pair option) override { + v->c->SetAirMode(option.second); + } }; airMode = new ui::DropDown(ui::Point(Size.X-88, 146), ui::Point(80, 16)); AddComponent(airMode); @@ -109,7 +119,9 @@ OptionsView::OptionsView(): OptionsView * v; public: GravityModeChanged(OptionsView * v): v(v) { } - virtual void OptionChanged(ui::DropDown * sender, std::pair option) { v->c->SetGravityMode(option.second); } + void OptionChanged(ui::DropDown * sender, std::pair option) override { + v->c->SetGravityMode(option.second); + } }; gravityMode = new ui::DropDown(ui::Point(Size.X-88, 166), ui::Point(80, 16)); @@ -128,7 +140,9 @@ OptionsView::OptionsView(): OptionsView * v; public: EdgeModeChanged(OptionsView * v): v(v) { } - virtual void OptionChanged(ui::DropDown * sender, std::pair option) { v->c->SetEdgeMode(option.second); } + void OptionChanged(ui::DropDown * sender, std::pair option) override { + v->c->SetEdgeMode(option.second); + } }; edgeMode = new ui::DropDown(ui::Point(Size.X-88, 186), ui::Point(80, 16)); @@ -147,7 +161,9 @@ OptionsView::OptionsView(): OptionsView * v; public: ScaleAction(OptionsView * v): v(v) { } - virtual void OptionChanged(ui::DropDown * sender, std::pair option) { v->c->SetScale(option.second); } + void OptionChanged(ui::DropDown * sender, std::pair option) override { + v->c->SetScale(option.second); + } }; scale = new ui::DropDown(ui::Point(8, 210), ui::Point(40, 16)); { @@ -178,7 +194,7 @@ OptionsView::OptionsView(): OptionsView * v; public: ResizableAction(OptionsView * v_){ v = v_; } - virtual void ActionCallback(ui::Checkbox * sender) + void ActionCallback(ui::Checkbox * sender) override { v->c->SetResizable(sender->GetChecked()); } @@ -196,7 +212,7 @@ OptionsView::OptionsView(): OptionsView * v; public: FullscreenAction(OptionsView * v_){ v = v_; } - virtual void ActionCallback(ui::Checkbox * sender) + void ActionCallback(ui::Checkbox * sender) override { v->c->SetFullscreen(sender->GetChecked()); } @@ -214,7 +230,7 @@ OptionsView::OptionsView(): OptionsView * v; public: AltFullscreenAction(OptionsView * v_){ v = v_; } - virtual void ActionCallback(ui::Checkbox * sender) + void ActionCallback(ui::Checkbox * sender) override { v->c->SetAltFullscreen(sender->GetChecked()); } @@ -232,7 +248,7 @@ OptionsView::OptionsView(): OptionsView * v; public: ForceIntegerScalingAction(OptionsView * v_) { v = v_; } - virtual void ActionCallback(ui::Checkbox * sender) + void ActionCallback(ui::Checkbox * sender) override { v->c->SetForceIntegerScaling(sender->GetChecked()); } @@ -251,7 +267,9 @@ OptionsView::OptionsView(): OptionsView * v; public: FastQuitAction(OptionsView * v_){ v = v_; } - virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetFastQuit(sender->GetChecked()); } + void ActionCallback(ui::Checkbox * sender) override { + v->c->SetFastQuit(sender->GetChecked()); + } }; fastquit = new ui::Checkbox(ui::Point(8, forceIntegerScaling->Position.Y + 20), ui::Point(Size.X-6, 16), "Fast Quit", ""); @@ -266,7 +284,9 @@ OptionsView::OptionsView(): OptionsView * v; public: ShowAvatarsAction(OptionsView * v_){ v = v_; } - virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetShowAvatars(sender->GetChecked()); } + void ActionCallback(ui::Checkbox * sender) override { + v->c->SetShowAvatars(sender->GetChecked()); + } }; showAvatars = new ui::Checkbox(ui::Point(8, fastquit->Position.Y + 20), ui::Point(Size.X-6, 16), "Show Avatars", ""); @@ -280,7 +300,7 @@ OptionsView::OptionsView(): { public: DataFolderAction() { } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { //one of these should always be defined #ifdef WIN @@ -310,7 +330,7 @@ OptionsView::OptionsView(): public: OptionsView * v; CloseAction(OptionsView * v_) { v = v_; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->Exit(); } diff --git a/src/gui/options/OptionsView.h b/src/gui/options/OptionsView.h index f8c632d12..5dd19b808 100644 --- a/src/gui/options/OptionsView.h +++ b/src/gui/options/OptionsView.h @@ -30,8 +30,8 @@ public: OptionsView(); void NotifySettingsChanged(OptionsModel * sender); void AttachController(OptionsController * c_); - void OnDraw(); - void OnTryExit(ExitMethod method); + void OnDraw() override; + void OnTryExit(ExitMethod method) override; virtual ~OptionsView(); }; diff --git a/src/gui/preview/PreviewController.h b/src/gui/preview/PreviewController.h index 2b64157e4..eda620190 100644 --- a/src/gui/preview/PreviewController.h +++ b/src/gui/preview/PreviewController.h @@ -18,7 +18,7 @@ class PreviewController: public ClientListener { LoginController * loginWindow; ControllerCallback * callback; public: - virtual void NotifyAuthUserChanged(Client * sender); + void NotifyAuthUserChanged(Client * sender) override; inline int SaveID() { return saveId; } bool HasExited; diff --git a/src/gui/preview/PreviewModelException.h b/src/gui/preview/PreviewModelException.h index c84894a26..42656d7ca 100644 --- a/src/gui/preview/PreviewModelException.h +++ b/src/gui/preview/PreviewModelException.h @@ -9,11 +9,11 @@ struct PreviewModelException: public exception { String message; public: PreviewModelException(String message_): message(message_) {} - const char * what() const throw() + const char * what() const throw() override { return message.ToUtf8().c_str(); } - ~PreviewModelException() throw() {}; + ~PreviewModelException() throw() {} }; #endif /* PREVIEWMODELEXCEPTION_H_ */ diff --git a/src/gui/preview/PreviewView.cpp b/src/gui/preview/PreviewView.cpp index 23e20702c..b6fd939be 100644 --- a/src/gui/preview/PreviewView.cpp +++ b/src/gui/preview/PreviewView.cpp @@ -22,7 +22,7 @@ class PreviewView::LoginAction: public ui::ButtonAction PreviewView * v; public: LoginAction(PreviewView * v_){ v = v_; } - virtual void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->ShowLogin(); } @@ -33,7 +33,7 @@ class PreviewView::SubmitCommentAction: public ui::ButtonAction PreviewView * v; public: SubmitCommentAction(PreviewView * v_){ v = v_; } - virtual void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->submitComment(); } @@ -44,7 +44,7 @@ class PreviewView::AutoCommentSizeAction: public ui::TextboxAction PreviewView * v; public: AutoCommentSizeAction(PreviewView * v): v(v) {} - virtual void TextChangedCallback(ui::Textbox * sender) { + void TextChangedCallback(ui::Textbox * sender) override { v->CheckComment(); v->commentBoxAutoHeight(); } @@ -55,7 +55,7 @@ class PreviewView::AvatarAction: public ui::AvatarButtonAction PreviewView * v; public: AvatarAction(PreviewView * v_){ v = v_; } - virtual void ActionCallback(ui::AvatarButton * sender) + void ActionCallback(ui::AvatarButton * sender) override { if(sender->GetUsername().size() > 0) { @@ -84,7 +84,7 @@ PreviewView::PreviewView(): PreviewView * v; public: FavAction(PreviewView * v_){ v = v_; } - virtual void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->FavouriteSave(); } @@ -103,7 +103,7 @@ PreviewView::PreviewView(): public: PreviewView * v; ReportPromptCallback(PreviewView * v_) { v = v_; } - virtual void TextCallback(TextPrompt::DialogueResult result, String resultText) { + void TextCallback(TextPrompt::DialogueResult result, String resultText) override { if (result == TextPrompt::ResultOkay) v->c->Report(resultText); } @@ -115,7 +115,7 @@ PreviewView::PreviewView(): PreviewView * v; public: ReportAction(PreviewView * v_){ v = v_; } - virtual void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { new TextPrompt("Report Save", "Things to consider when reporting:\n\bw1)\bg When reporting stolen saves, please include the ID of the original save.\n\bw2)\bg Do not ask for saves to be removed from front page unless they break the rules.\n\bw3)\bg You may report saves for comments or tags too (including your own saves)", "", "[reason]", true, new ReportPromptCallback(v)); } @@ -132,7 +132,7 @@ PreviewView::PreviewView(): PreviewView * v; public: OpenAction(PreviewView * v_){ v = v_; } - virtual void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->DoOpen(); } @@ -148,7 +148,7 @@ PreviewView::PreviewView(): PreviewView * v; public: BrowserOpenAction(PreviewView * v_){ v = v_; } - virtual void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->OpenInBrowser(); } diff --git a/src/gui/preview/PreviewView.h b/src/gui/preview/PreviewView.h index a082af468..587332258 100644 --- a/src/gui/preview/PreviewView.h +++ b/src/gui/preview/PreviewView.h @@ -79,13 +79,13 @@ public: void NotifyCommentsPageChanged(PreviewModel * sender); void NotifyCommentBoxEnabledChanged(PreviewModel * sender); void SaveLoadingError(String errorMessage); - virtual void OnDraw(); - virtual void DoDraw(); - virtual void OnTick(float dt); - virtual void OnTryExit(ExitMethod method); - virtual void OnMouseWheel(int x, int y, int d); - virtual void OnMouseUp(int x, int y, unsigned int button); - virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); + void OnDraw() override; + void DoDraw() override; + void OnTick(float dt) override; + void OnTryExit(ExitMethod method) override; + void OnMouseWheel(int x, int y, int d) override; + void OnMouseUp(int x, int y, unsigned int button) override; + void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; virtual ~PreviewView(); }; diff --git a/src/gui/profile/ProfileActivity.cpp b/src/gui/profile/ProfileActivity.cpp index d0ec53b1a..0cbb383b6 100644 --- a/src/gui/profile/ProfileActivity.cpp +++ b/src/gui/profile/ProfileActivity.cpp @@ -28,7 +28,7 @@ ProfileActivity::ProfileActivity(ByteString username) : ProfileActivity * a; public: CloseAction(ProfileActivity * a) : a(a) { } - void ActionCallback(ui::Button * sender_) + void ActionCallback(ui::Button * sender_) override { a->Exit(); } @@ -39,7 +39,7 @@ ProfileActivity::ProfileActivity(ByteString username) : ProfileActivity * a; public: SaveAction(ProfileActivity * a) : a(a) { } - void ActionCallback(ui::Button * sender_) + void ActionCallback(ui::Button * sender_) override { if (!a->loading && !a->saving && a->editable) { @@ -79,7 +79,7 @@ void ProfileActivity::setUserInfo(UserInfo newInfo) class EditAvatarAction: public ui::ButtonAction { public: - void ActionCallback(ui::Button * sender_) + void ActionCallback(ui::Button * sender_) override { Platform::OpenURI("http://" SERVER "/Profile/Avatar.html"); } @@ -206,7 +206,7 @@ void ProfileActivity::setUserInfo(UserInfo newInfo) public: ProfileActivity * profileActivity; BioChangedAction(ProfileActivity * profileActivity_) { profileActivity = profileActivity_; } - virtual void TextChangedCallback(ui::Textbox * sender) + void TextChangedCallback(ui::Textbox * sender) override { profileActivity->ResizeArea(); } diff --git a/src/gui/profile/ProfileActivity.h b/src/gui/profile/ProfileActivity.h index a1d897a63..a811c2cac 100644 --- a/src/gui/profile/ProfileActivity.h +++ b/src/gui/profile/ProfileActivity.h @@ -30,9 +30,9 @@ class ProfileActivity: public WindowActivity, public SaveUserInfoRequestMonitor, public: ProfileActivity(ByteString username); virtual ~ProfileActivity(); - virtual void OnTick(float dt); - virtual void OnDraw(); - virtual void OnTryExit(ExitMethod method); + void OnTick(float dt) override; + void OnDraw() override; + void OnTryExit(ExitMethod method) override; void OnResponse(bool saveUserInfoStatus) override; void OnResponse(std::unique_ptr getUserInfoResult) override; diff --git a/src/gui/render/RenderView.cpp b/src/gui/render/RenderView.cpp index cfc20c39b..526382641 100644 --- a/src/gui/render/RenderView.cpp +++ b/src/gui/render/RenderView.cpp @@ -13,7 +13,7 @@ public: v = v_; renderMode = renderMode_; } - virtual void ActionCallback(ui::Checkbox * sender) + void ActionCallback(ui::Checkbox * sender) override { if(sender->GetChecked()) v->c->SetRenderMode(renderMode); @@ -32,7 +32,7 @@ public: v = v_; displayMode = displayMode_; } - virtual void ActionCallback(ui::Checkbox * sender) + void ActionCallback(ui::Checkbox * sender) override { if(sender->GetChecked()) v->c->SetDisplayMode(displayMode); @@ -51,7 +51,7 @@ public: v = v_; colourMode = colourMode_; } - virtual void ActionCallback(ui::Checkbox * sender) + void ActionCallback(ui::Checkbox * sender) override { if(sender->GetChecked()) v->c->SetColourMode(colourMode); @@ -70,7 +70,7 @@ public: v = v_; renderPreset = renderPreset_; } - virtual void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->LoadRenderPreset(renderPreset); } diff --git a/src/gui/render/RenderView.h b/src/gui/render/RenderView.h index 9b0e5892f..ba83ba54b 100644 --- a/src/gui/render/RenderView.h +++ b/src/gui/render/RenderView.h @@ -33,12 +33,12 @@ public: void NotifyDisplayChanged(RenderModel * sender); void NotifyColourChanged(RenderModel * sender); void AttachController(RenderController * c_) { c = c_; } - void OnMouseDown(int x, int y, unsigned button); - void OnTryExit(ExitMethod method); - virtual void OnDraw(); - virtual void OnTick(float dt); - virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); - virtual void ToolTip(ui::Point senderPosition, String toolTip); + void OnMouseDown(int x, int y, unsigned button) override; + void OnTryExit(ExitMethod method) override; + void OnDraw() override; + void OnTick(float dt) override; + void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; + void ToolTip(ui::Point senderPosition, String toolTip) override; virtual ~RenderView(); }; diff --git a/src/gui/save/LocalSaveActivity.cpp b/src/gui/save/LocalSaveActivity.cpp index 29bc67b47..7df1ec07e 100644 --- a/src/gui/save/LocalSaveActivity.cpp +++ b/src/gui/save/LocalSaveActivity.cpp @@ -19,7 +19,7 @@ class LocalSaveActivity::CancelAction: public ui::ButtonAction LocalSaveActivity * a; public: CancelAction(LocalSaveActivity * a) : a(a) {} - virtual void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { a->Exit(); } @@ -30,7 +30,7 @@ class LocalSaveActivity::SaveAction: public ui::ButtonAction LocalSaveActivity * a; public: SaveAction(LocalSaveActivity * a) : a(a) {} - virtual void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { a->Save(); } @@ -97,7 +97,7 @@ void LocalSaveActivity::Save() LocalSaveActivity * a; ByteString filename; FileOverwriteConfirmation(LocalSaveActivity * a, ByteString finalFilename) : a(a), filename(finalFilename) {} - virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) { + void ConfirmCallback(ConfirmPrompt::DialogueResult result) override { if (result == ConfirmPrompt::ResultOkay) { a->saveWrite(filename); diff --git a/src/gui/save/LocalSaveActivity.h b/src/gui/save/LocalSaveActivity.h index 02636bcc0..02a5a1c7d 100644 --- a/src/gui/save/LocalSaveActivity.h +++ b/src/gui/save/LocalSaveActivity.h @@ -35,8 +35,8 @@ class LocalSaveActivity: public WindowActivity public: LocalSaveActivity(SaveFile save, FileSavedCallback * callback); void saveWrite(ByteString finalFilename); - virtual void Save(); - virtual void OnDraw(); - virtual void OnTick(float dt); + void Save(); + void OnDraw() override; + void OnTick(float dt) override; virtual ~LocalSaveActivity(); }; diff --git a/src/gui/save/ServerSaveActivity.cpp b/src/gui/save/ServerSaveActivity.cpp index e7ba58e5f..496d33e2b 100644 --- a/src/gui/save/ServerSaveActivity.cpp +++ b/src/gui/save/ServerSaveActivity.cpp @@ -20,7 +20,7 @@ class ServerSaveActivity::CancelAction: public ui::ButtonAction ServerSaveActivity * a; public: CancelAction(ServerSaveActivity * a) : a(a) {} - virtual void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { a->Exit(); } @@ -31,7 +31,7 @@ class ServerSaveActivity::SaveAction: public ui::ButtonAction ServerSaveActivity * a; public: SaveAction(ServerSaveActivity * a) : a(a) {} - virtual void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { a->Save(); } @@ -42,7 +42,7 @@ class ServerSaveActivity::PublishingAction: public ui::ButtonAction ServerSaveActivity * a; public: PublishingAction(ServerSaveActivity * a) : a(a) {} - virtual void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { a->ShowPublishingInfo(); } @@ -53,7 +53,7 @@ class ServerSaveActivity::RulesAction: public ui::ButtonAction ServerSaveActivity * a; public: RulesAction(ServerSaveActivity * a) : a(a) {} - virtual void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { a->ShowRules(); } @@ -64,7 +64,7 @@ class ServerSaveActivity::NameChangedAction: public ui::TextboxAction public: ServerSaveActivity * a; NameChangedAction(ServerSaveActivity * a) : a(a) {} - virtual void TextChangedCallback(ui::Textbox * sender) { + void TextChangedCallback(ui::Textbox * sender) override { a->CheckName(sender->GetText()); } }; @@ -73,17 +73,17 @@ class SaveUploadTask: public Task { SaveInfo save; - virtual void before() + void before() override { } - virtual void after() + void after() override { } - virtual bool doWork() + bool doWork() override { notifyProgress(-1); return Client::Ref().UploadSave(save) == RequestOkay; @@ -233,7 +233,7 @@ void ServerSaveActivity::Save() public: ServerSaveActivity * a; PublishConfirmation(ServerSaveActivity * a) : a(a) {} - virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) { + void ConfirmCallback(ConfirmPrompt::DialogueResult result) override { if (result == ConfirmPrompt::ResultOkay) { a->Exit(); diff --git a/src/gui/save/ServerSaveActivity.h b/src/gui/save/ServerSaveActivity.h index 34cec5575..6afe0508b 100644 --- a/src/gui/save/ServerSaveActivity.h +++ b/src/gui/save/ServerSaveActivity.h @@ -29,17 +29,17 @@ public: ServerSaveActivity(SaveInfo save, SaveUploadedCallback * callback); ServerSaveActivity(SaveInfo save, bool saveNow, SaveUploadedCallback * callback); void saveUpload(); - virtual void Save(); - virtual void Exit(); - virtual void ShowPublishingInfo(); - virtual void ShowRules(); - virtual void CheckName(String newname); - virtual void OnDraw(); - virtual void OnTick(float dt); + void Save(); + virtual void Exit() override; + void ShowPublishingInfo(); + void ShowRules(); + void CheckName(String newname); + virtual void OnDraw() override; + virtual void OnTick(float dt) override; virtual ~ServerSaveActivity(); protected: void AddAuthorInfo(); - virtual void NotifyDone(Task * task); + void NotifyDone(Task * task) override; ThumbnailRendererTask *thumbnailRenderer; std::unique_ptr thumbnail; SaveInfo save; diff --git a/src/gui/search/SearchController.cpp b/src/gui/search/SearchController.cpp index 7e94135bd..2b80fc6b4 100644 --- a/src/gui/search/SearchController.cpp +++ b/src/gui/search/SearchController.cpp @@ -17,7 +17,7 @@ class SearchController::OpenCallback: public ControllerCallback SearchController * cc; public: OpenCallback(SearchController * cc_) { cc = cc_; } - virtual void ControllerExit() + void ControllerExit() override { if(cc->activePreview->GetDoOpen() && cc->activePreview->GetSaveInfo()) { @@ -224,7 +224,7 @@ void SearchController::RemoveSelected() public: SearchController * c; RemoveSelectedConfirmation(SearchController * c_) { c = c_; } - virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) { + void ConfirmCallback(ConfirmPrompt::DialogueResult result) override { if (result == ConfirmPrompt::ResultOkay) c->removeSelectedC(); } @@ -247,7 +247,7 @@ void SearchController::removeSelectedC() std::vector saves; public: RemoveSavesTask(std::vector saves_, SearchController *c_) { saves = saves_; c = c_; } - virtual bool doWork() + bool doWork() override { for (size_t i = 0; i < saves.size(); i++) { @@ -278,7 +278,7 @@ void SearchController::UnpublishSelected(bool publish) SearchController * c; bool publish; UnpublishSelectedConfirmation(SearchController * c_, bool publish_) { c = c_; publish = publish_; } - virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) { + void ConfirmCallback(ConfirmPrompt::DialogueResult result) override { if (result == ConfirmPrompt::ResultOkay) c->unpublishSelectedC(publish); } @@ -319,7 +319,7 @@ void SearchController::unpublishSelectedC(bool publish) return true; } - virtual bool doWork() + bool doWork() override { bool ret; for (size_t i = 0; i < saves.size(); i++) @@ -355,7 +355,7 @@ void SearchController::FavouriteSelected() std::vector saves; public: FavouriteSavesTask(std::vector saves_) { saves = saves_; } - virtual bool doWork() + bool doWork() override { for (size_t i = 0; i < saves.size(); i++) { @@ -376,7 +376,7 @@ void SearchController::FavouriteSelected() std::vector saves; public: UnfavouriteSavesTask(std::vector saves_) { saves = saves_; } - virtual bool doWork() + bool doWork() override { for (size_t i = 0; i < saves.size(); i++) { diff --git a/src/gui/search/SearchView.cpp b/src/gui/search/SearchView.cpp index c1b1cf30a..ee08a8208 100644 --- a/src/gui/search/SearchView.cpp +++ b/src/gui/search/SearchView.cpp @@ -38,7 +38,7 @@ SearchView::SearchView(): SearchView * v; public: PageNumAction(SearchView * _v) { v = _v; } - void TextChangedCallback(ui::Textbox * sender) + void TextChangedCallback(ui::Textbox * sender) override { v->textChanged(); } @@ -59,7 +59,7 @@ SearchView::SearchView(): SearchView * v; public: SearchAction(SearchView * _v) { v = _v; } - void TextChangedCallback(ui::Textbox * sender) + void TextChangedCallback(ui::Textbox * sender) override { v->doSearch(); } @@ -77,7 +77,7 @@ SearchView::SearchView(): SearchView * v; public: SortAction(SearchView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->ChangeSort(); } @@ -95,7 +95,7 @@ SearchView::SearchView(): SearchView * v; public: MyOwnAction(SearchView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->ShowOwn(sender->GetToggleState()); } @@ -113,7 +113,7 @@ SearchView::SearchView(): SearchView * v; public: FavAction(SearchView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->ShowFavourite(sender->GetToggleState()); } @@ -133,7 +133,7 @@ SearchView::SearchView(): SearchView * v; public: ClearSearchAction(SearchView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->clearSearch(); } @@ -154,7 +154,7 @@ SearchView::SearchView(): int offset; public: RelativePageAction(SearchView * _v, int _offset): v(_v), offset(_offset) {} - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->SetPageRelative(offset); } @@ -184,7 +184,7 @@ SearchView::SearchView(): SearchView * v; public: RemoveSelectedAction(SearchView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->RemoveSelected(); } @@ -195,7 +195,7 @@ SearchView::SearchView(): SearchView * v; public: UnpublishSelectedAction(SearchView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->UnpublishSelected(v->publishButtonShown); } @@ -206,7 +206,7 @@ SearchView::SearchView(): SearchView * v; public: FavouriteSelectedAction(SearchView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->FavouriteSelected(); } @@ -217,7 +217,7 @@ SearchView::SearchView(): SearchView * v; public: ClearSelectionAction(SearchView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->ClearSelection(); } @@ -519,7 +519,7 @@ void SearchView::NotifyTagListChanged(SearchModel * sender) ByteString tag; public: TagAction(SearchView * v, ByteString tag) : v(v), tag(tag) {} - virtual void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->Search(tag.FromUtf8()); } @@ -668,19 +668,19 @@ void SearchView::NotifySaveListChanged(SearchModel * sender) SearchView * v; public: SaveOpenAction(SearchView * _v) { v = _v; } - virtual void ActionCallback(ui::SaveButton * sender) + void ActionCallback(ui::SaveButton * sender) override { v->c->OpenSave(sender->GetSave()->GetID(), sender->GetSave()->GetVersion()); } - virtual void SelectedCallback(ui::SaveButton * sender) + void SelectedCallback(ui::SaveButton * sender) override { v->c->Selected(sender->GetSave()->GetID(), sender->GetSelected()); } - virtual void AltActionCallback(ui::SaveButton * sender) + void AltActionCallback(ui::SaveButton * sender) override { v->Search(String::Build("history:", sender->GetSave()->GetID())); } - virtual void AltActionCallback2(ui::SaveButton * sender) + void AltActionCallback2(ui::SaveButton * sender) override { v->Search(String::Build("user:", sender->GetSave()->GetUserName().FromUtf8())); } diff --git a/src/gui/search/SearchView.h b/src/gui/search/SearchView.h index 14d1ec216..36aea6dee 100644 --- a/src/gui/search/SearchView.h +++ b/src/gui/search/SearchView.h @@ -59,18 +59,18 @@ public: void NotifySortChanged(SearchModel * sender); void NotifyShowOwnChanged(SearchModel * sender); void NotifyShowFavouriteChanged(SearchModel * sender); - void NotifyAuthUserChanged(Client * sender); - void NotifyMessageOfTheDay(Client * sender); + void NotifyAuthUserChanged(Client * sender) override; + void NotifyMessageOfTheDay(Client * sender) override; void CheckAccess(); - virtual void OnTryOkay(OkayMethod method); + void OnTryOkay(OkayMethod method) override; SearchView(); virtual ~SearchView(); void AttachController(SearchController * _c) { c = _c; } virtual void Search(String); - virtual void OnTick(float dt); - virtual void OnMouseWheel(int x, int y, int d); - virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); - virtual void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); + void OnTick(float dt) override; + void OnMouseWheel(int x, int y, int d) override; + void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; + void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; }; diff --git a/src/gui/tags/TagsView.cpp b/src/gui/tags/TagsView.cpp index f72243898..48b9817c7 100644 --- a/src/gui/tags/TagsView.cpp +++ b/src/gui/tags/TagsView.cpp @@ -21,7 +21,7 @@ TagsView::TagsView(): TagsView * v; public: CloseAction(TagsView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->c->Exit(); } @@ -45,7 +45,7 @@ TagsView::TagsView(): TagsView * v; public: AddTagAction(TagsView * _v) { v = _v; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { v->addTag(); } @@ -90,7 +90,7 @@ void TagsView::NotifyTagsChanged(TagsModel * sender) ByteString tag; public: DeleteTagAction(TagsView * _v, ByteString tag) { v = _v; this->tag = tag; } - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { try { diff --git a/src/gui/tags/TagsView.h b/src/gui/tags/TagsView.h index ff572864b..da2366ab4 100644 --- a/src/gui/tags/TagsView.h +++ b/src/gui/tags/TagsView.h @@ -23,9 +23,9 @@ class TagsView: public ui::Window { void addTag(); public: TagsView(); - virtual void OnDraw(); + void OnDraw() override; void AttachController(TagsController * c_) { c = c_; } - virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt); + void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; void NotifyTagsChanged(TagsModel * sender); virtual ~TagsView(); }; diff --git a/src/gui/update/UpdateActivity.cpp b/src/gui/update/UpdateActivity.cpp index 07f71bb66..8115e8119 100644 --- a/src/gui/update/UpdateActivity.cpp +++ b/src/gui/update/UpdateActivity.cpp @@ -16,14 +16,14 @@ public: private: UpdateActivity * a; ByteString updateName; - virtual void notifyDoneMain(){ + void notifyDoneMain() override { a->NotifyDone(this); } - virtual void notifyErrorMain() + void notifyErrorMain() override { a->NotifyError(this); } - virtual bool doWork() + bool doWork() override { String error; http::Request *request = new http::Request(updateName); @@ -145,7 +145,7 @@ void UpdateActivity::NotifyError(Task * sender) UpdateActivity * a; public: ErrorMessageCallback(UpdateActivity * a_) { a = a_; } - virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) { + void ConfirmCallback(ConfirmPrompt::DialogueResult result) override { if (result == ConfirmPrompt::ResultOkay) { #ifndef UPDATESERVER diff --git a/src/json/json.h b/src/json/json.h index 7145b1a4e..aa7ad0919 100644 --- a/src/json/json.h +++ b/src/json/json.h @@ -1529,7 +1529,7 @@ public: CharReaderBuilder(); virtual ~CharReaderBuilder(); - virtual CharReader* newCharReader() const; + CharReader* newCharReader() const override; /** \return true if 'settings' are legal and consistent; * otherwise, indicate bad settings via 'invalid'. @@ -1725,7 +1725,7 @@ public: /** * \throw std::exception if something goes wrong (e.g. invalid settings) */ - virtual StreamWriter* newStreamWriter() const; + StreamWriter* newStreamWriter() const override; /** \return true if 'settings' are legal and consistent; * otherwise, indicate bad settings via 'invalid'. @@ -1780,7 +1780,7 @@ public: void omitEndingLineFeed(); public: // overridden from Writer - virtual std::string write(const Value& root); + std::string write(const Value& root) override; private: void writeValue(const Value& value); @@ -1825,7 +1825,7 @@ public: // overridden from Writer * \param root Value to serialize. * \return String containing the JSON document that represents the root value. */ - virtual std::string write(const Value& root); + std::string write(const Value& root) override; private: void writeValue(const Value& value); diff --git a/src/json/jsoncpp.cpp b/src/json/jsoncpp.cpp index 49569f918..917617ab1 100644 --- a/src/json/jsoncpp.cpp +++ b/src/json/jsoncpp.cpp @@ -2060,9 +2060,9 @@ public: : collectComments_(collectComments) , reader_(features) {} - virtual bool parse( + bool parse( char const* beginDoc, char const* endDoc, - Value* root, std::string* errs) { + Value* root, std::string* errs) override { bool ok = reader_.parse(beginDoc, endDoc, *root, collectComments_); if (errs) { *errs = reader_.getFormattedErrorMessages(); @@ -2534,7 +2534,7 @@ class JSON_API Exception : public std::exception { public: Exception(std::string const& msg); virtual ~Exception() throw(); - virtual char const* what() const throw(); + char const* what() const throw() override; protected: std::string const msg_; }; @@ -4750,7 +4750,7 @@ struct BuiltStyledStreamWriter : public StreamWriter std::string const& colonSymbol, std::string const& nullSymbol, std::string const& endingLineFeedSymbol); - virtual int write(Value const& root, std::ostream* sout); + int write(Value const& root, std::ostream* sout) override; private: void writeValue(Value const& value); void writeArrayValue(Value const& value); diff --git a/src/lua/LuaButton.cpp b/src/lua/LuaButton.cpp index e13e83f32..5f0a4a174 100644 --- a/src/lua/LuaButton.cpp +++ b/src/lua/LuaButton.cpp @@ -36,7 +36,7 @@ LuaButton::LuaButton(lua_State * l) : LuaButton * luaButton; public: ClickAction(LuaButton * luaButton) : luaButton(luaButton) {} - void ActionCallback(ui::Button * sender) + void ActionCallback(ui::Button * sender) override { luaButton->triggerAction(); } diff --git a/src/lua/LuaCheckbox.cpp b/src/lua/LuaCheckbox.cpp index 6e9453468..f37d61c09 100644 --- a/src/lua/LuaCheckbox.cpp +++ b/src/lua/LuaCheckbox.cpp @@ -35,7 +35,7 @@ LuaCheckbox::LuaCheckbox(lua_State * l) : LuaCheckbox * luaCheckbox; public: ClickAction(LuaCheckbox * luaCheckbox) : luaCheckbox(luaCheckbox) {} - void ActionCallback(ui::Checkbox * sender) + void ActionCallback(ui::Checkbox * sender) override { luaCheckbox->triggerAction(); } diff --git a/src/lua/LuaScriptInterface.h b/src/lua/LuaScriptInterface.h index 7586fe8a6..41d267763 100644 --- a/src/lua/LuaScriptInterface.h +++ b/src/lua/LuaScriptInterface.h @@ -188,13 +188,13 @@ public: lua_State *l; LuaScriptInterface(GameController * c, GameModel * m); - virtual void OnTick(); - virtual bool HandleEvent(LuaEvents::EventTypes eventType, Event * event); + void OnTick() override; + bool HandleEvent(LuaEvents::EventTypes eventType, Event * event) override; - virtual void Init(); - virtual void SetWindow(ui::Window * window); - virtual int Command(String command); - virtual String FormatCommand(String command); + void Init(); + void SetWindow(ui::Window * window); + int Command(String command) override; + String FormatCommand(String command) override; virtual ~LuaScriptInterface(); }; diff --git a/src/lua/LuaSlider.cpp b/src/lua/LuaSlider.cpp index 1034f9346..b215c7c0d 100644 --- a/src/lua/LuaSlider.cpp +++ b/src/lua/LuaSlider.cpp @@ -35,7 +35,7 @@ LuaSlider::LuaSlider(lua_State * l) : LuaSlider * luaSlider; public: ValueAction(LuaSlider * luaSlider) : luaSlider(luaSlider) {} - void ValueChangedCallback(ui::Slider * sender) + void ValueChangedCallback(ui::Slider * sender) override { luaSlider->triggerOnValueChanged(); } diff --git a/src/lua/LuaTextbox.cpp b/src/lua/LuaTextbox.cpp index c3cd6c97a..78dd3d822 100644 --- a/src/lua/LuaTextbox.cpp +++ b/src/lua/LuaTextbox.cpp @@ -37,7 +37,7 @@ LuaTextbox::LuaTextbox(lua_State * l) : LuaTextbox * t; public: TextChangedAction(LuaTextbox * t) : t(t) {} - void TextChangedCallback(ui::Textbox * sender) + void TextChangedCallback(ui::Textbox * sender) override { t->triggerOnTextChanged(); } diff --git a/src/lua/LuaWindow.cpp b/src/lua/LuaWindow.cpp index dedb17ec2..de6717532 100644 --- a/src/lua/LuaWindow.cpp +++ b/src/lua/LuaWindow.cpp @@ -80,26 +80,26 @@ LuaWindow::LuaWindow(lua_State * l) : LuaWindow * luaWindow; public: DrawnWindow(ui::Point position, ui::Point size, LuaWindow * luaWindow) : ui::Window(position, size), luaWindow(luaWindow) {} - virtual void OnDraw() + void OnDraw() override { Graphics * g = ui::Engine::Ref().g; g->clearrect(Position.X-2, Position.Y-2, Size.X+4, Size.Y+4); g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255); luaWindow->triggerOnDraw(); } - virtual void OnInitialized() { luaWindow->triggerOnInitialized(); } - virtual void OnExit() { luaWindow->triggerOnExit(); } - virtual void OnTick(float dt) { luaWindow->triggerOnTick( dt); } - virtual void OnFocus() { luaWindow->triggerOnFocus(); } - virtual void OnBlur() { luaWindow->triggerOnBlur(); } - virtual void OnTryExit(ExitMethod) { luaWindow->triggerOnTryExit(); } - virtual void OnTryOkay(OkayMethod) { luaWindow->triggerOnTryOkay(); } - virtual void OnMouseMove(int x, int y, int dx, int dy) { luaWindow->triggerOnMouseMove(x, y, dx, dy); } - virtual void OnMouseDown(int x, int y, unsigned button) { luaWindow->triggerOnMouseDown(x, y, button); } - virtual void OnMouseUp(int x, int y, unsigned button) { luaWindow->triggerOnMouseUp(x, y, button); } - virtual void OnMouseWheel(int x, int y, int d) { luaWindow->triggerOnMouseWheel(x, y, d); } - virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) { luaWindow->triggerOnKeyPress(key, scan, repeat, shift, ctrl, alt); } - virtual void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) { luaWindow->triggerOnKeyRelease(key, scan, repeat, shift, ctrl, alt); } + void OnInitialized() override { luaWindow->triggerOnInitialized(); } + void OnExit() override { luaWindow->triggerOnExit(); } + void OnTick(float dt) override { luaWindow->triggerOnTick( dt); } + void OnFocus() override { luaWindow->triggerOnFocus(); } + void OnBlur() override { luaWindow->triggerOnBlur(); } + void OnTryExit(ExitMethod) override { luaWindow->triggerOnTryExit(); } + void OnTryOkay(OkayMethod) override { luaWindow->triggerOnTryOkay(); } + void OnMouseMove(int x, int y, int dx, int dy) override { luaWindow->triggerOnMouseMove(x, y, dx, dy); } + void OnMouseDown(int x, int y, unsigned button) override { luaWindow->triggerOnMouseDown(x, y, button); } + void OnMouseUp(int x, int y, unsigned button) override { luaWindow->triggerOnMouseUp(x, y, button); } + void OnMouseWheel(int x, int y, int d) override { luaWindow->triggerOnMouseWheel(x, y, d); } + void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override { luaWindow->triggerOnKeyPress(key, scan, repeat, shift, ctrl, alt); } + void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override { luaWindow->triggerOnKeyRelease(key, scan, repeat, shift, ctrl, alt); } }; window = new DrawnWindow(ui::Point(posX, posY), ui::Point(sizeX, sizeY), this); diff --git a/src/lua/TPTScriptInterface.h b/src/lua/TPTScriptInterface.h index d8f07ff6d..cad31d1ba 100644 --- a/src/lua/TPTScriptInterface.h +++ b/src/lua/TPTScriptInterface.h @@ -18,9 +18,8 @@ protected: ValueType testType(String word); public: TPTScriptInterface(GameController * c, GameModel * m); - virtual void Tick() {} - virtual int Command(String command); - virtual String FormatCommand(String command); + int Command(String command) override; + String FormatCommand(String command) override; virtual ~TPTScriptInterface(); }; diff --git a/src/simulation/CoordStack.h b/src/simulation/CoordStack.h index 3d64cc30f..81d3bc915 100644 --- a/src/simulation/CoordStack.h +++ b/src/simulation/CoordStack.h @@ -24,7 +24,7 @@ class CoordStackOverflowException: public std::exception { public: CoordStackOverflowException() { } - virtual const char* what() const throw() + const char* what() const throw() override { return "Maximum number of entries in the coordinate stack was exceeded"; } diff --git a/src/tasks/AbandonableTask.h b/src/tasks/AbandonableTask.h index 835f50941..1a9248cc7 100644 --- a/src/tasks/AbandonableTask.h +++ b/src/tasks/AbandonableTask.h @@ -6,10 +6,10 @@ class AbandonableTask : public Task { public: - void Start(); + void Start() override; void Finish(); void Abandon(); - void Poll(); + void Poll() override; AbandonableTask(); virtual ~AbandonableTask(); diff --git a/src/tasks/Task.h b/src/tasks/Task.h index 5913750ad..32ba631cc 100644 --- a/src/tasks/Task.h +++ b/src/tasks/Task.h @@ -10,13 +10,13 @@ class TaskListener; class Task { public: void AddTaskListener(TaskListener * listener); - void Start(); + virtual void Start(); int GetProgress(); bool GetDone(); bool GetSuccess(); String GetError(); String GetStatus(); - void Poll(); + virtual void Poll(); Task() : listener(NULL) { progress = 0; thProgress = 0; } virtual ~Task(); protected: diff --git a/src/tasks/TaskWindow.h b/src/tasks/TaskWindow.h index 3b3f872c7..f70b38c7a 100644 --- a/src/tasks/TaskWindow.h +++ b/src/tasks/TaskWindow.h @@ -17,13 +17,13 @@ class TaskWindow: public ui::Window, public TaskListener { String progressStatus; public: TaskWindow(String title_, Task * task_, bool closeOnDone = true); - virtual void NotifyStatus(Task * task); - virtual void NotifyDone(Task * task); - virtual void NotifyProgress(Task * task); - virtual void NotifyError(Task * task); - virtual void OnTick(float dt); - virtual void OnDraw(); - virtual void Exit(); + void NotifyStatus(Task * task) override; + void NotifyDone(Task * task) override; + void NotifyProgress(Task * task) override; + void NotifyError(Task * task) override; + void OnTick(float dt) override; + void OnDraw() override; + void Exit(); virtual ~TaskWindow(); };