From 98d7b14dbc22e305d59902f9e62ebf1e65dcda7d Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 6 Mar 2023 18:45:23 +0000 Subject: [PATCH] A better solution to keep SPICE netlist from being entirely selected. Fixes https://gitlab.com/kicad/code/kicad/issues/14177 --- common/dialog_shim.cpp | 4 ++-- eeschema/tools/simulator_control.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/dialog_shim.cpp b/common/dialog_shim.cpp index 0c96d81eca..b919fb6deb 100644 --- a/common/dialog_shim.cpp +++ b/common/dialog_shim.cpp @@ -339,7 +339,7 @@ static void selectAllInTextCtrls( wxWindowList& children ) { // Respect an existing selection } - else + else if( childTextCtrl->IsEditable() ) { childTextCtrl->SelectAll(); } @@ -353,7 +353,7 @@ static void selectAllInTextCtrls( wxWindowList& children ) { // Respect an existing selection } - else if( !scintilla->GetText().Contains( wxT( "\n") ) ) + else if( scintilla->IsEditable() ) { scintilla->SelectAll(); } diff --git a/eeschema/tools/simulator_control.cpp b/eeschema/tools/simulator_control.cpp index 0822b86d1d..87c575c445 100644 --- a/eeschema/tools/simulator_control.cpp +++ b/eeschema/tools/simulator_control.cpp @@ -375,6 +375,8 @@ public: textCtrl->SetLexer( wxSTC_LEX_SPICE ); + textCtrl->SetEditable( false ); + wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL ); sizer->Add( textCtrl, 1, wxEXPAND | wxALL, 5 ); SetSizer( sizer );