Table support for footprint editor.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17333
This commit is contained in:
Jeff Young 2024-03-11 14:13:11 +00:00
parent 85d0126187
commit ccfefc3971
4 changed files with 15 additions and 3 deletions

View File

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

View File

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

View File

@ -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" ) );

View File

@ -412,7 +412,15 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
GENERAL_COLLECTORS_GUIDE guide = getCollectorsGuide();
GENERAL_COLLECTOR collector;
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() )
{