mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Cleanup: use override specifier everywhere, and enable gcc warning to check for it.
This commit is contained in:
@@ -19,9 +19,9 @@ class ChoiceValueViewer : public ValueViewer {
|
||||
public:
|
||||
DECLARE_VALUE_VIEWER(Choice) : ValueViewer(parent,style) {}
|
||||
|
||||
virtual bool prepare(RotatedDC& dc);
|
||||
virtual void draw(RotatedDC& dc);
|
||||
virtual void onStyleChange(int);
|
||||
bool prepare(RotatedDC& dc) override;
|
||||
void draw(RotatedDC& dc) override;
|
||||
void onStyleChange(int) override;
|
||||
};
|
||||
|
||||
bool prepare_choice_viewer(RotatedDC& dc, ValueViewer& viewer, ChoiceStyle& style, const String& value);
|
||||
|
||||
@@ -21,7 +21,7 @@ class ColorValueViewer : public ValueViewer {
|
||||
public:
|
||||
DECLARE_VALUE_VIEWER(Color) : ValueViewer(parent,style) {}
|
||||
|
||||
virtual void draw(RotatedDC& dc);
|
||||
virtual bool containsPoint(const RealPoint& p) const;
|
||||
void draw(RotatedDC& dc) override;
|
||||
bool containsPoint(const RealPoint& p) const override;
|
||||
};
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ class ImageValueViewer : public ValueViewer {
|
||||
public:
|
||||
DECLARE_VALUE_VIEWER(Image) : ValueViewer(parent,style) {}
|
||||
|
||||
virtual void draw(RotatedDC& dc);
|
||||
virtual void onValueChange();
|
||||
virtual void onStyleChange(int);
|
||||
void draw(RotatedDC& dc) override;
|
||||
void onValueChange() override;
|
||||
void onStyleChange(int) override;
|
||||
|
||||
private:
|
||||
Bitmap bitmap; ///< Cached bitmap
|
||||
|
||||
@@ -19,7 +19,7 @@ class InfoValueViewer : public ValueViewer {
|
||||
public:
|
||||
DECLARE_VALUE_VIEWER(Info) : ValueViewer(parent,style) {}
|
||||
|
||||
virtual void draw(RotatedDC& dc);
|
||||
void draw(RotatedDC& dc) override;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@ class MultipleChoiceValueViewer : public ValueViewer {
|
||||
public:
|
||||
DECLARE_VALUE_VIEWER(MultipleChoice) : ValueViewer(parent,style), item_height(0) {}
|
||||
|
||||
virtual bool prepare(RotatedDC& dc);
|
||||
virtual void draw(RotatedDC& dc);
|
||||
virtual void onStyleChange(int);
|
||||
bool prepare(RotatedDC& dc) override;
|
||||
void draw(RotatedDC& dc) override;
|
||||
void onStyleChange(int) override;
|
||||
protected:
|
||||
double item_height; ///< Height of a single item, or 0 if non uniform
|
||||
private:
|
||||
|
||||
@@ -19,7 +19,7 @@ class PackageChoiceValueViewer : public ValueViewer {
|
||||
public:
|
||||
DECLARE_VALUE_VIEWER(PackageChoice) : ValueViewer(parent,style) { initItems(); }
|
||||
|
||||
virtual void draw(RotatedDC& dc);
|
||||
void draw(RotatedDC& dc) override;
|
||||
|
||||
struct Item{
|
||||
String package_name;
|
||||
|
||||
@@ -19,8 +19,8 @@ class SymbolValueViewer : public ValueViewer {
|
||||
public:
|
||||
DECLARE_VALUE_VIEWER(Symbol) : ValueViewer(parent,style) {}
|
||||
|
||||
virtual void draw(RotatedDC& dc);
|
||||
void onValueChange();
|
||||
void draw(RotatedDC& dc) override;
|
||||
void onValueChange() override;
|
||||
|
||||
protected:
|
||||
vector<Bitmap> symbols; ///< Cached images
|
||||
|
||||
@@ -20,12 +20,12 @@ class TextValueViewer : public ValueViewer {
|
||||
public:
|
||||
DECLARE_VALUE_VIEWER(Text) : ValueViewer(parent,style) {}
|
||||
|
||||
virtual bool prepare(RotatedDC& dc);
|
||||
virtual void draw(RotatedDC& dc);
|
||||
virtual void onValueChange();
|
||||
virtual void onStyleChange(int);
|
||||
virtual void onAction(const Action&, bool undone);
|
||||
virtual double getStretch() const;
|
||||
bool prepare(RotatedDC& dc) override;
|
||||
void draw(RotatedDC& dc) override;
|
||||
void onValueChange() override;
|
||||
void onStyleChange(int) override;
|
||||
void onAction(const Action&, bool undone) override;
|
||||
double getStretch() const override;
|
||||
|
||||
protected:
|
||||
TextViewer v;
|
||||
|
||||
@@ -63,12 +63,12 @@ public:
|
||||
virtual void onValueChange() {}
|
||||
/// Called when a (scripted) property of the associated style has changed
|
||||
/** Default: redraws the viewer if needed */
|
||||
virtual void onStyleChange(int changes);
|
||||
void onStyleChange(int changes) override;
|
||||
/// Called when an action is performed on the associated value
|
||||
virtual void onAction(const Action&, bool undone) { onValueChange(); }
|
||||
|
||||
/// Convert this viewer to an editor, if possible
|
||||
virtual ValueEditor* getEditor() { return 0; }
|
||||
virtual ValueEditor* getEditor() { return nullptr; }
|
||||
|
||||
DataViewer& viewer; ///< Our parent object
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user