diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index cc427f3ed5..a8ae9bcc58 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -103,6 +103,7 @@ void SCH_EDIT_FRAME::ShowSchematicSetupDialog( const wxString& aInitialPage ) if( !aInitialPage.IsEmpty() ) dlg.SetInitialPage( aInitialPage, wxEmptyString ); + // TODO: is QuasiModal required here? if( dlg.ShowQuasiModal() == wxID_OK ) { // Mark document as modified so that project settings can be saved as part of doc save diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index c3124d6343..f11f629556 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -61,6 +61,7 @@ #include <dialogs/dialog_text_properties.h> #include <dialogs/dialog_wire_bus_properties.h> #include <dialogs/dialog_junction_props.h> +#include <dialogs/dialog_table_properties.h> #include <import_gfx/dialog_import_gfx_sch.h> #include <sync_sheet_pin/sheet_synchronization_agent.h> #include <string_utils.h> @@ -1296,7 +1297,7 @@ SCH_TEXT* SCH_DRAWING_TOOLS::createNewText( const VECTOR2I& aPosition, int aType { DIALOG_LABEL_PROPERTIES dlg( m_frame, static_cast<SCH_LABEL_BASE*>( textItem ) ); - // Must be quasi modal for syntax help + // QuasiModal required for syntax help and Scintilla auto-complete if( dlg.ShowQuasiModal() != wxID_OK ) { delete labelItem; @@ -2158,15 +2159,25 @@ int SCH_DRAWING_TOOLS::DrawTable( const TOOL_EVENT& aEvent ) table->SetFlags( IS_NEW ); table->Normalize(); - SCH_COMMIT commit( m_toolMgr ); - commit.Add( table, m_frame->GetScreen() ); - commit.Push( _( "Draw Table" ) ); + DIALOG_TABLE_PROPERTIES dlg( m_frame, table ); + + // QuasiModal required for Scintilla auto-complete + if( dlg.ShowQuasiModal() == wxID_OK ) + { + SCH_COMMIT commit( m_toolMgr ); + commit.Add( table, m_frame->GetScreen() ); + commit.Push( _( "Draw Table" ) ); + + m_selectionTool->AddItemToSel( table ); + m_toolMgr->PostAction( ACTIONS::activatePointEditor ); + } + else + { + delete table; + } - m_selectionTool->AddItemToSel( table ); table = nullptr; - m_view->ClearPreview(); - m_toolMgr->PostAction( ACTIONS::activatePointEditor ); } else if( table && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) ) { diff --git a/eeschema/tools/sch_edit_table_tool.cpp b/eeschema/tools/sch_edit_table_tool.cpp index 309cf63fa5..fa1704109d 100644 --- a/eeschema/tools/sch_edit_table_tool.cpp +++ b/eeschema/tools/sch_edit_table_tool.cpp @@ -70,7 +70,8 @@ int SCH_EDIT_TABLE_TOOL::EditTable( const TOOL_EVENT& aEvent ) { DIALOG_TABLE_PROPERTIES dlg( m_frame, parentTable ); - dlg.ShowQuasiModal(); // Scintilla's auto-complete requires quasiModal + // QuasiModal required for Scintilla auto-complete + dlg.ShowQuasiModal(); } if( clearSelection ) diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index bd30c35dcd..1d251d8bc0 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -1700,6 +1700,7 @@ int SCH_EDIT_TOOL::ChangeSymbols( const TOOL_EVENT& aEvent ) DIALOG_CHANGE_SYMBOLS dlg( m_frame, selectedSymbol, mode ); + // QuasiModal required to invoke symbol browser dlg.ShowQuasiModal(); return 0; @@ -1933,12 +1934,21 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) SCH_TABLE* table = static_cast<SCH_TABLE*>( cells[0]->GetParent() ); DIALOG_TABLE_PROPERTIES tableDlg( m_frame, table ); - tableDlg.ShowQuasiModal(); // Scintilla's auto-complete requires quasiModal + tableDlg.ShowModal(); } } break; + case SCH_TABLE_T: + { + DIALOG_TABLE_PROPERTIES dlg( m_frame, static_cast<SCH_TABLE*>( curr_item ) ); + + // QuasiModal required for Scintilla auto-complete + dlg.ShowQuasiModal(); + break; + } + case SCH_LABEL_T: case SCH_GLOBAL_LABEL_T: case SCH_HIER_LABEL_T: @@ -1946,7 +1956,7 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) { DIALOG_LABEL_PROPERTIES dlg( m_frame, static_cast<SCH_LABEL_BASE*>( curr_item ) ); - // Must be quasi modal for syntax help + // QuasiModal for syntax help and Scintilla auto-complete dlg.ShowQuasiModal(); break; } diff --git a/eeschema/tools/simulator_control.cpp b/eeschema/tools/simulator_control.cpp index c43a9519d1..f171f4d5a6 100644 --- a/eeschema/tools/simulator_control.cpp +++ b/eeschema/tools/simulator_control.cpp @@ -480,6 +480,7 @@ int SIMULATOR_CONTROL::EditUserDefinedSignals( const TOOL_EVENT& aEvent ) DIALOG_USER_DEFINED_SIGNALS dlg( m_simulatorFrame, &userSignals ); + // QuasiModal required for syntax help and Scintilla auto-complete if( dlg.ShowQuasiModal() == wxID_OK ) m_simulatorFrame->SetUserDefinedSignals( userSignals ); diff --git a/eeschema/tools/symbol_editor_drawing_tools.cpp b/eeschema/tools/symbol_editor_drawing_tools.cpp index ec7417b7c5..cbac6b8ea9 100644 --- a/eeschema/tools/symbol_editor_drawing_tools.cpp +++ b/eeschema/tools/symbol_editor_drawing_tools.cpp @@ -527,6 +527,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape( const TOOL_EVENT& aEvent, std::opt LIB_TEXTBOX* textbox = static_cast<LIB_TEXTBOX*>( item ); DIALOG_LIB_TEXTBOX_PROPERTIES dlg( m_frame, static_cast<LIB_TEXTBOX*>( item ) ); + // QuasiModal required for syntax help and Scintilla auto-complete if( dlg.ShowQuasiModal() != wxID_OK ) { cleanup(); diff --git a/pcbnew/dialogs/dialog_copper_zones.cpp b/pcbnew/dialogs/dialog_copper_zones.cpp index 31e35f4a94..577ca02e49 100644 --- a/pcbnew/dialogs/dialog_copper_zones.cpp +++ b/pcbnew/dialogs/dialog_copper_zones.cpp @@ -129,6 +129,7 @@ int InvokeCopperZonesEditor( PCB_BASE_FRAME* aCaller, ZONE_SETTINGS* aSettings, { DIALOG_COPPER_ZONE dlg( aCaller, aSettings, aConvertSettings ); + // TODO: why does this need QuasiModal? return dlg.ShowQuasiModal(); } diff --git a/pcbnew/dialogs/dialog_non_copper_zones_properties.cpp b/pcbnew/dialogs/dialog_non_copper_zones_properties.cpp index d4f944ba4c..4a486c05b8 100644 --- a/pcbnew/dialogs/dialog_non_copper_zones_properties.cpp +++ b/pcbnew/dialogs/dialog_non_copper_zones_properties.cpp @@ -74,6 +74,7 @@ int InvokeNonCopperZonesEditor( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* aSetting { DIALOG_NON_COPPER_ZONES_EDITOR dlg( aParent, aSettings, aConvertSettings ); + // TODO: why does this require QuasiModal? return dlg.ShowQuasiModal(); } diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index c49bd27016..1a5541df3f 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -138,6 +138,7 @@ void PCB_BASE_FRAME::ShowPadPropertiesDialog( PAD* aPad ) { DIALOG_PAD_PROPERTIES dlg( this, aPad ); + // QuasiModal required for NET_SELECTOR dlg.ShowQuasiModal(); } diff --git a/pcbnew/dialogs/dialog_text_properties.cpp b/pcbnew/dialogs/dialog_text_properties.cpp index 1a870b1f25..5084bd3293 100644 --- a/pcbnew/dialogs/dialog_text_properties.cpp +++ b/pcbnew/dialogs/dialog_text_properties.cpp @@ -256,6 +256,8 @@ DIALOG_TEXT_PROPERTIES::~DIALOG_TEXT_PROPERTIES() void PCB_BASE_EDIT_FRAME::ShowTextPropertiesDialog( PCB_TEXT* aText ) { DIALOG_TEXT_PROPERTIES dlg( this, aText ); + + // QuasiModal required for Scintilla auto-complete dlg.ShowQuasiModal(); } diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index 6dcab5b2e2..c12fa62bd3 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -141,7 +141,9 @@ void PCB_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem ) case PCB_TABLE_T: { DIALOG_TABLE_PROPERTIES dlg( this, static_cast<PCB_TABLE*>( aItem ) ); - dlg.ShowQuasiModal(); // Scintilla's auto-complete requires quasiModal + + //QuasiModal required for Scintilla auto-complete + dlg.ShowQuasiModal(); break; } @@ -164,6 +166,8 @@ void PCB_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem ) case PCB_DIM_LEADER_T: { DIALOG_DIMENSION_PROPERTIES dlg( this, static_cast<PCB_DIMENSION_BASE*>( aItem ) ); + + // TODO: why is this QuasiModal? dlg.ShowQuasiModal(); break; } diff --git a/pcbnew/footprint_editor_utils.cpp b/pcbnew/footprint_editor_utils.cpp index 3df6c5582e..56be351367 100644 --- a/pcbnew/footprint_editor_utils.cpp +++ b/pcbnew/footprint_editor_utils.cpp @@ -215,6 +215,8 @@ void FOOTPRINT_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem ) case PCB_DIM_LEADER_T: { DIALOG_DIMENSION_PROPERTIES dlg( this, static_cast<PCB_DIMENSION_BASE*>( aItem ) ); + + // TODO: why is this QuasiModal? dlg.ShowQuasiModal(); break; } diff --git a/pcbnew/microwave/microwave_footprint.cpp b/pcbnew/microwave/microwave_footprint.cpp index 1100c5e223..8226b8a10a 100644 --- a/pcbnew/microwave/microwave_footprint.cpp +++ b/pcbnew/microwave/microwave_footprint.cpp @@ -80,6 +80,7 @@ FOOTPRINT* MICROWAVE_TOOL::createFootprint( MICROWAVE_FOOTPRINT_SHAPE aFootprint wxString value = editFrame->StringFromValue( gap_size ); WX_TEXT_ENTRY_DIALOG dlg( editFrame, msg, _( "Create Microwave Footprint" ), value ); + // TODO: why is this QuasiModal? if( dlg.ShowQuasiModal() != wxID_OK ) return nullptr; // cancelled by user @@ -94,6 +95,7 @@ FOOTPRINT* MICROWAVE_TOOL::createFootprint( MICROWAVE_FOOTPRINT_SHAPE aFootprint WX_TEXT_ENTRY_DIALOG angledlg( editFrame, _( "Angle in degrees:" ), _( "Create Microwave Footprint" ), msg ); + // TODO: why is this QuasiModal? if( angledlg.ShowQuasiModal() != wxID_OK ) return nullptr; // cancelled by user diff --git a/pcbnew/microwave/microwave_inductor.cpp b/pcbnew/microwave/microwave_inductor.cpp index 55050054a7..a4b51315c3 100644 --- a/pcbnew/microwave/microwave_inductor.cpp +++ b/pcbnew/microwave/microwave_inductor.cpp @@ -365,6 +365,7 @@ FOOTPRINT* MICROWAVE_TOOL::createMicrowaveInductor( MICROWAVE_INDUCTOR_PATTERN& wxString msg = editFrame->StringFromValue( aInductorPattern.m_Length ); WX_TEXT_ENTRY_DIALOG dlg( editFrame, _( "Length of Trace:" ), wxEmptyString, msg ); + // TODO: why is this QuasiModal? if( dlg.ShowQuasiModal() != wxID_OK ) return nullptr; // canceled by user @@ -404,6 +405,7 @@ FOOTPRINT* MICROWAVE_TOOL::createMicrowaveInductor( MICROWAVE_INDUCTOR_PATTERN& WX_TEXT_ENTRY_DIALOG cmpdlg( editFrame, _( "Component Value:" ), wxEmptyString, msg ); cmpdlg.SetTextValidator( FOOTPRINT_NAME_VALIDATOR( &msg ) ); + // TODO: why is this QuasiModal? if( ( cmpdlg.ShowQuasiModal() != wxID_OK ) || msg.IsEmpty() ) return nullptr; // Aborted by user diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index b3a22f1e44..b0160f529f 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -1225,6 +1225,7 @@ void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage ) if( !aInitialPage.IsEmpty() ) dlg.SetInitialPage( aInitialPage, wxEmptyString ); + // QuasiModal required for Scintilla auto-complete if( dlg.ShowQuasiModal() == wxID_OK ) { GetBoard()->SynchronizeNetsAndNetClasses( true ); diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 99dab48f1b..70561cf35d 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -1167,6 +1167,7 @@ int DRAWING_TOOL::DrawTable( const TOOL_EVENT& aEvent ) DIALOG_TABLE_PROPERTIES dlg( m_frame, table ); + // QuasiModal required for Scintilla auto-complete if( dlg.ShowQuasiModal() == wxID_OK ) { m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );