mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-21 16:11:11 +01:00
Revert "Bug2267: Nyquist prompt should allow multiline input..."
This reverts commit 33bd2a4d93.
This commit is contained in:
@@ -11,7 +11,6 @@
|
|||||||
#include "KeyboardCapture.h"
|
#include "KeyboardCapture.h"
|
||||||
|
|
||||||
#if defined(__WXMAC__)
|
#if defined(__WXMAC__)
|
||||||
#include <wx/textctrl.h>
|
|
||||||
#include <AppKit/AppKit.h>
|
#include <AppKit/AppKit.h>
|
||||||
#include <wx/osx/private.h>
|
#include <wx/osx/private.h>
|
||||||
#elif defined(__WXGTK__)
|
#elif defined(__WXGTK__)
|
||||||
@@ -194,26 +193,20 @@ public:
|
|||||||
return Event_Skip;
|
return Event_Skip;
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
// Bugs 1329 and 2107 (Mac only)
|
// Bug 2107 (Mac only)
|
||||||
// wxButton::SetDefault() alone doesn't cause correct event routing
|
// wxButton::SetDefault() alone doesn't cause correct event routing
|
||||||
// of key-down to the button when a text entry or combo has focus,
|
// of key-down to the button when a text entry or combo has focus,
|
||||||
// but we can intercept wxEVT_CHAR_HOOK here and do it
|
// but we can intercept wxEVT_CHAR_HOOK here and do it
|
||||||
if ( type == wxEVT_CHAR_HOOK &&
|
if ( type == wxEVT_CHAR_HOOK &&
|
||||||
key.GetKeyCode() == WXK_RETURN ) {
|
key.GetKeyCode() == WXK_RETURN ) {
|
||||||
const auto focus = wxWindow::FindFocus();
|
if (auto top =
|
||||||
// Bug 2267 (Mac only): don't apply fix for 2107 when a text entry
|
dynamic_cast< wxTopLevelWindow* >(
|
||||||
// needs to allow multiple line input
|
wxGetTopLevelParent( wxWindow::FindFocus() ) ) ) {
|
||||||
const auto text = dynamic_cast<wxTextCtrl*>(focus);
|
if ( auto button =
|
||||||
if ( !text ) {
|
dynamic_cast<wxButton*>( top->GetDefaultItem() ) ) {
|
||||||
if (auto top =
|
wxCommandEvent newEvent{ wxEVT_BUTTON, button->GetId() };
|
||||||
dynamic_cast< wxTopLevelWindow* >(
|
button->GetEventHandler()->AddPendingEvent( newEvent );
|
||||||
wxGetTopLevelParent( focus ) ) ) {
|
return Event_Processed;
|
||||||
if ( auto button =
|
|
||||||
dynamic_cast<wxButton*>( top->GetDefaultItem() ) ) {
|
|
||||||
wxCommandEvent newEvent{ wxEVT_BUTTON, button->GetId() };
|
|
||||||
button->GetEventHandler()->AddPendingEvent( newEvent );
|
|
||||||
return Event_Processed;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user