mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-29 22:58:39 +02:00
Make the Windows menu key work for the ruler
This commit is contained in:
parent
c616d433c2
commit
5c3548528f
@ -1784,9 +1784,13 @@ BEGIN_EVENT_TABLE(AdornedRulerPanel, wxPanel)
|
|||||||
EVT_COMMAND(wxID_ANY, EVT_CAPTURE_KEY, AdornedRulerPanel::OnCaptureKey)
|
EVT_COMMAND(wxID_ANY, EVT_CAPTURE_KEY, AdornedRulerPanel::OnCaptureKey)
|
||||||
EVT_KEY_DOWN(AdornedRulerPanel::OnKeyDown)
|
EVT_KEY_DOWN(AdornedRulerPanel::OnKeyDown)
|
||||||
|
|
||||||
|
// Correct management of track focus
|
||||||
EVT_SET_FOCUS(AdornedRulerPanel::OnSetFocus)
|
EVT_SET_FOCUS(AdornedRulerPanel::OnSetFocus)
|
||||||
EVT_KILL_FOCUS(AdornedRulerPanel::OnKillFocus)
|
EVT_KILL_FOCUS(AdornedRulerPanel::OnKillFocus)
|
||||||
|
|
||||||
|
// Pop up menus on Windows
|
||||||
|
EVT_CONTEXT_MENU(AdornedRulerPanel::OnContextMenu)
|
||||||
|
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
AdornedRulerPanel::AdornedRulerPanel(AudacityProject* parent,
|
AdornedRulerPanel::AdornedRulerPanel(AudacityProject* parent,
|
||||||
@ -2831,6 +2835,7 @@ void AdornedRulerPanel::OnKeyDown(wxKeyEvent &event)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
event.Skip();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2849,6 +2854,13 @@ void AdornedRulerPanel::OnKillFocus(wxFocusEvent & WXUNUSED(event))
|
|||||||
Refresh(false);
|
Refresh(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AdornedRulerPanel::OnContextMenu(wxContextMenuEvent & WXUNUSED(event))
|
||||||
|
{
|
||||||
|
auto rect = GetRect();
|
||||||
|
wxPoint position(rect.GetLeft() + 1, rect.GetBottom() + 1);
|
||||||
|
ShowMenu(position);
|
||||||
|
}
|
||||||
|
|
||||||
void AdornedRulerPanel::OnCaptureLost(wxMouseCaptureLostEvent & WXUNUSED(evt))
|
void AdornedRulerPanel::OnCaptureLost(wxMouseCaptureLostEvent & WXUNUSED(evt))
|
||||||
{
|
{
|
||||||
DrawQuickPlayIndicator(NULL);
|
DrawQuickPlayIndicator(NULL);
|
||||||
|
@ -478,6 +478,7 @@ private:
|
|||||||
void OnKeyDown(wxKeyEvent &event);
|
void OnKeyDown(wxKeyEvent &event);
|
||||||
void OnSetFocus(wxFocusEvent &);
|
void OnSetFocus(wxFocusEvent &);
|
||||||
void OnKillFocus(wxFocusEvent &);
|
void OnKillFocus(wxFocusEvent &);
|
||||||
|
void OnContextMenu(wxContextMenuEvent & WXUNUSED(event));
|
||||||
|
|
||||||
bool mPlayRegionDragsSelection;
|
bool mPlayRegionDragsSelection;
|
||||||
bool mTimelineToolTip;
|
bool mTimelineToolTip;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user