Browse Source

Schematic editor Table Properties and commenting for QuasiModal usage.

newinvert
Jeff Young 2 years ago
parent
commit
1bf24da385
  1. 1
      eeschema/eeschema_config.cpp
  2. 25
      eeschema/tools/sch_drawing_tools.cpp
  3. 3
      eeschema/tools/sch_edit_table_tool.cpp
  4. 14
      eeschema/tools/sch_edit_tool.cpp
  5. 1
      eeschema/tools/simulator_control.cpp
  6. 1
      eeschema/tools/symbol_editor_drawing_tools.cpp
  7. 1
      pcbnew/dialogs/dialog_copper_zones.cpp
  8. 1
      pcbnew/dialogs/dialog_non_copper_zones_properties.cpp
  9. 1
      pcbnew/dialogs/dialog_pad_properties.cpp
  10. 2
      pcbnew/dialogs/dialog_text_properties.cpp
  11. 6
      pcbnew/edit.cpp
  12. 2
      pcbnew/footprint_editor_utils.cpp
  13. 2
      pcbnew/microwave/microwave_footprint.cpp
  14. 2
      pcbnew/microwave/microwave_inductor.cpp
  15. 1
      pcbnew/pcb_edit_frame.cpp
  16. 1
      pcbnew/tools/drawing_tool.cpp

1
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

25
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 );
m_selectionTool->AddItemToSel( table );
table = nullptr;
// 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;
}
table = nullptr;
m_view->ClearPreview();
m_toolMgr->PostAction( ACTIONS::activatePointEditor );
}
else if( table && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) )
{

3
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 )

14
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;
}

1
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 );

1
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();

1
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();
}

1
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();
}

1
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();
}

2
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();
}

6
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;
}

2
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;
}

2
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

2
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

1
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 );

1
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 );

Loading…
Cancel
Save