From 5a9ed66cfd9a11d3ec2a7d508d9fbe7d5ce92fc7 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 24 May 2023 10:28:46 +0100 Subject: [PATCH] Go back to using QuasiModal for TextBox Properties. Also removes auto-closing of blocking dialogs when inserting symbols from the Symbol Editor or Chooser, preventing the bug that QuasiModel was removed for earlier. Also fixes a non-initialized parent pointer when the TextBox Properties dialog was called from DrawShape(). Fixes https://gitlab.com/kicad/code/kicad/-/issues/14777 --- eeschema/tools/sch_drawing_tools.cpp | 7 ++++--- eeschema/tools/symbol_editor_control.cpp | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index 9bddd09f50..7852c2703c 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -1608,6 +1608,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) textbox->SetHorizJustify( m_lastTextJust ); textbox->SetStroke( m_lastTextboxStroke ); textbox->SetFillColor( m_lastTextboxFillColor ); + textbox->SetParent( schematic ); item = textbox; } @@ -1617,6 +1618,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) item->SetStroke( m_lastStroke ); item->SetFillColor( m_lastFillColor ); + item->SetParent( schematic ); } item->SetFlags( IS_NEW ); @@ -1646,9 +1648,8 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) getViewControls()->SetAutoPan( false ); getViewControls()->CaptureCursor( false ); - // This is modal not quasi to protect against place symbol calls starting - // TwoClickPlace wait routines in the middle - if( dlg.ShowModal() != wxID_OK ) + // Must be quasi modal for syntax help + if( dlg.ShowQuasiModal() != wxID_OK ) { cleanup(); continue; diff --git a/eeschema/tools/symbol_editor_control.cpp b/eeschema/tools/symbol_editor_control.cpp index 846b7a1b4d..1ffb6089a9 100644 --- a/eeschema/tools/symbol_editor_control.cpp +++ b/eeschema/tools/symbol_editor_control.cpp @@ -664,7 +664,11 @@ int SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic( const TOOL_EVENT& aEvent ) wxWindow* blocking_dialog = schframe->Kiway().GetBlockingDialog(); if( blocking_dialog ) - blocking_dialog->Close( true ); + { + blocking_dialog->Raise(); + wxBell(); + return 0; + } wxCHECK( libSymbol->GetLibId().IsValid(), 0 );