1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-14 17:14:07 +01:00

Highlight MIDI channel buttons

This commit is contained in:
Paul Licameli
2017-06-22 00:23:17 -04:00
parent 25641ae568
commit 44d6d5f427
5 changed files with 32 additions and 6 deletions

View File

@@ -24,12 +24,23 @@ NoteTrackButtonHandle::NoteTrackButtonHandle
: mpTrack{ pTrack }
, mChannel{ channel }
, mRect{ rect }
{}
{
mChangeHighlight = RefreshCode::RefreshCell;
}
NoteTrackButtonHandle::~NoteTrackButtonHandle()
{
}
UIHandle::Result NoteTrackButtonHandle::NeedChangeHighlight
(const NoteTrackButtonHandle &oldState, const NoteTrackButtonHandle &newState)
{
if (oldState.GetChannel() != newState.GetChannel())
// Repaint whenever the highlighted button is different
return RefreshCode::RefreshCell;
return 0;
}
UIHandlePtr NoteTrackButtonHandle::HitTest
(std::weak_ptr<NoteTrackButtonHandle> &holder,
const wxMouseState &state, const wxRect &rect,

View File

@@ -42,6 +42,10 @@ public:
int GetChannel() const { return mChannel; }
static UIHandle::Result NeedChangeHighlight
(const NoteTrackButtonHandle &oldState,
const NoteTrackButtonHandle &newState);
protected:
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;