diff --git a/eeschema/dialogs/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp index b0a80397a4..256ca2bbf0 100644 --- a/eeschema/dialogs/dialog_erc.cpp +++ b/eeschema/dialogs/dialog_erc.cpp @@ -294,17 +294,28 @@ void DIALOG_ERC::ReBuildMatrixPanel() if( m_initialized == false ) { + std::vector labels; + // Print row labels for( int ii = 0; ii < PINTYPE_COUNT; ii++ ) { int y = pos.y + (ii * bitmap_size.y); text = new wxStaticText( m_matrixPanel, -1, CommentERC_H[ii], wxPoint( 5, y + ( bitmap_size.y / 2) - (text_height / 2) ) ); + labels.push_back( text ); int x = text->GetRect().GetRight(); pos.x = std::max( pos.x, x ); } + // Right-align + for( int ii = 0; ii < PINTYPE_COUNT; ii++ ) + { + wxPoint labelPos = labels[ ii ]->GetPosition(); + labelPos.x = pos.x - labels[ ii ]->GetRect().GetWidth(); + labels[ ii ]->SetPosition( labelPos ); + } + pos.x += 5; } else diff --git a/eeschema/dialogs/dialog_erc_base.cpp b/eeschema/dialogs/dialog_erc_base.cpp index 15842c75ad..cccd2fb2d9 100644 --- a/eeschema/dialogs/dialog_erc_base.cpp +++ b/eeschema/dialogs/dialog_erc_base.cpp @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 17 2016) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO "NOT" EDIT THIS FILE! +// PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #include "dialog_erc_listbox.h" @@ -63,30 +63,36 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin sdiagSizer->Add( m_WriteResultOpt, 0, wxALL|wxBOTTOM|wxRIGHT|wxTOP, 5 ); - bupperSizer->Add( sdiagSizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); + bupperSizer->Add( sdiagSizer, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); wxBoxSizer* bSizerMessages; bSizerMessages = new wxBoxSizer( wxVERTICAL ); m_titleMessages = new wxStaticText( m_PanelERC, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 ); m_titleMessages->Wrap( -1 ); - bSizerMessages->Add( m_titleMessages, 0, wxRIGHT|wxLEFT, 5 ); + m_titleMessages->SetFont( wxFont( 11, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); + + bSizerMessages->Add( m_titleMessages, 0, wxRIGHT|wxLEFT, 12 ); m_MessagesList = new wxTextCtrl( m_PanelERC, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY ); - bSizerMessages->Add( m_MessagesList, 1, wxEXPAND|wxLEFT, 5 ); + m_MessagesList->SetMinSize( wxSize( 180,-1 ) ); + + bSizerMessages->Add( m_MessagesList, 1, wxEXPAND|wxBOTTOM|wxLEFT, 5 ); - bupperSizer->Add( bSizerMessages, 1, wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP, 5 ); + bupperSizer->Add( bSizerMessages, 1, wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP, 3 ); - bercSizer->Add( bupperSizer, 0, wxALL|wxEXPAND, 5 ); + bercSizer->Add( bupperSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 8 ); m_textMarkers = new wxStaticText( m_PanelERC, wxID_ANY, _("Error list:"), wxDefaultPosition, wxDefaultSize, 0 ); m_textMarkers->Wrap( -1 ); - bercSizer->Add( m_textMarkers, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + m_textMarkers->SetFont( wxFont( 11, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); + + bercSizer->Add( m_textMarkers, 0, wxLEFT|wxRIGHT, 20 ); m_MarkersList = new ERC_HTML_LISTFRAME( m_PanelERC, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER ); - bercSizer->Add( m_MarkersList, 1, wxEXPAND|wxALL, 5 ); + bercSizer->Add( m_MarkersList, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 8 ); wxBoxSizer* bbuttonsSizer; bbuttonsSizer = new wxBoxSizer( wxHORIZONTAL ); @@ -102,7 +108,7 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin bbuttonsSizer->Add( m_buttonClose, 0, wxALL|wxEXPAND, 5 ); - bercSizer->Add( bbuttonsSizer, 0, wxALIGN_RIGHT, 5 ); + bercSizer->Add( bbuttonsSizer, 0, wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 ); m_PanelERC->SetSizer( bercSizer ); @@ -113,32 +119,33 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin wxBoxSizer* m_panelMatrixSizer; m_panelMatrixSizer = new wxBoxSizer( wxVERTICAL ); - m_ResetOptButton = new wxButton( m_PanelERCOptions, ID_RESET_MATRIX, _("Initialize to Default"), wxDefaultPosition, wxDefaultSize, 0 ); - m_panelMatrixSizer->Add( m_ResetOptButton, 0, wxALIGN_RIGHT|wxTOP|wxRIGHT|wxLEFT, 5 ); + wxStaticBoxSizer* sbSizer2; + sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( m_PanelERCOptions, wxID_ANY, _("Label to Label Connections") ), wxVERTICAL ); + + m_cbTestSimilarLabels = new wxCheckBox( sbSizer2->GetStaticBox(), wxID_ANY, _("Test similar labels"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbTestSimilarLabels->SetToolTip( _("Similar labels are labels (inside a sheet) which differs only by upper/lower case") ); + + sbSizer2->Add( m_cbTestSimilarLabels, 0, wxALL, 5 ); - m_staticText8 = new wxStaticText( m_PanelERCOptions, wxID_ANY, _("Pin to pin connections"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE ); - m_staticText8->Wrap( -1 ); - m_panelMatrixSizer->Add( m_staticText8, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 ); + m_cbTestUniqueGlbLabels = new wxCheckBox( sbSizer2->GetStaticBox(), wxID_ANY, _("Test single instances of global labels"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbTestUniqueGlbLabels->SetToolTip( _("Global labels are used to connect signals across the full hierarchy.\nThey are expected to be at least two labels with the same name.") ); - m_matrixPanel = new wxPanel( m_PanelERCOptions, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panelMatrixSizer->Add( m_matrixPanel, 1, wxEXPAND | wxALL, 5 ); + sbSizer2->Add( m_cbTestUniqueGlbLabels, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - m_staticline2 = new wxStaticLine( m_PanelERCOptions, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - m_panelMatrixSizer->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - m_staticText9 = new wxStaticText( m_PanelERCOptions, wxID_ANY, _("Label to label connections"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE ); - m_staticText9->Wrap( -1 ); - m_panelMatrixSizer->Add( m_staticText9, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + m_panelMatrixSizer->Add( sbSizer2, 0, wxALL|wxEXPAND, 5 ); - m_cbTestSimilarLabels = new wxCheckBox( m_PanelERCOptions, wxID_ANY, _("Test similar labels"), wxDefaultPosition, wxDefaultSize, 0 ); - m_cbTestSimilarLabels->SetToolTip( _("Similar labels are labels (inside a sheet) which differs only by upper/lower case") ); + wxStaticBoxSizer* sbSizer3; + sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( m_PanelERCOptions, wxID_ANY, _("Pin to Pin Connections") ), wxVERTICAL ); - m_panelMatrixSizer->Add( m_cbTestSimilarLabels, 0, wxALL, 5 ); + m_matrixPanel = new wxPanel( sbSizer3->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + sbSizer3->Add( m_matrixPanel, 1, wxEXPAND | wxALL, 5 ); + + m_ResetOptButton = new wxButton( sbSizer3->GetStaticBox(), ID_RESET_MATRIX, _("Initialize to Default"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer3->Add( m_ResetOptButton, 0, wxALIGN_RIGHT|wxTOP|wxRIGHT|wxLEFT, 5 ); - m_cbTestUniqueGlbLabels = new wxCheckBox( m_PanelERCOptions, wxID_ANY, _("Test single instances of global labels"), wxDefaultPosition, wxDefaultSize, 0 ); - m_cbTestUniqueGlbLabels->SetToolTip( _("Global labels are used to connect signals across the full hierarchy.\nThey are expected to be at least two labels with the same name.") ); - m_panelMatrixSizer->Add( m_cbTestUniqueGlbLabels, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + m_panelMatrixSizer->Add( sbSizer3, 0, wxALL|wxEXPAND, 5 ); m_PanelERCOptions->SetSizer( m_panelMatrixSizer ); diff --git a/eeschema/dialogs/dialog_erc_base.fbp b/eeschema/dialogs/dialog_erc_base.fbp index 7aa71bae79..64f0b5b6b2 100644 --- a/eeschema/dialogs/dialog_erc_base.fbp +++ b/eeschema/dialogs/dialog_erc_base.fbp @@ -259,8 +259,8 @@ wxVERTICAL none - 5 - wxALL|wxEXPAND + 8 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT 0 @@ -269,7 +269,7 @@ none 5 - wxEXPAND|wxLEFT|wxRIGHT|wxTOP + wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT 0 wxID_ANY @@ -987,17 +987,17 @@ - - 5 + + 3 wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP 1 - + bSizerMessages wxVERTICAL none - 5 + 12 wxRIGHT|wxLEFT 0 @@ -1024,7 +1024,7 @@ 1 1 - + ,90,90,11,70,0 0 0 wxID_ANY @@ -1081,7 +1081,7 @@ 5 - wxEXPAND|wxLEFT + wxEXPAND|wxBOTTOM|wxLEFT 1 1 @@ -1117,7 +1117,7 @@ 0 0 - -1,-1 + 180,-1 1 m_MessagesList 1 @@ -1175,8 +1175,8 @@ - 5 - wxTOP|wxRIGHT|wxLEFT + 20 + wxLEFT|wxRIGHT 0 1 @@ -1202,7 +1202,7 @@ 1 1 - + ,90,90,11,70,0 0 0 wxID_ANY @@ -1258,8 +1258,8 @@ - 5 - wxEXPAND|wxALL + 8 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 1 1 @@ -1343,7 +1343,7 @@ 5 - wxALIGN_RIGHT + wxALIGN_RIGHT|wxRIGHT|wxLEFT 0 @@ -1704,593 +1704,376 @@ none 5 - wxALIGN_RIGHT|wxTOP|wxRIGHT|wxLEFT + wxALL|wxEXPAND 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_RESET_MATRIX - Initialize to Default - - 0 - - - 0 + + wxID_ANY + Label to Label Connections - 1 - m_ResetOptButton - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnResetMatrixClick - - - - - - - - - - - - - - - - - - - - - - + sbSizer2 + wxVERTICAL + 1 + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Test similar labels + + 0 + + + 0 + + 1 + m_cbTestSimilarLabels + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Similar labels are labels (inside a sheet) which differs only by upper/lower case + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Test single instances of global labels + + 0 + + + 0 + + 1 + m_cbTestUniqueGlbLabels + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Global labels are used to connect signals across the full hierarchy. They are expected to be at least two labels with the same name. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 - wxRIGHT|wxLEFT|wxEXPAND + wxALL|wxEXPAND 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Pin to pin connections - - 0 - - - 0 - - 1 - m_staticText8 - 1 - - - protected - 1 - - Resizable - 1 - - wxALIGN_CENTRE - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND | wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_matrixPanel - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxTOP|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline2 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Label to label connections - - 0 - - - 0 - - 1 - m_staticText9 - 1 - - - protected - 1 - - Resizable - 1 - - wxALIGN_CENTRE - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Test similar labels - - 0 - - - 0 - - 1 - m_cbTestSimilarLabels - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Similar labels are labels (inside a sheet) which differs only by upper/lower case - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 + wxID_ANY - Test single instances of global labels - - 0 - - - 0 + Pin to Pin Connections - 1 - m_cbTestUniqueGlbLabels - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Global labels are used to connect signals across the full hierarchy. They are expected to be at least two labels with the same name. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + sbSizer3 + wxVERTICAL + 1 + none + + 5 + wxEXPAND | wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_matrixPanel + 1 + + + protected + 1 + + Resizable + 1 + + + 0 + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_RIGHT|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_RESET_MATRIX + Initialize to Default + + 0 + + + 0 + + 1 + m_ResetOptButton + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnResetMatrixClick + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eeschema/dialogs/dialog_erc_base.h b/eeschema/dialogs/dialog_erc_base.h index 72886f347b..33c3c65b1e 100644 --- a/eeschema/dialogs/dialog_erc_base.h +++ b/eeschema/dialogs/dialog_erc_base.h @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 17 2016) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO "NOT" EDIT THIS FILE! +// PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #ifndef __DIALOG_ERC_BASE_H__ @@ -11,7 +11,6 @@ #include #include #include -class DIALOG_SHIM; class ERC_HTML_LISTFRAME; #include "dialog_shim.h" @@ -67,13 +66,10 @@ class DIALOG_ERC_BASE : public DIALOG_SHIM wxButton* m_buttonERC; wxButton* m_buttonClose; wxPanel* m_PanelERCOptions; - wxButton* m_ResetOptButton; - wxStaticText* m_staticText8; - wxPanel* m_matrixPanel; - wxStaticLine* m_staticline2; - wxStaticText* m_staticText9; wxCheckBox* m_cbTestSimilarLabels; wxCheckBox* m_cbTestUniqueGlbLabels; + wxPanel* m_matrixPanel; + wxButton* m_ResetOptButton; // Virtual event handlers, overide them in your derived class virtual void OnCloseErcDialog( wxCloseEvent& event ) { event.Skip(); } diff --git a/eeschema/erc.cpp b/eeschema/erc.cpp index 8fdee6f153..7cbc64f9ea 100644 --- a/eeschema/erc.cpp +++ b/eeschema/erc.cpp @@ -86,17 +86,17 @@ // Messages for matrix rows: const wxString CommentERC_H[] = { - _( "Input Pin.........." ), - _( "Output Pin........." ), - _( "Bidirectional Pin.." ), - _( "Tri-State Pin......" ), - _( "Passive Pin........" ), - _( "Unspecified Pin...." ), - _( "Power Input Pin...." ), - _( "Power Output Pin..." ), - _( "Open Collector....." ), - _( "Open Emitter......." ), - _( "No Connection......" ) + _( "Input Pin" ), + _( "Output Pin" ), + _( "Bidirectional Pin" ), + _( "Tri-State Pin" ), + _( "Passive Pin" ), + _( "Unspecified Pin" ), + _( "Power Input Pin" ), + _( "Power Output Pin" ), + _( "Open Collector" ), + _( "Open Emitter" ), + _( "No Connection" ) }; // Messages for matrix columns