From 4fe97acbc9a4472886c428adfae9613ef6ec490b Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Mon, 17 Sep 2018 12:53:34 -0400 Subject: [PATCH] Define CellularPanel::Root --- src/AdornedRulerPanel.cpp | 5 +++++ src/AdornedRulerPanel.h | 5 +++++ src/CellularPanel.h | 6 ++++++ src/TrackPanel.cpp | 5 +++++ src/TrackPanel.h | 4 ++++ 5 files changed, 25 insertions(+) diff --git a/src/AdornedRulerPanel.cpp b/src/AdornedRulerPanel.cpp index b73343d57..7e8af675f 100644 --- a/src/AdornedRulerPanel.cpp +++ b/src/AdornedRulerPanel.cpp @@ -2102,6 +2102,11 @@ void AdornedRulerPanel::GetMaxSize(wxCoord *width, wxCoord *height) } // CellularPanel implementation +std::shared_ptr AdornedRulerPanel::Root() +{ + return {}; +} + auto AdornedRulerPanel::FindCell(int mouseX, int mouseY) -> FoundCell { bool mayScrub = mProject->GetScrubber().CanScrub() && diff --git a/src/AdornedRulerPanel.h b/src/AdornedRulerPanel.h index bbbc86ea2..999b892ae 100644 --- a/src/AdornedRulerPanel.h +++ b/src/AdornedRulerPanel.h @@ -172,6 +172,11 @@ private: // // CellularPanel implementation // + + // Get the root object defining a recursive subdivision of the panel's + // area into cells + std::shared_ptr Root() override; + FoundCell FindCell(int mouseX, int mouseY) override; wxRect FindRect(const TrackPanelCell &cell) override; public: diff --git a/src/CellularPanel.h b/src/CellularPanel.h index 00eda5f5e..19b96e32f 100644 --- a/src/CellularPanel.h +++ b/src/CellularPanel.h @@ -18,6 +18,7 @@ class ViewInfo; class AudacityProject; class TrackPanelCell; +class TrackPanelNode; struct TrackPanelMouseEvent; struct TrackPanelMouseState; @@ -47,6 +48,11 @@ public: std::shared_ptr pCell; wxRect rect; }; + + // Get the root object defining a recursive subdivision of the panel's + // area into cells + virtual std::shared_ptr Root() = 0; + virtual FoundCell FindCell(int mouseX, int mouseY) = 0; virtual wxRect FindRect(const TrackPanelCell &cell) = 0; virtual TrackPanelCell *GetFocusedCell() = 0; diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index fd02d99c2..44c60fda0 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -1956,6 +1956,11 @@ void TrackPanel::DrawShadow(const Track * /* t */ , wxDC * dc, const wxRect & re AColor::Line(*dc, right, rect.y, right, rect.y + 1); } +std::shared_ptr TrackPanel::Root() +{ + return {}; +} + /// Determines which cell is under the mouse /// @param mouseX - mouse X position. /// @param mouseY - mouse Y position. diff --git a/src/TrackPanel.h b/src/TrackPanel.h index 12a73bba5..e1bc38b4b 100644 --- a/src/TrackPanel.h +++ b/src/TrackPanel.h @@ -337,6 +337,10 @@ protected: void MakeParentModifyState(bool bWantsAutoSave); // if true, writes auto-save file. Should set only if you really want the state change restored after // a crash, as it can take many seconds for large (eg. 10 track-hours) projects + // Get the root object defining a recursive subdivision of the panel's + // area into cells + std::shared_ptr Root() override; + // Find track info by coordinate FoundCell FindCell(int mouseX, int mouseY) override;