GUI: Add override markers where appropriate

This commit is contained in:
Bastien Bouclet 2020-01-05 17:48:04 +01:00
parent 37b473cc0d
commit c566d02992
34 changed files with 237 additions and 237 deletions

View file

@ -68,7 +68,7 @@ class WriteStream;
class EventRecorder : private Common::EventSource, public Common::Singleton<EventRecorder>, private Common::DefaultEventMapper { class EventRecorder : private Common::EventSource, public Common::Singleton<EventRecorder>, private Common::DefaultEventMapper {
friend class Common::Singleton<SingletonBaseType>; friend class Common::Singleton<SingletonBaseType>;
EventRecorder(); EventRecorder();
~EventRecorder(); ~EventRecorder() override;
public: public:
/** Specify operation mode of Event Recorder */ /** Specify operation mode of Event Recorder */
enum RecordMode { enum RecordMode {
@ -176,9 +176,9 @@ public:
void switchFastMode(); void switchFastMode();
private: private:
virtual Common::List<Common::Event> mapEvent(const Common::Event &ev, Common::EventSource *source); Common::List<Common::Event> mapEvent(const Common::Event &ev, Common::EventSource *source) override;
bool notifyPoll(); bool notifyPoll();
bool pollEvent(Common::Event &ev); bool pollEvent(Common::Event &ev) override;
bool _initialized; bool _initialized;
volatile uint32 _fakeTimer; volatile uint32 _fakeTimer;
bool _savedState; bool _savedState;
@ -215,7 +215,7 @@ private:
bool checkGameHash(const ADGameDescription *desc); bool checkGameHash(const ADGameDescription *desc);
void checkForKeyCode(const Common::Event &event); void checkForKeyCode(const Common::Event &event);
bool allowMapping() const { return false; } bool allowMapping() const override { return false; }
volatile uint32 _lastMillis; volatile uint32 _lastMillis;
uint32 _lastScreenshotTime; uint32 _lastScreenshotTime;

View file

@ -35,9 +35,9 @@ class KeysDialog : public GUI::Dialog {
public: public:
KeysDialog(const Common::String &title = _("Choose an action to map")); KeysDialog(const Common::String &title = _("Choose an action to map"));
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
virtual void handleKeyUp(Common::KeyState state); void handleKeyUp(Common::KeyState state) override;
virtual void handleKeyDown(Common::KeyState state); void handleKeyDown(Common::KeyState state) override;
protected: protected:

View file

@ -152,7 +152,7 @@ public:
} }
void reflowLayout(Widget *widgetChain) override; void reflowLayout(Widget *widgetChain) override;
void resetLayout() { void resetLayout() override {
ThemeLayout::resetLayout(); ThemeLayout::resetLayout();
_x = _defaultX; _x = _defaultX;
_y = _defaultY; _y = _defaultY;
@ -162,7 +162,7 @@ public:
protected: protected:
LayoutType getLayoutType() const override { return kLayoutMain; } LayoutType getLayoutType() const override { return kLayoutMain; }
ThemeLayout *makeClone(ThemeLayout *newParent) { assert(!"Do not copy Main Layouts!"); return 0; } ThemeLayout *makeClone(ThemeLayout *newParent) override { assert(!"Do not copy Main Layouts!"); return 0; }
int16 _defaultX; int16 _defaultX;
int16 _defaultY; int16 _defaultY;
@ -204,7 +204,7 @@ protected:
LayoutType getLayoutType() const override { return _type; } LayoutType getLayoutType() const override { return _type; }
ThemeLayout *makeClone(ThemeLayout *newParent) { ThemeLayout *makeClone(ThemeLayout *newParent) override {
ThemeLayoutStacked *n = new ThemeLayoutStacked(*this); ThemeLayoutStacked *n = new ThemeLayoutStacked(*this);
n->_parent = newParent; n->_parent = newParent;
@ -228,8 +228,8 @@ public:
setTextHAlign(align); setTextHAlign(align);
} }
bool getWidgetData(const Common::String &name, int16 &x, int16 &y, uint16 &w, uint16 &h); bool getWidgetData(const Common::String &name, int16 &x, int16 &y, uint16 &w, uint16 &h) override;
Graphics::TextAlign getWidgetTextHAlign(const Common::String &name); Graphics::TextAlign getWidgetTextHAlign(const Common::String &name) override;
void reflowLayout(Widget *widgetChain) override; void reflowLayout(Widget *widgetChain) override;
@ -241,7 +241,7 @@ protected:
bool isBound(Widget *widgetChain) const override; bool isBound(Widget *widgetChain) const override;
Widget *getWidget(Widget *widgetChain) const; Widget *getWidget(Widget *widgetChain) const;
ThemeLayout *makeClone(ThemeLayout *newParent) { ThemeLayout *makeClone(ThemeLayout *newParent) override {
ThemeLayout *n = new ThemeLayoutWidget(*this); ThemeLayout *n = new ThemeLayoutWidget(*this);
n->_parent = newParent; n->_parent = newParent;
return n; return n;
@ -265,7 +265,7 @@ public:
} }
} }
virtual bool getWidgetData(const Common::String &name, int16 &x, int16 &y, uint16 &w, uint16 &h) { bool getWidgetData(const Common::String &name, int16 &x, int16 &y, uint16 &w, uint16 &h) override {
if (ThemeLayoutWidget::getWidgetData(name, x, y, w, h)) { if (ThemeLayoutWidget::getWidgetData(name, x, y, w, h)) {
h -= _tabHeight; h -= _tabHeight;
return true; return true;
@ -277,7 +277,7 @@ public:
protected: protected:
LayoutType getLayoutType() const override { return kLayoutTabWidget; } LayoutType getLayoutType() const override { return kLayoutTabWidget; }
ThemeLayout *makeClone(ThemeLayout *newParent) { ThemeLayout *makeClone(ThemeLayout *newParent) override {
ThemeLayoutTabWidget *n = new ThemeLayoutTabWidget(*this); ThemeLayoutTabWidget *n = new ThemeLayoutTabWidget(*this);
n->_parent = newParent; n->_parent = newParent;
return n; return n;
@ -296,7 +296,7 @@ public:
} }
} }
bool getWidgetData(const Common::String &name, int16 &x, int16 &y, uint16 &w, uint16 &h) { return false; } bool getWidgetData(const Common::String &name, int16 &x, int16 &y, uint16 &w, uint16 &h) override { return false; }
void reflowLayout(Widget *widgetChain) override {} void reflowLayout(Widget *widgetChain) override {}
#ifdef LAYOUT_DEBUG_DIALOG #ifdef LAYOUT_DEBUG_DIALOG
const char *getName() const { return "SPACE"; } const char *getName() const { return "SPACE"; }
@ -305,7 +305,7 @@ public:
protected: protected:
LayoutType getLayoutType() const override { return kLayoutSpace; } LayoutType getLayoutType() const override { return kLayoutSpace; }
ThemeLayout *makeClone(ThemeLayout *newParent) { ThemeLayout *makeClone(ThemeLayout *newParent) override {
ThemeLayout *n = new ThemeLayoutSpacing(*this); ThemeLayout *n = new ThemeLayoutSpacing(*this);
n->_parent = newParent; n->_parent = newParent;
return n; return n;

View file

@ -34,7 +34,7 @@ class ThemeParser : public Common::XMLParser {
public: public:
ThemeParser(ThemeEngine *parent); ThemeParser(ThemeEngine *parent);
virtual ~ThemeParser(); ~ThemeParser() override;
bool getPaletteColor(const Common::String &name, int &r, int &g, int &b) { bool getPaletteColor(const Common::String &name, int &r, int &g, int &b) {
if (!_palette.contains(name)) if (!_palette.contains(name))
@ -244,11 +244,11 @@ protected:
bool parserCallback_space(ParserNode *node); bool parserCallback_space(ParserNode *node);
bool parserCallback_import(ParserNode *node); bool parserCallback_import(ParserNode *node);
bool closedKeyCallback(ParserNode *node); bool closedKeyCallback(ParserNode *node) override;
bool resolutionCheck(const Common::String &resolution); bool resolutionCheck(const Common::String &resolution);
void cleanup(); void cleanup() override;
Graphics::DrawStep *newDrawStep(); Graphics::DrawStep *newDrawStep();
Graphics::DrawStep *defaultDrawStep(); Graphics::DrawStep *defaultDrawStep();

View file

@ -42,29 +42,29 @@ public:
void drawDialog(DrawLayer layerToDraw) override; void drawDialog(DrawLayer layerToDraw) override;
virtual void receivedFocus(int x = -1, int y = -1) override {} void receivedFocus(int x = -1, int y = -1) override {}
protected: protected:
virtual void handleMouseDown(int x, int y, int button, int clickCount) override { void handleMouseDown(int x, int y, int button, int clickCount) override {
close(); close();
_parent->handleMouseDown(x + (getAbsX() - _parent->getAbsX()), y + (getAbsY() - _parent->getAbsY()), button, clickCount); _parent->handleMouseDown(x + (getAbsX() - _parent->getAbsX()), y + (getAbsY() - _parent->getAbsY()), button, clickCount);
} }
virtual void handleMouseUp(int x, int y, int button, int clickCount) override { void handleMouseUp(int x, int y, int button, int clickCount) override {
close(); close();
_parent->handleMouseUp(x + (getAbsX() - _parent->getAbsX()), y + (getAbsY() - _parent->getAbsY()), button, clickCount); _parent->handleMouseUp(x + (getAbsX() - _parent->getAbsX()), y + (getAbsY() - _parent->getAbsY()), button, clickCount);
} }
virtual void handleMouseWheel(int x, int y, int direction) override { void handleMouseWheel(int x, int y, int direction) override {
close(); close();
_parent->handleMouseWheel(x + (getAbsX() - _parent->getAbsX()), y + (getAbsX() - _parent->getAbsX()), direction); _parent->handleMouseWheel(x + (getAbsX() - _parent->getAbsX()), y + (getAbsX() - _parent->getAbsX()), direction);
} }
virtual void handleKeyDown(Common::KeyState state) override { void handleKeyDown(Common::KeyState state) override {
close(); close();
_parent->handleKeyDown(state); _parent->handleKeyDown(state);
} }
virtual void handleKeyUp(Common::KeyState state) override { void handleKeyUp(Common::KeyState state) override {
close(); close();
_parent->handleKeyUp(state); _parent->handleKeyUp(state);
} }
virtual void handleMouseMoved(int x, int y, int button) override { void handleMouseMoved(int x, int y, int button) override {
close(); close();
} }

View file

@ -38,9 +38,9 @@ class BrowserDialog : public Dialog {
public: public:
BrowserDialog(const char *title, bool dirBrowser); BrowserDialog(const char *title, bool dirBrowser);
virtual int runModal(); int runModal() override;
virtual void open(); void open() override;
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
const Common::FSNode &getResult() { return _choice; } const Common::FSNode &getResult() { return _choice; }

View file

@ -49,7 +49,7 @@ public:
void setList(const StringArray& list); void setList(const StringArray& list);
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
}; };
} // End of namespace GUI } // End of namespace GUI

View file

@ -68,9 +68,9 @@ public:
virtual int runModal(); virtual int runModal();
bool isVisible() const { return _visible; } bool isVisible() const override { return _visible; }
void releaseFocus(); void releaseFocus() override;
void setFocusWidget(Widget *widget); void setFocusWidget(Widget *widget);
Widget *getFocusWidget() { return _focusedWidget; } Widget *getFocusWidget() { return _focusedWidget; }
@ -78,7 +78,7 @@ public:
void unSetTickleWidget() { _tickleWidget = NULL; } void unSetTickleWidget() { _tickleWidget = NULL; }
Widget *getTickleWidget() { return _tickleWidget; } Widget *getTickleWidget() { return _tickleWidget; }
virtual void reflowLayout(); void reflowLayout() override;
virtual void lostFocus(); virtual void lostFocus();
virtual void receivedFocus(int x = -1, int y = -1) { if (x >= 0 && y >= 0) handleMouseMoved(x, y, 0); } virtual void receivedFocus(int x = -1, int y = -1) { if (x >= 0 && y >= 0) handleMouseMoved(x, y, 0); }
@ -103,12 +103,12 @@ protected:
virtual void handleKeyUp(Common::KeyState state); virtual void handleKeyUp(Common::KeyState state);
virtual void handleMouseMoved(int x, int y, int button); virtual void handleMouseMoved(int x, int y, int button);
virtual void handleMouseLeft(int button) {}; virtual void handleMouseLeft(int button) {};
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
virtual void handleOtherEvent(Common::Event evt); virtual void handleOtherEvent(Common::Event evt);
Widget *findWidget(int x, int y); // Find the widget at pos x,y if any Widget *findWidget(int x, int y); // Find the widget at pos x,y if any
Widget *findWidget(const char *name); Widget *findWidget(const char *name);
void removeWidget(Widget *widget); void removeWidget(Widget *widget) override;
void setDefaultFocusedWidget(); void setDefaultFocusedWidget();

View file

@ -67,13 +67,13 @@ class DownloadDialog : public Dialog {
public: public:
DownloadDialog(uint32 storageId, LauncherDialog *launcher); DownloadDialog(uint32 storageId, LauncherDialog *launcher);
virtual ~DownloadDialog(); ~DownloadDialog() override;
virtual void open(); void open() override;
virtual void close(); void close() override;
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
virtual void handleTickle(); void handleTickle() override;
virtual void reflowLayout(); void reflowLayout() override;
}; };
} // End of namespace GUI } // End of namespace GUI

View file

@ -89,7 +89,7 @@ public:
: EditTextWidget(boss, name, text, tooltip) {} : EditTextWidget(boss, name, text, tooltip) {}
protected: protected:
bool tryInsertChar(byte c, int pos) { bool tryInsertChar(byte c, int pos) override {
if (Common::isAlnum(c) || c == '-' || c == '_') { if (Common::isAlnum(c) || c == '-' || c == '_') {
_editString.insertChar(c, pos); _editString.insertChar(c, pos);
return true; return true;

View file

@ -62,12 +62,12 @@ class EditGameDialog : public OptionsDialog {
public: public:
EditGameDialog(const String &domain); EditGameDialog(const String &domain);
void open(); void open() override;
virtual void apply(); void apply() override;
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
protected: protected:
virtual void setupGraphicsTab(); void setupGraphicsTab() override;
EditTextWidget *_descriptionWidget; EditTextWidget *_descriptionWidget;
DomainEditTextWidget *_domainWidget; DomainEditTextWidget *_domainWidget;

View file

@ -38,7 +38,7 @@ private:
EditRecordDialog() : Dialog("EditRecordDialog") {}; EditRecordDialog() : Dialog("EditRecordDialog") {};
public: public:
EditRecordDialog(const Common::String author, const Common::String name, const Common::String notes); EditRecordDialog(const Common::String author, const Common::String name, const Common::String notes);
~EditRecordDialog(); ~EditRecordDialog() override;
const Common::String getAuthor(); const Common::String getAuthor();
const Common::String getNotes(); const Common::String getNotes();
@ -48,7 +48,7 @@ public:
void setNotes(const Common::String &desc); void setNotes(const Common::String &desc);
void setName(const Common::String &name); void setName(const Common::String &name);
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
}; };
}// End of namespace GUI }// End of namespace GUI

View file

@ -41,9 +41,9 @@ class FileBrowserDialog : public Dialog {
public: public:
FileBrowserDialog(const char *title, const char *fileExtension, int mode); FileBrowserDialog(const char *title, const char *fileExtension, int mode);
virtual void open(); void open() override;
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
const char *getResult() { return Dialog::getResult() ? _fileName->getEditString().c_str() : NULL; } const char *getResult() { return Dialog::getResult() ? _fileName->getEditString().c_str() : NULL; }

View file

@ -37,11 +37,11 @@ class PopUpWidget;
class FluidSynthSettingsDialog : public Dialog { class FluidSynthSettingsDialog : public Dialog {
public: public:
FluidSynthSettingsDialog(); FluidSynthSettingsDialog();
~FluidSynthSettingsDialog(); ~FluidSynthSettingsDialog() override;
void open(); void open() override;
void close(); void close() override;
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
protected: protected:
void setChorusSettingsState(bool enabled); void setChorusSettingsState(bool enabled);

View file

@ -67,7 +67,7 @@ class GuiManager : public Common::Singleton<GuiManager> {
friend class Dialog; friend class Dialog;
friend class Common::Singleton<SingletonBaseType>; friend class Common::Singleton<SingletonBaseType>;
GuiManager(); GuiManager();
~GuiManager(); ~GuiManager() override;
public: public:
// Main entry for the GUI: this will start an event loop that keeps running // Main entry for the GUI: this will start an event loop that keeps running

View file

@ -43,15 +43,15 @@ class LauncherDialog : public Dialog {
typedef Common::Array<Common::String> StringArray; typedef Common::Array<Common::String> StringArray;
public: public:
LauncherDialog(); LauncherDialog();
~LauncherDialog(); ~LauncherDialog() override;
void rebuild(); void rebuild();
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
virtual void handleKeyDown(Common::KeyState state); void handleKeyDown(Common::KeyState state) override;
virtual void handleKeyUp(Common::KeyState state); void handleKeyUp(Common::KeyState state) override;
virtual void handleOtherEvent(Common::Event evt); void handleOtherEvent(Common::Event evt) override;
bool doGameDetection(const Common::String &path); bool doGameDetection(const Common::String &path);
protected: protected:
EditTextWidget *_searchWidget; EditTextWidget *_searchWidget;
@ -73,7 +73,7 @@ protected:
String _search; String _search;
virtual void reflowLayout(); void reflowLayout() override;
/** /**
* Fill the list widget with all currently configured targets, and trigger * Fill the list widget with all currently configured targets, and trigger
@ -86,8 +86,8 @@ protected:
void build(); void build();
void clean(); void clean();
void open(); void open() override;
void close(); void close() override;
/** /**
* Handle "Add game..." button. * Handle "Add game..." button.

View file

@ -40,8 +40,8 @@ public:
MassAddDialog(const Common::FSNode &startDir); MassAddDialog(const Common::FSNode &startDir);
//void open(); //void open();
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
void handleTickle(); void handleTickle() override;
Common::String getFirstAddedTarget() const { Common::String getFirstAddedTarget() const {
if (!_games.empty()) if (!_games.empty())

View file

@ -43,7 +43,7 @@ class MessageDialog : public Dialog {
public: public:
MessageDialog(const Common::String &message, const char *defaultButton = "OK", const char *altButton = 0); MessageDialog(const Common::String &message, const char *defaultButton = "OK", const char *altButton = 0);
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
}; };
/** /**
@ -53,7 +53,7 @@ class TimedMessageDialog : public MessageDialog {
public: public:
TimedMessageDialog(const Common::String &message, uint32 duration); TimedMessageDialog(const Common::String &message, uint32 duration);
void handleTickle(); void handleTickle() override;
protected: protected:
uint32 _timer; uint32 _timer;

View file

@ -72,7 +72,7 @@ protected:
public: public:
GuiObject(int x, int y, int w, int h) : _x(x), _y(y), _w(w), _h(h), _firstWidget(nullptr) { } GuiObject(int x, int y, int w, int h) : _x(x), _y(y), _w(w), _h(h), _firstWidget(nullptr) { }
GuiObject(const Common::String &name); GuiObject(const Common::String &name);
~GuiObject(); ~GuiObject() override;
virtual void setTextDrawableArea(const Common::Rect &r) { _textDrawableArea = r; } virtual void setTextDrawableArea(const Common::Rect &r) { _textDrawableArea = r; }

View file

@ -42,23 +42,23 @@ private:
public: public:
OnScreenDialog(bool recordingMode); OnScreenDialog(bool recordingMode);
~OnScreenDialog(); ~OnScreenDialog() override;
virtual void close(); void close() override;
virtual bool isVisible() const; bool isVisible() const override;
virtual void reflowLayout(); void reflowLayout() override;
void setReplayedTime(uint32 newTime); void setReplayedTime(uint32 newTime);
virtual void handleMouseMoved(int x, int y, int button); void handleMouseMoved(int x, int y, int button) override;
virtual void handleMouseDown(int x, int y, int button, int clickCount); void handleMouseDown(int x, int y, int button, int clickCount) override;
virtual void handleMouseUp(int x, int y, int button, int clickCount); void handleMouseUp(int x, int y, int button, int clickCount) override;
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
bool isMouseOver(); bool isMouseOver();
bool isEditDlgVisible(); bool isEditDlgVisible();
Dialog *getActiveDlg(); Dialog *getActiveDlg();
protected: protected:
virtual void releaseFocus(); void releaseFocus() override;
}; };
} // End of namespace GUI } // End of namespace GUI

View file

@ -62,17 +62,17 @@ class OptionsDialog : public Dialog {
public: public:
OptionsDialog(const Common::String &domain, int x, int y, int w, int h); OptionsDialog(const Common::String &domain, int x, int y, int w, int h);
OptionsDialog(const Common::String &domain, const Common::String &name); OptionsDialog(const Common::String &domain, const Common::String &name);
~OptionsDialog(); ~OptionsDialog() override;
void init(); void init();
void open(); void open() override;
virtual void apply(); virtual void apply();
void close(); void close() override;
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
const Common::String& getDomain() const { return _domain; } const Common::String& getDomain() const { return _domain; }
virtual void reflowLayout(); void reflowLayout() override;
protected: protected:
/** Config domain this dialog is used to edit. */ /** Config domain this dialog is used to edit. */
@ -240,18 +240,18 @@ protected:
class GlobalOptionsDialog : public OptionsDialog, public CommandSender { class GlobalOptionsDialog : public OptionsDialog, public CommandSender {
public: public:
GlobalOptionsDialog(LauncherDialog *launcher); GlobalOptionsDialog(LauncherDialog *launcher);
~GlobalOptionsDialog(); ~GlobalOptionsDialog() override;
virtual void apply(); void apply() override;
void close(); void close() override;
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
void handleTickle(); void handleTickle() override;
virtual void reflowLayout(); void reflowLayout() override;
protected: protected:
virtual void build(); void build() override;
virtual void clean(); void clean() override;
Common::String _newTheme; Common::String _newTheme;
LauncherDialog *_launcher; LauncherDialog *_launcher;

View file

@ -36,13 +36,13 @@ class PicButtonWidget;
class PredictiveDialog : public GUI::Dialog { class PredictiveDialog : public GUI::Dialog {
public: public:
PredictiveDialog(); PredictiveDialog();
~PredictiveDialog(); ~PredictiveDialog() override;
virtual void reflowLayout(); void reflowLayout() override;
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
virtual void handleKeyUp(Common::KeyState state); void handleKeyUp(Common::KeyState state) override;
virtual void handleKeyDown(Common::KeyState state); void handleKeyDown(Common::KeyState state) override;
const char *getResult() const { return _predictiveResult; } const char *getResult() const { return _predictiveResult; }

View file

@ -69,10 +69,10 @@ public:
kRecordDialogPlayback kRecordDialogPlayback
}; };
RecorderDialog(); RecorderDialog();
~RecorderDialog(); ~RecorderDialog() override;
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
virtual void reflowLayout(); void reflowLayout() override;
int runModal(Common::String &target); int runModal(Common::String &target);
const Common::String getFileName() {return _filename;} const Common::String getFileName() {return _filename;}

View file

@ -39,12 +39,12 @@ class CommandSender;
class RemoteBrowserDialog : public Dialog { class RemoteBrowserDialog : public Dialog {
public: public:
RemoteBrowserDialog(const char *title); RemoteBrowserDialog(const char *title);
virtual ~RemoteBrowserDialog(); ~RemoteBrowserDialog() override;
virtual void open(); void open() override;
virtual void close(); void close() override;
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
virtual void handleTickle(); void handleTickle() override;
const Cloud::StorageFile &getResult() { return _choice; } const Cloud::StorageFile &getResult() { return _choice; }

View file

@ -42,10 +42,10 @@ class SaveLoadCloudSyncProgressDialog : public Dialog { //protected?
bool _close; bool _close;
public: public:
SaveLoadCloudSyncProgressDialog(bool canRunInBackground); SaveLoadCloudSyncProgressDialog(bool canRunInBackground);
virtual ~SaveLoadCloudSyncProgressDialog(); ~SaveLoadCloudSyncProgressDialog() override;
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
virtual void handleTickle(); void handleTickle() override;
}; };
#endif #endif
@ -72,20 +72,20 @@ class SaveLoadChooserDialog : protected Dialog {
public: public:
SaveLoadChooserDialog(const Common::String &dialogName, const bool saveMode); SaveLoadChooserDialog(const Common::String &dialogName, const bool saveMode);
SaveLoadChooserDialog(int x, int y, int w, int h, const bool saveMode); SaveLoadChooserDialog(int x, int y, int w, int h, const bool saveMode);
virtual ~SaveLoadChooserDialog(); ~SaveLoadChooserDialog() override;
virtual void open(); void open() override;
virtual void close(); void close() override;
virtual void reflowLayout(); void reflowLayout() override;
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
#if defined(USE_CLOUD) && defined(USE_LIBCURL) #if defined(USE_CLOUD) && defined(USE_LIBCURL)
virtual void runSaveSync(bool hasSavepathOverride); virtual void runSaveSync(bool hasSavepathOverride);
#endif #endif
virtual void handleTickle(); void handleTickle() override;
#ifndef DISABLE_SAVELOADCHOOSER_GRID #ifndef DISABLE_SAVELOADCHOOSER_GRID
virtual SaveLoadChooserType getType() const = 0; virtual SaveLoadChooserType getType() const = 0;
@ -136,22 +136,22 @@ class SaveLoadChooserSimple : public SaveLoadChooserDialog {
public: public:
SaveLoadChooserSimple(const String &title, const String &buttonLabel, bool saveMode); SaveLoadChooserSimple(const String &title, const String &buttonLabel, bool saveMode);
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
virtual const Common::String &getResultString() const; const Common::String &getResultString() const override;
virtual void reflowLayout(); void reflowLayout() override;
#ifndef DISABLE_SAVELOADCHOOSER_GRID #ifndef DISABLE_SAVELOADCHOOSER_GRID
virtual SaveLoadChooserType getType() const { return kSaveLoadDialogList; } SaveLoadChooserType getType() const override { return kSaveLoadDialogList; }
#endif // !DISABLE_SAVELOADCHOOSER_GRID #endif // !DISABLE_SAVELOADCHOOSER_GRID
virtual void open(); void open() override;
virtual void close(); void close() override;
protected: protected:
virtual void updateSaveList(); void updateSaveList() override;
private: private:
virtual int runIntern(); int runIntern() override;
ListWidget *_list; ListWidget *_list;
ButtonWidget *_chooseButton; ButtonWidget *_chooseButton;
@ -181,9 +181,9 @@ public:
void setTargetSlot(int slot) { _targetSlot = slot; } void setTargetSlot(int slot) { _targetSlot = slot; }
virtual void open(); void open() override;
protected: protected:
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
private: private:
int _targetSlot; int _targetSlot;
StaticTextWidget *_title; StaticTextWidget *_title;
@ -193,23 +193,23 @@ private:
class SaveLoadChooserGrid : public SaveLoadChooserDialog { class SaveLoadChooserGrid : public SaveLoadChooserDialog {
public: public:
SaveLoadChooserGrid(const Common::String &title, bool saveMode); SaveLoadChooserGrid(const Common::String &title, bool saveMode);
~SaveLoadChooserGrid(); ~SaveLoadChooserGrid() override;
virtual const Common::String &getResultString() const; const Common::String &getResultString() const override;
virtual void open(); void open() override;
virtual void reflowLayout(); void reflowLayout() override;
virtual SaveLoadChooserType getType() const { return kSaveLoadDialogGrid; } SaveLoadChooserType getType() const override { return kSaveLoadDialogGrid; }
virtual void close(); void close() override;
protected: protected:
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
virtual void handleMouseWheel(int x, int y, int direction); void handleMouseWheel(int x, int y, int direction) override;
virtual void updateSaveList(); void updateSaveList() override;
private: private:
virtual int runIntern(); int runIntern() override;
uint _columns, _lines; uint _columns, _lines;
uint _entriesPerPage; uint _entriesPerPage;

View file

@ -38,8 +38,8 @@ class ThemeBrowser : public Dialog {
public: public:
ThemeBrowser(); ThemeBrowser();
void open(); void open() override;
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
const Common::String &getSelected() const { return _select; } const Common::String &getSelected() const { return _select; }
const Common::String &getSelectedName() const { return _selectName; } const Common::String &getSelectedName() const { return _selectName; }

View file

@ -38,9 +38,9 @@ class PopUpWidget;
class UpdatesDialog : public Dialog { class UpdatesDialog : public Dialog {
public: public:
UpdatesDialog(); UpdatesDialog();
virtual ~UpdatesDialog() {} ~UpdatesDialog() override {}
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
private: private:
PopUpWidget *_updatesPopUp; PopUpWidget *_updatesPopUp;

View file

@ -116,7 +116,7 @@ public:
public: public:
Widget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0); Widget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0);
Widget(GuiObject *boss, const Common::String &name, const char *tooltip = 0); Widget(GuiObject *boss, const Common::String &name, const char *tooltip = 0);
virtual ~Widget(); ~Widget() override;
void init(); void init();
void resize(int x, int y, int w, int h); void resize(int x, int y, int w, int h);
@ -124,8 +124,8 @@ public:
void setNext(Widget *w) { _next = w; } void setNext(Widget *w) { _next = w; }
Widget *next() { return _next; } Widget *next() { return _next; }
virtual int16 getAbsX() const { return _x + _boss->getChildX(); } int16 getAbsX() const override { return _x + _boss->getChildX(); }
virtual int16 getAbsY() const { return _y + _boss->getChildY(); } int16 getAbsY() const override { return _y + _boss->getChildY(); }
virtual void setPos(int x, int y) { _x = x; _y = y; } virtual void setPos(int x, int y) { _x = x; _y = y; }
virtual void setSize(int w, int h) { _w = w; _h = h; } virtual void setSize(int w, int h) { _w = w; _h = h; }
@ -161,7 +161,7 @@ public:
bool isEnabled() const; bool isEnabled() const;
void setVisible(bool e); void setVisible(bool e);
bool isVisible() const; bool isVisible() const override;
uint8 parseHotkey(const Common::String &label); uint8 parseHotkey(const Common::String &label);
Common::String cleanupHotkey(const Common::String &label); Common::String cleanupHotkey(const Common::String &label);
@ -184,10 +184,10 @@ protected:
virtual Widget *findWidget(int x, int y) { return this; } virtual Widget *findWidget(int x, int y) { return this; }
void releaseFocus() { assert(_boss); _boss->releaseFocus(); } void releaseFocus() override { assert(_boss); _boss->releaseFocus(); }
// By default, delegate unhandled commands to the boss // By default, delegate unhandled commands to the boss
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { assert(_boss); _boss->handleCommand(sender, cmd, data); } void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override { assert(_boss); _boss->handleCommand(sender, cmd, data); }
}; };
/* StaticTextWidget */ /* StaticTextWidget */
@ -201,14 +201,14 @@ public:
StaticTextWidget(GuiObject *boss, const Common::String &name, const Common::String &text, const char *tooltip = 0, ThemeEngine::FontStyle font = ThemeEngine::kFontStyleBold); StaticTextWidget(GuiObject *boss, const Common::String &name, const Common::String &text, const char *tooltip = 0, ThemeEngine::FontStyle font = ThemeEngine::kFontStyleBold);
void setValue(int value); void setValue(int value);
void setLabel(const Common::String &label); void setLabel(const Common::String &label);
void handleMouseEntered(int button) { readLabel(); } void handleMouseEntered(int button) override { readLabel(); }
const Common::String &getLabel() const { return _label; } const Common::String &getLabel() const { return _label; }
void setAlign(Graphics::TextAlign align); void setAlign(Graphics::TextAlign align);
Graphics::TextAlign getAlign() const { return _align; } Graphics::TextAlign getAlign() const { return _align; }
void readLabel() { read(_label); } void readLabel() { read(_label); }
protected: protected:
void drawWidget(); void drawWidget() override;
}; };
/* ButtonWidget */ /* ButtonWidget */
@ -228,16 +228,16 @@ public:
void setLabel(const Common::String &label); void setLabel(const Common::String &label);
void handleMouseUp(int x, int y, int button, int clickCount); void handleMouseUp(int x, int y, int button, int clickCount) override;
void handleMouseDown(int x, int y, int button, int clickCount); void handleMouseDown(int x, int y, int button, int clickCount) override;
void handleMouseEntered(int button) { readLabel(); if (_duringPress) { setFlags(WIDGET_PRESSED); } else { setFlags(WIDGET_HILITED); } markAsDirty(); } void handleMouseEntered(int button) override { readLabel(); if (_duringPress) { setFlags(WIDGET_PRESSED); } else { setFlags(WIDGET_HILITED); } markAsDirty(); }
void handleMouseLeft(int button) { clearFlags(WIDGET_HILITED | WIDGET_PRESSED); markAsDirty(); } void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED | WIDGET_PRESSED); markAsDirty(); }
void setHighLighted(bool enable); void setHighLighted(bool enable);
void setPressedState(); void setPressedState();
void setUnpressedState(); void setUnpressedState();
protected: protected:
void drawWidget(); void drawWidget() override;
bool _duringPress; bool _duringPress;
}; };
@ -281,7 +281,7 @@ class PicButtonWidget : public ButtonWidget {
public: public:
PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0); PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0);
PicButtonWidget(GuiObject *boss, const Common::String &name, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0); PicButtonWidget(GuiObject *boss, const Common::String &name, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0);
~PicButtonWidget(); ~PicButtonWidget() override;
void setGfx(const Graphics::Surface *gfx, int statenum = kPicButtonStateEnabled); void setGfx(const Graphics::Surface *gfx, int statenum = kPicButtonStateEnabled);
void setGfx(int w, int h, int r, int g, int b, int statenum = kPicButtonStateEnabled); void setGfx(int w, int h, int r, int g, int b, int statenum = kPicButtonStateEnabled);
@ -291,7 +291,7 @@ public:
void setButtonDisplay(bool enable) {_showButton = enable; } void setButtonDisplay(bool enable) {_showButton = enable; }
protected: protected:
void drawWidget(); void drawWidget() override;
Graphics::Surface _gfx[kPicButtonStateMax + 1]; Graphics::Surface _gfx[kPicButtonStateMax + 1];
int _alpha; int _alpha;
@ -307,16 +307,16 @@ public:
CheckboxWidget(GuiObject *boss, int x, int y, int w, int h, const Common::String &label, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0); CheckboxWidget(GuiObject *boss, int x, int y, int w, int h, const Common::String &label, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0);
CheckboxWidget(GuiObject *boss, const Common::String &name, const Common::String &label, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0); CheckboxWidget(GuiObject *boss, const Common::String &name, const Common::String &label, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0);
void handleMouseUp(int x, int y, int button, int clickCount); void handleMouseUp(int x, int y, int button, int clickCount) override;
virtual void handleMouseEntered(int button) { readLabel(); setFlags(WIDGET_HILITED); markAsDirty(); } void handleMouseEntered(int button) override { readLabel(); setFlags(WIDGET_HILITED); markAsDirty(); }
virtual void handleMouseLeft(int button) { clearFlags(WIDGET_HILITED); markAsDirty(); } void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED); markAsDirty(); }
void setState(bool state); void setState(bool state);
void toggleState() { setState(!_state); } void toggleState() { setState(!_state); }
bool getState() const { return _state; } bool getState() const { return _state; }
protected: protected:
void drawWidget(); void drawWidget() override;
}; };
class RadiobuttonWidget; class RadiobuttonWidget;
@ -324,7 +324,7 @@ class RadiobuttonWidget;
class RadiobuttonGroup : public CommandSender { class RadiobuttonGroup : public CommandSender {
public: public:
RadiobuttonGroup(GuiObject *boss, uint32 cmd = 0); RadiobuttonGroup(GuiObject *boss, uint32 cmd = 0);
~RadiobuttonGroup() {} ~RadiobuttonGroup() override {}
void addButton(RadiobuttonWidget *button) { _buttons.push_back(button); } void addButton(RadiobuttonWidget *button) { _buttons.push_back(button); }
Common::Array<RadiobuttonWidget *> getButtonList() const { return _buttons; } Common::Array<RadiobuttonWidget *> getButtonList() const { return _buttons; }
@ -353,9 +353,9 @@ public:
RadiobuttonWidget(GuiObject *boss, int x, int y, int w, int h, RadiobuttonGroup *group, int value, const Common::String &label, const char *tooltip = 0, uint8 hotkey = 0); RadiobuttonWidget(GuiObject *boss, int x, int y, int w, int h, RadiobuttonGroup *group, int value, const Common::String &label, const char *tooltip = 0, uint8 hotkey = 0);
RadiobuttonWidget(GuiObject *boss, const Common::String &name, RadiobuttonGroup *group, int value, const Common::String &label, const char *tooltip = 0, uint8 hotkey = 0); RadiobuttonWidget(GuiObject *boss, const Common::String &name, RadiobuttonGroup *group, int value, const Common::String &label, const char *tooltip = 0, uint8 hotkey = 0);
void handleMouseUp(int x, int y, int button, int clickCount); void handleMouseUp(int x, int y, int button, int clickCount) override;
virtual void handleMouseEntered(int button) { readLabel(); setFlags(WIDGET_HILITED); markAsDirty(); } void handleMouseEntered(int button) override { readLabel(); setFlags(WIDGET_HILITED); markAsDirty(); }
virtual void handleMouseLeft(int button) { clearFlags(WIDGET_HILITED); markAsDirty(); } void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED); markAsDirty(); }
void setState(bool state, bool setGroup = true); void setState(bool state, bool setGroup = true);
void toggleState() { setState(!_state); } void toggleState() { setState(!_state); }
@ -363,7 +363,7 @@ public:
int getValue() const { return _value; } int getValue() const { return _value; }
protected: protected:
void drawWidget(); void drawWidget() override;
RadiobuttonGroup *_group; RadiobuttonGroup *_group;
}; };
@ -391,15 +391,15 @@ public:
void setMaxValue(int value) { _valueMax = value; } void setMaxValue(int value) { _valueMax = value; }
int getMaxValue() const { return _valueMax; } int getMaxValue() const { return _valueMax; }
void handleMouseMoved(int x, int y, int button); void handleMouseMoved(int x, int y, int button) override;
void handleMouseDown(int x, int y, int button, int clickCount); void handleMouseDown(int x, int y, int button, int clickCount) override;
void handleMouseUp(int x, int y, int button, int clickCount); void handleMouseUp(int x, int y, int button, int clickCount) override;
void handleMouseEntered(int button) { setFlags(WIDGET_HILITED); markAsDirty(); } void handleMouseEntered(int button) override { setFlags(WIDGET_HILITED); markAsDirty(); }
void handleMouseLeft(int button) { clearFlags(WIDGET_HILITED); markAsDirty(); } void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED); markAsDirty(); }
void handleMouseWheel(int x, int y, int direction); void handleMouseWheel(int x, int y, int direction) override;
protected: protected:
void drawWidget(); void drawWidget() override;
int valueToPos(int value); int valueToPos(int value);
int posToValue(int pos); int posToValue(int pos);
@ -411,7 +411,7 @@ class GraphicsWidget : public Widget {
public: public:
GraphicsWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0); GraphicsWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0);
GraphicsWidget(GuiObject *boss, const Common::String &name, const char *tooltip = 0); GraphicsWidget(GuiObject *boss, const Common::String &name, const char *tooltip = 0);
~GraphicsWidget(); ~GraphicsWidget() override;
void setGfx(const Graphics::Surface *gfx); void setGfx(const Graphics::Surface *gfx);
void setGfx(int w, int h, int r, int g, int b); void setGfx(int w, int h, int r, int g, int b);
@ -420,7 +420,7 @@ public:
void useThemeTransparency(bool enable) { _transparency = enable; } void useThemeTransparency(bool enable) { _transparency = enable; }
protected: protected:
void drawWidget(); void drawWidget() override;
Graphics::Surface _gfx; Graphics::Surface _gfx;
int _alpha; int _alpha;
@ -432,15 +432,15 @@ class ContainerWidget : public Widget {
public: public:
ContainerWidget(GuiObject *boss, int x, int y, int w, int h); ContainerWidget(GuiObject *boss, int x, int y, int w, int h);
ContainerWidget(GuiObject *boss, const Common::String &name); ContainerWidget(GuiObject *boss, const Common::String &name);
~ContainerWidget(); ~ContainerWidget() override;
virtual bool containsWidget(Widget *) const; bool containsWidget(Widget *) const override;
virtual Widget *findWidget(int x, int y); Widget *findWidget(int x, int y) override;
virtual void removeWidget(Widget *widget); void removeWidget(Widget *widget) override;
void setBackgroundType(ThemeEngine::WidgetBackground backgroundType); void setBackgroundType(ThemeEngine::WidgetBackground backgroundType);
protected: protected:
void drawWidget(); void drawWidget() override;
ThemeEngine::WidgetBackground _backgroundType; ThemeEngine::WidgetBackground _backgroundType;
}; };

View file

@ -62,16 +62,16 @@ protected:
public: public:
EditableWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0, uint32 cmd = 0); EditableWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0, uint32 cmd = 0);
EditableWidget(GuiObject *boss, const String &name, const char *tooltip = 0, uint32 cmd = 0); EditableWidget(GuiObject *boss, const String &name, const char *tooltip = 0, uint32 cmd = 0);
virtual ~EditableWidget(); ~EditableWidget() override;
void init(); void init();
virtual void setEditString(const String &str); virtual void setEditString(const String &str);
virtual const String &getEditString() const { return _editString; } virtual const String &getEditString() const { return _editString; }
virtual void handleTickle(); void handleTickle() override;
virtual bool handleKeyDown(Common::KeyState state); bool handleKeyDown(Common::KeyState state) override;
virtual void reflowLayout(); void reflowLayout() override;
bool setCaretPos(int newPos); bool setCaretPos(int newPos);

View file

@ -43,24 +43,24 @@ public:
EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip = 0, uint32 cmd = 0, uint32 finishCmd = 0, ThemeEngine::FontStyle font = ThemeEngine::kFontStyleNormal); EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip = 0, uint32 cmd = 0, uint32 finishCmd = 0, ThemeEngine::FontStyle font = ThemeEngine::kFontStyleNormal);
EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltp = 0, uint32 cmd = 0, uint32 finishCmd = 0, ThemeEngine::FontStyle font = ThemeEngine::kFontStyleNormal); EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltp = 0, uint32 cmd = 0, uint32 finishCmd = 0, ThemeEngine::FontStyle font = ThemeEngine::kFontStyleNormal);
void setEditString(const String &str); void setEditString(const String &str) override;
virtual void handleMouseDown(int x, int y, int button, int clickCount); void handleMouseDown(int x, int y, int button, int clickCount) override;
virtual bool wantsFocus() { return true; } bool wantsFocus() override { return true; }
virtual void reflowLayout(); void reflowLayout() override;
protected: protected:
void drawWidget(); void drawWidget() override;
void receivedFocusWidget(); void receivedFocusWidget() override;
void lostFocusWidget(); void lostFocusWidget() override;
void startEditMode(); void startEditMode() override;
void endEditMode(); void endEditMode() override;
void abortEditMode(); void abortEditMode() override;
Common::Rect getEditRect() const; Common::Rect getEditRect() const override;
uint32 _finishCmd; uint32 _finishCmd;
}; };

View file

@ -90,8 +90,8 @@ public:
ListWidget(Dialog *boss, const String &name, const char *tooltip = 0, uint32 cmd = 0); ListWidget(Dialog *boss, const String &name, const char *tooltip = 0, uint32 cmd = 0);
ListWidget(Dialog *boss, int x, int y, int w, int h, const char *tooltip = 0, uint32 cmd = 0); ListWidget(Dialog *boss, int x, int y, int w, int h, const char *tooltip = 0, uint32 cmd = 0);
virtual bool containsWidget(Widget *) const; bool containsWidget(Widget *) const override;
virtual Widget *findWidget(int x, int y); Widget *findWidget(int x, int y) override;
void setList(const StringArray &list, const ColorList *colors = 0); void setList(const StringArray &list, const ColorList *colors = 0);
const StringArray &getList() const { return _dataList; } const StringArray &getList() const { return _dataList; }
@ -118,38 +118,38 @@ public:
void setEditColor(ThemeEngine::FontColor color) { _editColor = color; } void setEditColor(ThemeEngine::FontColor color) { _editColor = color; }
// Made startEditMode/endEditMode for SaveLoadChooser // Made startEditMode/endEditMode for SaveLoadChooser
void startEditMode(); void startEditMode() override;
void endEditMode(); void endEditMode() override;
void setFilter(const String &filter, bool redraw = true); void setFilter(const String &filter, bool redraw = true);
virtual void handleTickle(); void handleTickle() override;
virtual void handleMouseDown(int x, int y, int button, int clickCount); void handleMouseDown(int x, int y, int button, int clickCount) override;
virtual void handleMouseUp(int x, int y, int button, int clickCount); void handleMouseUp(int x, int y, int button, int clickCount) override;
virtual void handleMouseWheel(int x, int y, int direction); void handleMouseWheel(int x, int y, int direction) override;
virtual void handleMouseMoved(int x, int y, int button); void handleMouseMoved(int x, int y, int button) override;
virtual void handleMouseLeft(int button); void handleMouseLeft(int button) override;
virtual bool handleKeyDown(Common::KeyState state); bool handleKeyDown(Common::KeyState state) override;
virtual bool handleKeyUp(Common::KeyState state); bool handleKeyUp(Common::KeyState state) override;
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
virtual void reflowLayout(); void reflowLayout() override;
virtual bool wantsFocus() { return true; } bool wantsFocus() override { return true; }
protected: protected:
void drawWidget(); void drawWidget() override;
/// Finds the item at position (x,y). Returns -1 if there is no item there. /// Finds the item at position (x,y). Returns -1 if there is no item there.
int findItem(int x, int y) const; int findItem(int x, int y) const;
void scrollBarRecalc(); void scrollBarRecalc();
void abortEditMode(); void abortEditMode() override;
Common::Rect getEditRect() const; Common::Rect getEditRect() const override;
void receivedFocusWidget(); void receivedFocusWidget() override;
void lostFocusWidget(); void lostFocusWidget() override;
void checkBounds(); void checkBounds();
void scrollToCurrent(); void scrollToCurrent();
}; };

View file

@ -60,8 +60,8 @@ public:
PopUpWidget(GuiObject *boss, const String &name, const char *tooltip = 0); PopUpWidget(GuiObject *boss, const String &name, const char *tooltip = 0);
PopUpWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0); PopUpWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0);
void handleMouseDown(int x, int y, int button, int clickCount); void handleMouseDown(int x, int y, int button, int clickCount) override;
void handleMouseWheel(int x, int y, int direction); void handleMouseWheel(int x, int y, int direction) override;
void appendEntry(const String &entry, uint32 tag = (uint32)-1); void appendEntry(const String &entry, uint32 tag = (uint32)-1);
void clearEntries(); void clearEntries();
@ -77,12 +77,12 @@ public:
uint32 getSelectedTag() const { return (_selectedItem >= 0) ? _entries[_selectedItem].tag : (uint32)-1; } uint32 getSelectedTag() const { return (_selectedItem >= 0) ? _entries[_selectedItem].tag : (uint32)-1; }
// const String& getSelectedString() const { return (_selectedItem >= 0) ? _entries[_selectedItem].name : String::emptyString; } // const String& getSelectedString() const { return (_selectedItem >= 0) ? _entries[_selectedItem].name : String::emptyString; }
void handleMouseEntered(int button) { if (_selectedItem != -1) read(_entries[_selectedItem].name); setFlags(WIDGET_HILITED); markAsDirty(); } void handleMouseEntered(int button) override { if (_selectedItem != -1) read(_entries[_selectedItem].name); setFlags(WIDGET_HILITED); markAsDirty(); }
void handleMouseLeft(int button) { clearFlags(WIDGET_HILITED); markAsDirty(); } void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED); markAsDirty(); }
virtual void reflowLayout(); void reflowLayout() override;
protected: protected:
void drawWidget(); void drawWidget() override;
}; };
/** /**

View file

@ -65,14 +65,14 @@ public:
public: public:
ScrollBarWidget(GuiObject *boss, int x, int y, int w, int h); ScrollBarWidget(GuiObject *boss, int x, int y, int w, int h);
void handleMouseDown(int x, int y, int button, int clickCount); void handleMouseDown(int x, int y, int button, int clickCount) override;
void handleMouseUp(int x, int y, int button, int clickCount); void handleMouseUp(int x, int y, int button, int clickCount) override;
void handleMouseWheel(int x, int y, int direction); void handleMouseWheel(int x, int y, int direction) override;
void handleMouseMoved(int x, int y, int button); void handleMouseMoved(int x, int y, int button) override;
void handleMouseEntered(int button) { setFlags(WIDGET_HILITED); } void handleMouseEntered(int button) override { setFlags(WIDGET_HILITED); }
void handleMouseLeft(int button) { clearFlags(WIDGET_HILITED); _part = kNoPart; markAsDirty(); } void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED); _part = kNoPart; markAsDirty(); }
void handleTickle(); void handleTickle() override;
bool wantsFocus() { return true; } bool wantsFocus() override { return true; }
// FIXME - this should be private, but then we also have to add accessors // FIXME - this should be private, but then we also have to add accessors
// for _numEntries, _entriesPerPage and _currentPos. This again leads to the question: // for _numEntries, _entriesPerPage and _currentPos. This again leads to the question:
@ -82,7 +82,7 @@ public:
void checkBounds(int old_pos); void checkBounds(int old_pos);
protected: protected:
void drawWidget(); void drawWidget() override;
}; };
} // End of namespace GUI } // End of namespace GUI

View file

@ -66,7 +66,7 @@ protected:
public: public:
TabWidget(GuiObject *boss, int x, int y, int w, int h); TabWidget(GuiObject *boss, int x, int y, int w, int h);
TabWidget(GuiObject *boss, const String &name); TabWidget(GuiObject *boss, const String &name);
~TabWidget(); ~TabWidget() override;
void init(); void init();
@ -103,17 +103,17 @@ public:
_tabs[tabID].title = title; _tabs[tabID].title = title;
} }
virtual void handleMouseDown(int x, int y, int button, int clickCount) override; void handleMouseDown(int x, int y, int button, int clickCount) override;
virtual void handleMouseMoved(int x, int y, int button); void handleMouseMoved(int x, int y, int button) override;
virtual void handleMouseLeft(int button) { _lastRead = -1; }; void handleMouseLeft(int button) override { _lastRead = -1; };
virtual bool handleKeyDown(Common::KeyState state) override; bool handleKeyDown(Common::KeyState state) override;
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override; void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
virtual int getFirstVisible() const; virtual int getFirstVisible() const;
virtual void setFirstVisible(int tabID, bool adjustIfRoom = false); virtual void setFirstVisible(int tabID, bool adjustIfRoom = false);
virtual bool containsWidget(Widget *) const override; bool containsWidget(Widget *) const override;
virtual void reflowLayout() override; void reflowLayout() override;
void draw() override; void draw() override;
void markAsDirty() override; void markAsDirty() override;
@ -121,12 +121,12 @@ public:
protected: protected:
// We overload getChildY to make sure child widgets are positioned correctly. // We overload getChildY to make sure child widgets are positioned correctly.
// Essentially this compensates for the space taken up by the tab title header. // Essentially this compensates for the space taken up by the tab title header.
virtual int16 getChildY() const override; int16 getChildY() const override;
virtual uint16 getHeight() const override; uint16 getHeight() const override;
virtual void drawWidget() override; void drawWidget() override;
virtual Widget *findWidget(int x, int y) override; Widget *findWidget(int x, int y) override;
virtual void adjustTabs(int value); virtual void adjustTabs(int value);