Adjust pin conflicts table for wxWidgets 3.1.

This commit is contained in:
Jeff Young 2021-03-12 22:45:32 +00:00
parent 2c3f9d30d8
commit 3e947553f5
3 changed files with 13 additions and 8 deletions

View File

@ -80,6 +80,11 @@ void PANEL_SETUP_PINMAP::reBuildMatrixPanel()
wxPoint pos( 0, charSize.y * 2 ); wxPoint pos( 0, charSize.y * 2 );
wxStaticText* text; wxStaticText* text;
#ifdef __WXMAC__
bmapSize.y += 2;
charSize.y += 2;
#endif
if( !m_initialized ) if( !m_initialized )
{ {
std::vector<wxStaticText*> labels; std::vector<wxStaticText*> labels;
@ -107,7 +112,9 @@ void PANEL_SETUP_PINMAP::reBuildMatrixPanel()
pos.x += 5; pos.x += 5;
} }
else else
{
pos = m_buttonList[0][0]->GetPosition(); pos = m_buttonList[0][0]->GetPosition();
}
for( int ii = 0; ii < ELECTRICAL_PINTYPES_TOTAL; ii++ ) for( int ii = 0; ii < ELECTRICAL_PINTYPES_TOTAL; ii++ )
{ {
@ -118,15 +125,15 @@ void PANEL_SETUP_PINMAP::reBuildMatrixPanel()
// Add column labels (only once) // Add column labels (only once)
PIN_ERROR diag = m_schematic->ErcSettings().GetPinMapValue( ii, jj ); PIN_ERROR diag = m_schematic->ErcSettings().GetPinMapValue( ii, jj );
int x = pos.x + ( jj * ( bmapSize.x + 4 ) ); int x = pos.x + ( jj * ( bmapSize.x + 2 ) );
if( ( ii == jj ) && !m_initialized ) if( ( ii == jj ) && !m_initialized )
{ {
wxPoint textPos( x + KiROUND( bmapSize.x / 2 ) - KiROUND( charSize.x / 2 ), wxPoint textPos( x + KiROUND( bmapSize.x / 2 ) - KiROUND( charSize.x ),
y - charSize.y * 2 ); y - charSize.y * 2 );
new wxStaticText( m_matrixPanel, wxID_ANY, CommentERC_V[ii], textPos ); new wxStaticText( m_matrixPanel, wxID_ANY, CommentERC_V[ii], textPos );
wxPoint calloutPos( x + KiROUND( bmapSize.x / 2 ) - 2, wxPoint calloutPos( x + KiROUND( bmapSize.x / 2 ) - KiROUND( charSize.x / 2 ),
y - charSize.y ); y - charSize.y );
new wxStaticText( m_matrixPanel, wxID_ANY, "|", calloutPos ); new wxStaticText( m_matrixPanel, wxID_ANY, "|", calloutPos );
} }
@ -138,10 +145,8 @@ void PANEL_SETUP_PINMAP::reBuildMatrixPanel()
wxBitmapButton* btn = new wxBitmapButton( m_matrixPanel, event_id, wxBitmapButton* btn = new wxBitmapButton( m_matrixPanel, event_id,
KiBitmap( bitmap_butt ), wxPoint( x, y ) ); KiBitmap( bitmap_butt ), wxPoint( x, y ) );
// On the mac, the button sizes are reliably 4 pixels smaller (maybe due to corner rounding)
// than can be displayed by the bitmap
#ifdef __WXMAC__ #ifdef __WXMAC__
btn->SetSize( btn->GetSize().x + 8, btn->GetSize().y + 4 ); btn->SetSize( btn->GetSize().x - 1, btn->GetSize().y );
#else #else
btn->SetSize( btn->GetSize().x + 4, btn->GetSize().y ); btn->SetSize( btn->GetSize().x + 4, btn->GetSize().y );
#endif #endif

View File

@ -21,7 +21,7 @@ PANEL_SETUP_PINMAP_BASE::PANEL_SETUP_PINMAP_BASE( wxWindow* parent, wxWindowID i
sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pin to Pin Connections") ), wxVERTICAL ); sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pin to Pin Connections") ), wxVERTICAL );
m_matrixPanel = new wxPanel( sbSizer3->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_matrixPanel = new wxPanel( sbSizer3->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_matrixPanel->SetMinSize( wxSize( 500,420 ) ); m_matrixPanel->SetMinSize( wxSize( 500,444 ) );
sbSizer3->Add( m_matrixPanel, 1, wxEXPAND | wxALL, 5 ); sbSizer3->Add( m_matrixPanel, 1, wxEXPAND | wxALL, 5 );

View File

@ -112,7 +112,7 @@
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="min_size"></property> <property name="min_size"></property>
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size">500,420</property> <property name="minimum_size">500,444</property>
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_matrixPanel</property> <property name="name">m_matrixPanel</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>