diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-22 02:34:48 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-22 21:22:21 +0300 |
commit | 4a5cdfe19cbb50e3b58149c6e91312366ee4b771 (patch) | |
tree | 7a2bbae95b5f6642731f2a1257913baad71d028d /src/gui/widgets | |
parent | 3dcf21babe03cee5080a25e787e1d7e72124288e (diff) | |
download | manaverse-4a5cdfe19cbb50e3b58149c6e91312366ee4b771.tar.gz manaverse-4a5cdfe19cbb50e3b58149c6e91312366ee4b771.tar.bz2 manaverse-4a5cdfe19cbb50e3b58149c6e91312366ee4b771.tar.xz manaverse-4a5cdfe19cbb50e3b58149c6e91312366ee4b771.zip |
Add override keyword to most overriden methods.
Diffstat (limited to 'src/gui/widgets')
55 files changed, 254 insertions, 252 deletions
diff --git a/src/gui/widgets/avatarlistbox.h b/src/gui/widgets/avatarlistbox.h index 9ab56e9b0..803a80070 100644 --- a/src/gui/widgets/avatarlistbox.h +++ b/src/gui/widgets/avatarlistbox.h @@ -39,7 +39,7 @@ class AvatarListModel : public gcn::ListModel public: virtual Avatar *getAvatarAt(const int i) = 0; - std::string getElementAt(int i) + std::string getElementAt(int i) override { return getAvatarAt(i)->getName(); } }; @@ -53,11 +53,11 @@ public: /** * Draws the list box. */ - void draw(gcn::Graphics *gcnGraphics); + void draw(gcn::Graphics *gcnGraphics) override; - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; - void optionChanged(const std::string &value); + void optionChanged(const std::string &value) override; private: bool mShowGender; diff --git a/src/gui/widgets/battletab.h b/src/gui/widgets/battletab.h index 12ba23ebf..87b082901 100644 --- a/src/gui/widgets/battletab.h +++ b/src/gui/widgets/battletab.h @@ -35,10 +35,10 @@ class BattleTab final : public ChatTab ~BattleTab(); - int getType() const + int getType() const override { return ChatTab::TAB_BATTLE; } - void saveToLogFile(std::string &msg); + void saveToLogFile(std::string &msg) override; }; extern BattleTab *battleChatTab; diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h index e95507c8c..9cf74ef4f 100644 --- a/src/gui/widgets/browserbox.h +++ b/src/gui/widgets/browserbox.h @@ -140,19 +140,17 @@ class BrowserBox final : public gcn::Widget, /** * Handles mouse actions. */ - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; /** * Draws the browser box. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; void updateHeight(); -// void widgetResized(const gcn::Event &event); - /** * BrowserBox modes. */ diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h index fbc040171..36f539b6a 100644 --- a/src/gui/widgets/button.h +++ b/src/gui/widgets/button.h @@ -80,14 +80,14 @@ class Button final : public gcn::Button, public gcn::WidgetListener /** * Draws the button. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Update the alpha value to the button components. */ void updateAlpha(); - virtual void mouseReleased(gcn::MouseEvent& mouseEvent); + virtual void mouseReleased(gcn::MouseEvent& mouseEvent) override; void setDescription(std::string text) { mDescription = text; } @@ -110,9 +110,9 @@ class Button final : public gcn::Button, public gcn::WidgetListener void setPressed(bool b) { mPressed = b; } - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; - void widgetMoved(const gcn::Event &event); + void widgetMoved(const gcn::Event &event) override; void loadImage(const std::string &imageName); @@ -120,9 +120,9 @@ class Button final : public gcn::Button, public gcn::WidgetListener void setCaption(const std::string& caption); - void keyPressed(gcn::KeyEvent &keyEvent); + void keyPressed(gcn::KeyEvent &keyEvent) override; - void keyReleased(gcn::KeyEvent &keyEvent); + void keyReleased(gcn::KeyEvent &keyEvent) override; bool isPressed2() const; diff --git a/src/gui/widgets/channeltab.h b/src/gui/widgets/channeltab.h index 92126e929..96b6dd6ac 100644 --- a/src/gui/widgets/channeltab.h +++ b/src/gui/widgets/channeltab.h @@ -37,10 +37,10 @@ class ChannelTab final : public ChatTab Channel *getChannel() const { return mChannel; } - void showHelp(); + void showHelp() override; bool handleCommand(const std::string &type, - const std::string &args); + const std::string &args) override; protected: friend class Channel; @@ -55,7 +55,7 @@ class ChannelTab final : public ChatTab */ ~ChannelTab(); - void handleInput(const std::string &msg); + void handleInput(const std::string &msg) override; private: Channel *mChannel; diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h index 0b4a287d0..ba6698e50 100644 --- a/src/gui/widgets/chattab.h +++ b/src/gui/widgets/chattab.h @@ -169,7 +169,7 @@ class ChatTab : public Tab friend class ChatWindow; friend class WhisperWindow; - virtual void setCurrent() + virtual void setCurrent() override { setFlash(0); } virtual void handleInput(const std::string &msg); diff --git a/src/gui/widgets/checkbox.h b/src/gui/widgets/checkbox.h index bb3cf751a..54e9a5e0d 100644 --- a/src/gui/widgets/checkbox.h +++ b/src/gui/widgets/checkbox.h @@ -52,7 +52,7 @@ class CheckBox final : public gcn::CheckBox /** * Draws the caption, then calls drawBox to draw the check box. */ - void draw(gcn::Graphics *const graphics); + void draw(gcn::Graphics *const graphics) override; /** * Update the alpha value to the checkbox components. @@ -67,14 +67,14 @@ class CheckBox final : public gcn::CheckBox /** * Called when the mouse enteres the widget area. */ - void mouseEntered(gcn::MouseEvent& event); + void mouseEntered(gcn::MouseEvent& event) override; /** * Called when the mouse leaves the widget area. */ - void mouseExited(gcn::MouseEvent& event); + void mouseExited(gcn::MouseEvent& event) override; - void keyPressed(gcn::KeyEvent& keyEvent); + void keyPressed(gcn::KeyEvent& keyEvent) override; private: static int instances; diff --git a/src/gui/widgets/desktop.h b/src/gui/widgets/desktop.h index 3cff9a75a..d8fa7d36a 100644 --- a/src/gui/widgets/desktop.h +++ b/src/gui/widgets/desktop.h @@ -57,9 +57,9 @@ class Desktop final : public Container, private gcn::WidgetListener */ void reloadWallpaper(); - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; private: void setBestFittingWallpaper(); diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h index 813a19e5f..f76a38b4d 100644 --- a/src/gui/widgets/dropdown.h +++ b/src/gui/widgets/dropdown.h @@ -59,25 +59,25 @@ class DropDown final : public gcn::DropDown */ void updateAlpha(); - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; - void drawFrame(gcn::Graphics *graphics); + void drawFrame(gcn::Graphics *graphics) override; // Inherited from FocusListener - void focusLost(const gcn::Event& event); + void focusLost(const gcn::Event& event) override; // Inherited from KeyListener - void keyPressed(gcn::KeyEvent& keyEvent); + void keyPressed(gcn::KeyEvent& keyEvent) override; // Inherited from MouseListener - void mousePressed(gcn::MouseEvent& mouseEvent); + void mousePressed(gcn::MouseEvent& mouseEvent) override; - void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent); + void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) override; - void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent); + void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override; void setSelectedString(std::string str); diff --git a/src/gui/widgets/dropshortcutcontainer.h b/src/gui/widgets/dropshortcutcontainer.h index 0544bf07c..337973412 100644 --- a/src/gui/widgets/dropshortcutcontainer.h +++ b/src/gui/widgets/dropshortcutcontainer.h @@ -52,28 +52,28 @@ class DropShortcutContainer final : public ShortcutContainer /** * Draws the items. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event); + void mouseDragged(gcn::MouseEvent &event) override; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; /** * Handles mouse release. */ - void mouseReleased(gcn::MouseEvent &event); + void mouseReleased(gcn::MouseEvent &event) override; - void widgetHidden(const gcn::Event &event); + void widgetHidden(const gcn::Event &event) override; - void mouseExited(gcn::MouseEvent &event); + void mouseExited(gcn::MouseEvent &event) override; - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; private: bool mItemClicked; diff --git a/src/gui/widgets/emoteshortcutcontainer.h b/src/gui/widgets/emoteshortcutcontainer.h index 56a1629d7..736370a93 100644 --- a/src/gui/widgets/emoteshortcutcontainer.h +++ b/src/gui/widgets/emoteshortcutcontainer.h @@ -53,28 +53,28 @@ class EmoteShortcutContainer final : public ShortcutContainer /** * Draws the items. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event); + void mouseDragged(gcn::MouseEvent &event) override; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; /** * Handles mouse release. */ - void mouseReleased(gcn::MouseEvent &event); + void mouseReleased(gcn::MouseEvent &event) override; - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; - void mouseExited(gcn::MouseEvent &event); + void mouseExited(gcn::MouseEvent &event) override; - void widgetHidden(const gcn::Event &event); + void widgetHidden(const gcn::Event &event) override; private: std::vector<const EmoteSprite*> mEmoteImg; diff --git a/src/gui/widgets/extendedlistbox.h b/src/gui/widgets/extendedlistbox.h index 196189674..af3ae64a9 100644 --- a/src/gui/widgets/extendedlistbox.h +++ b/src/gui/widgets/extendedlistbox.h @@ -36,9 +36,9 @@ class ExtendedListBox final : public ListBox /** * Draws the list box. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; - unsigned int getRowHeight() const + unsigned int getRowHeight() const override { return mRowHeight; } void setRowHeight(unsigned int n) diff --git a/src/gui/widgets/extendednamesmodel.h b/src/gui/widgets/extendednamesmodel.h index be59c7e20..a4b6013c2 100644 --- a/src/gui/widgets/extendednamesmodel.h +++ b/src/gui/widgets/extendednamesmodel.h @@ -34,11 +34,11 @@ class ExtendedNamesModel : public ExtendedListModel virtual ~ExtendedNamesModel(); - virtual int getNumberOfElements(); + virtual int getNumberOfElements() override; - virtual std::string getElementAt(int i); + virtual std::string getElementAt(int i) override; - virtual const Image *getImageAt(int i); + virtual const Image *getImageAt(int i) override; StringVect &getNames() { return mNames; } diff --git a/src/gui/widgets/flowcontainer.h b/src/gui/widgets/flowcontainer.h index f0d1d9638..d04dffb23 100644 --- a/src/gui/widgets/flowcontainer.h +++ b/src/gui/widgets/flowcontainer.h @@ -50,7 +50,7 @@ class FlowContainer final : public Container, * Invoked when a widget changes its size. This is used to determine * the new height of the container. */ - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; int getBoxWidth() const { return mBoxWidth; } diff --git a/src/gui/widgets/guildchattab.h b/src/gui/widgets/guildchattab.h index a8f47db25..54dd67a8d 100644 --- a/src/gui/widgets/guildchattab.h +++ b/src/gui/widgets/guildchattab.h @@ -35,21 +35,22 @@ class GuildChatTab final : public ChatTab ~GuildChatTab(); - bool handleCommand(const std::string &type, const std::string &args); + bool handleCommand(const std::string &type, + const std::string &args) override; - void showHelp(); + void showHelp() override; - void saveToLogFile(std::string &msg); + void saveToLogFile(std::string &msg) override; - int getType() const + int getType() const override { return ChatTab::TAB_GUILD; } - void playNewMessageSound(); + void playNewMessageSound() override; protected: - void handleInput(const std::string &msg); + void handleInput(const std::string &msg) override; - void getAutoCompleteList(StringVect &names) const; + void getAutoCompleteList(StringVect &names) const override; }; #endif diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h index af6bedb62..76fdb4b54 100644 --- a/src/gui/widgets/guitable.h +++ b/src/gui/widgets/guitable.h @@ -89,7 +89,7 @@ public: void setWrappingEnabled(bool wrappingEnabled) { mWrappingEnabled = wrappingEnabled; } - gcn::Rectangle getChildrenArea(); + gcn::Rectangle getChildrenArea() override; /** * Toggle whether to use linewise selection mode, in which the table selects @@ -105,18 +105,18 @@ public: void setLinewiseSelection(bool linewise); // Inherited from Widget - virtual void draw(gcn::Graphics* graphics); + virtual void draw(gcn::Graphics* graphics) override; - virtual gcn::Widget *getWidgetAt(int x, int y); + virtual gcn::Widget *getWidgetAt(int x, int y) override; - virtual void moveToTop(gcn::Widget *child); + virtual void moveToTop(gcn::Widget *child) override; - virtual void moveToBottom(gcn::Widget *child); + virtual void moveToBottom(gcn::Widget *child) override; - virtual void _setFocusHandler(gcn::FocusHandler* focusHandler); + virtual void _setFocusHandler(gcn::FocusHandler* focusHandler) override; // Inherited from KeyListener - virtual void keyPressed(gcn::KeyEvent& keyEvent); + virtual void keyPressed(gcn::KeyEvent& keyEvent) override; /** * Sets the table to be opaque, that is sets the table @@ -137,16 +137,16 @@ public: { return mOpaque; } // Inherited from MouseListener - virtual void mousePressed(gcn::MouseEvent& mouseEvent); + virtual void mousePressed(gcn::MouseEvent& mouseEvent) override; - virtual void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent); + virtual void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) override; - virtual void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent); + virtual void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override; - virtual void mouseDragged(gcn::MouseEvent& mouseEvent); + virtual void mouseDragged(gcn::MouseEvent& mouseEvent) override; // Constraints inherited from TableModelListener - virtual void modelUpdated(bool); + virtual void modelUpdated(bool) override; protected: /** Frees all action listeners on inner widgets. */ diff --git a/src/gui/widgets/horizontcontainer.h b/src/gui/widgets/horizontcontainer.h index 736d8fd98..1db5bf7a8 100644 --- a/src/gui/widgets/horizontcontainer.h +++ b/src/gui/widgets/horizontcontainer.h @@ -42,7 +42,7 @@ class HorizontContainer final : public Container, public gcn::WidgetListener virtual void clear(); - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; protected: int mSpacing; diff --git a/src/gui/widgets/icon.h b/src/gui/widgets/icon.h index 62e8ac1b1..ec9c8319f 100644 --- a/src/gui/widgets/icon.h +++ b/src/gui/widgets/icon.h @@ -59,7 +59,7 @@ class Icon final : public gcn::Widget /** * Draws the Icon. */ - void draw(gcn::Graphics *g); + void draw(gcn::Graphics *g) override; private: Image *mImage; diff --git a/src/gui/widgets/inttextfield.h b/src/gui/widgets/inttextfield.h index a820de8a3..430ae4746 100644 --- a/src/gui/widgets/inttextfield.h +++ b/src/gui/widgets/inttextfield.h @@ -65,7 +65,7 @@ class IntTextField final : public TextField /** * Responds to key presses. */ - void keyPressed(gcn::KeyEvent &event); + void keyPressed(gcn::KeyEvent &event) override; private: int mMin; /**< Minimum value */ diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h index 40f9a92d7..e7bf11e48 100644 --- a/src/gui/widgets/itemcontainer.h +++ b/src/gui/widgets/itemcontainer.h @@ -73,26 +73,26 @@ class ItemContainer final : public gcn::Widget, /** * Necessary for checking how full the inventory is. */ - void logic(); + void logic() override; /** * Draws the items. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; // KeyListener - void keyPressed(gcn::KeyEvent &event); - void keyReleased(gcn::KeyEvent &event); + void keyPressed(gcn::KeyEvent &event) override; + void keyReleased(gcn::KeyEvent &event) override; // MouseListener - void mousePressed(gcn::MouseEvent &event); - void mouseDragged(gcn::MouseEvent &event); - void mouseReleased(gcn::MouseEvent &event); - void mouseMoved(gcn::MouseEvent &event); - void mouseExited(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; + void mouseDragged(gcn::MouseEvent &event) override; + void mouseReleased(gcn::MouseEvent &event) override; + void mouseMoved(gcn::MouseEvent &event) override; + void mouseExited(gcn::MouseEvent &event) override; // WidgetListener - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; /** * Returns the selected item. diff --git a/src/gui/widgets/itemlinkhandler.h b/src/gui/widgets/itemlinkhandler.h index 5deb76c73..35415a010 100644 --- a/src/gui/widgets/itemlinkhandler.h +++ b/src/gui/widgets/itemlinkhandler.h @@ -34,7 +34,8 @@ class ItemLinkHandler final : public LinkHandler ~ItemLinkHandler(); - void handleLink(const std::string &link, gcn::MouseEvent *event); + void handleLink(const std::string &link, + gcn::MouseEvent *event) override; private: ItemPopup *mItemPopup; diff --git a/src/gui/widgets/itemshortcutcontainer.h b/src/gui/widgets/itemshortcutcontainer.h index 92866b10d..e7a13b45f 100644 --- a/src/gui/widgets/itemshortcutcontainer.h +++ b/src/gui/widgets/itemshortcutcontainer.h @@ -53,28 +53,28 @@ class ItemShortcutContainer final : public ShortcutContainer /** * Draws the items. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event); + void mouseDragged(gcn::MouseEvent &event) override; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; /** * Handles mouse release. */ - void mouseReleased(gcn::MouseEvent &event); + void mouseReleased(gcn::MouseEvent &event) override; - void widgetHidden(const gcn::Event &event); + void widgetHidden(const gcn::Event &event) override; - void mouseExited(gcn::MouseEvent &event); + void mouseExited(gcn::MouseEvent &event) override; - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; private: bool mItemClicked; diff --git a/src/gui/widgets/label.h b/src/gui/widgets/label.h index b9845ef0a..fc82fa900 100644 --- a/src/gui/widgets/label.h +++ b/src/gui/widgets/label.h @@ -47,7 +47,7 @@ class Label final : public gcn::Label /** * Draws the label. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; }; #endif diff --git a/src/gui/widgets/layouthelper.h b/src/gui/widgets/layouthelper.h index 518168a80..2285e15cd 100644 --- a/src/gui/widgets/layouthelper.h +++ b/src/gui/widgets/layouthelper.h @@ -76,7 +76,7 @@ class LayoutHelper final : public gcn::WidgetListener /** * Called whenever the managed container changes size. */ - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; private: Layout mLayout; /**< Layout handler */ diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h index fdb6350c5..efe6da57d 100644 --- a/src/gui/widgets/listbox.h +++ b/src/gui/widgets/listbox.h @@ -47,7 +47,7 @@ class ListBox : public gcn::ListBox /** * Draws the list box. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Update the alpha value to the graphic components. @@ -56,17 +56,17 @@ class ListBox : public gcn::ListBox // Inherited from KeyListener - void keyPressed(gcn::KeyEvent& keyEvent); + void keyPressed(gcn::KeyEvent& keyEvent) override; // Inherited from MouseListener - void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent); + void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) override; - void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent); + void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override; - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; - void mouseDragged(gcn::MouseEvent &event); + void mouseDragged(gcn::MouseEvent &event) override; void refocus(); diff --git a/src/gui/widgets/namesmodel.h b/src/gui/widgets/namesmodel.h index 1064a8875..69d9f3c56 100644 --- a/src/gui/widgets/namesmodel.h +++ b/src/gui/widgets/namesmodel.h @@ -25,6 +25,8 @@ #include <guichan/listmodel.hpp> +#include "localconsts.h" + class NamesModel : public gcn::ListModel { public: @@ -32,9 +34,9 @@ class NamesModel : public gcn::ListModel virtual ~NamesModel(); - virtual int getNumberOfElements(); + virtual int getNumberOfElements() override; - virtual std::string getElementAt(int i); + virtual std::string getElementAt(int i) override; StringVect &getNames() { return mNames; } diff --git a/src/gui/widgets/passwordfield.h b/src/gui/widgets/passwordfield.h index ceb88876e..0444427ee 100644 --- a/src/gui/widgets/passwordfield.h +++ b/src/gui/widgets/passwordfield.h @@ -41,7 +41,7 @@ class PasswordField final : public TextField /** * Draws the password field. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; }; #endif diff --git a/src/gui/widgets/playerbox.h b/src/gui/widgets/playerbox.h index dbf104de0..3b3116294 100644 --- a/src/gui/widgets/playerbox.h +++ b/src/gui/widgets/playerbox.h @@ -67,12 +67,12 @@ class PlayerBox final : public gcn::ScrollArea /** * Draws the scroll area. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Draws the background and border of the scroll area. */ - void drawFrame(gcn::Graphics *graphics); + void drawFrame(gcn::Graphics *graphics) override; Being *getBeing() { return mBeing; } diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h index 2442aa220..af7c8d5bd 100644 --- a/src/gui/widgets/popup.h +++ b/src/gui/widgets/popup.h @@ -73,7 +73,7 @@ class Popup : public Container, public gcn::MouseListener, /** * Draws the popup. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Sets the size of this popup. @@ -85,7 +85,7 @@ class Popup : public Container, public gcn::MouseListener, */ void setLocationRelativeTo(const gcn::Widget *const widget); - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; /** * Sets the minimum width of the popup. @@ -149,7 +149,7 @@ class Popup : public Container, public gcn::MouseListener, // Inherited from BasicContainer - virtual gcn::Rectangle getChildrenArea(); + virtual gcn::Rectangle getChildrenArea() override; /** * Sets the location to display the popup. Tries to horizontally center @@ -161,9 +161,9 @@ class Popup : public Container, public gcn::MouseListener, void hide(); - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; - void widgetMoved(const gcn::Event &event); + void widgetMoved(const gcn::Event &event) override; private: std::string mPopupName; /**< Name of the popup */ diff --git a/src/gui/widgets/progressbar.h b/src/gui/widgets/progressbar.h index 11c8069a3..e163fe66c 100644 --- a/src/gui/widgets/progressbar.h +++ b/src/gui/widgets/progressbar.h @@ -53,7 +53,7 @@ class ProgressBar final : public gcn::Widget, public gcn::WidgetListener /** * Performs progress bar logic (fading colors) */ - void logic(); + void logic() override; /** * Update the alpha value to the graphic components. @@ -63,7 +63,7 @@ class ProgressBar final : public gcn::Widget, public gcn::WidgetListener /** * Draws the progress bar. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Sets the current progress. @@ -132,9 +132,9 @@ class ProgressBar final : public gcn::Widget, public gcn::WidgetListener const gcn::Color &color, const float progress, const std::string &text = ""); - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; - void widgetMoved(const gcn::Event &event); + void widgetMoved(const gcn::Event &event) override; private: float mProgress; diff --git a/src/gui/widgets/progressindicator.h b/src/gui/widgets/progressindicator.h index 4046f21d9..2db3fe8b9 100644 --- a/src/gui/widgets/progressindicator.h +++ b/src/gui/widgets/progressindicator.h @@ -34,10 +34,12 @@ class ProgressIndicator final : public gcn::Widget { public: ProgressIndicator(); + ~ProgressIndicator(); - void logic(); - void draw(gcn::Graphics *graphics); + void logic() override; + + void draw(gcn::Graphics *graphics) override; private: SimpleAnimation *mIndicator; diff --git a/src/gui/widgets/radiobutton.h b/src/gui/widgets/radiobutton.h index ae846bc77..cc0ff7734 100644 --- a/src/gui/widgets/radiobutton.h +++ b/src/gui/widgets/radiobutton.h @@ -47,25 +47,25 @@ class RadioButton final : public gcn::RadioButton /** * Draws the radiobutton, not the caption. */ - void drawBox(gcn::Graphics* graphics); + void drawBox(gcn::Graphics* graphics) override; /** * Implementation of the draw methods. * Thus, avoiding the rhomb around the radio button. */ - void draw(gcn::Graphics* graphics); + void draw(gcn::Graphics* graphics) override; /** * Called when the mouse enteres the widget area. */ - void mouseEntered(gcn::MouseEvent& event); + void mouseEntered(gcn::MouseEvent& event) override; /** * Called when the mouse leaves the widget area. */ - void mouseExited(gcn::MouseEvent& event); + void mouseExited(gcn::MouseEvent& event) override; - void keyPressed(gcn::KeyEvent& keyEvent); + void keyPressed(gcn::KeyEvent& keyEvent) override; private: static int instances; diff --git a/src/gui/widgets/radiogroup.h b/src/gui/widgets/radiogroup.h index 19e67d09d..370d46436 100644 --- a/src/gui/widgets/radiogroup.h +++ b/src/gui/widgets/radiogroup.h @@ -31,7 +31,7 @@ class RadioGroup final : public WidgetGroup RadioGroup(const std::string &group, const int height, const int spacing); - gcn::Widget *createWidget(const std::string &name); + gcn::Widget *createWidget(const std::string &name) override; }; #endif diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h index 064bfdeb0..7a1a3b076 100644 --- a/src/gui/widgets/scrollarea.h +++ b/src/gui/widgets/scrollarea.h @@ -65,7 +65,7 @@ class ScrollArea final : public gcn::ScrollArea, public gcn::WidgetListener * Logic function optionally adapts width or height of contents. This * depends on the scrollbar settings. */ - void logic(); + void logic() override; /** * Update the alpha value to the graphic components. @@ -75,12 +75,12 @@ class ScrollArea final : public gcn::ScrollArea, public gcn::WidgetListener /** * Draws the scroll area. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Draws the background and border of the scroll area. */ - void drawFrame(gcn::Graphics *graphics); + void drawFrame(gcn::Graphics *graphics) override; /** * Sets whether the widget should draw its background or not. @@ -96,25 +96,25 @@ class ScrollArea final : public gcn::ScrollArea, public gcn::WidgetListener /** * Called when the mouse moves in the widget area. */ - void mouseMoved(gcn::MouseEvent& event); + void mouseMoved(gcn::MouseEvent& event) override; /** * Called when the mouse enteres the widget area. */ - void mouseEntered(gcn::MouseEvent& event); + void mouseEntered(gcn::MouseEvent& event) override; /** * Called when the mouse leaves the widget area. */ - void mouseExited(gcn::MouseEvent& event); + void mouseExited(gcn::MouseEvent& event) override; - void mousePressed(gcn::MouseEvent& event); + void mousePressed(gcn::MouseEvent& event) override; - void mouseReleased(gcn::MouseEvent& event); + void mouseReleased(gcn::MouseEvent& event) override; - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; - void widgetMoved(const gcn::Event &event); + void widgetMoved(const gcn::Event &event) override; protected: enum BUTTON_DIR @@ -132,14 +132,14 @@ class ScrollArea final : public gcn::ScrollArea, public gcn::WidgetListener void init(std::string skinName); void drawButton(gcn::Graphics *const graphics, const BUTTON_DIR dir); - void drawUpButton(gcn::Graphics *const graphics); - void drawDownButton(gcn::Graphics *const graphics); - void drawLeftButton(gcn::Graphics *const graphics); - void drawRightButton(gcn::Graphics *const graphics); - void drawVBar(gcn::Graphics *const graphics); - void drawHBar(gcn::Graphics *const graphics); - void drawVMarker(gcn::Graphics *const graphics); - void drawHMarker(gcn::Graphics *const graphics); + void drawUpButton(gcn::Graphics *const graphics) override; + void drawDownButton(gcn::Graphics *const graphics) override; + void drawLeftButton(gcn::Graphics *const graphics) override; + void drawRightButton(gcn::Graphics *const graphics) override; + void drawVBar(gcn::Graphics *const graphics) override; + void drawHBar(gcn::Graphics *const graphics) override; + void drawVMarker(gcn::Graphics *const graphics) override; + void drawHMarker(gcn::Graphics *const graphics) override; static int instances; static float mAlpha; diff --git a/src/gui/widgets/setupitem.h b/src/gui/widgets/setupitem.h index d8affadd1..f36dc2534 100644 --- a/src/gui/widgets/setupitem.h +++ b/src/gui/widgets/setupitem.h @@ -88,7 +88,7 @@ class SetupItem : public gcn::ActionListener virtual std::string getActionEventId(); - virtual void action(const gcn::ActionEvent &event); + virtual void action(const gcn::ActionEvent &event) override; virtual void action(); @@ -145,9 +145,9 @@ class SetupItemCheckBox final : public SetupItem void createControls(); - void fromWidget(); + void fromWidget() override; - void toWidget(); + void toWidget() override; protected: CheckBox *mCheckBox; @@ -170,13 +170,13 @@ class SetupItemTextField final : public SetupItem void createControls(); - void fromWidget(); + void fromWidget() override; - void toWidget(); + void toWidget() override; - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void apply(std::string eventName); + void apply(std::string eventName) override; protected: HorizontContainer *mHorizont; @@ -207,13 +207,13 @@ class SetupItemIntTextField final : public SetupItem void createControls(); - void fromWidget(); + void fromWidget() override; - void toWidget(); + void toWidget() override; - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void apply(std::string eventName); + void apply(std::string eventName) override; protected: HorizontContainer *mHorizont; @@ -236,13 +236,13 @@ class SetupItemLabel final : public SetupItem void createControls(); - void fromWidget(); + void fromWidget() override; - void toWidget(); + void toWidget() override; - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void apply(std::string eventName); + void apply(std::string eventName) override; protected: Label *mLabel; @@ -266,9 +266,9 @@ class SetupItemDropDown final : public SetupItem void createControls(); - void fromWidget(); + void fromWidget() override; - void toWidget(); + void toWidget() override; protected: HorizontContainer *mHorizont; @@ -299,11 +299,11 @@ class SetupItemSlider final : public SetupItem void createControls(); - void fromWidget(); + void fromWidget() override; - void toWidget(); + void toWidget() override; - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; void apply(std::string eventName); @@ -346,13 +346,13 @@ class SetupItemSlider2 final : public SetupItem void createControls(); - void fromWidget(); + void fromWidget() override; - void toWidget(); + void toWidget() override; - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void apply(std::string eventName); + void apply(std::string eventName) override; void setInvertValue(const int v); @@ -394,13 +394,13 @@ class SetupItemSliderList : public SetupItem void createControls(); - void fromWidget(); + void fromWidget() override; - void toWidget(); + void toWidget() override; - virtual void action(const gcn::ActionEvent &event); + virtual void action(const gcn::ActionEvent &event) override; - void apply(std::string eventName); + void apply(std::string eventName) override; virtual void addMoreControls() = 0; @@ -422,9 +422,9 @@ class SetupItemSound final : public SetupItemSliderList const int width = 150, const bool onTheFly = false, const bool mainConfig = true); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void addMoreControls(); + void addMoreControls() override; protected: Button *mButton; diff --git a/src/gui/widgets/setuptabscroll.h b/src/gui/widgets/setuptabscroll.h index 77103323a..947ca2b26 100644 --- a/src/gui/widgets/setuptabscroll.h +++ b/src/gui/widgets/setuptabscroll.h @@ -46,13 +46,13 @@ class SetupTabScroll : public SetupTab VertContainer *getContainer() const { return mContainer; } - virtual void apply(); + virtual void apply() override; - virtual void cancel(); + virtual void cancel() override; - virtual void externalUpdated(); + virtual void externalUpdated() override; - virtual void action(const gcn::ActionEvent &event A_UNUSED) + virtual void action(const gcn::ActionEvent &event A_UNUSED) override { } int getPreferredFirstItemSize() diff --git a/src/gui/widgets/shopitems.h b/src/gui/widgets/shopitems.h index 978926420..840be4267 100644 --- a/src/gui/widgets/shopitems.h +++ b/src/gui/widgets/shopitems.h @@ -79,7 +79,7 @@ class ShopItems final : public gcn::ListModel /** * Returns the number of items in the shop. */ - int getNumberOfElements() + int getNumberOfElements() override { return static_cast<int>(mShopItems.size()); } bool empty() const @@ -90,7 +90,7 @@ class ShopItems final : public gcn::ListModel * * @param i the index to retrieve */ - std::string getElementAt(int i); + std::string getElementAt(int i) override; /** * Returns the item number i in the shop. diff --git a/src/gui/widgets/shoplistbox.h b/src/gui/widgets/shoplistbox.h index ed5bfa003..906c6b3d3 100644 --- a/src/gui/widgets/shoplistbox.h +++ b/src/gui/widgets/shoplistbox.h @@ -52,12 +52,12 @@ class ShopListBox final : public ListBox /** * Draws the list box. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Returns the height of a row. */ - unsigned int getRowHeight() const + unsigned int getRowHeight() const override { return mRowHeight; } /** @@ -76,9 +76,9 @@ class ShopListBox final : public ListBox */ void setPriceCheck(const bool check); - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; - void mouseExited(gcn::MouseEvent& mouseEvent); + void mouseExited(gcn::MouseEvent& mouseEvent) override; private: void init(); diff --git a/src/gui/widgets/shortcutcontainer.h b/src/gui/widgets/shortcutcontainer.h index 6de2d1963..2551bdb17 100644 --- a/src/gui/widgets/shortcutcontainer.h +++ b/src/gui/widgets/shortcutcontainer.h @@ -55,28 +55,28 @@ class ShortcutContainer : public gcn::Widget, /** * Draws the shortcuts */ - virtual void draw(gcn::Graphics *graphics) = 0; + virtual void draw(gcn::Graphics *graphics) override = 0; /** * Invoked when a widget changes its size. This is used to determine * the new height of the container. */ - virtual void widgetResized(const gcn::Event &event); + virtual void widgetResized(const gcn::Event &event) override; /** * Handles mouse when dragged. */ - virtual void mouseDragged(gcn::MouseEvent &event) = 0; + virtual void mouseDragged(gcn::MouseEvent &event) override = 0; /** * Handles mouse when pressed. */ - virtual void mousePressed(gcn::MouseEvent &event) = 0; + virtual void mousePressed(gcn::MouseEvent &event) override = 0; /** * Handles mouse release. */ - virtual void mouseReleased(gcn::MouseEvent &event) = 0; + virtual void mouseReleased(gcn::MouseEvent &event) override = 0; int getMaxItems() const { return mMaxItems; } diff --git a/src/gui/widgets/slider.h b/src/gui/widgets/slider.h index 494039c73..3d304ad3a 100644 --- a/src/gui/widgets/slider.h +++ b/src/gui/widgets/slider.h @@ -59,7 +59,7 @@ class Slider final : public gcn::Slider /** * Draws the slider. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Draws the marker. @@ -69,14 +69,14 @@ class Slider final : public gcn::Slider /** * Called when the mouse enteres the widget area. */ - void mouseEntered(gcn::MouseEvent& event); + void mouseEntered(gcn::MouseEvent& event) override; /** * Called when the mouse leaves the widget area. */ - void mouseExited(gcn::MouseEvent& event); + void mouseExited(gcn::MouseEvent& event) override; - void keyPressed(gcn::KeyEvent& keyEvent); + void keyPressed(gcn::KeyEvent& keyEvent) override; enum SLIDER_ENUM { @@ -98,10 +98,6 @@ class Slider final : public gcn::Slider void init(); static ImageRect buttons[2]; - //*hStart, *hMid, *hEnd, *hGrip; -// static Image *vStart, *vMid, *vEnd, *vGrip; -// static Image *hStartHi, *hMidHi, *hEndHi, *hGripHi; -// static Image *vStartHi, *vMidHi, *vEndHi, *vGripHi; bool mHasMouse; static float mAlpha; static int mInstances; diff --git a/src/gui/widgets/sliderlist.h b/src/gui/widgets/sliderlist.h index 76dbc012c..f310ea27a 100644 --- a/src/gui/widgets/sliderlist.h +++ b/src/gui/widgets/sliderlist.h @@ -45,15 +45,15 @@ class SliderList final : public Container, void updateAlpha(); - void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent); + void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) override; - void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent); + void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override; void resize(); - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; void setSelectedString(std::string str); diff --git a/src/gui/widgets/spellshortcutcontainer.h b/src/gui/widgets/spellshortcutcontainer.h index 570b8b263..09c60624a 100644 --- a/src/gui/widgets/spellshortcutcontainer.h +++ b/src/gui/widgets/spellshortcutcontainer.h @@ -52,28 +52,28 @@ class SpellShortcutContainer final : public ShortcutContainer /** * Draws the items. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event); + void mouseDragged(gcn::MouseEvent &event) override; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; /** * Handles mouse release. */ - void mouseReleased(gcn::MouseEvent &event); + void mouseReleased(gcn::MouseEvent &event) override; - void widgetHidden(const gcn::Event &event); + void widgetHidden(const gcn::Event &event) override; - void mouseExited(gcn::MouseEvent &event); + void mouseExited(gcn::MouseEvent &event) override; - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; private: bool mSpellClicked; diff --git a/src/gui/widgets/tab.h b/src/gui/widgets/tab.h index a8ff5eb3d..6519d5847 100644 --- a/src/gui/widgets/tab.h +++ b/src/gui/widgets/tab.h @@ -49,7 +49,7 @@ class Tab : public gcn::Tab, public gcn::WidgetListener /** * Draw the tabbed area. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Set the normal color for the tab's text. @@ -90,9 +90,9 @@ class Tab : public gcn::Tab, public gcn::WidgetListener int getFlash() const { return mFlash; } - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; - void widgetMoved(const gcn::Event &event); + void widgetMoved(const gcn::Event &event) override; void setLabelFont(gcn::Font *const font); @@ -101,6 +101,7 @@ class Tab : public gcn::Tab, public gcn::WidgetListener protected: friend class TabbedArea; + virtual void setCurrent() { } diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index a616a9935..65eb09447 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -50,7 +50,7 @@ class TabbedArea final : public gcn::TabbedArea, public gcn::WidgetListener /** * Draw the tabbed area. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Return how many tabs have been created. @@ -84,7 +84,7 @@ class TabbedArea final : public gcn::TabbedArea, public gcn::WidgetListener * @param tab The tab widget for the tab. * @param widget The widget to view when the tab is selected. */ - void addTab(gcn::Tab* tab, gcn::Widget* widget); + void addTab(gcn::Tab* tab, gcn::Widget* widget) override; /** * Add a tab. Overridden since it needs to create an instance of Tab @@ -98,25 +98,25 @@ class TabbedArea final : public gcn::TabbedArea, public gcn::WidgetListener /** * Overload the remove tab function as it's broken in guichan 0.8. */ - void removeTab(gcn::Tab *tab); + void removeTab(gcn::Tab *tab) override; void removeAll(); /** * Overload the logic function since it's broken in guichan 0.8. */ - void logic(); + void logic() override; int getContainerHeight() const { return mWidgetContainer->getHeight(); } - void setSelectedTab(gcn::Tab *tab); + void setSelectedTab(gcn::Tab *tab) override; void setSelectedTabByPos(int tab); void setSelectedTabByName(const std::string &name); - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; /* void moveLeft(gcn::Tab *tab); @@ -125,11 +125,11 @@ class TabbedArea final : public gcn::TabbedArea, public gcn::WidgetListener */ void adjustTabPositions(); - void action(const gcn::ActionEvent& actionEvent); + void action(const gcn::ActionEvent& actionEvent) override; // Inherited from MouseListener - void mousePressed(gcn::MouseEvent &mouseEvent); + void mousePressed(gcn::MouseEvent &mouseEvent) override; void enableScrollButtons(const bool enable); @@ -148,7 +148,7 @@ class TabbedArea final : public gcn::TabbedArea, public gcn::WidgetListener void fixSize() { adjustSize(); } - void keyPressed(gcn::KeyEvent& keyEvent); + void keyPressed(gcn::KeyEvent& keyEvent) override; void setBlockSwitching(bool b) { mBlockSwitching = b; } diff --git a/src/gui/widgets/tablemodel.h b/src/gui/widgets/tablemodel.h index 4e3938038..6af6d2425 100644 --- a/src/gui/widgets/tablemodel.h +++ b/src/gui/widgets/tablemodel.h @@ -142,11 +142,11 @@ public: virtual int getRows() const; virtual int getColumns() const; - virtual int getRowHeight() const; + virtual int getRowHeight() const override; virtual int getWidth() const; virtual int getHeight() const; virtual int getColumnWidth(int index) const; - virtual gcn::Widget *getElementAt(int row, int column) const; + virtual gcn::Widget *getElementAt(int row, int column) const override; protected: int mRows, mColumns; diff --git a/src/gui/widgets/tabstrip.h b/src/gui/widgets/tabstrip.h index fac0fc502..efdeda657 100644 --- a/src/gui/widgets/tabstrip.h +++ b/src/gui/widgets/tabstrip.h @@ -34,9 +34,9 @@ class TabStrip final : public WidgetGroup TabStrip(const int height, const int spacing = 0); - gcn::Widget *createWidget(const std::string &name); + gcn::Widget *createWidget(const std::string &name) override; - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; }; #endif diff --git a/src/gui/widgets/textbox.h b/src/gui/widgets/textbox.h index a95fd118a..61cf6f665 100644 --- a/src/gui/widgets/textbox.h +++ b/src/gui/widgets/textbox.h @@ -57,14 +57,14 @@ class TextBox final : public gcn::TextBox /** * Draws the text. */ - inline void draw(gcn::Graphics *graphics) + inline void draw(gcn::Graphics *graphics) override { if (mTextColor) mForegroundColor = *mTextColor; gcn::TextBox::draw(graphics); } - void keyPressed(gcn::KeyEvent& keyEvent); + void keyPressed(gcn::KeyEvent& keyEvent) override; private: int mMinWidth; diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h index 12a101b0e..72d679052 100644 --- a/src/gui/widgets/textfield.h +++ b/src/gui/widgets/textfield.h @@ -52,7 +52,7 @@ class TextField : public gcn::TextField /** * Draws the text field. */ - virtual void draw(gcn::Graphics *graphics); + virtual void draw(gcn::Graphics *graphics) override; /** * Update the alpha value to the graphic components. @@ -62,7 +62,7 @@ class TextField : public gcn::TextField /** * Draws the background and border. */ - void drawFrame(gcn::Graphics *graphics); + void drawFrame(gcn::Graphics *graphics) override; /** * Determine whether the field should be numeric or not @@ -81,7 +81,7 @@ class TextField : public gcn::TextField /** * Processes one keypress. */ - void keyPressed(gcn::KeyEvent &keyEvent); + void keyPressed(gcn::KeyEvent &keyEvent) override; /** * Set the minimum value for a range diff --git a/src/gui/widgets/textpreview.h b/src/gui/widgets/textpreview.h index e116e939b..0c127cba0 100644 --- a/src/gui/widgets/textpreview.h +++ b/src/gui/widgets/textpreview.h @@ -97,7 +97,7 @@ class TextPreview final : public gcn::Widget * * @param graphics graphics to draw into */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Set opacity for this widget (whether or not to show the background diff --git a/src/gui/widgets/tradetab.h b/src/gui/widgets/tradetab.h index a31376263..55e6550cb 100644 --- a/src/gui/widgets/tradetab.h +++ b/src/gui/widgets/tradetab.h @@ -35,13 +35,13 @@ class TradeTab final : public ChatTab ~TradeTab(); - int getType() const + int getType() const override { return ChatTab::TAB_TRADE; } - void saveToLogFile(std::string &msg); + void saveToLogFile(std::string &msg) override; protected: - void handleInput(const std::string &msg); + void handleInput(const std::string &msg) override; }; extern TradeTab *tradeChatTab; diff --git a/src/gui/widgets/vertcontainer.h b/src/gui/widgets/vertcontainer.h index 2c9087db2..e8c1da82f 100644 --- a/src/gui/widgets/vertcontainer.h +++ b/src/gui/widgets/vertcontainer.h @@ -46,7 +46,7 @@ class VertContainer final : public Container, public gcn::WidgetListener virtual void clear(); - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; private: std::vector<gcn::Widget*> mResizableWidgets; diff --git a/src/gui/widgets/whispertab.h b/src/gui/widgets/whispertab.h index 2a8ca1ab0..502d20efe 100644 --- a/src/gui/widgets/whispertab.h +++ b/src/gui/widgets/whispertab.h @@ -36,15 +36,15 @@ class WhisperTab final : public ChatTab const std::string &getNick() const { return mNick; } - void showHelp(); + void showHelp() override; bool handleCommand(const std::string &type, - const std::string &args); + const std::string &args) override; - int getType() const + int getType() const override { return ChatTab::TAB_WHISPER; } - void saveToLogFile(std::string &msg); + void saveToLogFile(std::string &msg) override; void setWhisperTabColors(); @@ -53,7 +53,7 @@ class WhisperTab final : public ChatTab protected: friend class ChatWindow; - void getAutoCompleteList(StringVect &names) const; + void getAutoCompleteList(StringVect &names) const override; /** * Constructor. * @@ -63,9 +63,9 @@ class WhisperTab final : public ChatTab ~WhisperTab(); - void handleInput(const std::string &msg); + void handleInput(const std::string &msg) override; - void handleCommand(const std::string &msg); + void handleCommand(const std::string &msg) override; private: std::string mNick; diff --git a/src/gui/widgets/widgetgroup.h b/src/gui/widgets/widgetgroup.h index ad2ee4e64..27d1a7357 100644 --- a/src/gui/widgets/widgetgroup.h +++ b/src/gui/widgets/widgetgroup.h @@ -38,13 +38,14 @@ class WidgetGroup : public Container, virtual void addButton(std::string text, std::string tag); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - virtual void add(gcn::Widget *const widget, const int spacing); + virtual void add(gcn::Widget *const widget, + const int spacing); virtual void clear(); - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; virtual Widget *createWidget(const std::string &name) = 0; diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index fdcfc23de..7ffa1eb2d 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -74,7 +74,7 @@ class Window : public gcn::Window, private gcn::WidgetListener /** * Draws the window. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Sets the size of this window. @@ -108,14 +108,14 @@ class Window : public gcn::Window, private gcn::WidgetListener /** * Called whenever the widget changes size. */ - virtual void widgetResized(const gcn::Event &event); + virtual void widgetResized(const gcn::Event &event) override; - virtual void widgetMoved(const gcn::Event& event); + virtual void widgetMoved(const gcn::Event& event) override; /** * Called whenever the widget is hidden. */ - virtual void widgetHidden(const gcn::Event &event); + virtual void widgetHidden(const gcn::Event &event) override; /** * Sets whether or not the window has a close button. @@ -247,31 +247,31 @@ class Window : public gcn::Window, private gcn::WidgetListener /** * Starts window resizing when appropriate. */ - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; /** * Implements window resizing and makes sure the window is not * dragged/resized outside of the screen. */ - void mouseDragged(gcn::MouseEvent &event); + void mouseDragged(gcn::MouseEvent &event) override; /** * Implements custom cursor image changing context, based on mouse * relative position. */ - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; /** * When the mouse button has been let go, this ensures that the mouse * custom cursor is restored back to it's standard image. */ - void mouseReleased(gcn::MouseEvent &event); + void mouseReleased(gcn::MouseEvent &event) override; /** * When the mouse leaves the window this ensures that the custom cursor * is restored back to it's standard image. */ - void mouseExited(gcn::MouseEvent &event); + void mouseExited(gcn::MouseEvent &event) override; /** * Sets the name of the window. This is not the window title. diff --git a/src/gui/widgets/windowcontainer.h b/src/gui/widgets/windowcontainer.h index a2d560cbb..e1b74be1c 100644 --- a/src/gui/widgets/windowcontainer.h +++ b/src/gui/widgets/windowcontainer.h @@ -40,7 +40,7 @@ class WindowContainer : public Container * Do GUI logic. This functions adds automatic deletion of objects that * volunteered to be deleted. */ - void logic(); + void logic() override; /** * Schedule a widget for deletion. It will be deleted at the start of |