mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
Cleanup: use override specifier everywhere, and enable gcc warning to check for it.
This commit is contained in:
@@ -22,11 +22,11 @@ const double min_item_size = thumbnail_size;
|
||||
class ChoiceThumbnailRequest : public ThumbnailRequest {
|
||||
public:
|
||||
ChoiceThumbnailRequest(ValueViewer* cve, int id, bool from_disk, bool thread_safe);
|
||||
virtual Image generate();
|
||||
virtual void store(const Image&);
|
||||
Image generate() override;
|
||||
void store(const Image&) override;
|
||||
|
||||
bool isThreadSafe;
|
||||
virtual bool threadSafe() const {return isThreadSafe;}
|
||||
bool threadSafe() const override {return isThreadSafe;}
|
||||
private:
|
||||
int id;
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@ public:
|
||||
~ChoiceValueEditor();
|
||||
|
||||
// --------------------------------------------------- : Events
|
||||
virtual bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev);
|
||||
virtual bool onChar(wxKeyEvent& ev);
|
||||
virtual void onLoseFocus();
|
||||
bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev) override;
|
||||
bool onChar(wxKeyEvent& ev) override;
|
||||
void onLoseFocus() override;
|
||||
|
||||
virtual void draw(RotatedDC& dc);
|
||||
virtual void determineSize(bool);
|
||||
void draw(RotatedDC& dc) override;
|
||||
void determineSize(bool) override;
|
||||
|
||||
private:
|
||||
DropDownListP drop_down;
|
||||
@@ -93,9 +93,9 @@ public:
|
||||
DropDownChoiceList(Window* parent, bool is_submenu, ValueViewer& cve, ChoiceField::ChoiceP group);
|
||||
|
||||
protected:
|
||||
virtual void onShow();
|
||||
virtual void select(size_t item);
|
||||
virtual size_t selection() const;
|
||||
virtual DropDownList* createSubMenu(ChoiceField::ChoiceP group) const;
|
||||
void onShow() override;
|
||||
void select(size_t item) override;
|
||||
size_t selection() const override;
|
||||
DropDownList* createSubMenu(ChoiceField::ChoiceP group) const override;
|
||||
};
|
||||
|
||||
|
||||
@@ -20,14 +20,14 @@ class DropDownColorList : public DropDownList {
|
||||
public:
|
||||
DropDownColorList(Window* parent, ColorValueEditor& cve);
|
||||
|
||||
protected:
|
||||
virtual size_t itemCount() const;
|
||||
virtual bool lineBelow(size_t item) const;
|
||||
virtual String itemText(size_t item) const;
|
||||
virtual void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const;
|
||||
protected:
|
||||
size_t itemCount() const override;
|
||||
bool lineBelow(size_t item) const override;
|
||||
String itemText(size_t item) const override;
|
||||
void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const override;
|
||||
|
||||
virtual void select(size_t item);
|
||||
virtual size_t selection() const;
|
||||
void select(size_t item) override;
|
||||
size_t selection() const override;
|
||||
|
||||
private:
|
||||
ColorValueEditor& cve;
|
||||
|
||||
@@ -22,12 +22,12 @@ public:
|
||||
DECLARE_VALUE_EDITOR(Color);
|
||||
|
||||
// --------------------------------------------------- : Events
|
||||
virtual bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev);
|
||||
virtual bool onChar(wxKeyEvent& ev);
|
||||
virtual void onLoseFocus();
|
||||
bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev) override;
|
||||
bool onChar(wxKeyEvent& ev) override;
|
||||
void onLoseFocus() override;
|
||||
|
||||
virtual void draw(RotatedDC& dc);
|
||||
virtual void determineSize(bool);
|
||||
void draw(RotatedDC& dc) override;
|
||||
void determineSize(bool) override;
|
||||
|
||||
private:
|
||||
DropDownListP drop_down;
|
||||
|
||||
@@ -138,13 +138,13 @@ protected:
|
||||
|
||||
#define DECLARE_VALUE_EDITOR(Type) \
|
||||
Type##ValueEditor(DataEditor& parent, const Type##StyleP& style); \
|
||||
virtual ValueEditor* getEditor() { return this; } \
|
||||
private: \
|
||||
ValueEditor* getEditor() override { return this; } \
|
||||
private: \
|
||||
/** Retrieve the parent editor object */ \
|
||||
inline DataEditor& editor() const { \
|
||||
inline DataEditor& editor() const override { \
|
||||
return static_cast<DataEditor&>(viewer); \
|
||||
} \
|
||||
public:
|
||||
public:
|
||||
|
||||
#define IMPLEMENT_VALUE_EDITOR(Type) \
|
||||
ValueViewerP Type##Style::makeEditor(DataEditor& parent) { \
|
||||
|
||||
@@ -19,17 +19,17 @@ class ImageValueEditor : public ImageValueViewer, public ValueEditor {
|
||||
public:
|
||||
DECLARE_VALUE_EDITOR(Image);
|
||||
|
||||
virtual bool onLeftDClick(const RealPoint&, wxMouseEvent&);
|
||||
bool onLeftDClick(const RealPoint&, wxMouseEvent&) override;
|
||||
|
||||
// --------------------------------------------------- : Clipboard
|
||||
|
||||
virtual bool canCopy() const;
|
||||
virtual bool canPaste() const;
|
||||
virtual bool doCopy();
|
||||
virtual bool doPaste();
|
||||
virtual bool doDelete();
|
||||
bool canCopy() const override;
|
||||
bool canPaste() const override;
|
||||
bool doCopy() override;
|
||||
bool doPaste() override;
|
||||
bool doDelete() override;
|
||||
|
||||
virtual bool onChar(wxKeyEvent&);
|
||||
bool onChar(wxKeyEvent&) override;
|
||||
|
||||
private:
|
||||
// Open the image slice window showing the give image
|
||||
|
||||
@@ -19,7 +19,7 @@ class InfoValueEditor : public InfoValueViewer, public ValueEditor {
|
||||
public:
|
||||
DECLARE_VALUE_EDITOR(Info);
|
||||
|
||||
virtual void determineSize(bool);
|
||||
virtual bool drawLabel() const { return false; }
|
||||
void determineSize(bool) override;
|
||||
bool drawLabel() const override { return false; }
|
||||
};
|
||||
|
||||
|
||||
@@ -21,13 +21,13 @@ public:
|
||||
DECLARE_VALUE_EDITOR(MultipleChoice);
|
||||
~MultipleChoiceValueEditor();
|
||||
|
||||
virtual void onValueChange();
|
||||
void onValueChange() override;
|
||||
|
||||
virtual void determineSize(bool force_fit);
|
||||
void determineSize(bool force_fit) override;
|
||||
|
||||
virtual bool onLeftDown (const RealPoint& pos, wxMouseEvent& ev);
|
||||
virtual bool onChar(wxKeyEvent& ev);
|
||||
virtual void onLoseFocus();
|
||||
bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev) override;
|
||||
bool onChar(wxKeyEvent& ev) override;
|
||||
void onLoseFocus() override;
|
||||
|
||||
private:
|
||||
DropDownListP drop_down;
|
||||
|
||||
@@ -20,12 +20,12 @@ public:
|
||||
DropDownPackageChoiceList(Window* parent, PackageChoiceValueEditor* editor);
|
||||
|
||||
protected:
|
||||
virtual size_t itemCount() const;
|
||||
virtual String itemText(size_t item) const;
|
||||
virtual bool lineBelow(size_t item) const;
|
||||
virtual void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const;
|
||||
virtual void select(size_t selection);
|
||||
virtual size_t selection() const;
|
||||
size_t itemCount() const override;
|
||||
String itemText(size_t item) const override;
|
||||
bool lineBelow(size_t item) const override;
|
||||
void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const override;
|
||||
void select(size_t selection) override;
|
||||
size_t selection() const override;
|
||||
|
||||
private:
|
||||
PackageChoiceValueEditor& editor;
|
||||
|
||||
@@ -21,11 +21,11 @@ class PackageChoiceValueEditor : public PackageChoiceValueViewer, public ValueEd
|
||||
public:
|
||||
DECLARE_VALUE_EDITOR(PackageChoice);
|
||||
|
||||
virtual void draw(RotatedDC& dc);
|
||||
virtual void determineSize(bool force_fit);
|
||||
virtual bool onLeftDown (const RealPoint& pos, wxMouseEvent& ev);
|
||||
virtual bool onChar(wxKeyEvent& ev);
|
||||
virtual void onLoseFocus();
|
||||
void draw(RotatedDC& dc) override;
|
||||
void determineSize(bool force_fit) override;
|
||||
bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev) override;
|
||||
bool onChar(wxKeyEvent& ev) override;
|
||||
void onLoseFocus() override;
|
||||
|
||||
private:
|
||||
DropDownListP drop_down;
|
||||
|
||||
@@ -21,12 +21,12 @@ class SymbolValueEditor : public SymbolValueViewer, public ValueEditor {
|
||||
public:
|
||||
DECLARE_VALUE_EDITOR(Symbol);
|
||||
|
||||
virtual void draw(RotatedDC& dc);
|
||||
virtual bool onLeftDown (const RealPoint& pos, wxMouseEvent&);
|
||||
virtual bool onLeftUp (const RealPoint& pos, wxMouseEvent&);
|
||||
virtual bool onLeftDClick(const RealPoint& pos, wxMouseEvent&);
|
||||
virtual bool onMotion (const RealPoint& pos, wxMouseEvent&);
|
||||
virtual void determineSize(bool);
|
||||
void draw(RotatedDC& dc) override;
|
||||
bool onLeftDown (const RealPoint& pos, wxMouseEvent&) override;
|
||||
bool onLeftUp (const RealPoint& pos, wxMouseEvent&) override;
|
||||
bool onLeftDClick(const RealPoint& pos, wxMouseEvent&) override;
|
||||
bool onMotion (const RealPoint& pos, wxMouseEvent&) override;
|
||||
void determineSize(bool) override;
|
||||
private:
|
||||
/// Draw a button, buttons are numbered from the right
|
||||
void drawButton(RotatedDC& dc, int button, const String& text);
|
||||
|
||||
+10
-10
@@ -116,15 +116,15 @@ public:
|
||||
inline WordListPosP getPos() const { return pos; }
|
||||
|
||||
protected:
|
||||
virtual void redrawArrowOnParent();
|
||||
virtual size_t itemCount() const { return items.size(); }
|
||||
virtual bool lineBelow(size_t item) const { return items[item].flags & FLAG_LINE_BELOW; }
|
||||
virtual String itemText(size_t item) const { return items[item].name; }
|
||||
virtual void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const;
|
||||
virtual DropDownList* submenu(size_t item) const;
|
||||
virtual size_t selection() const;
|
||||
virtual void select(size_t item);
|
||||
virtual bool stayOpen(size_t selection) const;
|
||||
void redrawArrowOnParent() override;
|
||||
size_t itemCount() const override { return items.size(); }
|
||||
bool lineBelow(size_t item) const override { return items[item].flags & FLAG_LINE_BELOW; }
|
||||
String itemText(size_t item) const override { return items[item].name; }
|
||||
void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const override;
|
||||
DropDownList* submenu(size_t item) const override;
|
||||
size_t selection() const override;
|
||||
void select(size_t item) override;
|
||||
bool stayOpen(size_t selection) const override;
|
||||
private:
|
||||
TextValueEditor& tve;
|
||||
WordListPosP pos;
|
||||
@@ -887,7 +887,7 @@ void TextValueEditor::showCaret() {
|
||||
// TODO : high quality?
|
||||
dc.SetFont(style().font.toWxFont(1.0));
|
||||
int hi;
|
||||
dc.GetTextExtent(_(" "), 0, &hi);
|
||||
dc.GetTextExtent(_(" "), nullptr, &hi);
|
||||
#ifdef __WXGTK__
|
||||
// HACK: Some fonts don't get the descender height set correctly.
|
||||
int charHeight = dc.GetCharHeight();
|
||||
|
||||
+36
-36
@@ -34,67 +34,67 @@ public:
|
||||
|
||||
// --------------------------------------------------- : Events
|
||||
|
||||
virtual void onFocus();
|
||||
virtual void onLoseFocus();
|
||||
void onFocus() override;
|
||||
void onLoseFocus() override;
|
||||
|
||||
virtual bool onLeftDown (const RealPoint& pos, wxMouseEvent&);
|
||||
virtual bool onLeftUp (const RealPoint& pos, wxMouseEvent&);
|
||||
virtual bool onLeftDClick(const RealPoint& pos, wxMouseEvent&);
|
||||
virtual bool onRightDown (const RealPoint& pos, wxMouseEvent&);
|
||||
virtual bool onMotion (const RealPoint& pos, wxMouseEvent&);
|
||||
virtual void onMouseLeave(const RealPoint& pos, wxMouseEvent&);
|
||||
virtual bool onMouseWheel(const RealPoint& pos, wxMouseEvent&);
|
||||
bool onLeftDown (const RealPoint& pos, wxMouseEvent&) override;
|
||||
bool onLeftUp (const RealPoint& pos, wxMouseEvent&) override;
|
||||
bool onLeftDClick(const RealPoint& pos, wxMouseEvent&) override;
|
||||
bool onRightDown (const RealPoint& pos, wxMouseEvent&) override;
|
||||
bool onMotion (const RealPoint& pos, wxMouseEvent&) override;
|
||||
void onMouseLeave(const RealPoint& pos, wxMouseEvent&) override;
|
||||
bool onMouseWheel(const RealPoint& pos, wxMouseEvent&) override;
|
||||
|
||||
virtual bool onContextMenu(wxMenu& m, wxContextMenuEvent&);
|
||||
virtual wxMenu* getMenu(int type) const;
|
||||
virtual bool onCommand(int);
|
||||
bool onContextMenu(wxMenu& m, wxContextMenuEvent&) override;
|
||||
wxMenu* getMenu(int type) const override;
|
||||
bool onCommand(int) override;
|
||||
|
||||
virtual bool onChar(wxKeyEvent&);
|
||||
bool onChar(wxKeyEvent&) override;
|
||||
|
||||
// --------------------------------------------------- : Actions
|
||||
|
||||
virtual void onValueChange();
|
||||
virtual void onAction(const Action&, bool undone);
|
||||
void onValueChange() override;
|
||||
void onAction(const Action&, bool undone) override;
|
||||
|
||||
// --------------------------------------------------- : Clipboard
|
||||
|
||||
virtual bool canCopy() const;
|
||||
virtual bool canPaste() const;
|
||||
virtual bool doCopy();
|
||||
virtual bool doPaste();
|
||||
virtual bool doDelete();
|
||||
bool canCopy() const override;
|
||||
bool canPaste() const override;
|
||||
bool doCopy() override;
|
||||
bool doPaste() override;
|
||||
bool doDelete() override;
|
||||
|
||||
// --------------------------------------------------- : Formating
|
||||
|
||||
virtual bool canFormat(int type) const;
|
||||
virtual bool hasFormat(int type) const;
|
||||
virtual void doFormat(int type);
|
||||
bool canFormat(int type) const override;
|
||||
bool hasFormat(int type) const override;
|
||||
void doFormat(int type) override;
|
||||
|
||||
// --------------------------------------------------- : Selection
|
||||
|
||||
virtual bool canSelectAll() const { return true; }
|
||||
virtual void doSelectAll();
|
||||
virtual void select(size_t start, size_t end);
|
||||
virtual size_t selectionStart() const { return selection_start; }
|
||||
virtual size_t selectionEnd() const { return selection_end; }
|
||||
bool canSelectAll() const override { return true; }
|
||||
void doSelectAll() override;
|
||||
void select(size_t start, size_t end) override;
|
||||
size_t selectionStart() const override { return selection_start; }
|
||||
size_t selectionEnd() const override { return selection_end; }
|
||||
|
||||
virtual void insert(const String& text, const String& action_name);
|
||||
void insert(const String& text, const String& action_name) override;
|
||||
|
||||
// --------------------------------------------------- : Search/replace
|
||||
|
||||
virtual bool search(FindInfo& find, bool from_start);
|
||||
bool search(FindInfo& find, bool from_start) override;
|
||||
private:
|
||||
bool matchSubstr(const String& s, size_t pos, FindInfo& find);
|
||||
public:
|
||||
|
||||
// --------------------------------------------------- : Other
|
||||
|
||||
virtual wxCursor cursor(const RealPoint& pos) const;
|
||||
virtual void determineSize(bool force_fit = false);
|
||||
virtual bool containsPoint(const RealPoint& p) const;
|
||||
virtual RealRect boundingBox() const;
|
||||
virtual void onShow(bool);
|
||||
virtual void draw(RotatedDC&);
|
||||
wxCursor cursor(const RealPoint& pos) const override;
|
||||
void determineSize(bool force_fit = false) override;
|
||||
bool containsPoint(const RealPoint& p) const override;
|
||||
RealRect boundingBox() const override;
|
||||
void onShow(bool) override;
|
||||
void draw(RotatedDC&) override;
|
||||
|
||||
// --------------------------------------------------- : Data
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user