mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
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 (cherry picked from commit 8a0e9bef5aadcb33b0326f390e8852f0b05b84b7)
This commit is contained in:
parent
ac5de5e938
commit
8993656e72
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user