Make ERC options dialog clearer.

Fixes: lp:1667600
* https://bugs.launchpad.net/kicad/+bug/1667600
This commit is contained in:
Jeff Young 2018-04-06 14:46:16 +01:00
parent 15c64ee92d
commit 591a303777
5 changed files with 438 additions and 641 deletions

View File

@ -294,17 +294,28 @@ void DIALOG_ERC::ReBuildMatrixPanel()
if( m_initialized == false )
{
std::vector<wxStaticText*> 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

View File

@ -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_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_matrixPanel = new wxPanel( m_PanelERCOptions, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_panelMatrixSizer->Add( m_matrixPanel, 1, wxEXPAND | wxALL, 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_cbTestSimilarLabels = new wxCheckBox( m_PanelERCOptions, wxID_ANY, _("Test similar labels"), wxDefaultPosition, wxDefaultSize, 0 );
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") );
m_panelMatrixSizer->Add( m_cbTestSimilarLabels, 0, wxALL, 5 );
sbSizer2->Add( m_cbTestSimilarLabels, 0, wxALL, 5 );
m_cbTestUniqueGlbLabels = new wxCheckBox( m_PanelERCOptions, wxID_ANY, _("Test single instances of global labels"), wxDefaultPosition, wxDefaultSize, 0 );
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_panelMatrixSizer->Add( m_cbTestUniqueGlbLabels, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
sbSizer2->Add( m_cbTestUniqueGlbLabels, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
m_panelMatrixSizer->Add( sbSizer2, 0, wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* sbSizer3;
sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( m_PanelERCOptions, wxID_ANY, _("Pin to Pin Connections") ), wxVERTICAL );
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_panelMatrixSizer->Add( sbSizer3, 0, wxALL|wxEXPAND, 5 );
m_PanelERCOptions->SetSizer( m_panelMatrixSizer );

File diff suppressed because it is too large Load Diff

View File

@ -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 <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
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(); }

View File

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