1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-16 08:34:10 +02:00

Handles mark need for highlight in new Enter() method not ctor...

... So this can be called more than once in its lifetime, in response to
TAB key rotation.
This commit is contained in:
Paul Licameli 2017-07-12 00:28:49 -04:00
parent 4ec6baf059
commit d7738c403f
25 changed files with 78 additions and 1 deletions

View File

@ -916,6 +916,9 @@ void TrackPanel::HandleMotion( const TrackPanelMouseState &tpmState )
if (!oldCell && oldHandle != handle)
// Did not move cell to cell, but did change the target
refreshCode = updateFlags;
if (handle)
handle->Enter();
}
// UIHANDLE PREVIEW

View File

@ -15,6 +15,10 @@ UIHandle::~UIHandle()
{
}
void UIHandle::Enter()
{
}
void UIHandle::DrawExtras
(DrawingPass, wxDC *, const wxRegion &, const wxRect &)
{

View File

@ -47,6 +47,10 @@ public:
virtual ~UIHandle() = 0;
// Before clicking, the handle is notified that it has been "hit"
// Default does nothing.
virtual void Enter();
// Assume hit test (implemented in other classes) was positive.
// May return Cancelled, overriding the hit test decision and stopping drag.
// Otherwise the framework will later call Release or Cancel after

View File

@ -29,6 +29,10 @@ LabelGlyphHandle::LabelGlyphHandle
: mpLT{ pLT }
, mRect{ rect }
, mHit{ hit }
{
}
void LabelGlyphHandle::Enter()
{
mChangeHighlight = RefreshCode::RefreshCell;
}

View File

@ -54,6 +54,8 @@ public:
virtual ~LabelGlyphHandle();
void Enter() override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -24,6 +24,10 @@ LabelTextHandle::LabelTextHandle
: mpLT{ pLT }
, mLabelNum{ labelNum }
{
}
void LabelTextHandle::Enter()
{
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;
#endif

View File

@ -38,6 +38,8 @@ public:
std::shared_ptr<LabelTrack> GetTrack() const { return mpLT.lock(); }
int GetLabelNum() const { return mLabelNum; }
void Enter() override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -24,6 +24,10 @@ NoteTrackButtonHandle::NoteTrackButtonHandle
: mpTrack{ pTrack }
, mChannel{ channel }
, mRect{ rect }
{
}
void NoteTrackButtonHandle::Enter()
{
mChangeHighlight = RefreshCode::RefreshCell;
}

View File

@ -47,6 +47,8 @@ public:
const NoteTrackButtonHandle &newState);
protected:
void Enter() override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -40,6 +40,10 @@ NoteTrackVZoomHandle::NoteTrackVZoomHandle
: mZoomStart(y), mZoomEnd(y), mRect(rect)
, mpTrack{ pTrack }
{
}
void NoteTrackVZoomHandle::Enter()
{
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;
#endif

View File

@ -38,6 +38,8 @@ public:
std::shared_ptr<NoteTrack> GetTrack() const { return mpTrack.lock(); }
void Enter() override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -28,6 +28,10 @@ CutlineHandle::CutlineHandle
: mpTrack{ pTrack }
, mLocation{ location }
{
}
void CutlineHandle::Enter()
{
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;
#endif

View File

@ -45,6 +45,8 @@ public:
const WaveTrackLocation &GetLocation() { return mLocation; }
std::shared_ptr<WaveTrack> GetTrack() { return mpTrack; }
void Enter() override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -38,6 +38,10 @@ static const double SMOOTHING_PROPORTION_MIN = 0.0;
SampleHandle::SampleHandle( const std::shared_ptr<WaveTrack> &pTrack )
: mClickedTrack{ pTrack }
{
}
void SampleHandle::Enter()
{
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;
#endif

View File

@ -46,6 +46,8 @@ public:
std::shared_ptr<WaveTrack> GetTrack() const { return mClickedTrack; }
void Enter() override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -49,6 +49,10 @@ WaveTrackVZoomHandle::WaveTrackVZoomHandle
: mZoomStart(y), mZoomEnd(y), mRect(rect)
, mpTrack{ pTrack }
{
}
void WaveTrackVZoomHandle::Enter()
{
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;
#endif

View File

@ -38,6 +38,8 @@ public:
std::shared_ptr<WaveTrack> GetTrack() const { return mpTrack.lock(); }
void Enter() override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -25,13 +25,17 @@ ButtonHandle::ButtonHandle
: mpTrack{ pTrack }
, mRect{ rect }
{
mChangeHighlight = RefreshCode::RefreshCell;
}
ButtonHandle::~ButtonHandle()
{
}
void ButtonHandle::Enter()
{
mChangeHighlight = RefreshCode::RefreshCell;
}
UIHandle::Result ButtonHandle::Click
(const TrackPanelMouseEvent &evt, AudacityProject *pProject)
{

View File

@ -42,6 +42,8 @@ protected:
virtual Result CommitChanges
(const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) = 0;
void Enter() override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -30,6 +30,10 @@ Paul Licameli split from TrackPanel.cpp
EnvelopeHandle::EnvelopeHandle( Envelope *pEnvelope )
: mEnvelope{ pEnvelope }
{
}
void EnvelopeHandle::Enter()
{
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;
#endif

View File

@ -56,6 +56,8 @@ public:
Envelope *GetEnvelope() const { return mEnvelope; }
void Enter() override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -21,6 +21,10 @@ SliderHandle::SliderHandle
: mSliderFn{ sliderFn }
, mRect{ rect }
, mpTrack{ pTrack }
{
}
void SliderHandle::Enter()
{
mChangeHighlight = RefreshCode::RefreshCell;
}

View File

@ -47,6 +47,8 @@ protected:
virtual Result CommitChanges
(const wxMouseEvent &event, AudacityProject *pProject) = 0;
void Enter() override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -29,6 +29,10 @@ TimeShiftHandle::TimeShiftHandle
: mCapturedTrack{ pTrack }
, mGripHit{ gripHit }
{
}
void TimeShiftHandle::Enter()
{
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;
#endif

View File

@ -75,6 +75,8 @@ public:
virtual ~TimeShiftHandle();
void Enter() override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;