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

Fix activation of certain 'select' commands via menu.

These commands all assumed they would be activated from a key press, and so take the key up/down state into account.  This is not now the case, and there is no wxEvent to pass to them if they came via a menu item.
This commit is contained in:
James Crook 2017-04-22 11:20:03 +01:00
parent e7007c1d59
commit a68f7fc10c

View File

@ -3018,22 +3018,26 @@ void AudacityProject::OnSelSetExtendRight()
void AudacityProject::OnSelExtendLeft(const wxEvent * evt) void AudacityProject::OnSelExtendLeft(const wxEvent * evt)
{ {
OnCursorLeft( true, false, evt->GetEventType() == wxEVT_KEY_UP ); bool bKeyUp = (evt) && evt->GetEventType() == wxEVT_KEY_UP;
OnCursorLeft( true, false, bKeyUp );
} }
void AudacityProject::OnSelExtendRight(const wxEvent * evt) void AudacityProject::OnSelExtendRight(const wxEvent * evt)
{ {
OnCursorRight( true, false, evt->GetEventType() == wxEVT_KEY_UP ); bool bKeyUp = (evt) && evt->GetEventType() == wxEVT_KEY_UP;
OnCursorRight( true, false, bKeyUp );
} }
void AudacityProject::OnSelContractLeft(const wxEvent * evt) void AudacityProject::OnSelContractLeft(const wxEvent * evt)
{ {
OnCursorRight( true, true, evt->GetEventType() == wxEVT_KEY_UP ); bool bKeyUp = (evt) && evt->GetEventType() == wxEVT_KEY_UP;
OnCursorRight( true, true, bKeyUp );
} }
void AudacityProject::OnSelContractRight(const wxEvent * evt) void AudacityProject::OnSelContractRight(const wxEvent * evt)
{ {
OnCursorLeft( true, true, evt->GetEventType() == wxEVT_KEY_UP ); bool bKeyUp = (evt) && evt->GetEventType() == wxEVT_KEY_UP;
OnCursorLeft( true, true, bKeyUp );
} }
void AudacityProject::OnClipLeft() void AudacityProject::OnClipLeft()