diff --git a/specter/include/specter/Button.hpp b/specter/include/specter/Button.hpp index 9dacdd5fc..fe77a7956 100644 --- a/specter/include/specter/Button.hpp +++ b/specter/include/specter/Button.hpp @@ -42,10 +42,10 @@ private: void setPressed(); void setDisabled(); - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseEnter(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseEnter(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; ButtonTarget(ViewResources& res, Button& button) : View(res, button), m_button(button) {} }; ViewChild> m_buttonTarget; @@ -61,10 +61,10 @@ private: void setPressed(); void setDisabled(); - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseEnter(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseEnter(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; MenuTarget(ViewResources& res, Button& button) : View(res, button), m_button(button) {} }; ViewChild> m_menuTarget; @@ -80,33 +80,33 @@ public: void destroy() {} }; - ~Button() { closeMenu({}); } + ~Button() override { closeMenu({}); } Button(ViewResources& res, View& parentView, IButtonBinding* controlBinding, std::string_view text, Icon* icon = nullptr, Style style = Style::Block, const zeus::CColor& bgColor = zeus::skWhite, RectangleConstraint constraint = RectangleConstraint()); Button(ViewResources& res, View& parentView, IButtonBinding* controlBinding, std::string_view text, const zeus::CColor& textColor, Icon* icon = nullptr, Style style = Style::Block, const zeus::CColor& bgColor = zeus::skWhite, RectangleConstraint constraint = RectangleConstraint()); - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseMove(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); - void think(); - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseMove(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; + void think() override; + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; void setText(std::string_view text, const zeus::CColor& textColor); void setText(std::string_view text); void setIcon(Icon* icon = nullptr); std::string_view getText() const { return m_textStr; } void colorGlyphs(const zeus::CColor& newColor); - int nominalWidth() const { return m_nomWidth; } - int nominalHeight() const { return m_nomHeight; } + int nominalWidth() const override { return m_nomWidth; } + int nominalHeight() const override { return m_nomHeight; } void closeMenu(const boo::SWindowCoord& coord); ViewChild>& getMenu() { return m_modalMenu; } - void setMultiplyColor(const zeus::CColor& color) { + void setMultiplyColor(const zeus::CColor& color) override { View::setMultiplyColor(color); m_viewVertBlock.m_color = color; if (m_viewVertBlockBuf) diff --git a/specter/include/specter/Control.hpp b/specter/include/specter/Control.hpp index c2dbb98b6..3ca9251fb 100644 --- a/specter/include/specter/Control.hpp +++ b/specter/include/specter/Control.hpp @@ -15,7 +15,7 @@ struct IControlBinding { }; struct IButtonBinding : IControlBinding { - ControlType type() const { return ControlType::Button; } + ControlType type() const override { return ControlType::Button; } static IButtonBinding* castTo(IControlBinding* bind) { return bind->type() == ControlType::Button ? static_cast(bind) : nullptr; } @@ -45,7 +45,7 @@ struct IButtonBinding : IControlBinding { }; struct IFloatBinding : IControlBinding { - ControlType type() const { return ControlType::Float; } + ControlType type() const override { return ControlType::Float; } static IFloatBinding* castTo(IControlBinding* bind) { return bind->type() == ControlType::Float ? static_cast(bind) : nullptr; } @@ -55,7 +55,7 @@ struct IFloatBinding : IControlBinding { }; struct IIntBinding : IControlBinding { - ControlType type() const { return ControlType::Int; } + ControlType type() const override { return ControlType::Int; } static IIntBinding* castTo(IControlBinding* bind) { return bind->type() == ControlType::Int ? static_cast(bind) : nullptr; } @@ -65,7 +65,7 @@ struct IIntBinding : IControlBinding { }; struct IStringBinding : IControlBinding { - ControlType type() const { return ControlType::String; } + ControlType type() const override { return ControlType::String; } static IStringBinding* castTo(IControlBinding* bind) { return bind->type() == ControlType::String ? static_cast(bind) : nullptr; } @@ -76,12 +76,12 @@ struct IStringBinding : IControlBinding { struct CVarControlBinding : IControlBinding { hecl::CVar* m_cvar; CVarControlBinding(hecl::CVar* cvar) : m_cvar(cvar) {} - ControlType type() const { return ControlType::CVar; } + ControlType type() const override { return ControlType::CVar; } static CVarControlBinding* castTo(IControlBinding* bind) { return bind->type() == ControlType::CVar ? static_cast(bind) : nullptr; } - std::string_view name(const Control* control) const { return m_cvar->name(); } - std::string_view help(const Control* control) const { return m_cvar->rawHelp(); } + std::string_view name(const Control* control) const override { return m_cvar->name(); } + std::string_view help(const Control* control) const override { return m_cvar->rawHelp(); } }; class Control : public View { diff --git a/specter/include/specter/FileBrowser.hpp b/specter/include/specter/FileBrowser.hpp index ce33cb7d3..91b89e3b0 100644 --- a/specter/include/specter/FileBrowser.hpp +++ b/specter/include/specter/FileBrowser.hpp @@ -28,16 +28,16 @@ private: friend class FileBrowser; FileBrowser& m_fb; LeftSide(FileBrowser& fb, ViewResources& res) : View(res, fb), m_fb(fb) {} - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; } m_left; class RightSide : public View { friend class FileBrowser; FileBrowser& m_fb; RightSide(FileBrowser& fb, ViewResources& res) : View(res, fb), m_fb(fb) {} - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; } m_right; ViewChild> m_split; @@ -52,8 +52,8 @@ private: new Button(res, fb, this, text, nullptr, Button::Style::Block, zeus::skWhite, RectangleConstraint(100 * res.pixelFactor(), -1, RectangleConstraint::Test::Minimum))); } - std::string_view name(const Control* control) const { return m_text; } - void activated(const Button* button, const boo::SWindowCoord&) { m_fb.okActivated(true); } + std::string_view name(const Control* control) const override { return m_text; } + void activated(const Button* button, const boo::SWindowCoord&) override { m_fb.okActivated(true); } } m_ok; void cancelActivated(); @@ -66,11 +66,11 @@ private: res, fb, this, text, nullptr, Button::Style::Block, zeus::skWhite, RectangleConstraint(m_fb.m_ok.m_button.m_view->nominalWidth(), -1, RectangleConstraint::Test::Minimum))); } - std::string_view name(const Control* control) const { return m_text; } - void activated(const Button* button, const boo::SWindowCoord&) { m_fb.cancelActivated(); } + std::string_view name(const Control* control) const override { return m_text; } + void activated(const Button* button, const boo::SWindowCoord&) override { m_fb.cancelActivated(); } } m_cancel; - void pathButtonActivated(size_t idx); + void pathButtonActivated(size_t idx) override; ViewChild> m_pathButtons; ViewChild> m_fileField; @@ -79,8 +79,8 @@ private: std::string m_name; FileFieldBind(FileBrowser& browser, const IViewManager& vm) : m_browser(browser), m_name(vm.translate()) {} - std::string_view name(const Control* control) const { return m_name; } - void changed(const Control* control, std::string_view val) {} + std::string_view name(const Control* control) const override { return m_name; } + void changed(const Control* control, std::string_view val) override {} } m_fileFieldBind; std::unique_ptr m_confirmWindow; @@ -104,10 +104,10 @@ private: std::string m_projStr; std::string m_fileStr; - size_t columnCount() const { return 3; } - size_t rowCount() const { return m_entries.size(); } + size_t columnCount() const override { return 3; } + size_t rowCount() const override { return m_entries.size(); } - std::string_view header(size_t cIdx) const { + std::string_view header(size_t cIdx) const override { switch (cIdx) { case 0: return m_nameCol; @@ -121,7 +121,7 @@ private: return {}; } - std::string_view cell(size_t cIdx, size_t rIdx) const { + std::string_view cell(size_t cIdx, size_t rIdx) const override { switch (cIdx) { case 0: return m_entries.at(rIdx).m_name; @@ -137,11 +137,11 @@ private: float m_columnSplits[3] = {0.0f, 0.7f, 0.9f}; - bool columnSplitResizeAllowed() const { return true; } + bool columnSplitResizeAllowed() const override { return true; } - float getColumnSplit(size_t cIdx) const { return m_columnSplits[cIdx]; } + float getColumnSplit(size_t cIdx) const override { return m_columnSplits[cIdx]; } - void setColumnSplit(size_t cIdx, float split) { m_columnSplits[cIdx] = split; } + void setColumnSplit(size_t cIdx, float split) override { m_columnSplits[cIdx] = split; } void updateListing(const hecl::DirectoryEnumerator& dEnum) { m_entries.clear(); @@ -172,12 +172,12 @@ private: SortDirection m_sortDir = SortDirection::Ascending; bool m_needsUpdate = false; - SortDirection getSort(size_t& cIdx) const { + SortDirection getSort(size_t& cIdx) const override { cIdx = m_sizeSort ? 2 : 0; return m_sortDir; } - void setSort(size_t cIdx, SortDirection dir) { + void setSort(size_t cIdx, SortDirection dir) override { if (cIdx == 1) return; m_sizeSort = cIdx == 2; @@ -185,7 +185,7 @@ private: m_needsUpdate = true; } - void setSelectedRow(size_t rIdx) { + void setSelectedRow(size_t rIdx) override { if (rIdx != SIZE_MAX) m_fb.m_fileField.m_view->setText(m_entries.at(rIdx).m_name); else @@ -193,7 +193,7 @@ private: m_fb.m_fileField.m_view->clearErrorState(); } - void rowActivated(size_t rIdx) { m_fb.okActivated(false); } + void rowActivated(size_t rIdx) override { m_fb.okActivated(false); } FileListingDataBind(FileBrowser& fb, const IViewManager& vm) : m_fb(fb) { m_nameCol = vm.translate(); @@ -233,17 +233,17 @@ private: }; std::vector m_entries; - size_t columnCount() const { return 1; } - size_t rowCount() const { return m_entries.size(); } + size_t columnCount() const override { return 1; } + size_t rowCount() const override { return m_entries.size(); } - std::string_view cell(size_t, size_t rIdx) const { return m_entries.at(rIdx).m_name; } + std::string_view cell(size_t, size_t rIdx) const override { return m_entries.at(rIdx).m_name; } - void setSelectedRow(size_t rIdx) { + void setSelectedRow(size_t rIdx) override { if (rIdx != SIZE_MAX) m_fb.navigateToPath(m_entries.at(rIdx).m_path); } - void rowActivated(size_t rIdx) { m_fb.okActivated(true); } + void rowActivated(size_t rIdx) override { m_fb.okActivated(true); } }; BookmarkDataBind m_systemBookmarkBind; @@ -276,22 +276,22 @@ public: m_showingHidden = showingHidden; navigateToPath(m_path); } - void updateContentOpacity(float opacity); + void updateContentOpacity(float opacity) override; - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseMove(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); - void scroll(const boo::SWindowCoord&, const boo::SScrollDelta&); - void touchDown(const boo::STouchCoord&, uintptr_t); - void touchUp(const boo::STouchCoord&, uintptr_t); - void touchMove(const boo::STouchCoord&, uintptr_t); - void charKeyDown(unsigned long, boo::EModifierKey, bool); - void specialKeyDown(boo::ESpecialKey, boo::EModifierKey, bool); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseMove(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; + void scroll(const boo::SWindowCoord&, const boo::SScrollDelta&) override; + void touchDown(const boo::STouchCoord&, uintptr_t) override; + void touchUp(const boo::STouchCoord&, uintptr_t) override; + void touchMove(const boo::STouchCoord&, uintptr_t) override; + void charKeyDown(unsigned long, boo::EModifierKey, bool) override; + void specialKeyDown(boo::ESpecialKey, boo::EModifierKey, bool) override; - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); - void think(); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override; + void think() override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; }; } // namespace specter diff --git a/specter/include/specter/Icon.hpp b/specter/include/specter/Icon.hpp index 11c45aaa0..f6c789420 100644 --- a/specter/include/specter/Icon.hpp +++ b/specter/include/specter/Icon.hpp @@ -57,8 +57,8 @@ class IconView : public View { public: IconView(ViewResources& res, View& parentView, Icon& icon); - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; }; } // namespace specter diff --git a/specter/include/specter/Menu.hpp b/specter/include/specter/Menu.hpp index 88c445d2a..e6abb7ce4 100644 --- a/specter/include/specter/Menu.hpp +++ b/specter/include/specter/Menu.hpp @@ -34,16 +34,16 @@ class Menu : public View { setHighlightedItem(-1); } - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseMove(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseMove(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, const boo::SWindowRect& scissor); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, const boo::SWindowRect& scissor) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; - int nominalWidth() const { return m_menu.m_cWidth; } - int nominalHeight() const { return m_menu.m_cHeight; } + int nominalWidth() const override { return m_menu.m_cWidth; } + int nominalHeight() const override { return m_menu.m_cHeight; } }; std::unique_ptr m_content; ViewChild> m_scroll; @@ -55,13 +55,13 @@ class Menu : public View { IMenuNode* m_node; ItemView(ViewResources& res, Menu& menu, std::string_view text, size_t idx, IMenuNode* node); - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseEnter(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseEnter(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; }; std::vector>> m_items; IMenuNode* m_deferredActivation = nullptr; @@ -72,15 +72,15 @@ public: Menu(ViewResources& res, View& parentView, IMenuNode* rootNode); void reset(IMenuNode* rootNode); - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseMove(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); - void scroll(const boo::SWindowCoord&, const boo::SScrollDelta&); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseMove(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; + void scroll(const boo::SWindowCoord&, const boo::SScrollDelta&) override; - void think(); - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void think() override; + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; }; } // namespace specter diff --git a/specter/include/specter/MessageWindow.hpp b/specter/include/specter/MessageWindow.hpp index c6cf32e0c..ae4c9ae54 100644 --- a/specter/include/specter/MessageWindow.hpp +++ b/specter/include/specter/MessageWindow.hpp @@ -20,8 +20,8 @@ private: MessageWindow& m_mw; std::string m_name; OKBinding(MessageWindow& mw, std::string_view name) : m_mw(mw), m_name(name) {} - std::string_view name(const Control* control) const { return m_name; } - void activated(const Button* button, const boo::SWindowCoord& coord) { m_mw.m_func(true); } + std::string_view name(const Control* control) const override { return m_name; } + void activated(const Button* button, const boo::SWindowCoord& coord) override { m_mw.m_func(true); } } m_okBind; ViewChild> m_ok; @@ -29,8 +29,8 @@ private: MessageWindow& m_mw; std::string m_name; CancelBinding(MessageWindow& mw, std::string_view name) : m_mw(mw), m_name(name) {} - std::string_view name(const Control* control) const { return m_name; } - void activated(const Button* button, const boo::SWindowCoord& coord) { m_mw.m_func(false); } + std::string_view name(const Control* control) const override { return m_name; } + void activated(const Button* button, const boo::SWindowCoord& coord) override { m_mw.m_func(false); } } m_cancelBind; ViewChild> m_cancel; @@ -38,7 +38,7 @@ public: MessageWindow(ViewResources& res, View& parentView, Type type, std::string_view message, std::function func); - void updateContentOpacity(float opacity) { + void updateContentOpacity(float opacity) override { zeus::CColor color = zeus::CColor::lerp({1, 1, 1, 0}, {1, 1, 1, 1}, opacity); ModalWindow::setMultiplyColor(color); m_text->setMultiplyColor(color); @@ -46,14 +46,14 @@ public: m_cancel.m_view->setMultiplyColor(color); } - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseMove(const boo::SWindowCoord&); - void mouseEnter(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseMove(const boo::SWindowCoord&) override; + void mouseEnter(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; }; } // namespace specter diff --git a/specter/include/specter/ModalWindow.hpp b/specter/include/specter/ModalWindow.hpp index 304aa9f15..87540edd6 100644 --- a/specter/include/specter/ModalWindow.hpp +++ b/specter/include/specter/ModalWindow.hpp @@ -55,14 +55,14 @@ protected: public: ModalWindow(ViewResources& res, View& parentView, const RectangleConstraint& constraint, const zeus::CColor& bgColor); ModalWindow(ViewResources& res, View& parentView, const RectangleConstraint& constraint); - void think(); + void think() override; bool skipBuildInAnimation(); void close(bool skipAnimation = false); bool closed() const { return m_phase >= Phase::BuildOut; } ModalWindow::Phase phase() const { return m_phase; } - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; }; } // namespace specter diff --git a/specter/include/specter/MultiLineTextView.hpp b/specter/include/specter/MultiLineTextView.hpp index 56a8560c3..b6e1c5ef1 100644 --- a/specter/include/specter/MultiLineTextView.hpp +++ b/specter/include/specter/MultiLineTextView.hpp @@ -31,16 +31,16 @@ public: void colorGlyphs(const zeus::CColor& newColor); - void setMultiplyColor(const zeus::CColor& color) { + void setMultiplyColor(const zeus::CColor& color) override { for (std::unique_ptr& l : m_lines) l->setMultiplyColor(color); } - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; - int nominalWidth() const { return m_width; } - int nominalHeight() const { return (int(m_lineHeight * m_fontAtlas.FT_LineHeight()) >> 6) * m_lines.size(); } + int nominalWidth() const override { return m_width; } + int nominalHeight() const override { return (int(m_lineHeight * m_fontAtlas.FT_LineHeight()) >> 6) * m_lines.size(); } }; } // namespace specter diff --git a/specter/include/specter/NumericField.hpp b/specter/include/specter/NumericField.hpp index 01b055a2b..16d98e12a 100644 --- a/specter/include/specter/NumericField.hpp +++ b/specter/include/specter/NumericField.hpp @@ -34,16 +34,16 @@ public: }; NumericField(ViewResources& res, View& parentView, std::string_view text); - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseEnter(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); - void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseEnter(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; + void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; void setText(std::string_view text); - int nominalWidth() const { return m_nomWidth; } - int nominalHeight() const { return m_nomHeight; } + int nominalWidth() const override { return m_nomWidth; } + int nominalHeight() const override { return m_nomHeight; } }; } // namespace specter diff --git a/specter/include/specter/Outliner.hpp b/specter/include/specter/Outliner.hpp index ee5ce153a..fdce1e224 100644 --- a/specter/include/specter/Outliner.hpp +++ b/specter/include/specter/Outliner.hpp @@ -24,13 +24,13 @@ class Outliner { }; Node(ViewResources& res, View& parentView, std::string_view description); - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseEnter(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); - void think(); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseEnter(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; + void think() override; }; }; } // namespace specter diff --git a/specter/include/specter/PathButtons.hpp b/specter/include/specter/PathButtons.hpp index 0ebeaebe5..cac69bb68 100644 --- a/specter/include/specter/PathButtons.hpp +++ b/specter/include/specter/PathButtons.hpp @@ -14,23 +14,23 @@ class PathButtons : public ScrollView { PathButtons& m_pb; boo::SWindowRect m_scissorRect; - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseMove(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseMove(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; - int nominalWidth() const { + int nominalWidth() const override { int ret = 0; for (PathButton& b : m_pb.m_pathButtons) ret += b.m_button.m_view->nominalWidth() + 2; return ret; } - int nominalHeight() const { + int nominalHeight() const override { return m_pb.m_pathButtons.size() ? m_pb.m_pathButtons[0].m_button.m_view->nominalHeight() : 0; } - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, const boo::SWindowRect& scissor); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, const boo::SWindowRect& scissor) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; ContentView(ViewResources& res, PathButtons& pb) : View(res, pb), m_pb(pb) {} }; @@ -46,8 +46,8 @@ class PathButtons : public ScrollView { PathButton(PathButtons& pb, ViewResources& res, size_t idx, const hecl::SystemString& str) : m_pb(pb), m_idx(idx) { m_button.m_view.reset(new Button(res, pb, this, hecl::SystemUTF8Conv(str).str())); } - std::string_view name(const Control* control) const { return m_button.m_view->getText(); } - void activated(const Button* button, const boo::SWindowCoord&) { m_pb.m_pathButtonPending = m_idx; } + std::string_view name(const Control* control) const override { return m_button.m_view->getText(); } + void activated(const Button* button, const boo::SWindowCoord&) override { m_pb.m_pathButtonPending = m_idx; } }; friend struct PathButton; std::vector m_pathButtons; @@ -56,10 +56,10 @@ public: PathButtons(ViewResources& res, View& parentView, IPathButtonsBinding& binding, bool fillContainer = false); void setButtons(const std::vector& comps); - void setMultiplyColor(const zeus::CColor& color); + void setMultiplyColor(const zeus::CColor& color) override; /* Fill all available space in container when requested */ - void containerResized(const boo::SWindowRect& root, const boo::SWindowRect& sub); + void containerResized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override; }; } // namespace specter diff --git a/specter/include/specter/RootView.hpp b/specter/include/specter/RootView.hpp index 0271cfef6..7979a2467 100644 --- a/specter/include/specter/RootView.hpp +++ b/specter/include/specter/RootView.hpp @@ -65,9 +65,9 @@ class RootView : public View { void draw(boo::IGraphicsCommandQueue* gfxQ); SplitMenuSystem(RootView& rv, boo::IGraphicsDataFactory::Context& ctx); - const std::string* text() const { return &m_text; } - size_t subNodeCount() const { return 2; } - IMenuNode* subNode(size_t idx) { + const std::string* text() const override { return &m_text; } + size_t subNodeCount() const override { return 2; } + IMenuNode* subNode(size_t idx) override { if (idx) return &m_joinActionNode; else @@ -82,8 +82,8 @@ class RootView : public View { SplitMenuSystem& m_smn; std::string m_text; SplitActionNode(SplitMenuSystem& smn); - const std::string* text() const { return &m_text; } - void activated(const boo::SWindowCoord& coord) { + const std::string* text() const override { return &m_text; } + void activated(const boo::SWindowCoord& coord) override { m_smn.m_deferredSplit = true; m_smn.m_deferredCoord = coord; } @@ -92,8 +92,8 @@ class RootView : public View { SplitMenuSystem& m_smn; std::string m_text; JoinActionNode(SplitMenuSystem& smn); - const std::string* text() const { return &m_text; } - void activated(const boo::SWindowCoord& coord) { + const std::string* text() const override { return &m_text; } + void activated(const boo::SWindowCoord& coord) override { m_smn.m_deferredJoin = true; m_smn.m_deferredCoord = coord; } @@ -103,7 +103,7 @@ class RootView : public View { public: RootView(IViewManager& viewMan, ViewResources& res, boo::IWindow* window); - ~RootView(); + ~RootView() override; void destroyed(); bool isDestroyed() const { return m_destroyed; } @@ -112,29 +112,29 @@ public: #pragma GCC diagnostic ignored "-Woverloaded-virtual" void resized(const boo::SWindowRect& rect, bool) { resized(rect, rect); } #pragma GCC diagnostic pop - void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub); - void mouseDown(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods); - void mouseUp(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods); - void mouseMove(const boo::SWindowCoord& coord); - void mouseEnter(const boo::SWindowCoord& coord); - void mouseLeave(const boo::SWindowCoord& coord); - void scroll(const boo::SWindowCoord& coord, const boo::SScrollDelta& scroll); + void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub) override; + void mouseDown(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods) override; + void mouseUp(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods) override; + void mouseMove(const boo::SWindowCoord& coord) override; + void mouseEnter(const boo::SWindowCoord& coord) override; + void mouseLeave(const boo::SWindowCoord& coord) override; + void scroll(const boo::SWindowCoord& coord, const boo::SScrollDelta& scroll) override; - void touchDown(const boo::STouchCoord& coord, uintptr_t tid); - void touchUp(const boo::STouchCoord& coord, uintptr_t tid); - void touchMove(const boo::STouchCoord& coord, uintptr_t tid); + void touchDown(const boo::STouchCoord& coord, uintptr_t tid) override; + void touchUp(const boo::STouchCoord& coord, uintptr_t tid) override; + void touchMove(const boo::STouchCoord& coord, uintptr_t tid) override; - void charKeyDown(unsigned long charCode, boo::EModifierKey mods, bool isRepeat); - void charKeyUp(unsigned long charCode, boo::EModifierKey mods); - void specialKeyDown(boo::ESpecialKey key, boo::EModifierKey mods, bool isRepeat); - void specialKeyUp(boo::ESpecialKey key, boo::EModifierKey mods); - void modKeyDown(boo::EModifierKey mod, bool isRepeat); - void modKeyUp(boo::EModifierKey mod); + void charKeyDown(unsigned long charCode, boo::EModifierKey mods, bool isRepeat) override; + void charKeyUp(unsigned long charCode, boo::EModifierKey mods) override; + void specialKeyDown(boo::ESpecialKey key, boo::EModifierKey mods, bool isRepeat) override; + void specialKeyUp(boo::ESpecialKey key, boo::EModifierKey mods) override; + void modKeyDown(boo::EModifierKey mod, bool isRepeat) override; + void modKeyUp(boo::EModifierKey mod) override; boo::ITextInputCallback* getTextInputCallback() { return m_activeTextView; } void internalThink(); void dispatchEvents() { m_events.dispatchEvents(); } - void draw(boo::IGraphicsCommandQueue* gfxQ); + void draw(boo::IGraphicsCommandQueue* gfxQ) override; const boo::SWindowRect& rootRect() const { return m_rootRect; } boo::IWindow* window() const { return m_window; } diff --git a/specter/include/specter/ScrollView.hpp b/specter/include/specter/ScrollView.hpp index 667491810..9b528e5c2 100644 --- a/specter/include/specter/ScrollView.hpp +++ b/specter/include/specter/ScrollView.hpp @@ -34,17 +34,19 @@ private: : m_sv(sv) , m_leftName(vm.translate()) , m_rightName(vm.translate()) {} - std::string_view name(const Control* control) const { + std::string_view name(const Control* control) const override { return (control == reinterpret_cast(m_sv.m_sideButtons[0].m_view.get())) ? m_leftName.c_str() : m_rightName.c_str(); } - void down(const Button* button, const boo::SWindowCoord& coord) { + void down(const Button* button, const boo::SWindowCoord& coord) override { if (button == m_sv.m_sideButtons[0].m_view.get()) m_sv.m_sideButtonState = SideButtonState::ScrollRight; else m_sv.m_sideButtonState = SideButtonState::ScrollLeft; } - void up(const Button* button, const boo::SWindowCoord& coord) { m_sv.m_sideButtonState = SideButtonState::None; } + void up(const Button* button, const boo::SWindowCoord& coord) override { + m_sv.m_sideButtonState = SideButtonState::None; + } } m_sideButtonBind; ViewChild> m_sideButtons[2]; @@ -58,23 +60,23 @@ public: updateSize(); } - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseMove(const boo::SWindowCoord&); - void mouseEnter(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); - void scroll(const boo::SWindowCoord& coord, const boo::SScrollDelta& scroll); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseMove(const boo::SWindowCoord&) override; + void mouseEnter(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; + void scroll(const boo::SWindowCoord& coord, const boo::SScrollDelta& scroll) override; int getScrollX() const { return m_scroll[0]; } int getScrollY() const { return m_scroll[1]; } - int nominalWidth() const { return subRect().size[0]; } - int nominalHeight() const { return subRect().size[1]; } + int nominalWidth() const override { return subRect().size[0]; } + int nominalHeight() const override { return subRect().size[1]; } - void setMultiplyColor(const zeus::CColor& color); + void setMultiplyColor(const zeus::CColor& color) override; - void think(); - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void think() override; + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; }; } // namespace specter diff --git a/specter/include/specter/Space.hpp b/specter/include/specter/Space.hpp index 8f257adf5..18aebf71d 100644 --- a/specter/include/specter/Space.hpp +++ b/specter/include/specter/Space.hpp @@ -34,13 +34,13 @@ class Space : public View { VertexBufferBindingSolid m_vertexBinding; bool m_flip; CornerView(ViewResources& res, Space& space, const zeus::CColor& triColor); - void mouseEnter(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); + void mouseEnter(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; using View::resized; void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, bool flip); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void draw(boo::IGraphicsCommandQueue* gfxQ) override; }; friend struct CornerView; ViewChild> m_cornerView; @@ -50,17 +50,17 @@ public: unsigned tbUnits); View* setContentView(View* view); Toolbar* toolbar() { return m_toolbar.m_view.get(); } - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseMove(const boo::SWindowCoord&); - void mouseEnter(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); - void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseMove(const boo::SWindowCoord&) override; + void mouseEnter(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; + void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; SplitView* findSplitViewOnSide(SplitView::Axis axis, int side); - void setMultiplyColor(const zeus::CColor& color) { + void setMultiplyColor(const zeus::CColor& color) override { View::setMultiplyColor(color); if (m_contentView.m_view) m_contentView.m_view->setMultiplyColor(color); @@ -68,7 +68,7 @@ public: m_toolbar.m_view->setMultiplyColor(color); } - bool isSpace() const { return true; } + bool isSpace() const override { return true; } }; inline Space* View::castToSpace() { return isSpace() ? static_cast(this) : nullptr; } diff --git a/specter/include/specter/SplitView.hpp b/specter/include/specter/SplitView.hpp index 0f099b8a4..f9000feda 100644 --- a/specter/include/specter/SplitView.hpp +++ b/specter/include/specter/SplitView.hpp @@ -79,15 +79,15 @@ public: void startDragSplit(const boo::SWindowCoord& coord); void endDragSplit(); void moveDragSplit(const boo::SWindowCoord& coord); - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseMove(const boo::SWindowCoord&); - void mouseEnter(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); - void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseMove(const boo::SWindowCoord&) override; + void mouseEnter(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; + void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; - void setMultiplyColor(const zeus::CColor& color) { + void setMultiplyColor(const zeus::CColor& color) override { View::setMultiplyColor(color); m_splitBlock.m_color = color; m_splitBlockBuf.access().finalAssign(m_splitBlock); @@ -98,7 +98,7 @@ public: m_views[1].m_view->setMultiplyColor(color); } - bool isSplitView() const { return true; } + bool isSplitView() const override { return true; } }; inline SplitView* View::castToSplitView() { return isSplitView() ? static_cast(this) : nullptr; } diff --git a/specter/include/specter/Table.hpp b/specter/include/specter/Table.hpp index 6191de33c..455a1a755 100644 --- a/specter/include/specter/Table.hpp +++ b/specter/include/specter/Table.hpp @@ -56,12 +56,12 @@ class Table : public View { bool reset(size_t c); bool reset(size_t c, size_t r); - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseEnter(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, const boo::SWindowRect& scissor); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseEnter(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, const boo::SWindowRect& scissor) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; }; std::vector>> m_headerViews; using ColumnPool = std::array>, SPECTER_TABLE_MAX_ROWS>, 2>; @@ -93,14 +93,14 @@ class Table : public View { void _setRowVerts(const boo::SWindowRect& rowsRect, const boo::SWindowRect& scissor); RowsView(Table& t, ViewResources& res); - int nominalHeight() const; - int nominalWidth() const { return m_t.m_scroll.m_view->nominalWidth(); } - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseMove(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, const boo::SWindowRect& scissor); - void draw(boo::IGraphicsCommandQueue* gfxQ); + int nominalHeight() const override; + int nominalWidth() const override { return m_t.m_scroll.m_view->nominalWidth(); } + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseMove(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, const boo::SWindowRect& scissor) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; } m_rowsView; bool m_headerNeedsUpdate = false; @@ -114,19 +114,19 @@ public: void cycleSortColumn(size_t c); void selectRow(size_t r); - void setMultiplyColor(const zeus::CColor& color); + void setMultiplyColor(const zeus::CColor& color) override; - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseMove(const boo::SWindowCoord&); - void mouseEnter(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); - void scroll(const boo::SWindowCoord&, const boo::SScrollDelta&); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseMove(const boo::SWindowCoord&) override; + void mouseEnter(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; + void scroll(const boo::SWindowCoord&, const boo::SScrollDelta&) override; - void think(); + void think() override; void updateData(); - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; }; } // namespace specter diff --git a/specter/include/specter/TextField.hpp b/specter/include/specter/TextField.hpp index a25d8d110..7b668c840 100644 --- a/specter/include/specter/TextField.hpp +++ b/specter/include/specter/TextField.hpp @@ -64,37 +64,38 @@ public: std::string_view getText() const { return m_textStr; } void setText(std::string_view str); - void clipboardCopy(); - void clipboardCut(); - void clipboardPaste(); + void clipboardCopy() override; + void clipboardCut() override; + void clipboardPaste() override; - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseMove(const boo::SWindowCoord&); - void mouseEnter(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord&); - void specialKeyDown(boo::ESpecialKey, boo::EModifierKey, bool); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseMove(const boo::SWindowCoord&) override; + void mouseEnter(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord&) override; + void specialKeyDown(boo::ESpecialKey, boo::EModifierKey, bool) override; - bool hasMarkedText() const; - std::pair markedRange() const; - std::pair selectedRange() const; + bool hasMarkedText() const override; + std::pair markedRange() const override; + std::pair selectedRange() const override; void setMarkedText(std::string_view str, const std::pair& selectedRange, - const std::pair& replacementRange); - void unmarkText(); + const std::pair& replacementRange) override; + void unmarkText() override; - std::string substringForRange(const std::pair& range, std::pair& actualRange) const; - void insertText(std::string_view str, const std::pair& range); - int characterIndexAtPoint(const boo::SWindowCoord& point) const; - boo::SWindowRect rectForCharacterRange(const std::pair& range, std::pair& actualRange) const; + std::string substringForRange(const std::pair& range, std::pair& actualRange) const override; + void insertText(std::string_view str, const std::pair& range) override; + int characterIndexAtPoint(const boo::SWindowCoord& point) const override; + boo::SWindowRect rectForCharacterRange(const std::pair& range, + std::pair& actualRange) const override; - void think(); - void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void think() override; + void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; - int nominalWidth() const { return m_nomWidth; } - int nominalHeight() const { return m_nomHeight; } + int nominalWidth() const override { return m_nomWidth; } + int nominalHeight() const override { return m_nomHeight; } - void setActive(bool active); + void setActive(bool active) override; void setCursorPos(size_t pos); void setErrorState(std::string_view message); void clearErrorState(); @@ -102,7 +103,7 @@ public: void setSelectionRange(size_t start, size_t count); void clearSelectionRange(); - void setMultiplyColor(const zeus::CColor& color) { + void setMultiplyColor(const zeus::CColor& color) override { View::setMultiplyColor(color); m_viewVertBlock.m_color = color; if (m_viewVertBlockBuf) diff --git a/specter/include/specter/TextView.hpp b/specter/include/specter/TextView.hpp index 4a633b351..394a028a0 100644 --- a/specter/include/specter/TextView.hpp +++ b/specter/include/specter/TextView.hpp @@ -95,13 +95,13 @@ public: void colorGlyphs(const zeus::CColor& newColor); void colorGlyphsTypeOn(const zeus::CColor& newColor, float startInterval = 0.2, float fadeTime = 0.5); - void think(); + void think() override; - void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; - int nominalWidth() const { return m_width; } - int nominalHeight() const { return m_fontAtlas.FT_LineHeight() >> 6; } + int nominalWidth() const override { return m_width; } + int nominalHeight() const override { return m_fontAtlas.FT_LineHeight() >> 6; } std::pair queryGlyphDimensions(size_t pos) const; size_t reverseSelectGlyph(int x) const; diff --git a/specter/include/specter/Toolbar.hpp b/specter/include/specter/Toolbar.hpp index a0cafea0d..ce2a4abd7 100644 --- a/specter/include/specter/Toolbar.hpp +++ b/specter/include/specter/Toolbar.hpp @@ -35,15 +35,15 @@ private: public: Toolbar(ViewResources& res, View& parentView, Position toolbarPos, unsigned units); - void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey); - void mouseMove(const boo::SWindowCoord&); - void mouseEnter(const boo::SWindowCoord&); - void mouseLeave(const boo::SWindowCoord& coord); - void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override; + void mouseMove(const boo::SWindowCoord&) override; + void mouseEnter(const boo::SWindowCoord&) override; + void mouseLeave(const boo::SWindowCoord& coord) override; + void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; - int nominalHeight() const { return m_nomGauge; } + int nominalHeight() const override { return m_nomGauge; } void clear() { for (std::vector>& u : m_children) @@ -51,7 +51,7 @@ public: } void push_back(View* v, unsigned unit); - void setMultiplyColor(const zeus::CColor& color) { + void setMultiplyColor(const zeus::CColor& color) override { View::setMultiplyColor(color); for (std::vector>& u : m_children) for (ViewChild& c : u) diff --git a/specter/include/specter/Tooltip.hpp b/specter/include/specter/Tooltip.hpp index 9c4e1b6c8..12ef3cb0a 100644 --- a/specter/include/specter/Tooltip.hpp +++ b/specter/include/specter/Tooltip.hpp @@ -26,11 +26,11 @@ class Tooltip : public View { public: Tooltip(ViewResources& res, View& parentView, std::string_view title, std::string_view message); - void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub); - void draw(boo::IGraphicsCommandQueue* gfxQ); + void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub) override; + void draw(boo::IGraphicsCommandQueue* gfxQ) override; - int nominalWidth() const { return m_nomWidth; } - int nominalHeight() const { return m_nomHeight; } + int nominalWidth() const override { return m_nomWidth; } + int nominalHeight() const override { return m_nomHeight; } }; } // namespace specter diff --git a/specter/include/specter/ViewResources.hpp b/specter/include/specter/ViewResources.hpp index fd6080365..2d64ff0e6 100644 --- a/specter/include/specter/ViewResources.hpp +++ b/specter/include/specter/ViewResources.hpp @@ -99,48 +99,48 @@ class DefaultThemeData : public IThemeData { zeus::CColor m_spaceTriangleShading2 = {0.5725, 0.5725, 0.5725, 1.0}; public: - virtual const zeus::CColor& uiText() const { return m_uiText; } - virtual const zeus::CColor& uiAltText() const { return m_uiAltText; } - virtual const zeus::CColor& fieldText() const { return m_fieldText; } - virtual const zeus::CColor& fieldMarkedText() const { return m_fieldMarkedText; } - virtual const zeus::CColor& selectedFieldText() const { return m_selectedFieldText; } + const zeus::CColor& uiText() const override { return m_uiText; } + const zeus::CColor& uiAltText() const override { return m_uiAltText; } + const zeus::CColor& fieldText() const override { return m_fieldText; } + const zeus::CColor& fieldMarkedText() const override { return m_fieldMarkedText; } + const zeus::CColor& selectedFieldText() const override { return m_selectedFieldText; } - virtual const zeus::CColor& viewportBackground() const { return m_vpBg; } - virtual const zeus::CColor& toolbarBackground() const { return m_tbBg; } - virtual const zeus::CColor& tooltipBackground() const { return m_tooltipBg; } - virtual const zeus::CColor& spaceBackground() const { return m_spaceBg; } - virtual const zeus::CColor& splashBackground() const { return m_splashBg; } - virtual const zeus::CColor& splashErrorBackground() const { return m_splashErrorBg; } + const zeus::CColor& viewportBackground() const override { return m_vpBg; } + const zeus::CColor& toolbarBackground() const override { return m_tbBg; } + const zeus::CColor& tooltipBackground() const override { return m_tooltipBg; } + const zeus::CColor& spaceBackground() const override { return m_spaceBg; } + const zeus::CColor& splashBackground() const override { return m_splashBg; } + const zeus::CColor& splashErrorBackground() const override { return m_splashErrorBg; } - virtual const zeus::CColor& splash1() const { return m_splash1; } - virtual const zeus::CColor& splash2() const { return m_splash2; } + const zeus::CColor& splash1() const override { return m_splash1; } + const zeus::CColor& splash2() const override { return m_splash2; } - virtual const zeus::CColor& button1Inactive() const { return m_button1Inactive; } - virtual const zeus::CColor& button2Inactive() const { return m_button2Inactive; } - virtual const zeus::CColor& button1Hover() const { return m_button1Hover; } - virtual const zeus::CColor& button2Hover() const { return m_button2Hover; } - virtual const zeus::CColor& button1Press() const { return m_button1Press; } - virtual const zeus::CColor& button2Press() const { return m_button2Press; } - virtual const zeus::CColor& button1Disabled() const { return m_button1Disabled; } - virtual const zeus::CColor& button2Disabled() const { return m_button2Disabled; } + const zeus::CColor& button1Inactive() const override { return m_button1Inactive; } + const zeus::CColor& button2Inactive() const override { return m_button2Inactive; } + const zeus::CColor& button1Hover() const override { return m_button1Hover; } + const zeus::CColor& button2Hover() const override { return m_button2Hover; } + const zeus::CColor& button1Press() const override { return m_button1Press; } + const zeus::CColor& button2Press() const override { return m_button2Press; } + const zeus::CColor& button1Disabled() const override { return m_button1Disabled; } + const zeus::CColor& button2Disabled() const override { return m_button2Disabled; } - virtual const zeus::CColor& textfield1Inactive() const { return m_textfield1Inactive; } - virtual const zeus::CColor& textfield2Inactive() const { return m_textfield2Inactive; } - virtual const zeus::CColor& textfield1Hover() const { return m_textfield1Hover; } - virtual const zeus::CColor& textfield2Hover() const { return m_textfield2Hover; } - virtual const zeus::CColor& textfield1Disabled() const { return m_textfield1Disabled; } - virtual const zeus::CColor& textfield2Disabled() const { return m_textfield2Disabled; } - virtual const zeus::CColor& textfieldSelection() const { return m_textfieldSelection; } - virtual const zeus::CColor& textfieldMarkSelection() const { return m_textfieldMarkSelection; } + const zeus::CColor& textfield1Inactive() const override { return m_textfield1Inactive; } + const zeus::CColor& textfield2Inactive() const override { return m_textfield2Inactive; } + const zeus::CColor& textfield1Hover() const override { return m_textfield1Hover; } + const zeus::CColor& textfield2Hover() const override { return m_textfield2Hover; } + const zeus::CColor& textfield1Disabled() const override { return m_textfield1Disabled; } + const zeus::CColor& textfield2Disabled() const override { return m_textfield2Disabled; } + const zeus::CColor& textfieldSelection() const override { return m_textfieldSelection; } + const zeus::CColor& textfieldMarkSelection() const override { return m_textfieldMarkSelection; } - virtual const zeus::CColor& tableCellBg1() const { return m_tableCellBg1; } - virtual const zeus::CColor& tableCellBg2() const { return m_tableCellBg2; } - virtual const zeus::CColor& tableCellBgSelected() const { return m_tableCellBgSelected; } + const zeus::CColor& tableCellBg1() const override { return m_tableCellBg1; } + const zeus::CColor& tableCellBg2() const override { return m_tableCellBg2; } + const zeus::CColor& tableCellBgSelected() const override { return m_tableCellBgSelected; } - virtual const zeus::CColor& scrollIndicator() const { return m_scrollIndicator; } + const zeus::CColor& scrollIndicator() const override { return m_scrollIndicator; } - virtual const zeus::CColor& spaceTriangleShading1() const { return m_spaceTriangleShading1; } - virtual const zeus::CColor& spaceTriangleShading2() const { return m_spaceTriangleShading2; } + const zeus::CColor& spaceTriangleShading1() const override { return m_spaceTriangleShading1; } + const zeus::CColor& spaceTriangleShading2() const override { return m_spaceTriangleShading2; } }; class ViewResources {