Fix some issues with hotkey paste in WX_GRIDs.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16253
This commit is contained in:
Jeff Young 2023-12-03 16:15:51 +00:00
parent 04246a969c
commit 95cfddf3a6
1 changed files with 8 additions and 1 deletions

View File

@ -28,6 +28,7 @@
#include <wx/tokenzr.h>
#include <wx/clipbrd.h>
#include <wx/log.h>
#include <wx/stc/stc.h>
#include <widgets/grid_readonly_text_helpers.h>
@ -492,7 +493,13 @@ void GRID_TRICKS::onCharHook( wxKeyEvent& ev )
stripped.Replace( ROW_SEP, " " );
stripped.Replace( ROW_SEP_R, " " );
stripped.Replace( COL_SEP, " " );
paste_text( stripped );
// Write to the CellEditControl if we can
if( wxTextEntry* te = dynamic_cast<wxTextEntry*>( ev.GetEventObject() ) )
te->WriteText( stripped );
else
paste_text( stripped );
handled = true;
}
}