1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 16:37:12 +01:00

Track::SetSelected is not virtual...

... which will simplify later rewrites that associate selection state with
the track group, not the track.

Since LabelTrack isn't notified immediately of selection changes, instead it
always tests whether it is selected, before using the stored selected label
index.
This commit is contained in:
Paul Licameli
2018-12-06 15:27:03 -05:00
parent 0cecc6e48d
commit 0750f62e88
4 changed files with 36 additions and 30 deletions

View File

@@ -130,7 +130,7 @@ class AUDACITY_DLL_API LabelTrack final : public Track
void Draw( TrackPanelDrawingContext &context, const wxRect & r ) const;
int getSelectedIndex() const { return mSelIndex; }
int GetSelectedIndex() const;
double GetOffset() const override;
double GetStartTime() const override;
@@ -142,8 +142,6 @@ private:
Track::Holder Clone() const override;
public:
void SetSelected(bool s) override;
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override;
XMLTagHandler *HandleXMLChild(const wxChar *tag) override;
void WriteXML(XMLWriter &xmlFile) const override;
@@ -258,7 +256,7 @@ public:
void ShowContextMenu();
void OnContextMenu(wxCommandEvent & evt);
int mSelIndex; /// Keeps track of the currently selected label
mutable int mSelIndex; /// Keeps track of the currently selected label
int mxMouseDisplacement; /// Displacement of mouse cursor from the centre being dragged.
LabelArray mLabels;