Move Bus Definitions to common GUI paradigm in Schematic Setup.

Also includes a change to the std::initializer_list stuff to try and
fix a crash.
This commit is contained in:
Jeff Young
2022-08-21 12:29:51 +01:00
parent 1f4d51ecb3
commit b2a2d66005
23 changed files with 1760 additions and 627 deletions
+20 -13
View File
@@ -83,7 +83,8 @@ PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, EDA_DRAW_
m_isEEschema( aIsEEschema ),
m_netSettings( aNetSettings ),
m_netNames( aNetNames ),
m_hoveredCol( -1 )
m_hoveredCol( -1 ),
m_lastNetclassGridWidth( -1 )
{
// Clear and re-load each time. Language (or darkmode) might have changed.
g_lineStyleIcons.clear();
@@ -593,16 +594,21 @@ void PANEL_SETUP_NETCLASSES::OnRemoveNetclassClick( wxCommandEvent& event )
void PANEL_SETUP_NETCLASSES::AdjustNetclassGridColumns( int aWidth )
{
// Account for scroll bars
aWidth -= ( m_netclassGrid->GetSize().x - m_netclassGrid->GetClientSize().x );
for( int i = 1; i < m_netclassGrid->GetNumberCols(); i++ )
if( aWidth != m_lastNetclassGridWidth )
{
m_netclassGrid->SetColSize( i, m_originalColWidths[ i ] );
aWidth -= m_originalColWidths[ i ];
}
m_lastNetclassGridWidth = aWidth;
m_netclassGrid->SetColSize( 0, std::max( aWidth - 2, m_originalColWidths[ 0 ] ) );
// Account for scroll bars
aWidth -= ( m_netclassGrid->GetSize().x - m_netclassGrid->GetClientSize().x );
for( int i = 1; i < m_netclassGrid->GetNumberCols(); i++ )
{
m_netclassGrid->SetColSize( i, m_originalColWidths[ i ] );
aWidth -= m_originalColWidths[ i ];
}
m_netclassGrid->SetColSize( 0, std::max( aWidth - 2, m_originalColWidths[ 0 ] ) );
}
}
@@ -640,14 +646,15 @@ void PANEL_SETUP_NETCLASSES::OnRemoveAssignmentClick( wxCommandEvent& event )
int curRow = m_assignmentGrid->GetGridCursorRow();
if( curRow < 0 )
{
return;
}
m_assignmentGrid->DeleteRows( curRow, 1 );
m_assignmentGrid->MakeCellVisible( std::max( 0, curRow-1 ), m_assignmentGrid->GetGridCursorCol() );
m_assignmentGrid->SetGridCursor( std::max( 0, curRow-1 ), m_assignmentGrid->GetGridCursorCol() );
if( m_assignmentGrid->GetNumberRows() > 0 )
{
m_assignmentGrid->MakeCellVisible( std::max( 0, curRow-1 ), 0 );
m_assignmentGrid->SetGridCursor( std::max( 0, curRow-1 ), 0 );
}
}