Do not insert newlines in single line controls

2d2f443aa4d48fc960968b2260d592ba75bfdbdf allowed the use of shift-enter
when creating tables for newlines.  However, this should not be applied
to all text controls.  We split the ones by IsMultiLine to determine if
the shift-return is a newline or a dialog close

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20866
This commit is contained in:
Seth Hillbrand 2025-05-14 17:10:51 -07:00
parent 42ccbe618d
commit 8a0e9bef5a

View File

@ -658,6 +658,13 @@ void DIALOG_SHIM::OnCharHook( wxKeyEvent& aEvt )
if( wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( eventSource ) )
{
// If the text control is not multi-line, we want to close the dialog
if( !textCtrl->IsMultiLine() )
{
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
return;
}
#if defined( __WXMAC__ ) || defined( __WXMSW__ )
wxString eol = "\r\n";
#else