Cleanup: use override specifier everywhere, and enable gcc warning to check for it.

This commit is contained in:
Twan van Laarhoven
2020-05-16 00:23:18 +02:00
parent a7c47729c1
commit 5deaeeeb3e
113 changed files with 710 additions and 714 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ endif()
# warnings # warnings
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
# Update if necessary # Update if necessary
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-comment") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wsuggest-override -Wstrict-null-sentinel -Wno-comment -Wno-unused-parameter")
endif() endif()
# visual studio debugger # visual studio debugger
+3 -3
View File
@@ -20,9 +20,9 @@ public:
/// The set is optional /// The set is optional
CLISetInterface(const SetP& set, bool quiet = false, bool run = true); CLISetInterface(const SetP& set, bool quiet = false, bool run = true);
protected: protected:
virtual void onAction(const Action&, bool) {} void onAction(const Action&, bool) override {}
virtual void onChangeSet(); void onChangeSet() override;
virtual void onBeforeChangeSet(); void onBeforeChangeSet() override;
private: private:
bool quiet; ///< Supress prompts and other non-vital stuff bool quiet; ///< Supress prompts and other non-vital stuff
bool running; ///< Still running? bool running; ///< Still running?
+6 -6
View File
@@ -40,8 +40,8 @@ public:
AddKeywordAction(Set& set); AddKeywordAction(Set& set);
AddKeywordAction(AddingOrRemoving, Set& set, const KeywordP& keyword); AddKeywordAction(AddingOrRemoving, Set& set, const KeywordP& keyword);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
const GenericAddAction<KeywordP> action; const GenericAddAction<KeywordP> action;
}; };
@@ -75,9 +75,9 @@ public:
Keyword& keyword; ///< The keyword we are the reminder text of Keyword& keyword; ///< The keyword we are the reminder text of
/// Try to compile the script /// Try to compile the script
virtual void store(); void store() override;
/// Add some tags, so the script looks nice /// Add some tags, so the script looks nice
virtual void retrieve(); void retrieve() override;
/// Syntax highlight, and store in value /// Syntax highlight, and store in value
void highlight(const String& code, const vector<ScriptParseError>& errors); void highlight(const String& code, const vector<ScriptParseError>& errors);
@@ -91,8 +91,8 @@ class ChangeKeywordModeAction : public Action {
public: public:
ChangeKeywordModeAction(Keyword& keyword, const String& new_mode); ChangeKeywordModeAction(Keyword& keyword, const String& new_mode);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
//private: //private:
Keyword& keyword; Keyword& keyword;
+16 -16
View File
@@ -44,8 +44,8 @@ public:
AddCardAction(AddingOrRemoving, Set& set, const CardP& card); AddCardAction(AddingOrRemoving, Set& set, const CardP& card);
AddCardAction(AddingOrRemoving, Set& set, const vector<CardP>& cards); AddCardAction(AddingOrRemoving, Set& set, const vector<CardP>& cards);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
const GenericAddAction<CardP> action; const GenericAddAction<CardP> action;
}; };
@@ -57,8 +57,8 @@ class ReorderCardsAction : public CardListAction {
public: public:
ReorderCardsAction(Set& set, size_t card_id1, size_t card_id2); ReorderCardsAction(Set& set, size_t card_id1, size_t card_id2);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
//private: //private:
const size_t card_id1, card_id2; ///< Positions of the two cards to swap const size_t card_id1, card_id2; ///< Positions of the two cards to swap
@@ -69,8 +69,8 @@ public:
/// An action that affects the rendering/display/look of a set or cards in the set /// An action that affects the rendering/display/look of a set or cards in the set
class DisplayChangeAction : public Action { class DisplayChangeAction : public Action {
public: public:
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
}; };
/// Changing the style of a a card /// Changing the style of a a card
@@ -78,8 +78,8 @@ class ChangeCardStyleAction : public DisplayChangeAction {
public: public:
ChangeCardStyleAction(const CardP& card, const StyleSheetP& stylesheet); ChangeCardStyleAction(const CardP& card, const StyleSheetP& stylesheet);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
//private: //private:
CardP card; ///< The affected card CardP card; ///< The affected card
@@ -93,8 +93,8 @@ class ChangeSetStyleAction : public DisplayChangeAction {
public: public:
ChangeSetStyleAction(Set& set, const CardP& card); ChangeSetStyleAction(Set& set, const CardP& card);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
private: private:
Set& set; ///< The affected set Set& set; ///< The affected set
@@ -109,8 +109,8 @@ class ChangeCardHasStylingAction : public DisplayChangeAction {
public: public:
ChangeCardHasStylingAction(Set& set, const CardP& card); ChangeCardHasStylingAction(Set& set, const CardP& card);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
//private: //private:
Set& set; ///< The set to copy styling from Set& set; ///< The set to copy styling from
@@ -136,8 +136,8 @@ public:
/// Add a newly allocated card /// Add a newly allocated card
AddPackAction(AddingOrRemoving, Set& set, const PackTypeP& pack); AddPackAction(AddingOrRemoving, Set& set, const PackTypeP& pack);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
const GenericAddAction<PackTypeP> action; const GenericAddAction<PackTypeP> action;
}; };
@@ -148,8 +148,8 @@ public:
/// Add a newly allocated card /// Add a newly allocated card
ChangePackAction(Set& set, size_t pos, const PackTypeP& new_pack); ChangePackAction(Set& set, size_t pos, const PackTypeP& new_pack);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
private: private:
PackTypeP pack; PackTypeP pack;
+28 -28
View File
@@ -40,8 +40,8 @@ class SymbolPartMoveAction : public SymbolPartsAction {
public: public:
SymbolPartMoveAction(const set<SymbolPartP>& parts, const Vector2D& delta = Vector2D()); SymbolPartMoveAction(const set<SymbolPartP>& parts, const Vector2D& delta = Vector2D());
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
/// Update this action to move some more /// Update this action to move some more
void move(const Vector2D& delta); void move(const Vector2D& delta);
@@ -80,8 +80,8 @@ class SymbolPartRotateAction : public SymbolPartMatrixAction {
public: public:
SymbolPartRotateAction(const set<SymbolPartP>& parts, const Vector2D& center); SymbolPartRotateAction(const set<SymbolPartP>& parts, const Vector2D& center);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
/// Update this action to rotate to a different angle /// Update this action to rotate to a different angle
void rotateTo(Radians newAngle); void rotateTo(Radians newAngle);
@@ -103,8 +103,8 @@ class SymbolPartShearAction : public SymbolPartMatrixAction {
public: public:
SymbolPartShearAction(const set<SymbolPartP>& parts, const Vector2D& center); SymbolPartShearAction(const set<SymbolPartP>& parts, const Vector2D& center);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
/// Change shear by a given amount /// Change shear by a given amount
void move(const Vector2D& deltaShear); void move(const Vector2D& deltaShear);
@@ -126,8 +126,8 @@ class SymbolPartScaleAction : public SymbolPartsAction {
public: public:
SymbolPartScaleAction(const set<SymbolPartP>& parts, int scaleX, int scaleY); SymbolPartScaleAction(const set<SymbolPartP>& parts, int scaleX, int scaleY);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
/// Change min and max coordinates /// Change min and max coordinates
void move(const Vector2D& delta_min, const Vector2D& delta_max); void move(const Vector2D& delta_min, const Vector2D& delta_max);
@@ -157,8 +157,8 @@ public:
// All parts must be SymbolParts // All parts must be SymbolParts
CombiningModeAction(const set<SymbolPartP>& parts, SymbolShapeCombine mode); CombiningModeAction(const set<SymbolPartP>& parts, SymbolShapeCombine mode);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
private: private:
void add(const SymbolPartP&, SymbolShapeCombine mode); void add(const SymbolPartP&, SymbolShapeCombine mode);
@@ -172,9 +172,9 @@ class SymbolPartNameAction : public SymbolPartAction {
public: public:
SymbolPartNameAction(const SymbolPartP& part, const String& name, size_t old_cursor, size_t new_cursor); SymbolPartNameAction(const SymbolPartP& part, const String& name, size_t old_cursor, size_t new_cursor);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
virtual bool merge(const Action& action); bool merge(const Action& action) override;
public: public:
SymbolPartP part; ///< Affected part SymbolPartP part; ///< Affected part
@@ -190,8 +190,8 @@ class AddSymbolPartAction : public SymbolPartListAction {
public: public:
AddSymbolPartAction(Symbol& symbol, const SymbolPartP& part); AddSymbolPartAction(Symbol& symbol, const SymbolPartP& part);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
private: private:
Symbol& symbol; ///< Symbol to add the part to Symbol& symbol; ///< Symbol to add the part to
@@ -205,8 +205,8 @@ class RemoveSymbolPartsAction : public SymbolPartListAction {
public: public:
RemoveSymbolPartsAction(Symbol& symbol, const set<SymbolPartP>& parts); RemoveSymbolPartsAction(Symbol& symbol, const set<SymbolPartP>& parts);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
private: private:
Symbol& symbol; Symbol& symbol;
@@ -234,8 +234,8 @@ class DuplicateSymbolPartsAction : public SymbolPartListAction {
public: public:
DuplicateSymbolPartsAction(Symbol& symbol, const set<SymbolPartP>& parts); DuplicateSymbolPartsAction(Symbol& symbol, const set<SymbolPartP>& parts);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
/// Fill a set with all the new parts /// Fill a set with all the new parts
void getParts(set<SymbolPartP>& parts); void getParts(set<SymbolPartP>& parts);
@@ -254,8 +254,8 @@ class ReorderSymbolPartsAction : public SymbolPartListAction {
public: public:
ReorderSymbolPartsAction(SymbolGroup& old_parent, size_t old_position, SymbolGroup& new_parent, size_t new_position); ReorderSymbolPartsAction(SymbolGroup& old_parent, size_t old_position, SymbolGroup& new_parent, size_t new_position);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
private: private:
SymbolGroup* old_parent, *new_parent;///< Parents to move from and to SymbolGroup* old_parent, *new_parent;///< Parents to move from and to
@@ -269,8 +269,8 @@ public:
/// Remove all the given groups /// Remove all the given groups
UngroupReorderSymbolPartsAction(SymbolGroup& group_parent, size_t group_pos, SymbolGroup& target_parent, size_t target_pos); UngroupReorderSymbolPartsAction(SymbolGroup& group_parent, size_t group_pos, SymbolGroup& target_parent, size_t target_pos);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
private: private:
SymbolGroup& group_parent; SymbolGroup& group_parent;
@@ -287,11 +287,11 @@ class GroupSymbolPartsActionBase : public SymbolPartListAction {
public: public:
GroupSymbolPartsActionBase(SymbolGroup& root); GroupSymbolPartsActionBase(SymbolGroup& root);
virtual void perform(bool to_undo); void perform(bool to_undo) override;
protected: protected:
SymbolGroup& root; ///< Symbol or group to group stuff in SymbolGroup& root; ///< Symbol or group to group stuff in
vector<SymbolPartP> old_part_list; ///< Old part list of the symbol vector<SymbolPartP> old_part_list; ///< Old part list of the symbol
}; };
/// Group multiple symbol parts together /// Group multiple symbol parts together
@@ -299,7 +299,7 @@ class GroupSymbolPartsAction : public GroupSymbolPartsActionBase {
public: public:
GroupSymbolPartsAction(SymbolGroup& root, const set<SymbolPartP>& parts, const SymbolGroupP& group); GroupSymbolPartsAction(SymbolGroup& root, const set<SymbolPartP>& parts, const SymbolGroupP& group);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
private: private:
SymbolGroupP group; SymbolGroupP group;
}; };
@@ -310,6 +310,6 @@ public:
/// Remove all the given groups /// Remove all the given groups
UngroupSymbolPartsAction(SymbolGroup& root, const set<SymbolPartP>& groups); UngroupSymbolPartsAction(SymbolGroup& root, const set<SymbolPartP>& groups);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
}; };
+4 -4
View File
@@ -304,8 +304,8 @@ class SinglePointRemoveAction : public Action, public IntrusivePtrBase<SinglePoi
public: public:
SinglePointRemoveAction(const SymbolShapeP& shape, UInt position); SinglePointRemoveAction(const SymbolShapeP& shape, UInt position);
virtual String getName(bool to_undo) const { return _("Delete point"); } String getName(bool to_undo) const override { return _("Delete point"); }
virtual void perform(bool to_undo); void perform(bool to_undo) override;
private: private:
SymbolShapeP shape; SymbolShapeP shape;
@@ -390,8 +390,8 @@ class ControlPointRemoveAction : public Action {
public: public:
ControlPointRemoveAction(const SymbolShapeP& shape, const set<ControlPointP>& to_delete); ControlPointRemoveAction(const SymbolShapeP& shape, const set<ControlPointP>& to_delete);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
private: private:
vector<SinglePointRemoveActionP> removals; vector<SinglePointRemoveActionP> removals;
+19 -19
View File
@@ -54,8 +54,8 @@ class ControlPointMoveAction : public ExtendableAction {
public: public:
ControlPointMoveAction(const set<ControlPointP>& points); ControlPointMoveAction(const set<ControlPointP>& points);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
/// Update this action to move some more /// Update this action to move some more
void move(const Vector2D& delta); void move(const Vector2D& delta);
@@ -76,8 +76,8 @@ class HandleMoveAction : public ExtendableAction {
public: public:
HandleMoveAction(const SelectedHandle& handle); HandleMoveAction(const SelectedHandle& handle);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
/// Update this action to move some more /// Update this action to move some more
void move(const Vector2D& delta); void move(const Vector2D& delta);
@@ -115,8 +115,8 @@ class SegmentModeAction : public Action {
public: public:
SegmentModeAction(const ControlPointP& p1, const ControlPointP& p2, SegmentMode mode); SegmentModeAction(const ControlPointP& p1, const ControlPointP& p2, SegmentMode mode);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
protected: protected:
ControlPointUpdate point1, point2; ControlPointUpdate point1, point2;
@@ -129,8 +129,8 @@ class LockModeAction : public Action {
public: public:
LockModeAction(const ControlPointP& p, LockMode mode); LockModeAction(const ControlPointP& p, LockMode mode);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
private: private:
ControlPointUpdate point; ///< The affected point ControlPointUpdate point; ///< The affected point
@@ -145,9 +145,9 @@ class CurveDragAction : public SegmentModeAction {
public: public:
CurveDragAction(const ControlPointP& point1, const ControlPointP& point2); CurveDragAction(const ControlPointP& point1, const ControlPointP& point2);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
// Move the curve by this much, it is grabbed at time t // Move the curve by this much, it is grabbed at time t
void move(const Vector2D& delta, double t); void move(const Vector2D& delta, double t);
}; };
@@ -160,8 +160,8 @@ public:
/// Insert a new point in shape, after position insertAfter_, at the time t on the segment /// Insert a new point in shape, after position insertAfter_, at the time t on the segment
ControlPointAddAction(const SymbolShapeP& shape, UInt insert_after, double t); ControlPointAddAction(const SymbolShapeP& shape, UInt insert_after, double t);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
inline ControlPointP getNewPoint() const { return new_point; } inline ControlPointP getNewPoint() const { return new_point; }
@@ -188,8 +188,8 @@ class SymmetryMoveAction : public Action {
public: public:
SymmetryMoveAction(SymbolSymmetry& symmetry, bool is_handle); SymmetryMoveAction(SymbolSymmetry& symmetry, bool is_handle);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
/// Update this action to move some more /// Update this action to move some more
void move(const Vector2D& delta); void move(const Vector2D& delta);
@@ -211,8 +211,8 @@ class SymmetryTypeAction : public Action {
public: public:
SymmetryTypeAction(SymbolSymmetry& symmetry, SymbolSymmetryType type); SymmetryTypeAction(SymbolSymmetry& symmetry, SymbolSymmetryType type);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
private: private:
SymbolSymmetry& symmetry; SymbolSymmetry& symmetry;
SymbolSymmetryType type; SymbolSymmetryType type;
@@ -227,8 +227,8 @@ class SymmetryCopiesAction : public Action {
public: public:
SymmetryCopiesAction(SymbolSymmetry& symmetry, int copies); SymmetryCopiesAction(SymbolSymmetry& symmetry, int copies);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
private: private:
SymbolSymmetry& symmetry; SymbolSymmetry& symmetry;
int copies; int copies;
+2 -2
View File
@@ -59,13 +59,13 @@ public:
: ValueAction(value), new_value(new_value) : ValueAction(value), new_value(new_value)
{} {}
virtual void perform(bool to_undo) { void perform(bool to_undo) override {
ValueAction::perform(to_undo); ValueAction::perform(to_undo);
swap_value(static_cast<T&>(*valueP), new_value); swap_value(static_cast<T&>(*valueP), new_value);
valueP->onAction(*this, to_undo); // notify value valueP->onAction(*this, to_undo); // notify value
} }
virtual bool merge(const Action& action) { bool merge(const Action& action) override {
if (!ALLOW_MERGE) return false; if (!ALLOW_MERGE) return false;
TYPE_CASE(action, SimpleValueAction) { TYPE_CASE(action, SimpleValueAction) {
if (action.valueP == valueP) { if (action.valueP == valueP) {
+16 -16
View File
@@ -40,8 +40,8 @@ public:
: valueP(value), card(nullptr), old_time_modified(wxDateTime::Now()) : valueP(value), card(nullptr), old_time_modified(wxDateTime::Now())
{} {}
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
/// We know that the value is on the given card, add that information /// We know that the value is on the given card, add that information
void isOnCard(Card* card); void isOnCard(Card* card);
@@ -69,9 +69,9 @@ class TextValueAction : public ValueAction {
public: public:
TextValueAction(const TextValueP& value, size_t start, size_t end, size_t new_end, const Defaultable<String>& new_value, const String& name); TextValueAction(const TextValueP& value, size_t start, size_t end, size_t new_end, const Defaultable<String>& new_value, const String& name);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
virtual bool merge(const Action& action); bool merge(const Action& action) override;
inline const String& newValue() const { return new_value(); } inline const String& newValue() const { return new_value(); }
@@ -99,10 +99,10 @@ class TextToggleReminderAction : public ValueAction {
public: public:
TextToggleReminderAction(const TextValueP& value, size_t pos); TextToggleReminderAction(const TextValueP& value, size_t pos);
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
private: private:
size_t pos; ///< Position of "<kw-" size_t pos; ///< Position of "<kw-"
bool enable; ///< Should the reminder text be turned on or off? bool enable; ///< Should the reminder text be turned on or off?
wxUniChar old; ///< Old value of the <kw- tag wxUniChar old; ///< Old value of the <kw- tag
@@ -114,7 +114,7 @@ public:
class SimpleTextValueAction : public ValueAction { class SimpleTextValueAction : public ValueAction {
public: public:
SimpleTextValueAction(const Card* card, const TextValueP& value, const Defaultable<String>& new_value); SimpleTextValueAction(const Card* card, const TextValueP& value, const Defaultable<String>& new_value);
virtual void perform(bool to_undo); void perform(bool to_undo) override;
bool merge(const SimpleTextValueAction& action); bool merge(const SimpleTextValueAction& action);
private: private:
Defaultable<String> new_value; Defaultable<String> new_value;
@@ -125,8 +125,8 @@ class ReplaceAllAction : public Action {
public: public:
~ReplaceAllAction(); ~ReplaceAllAction();
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
vector<SimpleTextValueAction> actions; vector<SimpleTextValueAction> actions;
}; };
@@ -137,9 +137,9 @@ public:
class ScriptValueEvent : public Action { class ScriptValueEvent : public Action {
public: public:
inline ScriptValueEvent(const Card* card, const Value* value) : card(card), value(value) {} inline ScriptValueEvent(const Card* card, const Value* value) : card(card), value(value) {}
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
const Card* card; ///< Card the value is on const Card* card; ///< Card the value is on
const Value* value; ///< The modified value const Value* value; ///< The modified value
@@ -152,8 +152,8 @@ public:
: stylesheet(stylesheet), style(style) : stylesheet(stylesheet), style(style)
{} {}
virtual String getName(bool to_undo) const; String getName(bool to_undo) const override;
virtual void perform(bool to_undo); void perform(bool to_undo) override;
const StyleSheet* stylesheet; ///< StyleSheet the style is for const StyleSheet* stylesheet; ///< StyleSheet the style is for
const Style* style; ///< The modified style const Style* style; ///< The modified style
+3 -3
View File
@@ -34,9 +34,9 @@ public:
OptionalScript script; ///< Export script, for multi file templates and initialization OptionalScript script; ///< Export script, for multi file templates and initialization
static String typeNameStatic(); static String typeNameStatic();
virtual String typeName() const; String typeName() const override;
Version fileVersion() const; Version fileVersion() const override;
virtual void validate(Version = app_version); void validate(Version = app_version) override;
/// Loads the export template with a particular name /// Loads the export template with a particular name
static ExportTemplateP byName(const String & name); static ExportTemplateP byName(const String & name);
private: private:
+2 -2
View File
@@ -33,7 +33,7 @@ class BooleanStyle : public ChoiceStyle {
public: public:
BooleanStyle(const ChoiceFieldP& field); BooleanStyle(const ChoiceFieldP& field);
DECLARE_HAS_FIELD(Boolean); // not DECLARE_STYLE_TYPE, because we use a normal ChoiceValueViewer/Editor DECLARE_HAS_FIELD(Boolean); // not DECLARE_STYLE_TYPE, because we use a normal ChoiceValueViewer/Editor
virtual StyleP clone() const; StyleP clone() const override;
// no extra data // no extra data
@@ -48,7 +48,7 @@ class BooleanValue : public ChoiceValue {
public: public:
inline BooleanValue(const ChoiceFieldP& field) : ChoiceValue(field) {} inline BooleanValue(const ChoiceFieldP& field) : ChoiceValue(field) {}
DECLARE_HAS_FIELD(Boolean); DECLARE_HAS_FIELD(Boolean);
virtual ValueP clone() const; ValueP clone() const override;
// no extra data // no extra data
+7 -7
View File
@@ -41,8 +41,8 @@ public:
map<String,Color> choice_colors; ///< Colors for the various choices (when color_cardlist) map<String,Color> choice_colors; ///< Colors for the various choices (when color_cardlist)
map<String,Color> choice_colors_cardlist; ///< Colors for the various choices, for in the card list map<String,Color> choice_colors_cardlist; ///< Colors for the various choices, for in the card list
virtual void initDependencies(Context&, const Dependency&) const; void initDependencies(Context&, const Dependency&) const override;
virtual void after_reading(Version ver); void after_reading(Version ver) override;
}; };
@@ -174,10 +174,10 @@ public:
/// Initialize image from choice_images /// Initialize image from choice_images
void initImage(); void initImage();
virtual int update(Context&); int update(Context&) override;
virtual void initDependencies(Context&, const Dependency&) const; void initDependencies(Context&, const Dependency&) const override;
virtual void checkContentDependencies(Context&, const Dependency&) const; void checkContentDependencies(Context&, const Dependency&) const override;
virtual void invalidate(); void invalidate() override;
}; };
// ----------------------------------------------------------------------------- : ChoiceValue // ----------------------------------------------------------------------------- : ChoiceValue
@@ -194,6 +194,6 @@ public:
ValueType value; /// The name of the selected choice ValueType value; /// The name of the selected choice
virtual bool update(Context&); bool update(Context&) override;
}; };
+3 -3
View File
@@ -36,7 +36,7 @@ public:
Defaultable<Color> initial; ///< Initial choice of a new value, if not set the first choice is used Defaultable<Color> initial; ///< Initial choice of a new value, if not set the first choice is used
String default_name; ///< Name of "default" value String default_name; ///< Name of "default" value
virtual void initDependencies(Context&, const Dependency&) const; void initDependencies(Context&, const Dependency&) const override;
}; };
/// A color that can be chosen for this field /// A color that can be chosen for this field
@@ -63,7 +63,7 @@ public:
double bottom_width; ///< Width of the colored region on the bottom side double bottom_width; ///< Width of the colored region on the bottom side
ImageCombine combine; ///< How to combine image with the background ImageCombine combine; ///< How to combine image with the background
virtual int update(Context&); int update(Context&) override;
}; };
// ----------------------------------------------------------------------------- : ColorValue // ----------------------------------------------------------------------------- : ColorValue
@@ -76,7 +76,7 @@ public:
ValueType value; ///< The value ValueType value; ///< The value
virtual bool update(Context&); bool update(Context&) override;
}; };
+1 -1
View File
@@ -37,7 +37,7 @@ public:
ScriptableImage default_image; ///< Placeholder ScriptableImage default_image; ///< Placeholder
virtual int update(Context&); int update(Context&) override;
}; };
// ----------------------------------------------------------------------------- : ImageValue // ----------------------------------------------------------------------------- : ImageValue
+8 -8
View File
@@ -28,9 +28,9 @@ public:
InfoField() { editable = false; } InfoField() { editable = false; }
DECLARE_FIELD_TYPE(Text); DECLARE_FIELD_TYPE(Text);
OptionalScript script; ///< Script to apply to all values OptionalScript script; ///< Script to apply to all values
virtual void initDependencies(Context&, const Dependency&) const; void initDependencies(Context&, const Dependency&) const override;
}; };
// ----------------------------------------------------------------------------- : InfoStyle // ----------------------------------------------------------------------------- : InfoStyle
@@ -41,14 +41,14 @@ public:
InfoStyle(const InfoFieldP&); InfoStyle(const InfoFieldP&);
DECLARE_STYLE_TYPE(Info); DECLARE_STYLE_TYPE(Info);
Font font; ///< Font to use for the text Font font; ///< Font to use for the text
Alignment alignment; ///< Alignment inside the box Alignment alignment; ///< Alignment inside the box
double padding_left, padding_right; ///< Padding double padding_left, padding_right; ///< Padding
double padding_top, padding_bottom; double padding_top, padding_bottom;
Color background_color; Color background_color;
virtual int update(Context&); int update(Context&) override;
virtual void initDependencies(Context&, const Dependency&) const; void initDependencies(Context&, const Dependency&) const override;
}; };
// ----------------------------------------------------------------------------- : InfoValue // ----------------------------------------------------------------------------- : InfoValue
@@ -61,6 +61,6 @@ public:
ValueType value; ValueType value;
virtual bool update(Context&); bool update(Context&) override;
}; };
+3 -3
View File
@@ -38,7 +38,7 @@ public:
Scriptable<Direction> direction; ///< In what direction are choices layed out? Scriptable<Direction> direction; ///< In what direction are choices layed out?
Scriptable<double> spacing; ///< Spacing between choices (images) in pixels Scriptable<double> spacing; ///< Spacing between choices (images) in pixels
virtual int update(Context&); int update(Context&) override;
}; };
// ----------------------------------------------------------------------------- : MultipleChoiceValue // ----------------------------------------------------------------------------- : MultipleChoiceValue
@@ -51,7 +51,7 @@ class MultipleChoiceValue : public ChoiceValue {
public: public:
inline MultipleChoiceValue(const MultipleChoiceFieldP& field) : ChoiceValue(field, false) {} inline MultipleChoiceValue(const MultipleChoiceFieldP& field) : ChoiceValue(field, false) {}
DECLARE_HAS_FIELD(MultipleChoice); DECLARE_HAS_FIELD(MultipleChoice);
virtual ValueP clone() const; ValueP clone() const override;
String last_change; ///< Which of the choices was selected/deselected last? String last_change; ///< Which of the choices was selected/deselected last?
@@ -64,7 +64,7 @@ public:
/// Splits the value, stores the selected choices in the out parameter /// Splits the value, stores the selected choices in the out parameter
void get(vector<String>& out) const; void get(vector<String>& out) const;
virtual bool update(Context&); bool update(Context&) override;
private: private:
DECLARE_REFLECTION(); DECLARE_REFLECTION();
+7 -7
View File
@@ -28,12 +28,12 @@ public:
DECLARE_FIELD_TYPE(PackageChoice); DECLARE_FIELD_TYPE(PackageChoice);
OptionalScript script; ///< Script to apply to all values OptionalScript script; ///< Script to apply to all values
String match; ///< Package filenames to match String match; ///< Package filenames to match
String initial; ///< Initial value String initial; ///< Initial value
bool required; ///< Is selecting a package required? bool required; ///< Is selecting a package required?
String empty_name; ///< Displayed name for the empty value (if !required) String empty_name; ///< Displayed name for the empty value (if !required)
virtual void initDependencies(Context&, const Dependency&) const; void initDependencies(Context&, const Dependency&) const override;
}; };
// ----------------------------------------------------------------------------- : PackageChoiceStyle // ----------------------------------------------------------------------------- : PackageChoiceStyle
@@ -46,7 +46,7 @@ public:
Font font; ///< Font to use for the text Font font; ///< Font to use for the text
virtual int update(Context&); int update(Context&) override;
}; };
// ----------------------------------------------------------------------------- : PackageChoiceValue // ----------------------------------------------------------------------------- : PackageChoiceValue
@@ -59,9 +59,9 @@ public:
ValueType package_name; ///< The selected package ValueType package_name; ///< The selected package
/// Get the package (if it is set) /// Get the package (if it is set), otherwise return nullptr
PackagedP getPackage() const; PackagedP getPackage() const;
virtual bool update(Context&); bool update(Context&) override;
}; };
+10 -10
View File
@@ -34,14 +34,14 @@ public:
TextField(); TextField();
DECLARE_FIELD_TYPE(Text); DECLARE_FIELD_TYPE(Text);
OptionalScript script; ///< Script to apply to all values OptionalScript script; ///< Script to apply to all values
OptionalScript default_script; ///< Script that generates the default value OptionalScript default_script; ///< Script that generates the default value
//%OptionalScript view_script; ///< Script to apply before viewing //%OptionalScript view_script; ///< Script to apply before viewing
//%OptionalScript unview_script; ///< Script to apply after changes to the view //%OptionalScript unview_script; ///< Script to apply after changes to the view
bool multi_line; ///< Are newlines allowed in the text? bool multi_line; ///< Are newlines allowed in the text?
String default_name; ///< Name of "default" value String default_name; ///< Name of "default" value
virtual void initDependencies(Context&, const Dependency&) const; void initDependencies(Context&, const Dependency&) const override;
}; };
// ----------------------------------------------------------------------------- : TextStyle // ----------------------------------------------------------------------------- : TextStyle
@@ -95,9 +95,9 @@ public:
double content_width, content_height; ///< Size of the rendered text double content_width, content_height; ///< Size of the rendered text
int content_lines; ///< Number of rendered lines int content_lines; ///< Number of rendered lines
virtual int update(Context&); int update(Context&) override;
virtual void initDependencies(Context&, const Dependency&) const; void initDependencies(Context&, const Dependency&) const override;
virtual void checkContentDependencies(Context&, const Dependency&) const; void checkContentDependencies(Context&, const Dependency&) const override;
/// Stretch factor to use /// Stretch factor to use
double getStretch() const; double getStretch() const;
@@ -114,7 +114,7 @@ public:
ValueType value; ///< The text of this value ValueType value; ///< The text of this value
Age last_update; ///< When was the text last changed? Age last_update; ///< When was the text last changed?
virtual bool update(Context&); bool update(Context&) override;
}; };
// ----------------------------------------------------------------------------- : TextValue // ----------------------------------------------------------------------------- : TextValue
@@ -139,8 +139,8 @@ public:
virtual void retrieve(); virtual void retrieve();
/// Update underlying data /// Update underlying data
virtual void onAction(Action& a, bool undone); void onAction(Action& a, bool undone) override;
/// Editing the same underlying value? /// Editing the same underlying value?
virtual bool equals(const Value* that); bool equals(const Value* that) override;
}; };
+1 -1
View File
@@ -64,7 +64,7 @@ template <typename T>
class QuickFilter : public Filter<T> { class QuickFilter : public Filter<T> {
public: public:
QuickFilter(String const& query) : query(parse_quicksearch_query(query)) {} QuickFilter(String const& query) : query(parse_quicksearch_query(query)) {}
virtual bool keep(T const& x) const { bool keep(T const& x) const override {
return match_quicksearch_query(query, x); return match_quicksearch_query(query, x);
} }
private: private:
+11 -11
View File
@@ -43,7 +43,7 @@ public:
/// Update the progress bar /// Update the progress bar
/** if the operation should be aborted, throws an AbortException /** if the operation should be aborted, throws an AbortException
*/ */
virtual void onProgress(float progress, const String& message); void onProgress(float progress, const String& message) override;
}; };
ExportProgressDialog::ExportProgressDialog(Window* parent, const String& title, const String& message) ExportProgressDialog::ExportProgressDialog(Window* parent, const String& title, const String& message)
@@ -133,8 +133,8 @@ public:
: ApprDatabase(progress_target, _("Expan.dat")) : ApprDatabase(progress_target, _("Expan.dat"))
{} {}
protected: protected:
virtual void doRead(wxInputStream& in); void doRead(wxInputStream& in) override;
virtual void doWrite(wxOutputStream& out); void doWrite(wxOutputStream& out) override;
public: public:
map<String,String> expansions; ///< code -> name map<String,String> expansions; ///< code -> name
@@ -196,8 +196,8 @@ public:
void removeSet(const String& code); void removeSet(const String& code);
protected: protected:
virtual void doRead(wxInputStream& in); void doRead(wxInputStream& in) override;
virtual void doWrite(wxOutputStream& out); void doWrite(wxOutputStream& out) override;
private: private:
vector<ApprFormat> formats; vector<ApprFormat> formats;
@@ -280,8 +280,8 @@ public:
void removeSet(const String& code); void removeSet(const String& code);
protected: protected:
virtual void doRead(wxInputStream& in); void doRead(wxInputStream& in) override;
virtual void doWrite(wxOutputStream& out); void doWrite(wxOutputStream& out) override;
public: public:
map<String,ApprDistro> distros; map<String,ApprDistro> distros;
@@ -295,7 +295,7 @@ void ApprDistroDatabase::removeSet(const String& code) {
void ApprDistroDatabase::doRead(wxInputStream& in) { void ApprDistroDatabase::doRead(wxInputStream& in) {
wxTextInputStream tin(in); wxTextInputStream tin(in);
ApprDistro* last = 0; ApprDistro* last = nullptr;
while (!in.Eof()) { while (!in.Eof()) {
String l = trim(tin.ReadLine()); String l = trim(tin.ReadLine());
if (l.size() > 2 && l.GetChar(0) == _('<')) { if (l.size() > 2 && l.GetChar(0) == _('<')) {
@@ -365,8 +365,8 @@ public:
void removeSet(const String& code); void removeSet(const String& code);
protected: protected:
virtual void doRead(wxInputStream& in); void doRead(wxInputStream& in) override;
virtual void doWrite(wxOutputStream& out); void doWrite(wxOutputStream& out) override;
public: public:
vector<ApprCardRecordP> cards; vector<ApprCardRecordP> cards;
@@ -582,7 +582,7 @@ class ApprenticeExportWindow : public wxDialog, public WithProgress {
public: public:
ApprenticeExportWindow(Window* parent, const SetP& set); ApprenticeExportWindow(Window* parent, const SetP& set);
virtual void onProgress(float p, const String& message); void onProgress(float p, const String& message) override;
void doStep(const String& s, float size); void doStep(const String& s, float size);
private: private:
+1 -1
View File
@@ -29,7 +29,7 @@ public:
UnzoomedDataViewer(bool use_zoom_settings) UnzoomedDataViewer(bool use_zoom_settings)
: use_zoom_settings(use_zoom_settings) : use_zoom_settings(use_zoom_settings)
{} {}
virtual Rotation getRotation() const; Rotation getRotation() const override;
private: private:
bool use_zoom_settings; bool use_zoom_settings;
}; };
+5 -5
View File
@@ -22,11 +22,11 @@
/// The file format of MSE1 files /// The file format of MSE1 files
class MSE1FileFormat : public FileFormat { class MSE1FileFormat : public FileFormat {
public: public:
virtual String extension() { return _("mse"); } String extension() override { return _("mse"); }
virtual String name() { return _("Magic Set Editor version 1 files (*.mse)"); } String name() override { return _("Magic Set Editor version 1 files (*.mse)"); }
virtual bool canImport() { return true; } bool canImport() override { return true; }
virtual bool canExport(const Game&) { return false; } bool canExport(const Game&) override { return false; }
virtual SetP importSet(const String& filename); SetP importSet(const String& filename) override;
}; };
FileFormatP mse1_file_format() { FileFormatP mse1_file_format() {
+7 -7
View File
@@ -16,12 +16,12 @@
/// The file format of MSE2 files /// The file format of MSE2 files
class MSE2FileFormat : public FileFormat { class MSE2FileFormat : public FileFormat {
public: public:
virtual String extension() { return _("mse-set"); } String extension() override { return _("mse-set"); }
virtual String matches() { return _("*.mse-set;set"); } String matches() override { return _("*.mse-set;set"); }
virtual String name() { return _("Magic Set Editor sets (*.mse-set)"); } String name() override { return _("Magic Set Editor sets (*.mse-set)"); }
virtual bool canImport() { return true; } bool canImport() override { return true; }
virtual bool canExport(const Game&) { return true; } bool canExport(const Game&) override { return true; }
virtual SetP importSet(const String& filename) { SetP importSet(const String& filename) override {
wxString set_name = filename; wxString set_name = filename;
// Strip "/set" or "/set.mset-set" from the end, this allows opening directories as set files // Strip "/set" or "/set.mset-set" from the end, this allows opening directories as set files
if (filename.EndsWith(_(".mse-set/set")) || filename.EndsWith(_(".mse-set\\set"))) { if (filename.EndsWith(_(".mse-set/set")) || filename.EndsWith(_(".mse-set\\set"))) {
@@ -34,7 +34,7 @@ public:
settings.addRecentFile(set_name); settings.addRecentFile(set_name);
return set; return set;
} }
virtual void exportSet(Set& set, const String& filename, bool is_copy) { void exportSet(Set& set, const String& filename, bool is_copy) override {
if (is_copy) { if (is_copy) {
set.saveCopy(filename); set.saveCopy(filename);
} else { } else {
+11 -11
View File
@@ -23,11 +23,11 @@
/// The file format of Mtg Editor files /// The file format of Mtg Editor files
class MtgEditorFileFormat : public FileFormat { class MtgEditorFileFormat : public FileFormat {
public: public:
virtual String extension() { return _("set"); } String extension() override { return _("set"); }
virtual String name() { return _("Mtg Editor files (*.set)"); } String name() override { return _("Mtg Editor files (*.set)"); }
virtual bool canImport() { return true; } bool canImport() override { return true; }
virtual bool canExport(const Game&) { return false; } bool canExport(const Game&) override { return false; }
virtual SetP importSet(const String& filename); SetP importSet(const String& filename) override;
private: private:
// Filter: se filename -> image directory // Filter: se filename -> image directory
// based on MtgEditor's: CardSet.getImageFolder // based on MtgEditor's: CardSet.getImageFolder
@@ -115,17 +115,17 @@ SetP MtgEditorFileFormat::importSet(const String& filename) {
} else if (line == _("#COST##########")) { // casting cost } else if (line == _("#COST##########")) { // casting cost
target = &current_card->value<TextValue>(_("casting cost")).value; target = &current_card->value<TextValue>(_("casting cost")).value;
} else if (line == _("#RARITY########") || line == _("#FREQUENCY#####")) { // rarity } else if (line == _("#RARITY########") || line == _("#FREQUENCY#####")) { // rarity
target = 0; target = nullptr;
line = file.ReadLine(); line = file.ReadLine();
if (line == _("0")) current_card->value<ChoiceValue>(_("rarity")).value.assign(_("common")); if (line == _("0")) current_card->value<ChoiceValue>(_("rarity")).value.assign(_("common"));
else if (line == _("1")) current_card->value<ChoiceValue>(_("rarity")).value.assign(_("uncommon")); else if (line == _("1")) current_card->value<ChoiceValue>(_("rarity")).value.assign(_("uncommon"));
else current_card->value<ChoiceValue>(_("rarity")).value.assign(_("rare")); else current_card->value<ChoiceValue>(_("rarity")).value.assign(_("rare"));
} else if (line == _("#COLOR#########")) { // card color } else if (line == _("#COLOR#########")) { // card color
target = 0; target = nullptr;
line = file.ReadLine(); line = file.ReadLine();
current_card->value<ChoiceValue>(_("card color")).value.assign(line); current_card->value<ChoiceValue>(_("card color")).value.assign(line);
} else if (line == _("#AUTOBG########")) { // card color.isDefault } else if (line == _("#AUTOBG########")) { // card color.isDefault
target = 0; target = nullptr;
line = file.ReadLine(); line = file.ReadLine();
if (line == _("TRUE")) { if (line == _("TRUE")) {
current_card->value<ChoiceValue>(_("card color")).value.makeDefault(); current_card->value<ChoiceValue>(_("card color")).value.makeDefault();
@@ -143,7 +143,7 @@ SetP MtgEditorFileFormat::importSet(const String& filename) {
} else if (line == _("#TOUGHNESS#####")) { // toughness } else if (line == _("#TOUGHNESS#####")) { // toughness
target = &current_card->value<TextValue>(_("toughness")).value; target = &current_card->value<TextValue>(_("toughness")).value;
} else if (line == _("#ILLUSTRATION##") || line == _("#ILLUSTRATION8#")) { // image } else if (line == _("#ILLUSTRATION##") || line == _("#ILLUSTRATION8#")) { // image
target = 0; target = nullptr;
line = file.ReadLine(); line = file.ReadLine();
if (!wxFileExists(line)) { if (!wxFileExists(line)) {
// based on card name and date // based on card name and date
@@ -158,14 +158,14 @@ SetP MtgEditorFileFormat::importSet(const String& filename) {
} }
} }
} else if (line == _("#TOMBSTONE#####")) { // tombstone } else if (line == _("#TOMBSTONE#####")) { // tombstone
target = 0; target = nullptr;
line = file.ReadLine(); line = file.ReadLine();
current_card->value<ChoiceValue>(_("card symbol")).value.assign( current_card->value<ChoiceValue>(_("card symbol")).value.assign(
line==_("TRUE") ? _("tombstone") : _("none") line==_("TRUE") ? _("tombstone") : _("none")
); );
} else { } else {
// normal text // normal text
if (target != 0) { // value of a text field if (target != nullptr) { // value of a text field
if (!target->isDefault()) target->mutate() += _("\n"); if (!target->isDefault()) target->mutate() += _("\n");
target->mutate() += line; target->mutate() += line;
} else { } else {
+3 -3
View File
@@ -70,11 +70,11 @@ public:
void initCardListColorScript(); void initCardListColorScript();
static String typeNameStatic(); static String typeNameStatic();
virtual String typeName() const; String typeName() const override;
Version fileVersion() const; Version fileVersion() const override;
protected: protected:
virtual void validate(Version); void validate(Version) override;
DECLARE_REFLECTION_OVERRIDE(); DECLARE_REFLECTION_OVERRIDE();
}; };
+3 -3
View File
@@ -43,9 +43,9 @@ public:
void addPackage(Packaged& package); void addPackage(Packaged& package);
protected: protected:
virtual String typeName() const; String typeName() const override;
virtual Version fileVersion() const; Version fileVersion() const override;
virtual void validate(Version file_app_version); void validate(Version file_app_version) override;
DECLARE_REFLECTION(); DECLARE_REFLECTION();
}; };
+2 -2
View File
@@ -43,8 +43,8 @@ public:
static LocaleP byName(const String& name); static LocaleP byName(const String& name);
protected: protected:
String typeName() const; String typeName() const override;
Version fileVersion() const; Version fileVersion() const override;
DECLARE_REFLECTION(); DECLARE_REFLECTION();
}; };
+2 -2
View File
@@ -256,7 +256,7 @@ void PackInstance::generate(vector<CardP>* out) {
// 1. the weights of each item, and of the cards // 1. the weights of each item, and of the cards
vector<WeightedItem> weighted_items; vector<WeightedItem> weighted_items;
FOR_EACH_CONST(item, pack_type.items) { FOR_EACH_CONST(item, pack_type.items) {
WeightedItem wi = {0,0,parent.gen()}; WeightedItem wi = {0,0,(int)parent.gen()};
if (pack_type.select == SELECT_EQUAL_PROPORTIONAL) { if (pack_type.select == SELECT_EQUAL_PROPORTIONAL) {
wi.weight = item->weight * parent.get(item->name).total_weight; wi.weight = item->weight * parent.get(item->name).total_weight;
} else if (pack_type.select == SELECT_EQUAL_NONEMPTY) { } else if (pack_type.select == SELECT_EQUAL_NONEMPTY) {
@@ -266,7 +266,7 @@ void PackInstance::generate(vector<CardP>* out) {
} }
weighted_items.push_back(wi); weighted_items.push_back(wi);
} }
WeightedItem wi = {cards.size(),0,parent.gen()}; WeightedItem wi = {(double)cards.size(),0,(int)parent.gen()};
weighted_items.push_back(wi); weighted_items.push_back(wi);
// 2. divide the requested_copies among the cards and the items, taking the weights into account // 2. divide the requested_copies among the cards and the items, taking the weights into account
weighted_equal_divide(weighted_items, (int)requested_copies); weighted_equal_divide(weighted_items, (int)requested_copies);
+5 -5
View File
@@ -114,18 +114,18 @@ public:
/// Clear the order_cache used by positionOfCard /// Clear the order_cache used by positionOfCard
void clearOrderCache(); void clearOrderCache();
virtual String typeName() const; String typeName() const override;
Version fileVersion() const; Version fileVersion() const override;
/// Validate that the set is correctly loaded /// Validate that the set is correctly loaded
virtual void validate(Version = app_version); void validate(Version = app_version) override;
protected: protected:
virtual VCSP getVCS() { VCSP getVCS() override {
return vcs; return vcs;
} }
private: private:
DECLARE_REFLECTION(); DECLARE_REFLECTION_OVERRIDE();
template <typename Handler> template <typename Handler>
void reflect_cards(Handler& handler); void reflect_cards(Handler& handler);
+3 -3
View File
@@ -62,10 +62,10 @@ public:
String stylesheetName() const; String stylesheetName() const;
static String typeNameStatic(); static String typeNameStatic();
virtual String typeName() const; String typeName() const override;
Version fileVersion() const; Version fileVersion() const override;
/// Validate the stylesheet /// Validate the stylesheet
virtual void validate(Version = app_version); void validate(Version = app_version) override;
protected: protected:
+19 -19
View File
@@ -206,11 +206,11 @@ public:
SymbolShape(); SymbolShape();
virtual String typeName() const; String typeName() const override;
virtual SymbolPartP clone() const; SymbolPartP clone() const override;
virtual int icon() const { return combine; } int icon() const override { return combine; }
virtual SymbolShape* isSymbolShape() { return this; } SymbolShape* isSymbolShape() override { return this; }
virtual const SymbolShape* isSymbolShape() const { return this; } const SymbolShape* isSymbolShape() const override { return this; }
/// Get a control point, wraps around /// Get a control point, wraps around
inline ControlPointP getPoint(int id) const { inline ControlPointP getPoint(int id) const {
@@ -221,7 +221,7 @@ public:
void enforceConstraints(); void enforceConstraints();
/// Calculate the position and size of the part using the given rotation matrix /// Calculate the position and size of the part using the given rotation matrix
virtual Bounds calculateBounds(const Vector2D& origin, const Matrix2D& m, bool is_identity); Bounds calculateBounds(const Vector2D& origin, const Matrix2D& m, bool is_identity) override;
DECLARE_REFLECTION_OVERRIDE(); DECLARE_REFLECTION_OVERRIDE();
void after_reading(Version) override; void after_reading(Version) override;
@@ -236,15 +236,15 @@ public:
SymbolGroup(); SymbolGroup();
virtual String typeName() const; String typeName() const override;
virtual SymbolPartP clone() const; SymbolPartP clone() const override;
virtual int icon() const { return SYMBOL_COMBINE_BORDER + 3; } int icon() const override { return SYMBOL_COMBINE_BORDER + 3; }
virtual SymbolGroup* isSymbolGroup() { return this; } SymbolGroup* isSymbolGroup() override { return this; }
virtual const SymbolGroup* isSymbolGroup() const { return this; } const SymbolGroup* isSymbolGroup() const override { return this; }
virtual bool isAncestor(const SymbolPart& that) const; bool isAncestor(const SymbolPart& that) const override;
virtual Bounds calculateBounds(const Vector2D& origin, const Matrix2D& m, bool is_identity); Bounds calculateBounds(const Vector2D& origin, const Matrix2D& m, bool is_identity) override;
DECLARE_REFLECTION_OVERRIDE(); DECLARE_REFLECTION_OVERRIDE();
}; };
@@ -268,14 +268,14 @@ public:
SymbolSymmetry(); SymbolSymmetry();
virtual String typeName() const; String typeName() const override;
virtual SymbolPartP clone() const; SymbolPartP clone() const override;
virtual int icon() const { return kind + SYMBOL_COMBINE_BORDER + 1; } int icon() const override { return kind + SYMBOL_COMBINE_BORDER + 1; }
virtual SymbolSymmetry* isSymbolSymmetry() { return this; } SymbolSymmetry* isSymbolSymmetry() override { return this; }
virtual const SymbolSymmetry* isSymbolSymmetry() const { return this; } const SymbolSymmetry* isSymbolSymmetry() const override { return this; }
String expectedName() const; String expectedName() const;
virtual Bounds calculateBounds(const Vector2D& origin, const Matrix2D& m, bool is_identity); Bounds calculateBounds(const Vector2D& origin, const Matrix2D& m, bool is_identity) override;
DECLARE_REFLECTION_OVERRIDE(); DECLARE_REFLECTION_OVERRIDE();
}; };
+10 -10
View File
@@ -68,8 +68,8 @@ public:
Image getImage(double font_size, const DrawableSymbol& symbol); Image getImage(double font_size, const DrawableSymbol& symbol);
static String typeNameStatic(); static String typeNameStatic();
virtual String typeName() const; String typeName() const override;
Version fileVersion() const; Version fileVersion() const override;
/// Generate a 'insert symbol' menu. /// Generate a 'insert symbol' menu.
/** This class owns the menu! /** This class owns the menu!
@@ -112,9 +112,9 @@ public:
// ----------------------------------------------------------------------------- : InsertSymbolMenu // ----------------------------------------------------------------------------- : InsertSymbolMenu
enum MenuItemType enum MenuItemType
{ ITEM_CODE ///< Name gives the code to insert { ITEM_CODE ///< Name gives the code to insert
, ITEM_CUSTOM ///< Use a dialog box , ITEM_CUSTOM ///< Use a dialog box
, ITEM_LINE ///< A menu separator , ITEM_LINE ///< A menu separator
, ITEM_SUBMENU ///< A submenu , ITEM_SUBMENU ///< A submenu
}; };
@@ -153,11 +153,11 @@ public:
/// Is a font loaded? /// Is a font loaded?
bool valid() const; bool valid() const;
Scriptable<String> name; ///< Font package name, can be changed with script Scriptable<String> name; ///< Font package name, can be changed with script
Scriptable<double> size; ///< Size of the font Scriptable<double> size; ///< Size of the font
double scale_down_to; ///< Mimumum size of the font double scale_down_to; ///< Mimumum size of the font
Scriptable<Alignment> alignment; ///< Alignment of symbols in a line of text Scriptable<Alignment> alignment; ///< Alignment of symbols in a line of text
SymbolFontP font; ///< The font, if it is loaded SymbolFontP font; ///< The font, if it is loaded
private: private:
DECLARE_REFLECTION(); DECLARE_REFLECTION();
+4 -4
View File
@@ -41,7 +41,7 @@ class HoverButtonBase : public wxControl {
public: public:
HoverButtonBase(Window* parent, int id, bool accepts_focus = true); HoverButtonBase(Window* parent, int id, bool accepts_focus = true);
virtual bool AcceptsFocus() const; bool AcceptsFocus() const override;
virtual void SetHelpText(const String& s) { help_text = s; } virtual void SetHelpText(const String& s) { help_text = s; }
@@ -90,14 +90,14 @@ private:
Bitmap bg_normal, bg_hover, bg_focus, bg_down; ///< Bitmaps for the states of the button Bitmap bg_normal, bg_hover, bg_focus, bg_down; ///< Bitmaps for the states of the button
Color background; Color background;
virtual wxSize DoGetBestSize() const; wxSize DoGetBestSize() const override;
const Bitmap* last_drawn; const Bitmap* last_drawn;
const Bitmap* toDraw() const; const Bitmap* toDraw() const;
protected: protected:
int drawDelta() const; int drawDelta() const;
virtual void refreshIfNeeded(); void refreshIfNeeded() override;
virtual void draw(DC& dc); void draw(DC& dc) override;
}; };
+7 -7
View File
@@ -47,24 +47,24 @@ public:
protected: protected:
/// Get all items /// Get all items
virtual void getItems(vector<VoidP>& out) const; void getItems(vector<VoidP>& out) const override;
/// Return the AutoReplace at the given position in the sorted list /// Return the AutoReplace at the given position in the sorted list
inline AutoReplaceP getAR(long pos) const { return static_pointer_cast<AutoReplace>(getItem(pos)); } inline AutoReplaceP getAR(long pos) const { return static_pointer_cast<AutoReplace>(getItem(pos)); }
/// Send an 'item selected' event for the currently selected item (selected_item) /// Send an 'item selected' event for the currently selected item (selected_item)
virtual void sendEvent(); void sendEvent() override;
/// Compare items /// Compare items
virtual bool compareItems(void* a, void* b) const; bool compareItems(void* a, void* b) const override;
virtual bool mustSort() const { return true; } bool mustSort() const override { return true; }
/// Get the text of an item in a specific column /// Get the text of an item in a specific column
/** Overrides a function from wxListCtrl */ /** Overrides a function from wxListCtrl */
virtual String OnGetItemText (long pos, long col) const; String OnGetItemText (long pos, long col) const override;
/// Get the image of an item, by default no image is used /// Get the image of an item, by default no image is used
/** Overrides a function from wxListCtrl */ /** Overrides a function from wxListCtrl */
virtual int OnGetItemImage(long pos) const; int OnGetItemImage(long pos) const override;
/// Get the color for an item /// Get the color for an item
virtual wxListItemAttr* OnGetItemAttr(long pos) const; wxListItemAttr* OnGetItemAttr(long pos) const override;
mutable wxListItemAttr item_attr; // for OnGetItemAttr mutable wxListItemAttr item_attr; // for OnGetItemAttr
}; };
+2 -2
View File
@@ -122,8 +122,8 @@ struct CompareTabOrder {
assert(a && b); assert(a && b);
Style& as = *a->getStyle(), &bs = *b->getStyle(); Style& as = *a->getStyle(), &bs = *b->getStyle();
// if tab_index differs, use that // if tab_index differs, use that
if (as.tab_index < as.tab_index) return true; if (as.tab_index < bs.tab_index) return true;
if (as.tab_index > as.tab_index) return false; if (as.tab_index > bs.tab_index) return false;
// otherwise look at the positions // otherwise look at the positions
// To get a total order, we look at the viewer center. // To get a total order, we look at the viewer center.
// Not completely (y,x), because for viewers that are almost at the same y we prefer to sort by x // Not completely (y,x), because for viewers that are almost at the same y we prefer to sort by x
+6 -6
View File
@@ -23,10 +23,10 @@ public:
// --------------------------------------------------- : Utility for ValueViewers/Editors // --------------------------------------------------- : Utility for ValueViewers/Editors
virtual DrawWhat drawWhat(const ValueViewer*) const; DrawWhat drawWhat(const ValueViewer*) const override;
virtual bool viewerIsCurrent(const ValueViewer*) const; bool viewerIsCurrent(const ValueViewer*) const override;
virtual void addAction(unique_ptr<Action> action); virtual void addAction(unique_ptr<Action> action) final;
inline SetP getSetForActions() { return set; } inline SetP getSetForActions() { return set; }
// --------------------------------------------------- : Selection // --------------------------------------------------- : Selection
@@ -42,7 +42,7 @@ public:
/// Select the previous editable editor, returns false if the current editor is the first one /// Select the previous editable editor, returns false if the current editor is the first one
bool selectPrevious(); bool selectPrevious();
virtual bool AcceptsFocus() const; bool AcceptsFocus() const override;
/// The next window in the tab order (optional) /// The next window in the tab order (optional)
const wxWindow* next_in_tab_order; const wxWindow* next_in_tab_order;
@@ -90,9 +90,9 @@ public:
protected: protected:
/// Create an editor for the given style (as opposed to a normal viewer) /// Create an editor for the given style (as opposed to a normal viewer)
virtual ValueViewerP makeViewer(const StyleP&); ValueViewerP makeViewer(const StyleP&) override;
virtual void onInit(); void onInit() override;
// --------------------------------------------------- : Data // --------------------------------------------------- : Data
ValueViewer* current_viewer; ///< The currently selected viewer ValueViewer* current_viewer; ///< The currently selected viewer
+17 -17
View File
@@ -69,20 +69,20 @@ public:
// --------------------------------------------------- : Clipboard // --------------------------------------------------- : Clipboard
bool canCut() const; bool canCut() const override;
bool canCopy() const; bool canCopy() const override;
bool canPaste() const; bool canPaste() const override;
bool canDelete() const; bool canDelete() const override;
// Try to perform a clipboard operation, return success // Try to perform a clipboard operation, return success
bool doCopy(); bool doCopy() override;
bool doPaste(); bool doPaste() override;
bool doDelete(); bool doDelete() override;
// --------------------------------------------------- : Set actions // --------------------------------------------------- : Set actions
virtual void onBeforeChangeSet(); void onBeforeChangeSet() override;
virtual void onChangeSet(); void onChangeSet() override;
virtual void onAction(const Action&, bool undone); void onAction(const Action&, bool undone) override;
// --------------------------------------------------- : The cards // --------------------------------------------------- : The cards
public: public:
@@ -92,7 +92,7 @@ public:
void getSelection(vector<CardP>& out) const; void getSelection(vector<CardP>& out) const;
protected: protected:
/// Get a list of all cards /// Get a list of all cards
virtual void getItems(vector<VoidP>& out) const; void getItems(vector<VoidP>& out) const override;
/// Rebuild the card list (clear all vectors and fill them again) /// Rebuild the card list (clear all vectors and fill them again)
void rebuild(); void rebuild();
@@ -101,24 +101,24 @@ protected:
/// Can the card list be modified? /// Can the card list be modified?
virtual bool allowModify() const { return false; } virtual bool allowModify() const { return false; }
/// Sort all card lists /// Sort all card lists
virtual void sortBy(long column, bool ascending); void sortBy(long column, bool ascending) override;
/// Send an 'item selected' event for the currently selected item (selected_item) /// Send an 'item selected' event for the currently selected item (selected_item)
virtual void sendEvent() { sendEvent(EVENT_CARD_SELECT); } void sendEvent() override { sendEvent(EVENT_CARD_SELECT); }
void sendEvent(int type = EVENT_CARD_SELECT); void sendEvent(int type = EVENT_CARD_SELECT);
/// Compare cards /// Compare cards
virtual bool compareItems(void* a, void* b) const; bool compareItems(void* a, void* b) const override;
// --------------------------------------------------- : Item 'events' // --------------------------------------------------- : Item 'events'
/// Get the text of an item in a specific column /// Get the text of an item in a specific column
/** Overrides a function from wxListCtrl */ /** Overrides a function from wxListCtrl */
virtual String OnGetItemText (long pos, long col) const; String OnGetItemText (long pos, long col) const override;
/// Get the image of an item, by default no image is used /// Get the image of an item, by default no image is used
/** Overrides a function from wxListCtrl */ /** Overrides a function from wxListCtrl */
virtual int OnGetItemImage(long pos) const; int OnGetItemImage(long pos) const override;
/// Get the color for an item /// Get the color for an item
virtual wxListItemAttr* OnGetItemAttr(long pos) const; wxListItemAttr* OnGetItemAttr(long pos) const override;
// --------------------------------------------------- : Data // --------------------------------------------------- : Data
private: private:
+7 -7
View File
@@ -32,24 +32,24 @@ public:
/// Invalidate and redraw the entire viewer /// Invalidate and redraw the entire viewer
void redraw(); void redraw();
/// Invalidate and redraw (the area of) a single value viewer /// Invalidate and redraw (the area of) a single value viewer
virtual void redraw(const ValueViewer&); void redraw(const ValueViewer&) override;
/// The rotation to use /// The rotation to use
virtual Rotation getRotation() const; Rotation getRotation() const override;
virtual bool AcceptsFocus() const { return false; } bool AcceptsFocus() const override { return false; }
protected: protected:
/// Return the desired size of control /// Return the desired size of control
virtual wxSize DoGetBestSize() const; wxSize DoGetBestSize() const override;
virtual void onChange(); void onChange() override;
virtual void onChangeSize(); void onChangeSize() override;
/// Should the given viewer be drawn? /// Should the given viewer be drawn?
bool shouldDraw(const ValueViewer&) const; bool shouldDraw(const ValueViewer&) const;
virtual void drawViewer(RotatedDC& dc, ValueViewer& v); void drawViewer(RotatedDC& dc, ValueViewer& v) override;
private: private:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
+4 -4
View File
@@ -24,10 +24,10 @@ public:
vector<String> choices; vector<String> choices;
protected: protected:
virtual size_t selection() const { return NO_SELECTION; } size_t selection() const override { return NO_SELECTION; }
virtual size_t itemCount() const { return choices.size(); } size_t itemCount() const override { return choices.size(); }
virtual String itemText(size_t item) const { return choices.at(item); } String itemText(size_t item) const override { return choices.at(item); }
virtual void select(size_t item); void select(size_t item) override;
}; };
// ----------------------------------------------------------------------------- : FilterControl // ----------------------------------------------------------------------------- : FilterControl
+3 -3
View File
@@ -26,11 +26,11 @@ public:
protected: protected:
/// Get only the subset of the cards /// Get only the subset of the cards
virtual void getItems(vector<VoidP>& out) const; void getItems(vector<VoidP>& out) const override;
virtual void onChangeSet(); void onChangeSet() override;
private: private:
CardListFilterP filter; ///< Filter with which this.cards is made CardListFilterP filter; ///< Filter with which this.cards is made
}; };
+1 -1
View File
@@ -71,7 +71,7 @@ protected:
virtual void onSelect(size_t item, size_t col, bool& changes) {} virtual void onSelect(size_t item, size_t col, bool& changes) {}
/// Return the desired size of control /// Return the desired size of control
virtual wxSize DoGetBestSize() const; wxSize DoGetBestSize() const override;
/// Information on the subcolumns. These are columns inside items /// Information on the subcolumns. These are columns inside items
struct SubColumn { struct SubColumn {
+30 -30
View File
@@ -157,9 +157,9 @@ protected:
class Graph1D : public Graph { class Graph1D : public Graph {
public: public:
inline Graph1D(size_t axis) : axis(axis) {} inline Graph1D(size_t axis) : axis(axis) {}
virtual void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const; void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const override;
virtual bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const; bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const override;
virtual void setData(const GraphDataP& d); void setData(const GraphDataP& d) override;
protected: protected:
size_t axis; size_t axis;
/// Find an item, return the position along the axis, or -1 if not found /// Find an item, return the position along the axis, or -1 if not found
@@ -172,7 +172,7 @@ protected:
class Graph2D : public Graph { class Graph2D : public Graph {
public: public:
inline Graph2D(size_t axis1, size_t axis2) : axis1(axis1), axis2(axis2) {} inline Graph2D(size_t axis1, size_t axis2) : axis1(axis1), axis2(axis2) {}
virtual void setData(const GraphDataP& d); void setData(const GraphDataP& d) override;
protected: protected:
size_t axis1, axis2; size_t axis1, axis2;
vector<UInt> values; // axis1.size * axis2.size array vector<UInt> values; // axis1.size * axis2.size array
@@ -184,33 +184,33 @@ protected:
class BarGraph : public Graph1D { class BarGraph : public Graph1D {
public: public:
inline BarGraph(size_t axis) : Graph1D(axis) {} inline BarGraph(size_t axis) : Graph1D(axis) {}
virtual void draw(RotatedDC& dc, int current, DrawLayer layer) const; void draw(RotatedDC& dc, int current, DrawLayer layer) const override;
virtual int findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight) const; int findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight) const override;
}; };
// A bar graph with stacked bars // A bar graph with stacked bars
class BarGraph2D : public Graph2D { class BarGraph2D : public Graph2D {
public: public:
inline BarGraph2D(size_t axis_h, size_t axis_v) : Graph2D(axis_h, axis_v) {} inline BarGraph2D(size_t axis_h, size_t axis_v) : Graph2D(axis_h, axis_v) {}
virtual void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const; void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const override;
virtual bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const; bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const override;
}; };
/// A pie graph /// A pie graph
class PieGraph : public Graph1D { class PieGraph : public Graph1D {
public: public:
inline PieGraph(size_t axis) : Graph1D(axis) {} inline PieGraph(size_t axis) : Graph1D(axis) {}
virtual void draw(RotatedDC& dc, int current, DrawLayer layer) const; void draw(RotatedDC& dc, int current, DrawLayer layer) const override;
virtual int findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight) const; int findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight) const override;
}; };
/// A scatter plot /// A scatter plot
class ScatterGraph : public Graph2D { class ScatterGraph : public Graph2D {
public: public:
inline ScatterGraph(size_t axis1, size_t axis2) : Graph2D(axis1, axis2) {} inline ScatterGraph(size_t axis1, size_t axis2) : Graph2D(axis1, axis2) {}
virtual void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const; void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const override;
virtual bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const; bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const override;
virtual void setData(const GraphDataP& d); void setData(const GraphDataP& d) override;
protected: protected:
UInt max_value; UInt max_value;
double max_value_x, max_value_y; ///< highest sum of two adjacent scaled values (radii) double max_value_x, max_value_y; ///< highest sum of two adjacent scaled values (radii)
@@ -221,7 +221,7 @@ protected:
class ScatterGraphPlus : public ScatterGraph { class ScatterGraphPlus : public ScatterGraph {
public: public:
inline ScatterGraphPlus(size_t axis1, size_t axis2, size_t axis3) : ScatterGraph(axis1, axis2), axis3(axis3) {} inline ScatterGraphPlus(size_t axis1, size_t axis2, size_t axis3) : ScatterGraph(axis1, axis2), axis3(axis3) {}
virtual void setData(const GraphDataP& d); void setData(const GraphDataP& d) override;
protected: protected:
size_t axis3; size_t axis3;
vector<UInt> values3D; // axis1.size * axis2.size * axis3.size array vector<UInt> values3D; // axis1.size * axis2.size * axis3.size array
@@ -232,7 +232,7 @@ protected:
class ScatterPieGraph : public ScatterGraphPlus { class ScatterPieGraph : public ScatterGraphPlus {
public: public:
inline ScatterPieGraph(size_t axis1, size_t axis2, size_t axis3) : ScatterGraphPlus(axis1, axis2, axis3) {} inline ScatterPieGraph(size_t axis1, size_t axis2, size_t axis3) : ScatterGraphPlus(axis1, axis2, axis3) {}
virtual void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const; void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const override;
}; };
/// The legend, used for pie graphs /// The legend, used for pie graphs
@@ -241,9 +241,9 @@ public:
inline GraphLegend(size_t axis, Alignment alignment, bool reverse = false) inline GraphLegend(size_t axis, Alignment alignment, bool reverse = false)
: Graph1D(axis), alignment(alignment), reverse(reverse) : Graph1D(axis), alignment(alignment), reverse(reverse)
{} {}
virtual RealSize determineSize(RotatedDC& dc) const; RealSize determineSize(RotatedDC& dc) const override;
virtual void draw(RotatedDC& dc, int current, DrawLayer layer) const; void draw(RotatedDC& dc, int current, DrawLayer layer) const override;
virtual int findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight) const; int findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight) const override;
private: private:
mutable RealSize size, item_size; mutable RealSize size, item_size;
Alignment alignment; Alignment alignment;
@@ -256,9 +256,9 @@ public:
inline GraphStats(size_t axis, Alignment alignment) inline GraphStats(size_t axis, Alignment alignment)
: Graph1D(axis), alignment(alignment) : Graph1D(axis), alignment(alignment)
{} {}
virtual RealSize determineSize(RotatedDC& dc) const; RealSize determineSize(RotatedDC& dc) const override;
virtual void draw(RotatedDC& dc, int current, DrawLayer layer) const; void draw(RotatedDC& dc, int current, DrawLayer layer) const override;
virtual void setData(const GraphDataP& d); void setData(const GraphDataP& d) override;
private: private:
mutable RealSize size, item_size; mutable RealSize size, item_size;
mutable double label_width; mutable double label_width;
@@ -281,8 +281,8 @@ public:
inline GraphLabelAxis(size_t axis, Direction direction, bool rotate = false, DrawLines draw_lines = DRAW_LINES_NO, bool label = false) inline GraphLabelAxis(size_t axis, Direction direction, bool rotate = false, DrawLines draw_lines = DRAW_LINES_NO, bool label = false)
: Graph1D(axis), direction(direction), rotate(rotate), draw_lines(draw_lines), label(label) : Graph1D(axis), direction(direction), rotate(rotate), draw_lines(draw_lines), label(label)
{} {}
virtual void draw(RotatedDC& dc, int current, DrawLayer layer) const; void draw(RotatedDC& dc, int current, DrawLayer layer) const override;
virtual int findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight) const; int findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight) const override;
private: private:
Direction direction; Direction direction;
int levels; int levels;
@@ -295,7 +295,7 @@ private:
class GraphValueAxis : public Graph1D { class GraphValueAxis : public Graph1D {
public: public:
inline GraphValueAxis(size_t axis, bool highlight_value) : Graph1D(axis), highlight_value(highlight_value) {} inline GraphValueAxis(size_t axis, bool highlight_value) : Graph1D(axis), highlight_value(highlight_value) {}
virtual void draw(RotatedDC& dc, int current, DrawLayer layer) const; void draw(RotatedDC& dc, int current, DrawLayer layer) const override;
private: private:
bool highlight_value; bool highlight_value;
}; };
@@ -310,9 +310,9 @@ public:
, margin_left(margin_left), margin_top(margin_top), margin_right(margin_right), margin_bottom(margin_bottom) , margin_left(margin_left), margin_top(margin_top), margin_right(margin_right), margin_bottom(margin_bottom)
, upside_down(upside_down) , upside_down(upside_down)
{} {}
virtual void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const; void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const override;
virtual bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const; bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const override;
virtual void setData(const GraphDataP& d); void setData(const GraphDataP& d) override;
private: private:
const GraphP graph; const GraphP graph;
double margin_left, margin_top, margin_right, margin_bottom; double margin_left, margin_top, margin_right, margin_bottom;
@@ -322,9 +322,9 @@ private:
/// A display containing multiple graphs /// A display containing multiple graphs
class GraphContainer : public Graph { class GraphContainer : public Graph {
public: public:
virtual void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const; void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const override;
virtual bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const; bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const override;
virtual void setData(const GraphDataP& d); void setData(const GraphDataP& d) override;
void add(const GraphP& graph); void add(const GraphP& graph);
private: private:
+3 -3
View File
@@ -57,7 +57,7 @@ public:
wxDateTime::Now()) // TODO: Find mofication time of card image wxDateTime::Now()) // TODO: Find mofication time of card image
, filename(filename) , filename(filename)
{} {}
virtual Image generate() { Image generate() override {
try { try {
ImageCardList* parent = (ImageCardList*)owner; ImageCardList* parent = (ImageCardList*)owner;
Image image; Image image;
@@ -72,7 +72,7 @@ public:
return Image(); return Image();
} }
} }
virtual void store(const Image& img) { void store(const Image& img) override {
// add finished bitmap to the imagelist // add finished bitmap to the imagelist
ImageCardList* parent = (ImageCardList*)owner; ImageCardList* parent = (ImageCardList*)owner;
if (img.Ok()) { if (img.Ok()) {
@@ -83,7 +83,7 @@ public:
} }
} }
virtual bool threadSafe() const {return true;} bool threadSafe() const override {return true;}
private: private:
LocalFileName filename; LocalFileName filename;
}; };
+6 -6
View File
@@ -23,10 +23,10 @@ public:
~ImageCardList(); ~ImageCardList();
ImageCardList(Window* parent, int id, long additional_style = 0); ImageCardList(Window* parent, int id, long additional_style = 0);
protected: protected:
virtual int OnGetItemImage(long pos) const; int OnGetItemImage(long pos) const override;
virtual void onRebuild(); void onRebuild() override;
virtual void onBeforeChangeSet(); void onBeforeChangeSet() override;
virtual bool allowModify() const { return true; } bool allowModify() const override { return true; }
private: private:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
void onIdle(wxIdleEvent&); void onIdle(wxIdleEvent&);
@@ -50,8 +50,8 @@ public:
protected: protected:
/// Get only the subset of the cards /// Get only the subset of the cards
virtual void getItems(vector<VoidP>& out) const; void getItems(vector<VoidP>& out) const override;
virtual void onChangeSet(); void onChangeSet() override;
private: private:
CardListFilterP filter; ///< Filter with which this.cards is made CardListFilterP filter; ///< Filter with which this.cards is made
+1 -1
View File
@@ -99,7 +99,7 @@ protected:
// --------------------------------------------------- : Fixing wx issues // --------------------------------------------------- : Fixing wx issues
wxSize DoGetBestClientSize() const; wxSize DoGetBestClientSize() const override;
// --------------------------------------------------- : Data // --------------------------------------------------- : Data
VoidP selected_item; ///< The currently selected item VoidP selected_item; ///< The currently selected item
+16 -16
View File
@@ -43,9 +43,9 @@ public:
// --------------------------------------------------- : Set stuff // --------------------------------------------------- : Set stuff
virtual void onBeforeChangeSet(); void onBeforeChangeSet() override;
virtual void onChangeSet(); void onChangeSet() override;
virtual void onAction(const Action&, bool); void onAction(const Action&, bool) override;
void updateUsageStatistics(); void updateUsageStatistics();
// --------------------------------------------------- : Selection // --------------------------------------------------- : Selection
@@ -58,35 +58,35 @@ public:
// --------------------------------------------------- : Clipboard // --------------------------------------------------- : Clipboard
bool canDelete() const; bool canDelete() const override;
bool canCopy() const; bool canCopy() const override;
bool canPaste() const; bool canPaste() const override;
// Try to perform a clipboard operation, return success // Try to perform a clipboard operation, return success
bool doCut(); bool doCut() override;
bool doCopy(); bool doCopy() override;
bool doPaste(); bool doPaste() override;
bool doDelete(); bool doDelete() override;
// --------------------------------------------------- : The keywords // --------------------------------------------------- : The keywords
protected: protected:
/// Get a list of all keywords /// Get a list of all keywords
virtual void getItems(vector<VoidP>& out) const; void getItems(vector<VoidP>& out) const override;
/// Return the keyword at the given position in the sorted keyword list /// Return the keyword at the given position in the sorted keyword list
inline KeywordP getKeyword(long pos) const { return static_pointer_cast<Keyword>(getItem(pos)); } inline KeywordP getKeyword(long pos) const { return static_pointer_cast<Keyword>(getItem(pos)); }
/// Send an 'item selected' event for the currently selected item (selected_item) /// Send an 'item selected' event for the currently selected item (selected_item)
virtual void sendEvent(); void sendEvent() override;
/// Compare keywords /// Compare keywords
virtual bool compareItems(void* a, void* b) const; bool compareItems(void* a, void* b) const override;
/// Get the text of an item in a specific column /// Get the text of an item in a specific column
/** Overrides a function from wxListCtrl */ /** Overrides a function from wxListCtrl */
virtual String OnGetItemText (long pos, long col) const; String OnGetItemText (long pos, long col) const override;
/// Get the image of an item, by default no image is used /// Get the image of an item, by default no image is used
/** Overrides a function from wxListCtrl */ /** Overrides a function from wxListCtrl */
virtual int OnGetItemImage(long pos) const; int OnGetItemImage(long pos) const override;
/// Get the color for an item /// Get the color for an item
virtual wxListItemAttr* OnGetItemAttr(long pos) const; wxListItemAttr* OnGetItemAttr(long pos) const override;
private: private:
void storeColumns(); void storeColumns();
+10 -10
View File
@@ -21,16 +21,16 @@ public:
NativeLookEditor(Window* parent, int id, long style = wxBORDER_THEME); NativeLookEditor(Window* parent, int id, long style = wxBORDER_THEME);
/// Uses a native look /// Uses a native look
virtual bool nativeLook() const { return true; } bool nativeLook() const override { return true; }
virtual Rotation getRotation() const; Rotation getRotation() const override;
virtual void draw(DC& dc); void draw(DC& dc) override;
virtual void drawViewer(RotatedDC& dc, ValueViewer& v); void drawViewer(RotatedDC& dc, ValueViewer& v) override;
protected: protected:
// Best size doesn't really matter, as long as it is not too small // Best size doesn't really matter, as long as it is not too small
virtual wxSize DoGetBestSize() const; wxSize DoGetBestSize() const override;
virtual void onInit(); void onInit() override;
private: private:
static const int margin = 6; static const int margin = 6;
@@ -57,9 +57,9 @@ class SetInfoEditor : public NativeLookEditor {
public: public:
SetInfoEditor(Window* parent, int id, long style = wxBORDER_THEME); SetInfoEditor(Window* parent, int id, long style = wxBORDER_THEME);
virtual Package& getStylePackage() const; Package& getStylePackage() const override;
protected: protected:
virtual void onChangeSet(); void onChangeSet() override;
}; };
// ----------------------------------------------------------------------------- : StylingEditor // ----------------------------------------------------------------------------- : StylingEditor
@@ -74,7 +74,7 @@ public:
/// Show the styling for given card /// Show the styling for given card
void showCard(const CardP& card); void showCard(const CardP& card);
protected: protected:
virtual void onChangeSet(); void onChangeSet() override;
}; };
// ----------------------------------------------------------------------------- : ExportOptionsEditor // ----------------------------------------------------------------------------- : ExportOptionsEditor
@@ -87,7 +87,7 @@ public:
/// Show the options for given export template /// Show the options for given export template
void showExport(const ExportTemplateP& export_template); void showExport(const ExportTemplateP& export_template);
virtual Package& getStylePackage() const; Package& getStylePackage() const override;
private: private:
ExportTemplateP export_template; ExportTemplateP export_template;
}; };
+2 -2
View File
@@ -53,9 +53,9 @@ public:
protected: protected:
/// Draw an item /// Draw an item
virtual void drawItem(DC& dc, int x, int y, size_t item); void drawItem(DC& dc, int x, int y, size_t item) override;
/// Return how many items there are in the list /// Return how many items there are in the list
virtual size_t itemCount() const; size_t itemCount() const override;
private: private:
// The default icon to use // The default icon to use
+2 -2
View File
@@ -31,8 +31,8 @@ public:
void setSelection(const vector<CardP>& cards); void setSelection(const vector<CardP>& cards);
protected: protected:
virtual int OnGetItemImage(long pos) const; int OnGetItemImage(long pos) const override;
virtual void onChangeSet(); void onChangeSet() override;
private: private:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
+7 -7
View File
@@ -48,18 +48,18 @@ public:
TextStyle& getStyle(); TextStyle& getStyle();
/// Uses a native look /// Uses a native look
virtual bool nativeLook() const { return true; } bool nativeLook() const override { return true; }
virtual Rotation getRotation() const; Rotation getRotation() const override;
virtual void draw(DC& dc); void draw(DC& dc) override;
virtual bool AcceptsFocus() const; bool AcceptsFocus() const override;
virtual void onChangeSet(); void onChangeSet() override;
protected: protected:
virtual void onInit(); void onInit() override;
virtual wxSize DoGetBestSize() const; wxSize DoGetBestSize() const override;
private: private:
bool multi_line; ///< Multi line text control? bool multi_line; ///< Multi line text control?
+1 -1
View File
@@ -131,7 +131,7 @@ TreeList::TreeList(Window* parent, int id, long style)
wxClientDC dc(this); wxClientDC dc(this);
dc.SetFont(*wxNORMAL_FONT); dc.SetFont(*wxNORMAL_FONT);
int h; int h;
dc.GetTextExtent(_("X"), 0, &h); dc.GetTextExtent(_("X"), nullptr, &h);
item_height = h + 2; item_height = h + 2;
} }
+2 -2
View File
@@ -26,7 +26,7 @@ public:
private: private:
DropDownList& list; DropDownList& list;
virtual bool ProcessEvent(wxEvent& ev) { bool ProcessEvent(wxEvent& ev) override {
int t = ev.GetEventType(); int t = ev.GetEventType();
if ( t == wxEVT_LEFT_DOWN || t == wxEVT_RIGHT_DOWN if ( t == wxEVT_LEFT_DOWN || t == wxEVT_RIGHT_DOWN
|| t == wxEVT_MOVE || t == wxEVT_SIZE || t == wxEVT_MOVE || t == wxEVT_SIZE
@@ -98,7 +98,7 @@ void DropDownList::show(bool in_place, wxPoint pos, RealRect* rect) {
dc.SetFont(*wxNORMAL_FONT); dc.SetFont(*wxNORMAL_FONT);
for (size_t i = 0 ; i < count ; ++i) { for (size_t i = 0 ; i < count ; ++i) {
int text_width; int text_width;
dc.GetTextExtent(capitalize(itemText(i)), &text_width, 0); dc.GetTextExtent(capitalize(itemText(i)), &text_width, nullptr);
item_size.width = max(item_size.width, text_width + icon_size.width + 14); // 14 = room for popup arrow + padding item_size.width = max(item_size.width, text_width + icon_size.width + 14); // 14 = room for popup arrow + padding
} }
} }
+2 -2
View File
@@ -127,13 +127,13 @@ private:
const AlphaMask& mask; const AlphaMask& mask;
bool mouse_down; bool mouse_down;
int mouseX, mouseY; ///< starting mouse position int mouseX, mouseY; ///< starting mouse position
wxRect start_selection; ///< selection in slice at start of dragging wxRect start_selection; ///< selection in slice at start of dragging
// --------------------------------------------------- : Events // --------------------------------------------------- : Events
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
wxSize DoGetBestSize() const; wxSize DoGetBestSize() const override;
void onLeftDown(wxMouseEvent&); void onLeftDown(wxMouseEvent&);
void onLeftUp (wxMouseEvent&); void onLeftUp (wxMouseEvent&);
+6 -6
View File
@@ -128,23 +128,23 @@ public:
buffer_size = m_parent_i_stream->LastRead(); buffer_size = m_parent_i_stream->LastRead();
} }
bool IsSeekable() const { return true; } bool IsSeekable() const override { return true; }
protected: protected:
virtual size_t OnSysRead(void *buffer, size_t bufsize) { size_t OnSysRead(void *buffer, size_t bufsize) override {
size_t len = min(buffer_size - buffer_pos, bufsize); size_t len = min(buffer_size - buffer_pos, bufsize);
memcpy(buffer, this->buffer + buffer_pos, len); memcpy(buffer, this->buffer + buffer_pos, len);
buffer_pos += len; buffer_pos += len;
m_parent_i_stream->Read((Byte*)buffer + len, bufsize - len); m_parent_i_stream->Read((Byte*)buffer + len, bufsize - len);
return m_parent_i_stream->LastRead() + len; return m_parent_i_stream->LastRead() + len;
} }
virtual wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode) { wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode) override {
if (mode == wxFromStart) buffer_pos = seek; if (mode == wxFromStart) buffer_pos = seek;
else if (mode == wxFromCurrent) buffer_pos += seek; else if (mode == wxFromCurrent) buffer_pos += seek;
else assert(false); else assert(false);
assert(buffer_pos < buffer_size); assert(buffer_pos < buffer_size);
return buffer_pos; return buffer_pos;
} }
virtual wxFileOffset OnSysTell() const { wxFileOffset OnSysTell() const override {
assert(buffer_pos < buffer_size); assert(buffer_pos < buffer_size);
return buffer_pos; return buffer_pos;
} }
@@ -164,7 +164,7 @@ public:
, list(list), ti(ti) , list(list), ti(ti)
{} {}
virtual Image generate() { Image generate() override {
wxURL url(ti->package->description->icon_url); wxURL url(ti->package->description->icon_url);
unique_ptr<wxInputStream> isP(url.GetInputStream()); unique_ptr<wxInputStream> isP(url.GetInputStream());
if (!isP) return wxImage(); if (!isP) return wxImage();
@@ -172,7 +172,7 @@ public:
Image result(is2); Image result(is2);
return result; return result;
} }
virtual void store(const Image& image) { void store(const Image& image) override {
if (!image.Ok()) return; if (!image.Ok()) return;
ti->setIcon(image); ti->setIcon(image);
list->Refresh(false); list->Refresh(false);
+5 -5
View File
@@ -30,12 +30,12 @@ public:
protected: protected:
// overridden methods from TreeList // overridden methods from TreeList
virtual void initItems(); void initItems() override;
virtual void drawItem(DC& dc, size_t index, size_t column, int x, int y, bool selected) const; void drawItem(DC& dc, size_t index, size_t column, int x, int y, bool selected) const override;
virtual size_t columnCount() const { return 3; } size_t columnCount() const override { return 3; }
virtual String columnText(size_t column) const; String columnText(size_t column) const override;
virtual int columnWidth(size_t column) const; int columnWidth(size_t column) const override;
private: private:
/// The list of packages we are displaying /// The list of packages we are displaying
+2 -2
View File
@@ -57,7 +57,7 @@ private:
wxMutex lock; wxMutex lock;
struct Thread : public wxThread { struct Thread : public wxThread {
virtual ExitCode Entry(); ExitCode Entry() override;
}; };
}; };
@@ -104,7 +104,7 @@ public:
void setPackage(const InstallablePackageP& package); void setPackage(const InstallablePackageP& package);
virtual wxSize DoGetBestSize() const; wxSize DoGetBestSize() const override;
private: private:
InstallablePackageP package; InstallablePackageP package;
+4 -4
View File
@@ -36,7 +36,7 @@ public:
class GlobalPreferencesPage : public PreferencesPage { class GlobalPreferencesPage : public PreferencesPage {
public: public:
GlobalPreferencesPage(Window* parent); GlobalPreferencesPage(Window* parent);
void store(); void store() override;
private: private:
wxComboBox* language; wxComboBox* language;
@@ -47,7 +47,7 @@ private:
class DisplayPreferencesPage : public PreferencesPage { class DisplayPreferencesPage : public PreferencesPage {
public: public:
DisplayPreferencesPage(Window* parent); DisplayPreferencesPage(Window* parent);
void store(); void store() override;
private: private:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
@@ -74,7 +74,7 @@ private:
class DirsPreferencesPage : public PreferencesPage { class DirsPreferencesPage : public PreferencesPage {
public: public:
DirsPreferencesPage(Window* parent); DirsPreferencesPage(Window* parent);
void store(); void store() override;
private: private:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
@@ -88,7 +88,7 @@ private:
class UpdatePreferencesPage : public PreferencesPage { class UpdatePreferencesPage : public PreferencesPage {
public: public:
UpdatePreferencesPage(Window* parent); UpdatePreferencesPage(Window* parent);
void store(); void store() override;
private: private:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
+5 -5
View File
@@ -55,13 +55,13 @@ class CardsPrintout : public wxPrintout {
public: public:
CardsPrintout(PrintJobP const& job); CardsPrintout(PrintJobP const& job);
/// Number of pages, and something else I don't understand... /// Number of pages, and something else I don't understand...
virtual void GetPageInfo(int* pageMin, int* pageMax, int* pageFrom, int* pageTo); void GetPageInfo(int* pageMin, int* pageMax, int* pageFrom, int* pageTo) override;
/// Again, 'number of pages', strange wx interface /// Again, 'number of pages', strange wx interface
virtual bool HasPage(int page); bool HasPage(int page) override;
/// Determine the layout /// Determine the layout
virtual void OnPreparePrinting(); void OnPreparePrinting() override;
/// Print a page /// Print a page
virtual bool OnPrintPage(int page); bool OnPrintPage(int page) override;
private: private:
PrintJobP job; ///< Cards to print PrintJobP job; ///< Cards to print
@@ -175,7 +175,7 @@ PrintJobP make_print_job(Window* parent, const SetP& set, const ExportCardSelect
s2->Add(s3, 1, wxEXPAND | wxALL, 8); s2->Add(s3, 1, wxEXPAND | wxALL, 8);
wxSizer* s4 = new wxStaticBoxSizer(wxVERTICAL, &wnd, L"Settings"); wxSizer* s4 = new wxStaticBoxSizer(wxVERTICAL, &wnd, L"Settings");
s4->Add(space, 1, wxALL | wxALIGN_TOP, 8); s4->Add(space, 1, wxALL | wxALIGN_TOP, 8);
s2->Add(s4, 1, wxEXPAND | wxALL & ~wxLEFT, 8); s2->Add(s4, 1, wxEXPAND | (wxALL & ~wxLEFT), 8);
s->Add(s2, 1, wxEXPAND); s->Add(s2, 1, wxEXPAND);
s->Add(wnd.CreateButtonSizer(wxOK | wxCANCEL) , 0, wxEXPAND | wxALL, 8); s->Add(wnd.CreateButtonSizer(wxOK | wxCANCEL) , 0, wxEXPAND | wxALL, 8);
s->SetSizeHints(&wnd); s->SetSizeHints(&wnd);
+3 -7
View File
@@ -284,13 +284,9 @@ void CardsPanel::onMenuOpen(wxMenuEvent& ev) {
wxMenu* menu = editor->getMenu(ID_INSERT_SYMBOL); wxMenu* menu = editor->getMenu(ID_INSERT_SYMBOL);
if (insertSymbolMenu->GetSubMenu() != menu || (menu && menu->GetParent() != menuFormat)) { if (insertSymbolMenu->GetSubMenu() != menu || (menu && menu->GetParent() != menuFormat)) {
// re-add the menu // re-add the menu
fprintf(stderr,"insert1 %p %p\n", menuFormat,insertSymbolMenu);fflush(stderr);
menuFormat->Remove(ID_INSERT_SYMBOL); menuFormat->Remove(ID_INSERT_SYMBOL);
fprintf(stderr,"insert2\n");fflush(stderr);
insertSymbolMenu->SetSubMenu(menu); insertSymbolMenu->SetSubMenu(menu);
fprintf(stderr,"insert3\n");fflush(stderr);
menuFormat->Append(insertSymbolMenu); menuFormat->Append(insertSymbolMenu);
fprintf(stderr,"insert4\n");fflush(stderr);
} }
} }
@@ -418,7 +414,7 @@ void CardsPanel::doSelectAll() {
class CardsPanel::SearchFindInfo : public FindInfo { class CardsPanel::SearchFindInfo : public FindInfo {
public: public:
SearchFindInfo(CardsPanel& panel, wxFindReplaceData& what) : FindInfo(what), panel(panel) {} SearchFindInfo(CardsPanel& panel, wxFindReplaceData& what) : FindInfo(what), panel(panel) {}
virtual bool handle(const CardP& card, const TextValueP& value, size_t pos, bool was_selection) { bool handle(const CardP& card, const TextValueP& value, size_t pos, bool was_selection) override {
// Select the card // Select the card
panel.card_list->setCard(card); panel.card_list->setCard(card);
return true; return true;
@@ -430,7 +426,7 @@ private:
class CardsPanel::ReplaceFindInfo : public FindInfo { class CardsPanel::ReplaceFindInfo : public FindInfo {
public: public:
ReplaceFindInfo(CardsPanel& panel, wxFindReplaceData& what) : FindInfo(what), panel(panel) {} ReplaceFindInfo(CardsPanel& panel, wxFindReplaceData& what) : FindInfo(what), panel(panel) {}
virtual bool handle(const CardP& card, const TextValueP& value, size_t pos, bool was_selection) { bool handle(const CardP& card, const TextValueP& value, size_t pos, bool was_selection) override {
// Select the card // Select the card
panel.card_list->setCard(card); panel.card_list->setCard(card);
// Replace // Replace
@@ -441,7 +437,7 @@ public:
return true; return true;
} }
} }
virtual bool searchSelection() const { return true; } bool searchSelection() const override { return true; }
private: private:
CardsPanel& panel; CardsPanel& panel;
}; };
+22 -22
View File
@@ -27,27 +27,27 @@ public:
CardsPanel(Window* parent, int id); CardsPanel(Window* parent, int id);
~CardsPanel(); ~CardsPanel();
virtual void onChangeSet(); void onChangeSet() override;
// --------------------------------------------------- : UI // --------------------------------------------------- : UI
virtual void initUI (wxToolBar* tb, wxMenuBar* mb); void initUI (wxToolBar* tb, wxMenuBar* mb) override;
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb); void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
virtual void onUpdateUI(wxUpdateUIEvent&); void onUpdateUI(wxUpdateUIEvent&) override;
virtual void onCommand(int id); void onCommand(int id) override;
virtual void onMenuOpen(wxMenuEvent&); void onMenuOpen(wxMenuEvent&) override;
// --------------------------------------------------- : Actions // --------------------------------------------------- : Actions
virtual bool wantsToHandle(const Action&, bool undone) const; bool wantsToHandle(const Action&, bool undone) const override;
// --------------------------------------------------- : Clipboard // --------------------------------------------------- : Clipboard
virtual bool canCut() const; bool canCut() const override;
virtual bool canCopy() const; bool canCopy() const override;
virtual bool canPaste() const; bool canPaste() const override;
virtual void doCut(); void doCut() override;
virtual void doCopy(); void doCopy() override;
virtual void doPaste(); void doPaste() override;
// --------------------------------------------------- : Text selection // --------------------------------------------------- : Text selection
@@ -56,11 +56,11 @@ public:
// --------------------------------------------------- : Searching (find/replace) // --------------------------------------------------- : Searching (find/replace)
virtual bool canFind() const { return true; } bool canFind() const override { return true; }
virtual bool canReplace() const { return true; } bool canReplace() const override { return true; }
virtual bool doFind (wxFindReplaceData&); bool doFind (wxFindReplaceData&) override;
virtual bool doReplace (wxFindReplaceData&); bool doReplace (wxFindReplaceData&) override;
virtual bool doReplaceAll(wxFindReplaceData&); bool doReplaceAll(wxFindReplaceData&) override;
private: private:
/// Do a search or replace action for the given FindInfo in all cards /// Do a search or replace action for the given FindInfo in all cards
bool search(FindInfo& find, bool from_start); bool search(FindInfo& find, bool from_start);
@@ -71,9 +71,9 @@ private:
public: public:
// --------------------------------------------------- : Selection // --------------------------------------------------- : Selection
virtual CardP selectedCard() const; CardP selectedCard() const override;
virtual void selectCard(const CardP& card); void selectCard(const CardP& card) override;
virtual void selectFirstCard(); void selectFirstCard() override;
private: private:
// --------------------------------------------------- : Controls // --------------------------------------------------- : Controls
@@ -92,7 +92,7 @@ private:
void updateNotesPosition(); void updateNotesPosition();
// before Layout, call updateNotesPosition. // before Layout, call updateNotesPosition.
// NOTE: docs say this function returns void, but the code says bool // NOTE: docs say this function returns void, but the code says bool
virtual bool Layout(); bool Layout() override;
// --------------------------------------------------- : Menus & tools // --------------------------------------------------- : Menus & tools
wxMenu* menuCard, *menuFormat; wxMenu* menuCard, *menuFormat;
+7 -7
View File
@@ -25,16 +25,16 @@ public:
void onIdle(wxIdleEvent&); void onIdle(wxIdleEvent&);
void onEnter(wxCommandEvent&); void onEnter(wxCommandEvent&);
virtual void initUI (wxToolBar* tb, wxMenuBar* mb); void initUI (wxToolBar* tb, wxMenuBar* mb) override;
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb); void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
virtual void onUpdateUI(wxUpdateUIEvent&); void onUpdateUI(wxUpdateUIEvent&) override;
virtual void onCommand(int id); void onCommand(int id) override;
// --------------------------------------------------- : Clipboard // --------------------------------------------------- : Clipboard
virtual bool canCut() const; bool canCut() const override;
virtual bool canCopy() const; bool canCopy() const override;
virtual void doCopy(); void doCopy() override;
protected: protected:
void onChangeSet() override; void onChangeSet() override;
+14 -14
View File
@@ -26,26 +26,26 @@ public:
KeywordsPanel(Window* parent, int id); KeywordsPanel(Window* parent, int id);
~KeywordsPanel(); ~KeywordsPanel();
virtual void onChangeSet(); void onChangeSet() override;
virtual void onAction(const Action&, bool); void onAction(const Action&, bool) override;
// --------------------------------------------------- : UI // --------------------------------------------------- : UI
virtual void initUI (wxToolBar* tb, wxMenuBar* mb); void initUI (wxToolBar* tb, wxMenuBar* mb) override;
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb); void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
virtual void onUpdateUI(wxUpdateUIEvent&); void onUpdateUI(wxUpdateUIEvent&) override;
virtual void onCommand(int id); void onCommand(int id) override;
// --------------------------------------------------- : Clipboard // --------------------------------------------------- : Clipboard
virtual bool canCut() const; bool canCut() const override;
virtual bool canCopy() const; bool canCopy() const override;
virtual bool canPaste() const; bool canPaste() const override;
virtual void doCut(); void doCut() override;
virtual void doCopy(); void doCopy() override;
virtual void doPaste(); void doPaste() override;
virtual bool canSelectAll() const; bool canSelectAll() const override;
virtual void doSelectAll(); void doSelectAll() override;
private: private:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
+1 -1
View File
@@ -51,7 +51,7 @@ public:
/// Should return true if this panel wants to get focus to show an action /// Should return true if this panel wants to get focus to show an action
virtual bool wantsToHandle(const Action&, bool undone) const { return false; } virtual bool wantsToHandle(const Action&, bool undone) const { return false; }
/// Handle an action that changes the current set /// Handle an action that changes the current set
virtual void onAction(const Action&, bool undone) {} virtual void onAction(const Action&, bool undone) override {}
// --------------------------------------------------- : Clipboard // --------------------------------------------------- : Clipboard
virtual bool canPaste() const { return false; } ///< Is pasting possible? virtual bool canPaste() const { return false; } ///< Is pasting possible?
+6 -6
View File
@@ -36,8 +36,8 @@ public:
vector<CardP> cards; vector<CardP> cards;
protected: protected:
virtual void getItems(vector<VoidP>& out) const; void getItems(vector<VoidP>& out) const override;
virtual void onChangeSet(); void onChangeSet() override;
}; };
RandomCardList::RandomCardList(Window* parent, int id, long style) RandomCardList::RandomCardList(Window* parent, int id, long style)
@@ -68,7 +68,7 @@ public:
PackTotalsPanel(Window* parent, int id, PackGenerator& generator, bool show_all = false) PackTotalsPanel(Window* parent, int id, PackGenerator& generator, bool show_all = false)
: wxPanel(parent,id), generator(generator), show_all(show_all) {} : wxPanel(parent,id), generator(generator), show_all(show_all) {}
void setGame(const GameP& game); void setGame(const GameP& game);
virtual wxSize DoGetBestSize() const; virtual wxSize DoGetBestSize() const override;
private: private:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
GameP game; GameP game;
@@ -157,7 +157,7 @@ public:
, interactive(interactive) , interactive(interactive)
, buddy(nullptr) , buddy(nullptr)
{} {}
void draw(DC& dc) { void draw(DC& dc) override {
Color bg = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); Color bg = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
Color fg = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT); Color fg = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT);
// clear background // clear background
@@ -176,7 +176,7 @@ public:
dc.GetTextExtent(label,&w,&h); dc.GetTextExtent(label,&w,&h);
dc.DrawText(interactive && hover ? label + _("...") : label, 2, (s.y-h)/2); dc.DrawText(interactive && hover ? label + _("...") : label, 2, (s.y-h)/2);
} }
wxSize DoGetBestSize() const { wxSize DoGetBestSize() const override {
int w,h; int w,h;
wxClientDC dc(const_cast<SelectableLabel*>(this)); wxClientDC dc(const_cast<SelectableLabel*>(this));
dc.SetFont(*wxNORMAL_FONT); dc.SetFont(*wxNORMAL_FONT);
@@ -186,7 +186,7 @@ public:
void setBuddy(wxWindow* buddy) { void setBuddy(wxWindow* buddy) {
this->buddy = buddy; this->buddy = buddy;
} }
virtual void onClick() { void onClick() override {
if (buddy) buddy->SetFocus(); if (buddy) buddy->SetFocus();
} }
void onDoubleClick(wxMouseEvent&) { void onDoubleClick(wxMouseEvent&) {
+12 -12
View File
@@ -43,24 +43,24 @@ public:
// --------------------------------------------------- : UI // --------------------------------------------------- : UI
virtual void onBeforeChangeSet(); void onBeforeChangeSet() override;
virtual void onChangeSet(); void onChangeSet() override;
virtual void onAction(const Action&, bool undone); void onAction(const Action&, bool undone) override;
virtual void initUI (wxToolBar* tb, wxMenuBar* mb); void initUI (wxToolBar* tb, wxMenuBar* mb) override;
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb); void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
virtual void onUpdateUI(wxUpdateUIEvent&); void onUpdateUI(wxUpdateUIEvent&) override;
virtual void onCommand(int id); void onCommand(int id) override;
// --------------------------------------------------- : Selection // --------------------------------------------------- : Selection
virtual CardP selectedCard() const; CardP selectedCard() const override;
virtual void selectCard(const CardP& card); void selectCard(const CardP& card) override;
virtual void selectionChoices(ExportCardSelectionChoices& out); void selectionChoices(ExportCardSelectionChoices& out) override;
// --------------------------------------------------- : Clipboard // --------------------------------------------------- : Clipboard
virtual bool canCopy() const; bool canCopy() const override;
virtual void doCopy(); void doCopy() override;
private: private:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
+13 -13
View File
@@ -21,24 +21,24 @@ public:
// --------------------------------------------------- : UI // --------------------------------------------------- : UI
virtual void initUI (wxToolBar* tb, wxMenuBar* mb); void initUI (wxToolBar* tb, wxMenuBar* mb) override;
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb); void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
virtual void onUpdateUI(wxUpdateUIEvent&); void onUpdateUI(wxUpdateUIEvent&) override;
virtual void onCommand(int id); void onCommand(int id) override;
// --------------------------------------------------- : Clipboard // --------------------------------------------------- : Clipboard
virtual bool canCut() const; bool canCut() const override;
virtual bool canCopy() const; bool canCopy() const override;
virtual bool canPaste() const; bool canPaste() const override;
virtual bool canSelectAll() const; bool canSelectAll() const override;
virtual void doCut(); void doCut() override;
virtual void doCopy(); void doCopy() override;
virtual void doPaste(); void doPaste() override;
virtual void doSelectAll(); void doSelectAll() override;
protected: protected:
virtual void onChangeSet(); void onChangeSet() override;
private: private:
SetInfoEditor* editor; SetInfoEditor* editor;
+5 -5
View File
@@ -146,14 +146,14 @@ public:
} }
protected: protected:
virtual size_t itemCount() const; size_t itemCount() const override;
virtual void drawItem(DC& dc, int x, int y, size_t item); void drawItem(DC& dc, int x, int y, size_t item) override;
virtual double subcolumnActivity(size_t col) const { double subcolumnActivity(size_t col) const override {
return col-1 >= prefered_dimension_count ? 0.2 : 0.7; return col-1 >= prefered_dimension_count ? 0.2 : 0.7;
} }
virtual void onSelect(size_t item, size_t old_col, bool& changes) { void onSelect(size_t item, size_t old_col, bool& changes) override {
// swap selection with another subcolumn? // swap selection with another subcolumn?
for (size_t j = 1 ; j < subcolumns.size() ; ++j) { for (size_t j = 1 ; j < subcolumns.size() ; ++j) {
if (j != active_subcolumn && subcolumns[j].selection == item && if (j != active_subcolumn && subcolumns[j].selection == item &&
@@ -527,7 +527,7 @@ public:
StatsFilter(GraphData& data, const vector<int> match) { StatsFilter(GraphData& data, const vector<int> match) {
data.indices(match, indices); data.indices(match, indices);
} }
virtual void getItems(const vector<CardP>& cards, vector<VoidP>& out) const { void getItems(const vector<CardP>& cards, vector<VoidP>& out) const override {
FOR_EACH_CONST(idx, indices) { FOR_EACH_CONST(idx, indices) {
out.push_back(cards.at(idx)); out.push_back(cards.at(idx));
} }
+8 -8
View File
@@ -31,17 +31,17 @@ public:
// --------------------------------------------------- : UI // --------------------------------------------------- : UI
virtual void onChangeSet(); void onChangeSet() override;
virtual void onAction(const Action&, bool undone); void onAction(const Action&, bool undone) override;
virtual void initUI (wxToolBar*, wxMenuBar*); void initUI (wxToolBar*, wxMenuBar*) override;
virtual void destroyUI(wxToolBar*, wxMenuBar*); void destroyUI(wxToolBar*, wxMenuBar*) override;
virtual void onUpdateUI(wxUpdateUIEvent&); void onUpdateUI(wxUpdateUIEvent&) override;
virtual void onCommand(int id); void onCommand(int id) override;
// --------------------------------------------------- : Selection // --------------------------------------------------- : Selection
virtual CardP selectedCard() const; CardP selectedCard() const override;
virtual void selectCard(const CardP& card); void selectCard(const CardP& card) override;
// --------------------------------------------------- : Data // --------------------------------------------------- : Data
private: private:
+13 -13
View File
@@ -22,25 +22,25 @@ class StylePanel : public SetWindowPanel {
public: public:
StylePanel(Window* parent, int id); StylePanel(Window* parent, int id);
virtual void onChangeSet(); void onChangeSet() override;
virtual void onAction(const Action&, bool undone); void onAction(const Action&, bool undone) override;
// --------------------------------------------------- : UI // --------------------------------------------------- : UI
virtual void initUI(wxToolBar*, wxMenuBar*); void initUI(wxToolBar*, wxMenuBar*) override;
// --------------------------------------------------- : Clipboard // --------------------------------------------------- : Clipboard
virtual bool canCut() const; bool canCut() const override;
virtual bool canCopy() const; bool canCopy() const override;
virtual bool canPaste() const; bool canPaste() const override;
virtual bool canSelectAll() const; bool canSelectAll() const override;
virtual void doCut(); void doCut() override;
virtual void doCopy(); void doCopy() override;
virtual void doPaste(); void doPaste() override;
virtual void doSelectAll(); void doSelectAll() override;
// --------------------------------------------------- : Selection // --------------------------------------------------- : Selection
virtual void selectCard(const CardP& card); void selectCard(const CardP& card) override;
private: private:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
@@ -58,7 +58,7 @@ private:
/// Determine the best size for the list of stylesheets based on available space /// Determine the best size for the list of stylesheets based on available space
void updateListSize(); void updateListSize();
virtual bool Layout(); bool Layout() override;
/// Actual intialization of the controls /// Actual intialization of the controls
void initControls(); void initControls();
+1 -1
View File
@@ -460,7 +460,7 @@ bool SetWindow::askSaveAndContinue() {
set->actions.setSavePoint(); set->actions.setSavePoint();
return true; return true;
} }
} catch (Error e) { } catch (Error const& e) {
// something went wrong with saving, don't proceed // something went wrong with saving, don't proceed
handle_error(e); handle_error(e);
return false; return false;
+2 -2
View File
@@ -74,9 +74,9 @@ private:
// --------------------------------------------------- : Action related // --------------------------------------------------- : Action related
protected: protected:
/// We want to respond to set changes /// We want to respond to set changes
virtual void onChangeSet(); void onChangeSet() override;
/// Actions that change the set /// Actions that change the set
virtual void onAction(const Action&, bool undone); void onAction(const Action&, bool undone) override;
public: public:
// minSize = mainSizer->getMinWindowSize(this) // minSize = mainSizer->getMinWindowSize(this)
+12 -12
View File
@@ -16,33 +16,33 @@ class wxSpinCtrl;
// ----------------------------------------------------------------------------- : SymbolBasicShapeEditor // ----------------------------------------------------------------------------- : SymbolBasicShapeEditor
/// Editor for drawing basic shapes such as rectangles and polygons /// Editor for drawing basic shapes such as rectangles and polygons
class SymbolBasicShapeEditor : public SymbolEditorBase { class SymbolBasicShapeEditor final : public SymbolEditorBase {
public: public:
SymbolBasicShapeEditor(SymbolControl* control); SymbolBasicShapeEditor(SymbolControl* control);
// --------------------------------------------------- : Drawing // --------------------------------------------------- : Drawing
virtual void draw(DC& dc); void draw(DC& dc) override;
// --------------------------------------------------- : UI // --------------------------------------------------- : UI
virtual void initUI (wxToolBar* tb, wxMenuBar* mb); void initUI (wxToolBar* tb, wxMenuBar* mb) override;
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb); void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
virtual void onUpdateUI(wxUpdateUIEvent&); void onUpdateUI(wxUpdateUIEvent&) override;
virtual void onCommand(int id); void onCommand(int id) override;
virtual int modeToolId(); int modeToolId() override;
// --------------------------------------------------- : Mouse events // --------------------------------------------------- : Mouse events
virtual void onLeftDown (const Vector2D& pos, wxMouseEvent& ev); void onLeftDown (const Vector2D& pos, wxMouseEvent& ev) override;
virtual void onLeftUp (const Vector2D& pos, wxMouseEvent& ev); void onLeftUp (const Vector2D& pos, wxMouseEvent& ev) override;
virtual void onMouseDrag (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev); void onMouseDrag (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev) override;
// --------------------------------------------------- : Other events // --------------------------------------------------- : Other events
virtual void onKeyChange(wxKeyEvent& ev); void onKeyChange(wxKeyEvent& ev) override;
virtual bool isEditing(); bool isEditing() override;
// --------------------------------------------------- : Data // --------------------------------------------------- : Data
private: private:
+2 -2
View File
@@ -26,9 +26,9 @@ class SymbolControl : public wxControl, public SymbolViewer {
public: public:
SymbolControl(SymbolWindow* parent, int id, const SymbolP& symbol); SymbolControl(SymbolWindow* parent, int id, const SymbolP& symbol);
virtual void onChangeSymbol(); void onChangeSymbol() override;
virtual void onAction(const Action&, bool undone); void onAction(const Action&, bool undone) override;
// Forward command to editor // Forward command to editor
void onExtraTool(wxCommandEvent& ev); void onExtraTool(wxCommandEvent& ev);
+4 -4
View File
@@ -31,9 +31,9 @@ public:
SymbolPartList(Window* parent, int id, SymbolPartsSelection& selection, SymbolP symbol = SymbolP()); SymbolPartList(Window* parent, int id, SymbolPartsSelection& selection, SymbolP symbol = SymbolP());
/// Another symbol is being viewed /// Another symbol is being viewed
virtual void onChangeSymbol(); void onChangeSymbol() override;
/// Event handler for changes to the symbol /// Event handler for changes to the symbol
virtual void onAction(const Action&, bool); void onAction(const Action&, bool) override;
/// Update the control /// Update the control
void update(); void update();
@@ -41,7 +41,7 @@ public:
void updateParts(const set<SymbolPartP>& parts); void updateParts(const set<SymbolPartP>& parts);
protected: protected:
virtual wxSize DoGetBestSize() const; wxSize DoGetBestSize() const override;
private: private:
SymbolPartsSelection& selection; ///< Store selection here SymbolPartsSelection& selection; ///< Store selection here
int number_of_items; int number_of_items;
@@ -75,7 +75,7 @@ private:
void onChar(wxKeyEvent& ev); void onChar(wxKeyEvent& ev);
void onPaint(wxPaintEvent&); void onPaint(wxPaintEvent&);
void onSize(wxSizeEvent&); void onSize(wxSizeEvent&);
void OnDraw(DC& dc); void OnDraw(DC& dc) override;
void sendEvent(int type); void sendEvent(int type);
+1 -1
View File
@@ -284,7 +284,7 @@ void SymbolPointEditor::onMouseDrag(const Vector2D& from, const Vector2D& to, wx
Vector2D delta = to - from; Vector2D delta = to - from;
if (selection == SELECTED_LINE && ev.AltDown()) { if (selection == SELECTED_LINE && ev.AltDown()) {
// Drag the curve // Drag the curve
if (controlPointMoveAction) controlPointMoveAction = 0; if (controlPointMoveAction) controlPointMoveAction = nullptr;
if (!curveDragAction) { if (!curveDragAction) {
auto action = make_unique<CurveDragAction>(selected_line1, selected_line2); auto action = make_unique<CurveDragAction>(selected_line1, selected_line2);
curveDragAction = action.get(); curveDragAction = action.get();
+15 -15
View File
@@ -19,13 +19,13 @@ class CurveDragAction;
// Symbol editor for editing control points and handles // Symbol editor for editing control points and handles
class SymbolPointEditor : public SymbolEditorBase { class SymbolPointEditor final : public SymbolEditorBase {
public: public:
SymbolPointEditor(SymbolControl* control, const SymbolShapeP& part); SymbolPointEditor(SymbolControl* control, const SymbolShapeP& part);
// --------------------------------------------------- : Drawing // --------------------------------------------------- : Drawing
virtual void draw(DC& dc); void draw(DC& dc) override;
private: private:
/// Draws a gradient on the selected line to indicate curve dragging /// Draws a gradient on the selected line to indicate curve dragging
@@ -56,25 +56,25 @@ private:
public: public:
// --------------------------------------------------- : UI // --------------------------------------------------- : UI
virtual void initUI (wxToolBar* tb, wxMenuBar* mb); void initUI (wxToolBar* tb, wxMenuBar* mb) override;
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb); void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
virtual void onUpdateUI(wxUpdateUIEvent&); void onUpdateUI(wxUpdateUIEvent&) override;
virtual void onCommand(int id); void onCommand(int id) override;
virtual int modeToolId(); int modeToolId() override;
// --------------------------------------------------- : Mouse events // --------------------------------------------------- : Mouse events
virtual void onLeftDown (const Vector2D& pos, wxMouseEvent& ev); void onLeftDown (const Vector2D& pos, wxMouseEvent& ev) override;
virtual void onLeftUp (const Vector2D& pos, wxMouseEvent& ev); void onLeftUp (const Vector2D& pos, wxMouseEvent& ev) override;
virtual void onLeftDClick(const Vector2D& pos, wxMouseEvent& ev); void onLeftDClick(const Vector2D& pos, wxMouseEvent& ev) override;
virtual void onMouseMove(const Vector2D& from, const Vector2D& to, wxMouseEvent& ev); void onMouseMove(const Vector2D& from, const Vector2D& to, wxMouseEvent& ev) override;
virtual void onMouseDrag(const Vector2D& from, const Vector2D& to, wxMouseEvent& ev); void onMouseDrag(const Vector2D& from, const Vector2D& to, wxMouseEvent& ev) override;
// --------------------------------------------------- : Other events // --------------------------------------------------- : Other events
virtual void onKeyChange(wxKeyEvent& ev); void onKeyChange(wxKeyEvent& ev) override;
virtual void onChar(wxKeyEvent& ev); void onChar(wxKeyEvent& ev) override;
virtual bool isEditing(); bool isEditing() override;
private: private:
// --------------------------------------------------- : Data // --------------------------------------------------- : Data
+15 -15
View File
@@ -19,13 +19,13 @@ DECLARE_POINTER_TYPE(SymbolPartShearAction);
// ----------------------------------------------------------------------------- : SymbolSelectEditor // ----------------------------------------------------------------------------- : SymbolSelectEditor
/// Editor that allows the user to select symbol parts /// Editor that allows the user to select symbol parts
class SymbolSelectEditor : public SymbolEditorBase { class SymbolSelectEditor final : public SymbolEditorBase {
public: public:
SymbolSelectEditor(SymbolControl* control, bool rotate); SymbolSelectEditor(SymbolControl* control, bool rotate);
// --------------------------------------------------- : Drawing // --------------------------------------------------- : Drawing
virtual void draw(DC& dc); void draw(DC& dc) override;
private: private:
/// Draw handles on all sides /// Draw handles on all sides
@@ -39,26 +39,26 @@ private:
public: public:
// --------------------------------------------------- : UI // --------------------------------------------------- : UI
virtual void initUI (wxToolBar* tb, wxMenuBar* mb); void initUI (wxToolBar* tb, wxMenuBar* mb) override;
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb); void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
virtual void onUpdateUI(wxUpdateUIEvent&); void onUpdateUI(wxUpdateUIEvent&) override;
virtual void onCommand(int id); void onCommand(int id) override;
virtual int modeToolId(); int modeToolId() override;
// --------------------------------------------------- : Mouse events // --------------------------------------------------- : Mouse events
virtual void onLeftDown (const Vector2D& pos, wxMouseEvent& ev); void onLeftDown (const Vector2D& pos, wxMouseEvent& ev) override;
virtual void onLeftDClick (const Vector2D& pos, wxMouseEvent& ev); void onLeftDClick (const Vector2D& pos, wxMouseEvent& ev) override;
virtual void onLeftUp (const Vector2D& pos, wxMouseEvent& ev); void onLeftUp (const Vector2D& pos, wxMouseEvent& ev) override;
virtual void onMouseMove (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev); void onMouseMove (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev) override;
virtual void onMouseDrag (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev); void onMouseDrag (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev) override;
// --------------------------------------------------- : Other events // --------------------------------------------------- : Other events
virtual void onKeyChange (wxKeyEvent& ev); void onKeyChange (wxKeyEvent& ev) override;
virtual void onChar (wxKeyEvent& ev); void onChar (wxKeyEvent& ev) override;
virtual bool isEditing(); bool isEditing() override;
private: private:
// The part under the mouse cursor // The part under the mouse cursor
+13 -13
View File
@@ -17,35 +17,35 @@ class SymmetryMoveAction;
// ----------------------------------------------------------------------------- : SymbolSymmetryEditor // ----------------------------------------------------------------------------- : SymbolSymmetryEditor
/// Editor for adding symmetries /// Editor for adding symmetries
class SymbolSymmetryEditor : public SymbolEditorBase { class SymbolSymmetryEditor final : public SymbolEditorBase {
public: public:
/** The symmetry parameter is optional, if it is not set, then only new ones can be created */ /** The symmetry parameter is optional, if it is not set, then only new ones can be created */
SymbolSymmetryEditor(SymbolControl* control, const SymbolSymmetryP& symmetry); SymbolSymmetryEditor(SymbolControl* control, const SymbolSymmetryP& symmetry);
// --------------------------------------------------- : Drawing // --------------------------------------------------- : Drawing
virtual void draw(DC& dc); void draw(DC& dc) override;
// --------------------------------------------------- : UI // --------------------------------------------------- : UI
virtual void initUI (wxToolBar* tb, wxMenuBar* mb); void initUI (wxToolBar* tb, wxMenuBar* mb) override;
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb); void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
virtual void onUpdateUI(wxUpdateUIEvent&); void onUpdateUI(wxUpdateUIEvent&) override;
virtual void onCommand(int id); void onCommand(int id) override;
virtual int modeToolId(); int modeToolId() override;
// --------------------------------------------------- : Mouse events // --------------------------------------------------- : Mouse events
virtual void onLeftDown (const Vector2D& pos, wxMouseEvent& ev); void onLeftDown (const Vector2D& pos, wxMouseEvent& ev) override;
virtual void onLeftUp (const Vector2D& pos, wxMouseEvent& ev); void onLeftUp (const Vector2D& pos, wxMouseEvent& ev) override;
virtual void onMouseMove (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev); void onMouseMove (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev) override;
virtual void onMouseDrag (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev); void onMouseDrag (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev) override;
// --------------------------------------------------- : Other events // --------------------------------------------------- : Other events
virtual void onKeyChange(wxKeyEvent& ev); void onKeyChange(wxKeyEvent& ev) override;
virtual bool isEditing(); bool isEditing() override;
// --------------------------------------------------- : Data // --------------------------------------------------- : Data
private: private:
+1 -1
View File
@@ -42,7 +42,7 @@ class ThumbnailThreadWorker : public wxThread {
public: public:
ThumbnailThreadWorker(ThumbnailThread* parent); ThumbnailThreadWorker(ThumbnailThread* parent);
virtual ExitCode Entry(); ExitCode Entry() override;
ThumbnailRequestP current; ///< Request we are working on ThumbnailRequestP current; ///< Request we are working on
ThumbnailThread* parent; ThumbnailThread* parent;
+2 -2
View File
@@ -91,7 +91,7 @@ bool update_available() {
// If not, displays a message // If not, displays a message
class CheckUpdateThread : public wxThread { class CheckUpdateThread : public wxThread {
public: public:
virtual void* Entry() { void* Entry() override {
Work(); Work();
return 0; return 0;
} }
@@ -170,7 +170,7 @@ struct HtmlWindowToBrowser : public wxHtmlWindow {
: wxHtmlWindow(parent, id, pos, size, flags) : wxHtmlWindow(parent, id, pos, size, flags)
{} {}
virtual void OnLinkClicked(const wxHtmlLinkInfo& info) { void OnLinkClicked(const wxHtmlLinkInfo& info) override {
wxLaunchDefaultBrowser( info.GetHref() ); wxLaunchDefaultBrowser( info.GetHref() );
} }
}; };
+3 -3
View File
@@ -22,11 +22,11 @@ const double min_item_size = thumbnail_size;
class ChoiceThumbnailRequest : public ThumbnailRequest { class ChoiceThumbnailRequest : public ThumbnailRequest {
public: public:
ChoiceThumbnailRequest(ValueViewer* cve, int id, bool from_disk, bool thread_safe); ChoiceThumbnailRequest(ValueViewer* cve, int id, bool from_disk, bool thread_safe);
virtual Image generate(); Image generate() override;
virtual void store(const Image&); void store(const Image&) override;
bool isThreadSafe; bool isThreadSafe;
virtual bool threadSafe() const {return isThreadSafe;} bool threadSafe() const override {return isThreadSafe;}
private: private:
int id; int id;
+9 -9
View File
@@ -25,12 +25,12 @@ public:
~ChoiceValueEditor(); ~ChoiceValueEditor();
// --------------------------------------------------- : Events // --------------------------------------------------- : Events
virtual bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev); bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev) override;
virtual bool onChar(wxKeyEvent& ev); bool onChar(wxKeyEvent& ev) override;
virtual void onLoseFocus(); void onLoseFocus() override;
virtual void draw(RotatedDC& dc); void draw(RotatedDC& dc) override;
virtual void determineSize(bool); void determineSize(bool) override;
private: private:
DropDownListP drop_down; DropDownListP drop_down;
@@ -93,9 +93,9 @@ public:
DropDownChoiceList(Window* parent, bool is_submenu, ValueViewer& cve, ChoiceField::ChoiceP group); DropDownChoiceList(Window* parent, bool is_submenu, ValueViewer& cve, ChoiceField::ChoiceP group);
protected: protected:
virtual void onShow(); void onShow() override;
virtual void select(size_t item); void select(size_t item) override;
virtual size_t selection() const; size_t selection() const override;
virtual DropDownList* createSubMenu(ChoiceField::ChoiceP group) const; DropDownList* createSubMenu(ChoiceField::ChoiceP group) const override;
}; };
+7 -7
View File
@@ -20,14 +20,14 @@ class DropDownColorList : public DropDownList {
public: public:
DropDownColorList(Window* parent, ColorValueEditor& cve); DropDownColorList(Window* parent, ColorValueEditor& cve);
protected: protected:
virtual size_t itemCount() const; size_t itemCount() const override;
virtual bool lineBelow(size_t item) const; bool lineBelow(size_t item) const override;
virtual String itemText(size_t item) const; String itemText(size_t item) const override;
virtual void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const; void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const override;
virtual void select(size_t item); void select(size_t item) override;
virtual size_t selection() const; size_t selection() const override;
private: private:
ColorValueEditor& cve; ColorValueEditor& cve;
+5 -5
View File
@@ -22,12 +22,12 @@ public:
DECLARE_VALUE_EDITOR(Color); DECLARE_VALUE_EDITOR(Color);
// --------------------------------------------------- : Events // --------------------------------------------------- : Events
virtual bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev); bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev) override;
virtual bool onChar(wxKeyEvent& ev); bool onChar(wxKeyEvent& ev) override;
virtual void onLoseFocus(); void onLoseFocus() override;
virtual void draw(RotatedDC& dc); void draw(RotatedDC& dc) override;
virtual void determineSize(bool); void determineSize(bool) override;
private: private:
DropDownListP drop_down; DropDownListP drop_down;
+4 -4
View File
@@ -138,13 +138,13 @@ protected:
#define DECLARE_VALUE_EDITOR(Type) \ #define DECLARE_VALUE_EDITOR(Type) \
Type##ValueEditor(DataEditor& parent, const Type##StyleP& style); \ Type##ValueEditor(DataEditor& parent, const Type##StyleP& style); \
virtual ValueEditor* getEditor() { return this; } \ ValueEditor* getEditor() override { return this; } \
private: \ private: \
/** Retrieve the parent editor object */ \ /** Retrieve the parent editor object */ \
inline DataEditor& editor() const { \ inline DataEditor& editor() const override { \
return static_cast<DataEditor&>(viewer); \ return static_cast<DataEditor&>(viewer); \
} \ } \
public: public:
#define IMPLEMENT_VALUE_EDITOR(Type) \ #define IMPLEMENT_VALUE_EDITOR(Type) \
ValueViewerP Type##Style::makeEditor(DataEditor& parent) { \ ValueViewerP Type##Style::makeEditor(DataEditor& parent) { \
+7 -7
View File
@@ -19,17 +19,17 @@ class ImageValueEditor : public ImageValueViewer, public ValueEditor {
public: public:
DECLARE_VALUE_EDITOR(Image); DECLARE_VALUE_EDITOR(Image);
virtual bool onLeftDClick(const RealPoint&, wxMouseEvent&); bool onLeftDClick(const RealPoint&, wxMouseEvent&) override;
// --------------------------------------------------- : Clipboard // --------------------------------------------------- : Clipboard
virtual bool canCopy() const; bool canCopy() const override;
virtual bool canPaste() const; bool canPaste() const override;
virtual bool doCopy(); bool doCopy() override;
virtual bool doPaste(); bool doPaste() override;
virtual bool doDelete(); bool doDelete() override;
virtual bool onChar(wxKeyEvent&); bool onChar(wxKeyEvent&) override;
private: private:
// Open the image slice window showing the give image // Open the image slice window showing the give image
+2 -2
View File
@@ -19,7 +19,7 @@ class InfoValueEditor : public InfoValueViewer, public ValueEditor {
public: public:
DECLARE_VALUE_EDITOR(Info); DECLARE_VALUE_EDITOR(Info);
virtual void determineSize(bool); void determineSize(bool) override;
virtual bool drawLabel() const { return false; } bool drawLabel() const override { return false; }
}; };
+5 -5
View File
@@ -21,13 +21,13 @@ public:
DECLARE_VALUE_EDITOR(MultipleChoice); DECLARE_VALUE_EDITOR(MultipleChoice);
~MultipleChoiceValueEditor(); ~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); bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev) override;
virtual bool onChar(wxKeyEvent& ev); bool onChar(wxKeyEvent& ev) override;
virtual void onLoseFocus(); void onLoseFocus() override;
private: private:
DropDownListP drop_down; DropDownListP drop_down;
+6 -6
View File
@@ -20,12 +20,12 @@ public:
DropDownPackageChoiceList(Window* parent, PackageChoiceValueEditor* editor); DropDownPackageChoiceList(Window* parent, PackageChoiceValueEditor* editor);
protected: protected:
virtual size_t itemCount() const; size_t itemCount() const override;
virtual String itemText(size_t item) const; String itemText(size_t item) const override;
virtual bool lineBelow(size_t item) const; bool lineBelow(size_t item) const override;
virtual void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const; void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const override;
virtual void select(size_t selection); void select(size_t selection) override;
virtual size_t selection() const; size_t selection() const override;
private: private:
PackageChoiceValueEditor& editor; PackageChoiceValueEditor& editor;
+5 -5
View File
@@ -21,11 +21,11 @@ class PackageChoiceValueEditor : public PackageChoiceValueViewer, public ValueEd
public: public:
DECLARE_VALUE_EDITOR(PackageChoice); DECLARE_VALUE_EDITOR(PackageChoice);
virtual void draw(RotatedDC& dc); void draw(RotatedDC& dc) override;
virtual void determineSize(bool force_fit); void determineSize(bool force_fit) override;
virtual bool onLeftDown (const RealPoint& pos, wxMouseEvent& ev); bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev) override;
virtual bool onChar(wxKeyEvent& ev); bool onChar(wxKeyEvent& ev) override;
virtual void onLoseFocus(); void onLoseFocus() override;
private: private:
DropDownListP drop_down; DropDownListP drop_down;
+6 -6
View File
@@ -21,12 +21,12 @@ class SymbolValueEditor : public SymbolValueViewer, public ValueEditor {
public: public:
DECLARE_VALUE_EDITOR(Symbol); DECLARE_VALUE_EDITOR(Symbol);
virtual void draw(RotatedDC& dc); void draw(RotatedDC& dc) override;
virtual bool onLeftDown (const RealPoint& pos, wxMouseEvent&); bool onLeftDown (const RealPoint& pos, wxMouseEvent&) override;
virtual bool onLeftUp (const RealPoint& pos, wxMouseEvent&); bool onLeftUp (const RealPoint& pos, wxMouseEvent&) override;
virtual bool onLeftDClick(const RealPoint& pos, wxMouseEvent&); bool onLeftDClick(const RealPoint& pos, wxMouseEvent&) override;
virtual bool onMotion (const RealPoint& pos, wxMouseEvent&); bool onMotion (const RealPoint& pos, wxMouseEvent&) override;
virtual void determineSize(bool); void determineSize(bool) override;
private: private:
/// Draw a button, buttons are numbered from the right /// Draw a button, buttons are numbered from the right
void drawButton(RotatedDC& dc, int button, const String& text); void drawButton(RotatedDC& dc, int button, const String& text);
+10 -10
View File
@@ -116,15 +116,15 @@ public:
inline WordListPosP getPos() const { return pos; } inline WordListPosP getPos() const { return pos; }
protected: protected:
virtual void redrawArrowOnParent(); void redrawArrowOnParent() override;
virtual size_t itemCount() const { return items.size(); } size_t itemCount() const override { return items.size(); }
virtual bool lineBelow(size_t item) const { return items[item].flags & FLAG_LINE_BELOW; } bool lineBelow(size_t item) const override { return items[item].flags & FLAG_LINE_BELOW; }
virtual String itemText(size_t item) const { return items[item].name; } String itemText(size_t item) const override { return items[item].name; }
virtual void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const; void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const override;
virtual DropDownList* submenu(size_t item) const; DropDownList* submenu(size_t item) const override;
virtual size_t selection() const; size_t selection() const override;
virtual void select(size_t item); void select(size_t item) override;
virtual bool stayOpen(size_t selection) const; bool stayOpen(size_t selection) const override;
private: private:
TextValueEditor& tve; TextValueEditor& tve;
WordListPosP pos; WordListPosP pos;
@@ -887,7 +887,7 @@ void TextValueEditor::showCaret() {
// TODO : high quality? // TODO : high quality?
dc.SetFont(style().font.toWxFont(1.0)); dc.SetFont(style().font.toWxFont(1.0));
int hi; int hi;
dc.GetTextExtent(_(" "), 0, &hi); dc.GetTextExtent(_(" "), nullptr, &hi);
#ifdef __WXGTK__ #ifdef __WXGTK__
// HACK: Some fonts don't get the descender height set correctly. // HACK: Some fonts don't get the descender height set correctly.
int charHeight = dc.GetCharHeight(); int charHeight = dc.GetCharHeight();
+36 -36
View File
@@ -34,67 +34,67 @@ public:
// --------------------------------------------------- : Events // --------------------------------------------------- : Events
virtual void onFocus(); void onFocus() override;
virtual void onLoseFocus(); void onLoseFocus() override;
virtual bool onLeftDown (const RealPoint& pos, wxMouseEvent&); bool onLeftDown (const RealPoint& pos, wxMouseEvent&) override;
virtual bool onLeftUp (const RealPoint& pos, wxMouseEvent&); bool onLeftUp (const RealPoint& pos, wxMouseEvent&) override;
virtual bool onLeftDClick(const RealPoint& pos, wxMouseEvent&); bool onLeftDClick(const RealPoint& pos, wxMouseEvent&) override;
virtual bool onRightDown (const RealPoint& pos, wxMouseEvent&); bool onRightDown (const RealPoint& pos, wxMouseEvent&) override;
virtual bool onMotion (const RealPoint& pos, wxMouseEvent&); bool onMotion (const RealPoint& pos, wxMouseEvent&) override;
virtual void onMouseLeave(const RealPoint& pos, wxMouseEvent&); void onMouseLeave(const RealPoint& pos, wxMouseEvent&) override;
virtual bool onMouseWheel(const RealPoint& pos, wxMouseEvent&); bool onMouseWheel(const RealPoint& pos, wxMouseEvent&) override;
virtual bool onContextMenu(wxMenu& m, wxContextMenuEvent&); bool onContextMenu(wxMenu& m, wxContextMenuEvent&) override;
virtual wxMenu* getMenu(int type) const; wxMenu* getMenu(int type) const override;
virtual bool onCommand(int); bool onCommand(int) override;
virtual bool onChar(wxKeyEvent&); bool onChar(wxKeyEvent&) override;
// --------------------------------------------------- : Actions // --------------------------------------------------- : Actions
virtual void onValueChange(); void onValueChange() override;
virtual void onAction(const Action&, bool undone); void onAction(const Action&, bool undone) override;
// --------------------------------------------------- : Clipboard // --------------------------------------------------- : Clipboard
virtual bool canCopy() const; bool canCopy() const override;
virtual bool canPaste() const; bool canPaste() const override;
virtual bool doCopy(); bool doCopy() override;
virtual bool doPaste(); bool doPaste() override;
virtual bool doDelete(); bool doDelete() override;
// --------------------------------------------------- : Formating // --------------------------------------------------- : Formating
virtual bool canFormat(int type) const; bool canFormat(int type) const override;
virtual bool hasFormat(int type) const; bool hasFormat(int type) const override;
virtual void doFormat(int type); void doFormat(int type) override;
// --------------------------------------------------- : Selection // --------------------------------------------------- : Selection
virtual bool canSelectAll() const { return true; } bool canSelectAll() const override { return true; }
virtual void doSelectAll(); void doSelectAll() override;
virtual void select(size_t start, size_t end); void select(size_t start, size_t end) override;
virtual size_t selectionStart() const { return selection_start; } size_t selectionStart() const override { return selection_start; }
virtual size_t selectionEnd() const { return selection_end; } 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 // --------------------------------------------------- : Search/replace
virtual bool search(FindInfo& find, bool from_start); bool search(FindInfo& find, bool from_start) override;
private: private:
bool matchSubstr(const String& s, size_t pos, FindInfo& find); bool matchSubstr(const String& s, size_t pos, FindInfo& find);
public: public:
// --------------------------------------------------- : Other // --------------------------------------------------- : Other
virtual wxCursor cursor(const RealPoint& pos) const; wxCursor cursor(const RealPoint& pos) const override;
virtual void determineSize(bool force_fit = false); void determineSize(bool force_fit = false) override;
virtual bool containsPoint(const RealPoint& p) const; bool containsPoint(const RealPoint& p) const override;
virtual RealRect boundingBox() const; RealRect boundingBox() const override;
virtual void onShow(bool); void onShow(bool) override;
virtual void draw(RotatedDC&); void draw(RotatedDC&) override;
// --------------------------------------------------- : Data // --------------------------------------------------- : Data
private: private:
+1 -1
View File
@@ -63,6 +63,6 @@ private:
wxFont font_large, font_small; wxFont font_large, font_small;
protected: protected:
virtual void draw(DC& dc); void draw(DC& dc) override;
}; };
+6 -6
View File
@@ -38,23 +38,23 @@ ScriptValueP export_set(SetP const& set, vector<CardP> const& cards, ExportTempl
class MSE : public wxApp { class MSE : public wxApp {
public: public:
/// Do nothing. The command line parsing, etc. is done in OnRun /// Do nothing. The command line parsing, etc. is done in OnRun
bool OnInit() { return true; } bool OnInit() override { return true; }
/// Main startup function of the program /// Main startup function of the program
/** Use OnRun instead of OnInit, so we can determine whether or not we need a main loop /** Use OnRun instead of OnInit, so we can determine whether or not we need a main loop
* Also, OnExit is always run. * Also, OnExit is always run.
*/ */
int OnRun(); int OnRun() override;
/// Actually start the GUI mainloop /// Actually start the GUI mainloop
int runGUI(); int runGUI();
/// On exit: write the settings to the config file /// On exit: write the settings to the config file
int OnExit(); int OnExit() override;
/// On exception: display error message /// On exception: display error message
void HandleEvent(wxEvtHandler *handler, wxEventFunction func, wxEvent& event) const; void HandleEvent(wxEvtHandler *handler, wxEventFunction func, wxEvent& event) const override;
/// Hack around some wxWidget idiocies /// Hack around some wxWidget idiocies
int FilterEvent(wxEvent& ev); int FilterEvent(wxEvent& ev) override;
/// Fancier assert /// Fancier assert
#if defined(_MSC_VER) && defined(_DEBUG) && defined(_CRT_WIDE) #if defined(_MSC_VER) && defined(_DEBUG) && defined(_CRT_WIDE)
void OnAssert(const wxChar *file, int line, const wxChar *cond, const wxChar *msg); void OnAssert(const wxChar *file, int line, const wxChar *cond, const wxChar *msg) override;
#endif #endif
}; };
+2 -2
View File
@@ -69,7 +69,7 @@ class DataViewer : public SetView {
void setCard(const CardP& card, bool refresh = false); void setCard(const CardP& card, bool refresh = false);
/// Clear data /// Clear data
virtual void onChangeSet(); void onChangeSet() override;
// --------------------------------------------------- : The viewers // --------------------------------------------------- : The viewers
private: private:
@@ -88,7 +88,7 @@ protected:
virtual ValueViewerP makeViewer(const StyleP&); virtual ValueViewerP makeViewer(const StyleP&);
/// Update the viewers and forward actions /// Update the viewers and forward actions
virtual void onAction(const Action&, bool undone); void onAction(const Action&, bool undone) override;
/// Notification that the total image has changed /// Notification that the total image has changed
virtual void onChange() {} virtual void onChange() {}
+9 -9
View File
@@ -62,9 +62,9 @@ public:
inline SolidFillSymbolFilter(const Color& fill_color, const Color& border_color) inline SolidFillSymbolFilter(const Color& fill_color, const Color& border_color)
: fill_color(fill_color), border_color(border_color) : fill_color(fill_color), border_color(border_color)
{} {}
virtual Color color(double x, double y, SymbolSet point) const; Color color(double x, double y, SymbolSet point) const override;
virtual String fillType() const; String fillType() const override;
virtual bool operator == (const SymbolFilter& that) const; bool operator == (const SymbolFilter& that) const override;
private: private:
Color fill_color, border_color; Color fill_color, border_color;
DECLARE_REFLECTION_OVERRIDE(); DECLARE_REFLECTION_OVERRIDE();
@@ -95,9 +95,9 @@ public:
LinearGradientSymbolFilter(const Color& fill_color_1, const Color& border_color_1, const Color& fill_color_2, const Color& border_color_2 LinearGradientSymbolFilter(const Color& fill_color_1, const Color& border_color_1, const Color& fill_color_2, const Color& border_color_2
,double center_x, double center_y, double end_x, double end_y); ,double center_x, double center_y, double end_x, double end_y);
virtual Color color(double x, double y, SymbolSet point) const; Color color(double x, double y, SymbolSet point) const override;
virtual String fillType() const; String fillType() const override;
virtual bool operator == (const SymbolFilter& that) const; bool operator == (const SymbolFilter& that) const override;
/// return time on the gradient, used by GradientSymbolFilter::color /// return time on the gradient, used by GradientSymbolFilter::color
inline double t(double x, double y) const; inline double t(double x, double y) const;
@@ -117,9 +117,9 @@ public:
: GradientSymbolFilter(fill_color_1, border_color_1, fill_color_2, border_color_2) : GradientSymbolFilter(fill_color_1, border_color_1, fill_color_2, border_color_2)
{} {}
virtual Color color(double x, double y, SymbolSet point) const; Color color(double x, double y, SymbolSet point) const override;
virtual String fillType() const; String fillType() const override;
virtual bool operator == (const SymbolFilter& that) const; bool operator == (const SymbolFilter& that) const override;
/// return time on the gradient, used by GradientSymbolFilter::color /// return time on the gradient, used by GradientSymbolFilter::color
inline double t(double x, double y) const; inline double t(double x, double y) const;
+1 -1
View File
@@ -58,7 +58,7 @@ public:
void drawEditingHints(DC& dc); void drawEditingHints(DC& dc);
void onAction(const Action&, bool) {} void onAction(const Action&, bool) override {}
private: private:
+3 -3
View File
@@ -19,9 +19,9 @@ class ChoiceValueViewer : public ValueViewer {
public: public:
DECLARE_VALUE_VIEWER(Choice) : ValueViewer(parent,style) {} DECLARE_VALUE_VIEWER(Choice) : ValueViewer(parent,style) {}
virtual bool prepare(RotatedDC& dc); bool prepare(RotatedDC& dc) override;
virtual void draw(RotatedDC& dc); void draw(RotatedDC& dc) override;
virtual void onStyleChange(int); void onStyleChange(int) override;
}; };
bool prepare_choice_viewer(RotatedDC& dc, ValueViewer& viewer, ChoiceStyle& style, const String& value); bool prepare_choice_viewer(RotatedDC& dc, ValueViewer& viewer, ChoiceStyle& style, const String& value);
+2 -2
View File
@@ -21,7 +21,7 @@ class ColorValueViewer : public ValueViewer {
public: public:
DECLARE_VALUE_VIEWER(Color) : ValueViewer(parent,style) {} DECLARE_VALUE_VIEWER(Color) : ValueViewer(parent,style) {}
virtual void draw(RotatedDC& dc); void draw(RotatedDC& dc) override;
virtual bool containsPoint(const RealPoint& p) const; bool containsPoint(const RealPoint& p) const override;
}; };

Some files were not shown because too many files have changed in this diff Show More