Browse Source

Table support for footprint editor.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17333
newinvert
Jeff Young 2 years ago
parent
commit
ccfefc3971
  1. 3
      pcbnew/footprint.cpp
  2. 1
      pcbnew/menubar_footprint_editor.cpp
  3. 4
      pcbnew/tools/drawing_tool.cpp
  4. 10
      pcbnew/tools/pcb_selection_tool.cpp

3
pcbnew/footprint.cpp

@ -735,6 +735,7 @@ void FOOTPRINT::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode, bool aSkipConnectiv
case PCB_DIM_ORTHOGONAL_T:
case PCB_SHAPE_T:
case PCB_TEXTBOX_T:
case PCB_TABLE_T:
case PCB_REFERENCE_IMAGE_T:
if( aMode == ADD_MODE::APPEND )
m_drawings.push_back( aBoardItem );
@ -1689,6 +1690,8 @@ INSPECT_RESULT FOOTPRINT::Visit( INSPECTOR inspector, void* testData,
case PCB_DIM_ORTHOGONAL_T:
case PCB_SHAPE_T:
case PCB_TEXTBOX_T:
case PCB_TABLE_T:
case PCB_TABLECELL_T:
if( !drawingsScanned )
{
if( IterateForward<BOARD_ITEM*>( m_drawings, inspector, testData, aScanTypes )

1
pcbnew/menubar_footprint_editor.cpp

@ -174,6 +174,7 @@ void FOOTPRINT_EDIT_FRAME::doReCreateMenuBar()
placeMenu->Add( PCB_ACTIONS::placeReferenceImage );
placeMenu->Add( PCB_ACTIONS::placeText );
placeMenu->Add( PCB_ACTIONS::drawTextBox );
placeMenu->Add( PCB_ACTIONS::drawTable );
placeMenu->AppendSeparator();
placeMenu->Add( PCB_ACTIONS::drawAlignedDimension );

4
pcbnew/tools/drawing_tool.cpp

@ -1162,6 +1162,8 @@ int DRAWING_TOOL::DrawTable( const TOOL_EVENT& aEvent )
}
else
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
table->ClearFlags();
table->Normalize();
@ -1170,8 +1172,6 @@ int DRAWING_TOOL::DrawTable( const TOOL_EVENT& aEvent )
// QuasiModal required for Scintilla auto-complete
if( dlg.ShowQuasiModal() == wxID_OK )
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
commit.Add( table, m_frame->GetScreen() );
commit.Push( _( "Draw Table" ) );

10
pcbnew/tools/pcb_selection_tool.cpp

@ -412,7 +412,15 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
GENERAL_COLLECTORS_GUIDE guide = getCollectorsGuide();
GENERAL_COLLECTOR collector;
collector.Collect( board(), { PCB_TABLECELL_T }, evt->DragOrigin(), guide );
if( m_isFootprintEditor )
{
collector.Collect( board()->GetFirstFootprint(), { PCB_TABLECELL_T },
evt->DragOrigin(), guide );
}
else
{
collector.Collect( board(), { PCB_TABLECELL_T }, evt->DragOrigin(), guide );
}
if( collector.GetCount() )
{

Loading…
Cancel
Save