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