1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-04 13:40:58 +01:00

Bug2180: Type-to-create labels twice should work...

Bug began at 0750f62e88

Track::SetSelected is virtual, after all, but then LabelTrack informs
LabelTrackView of selection changes by events, so that LabelTrack remains
independent of LabelTrackView.

This might make much of the rest of the guily commit unnecessary (the resetting
of selected index to -1 only lazily), but it is harmless.
This commit is contained in:
Paul Licameli
2019-07-31 15:31:09 -04:00
parent 37eab87bff
commit e589ed8ecf
5 changed files with 36 additions and 3 deletions

View File

@@ -97,6 +97,8 @@ class AUDACITY_DLL_API LabelTrack final
void SetOffset(double dOffset) override;
void SetSelected(bool s) override;
double GetOffset() const override;
double GetStartTime() const override;
double GetEndTime() const override;
@@ -192,12 +194,13 @@ struct LabelTrackEvent : TrackListEvent
// wxWidgets will own the event object
return safenew LabelTrackEvent(*this); }
// invalid for selection events
wxString mTitle;
// invalid for addition event
// invalid for addition and selection events
int mFormerPosition{ -1 };
// invalid for deletion event
// invalid for deletion and selection events
int mPresentPosition{ -1 };
};
@@ -212,4 +215,8 @@ wxDECLARE_EXPORTED_EVENT(AUDACITY_DLL_API,
// Posted when a label is repositioned in the sequence of labels.
wxDECLARE_EXPORTED_EVENT(AUDACITY_DLL_API,
EVT_LABELTRACK_PERMUTED, LabelTrackEvent);
// Posted when the track is selected or unselected.
wxDECLARE_EXPORTED_EVENT(AUDACITY_DLL_API,
EVT_LABELTRACK_SELECTION, LabelTrackEvent);
#endif