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
+4 -4
View File
@@ -41,7 +41,7 @@ class HoverButtonBase : public wxControl {
public:
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; }
@@ -90,14 +90,14 @@ private:
Bitmap bg_normal, bg_hover, bg_focus, bg_down; ///< Bitmaps for the states of the button
Color background;
virtual wxSize DoGetBestSize() const;
wxSize DoGetBestSize() const override;
const Bitmap* last_drawn;
const Bitmap* toDraw() const;
protected:
int drawDelta() const;
virtual void refreshIfNeeded();
virtual void draw(DC& dc);
void refreshIfNeeded() override;
void draw(DC& dc) override;
};
+7 -7
View File
@@ -47,24 +47,24 @@ public:
protected:
/// 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
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)
virtual void sendEvent();
void sendEvent() override;
/// Compare items
virtual bool compareItems(void* a, void* b) const;
virtual bool mustSort() const { return true; }
bool compareItems(void* a, void* b) const override;
bool mustSort() const override { return true; }
/// Get the text of an item in a specific column
/** 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
/** Overrides a function from wxListCtrl */
virtual int OnGetItemImage(long pos) const;
int OnGetItemImage(long pos) const override;
/// Get the color for an item
virtual wxListItemAttr* OnGetItemAttr(long pos) const;
wxListItemAttr* OnGetItemAttr(long pos) const override;
mutable wxListItemAttr item_attr; // for OnGetItemAttr
};
+2 -2
View File
@@ -122,8 +122,8 @@ struct CompareTabOrder {
assert(a && b);
Style& as = *a->getStyle(), &bs = *b->getStyle();
// if tab_index differs, use that
if (as.tab_index < as.tab_index) return true;
if (as.tab_index > as.tab_index) return false;
if (as.tab_index < bs.tab_index) return true;
if (as.tab_index > bs.tab_index) return false;
// otherwise look at the positions
// 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
+6 -6
View File
@@ -23,10 +23,10 @@ public:
// --------------------------------------------------- : Utility for ValueViewers/Editors
virtual DrawWhat drawWhat(const ValueViewer*) const;
virtual bool viewerIsCurrent(const ValueViewer*) const;
DrawWhat drawWhat(const ValueViewer*) const override;
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; }
// --------------------------------------------------- : Selection
@@ -42,7 +42,7 @@ public:
/// Select the previous editable editor, returns false if the current editor is the first one
bool selectPrevious();
virtual bool AcceptsFocus() const;
bool AcceptsFocus() const override;
/// The next window in the tab order (optional)
const wxWindow* next_in_tab_order;
@@ -90,9 +90,9 @@ public:
protected:
/// 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
ValueViewer* current_viewer; ///< The currently selected viewer
+17 -17
View File
@@ -69,20 +69,20 @@ public:
// --------------------------------------------------- : Clipboard
bool canCut() const;
bool canCopy() const;
bool canPaste() const;
bool canDelete() const;
bool canCut() const override;
bool canCopy() const override;
bool canPaste() const override;
bool canDelete() const override;
// Try to perform a clipboard operation, return success
bool doCopy();
bool doPaste();
bool doDelete();
bool doCopy() override;
bool doPaste() override;
bool doDelete() override;
// --------------------------------------------------- : Set actions
virtual void onBeforeChangeSet();
virtual void onChangeSet();
virtual void onAction(const Action&, bool undone);
void onBeforeChangeSet() override;
void onChangeSet() override;
void onAction(const Action&, bool undone) override;
// --------------------------------------------------- : The cards
public:
@@ -92,7 +92,7 @@ public:
void getSelection(vector<CardP>& out) const;
protected:
/// 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)
void rebuild();
@@ -101,24 +101,24 @@ protected:
/// Can the card list be modified?
virtual bool allowModify() const { return false; }
/// 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)
virtual void sendEvent() { sendEvent(EVENT_CARD_SELECT); }
void sendEvent() override { sendEvent(EVENT_CARD_SELECT); }
void sendEvent(int type = EVENT_CARD_SELECT);
/// Compare cards
virtual bool compareItems(void* a, void* b) const;
bool compareItems(void* a, void* b) const override;
// --------------------------------------------------- : Item 'events'
/// Get the text of an item in a specific column
/** 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
/** Overrides a function from wxListCtrl */
virtual int OnGetItemImage(long pos) const;
int OnGetItemImage(long pos) const override;
/// Get the color for an item
virtual wxListItemAttr* OnGetItemAttr(long pos) const;
wxListItemAttr* OnGetItemAttr(long pos) const override;
// --------------------------------------------------- : Data
private:
+7 -7
View File
@@ -32,24 +32,24 @@ public:
/// Invalidate and redraw the entire viewer
void redraw();
/// Invalidate and redraw (the area of) a single value viewer
virtual void redraw(const ValueViewer&);
void redraw(const ValueViewer&) override;
/// 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:
/// Return the desired size of control
virtual wxSize DoGetBestSize() const;
wxSize DoGetBestSize() const override;
virtual void onChange();
virtual void onChangeSize();
void onChange() override;
void onChangeSize() override;
/// Should the given viewer be drawn?
bool shouldDraw(const ValueViewer&) const;
virtual void drawViewer(RotatedDC& dc, ValueViewer& v);
void drawViewer(RotatedDC& dc, ValueViewer& v) override;
private:
DECLARE_EVENT_TABLE();
+4 -4
View File
@@ -24,10 +24,10 @@ public:
vector<String> choices;
protected:
virtual size_t selection() const { return NO_SELECTION; }
virtual size_t itemCount() const { return choices.size(); }
virtual String itemText(size_t item) const { return choices.at(item); }
virtual void select(size_t item);
size_t selection() const override { return NO_SELECTION; }
size_t itemCount() const override { return choices.size(); }
String itemText(size_t item) const override { return choices.at(item); }
void select(size_t item) override;
};
// ----------------------------------------------------------------------------- : FilterControl
+3 -3
View File
@@ -26,11 +26,11 @@ public:
protected:
/// 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
};
+1 -1
View File
@@ -71,7 +71,7 @@ protected:
virtual void onSelect(size_t item, size_t col, bool& changes) {}
/// Return the desired size of control
virtual wxSize DoGetBestSize() const;
wxSize DoGetBestSize() const override;
/// Information on the subcolumns. These are columns inside items
struct SubColumn {
+30 -30
View File
@@ -157,9 +157,9 @@ protected:
class Graph1D : public Graph {
public:
inline Graph1D(size_t axis) : axis(axis) {}
virtual void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const;
virtual bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const;
virtual void setData(const GraphDataP& d);
void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const override;
bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const override;
void setData(const GraphDataP& d) override;
protected:
size_t axis;
/// Find an item, return the position along the axis, or -1 if not found
@@ -172,7 +172,7 @@ protected:
class Graph2D : public Graph {
public:
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:
size_t axis1, axis2;
vector<UInt> values; // axis1.size * axis2.size array
@@ -184,33 +184,33 @@ protected:
class BarGraph : public Graph1D {
public:
inline BarGraph(size_t axis) : Graph1D(axis) {}
virtual void draw(RotatedDC& dc, int current, DrawLayer layer) const;
virtual int findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight) const;
void draw(RotatedDC& dc, int current, DrawLayer layer) const override;
int findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight) const override;
};
// A bar graph with stacked bars
class BarGraph2D : public Graph2D {
public:
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;
virtual bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const;
void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const override;
bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const override;
};
/// A pie graph
class PieGraph : public Graph1D {
public:
inline PieGraph(size_t axis) : Graph1D(axis) {}
virtual void draw(RotatedDC& dc, int current, DrawLayer layer) const;
virtual int findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight) const;
void draw(RotatedDC& dc, int current, DrawLayer layer) const override;
int findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight) const override;
};
/// A scatter plot
class ScatterGraph : public Graph2D {
public:
inline ScatterGraph(size_t axis1, size_t axis2) : Graph2D(axis1, axis2) {}
virtual void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const;
virtual bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const;
virtual void setData(const GraphDataP& d);
void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const override;
bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const override;
void setData(const GraphDataP& d) override;
protected:
UInt max_value;
double max_value_x, max_value_y; ///< highest sum of two adjacent scaled values (radii)
@@ -221,7 +221,7 @@ protected:
class ScatterGraphPlus : public ScatterGraph {
public:
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:
size_t axis3;
vector<UInt> values3D; // axis1.size * axis2.size * axis3.size array
@@ -232,7 +232,7 @@ protected:
class ScatterPieGraph : public ScatterGraphPlus {
public:
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
@@ -241,9 +241,9 @@ public:
inline GraphLegend(size_t axis, Alignment alignment, bool reverse = false)
: Graph1D(axis), alignment(alignment), reverse(reverse)
{}
virtual RealSize determineSize(RotatedDC& dc) const;
virtual void draw(RotatedDC& dc, int current, DrawLayer layer) const;
virtual int findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight) const;
RealSize determineSize(RotatedDC& dc) const override;
void draw(RotatedDC& dc, int current, DrawLayer layer) const override;
int findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight) const override;
private:
mutable RealSize size, item_size;
Alignment alignment;
@@ -256,9 +256,9 @@ public:
inline GraphStats(size_t axis, Alignment alignment)
: Graph1D(axis), alignment(alignment)
{}
virtual RealSize determineSize(RotatedDC& dc) const;
virtual void draw(RotatedDC& dc, int current, DrawLayer layer) const;
virtual void setData(const GraphDataP& d);
RealSize determineSize(RotatedDC& dc) const override;
void draw(RotatedDC& dc, int current, DrawLayer layer) const override;
void setData(const GraphDataP& d) override;
private:
mutable RealSize size, item_size;
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)
: Graph1D(axis), direction(direction), rotate(rotate), draw_lines(draw_lines), label(label)
{}
virtual void draw(RotatedDC& dc, int current, DrawLayer layer) const;
virtual int findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight) const;
void draw(RotatedDC& dc, int current, DrawLayer layer) const override;
int findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight) const override;
private:
Direction direction;
int levels;
@@ -295,7 +295,7 @@ private:
class GraphValueAxis : public Graph1D {
public:
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:
bool highlight_value;
};
@@ -310,9 +310,9 @@ public:
, margin_left(margin_left), margin_top(margin_top), margin_right(margin_right), margin_bottom(margin_bottom)
, upside_down(upside_down)
{}
virtual void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const;
virtual bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const;
virtual void setData(const GraphDataP& d);
void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const override;
bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const override;
void setData(const GraphDataP& d) override;
private:
const GraphP graph;
double margin_left, margin_top, margin_right, margin_bottom;
@@ -322,9 +322,9 @@ private:
/// A display containing multiple graphs
class GraphContainer : public Graph {
public:
virtual void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const;
virtual bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const;
virtual void setData(const GraphDataP& d);
void draw(RotatedDC& dc, const vector<int>& current, DrawLayer layer) const override;
bool findItem(const RealPoint& pos, const RealRect& screen_rect, bool tight, vector<int>& out) const override;
void setData(const GraphDataP& d) override;
void add(const GraphP& graph);
private:
+3 -3
View File
@@ -57,7 +57,7 @@ public:
wxDateTime::Now()) // TODO: Find mofication time of card image
, filename(filename)
{}
virtual Image generate() {
Image generate() override {
try {
ImageCardList* parent = (ImageCardList*)owner;
Image image;
@@ -72,7 +72,7 @@ public:
return Image();
}
}
virtual void store(const Image& img) {
void store(const Image& img) override {
// add finished bitmap to the imagelist
ImageCardList* parent = (ImageCardList*)owner;
if (img.Ok()) {
@@ -83,7 +83,7 @@ public:
}
}
virtual bool threadSafe() const {return true;}
bool threadSafe() const override {return true;}
private:
LocalFileName filename;
};
+6 -6
View File
@@ -23,10 +23,10 @@ public:
~ImageCardList();
ImageCardList(Window* parent, int id, long additional_style = 0);
protected:
virtual int OnGetItemImage(long pos) const;
virtual void onRebuild();
virtual void onBeforeChangeSet();
virtual bool allowModify() const { return true; }
int OnGetItemImage(long pos) const override;
void onRebuild() override;
void onBeforeChangeSet() override;
bool allowModify() const override { return true; }
private:
DECLARE_EVENT_TABLE();
void onIdle(wxIdleEvent&);
@@ -50,8 +50,8 @@ public:
protected:
/// Get only the subset of the cards
virtual void getItems(vector<VoidP>& out) const;
virtual void onChangeSet();
void getItems(vector<VoidP>& out) const override;
void onChangeSet() override;
private:
CardListFilterP filter; ///< Filter with which this.cards is made
+1 -1
View File
@@ -99,7 +99,7 @@ protected:
// --------------------------------------------------- : Fixing wx issues
wxSize DoGetBestClientSize() const;
wxSize DoGetBestClientSize() const override;
// --------------------------------------------------- : Data
VoidP selected_item; ///< The currently selected item
+16 -16
View File
@@ -43,9 +43,9 @@ public:
// --------------------------------------------------- : Set stuff
virtual void onBeforeChangeSet();
virtual void onChangeSet();
virtual void onAction(const Action&, bool);
void onBeforeChangeSet() override;
void onChangeSet() override;
void onAction(const Action&, bool) override;
void updateUsageStatistics();
// --------------------------------------------------- : Selection
@@ -58,35 +58,35 @@ public:
// --------------------------------------------------- : Clipboard
bool canDelete() const;
bool canCopy() const;
bool canPaste() const;
bool canDelete() const override;
bool canCopy() const override;
bool canPaste() const override;
// Try to perform a clipboard operation, return success
bool doCut();
bool doCopy();
bool doPaste();
bool doDelete();
bool doCut() override;
bool doCopy() override;
bool doPaste() override;
bool doDelete() override;
// --------------------------------------------------- : The keywords
protected:
/// 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
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)
virtual void sendEvent();
void sendEvent() override;
/// 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
/** 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
/** Overrides a function from wxListCtrl */
virtual int OnGetItemImage(long pos) const;
int OnGetItemImage(long pos) const override;
/// Get the color for an item
virtual wxListItemAttr* OnGetItemAttr(long pos) const;
wxListItemAttr* OnGetItemAttr(long pos) const override;
private:
void storeColumns();
+10 -10
View File
@@ -21,16 +21,16 @@ public:
NativeLookEditor(Window* parent, int id, long style = wxBORDER_THEME);
/// Uses a native look
virtual bool nativeLook() const { return true; }
virtual Rotation getRotation() const;
bool nativeLook() const override { return true; }
Rotation getRotation() const override;
virtual void draw(DC& dc);
virtual void drawViewer(RotatedDC& dc, ValueViewer& v);
void draw(DC& dc) override;
void drawViewer(RotatedDC& dc, ValueViewer& v) override;
protected:
// Best size doesn't really matter, as long as it is not too small
virtual wxSize DoGetBestSize() const;
virtual void onInit();
wxSize DoGetBestSize() const override;
void onInit() override;
private:
static const int margin = 6;
@@ -57,9 +57,9 @@ class SetInfoEditor : public NativeLookEditor {
public:
SetInfoEditor(Window* parent, int id, long style = wxBORDER_THEME);
virtual Package& getStylePackage() const;
Package& getStylePackage() const override;
protected:
virtual void onChangeSet();
void onChangeSet() override;
};
// ----------------------------------------------------------------------------- : StylingEditor
@@ -74,7 +74,7 @@ public:
/// Show the styling for given card
void showCard(const CardP& card);
protected:
virtual void onChangeSet();
void onChangeSet() override;
};
// ----------------------------------------------------------------------------- : ExportOptionsEditor
@@ -87,7 +87,7 @@ public:
/// Show the options for given export template
void showExport(const ExportTemplateP& export_template);
virtual Package& getStylePackage() const;
Package& getStylePackage() const override;
private:
ExportTemplateP export_template;
};
+2 -2
View File
@@ -53,9 +53,9 @@ public:
protected:
/// 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
virtual size_t itemCount() const;
size_t itemCount() const override;
private:
// The default icon to use
+2 -2
View File
@@ -31,8 +31,8 @@ public:
void setSelection(const vector<CardP>& cards);
protected:
virtual int OnGetItemImage(long pos) const;
virtual void onChangeSet();
int OnGetItemImage(long pos) const override;
void onChangeSet() override;
private:
DECLARE_EVENT_TABLE();
+7 -7
View File
@@ -48,18 +48,18 @@ public:
TextStyle& getStyle();
/// Uses a native look
virtual bool nativeLook() const { return true; }
virtual Rotation getRotation() const;
bool nativeLook() const override { return true; }
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:
virtual void onInit();
virtual wxSize DoGetBestSize() const;
void onInit() override;
wxSize DoGetBestSize() const override;
private:
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);
dc.SetFont(*wxNORMAL_FONT);
int h;
dc.GetTextExtent(_("X"), 0, &h);
dc.GetTextExtent(_("X"), nullptr, &h);
item_height = h + 2;
}
+2 -2
View File
@@ -26,7 +26,7 @@ public:
private:
DropDownList& list;
virtual bool ProcessEvent(wxEvent& ev) {
bool ProcessEvent(wxEvent& ev) override {
int t = ev.GetEventType();
if ( t == wxEVT_LEFT_DOWN || t == wxEVT_RIGHT_DOWN
|| t == wxEVT_MOVE || t == wxEVT_SIZE
@@ -98,7 +98,7 @@ void DropDownList::show(bool in_place, wxPoint pos, RealRect* rect) {
dc.SetFont(*wxNORMAL_FONT);
for (size_t i = 0 ; i < count ; ++i) {
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
}
}
+2 -2
View File
@@ -127,13 +127,13 @@ private:
const AlphaMask& mask;
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
// --------------------------------------------------- : Events
DECLARE_EVENT_TABLE();
wxSize DoGetBestSize() const;
wxSize DoGetBestSize() const override;
void onLeftDown(wxMouseEvent&);
void onLeftUp (wxMouseEvent&);
+6 -6
View File
@@ -128,23 +128,23 @@ public:
buffer_size = m_parent_i_stream->LastRead();
}
bool IsSeekable() const { return true; }
bool IsSeekable() const override { return true; }
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);
memcpy(buffer, this->buffer + buffer_pos, len);
buffer_pos += len;
m_parent_i_stream->Read((Byte*)buffer + len, bufsize - 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;
else if (mode == wxFromCurrent) buffer_pos += seek;
else assert(false);
assert(buffer_pos < buffer_size);
return buffer_pos;
}
virtual wxFileOffset OnSysTell() const {
wxFileOffset OnSysTell() const override {
assert(buffer_pos < buffer_size);
return buffer_pos;
}
@@ -164,7 +164,7 @@ public:
, list(list), ti(ti)
{}
virtual Image generate() {
Image generate() override {
wxURL url(ti->package->description->icon_url);
unique_ptr<wxInputStream> isP(url.GetInputStream());
if (!isP) return wxImage();
@@ -172,7 +172,7 @@ public:
Image result(is2);
return result;
}
virtual void store(const Image& image) {
void store(const Image& image) override {
if (!image.Ok()) return;
ti->setIcon(image);
list->Refresh(false);
+5 -5
View File
@@ -30,12 +30,12 @@ public:
protected:
// overridden methods from TreeList
virtual void initItems();
virtual void drawItem(DC& dc, size_t index, size_t column, int x, int y, bool selected) const;
void initItems() override;
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; }
virtual String columnText(size_t column) const;
virtual int columnWidth(size_t column) const;
size_t columnCount() const override { return 3; }
String columnText(size_t column) const override;
int columnWidth(size_t column) const override;
private:
/// The list of packages we are displaying
+2 -2
View File
@@ -57,7 +57,7 @@ private:
wxMutex lock;
struct Thread : public wxThread {
virtual ExitCode Entry();
ExitCode Entry() override;
};
};
@@ -104,7 +104,7 @@ public:
void setPackage(const InstallablePackageP& package);
virtual wxSize DoGetBestSize() const;
wxSize DoGetBestSize() const override;
private:
InstallablePackageP package;
+4 -4
View File
@@ -36,7 +36,7 @@ public:
class GlobalPreferencesPage : public PreferencesPage {
public:
GlobalPreferencesPage(Window* parent);
void store();
void store() override;
private:
wxComboBox* language;
@@ -47,7 +47,7 @@ private:
class DisplayPreferencesPage : public PreferencesPage {
public:
DisplayPreferencesPage(Window* parent);
void store();
void store() override;
private:
DECLARE_EVENT_TABLE();
@@ -74,7 +74,7 @@ private:
class DirsPreferencesPage : public PreferencesPage {
public:
DirsPreferencesPage(Window* parent);
void store();
void store() override;
private:
DECLARE_EVENT_TABLE();
@@ -88,7 +88,7 @@ private:
class UpdatePreferencesPage : public PreferencesPage {
public:
UpdatePreferencesPage(Window* parent);
void store();
void store() override;
private:
DECLARE_EVENT_TABLE();
+5 -5
View File
@@ -55,13 +55,13 @@ class CardsPrintout : public wxPrintout {
public:
CardsPrintout(PrintJobP const& job);
/// 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
virtual bool HasPage(int page);
bool HasPage(int page) override;
/// Determine the layout
virtual void OnPreparePrinting();
void OnPreparePrinting() override;
/// Print a page
virtual bool OnPrintPage(int page);
bool OnPrintPage(int page) override;
private:
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);
wxSizer* s4 = new wxStaticBoxSizer(wxVERTICAL, &wnd, L"Settings");
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(wnd.CreateButtonSizer(wxOK | wxCANCEL) , 0, wxEXPAND | wxALL, 8);
s->SetSizeHints(&wnd);
+3 -7
View File
@@ -284,13 +284,9 @@ void CardsPanel::onMenuOpen(wxMenuEvent& ev) {
wxMenu* menu = editor->getMenu(ID_INSERT_SYMBOL);
if (insertSymbolMenu->GetSubMenu() != menu || (menu && menu->GetParent() != menuFormat)) {
// re-add the menu
fprintf(stderr,"insert1 %p %p\n", menuFormat,insertSymbolMenu);fflush(stderr);
menuFormat->Remove(ID_INSERT_SYMBOL);
fprintf(stderr,"insert2\n");fflush(stderr);
insertSymbolMenu->SetSubMenu(menu);
fprintf(stderr,"insert3\n");fflush(stderr);
menuFormat->Append(insertSymbolMenu);
fprintf(stderr,"insert4\n");fflush(stderr);
}
}
@@ -418,7 +414,7 @@ void CardsPanel::doSelectAll() {
class CardsPanel::SearchFindInfo : public FindInfo {
public:
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
panel.card_list->setCard(card);
return true;
@@ -430,7 +426,7 @@ private:
class CardsPanel::ReplaceFindInfo : public FindInfo {
public:
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
panel.card_list->setCard(card);
// Replace
@@ -441,7 +437,7 @@ public:
return true;
}
}
virtual bool searchSelection() const { return true; }
bool searchSelection() const override { return true; }
private:
CardsPanel& panel;
};
+22 -22
View File
@@ -27,27 +27,27 @@ public:
CardsPanel(Window* parent, int id);
~CardsPanel();
virtual void onChangeSet();
void onChangeSet() override;
// --------------------------------------------------- : UI
virtual void initUI (wxToolBar* tb, wxMenuBar* mb);
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb);
virtual void onUpdateUI(wxUpdateUIEvent&);
virtual void onCommand(int id);
virtual void onMenuOpen(wxMenuEvent&);
void initUI (wxToolBar* tb, wxMenuBar* mb) override;
void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
void onUpdateUI(wxUpdateUIEvent&) override;
void onCommand(int id) override;
void onMenuOpen(wxMenuEvent&) override;
// --------------------------------------------------- : Actions
virtual bool wantsToHandle(const Action&, bool undone) const;
bool wantsToHandle(const Action&, bool undone) const override;
// --------------------------------------------------- : Clipboard
virtual bool canCut() const;
virtual bool canCopy() const;
virtual bool canPaste() const;
virtual void doCut();
virtual void doCopy();
virtual void doPaste();
bool canCut() const override;
bool canCopy() const override;
bool canPaste() const override;
void doCut() override;
void doCopy() override;
void doPaste() override;
// --------------------------------------------------- : Text selection
@@ -56,11 +56,11 @@ public:
// --------------------------------------------------- : Searching (find/replace)
virtual bool canFind() const { return true; }
virtual bool canReplace() const { return true; }
virtual bool doFind (wxFindReplaceData&);
virtual bool doReplace (wxFindReplaceData&);
virtual bool doReplaceAll(wxFindReplaceData&);
bool canFind() const override { return true; }
bool canReplace() const override { return true; }
bool doFind (wxFindReplaceData&) override;
bool doReplace (wxFindReplaceData&) override;
bool doReplaceAll(wxFindReplaceData&) override;
private:
/// Do a search or replace action for the given FindInfo in all cards
bool search(FindInfo& find, bool from_start);
@@ -71,9 +71,9 @@ private:
public:
// --------------------------------------------------- : Selection
virtual CardP selectedCard() const;
virtual void selectCard(const CardP& card);
virtual void selectFirstCard();
CardP selectedCard() const override;
void selectCard(const CardP& card) override;
void selectFirstCard() override;
private:
// --------------------------------------------------- : Controls
@@ -92,7 +92,7 @@ private:
void updateNotesPosition();
// before Layout, call updateNotesPosition.
// NOTE: docs say this function returns void, but the code says bool
virtual bool Layout();
bool Layout() override;
// --------------------------------------------------- : Menus & tools
wxMenu* menuCard, *menuFormat;
+7 -7
View File
@@ -25,16 +25,16 @@ public:
void onIdle(wxIdleEvent&);
void onEnter(wxCommandEvent&);
virtual void initUI (wxToolBar* tb, wxMenuBar* mb);
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb);
virtual void onUpdateUI(wxUpdateUIEvent&);
virtual void onCommand(int id);
void initUI (wxToolBar* tb, wxMenuBar* mb) override;
void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
void onUpdateUI(wxUpdateUIEvent&) override;
void onCommand(int id) override;
// --------------------------------------------------- : Clipboard
virtual bool canCut() const;
virtual bool canCopy() const;
virtual void doCopy();
bool canCut() const override;
bool canCopy() const override;
void doCopy() override;
protected:
void onChangeSet() override;
+14 -14
View File
@@ -26,26 +26,26 @@ public:
KeywordsPanel(Window* parent, int id);
~KeywordsPanel();
virtual void onChangeSet();
virtual void onAction(const Action&, bool);
void onChangeSet() override;
void onAction(const Action&, bool) override;
// --------------------------------------------------- : UI
virtual void initUI (wxToolBar* tb, wxMenuBar* mb);
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb);
virtual void onUpdateUI(wxUpdateUIEvent&);
virtual void onCommand(int id);
void initUI (wxToolBar* tb, wxMenuBar* mb) override;
void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
void onUpdateUI(wxUpdateUIEvent&) override;
void onCommand(int id) override;
// --------------------------------------------------- : Clipboard
virtual bool canCut() const;
virtual bool canCopy() const;
virtual bool canPaste() const;
virtual void doCut();
virtual void doCopy();
virtual void doPaste();
bool canCut() const override;
bool canCopy() const override;
bool canPaste() const override;
void doCut() override;
void doCopy() override;
void doPaste() override;
virtual bool canSelectAll() const;
virtual void doSelectAll();
bool canSelectAll() const override;
void doSelectAll() override;
private:
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
virtual bool wantsToHandle(const Action&, bool undone) const { return false; }
/// Handle an action that changes the current set
virtual void onAction(const Action&, bool undone) {}
virtual void onAction(const Action&, bool undone) override {}
// --------------------------------------------------- : Clipboard
virtual bool canPaste() const { return false; } ///< Is pasting possible?
+6 -6
View File
@@ -36,8 +36,8 @@ public:
vector<CardP> cards;
protected:
virtual void getItems(vector<VoidP>& out) const;
virtual void onChangeSet();
void getItems(vector<VoidP>& out) const override;
void onChangeSet() override;
};
RandomCardList::RandomCardList(Window* parent, int id, long style)
@@ -68,7 +68,7 @@ public:
PackTotalsPanel(Window* parent, int id, PackGenerator& generator, bool show_all = false)
: wxPanel(parent,id), generator(generator), show_all(show_all) {}
void setGame(const GameP& game);
virtual wxSize DoGetBestSize() const;
virtual wxSize DoGetBestSize() const override;
private:
DECLARE_EVENT_TABLE();
GameP game;
@@ -157,7 +157,7 @@ public:
, interactive(interactive)
, buddy(nullptr)
{}
void draw(DC& dc) {
void draw(DC& dc) override {
Color bg = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
Color fg = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT);
// clear background
@@ -176,7 +176,7 @@ public:
dc.GetTextExtent(label,&w,&h);
dc.DrawText(interactive && hover ? label + _("...") : label, 2, (s.y-h)/2);
}
wxSize DoGetBestSize() const {
wxSize DoGetBestSize() const override {
int w,h;
wxClientDC dc(const_cast<SelectableLabel*>(this));
dc.SetFont(*wxNORMAL_FONT);
@@ -186,7 +186,7 @@ public:
void setBuddy(wxWindow* buddy) {
this->buddy = buddy;
}
virtual void onClick() {
void onClick() override {
if (buddy) buddy->SetFocus();
}
void onDoubleClick(wxMouseEvent&) {
+12 -12
View File
@@ -43,24 +43,24 @@ public:
// --------------------------------------------------- : UI
virtual void onBeforeChangeSet();
virtual void onChangeSet();
virtual void onAction(const Action&, bool undone);
void onBeforeChangeSet() override;
void onChangeSet() override;
void onAction(const Action&, bool undone) override;
virtual void initUI (wxToolBar* tb, wxMenuBar* mb);
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb);
virtual void onUpdateUI(wxUpdateUIEvent&);
virtual void onCommand(int id);
void initUI (wxToolBar* tb, wxMenuBar* mb) override;
void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
void onUpdateUI(wxUpdateUIEvent&) override;
void onCommand(int id) override;
// --------------------------------------------------- : Selection
virtual CardP selectedCard() const;
virtual void selectCard(const CardP& card);
virtual void selectionChoices(ExportCardSelectionChoices& out);
CardP selectedCard() const override;
void selectCard(const CardP& card) override;
void selectionChoices(ExportCardSelectionChoices& out) override;
// --------------------------------------------------- : Clipboard
virtual bool canCopy() const;
virtual void doCopy();
bool canCopy() const override;
void doCopy() override;
private:
DECLARE_EVENT_TABLE();
+13 -13
View File
@@ -21,24 +21,24 @@ public:
// --------------------------------------------------- : UI
virtual void initUI (wxToolBar* tb, wxMenuBar* mb);
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb);
virtual void onUpdateUI(wxUpdateUIEvent&);
virtual void onCommand(int id);
void initUI (wxToolBar* tb, wxMenuBar* mb) override;
void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
void onUpdateUI(wxUpdateUIEvent&) override;
void onCommand(int id) override;
// --------------------------------------------------- : Clipboard
virtual bool canCut() const;
virtual bool canCopy() const;
virtual bool canPaste() const;
virtual bool canSelectAll() const;
virtual void doCut();
virtual void doCopy();
virtual void doPaste();
virtual void doSelectAll();
bool canCut() const override;
bool canCopy() const override;
bool canPaste() const override;
bool canSelectAll() const override;
void doCut() override;
void doCopy() override;
void doPaste() override;
void doSelectAll() override;
protected:
virtual void onChangeSet();
void onChangeSet() override;
private:
SetInfoEditor* editor;
+5 -5
View File
@@ -146,14 +146,14 @@ public:
}
protected:
virtual size_t itemCount() const;
virtual void drawItem(DC& dc, int x, int y, size_t item);
size_t itemCount() const override;
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;
}
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?
for (size_t j = 1 ; j < subcolumns.size() ; ++j) {
if (j != active_subcolumn && subcolumns[j].selection == item &&
@@ -527,7 +527,7 @@ public:
StatsFilter(GraphData& data, const vector<int> match) {
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) {
out.push_back(cards.at(idx));
}
+8 -8
View File
@@ -31,17 +31,17 @@ public:
// --------------------------------------------------- : UI
virtual void onChangeSet();
virtual void onAction(const Action&, bool undone);
void onChangeSet() override;
void onAction(const Action&, bool undone) override;
virtual void initUI (wxToolBar*, wxMenuBar*);
virtual void destroyUI(wxToolBar*, wxMenuBar*);
virtual void onUpdateUI(wxUpdateUIEvent&);
virtual void onCommand(int id);
void initUI (wxToolBar*, wxMenuBar*) override;
void destroyUI(wxToolBar*, wxMenuBar*) override;
void onUpdateUI(wxUpdateUIEvent&) override;
void onCommand(int id) override;
// --------------------------------------------------- : Selection
virtual CardP selectedCard() const;
virtual void selectCard(const CardP& card);
CardP selectedCard() const override;
void selectCard(const CardP& card) override;
// --------------------------------------------------- : Data
private:
+13 -13
View File
@@ -22,25 +22,25 @@ class StylePanel : public SetWindowPanel {
public:
StylePanel(Window* parent, int id);
virtual void onChangeSet();
virtual void onAction(const Action&, bool undone);
void onChangeSet() override;
void onAction(const Action&, bool undone) override;
// --------------------------------------------------- : UI
virtual void initUI(wxToolBar*, wxMenuBar*);
void initUI(wxToolBar*, wxMenuBar*) override;
// --------------------------------------------------- : Clipboard
virtual bool canCut() const;
virtual bool canCopy() const;
virtual bool canPaste() const;
virtual bool canSelectAll() const;
virtual void doCut();
virtual void doCopy();
virtual void doPaste();
virtual void doSelectAll();
bool canCut() const override;
bool canCopy() const override;
bool canPaste() const override;
bool canSelectAll() const override;
void doCut() override;
void doCopy() override;
void doPaste() override;
void doSelectAll() override;
// --------------------------------------------------- : Selection
virtual void selectCard(const CardP& card);
void selectCard(const CardP& card) override;
private:
DECLARE_EVENT_TABLE();
@@ -58,7 +58,7 @@ private:
/// Determine the best size for the list of stylesheets based on available space
void updateListSize();
virtual bool Layout();
bool Layout() override;
/// Actual intialization of the controls
void initControls();
+1 -1
View File
@@ -460,7 +460,7 @@ bool SetWindow::askSaveAndContinue() {
set->actions.setSavePoint();
return true;
}
} catch (Error e) {
} catch (Error const& e) {
// something went wrong with saving, don't proceed
handle_error(e);
return false;
+2 -2
View File
@@ -74,9 +74,9 @@ private:
// --------------------------------------------------- : Action related
protected:
/// We want to respond to set changes
virtual void onChangeSet();
void onChangeSet() override;
/// Actions that change the set
virtual void onAction(const Action&, bool undone);
void onAction(const Action&, bool undone) override;
public:
// minSize = mainSizer->getMinWindowSize(this)
+12 -12
View File
@@ -16,33 +16,33 @@ class wxSpinCtrl;
// ----------------------------------------------------------------------------- : SymbolBasicShapeEditor
/// Editor for drawing basic shapes such as rectangles and polygons
class SymbolBasicShapeEditor : public SymbolEditorBase {
class SymbolBasicShapeEditor final : public SymbolEditorBase {
public:
SymbolBasicShapeEditor(SymbolControl* control);
// --------------------------------------------------- : Drawing
virtual void draw(DC& dc);
void draw(DC& dc) override;
// --------------------------------------------------- : UI
virtual void initUI (wxToolBar* tb, wxMenuBar* mb);
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb);
virtual void onUpdateUI(wxUpdateUIEvent&);
virtual void onCommand(int id);
virtual int modeToolId();
void initUI (wxToolBar* tb, wxMenuBar* mb) override;
void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
void onUpdateUI(wxUpdateUIEvent&) override;
void onCommand(int id) override;
int modeToolId() override;
// --------------------------------------------------- : Mouse events
virtual void onLeftDown (const Vector2D& pos, wxMouseEvent& ev);
virtual void onLeftUp (const Vector2D& pos, wxMouseEvent& ev);
virtual void onMouseDrag (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev);
void onLeftDown (const Vector2D& pos, wxMouseEvent& ev) override;
void onLeftUp (const Vector2D& pos, wxMouseEvent& ev) override;
void onMouseDrag (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev) override;
// --------------------------------------------------- : Other events
virtual void onKeyChange(wxKeyEvent& ev);
void onKeyChange(wxKeyEvent& ev) override;
virtual bool isEditing();
bool isEditing() override;
// --------------------------------------------------- : Data
private:
+2 -2
View File
@@ -26,9 +26,9 @@ class SymbolControl : public wxControl, public SymbolViewer {
public:
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
void onExtraTool(wxCommandEvent& ev);
+4 -4
View File
@@ -31,9 +31,9 @@ public:
SymbolPartList(Window* parent, int id, SymbolPartsSelection& selection, SymbolP symbol = SymbolP());
/// Another symbol is being viewed
virtual void onChangeSymbol();
void onChangeSymbol() override;
/// Event handler for changes to the symbol
virtual void onAction(const Action&, bool);
void onAction(const Action&, bool) override;
/// Update the control
void update();
@@ -41,7 +41,7 @@ public:
void updateParts(const set<SymbolPartP>& parts);
protected:
virtual wxSize DoGetBestSize() const;
wxSize DoGetBestSize() const override;
private:
SymbolPartsSelection& selection; ///< Store selection here
int number_of_items;
@@ -75,7 +75,7 @@ private:
void onChar(wxKeyEvent& ev);
void onPaint(wxPaintEvent&);
void onSize(wxSizeEvent&);
void OnDraw(DC& dc);
void OnDraw(DC& dc) override;
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;
if (selection == SELECTED_LINE && ev.AltDown()) {
// Drag the curve
if (controlPointMoveAction) controlPointMoveAction = 0;
if (controlPointMoveAction) controlPointMoveAction = nullptr;
if (!curveDragAction) {
auto action = make_unique<CurveDragAction>(selected_line1, selected_line2);
curveDragAction = action.get();
+15 -15
View File
@@ -19,13 +19,13 @@ class CurveDragAction;
// Symbol editor for editing control points and handles
class SymbolPointEditor : public SymbolEditorBase {
class SymbolPointEditor final : public SymbolEditorBase {
public:
SymbolPointEditor(SymbolControl* control, const SymbolShapeP& part);
// --------------------------------------------------- : Drawing
virtual void draw(DC& dc);
void draw(DC& dc) override;
private:
/// Draws a gradient on the selected line to indicate curve dragging
@@ -56,25 +56,25 @@ private:
public:
// --------------------------------------------------- : UI
virtual void initUI (wxToolBar* tb, wxMenuBar* mb);
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb);
virtual void onUpdateUI(wxUpdateUIEvent&);
virtual void onCommand(int id);
virtual int modeToolId();
void initUI (wxToolBar* tb, wxMenuBar* mb) override;
void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
void onUpdateUI(wxUpdateUIEvent&) override;
void onCommand(int id) override;
int modeToolId() override;
// --------------------------------------------------- : Mouse events
virtual void onLeftDown (const Vector2D& pos, wxMouseEvent& ev);
virtual void onLeftUp (const Vector2D& pos, wxMouseEvent& ev);
virtual void onLeftDClick(const Vector2D& pos, wxMouseEvent& ev);
virtual void onMouseMove(const Vector2D& from, const Vector2D& to, wxMouseEvent& ev);
virtual void onMouseDrag(const Vector2D& from, const Vector2D& to, wxMouseEvent& ev);
void onLeftDown (const Vector2D& pos, wxMouseEvent& ev) override;
void onLeftUp (const Vector2D& pos, wxMouseEvent& ev) override;
void onLeftDClick(const Vector2D& pos, wxMouseEvent& ev) override;
void onMouseMove(const Vector2D& from, const Vector2D& to, wxMouseEvent& ev) override;
void onMouseDrag(const Vector2D& from, const Vector2D& to, wxMouseEvent& ev) override;
// --------------------------------------------------- : Other events
virtual void onKeyChange(wxKeyEvent& ev);
virtual void onChar(wxKeyEvent& ev);
virtual bool isEditing();
void onKeyChange(wxKeyEvent& ev) override;
void onChar(wxKeyEvent& ev) override;
bool isEditing() override;
private:
// --------------------------------------------------- : Data
+15 -15
View File
@@ -19,13 +19,13 @@ DECLARE_POINTER_TYPE(SymbolPartShearAction);
// ----------------------------------------------------------------------------- : SymbolSelectEditor
/// Editor that allows the user to select symbol parts
class SymbolSelectEditor : public SymbolEditorBase {
class SymbolSelectEditor final : public SymbolEditorBase {
public:
SymbolSelectEditor(SymbolControl* control, bool rotate);
// --------------------------------------------------- : Drawing
virtual void draw(DC& dc);
void draw(DC& dc) override;
private:
/// Draw handles on all sides
@@ -39,26 +39,26 @@ private:
public:
// --------------------------------------------------- : UI
virtual void initUI (wxToolBar* tb, wxMenuBar* mb);
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb);
virtual void onUpdateUI(wxUpdateUIEvent&);
virtual void onCommand(int id);
virtual int modeToolId();
void initUI (wxToolBar* tb, wxMenuBar* mb) override;
void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
void onUpdateUI(wxUpdateUIEvent&) override;
void onCommand(int id) override;
int modeToolId() override;
// --------------------------------------------------- : Mouse events
virtual void onLeftDown (const Vector2D& pos, wxMouseEvent& ev);
virtual void onLeftDClick (const Vector2D& pos, wxMouseEvent& ev);
virtual void onLeftUp (const Vector2D& pos, wxMouseEvent& ev);
virtual void onMouseMove (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev);
virtual void onMouseDrag (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev);
void onLeftDown (const Vector2D& pos, wxMouseEvent& ev) override;
void onLeftDClick (const Vector2D& pos, wxMouseEvent& ev) override;
void onLeftUp (const Vector2D& pos, wxMouseEvent& ev) override;
void onMouseMove (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev) override;
void onMouseDrag (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev) override;
// --------------------------------------------------- : Other events
virtual void onKeyChange (wxKeyEvent& ev);
virtual void onChar (wxKeyEvent& ev);
void onKeyChange (wxKeyEvent& ev) override;
void onChar (wxKeyEvent& ev) override;
virtual bool isEditing();
bool isEditing() override;
private:
// The part under the mouse cursor
+13 -13
View File
@@ -17,35 +17,35 @@ class SymmetryMoveAction;
// ----------------------------------------------------------------------------- : SymbolSymmetryEditor
/// Editor for adding symmetries
class SymbolSymmetryEditor : public SymbolEditorBase {
class SymbolSymmetryEditor final : public SymbolEditorBase {
public:
/** The symmetry parameter is optional, if it is not set, then only new ones can be created */
SymbolSymmetryEditor(SymbolControl* control, const SymbolSymmetryP& symmetry);
// --------------------------------------------------- : Drawing
virtual void draw(DC& dc);
void draw(DC& dc) override;
// --------------------------------------------------- : UI
virtual void initUI (wxToolBar* tb, wxMenuBar* mb);
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb);
virtual void onUpdateUI(wxUpdateUIEvent&);
virtual void onCommand(int id);
virtual int modeToolId();
void initUI (wxToolBar* tb, wxMenuBar* mb) override;
void destroyUI(wxToolBar* tb, wxMenuBar* mb) override;
void onUpdateUI(wxUpdateUIEvent&) override;
void onCommand(int id) override;
int modeToolId() override;
// --------------------------------------------------- : Mouse events
virtual void onLeftDown (const Vector2D& pos, wxMouseEvent& ev);
virtual void onLeftUp (const Vector2D& pos, wxMouseEvent& ev);
virtual void onMouseMove (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev);
virtual void onMouseDrag (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev);
void onLeftDown (const Vector2D& pos, wxMouseEvent& ev) override;
void onLeftUp (const Vector2D& pos, wxMouseEvent& ev) override;
void onMouseMove (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev) override;
void onMouseDrag (const Vector2D& from, const Vector2D& to, wxMouseEvent& ev) override;
// --------------------------------------------------- : Other events
virtual void onKeyChange(wxKeyEvent& ev);
void onKeyChange(wxKeyEvent& ev) override;
virtual bool isEditing();
bool isEditing() override;
// --------------------------------------------------- : Data
private:
+1 -1
View File
@@ -42,7 +42,7 @@ class ThumbnailThreadWorker : public wxThread {
public:
ThumbnailThreadWorker(ThumbnailThread* parent);
virtual ExitCode Entry();
ExitCode Entry() override;
ThumbnailRequestP current; ///< Request we are working on
ThumbnailThread* parent;
+2 -2
View File
@@ -91,7 +91,7 @@ bool update_available() {
// If not, displays a message
class CheckUpdateThread : public wxThread {
public:
virtual void* Entry() {
void* Entry() override {
Work();
return 0;
}
@@ -170,7 +170,7 @@ struct HtmlWindowToBrowser : public wxHtmlWindow {
: wxHtmlWindow(parent, id, pos, size, flags)
{}
virtual void OnLinkClicked(const wxHtmlLinkInfo& info) {
void OnLinkClicked(const wxHtmlLinkInfo& info) override {
wxLaunchDefaultBrowser( info.GetHref() );
}
};
+3 -3
View File
@@ -22,11 +22,11 @@ const double min_item_size = thumbnail_size;
class ChoiceThumbnailRequest : public ThumbnailRequest {
public:
ChoiceThumbnailRequest(ValueViewer* cve, int id, bool from_disk, bool thread_safe);
virtual Image generate();
virtual void store(const Image&);
Image generate() override;
void store(const Image&) override;
bool isThreadSafe;
virtual bool threadSafe() const {return isThreadSafe;}
bool threadSafe() const override {return isThreadSafe;}
private:
int id;
+9 -9
View File
@@ -25,12 +25,12 @@ public:
~ChoiceValueEditor();
// --------------------------------------------------- : Events
virtual bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev);
virtual bool onChar(wxKeyEvent& ev);
virtual void onLoseFocus();
bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev) override;
bool onChar(wxKeyEvent& ev) override;
void onLoseFocus() override;
virtual void draw(RotatedDC& dc);
virtual void determineSize(bool);
void draw(RotatedDC& dc) override;
void determineSize(bool) override;
private:
DropDownListP drop_down;
@@ -93,9 +93,9 @@ public:
DropDownChoiceList(Window* parent, bool is_submenu, ValueViewer& cve, ChoiceField::ChoiceP group);
protected:
virtual void onShow();
virtual void select(size_t item);
virtual size_t selection() const;
virtual DropDownList* createSubMenu(ChoiceField::ChoiceP group) const;
void onShow() override;
void select(size_t item) override;
size_t selection() const override;
DropDownList* createSubMenu(ChoiceField::ChoiceP group) const override;
};
+7 -7
View File
@@ -20,14 +20,14 @@ class DropDownColorList : public DropDownList {
public:
DropDownColorList(Window* parent, ColorValueEditor& cve);
protected:
virtual size_t itemCount() const;
virtual bool lineBelow(size_t item) const;
virtual String itemText(size_t item) const;
virtual void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const;
protected:
size_t itemCount() const override;
bool lineBelow(size_t item) const override;
String itemText(size_t item) const override;
void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const override;
virtual void select(size_t item);
virtual size_t selection() const;
void select(size_t item) override;
size_t selection() const override;
private:
ColorValueEditor& cve;
+5 -5
View File
@@ -22,12 +22,12 @@ public:
DECLARE_VALUE_EDITOR(Color);
// --------------------------------------------------- : Events
virtual bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev);
virtual bool onChar(wxKeyEvent& ev);
virtual void onLoseFocus();
bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev) override;
bool onChar(wxKeyEvent& ev) override;
void onLoseFocus() override;
virtual void draw(RotatedDC& dc);
virtual void determineSize(bool);
void draw(RotatedDC& dc) override;
void determineSize(bool) override;
private:
DropDownListP drop_down;
+4 -4
View File
@@ -138,13 +138,13 @@ protected:
#define DECLARE_VALUE_EDITOR(Type) \
Type##ValueEditor(DataEditor& parent, const Type##StyleP& style); \
virtual ValueEditor* getEditor() { return this; } \
private: \
ValueEditor* getEditor() override { return this; } \
private: \
/** Retrieve the parent editor object */ \
inline DataEditor& editor() const { \
inline DataEditor& editor() const override { \
return static_cast<DataEditor&>(viewer); \
} \
public:
public:
#define IMPLEMENT_VALUE_EDITOR(Type) \
ValueViewerP Type##Style::makeEditor(DataEditor& parent) { \
+7 -7
View File
@@ -19,17 +19,17 @@ class ImageValueEditor : public ImageValueViewer, public ValueEditor {
public:
DECLARE_VALUE_EDITOR(Image);
virtual bool onLeftDClick(const RealPoint&, wxMouseEvent&);
bool onLeftDClick(const RealPoint&, wxMouseEvent&) override;
// --------------------------------------------------- : Clipboard
virtual bool canCopy() const;
virtual bool canPaste() const;
virtual bool doCopy();
virtual bool doPaste();
virtual bool doDelete();
bool canCopy() const override;
bool canPaste() const override;
bool doCopy() override;
bool doPaste() override;
bool doDelete() override;
virtual bool onChar(wxKeyEvent&);
bool onChar(wxKeyEvent&) override;
private:
// Open the image slice window showing the give image
+2 -2
View File
@@ -19,7 +19,7 @@ class InfoValueEditor : public InfoValueViewer, public ValueEditor {
public:
DECLARE_VALUE_EDITOR(Info);
virtual void determineSize(bool);
virtual bool drawLabel() const { return false; }
void determineSize(bool) override;
bool drawLabel() const override { return false; }
};
+5 -5
View File
@@ -21,13 +21,13 @@ public:
DECLARE_VALUE_EDITOR(MultipleChoice);
~MultipleChoiceValueEditor();
virtual void onValueChange();
void onValueChange() override;
virtual void determineSize(bool force_fit);
void determineSize(bool force_fit) override;
virtual bool onLeftDown (const RealPoint& pos, wxMouseEvent& ev);
virtual bool onChar(wxKeyEvent& ev);
virtual void onLoseFocus();
bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev) override;
bool onChar(wxKeyEvent& ev) override;
void onLoseFocus() override;
private:
DropDownListP drop_down;
+6 -6
View File
@@ -20,12 +20,12 @@ public:
DropDownPackageChoiceList(Window* parent, PackageChoiceValueEditor* editor);
protected:
virtual size_t itemCount() const;
virtual String itemText(size_t item) const;
virtual bool lineBelow(size_t item) const;
virtual void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const;
virtual void select(size_t selection);
virtual size_t selection() const;
size_t itemCount() const override;
String itemText(size_t item) const override;
bool lineBelow(size_t item) const override;
void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const override;
void select(size_t selection) override;
size_t selection() const override;
private:
PackageChoiceValueEditor& editor;
+5 -5
View File
@@ -21,11 +21,11 @@ class PackageChoiceValueEditor : public PackageChoiceValueViewer, public ValueEd
public:
DECLARE_VALUE_EDITOR(PackageChoice);
virtual void draw(RotatedDC& dc);
virtual void determineSize(bool force_fit);
virtual bool onLeftDown (const RealPoint& pos, wxMouseEvent& ev);
virtual bool onChar(wxKeyEvent& ev);
virtual void onLoseFocus();
void draw(RotatedDC& dc) override;
void determineSize(bool force_fit) override;
bool onLeftDown(const RealPoint& pos, wxMouseEvent& ev) override;
bool onChar(wxKeyEvent& ev) override;
void onLoseFocus() override;
private:
DropDownListP drop_down;
+6 -6
View File
@@ -21,12 +21,12 @@ class SymbolValueEditor : public SymbolValueViewer, public ValueEditor {
public:
DECLARE_VALUE_EDITOR(Symbol);
virtual void draw(RotatedDC& dc);
virtual bool onLeftDown (const RealPoint& pos, wxMouseEvent&);
virtual bool onLeftUp (const RealPoint& pos, wxMouseEvent&);
virtual bool onLeftDClick(const RealPoint& pos, wxMouseEvent&);
virtual bool onMotion (const RealPoint& pos, wxMouseEvent&);
virtual void determineSize(bool);
void draw(RotatedDC& dc) override;
bool onLeftDown (const RealPoint& pos, wxMouseEvent&) override;
bool onLeftUp (const RealPoint& pos, wxMouseEvent&) override;
bool onLeftDClick(const RealPoint& pos, wxMouseEvent&) override;
bool onMotion (const RealPoint& pos, wxMouseEvent&) override;
void determineSize(bool) override;
private:
/// Draw a button, buttons are numbered from the right
void drawButton(RotatedDC& dc, int button, const String& text);
+10 -10
View File
@@ -116,15 +116,15 @@ public:
inline WordListPosP getPos() const { return pos; }
protected:
virtual void redrawArrowOnParent();
virtual size_t itemCount() const { return items.size(); }
virtual bool lineBelow(size_t item) const { return items[item].flags & FLAG_LINE_BELOW; }
virtual String itemText(size_t item) const { return items[item].name; }
virtual void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const;
virtual DropDownList* submenu(size_t item) const;
virtual size_t selection() const;
virtual void select(size_t item);
virtual bool stayOpen(size_t selection) const;
void redrawArrowOnParent() override;
size_t itemCount() const override { return items.size(); }
bool lineBelow(size_t item) const override { return items[item].flags & FLAG_LINE_BELOW; }
String itemText(size_t item) const override { return items[item].name; }
void drawIcon(DC& dc, int x, int y, size_t item, bool selected) const override;
DropDownList* submenu(size_t item) const override;
size_t selection() const override;
void select(size_t item) override;
bool stayOpen(size_t selection) const override;
private:
TextValueEditor& tve;
WordListPosP pos;
@@ -887,7 +887,7 @@ void TextValueEditor::showCaret() {
// TODO : high quality?
dc.SetFont(style().font.toWxFont(1.0));
int hi;
dc.GetTextExtent(_(" "), 0, &hi);
dc.GetTextExtent(_(" "), nullptr, &hi);
#ifdef __WXGTK__
// HACK: Some fonts don't get the descender height set correctly.
int charHeight = dc.GetCharHeight();
+36 -36
View File
@@ -34,67 +34,67 @@ public:
// --------------------------------------------------- : Events
virtual void onFocus();
virtual void onLoseFocus();
void onFocus() override;
void onLoseFocus() override;
virtual bool onLeftDown (const RealPoint& pos, wxMouseEvent&);
virtual bool onLeftUp (const RealPoint& pos, wxMouseEvent&);
virtual bool onLeftDClick(const RealPoint& pos, wxMouseEvent&);
virtual bool onRightDown (const RealPoint& pos, wxMouseEvent&);
virtual bool onMotion (const RealPoint& pos, wxMouseEvent&);
virtual void onMouseLeave(const RealPoint& pos, wxMouseEvent&);
virtual bool onMouseWheel(const RealPoint& pos, wxMouseEvent&);
bool onLeftDown (const RealPoint& pos, wxMouseEvent&) override;
bool onLeftUp (const RealPoint& pos, wxMouseEvent&) override;
bool onLeftDClick(const RealPoint& pos, wxMouseEvent&) override;
bool onRightDown (const RealPoint& pos, wxMouseEvent&) override;
bool onMotion (const RealPoint& pos, wxMouseEvent&) override;
void onMouseLeave(const RealPoint& pos, wxMouseEvent&) override;
bool onMouseWheel(const RealPoint& pos, wxMouseEvent&) override;
virtual bool onContextMenu(wxMenu& m, wxContextMenuEvent&);
virtual wxMenu* getMenu(int type) const;
virtual bool onCommand(int);
bool onContextMenu(wxMenu& m, wxContextMenuEvent&) override;
wxMenu* getMenu(int type) const override;
bool onCommand(int) override;
virtual bool onChar(wxKeyEvent&);
bool onChar(wxKeyEvent&) override;
// --------------------------------------------------- : Actions
virtual void onValueChange();
virtual void onAction(const Action&, bool undone);
void onValueChange() override;
void onAction(const Action&, bool undone) override;
// --------------------------------------------------- : Clipboard
virtual bool canCopy() const;
virtual bool canPaste() const;
virtual bool doCopy();
virtual bool doPaste();
virtual bool doDelete();
bool canCopy() const override;
bool canPaste() const override;
bool doCopy() override;
bool doPaste() override;
bool doDelete() override;
// --------------------------------------------------- : Formating
virtual bool canFormat(int type) const;
virtual bool hasFormat(int type) const;
virtual void doFormat(int type);
bool canFormat(int type) const override;
bool hasFormat(int type) const override;
void doFormat(int type) override;
// --------------------------------------------------- : Selection
virtual bool canSelectAll() const { return true; }
virtual void doSelectAll();
virtual void select(size_t start, size_t end);
virtual size_t selectionStart() const { return selection_start; }
virtual size_t selectionEnd() const { return selection_end; }
bool canSelectAll() const override { return true; }
void doSelectAll() override;
void select(size_t start, size_t end) override;
size_t selectionStart() const override { return selection_start; }
size_t selectionEnd() const override { return selection_end; }
virtual void insert(const String& text, const String& action_name);
void insert(const String& text, const String& action_name) override;
// --------------------------------------------------- : Search/replace
virtual bool search(FindInfo& find, bool from_start);
bool search(FindInfo& find, bool from_start) override;
private:
bool matchSubstr(const String& s, size_t pos, FindInfo& find);
public:
// --------------------------------------------------- : Other
virtual wxCursor cursor(const RealPoint& pos) const;
virtual void determineSize(bool force_fit = false);
virtual bool containsPoint(const RealPoint& p) const;
virtual RealRect boundingBox() const;
virtual void onShow(bool);
virtual void draw(RotatedDC&);
wxCursor cursor(const RealPoint& pos) const override;
void determineSize(bool force_fit = false) override;
bool containsPoint(const RealPoint& p) const override;
RealRect boundingBox() const override;
void onShow(bool) override;
void draw(RotatedDC&) override;
// --------------------------------------------------- : Data
private:
+1 -1
View File
@@ -63,6 +63,6 @@ private:
wxFont font_large, font_small;
protected:
virtual void draw(DC& dc);
void draw(DC& dc) override;
};