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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user