From 3169b4170f62a1ef5307367d0f208159ccd6816d Mon Sep 17 00:00:00 2001 From: Mark Roszko Date: Sun, 5 Oct 2014 19:32:12 -0400 Subject: [PATCH 01/26] Use the verb "Generate" rather than the noun "Netlist" on the button in the Netlist Dialog. --- eeschema/dialogs/dialog_netlist_base.cpp | 7 +++++-- eeschema/dialogs/dialog_netlist_base.fbp | 6 ++++-- eeschema/dialogs/dialog_netlist_base.h | 4 +++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/eeschema/dialogs/dialog_netlist_base.cpp b/eeschema/dialogs/dialog_netlist_base.cpp index 97f5031338..6d7ebd913f 100644 --- a/eeschema/dialogs/dialog_netlist_base.cpp +++ b/eeschema/dialogs/dialog_netlist_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -43,7 +43,7 @@ NETLIST_DIALOG_BASE::NETLIST_DIALOG_BASE( wxWindow* parent, wxWindowID id, const bLeftSizer->Add( 0, 0, 0, wxTOP, 15 ); - m_buttonNetlist = new wxButton( this, ID_CREATE_NETLIST, _("Netlist"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonNetlist = new wxButton( this, ID_CREATE_NETLIST, _("Generate"), wxDefaultPosition, wxDefaultSize, 0 ); bLeftSizer->Add( m_buttonNetlist, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -72,6 +72,7 @@ NETLIST_DIALOG_BASE::NETLIST_DIALOG_BASE( wxWindow* parent, wxWindowID id, const bMainSizer->Add( m_staticTextDefaultFN, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_textCtrlDefaultFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); + m_textCtrlDefaultFileName->SetMaxLength( 0 ); bMainSizer->Add( m_textCtrlDefaultFileName, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); @@ -106,6 +107,7 @@ NETLIST_DIALOG_ADD_PLUGIN_BASE::NETLIST_DIALOG_ADD_PLUGIN_BASE( wxWindow* parent bSizerLeft->Add( m_staticTextCmd, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_textCtrlCommand = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_textCtrlCommand->SetMaxLength( 0 ); m_textCtrlCommand->SetMinSize( wxSize( 300,-1 ) ); bSizerLeft->Add( m_textCtrlCommand, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); @@ -115,6 +117,7 @@ NETLIST_DIALOG_ADD_PLUGIN_BASE::NETLIST_DIALOG_ADD_PLUGIN_BASE( wxWindow* parent bSizerLeft->Add( m_staticTextName, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_textCtrlName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_textCtrlName->SetMaxLength( 0 ); bSizerLeft->Add( m_textCtrlName, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); diff --git a/eeschema/dialogs/dialog_netlist_base.fbp b/eeschema/dialogs/dialog_netlist_base.fbp index 8b37c8e137..8d8d016a53 100644 --- a/eeschema/dialogs/dialog_netlist_base.fbp +++ b/eeschema/dialogs/dialog_netlist_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -20,8 +20,10 @@ . 1 + 1 1 1 + UI 1 0 @@ -247,7 +249,7 @@ 0 0 ID_CREATE_NETLIST - Netlist + Generate 0 diff --git a/eeschema/dialogs/dialog_netlist_base.h b/eeschema/dialogs/dialog_netlist_base.h index 840c6d1596..c6ed9a6e54 100644 --- a/eeschema/dialogs/dialog_netlist_base.h +++ b/eeschema/dialogs/dialog_netlist_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -11,6 +11,8 @@ #include #include #include +class DIALOG_SHIM; + #include "dialog_shim.h" #include #include From 8a2eecf435a851150a8ca83cc8a937d63bc3c68b Mon Sep 17 00:00:00 2001 From: Mark Roszko Date: Sun, 5 Oct 2014 19:33:20 -0400 Subject: [PATCH 02/26] Use the verb "Annotate" instead of "Annotation" in the Annotate Schematic dialog --- eeschema/dialogs/dialog_annotate_base.cpp | 4 ++-- eeschema/dialogs/dialog_annotate_base.fbp | 8 +++++--- eeschema/dialogs/dialog_annotate_base.h | 6 ++++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/eeschema/dialogs/dialog_annotate_base.cpp b/eeschema/dialogs/dialog_annotate_base.cpp index 38d1dc73ff..83fb59b599 100644 --- a/eeschema/dialogs/dialog_annotate_base.cpp +++ b/eeschema/dialogs/dialog_annotate_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -205,7 +205,7 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con m_btnClear = new wxButton( this, ID_CLEAR_ANNOTATION_CMP, _("Clear Annotation"), wxDefaultPosition, wxDefaultSize, 0 ); bButtonsSizer->Add( m_btnClear, 0, wxALL|wxEXPAND, 5 ); - m_btnApply = new wxButton( this, wxID_APPLY, _("Annotation"), wxDefaultPosition, wxDefaultSize, 0 ); + m_btnApply = new wxButton( this, wxID_APPLY, _("Annotate"), wxDefaultPosition, wxDefaultSize, 0 ); bButtonsSizer->Add( m_btnApply, 0, wxALL|wxEXPAND, 5 ); diff --git a/eeschema/dialogs/dialog_annotate_base.fbp b/eeschema/dialogs/dialog_annotate_base.fbp index 2c4df201cd..ebf4f0fd9d 100644 --- a/eeschema/dialogs/dialog_annotate_base.fbp +++ b/eeschema/dialogs/dialog_annotate_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -20,8 +20,10 @@ . 1 + 1 1 1 + UI 0 0 @@ -42,7 +44,7 @@ DIALOG_ANNOTATE_BASE - 432,454 + 432,550 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Annotate Schematic @@ -2398,7 +2400,7 @@ 0 0 wxID_APPLY - Annotation + Annotate 0 diff --git a/eeschema/dialogs/dialog_annotate_base.h b/eeschema/dialogs/dialog_annotate_base.h index 03e24ca816..a6161ee3b4 100644 --- a/eeschema/dialogs/dialog_annotate_base.h +++ b/eeschema/dialogs/dialog_annotate_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -11,6 +11,8 @@ #include #include #include +class DIALOG_SHIM; + #include "dialog_shim.h" #include #include @@ -81,7 +83,7 @@ class DIALOG_ANNOTATE_BASE : public DIALOG_SHIM public: - DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Annotate Schematic"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 432,454 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Annotate Schematic"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 432,550 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_ANNOTATE_BASE(); }; From 87aba60608ff1eae8103a58e6303af42d7da5989 Mon Sep 17 00:00:00 2001 From: Mark Roszko Date: Wed, 8 Oct 2014 00:02:48 -0400 Subject: [PATCH 03/26] Tweak the ERC dialog a bit. Fix dialog title to be "Electrical Rules Checker" to match everywhere else. Fix all usages of "Erc" to "ERC" consistently. Move action buttons to bottom of dialog, make Del Markers actually say Delete Markers. Add tooltips to ERC options matrix buttons to indicate what their current state is, for newb friendliness. Cleanup ERC options code that for some reason decided to delete the button and recreate it instead of just updating it's bitmap directly. Rename "Test Erc" to "Run" because you are running ERC and not testing it. Fix improper usage of SetLabel on a wxTextCtrl instead of SetValue so the ERC totals now work! --- eeschema/dialogs/dialog_erc.cpp | 78 ++-- eeschema/dialogs/dialog_erc.h | 1 + eeschema/dialogs/dialog_erc_base.cpp | 44 +- eeschema/dialogs/dialog_erc_base.fbp | 608 +++++++++++++-------------- eeschema/dialogs/dialog_erc_base.h | 28 +- 5 files changed, 383 insertions(+), 376 deletions(-) diff --git a/eeschema/dialogs/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp index 90d03494cf..32df02366a 100644 --- a/eeschema/dialogs/dialog_erc.cpp +++ b/eeschema/dialogs/dialog_erc.cpp @@ -93,13 +93,13 @@ void DIALOG_ERC::Init() wxString num; num.Printf( wxT( "%d" ), markers ); - m_TotalErrCount->SetLabel( num ); + m_TotalErrCount->SetValue( num ); num.Printf( wxT( "%d" ), markers - warnings ); - m_LastErrCount->SetLabel( num ); + m_LastErrCount->SetValue( num ); num.Printf( wxT( "%d" ), warnings ); - m_LastWarningCount->SetLabel( num ); + m_LastWarningCount->SetValue( num ); DisplayERC_MarkersList(); @@ -289,30 +289,14 @@ void DIALOG_ERC::ReBuildMatrixPanel() } int event_id = ID_MATRIX_0 + ii + ( jj * PIN_NMAX ); - BITMAP_DEF bitmap_butt = NULL; - - // Add button on matrix - switch( diag ) - { - case OK: - bitmap_butt = erc_green_xpm; - break; - - case WAR: - bitmap_butt = ercwarn_xpm ; - break; - - default: - case ERR: - bitmap_butt = ercerr_xpm; - break; - } + BITMAP_DEF bitmap_butt = erc_green_xpm; delete m_buttonList[ii][jj]; m_buttonList[ii][jj] = new wxBitmapButton( m_matrixPanel, event_id, KiBitmap( bitmap_butt ), wxPoint( x, y ) ); + setDRCMatrixButtonState( m_buttonList[ii][jj], diag ); } } @@ -320,6 +304,37 @@ void DIALOG_ERC::ReBuildMatrixPanel() } +void DIALOG_ERC::setDRCMatrixButtonState( wxBitmapButton *aButton, int aState ) +{ + BITMAP_DEF bitmap_butt = NULL; + wxString tooltip; + + switch( aState ) + { + case OK: + bitmap_butt = erc_green_xpm; + tooltip = _("No error or warning"); + break; + + case WAR: + bitmap_butt = ercwarn_xpm; + tooltip = _("Generate warning"); + break; + + case ERR: + bitmap_butt = ercerr_xpm; + tooltip = _("Generate error"); + break; + } + + if( bitmap_butt ) + { + aButton->SetBitmap(KiBitmap( bitmap_butt )); + aButton->SetToolTip(tooltip); + } +} + + void DIALOG_ERC::DisplayERC_MarkersList() { SCH_SHEET_LIST sheetList; @@ -359,7 +374,6 @@ void DIALOG_ERC::ResetDefaultERCDiag( wxCommandEvent& event ) void DIALOG_ERC::ChangeErrorLevel( wxCommandEvent& event ) { int id, level, ii, x, y; - BITMAP_DEF new_bitmap_butt = NULL; wxPoint pos; id = event.GetId(); @@ -371,33 +385,25 @@ void DIALOG_ERC::ChangeErrorLevel( wxCommandEvent& event ) level = DiagErc[y][x]; + //change to the next error level switch( level ) { case OK: level = WAR; - new_bitmap_butt = ercwarn_xpm; break; case WAR: level = ERR; - new_bitmap_butt = ercerr_xpm; break; case ERR: level = OK; - new_bitmap_butt = erc_green_xpm; break; } - if( new_bitmap_butt ) - { - delete butt; - butt = new wxBitmapButton( m_matrixPanel, id, - KiBitmap( new_bitmap_butt ), pos ); + setDRCMatrixButtonState( butt, level); - m_buttonList[y][x] = butt; - DiagErc[y][x] = DiagErc[x][y] = level; - } + DiagErc[y][x] = DiagErc[x][y] = level; } @@ -520,13 +526,13 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList ) int warnings = screens.GetMarkerCount( WAR ); num.Printf( wxT( "%d" ), markers ); - m_TotalErrCount->SetLabel( num ); + m_TotalErrCount->SetValue( num ); num.Printf( wxT( "%d" ), markers - warnings ); - m_LastErrCount->SetLabel( num ); + m_LastErrCount->SetValue( num ); num.Printf( wxT( "%d" ), warnings ); - m_LastWarningCount->SetLabel( num ); + m_LastWarningCount->SetValue( num ); // Display diags: DisplayERC_MarkersList(); diff --git a/eeschema/dialogs/dialog_erc.h b/eeschema/dialogs/dialog_erc.h index 294efe7131..91142eeea3 100644 --- a/eeschema/dialogs/dialog_erc.h +++ b/eeschema/dialogs/dialog_erc.h @@ -61,6 +61,7 @@ private: void ResetDefaultERCDiag( wxCommandEvent& event ); void ChangeErrorLevel( wxCommandEvent& event ); void ReBuildMatrixPanel(); + void setDRCMatrixButtonState( wxBitmapButton *aButton, int aState ); }; diff --git a/eeschema/dialogs/dialog_erc_base.cpp b/eeschema/dialogs/dialog_erc_base.cpp index f41796997c..7217988aa5 100644 --- a/eeschema/dialogs/dialog_erc_base.cpp +++ b/eeschema/dialogs/dialog_erc_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 6 2013) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -13,11 +13,11 @@ BEGIN_EVENT_TABLE( DIALOG_ERC_BASE, DIALOG_SHIM ) EVT_CLOSE( DIALOG_ERC_BASE::_wxFB_OnCloseErcDialog ) - EVT_BUTTON( ID_ERC_CMP, DIALOG_ERC_BASE::_wxFB_OnErcCmpClick ) - EVT_BUTTON( ID_ERASE_DRC_MARKERS, DIALOG_ERC_BASE::_wxFB_OnEraseDrcMarkersClick ) - EVT_BUTTON( wxID_CANCEL, DIALOG_ERC_BASE::_wxFB_OnButtonCloseClick ) EVT_LISTBOX( ID_MAKER_HTMLLISTBOX, DIALOG_ERC_BASE::_wxFB_OnLeftClickMarkersList ) EVT_LISTBOX_DCLICK( ID_MAKER_HTMLLISTBOX, DIALOG_ERC_BASE::_wxFB_OnLeftDblClickMarkersList ) + EVT_BUTTON( ID_ERASE_DRC_MARKERS, DIALOG_ERC_BASE::_wxFB_OnEraseDrcMarkersClick ) + EVT_BUTTON( ID_ERC_CMP, DIALOG_ERC_BASE::_wxFB_OnErcCmpClick ) + EVT_BUTTON( wxID_CANCEL, DIALOG_ERC_BASE::_wxFB_OnButtonCloseClick ) EVT_BUTTON( ID_RESET_MATRIX, DIALOG_ERC_BASE::_wxFB_OnResetMatrixClick ) END_EVENT_TABLE() @@ -37,7 +37,7 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin bupperSizer = new wxBoxSizer( wxHORIZONTAL ); wxStaticBoxSizer* sdiagSizer; - sdiagSizer = new wxStaticBoxSizer( new wxStaticBox( m_PanelERC, wxID_ANY, _("Erc report:") ), wxVERTICAL ); + sdiagSizer = new wxStaticBoxSizer( new wxStaticBox( m_PanelERC, wxID_ANY, _("ERC Report:") ), wxVERTICAL ); wxGridSizer* gSizeDiag; gSizeDiag = new wxGridSizer( 3, 2, 0, 0 ); @@ -86,24 +86,8 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin bupperSizer->Add( bSizerMessages, 1, wxEXPAND, 5 ); - wxBoxSizer* bbuttonsSizer; - bbuttonsSizer = new wxBoxSizer( wxVERTICAL ); - m_buttonERC = new wxButton( m_PanelERC, ID_ERC_CMP, _("&Test Erc"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonERC->SetDefault(); - bbuttonsSizer->Add( m_buttonERC, 0, wxALL|wxEXPAND, 5 ); - - m_buttondelmarkers = new wxButton( m_PanelERC, ID_ERASE_DRC_MARKERS, _("&Del Markers"), wxDefaultPosition, wxDefaultSize, 0 ); - bbuttonsSizer->Add( m_buttondelmarkers, 0, wxALL|wxEXPAND, 5 ); - - m_buttonClose = new wxButton( m_PanelERC, wxID_CANCEL, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 ); - bbuttonsSizer->Add( m_buttonClose, 0, wxALL|wxEXPAND, 5 ); - - - bupperSizer->Add( bbuttonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bercSizer->Add( bupperSizer, 0, wxEXPAND, 5 ); + bercSizer->Add( bupperSizer, 0, wxALL|wxEXPAND, 5 ); m_textMarkers = new wxStaticText( m_PanelERC, wxID_ANY, _("Error list:"), wxDefaultPosition, wxDefaultSize, 0 ); m_textMarkers->Wrap( -1 ); @@ -114,6 +98,22 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin bercSizer->Add( m_MarkersList, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + wxBoxSizer* bbuttonsSizer; + bbuttonsSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_buttondelmarkers = new wxButton( m_PanelERC, ID_ERASE_DRC_MARKERS, _("&Delete Markers"), wxDefaultPosition, wxDefaultSize, 0 ); + bbuttonsSizer->Add( m_buttondelmarkers, 0, wxALL|wxEXPAND, 5 ); + + m_buttonERC = new wxButton( m_PanelERC, ID_ERC_CMP, _("&Run"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonERC->SetDefault(); + bbuttonsSizer->Add( m_buttonERC, 0, wxALL|wxEXPAND, 5 ); + + m_buttonClose = new wxButton( m_PanelERC, wxID_CANCEL, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 ); + bbuttonsSizer->Add( m_buttonClose, 0, wxALL|wxEXPAND, 5 ); + + + bercSizer->Add( bbuttonsSizer, 0, wxALIGN_RIGHT, 5 ); + m_PanelERC->SetSizer( bercSizer ); m_PanelERC->Layout(); diff --git a/eeschema/dialogs/dialog_erc_base.fbp b/eeschema/dialogs/dialog_erc_base.fbp index 80447fc655..19e8d94af9 100644 --- a/eeschema/dialogs/dialog_erc_base.fbp +++ b/eeschema/dialogs/dialog_erc_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -47,7 +47,7 @@ 519,392 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h - EESchema Erc + Electrical Rules Checker @@ -260,30 +260,30 @@ none 5 - wxEXPAND + wxALL|wxEXPAND 0 - + bupperSizer wxHORIZONTAL none - + 5 wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP 0 - + wxID_ANY - Erc report: + ERC Report: sdiagSizer wxVERTICAL none - + 5 0 - + 2 0 @@ -291,11 +291,11 @@ none 3 0 - + 5 wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -374,11 +374,11 @@ - + 5 wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -465,11 +465,11 @@ - + 5 wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -548,11 +548,11 @@ - + 5 wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -639,11 +639,11 @@ - + 5 wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -722,11 +722,11 @@ - + 5 wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -815,11 +815,11 @@ - + 5 wxTOP|wxBOTTOM|wxRIGHT 0 - + 1 1 1 @@ -905,20 +905,20 @@ - + 5 wxEXPAND 1 - + bSizerMessages wxVERTICAL none - + 5 wxRIGHT|wxLEFT 0 - + 1 1 1 @@ -997,11 +997,11 @@ - + 5 wxEXPAND|wxLEFT 1 - + 1 1 1 @@ -1090,281 +1090,6 @@ - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - - bbuttonsSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_ERC_CMP - &Test Erc - - 0 - - - 0 - - 1 - m_buttonERC - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnErcCmpClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_ERASE_DRC_MARKERS - &Del Markers - - 0 - - - 0 - - 1 - m_buttondelmarkers - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnEraseDrcMarkersClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_CANCEL - &Close - - 0 - - - 0 - - 1 - m_buttonClose - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnButtonCloseClick - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1538,6 +1263,281 @@ + + 5 + wxALIGN_RIGHT + 0 + + + bbuttonsSizer + wxHORIZONTAL + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_ERASE_DRC_MARKERS + &Delete Markers + + 0 + + + 0 + + 1 + m_buttondelmarkers + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnEraseDrcMarkersClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_ERC_CMP + &Run + + 0 + + + 0 + + 1 + m_buttonERC + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnErcCmpClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_CANCEL + &Close + + 0 + + + 0 + + 1 + m_buttonClose + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnButtonCloseClick + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eeschema/dialogs/dialog_erc_base.h b/eeschema/dialogs/dialog_erc_base.h index 78dd608c2c..83689250f0 100644 --- a/eeschema/dialogs/dialog_erc_base.h +++ b/eeschema/dialogs/dialog_erc_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 6 2013) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -25,8 +25,8 @@ class ERC_HTML_LISTBOX; #include #include #include -#include #include +#include #include #include #include @@ -46,20 +46,20 @@ class DIALOG_ERC_BASE : public DIALOG_SHIM // Private event handlers void _wxFB_OnCloseErcDialog( wxCloseEvent& event ){ OnCloseErcDialog( event ); } - void _wxFB_OnErcCmpClick( wxCommandEvent& event ){ OnErcCmpClick( event ); } - void _wxFB_OnEraseDrcMarkersClick( wxCommandEvent& event ){ OnEraseDrcMarkersClick( event ); } - void _wxFB_OnButtonCloseClick( wxCommandEvent& event ){ OnButtonCloseClick( event ); } void _wxFB_OnLeftClickMarkersList( wxCommandEvent& event ){ OnLeftClickMarkersList( event ); } void _wxFB_OnLeftDblClickMarkersList( wxCommandEvent& event ){ OnLeftDblClickMarkersList( event ); } + void _wxFB_OnEraseDrcMarkersClick( wxCommandEvent& event ){ OnEraseDrcMarkersClick( event ); } + void _wxFB_OnErcCmpClick( wxCommandEvent& event ){ OnErcCmpClick( event ); } + void _wxFB_OnButtonCloseClick( wxCommandEvent& event ){ OnButtonCloseClick( event ); } void _wxFB_OnResetMatrixClick( wxCommandEvent& event ){ OnResetMatrixClick( event ); } protected: enum { - ID_ERC_CMP = 1000, + ID_MAKER_HTMLLISTBOX = 1000, ID_ERASE_DRC_MARKERS, - ID_MAKER_HTMLLISTBOX, + ID_ERC_CMP, ID_RESET_MATRIX }; @@ -74,28 +74,28 @@ class DIALOG_ERC_BASE : public DIALOG_SHIM wxCheckBox* m_WriteResultOpt; wxStaticText* m_titleMessages; wxTextCtrl* m_MessagesList; - wxButton* m_buttonERC; - wxButton* m_buttondelmarkers; - wxButton* m_buttonClose; wxStaticText* m_textMarkers; ERC_HTML_LISTBOX* m_MarkersList; + wxButton* m_buttondelmarkers; + wxButton* m_buttonERC; + wxButton* m_buttonClose; wxPanel* m_PanelERCOptions; wxButton* m_ResetOptButton; wxPanel* m_matrixPanel; // Virtual event handlers, overide them in your derived class virtual void OnCloseErcDialog( wxCloseEvent& event ) { event.Skip(); } - virtual void OnErcCmpClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnEraseDrcMarkersClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnButtonCloseClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnLeftClickMarkersList( wxCommandEvent& event ) { event.Skip(); } virtual void OnLeftDblClickMarkersList( wxCommandEvent& event ) { event.Skip(); } + virtual void OnEraseDrcMarkersClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnErcCmpClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnButtonCloseClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnResetMatrixClick( wxCommandEvent& event ) { event.Skip(); } public: - DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("EESchema Erc"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 519,392 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Electrical Rules Checker"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 519,392 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_ERC_BASE(); }; From 08f00517996028362c59f5d3c60a4de75a009e3e Mon Sep 17 00:00:00 2001 From: Mark Roszko Date: Wed, 8 Oct 2014 01:50:56 -0400 Subject: [PATCH 04/26] Rename module to footprint in menu,toolbars, window, etc that are in code --- pcbnew/footprint_wizard_frame.cpp | 2 +- pcbnew/loadcmp.cpp | 2 +- pcbnew/menubar_modedit.cpp | 30 +++++++++++++++--------------- pcbnew/menubar_pcbframe.cpp | 18 +++++++++--------- pcbnew/modedit_onclick.cpp | 12 ++++++------ pcbnew/moduleframe.cpp | 8 ++++---- pcbnew/modules.cpp | 2 +- pcbnew/tool_modedit.cpp | 30 +++++++++++++++--------------- pcbnew/tool_pcb.cpp | 6 +++--- 9 files changed, 55 insertions(+), 55 deletions(-) diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index 1ae891a257..69d2863aca 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -620,7 +620,7 @@ void FOOTPRINT_WIZARD_FRAME::ReCreateHToolbar() m_mainToolBar->AddSeparator(); m_mainToolBar->AddTool( ID_FOOTPRINT_WIZARD_DONE, wxEmptyString, KiBitmap( export_footprint_names_xpm ), - _( "Insert footprint in board" ) ); + _( "Add footprint to board" ) ); } // after adding the buttons to the toolbar, must call Realize() to diff --git a/pcbnew/loadcmp.cpp b/pcbnew/loadcmp.cpp index cc740ba166..92ce88082a 100644 --- a/pcbnew/loadcmp.cpp +++ b/pcbnew/loadcmp.cpp @@ -164,7 +164,7 @@ MODULE* PCB_BASE_FRAME::LoadModuleFromLibrary( const wxString& aLibrary, static wxString lastComponentName; // Ask for a component name or key words - DIALOG_GET_COMPONENT dlg( this, HistoryList, _( "Load Module" ), aUseFootprintViewer ); + DIALOG_GET_COMPONENT dlg( this, HistoryList, _( "Load Footprint" ), aUseFootprintViewer ); dlg.SetComponentName( lastComponentName ); diff --git a/pcbnew/menubar_modedit.cpp b/pcbnew/menubar_modedit.cpp index 418cc5c342..fc73ba49b0 100644 --- a/pcbnew/menubar_modedit.cpp +++ b/pcbnew/menubar_modedit.cpp @@ -69,7 +69,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() // New module AddMenuItem( fileMenu, ID_MODEDIT_NEW_MODULE, - _( "&New Module" ), _( "Create new module" ), + _( "&New Footprint" ), _( "Create new footprint" ), KiBitmap( new_footprint_xpm ) ); // Open submenu @@ -77,26 +77,26 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() // from File AddMenuItem( openSubmenu, ID_MODEDIT_IMPORT_PART, - _( "&Import Module From File" ), + _( "&Import Footprint From File" ), _( "Import footprint from an existing file" ), KiBitmap( import_module_xpm ) ); // from Library AddMenuItem( openSubmenu, ID_MODEDIT_LOAD_MODULE, - _( "Load Module From Current Li&brary" ), - _( "Open a footprint module from library" ), + _( "Load Footprint From Current Li&brary" ), + _( "Open a footprint from library" ), KiBitmap( module_xpm ) ); // from current Board AddMenuItem( openSubmenu, ID_MODEDIT_LOAD_MODULE_FROM_BOARD, - _( "Load Module From &Current Board" ), - _( "Load a footprint module from the current board" ), + _( "Load Footprint From &Current Board" ), + _( "Load a footprint from the current board" ), KiBitmap( load_module_board_xpm ) ); /* Append openSubmenu to fileMenu */ AddMenuItem( fileMenu, openSubmenu, -1, - _( "&Load Module" ), - _( "Load footprint module" ), + _( "&Load Footprint" ), + _( "Load footprint" ), KiBitmap( open_document_xpm ) ); fileMenu->AppendSeparator(); @@ -107,23 +107,23 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() KiBitmap( copy_library_xpm ) ); // Save module - text = AddHotkeyName( _( "&Save Module in Active Library" ), + text = AddHotkeyName( _( "&Save Footprint in Active Library" ), g_Module_Editor_Hokeys_Descr, HK_SAVE_MODULE ); AddMenuItem( fileMenu, ID_MODEDIT_SAVE_LIBMODULE, text, - _( "Save module in active library" ), + _( "Save footprint in active library" ), KiBitmap( save_library_xpm ) ); // Save module in new lib AddMenuItem( fileMenu, ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART, - _( "S&ave Module in New Library" ), + _( "S&ave Footprint in New Library" ), _( "Create a new library and save current module into it" ), KiBitmap( new_library_xpm ) ); // Export module AddMenuItem( fileMenu, ID_MODEDIT_EXPORT_PART, - _( "&Export Module" ), - _( "Save current loaded module into file" ), + _( "&Export Footprint" ), + _( "Save currently loaded footprint into file" ), KiBitmap( export_module_xpm ) ); // Import DXF File @@ -137,7 +137,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() // Print AddMenuItem( fileMenu, wxID_PRINT, _( "&Print" ), - _( "Print current module" ), + _( "Print current footprint" ), KiBitmap( plot_xpm ) ); // Separator @@ -175,7 +175,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() // Properties AddMenuItem( editMenu, ID_MODEDIT_EDIT_MODULE_PROPERTIES, _( "Edit &Properties" ), - _( "Edit module properties" ), + _( "Edit footprint properties" ), KiBitmap( module_options_xpm ) ); // Dimensions submenu diff --git a/pcbnew/menubar_pcbframe.cpp b/pcbnew/menubar_pcbframe.cpp index 9f1e6777b1..76c67252c0 100644 --- a/pcbnew/menubar_pcbframe.cpp +++ b/pcbnew/menubar_pcbframe.cpp @@ -134,8 +134,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() //----- Fabrication Outputs submenu ----------------------------------------- wxMenu* fabricationOutputsMenu = new wxMenu; AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_POS_MODULES_FILE, - _( "&Modules Position (.pos) File" ), - _( "Generate modules position file for pick and place" ), + _( "&Footprint Position (.pos) File" ), + _( "Generate footprint position file for pick and place" ), KiBitmap( post_compo_xpm ) ); AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_DRILL_FILE, @@ -144,8 +144,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() KiBitmap( post_drill_xpm ) ); AddMenuItem( fabricationOutputsMenu, ID_GEN_EXPORT_FILE_MODULE_REPORT, - _( "&Module (.rpt) Report" ), - _( "Create a report of all modules on the current board" ), + _( "&Footprint (.rpt) Report" ), + _( "Create a report of all footprints on the current board" ), KiBitmap( tools_xpm ) ); AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_D356_FILE, @@ -279,7 +279,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() AddMenuItem( editMenu, ID_PCB_GLOBAL_DELETE, _( "&Global Deletions" ), - _( "Delete tracks, modules, texts... on board" ), + _( "Delete tracks, footprints, texts... on board" ), KiBitmap( general_deletions_xpm ) ); AddMenuItem( editMenu, ID_MENU_PCB_CLEAN, @@ -293,8 +293,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() KiBitmap( swap_layer_xpm ) ); AddMenuItem( editMenu, ID_MENU_PCB_RESET_TEXTMODULE_FIELDS_SIZES, - _( "&Reset Module Field Sizes" ), - _( "Reset text size and width of all module fields to current defaults" ), + _( "&Reset Footprint Field Sizes" ), + _( "Reset text size and width of all footprint fields to current defaults" ), KiBitmap( reset_text_xpm ) ); //----- View menu ----------------------------------------------------------- @@ -365,10 +365,10 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() //----- Place Menu ---------------------------------------------------------- wxMenu* placeMenu = new wxMenu; - text = AddHotkeyName( _( "&Module" ), g_Pcbnew_Editor_Hokeys_Descr, + text = AddHotkeyName( _( "&Footprint" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ADD_MODULE ); AddMenuItem( placeMenu, ID_PCB_MODULE_BUTT, text, - _( "Add modules" ), KiBitmap( module_xpm ) ); + _( "Add footprints" ), KiBitmap( module_xpm ) ); text = AddHotkeyName( _( "&Track" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ADD_NEW_TRACK, IS_COMMENT ); diff --git a/pcbnew/modedit_onclick.cpp b/pcbnew/modedit_onclick.cpp index 70374ca976..a6b2e0d6f7 100644 --- a/pcbnew/modedit_onclick.cpp +++ b/pcbnew/modedit_onclick.cpp @@ -262,10 +262,10 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen KiBitmap( rotate_module_ccw_xpm ) ); AddMenuItem( transform_choice, ID_MODEDIT_MODULE_MIRROR, _( "Mirror" ), KiBitmap( mirror_footprint_axisY_xpm ) ); - msg = AddHotkeyName( _( "Edit Module" ), g_Module_Editor_Hokeys_Descr, HK_EDIT_ITEM ); + msg = AddHotkeyName( _( "Edit Footprint" ), g_Module_Editor_Hokeys_Descr, HK_EDIT_ITEM ); AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_MODULE_PRMS, msg, KiBitmap( edit_module_xpm ) ); AddMenuItem( PopMenu, transform_choice, ID_MODEDIT_TRANSFORM_MODULE, - _( "Transform Module" ), KiBitmap( edit_xpm ) ); + _( "Transform Footprint" ), KiBitmap( edit_xpm ) ); break; } @@ -297,25 +297,25 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen case PCB_MODULE_TEXT_T: if( !flags ) { - msg = AddHotkeyName( _("Move Text Mod." ), g_Module_Editor_Hokeys_Descr, + msg = AddHotkeyName( _("Move Text" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM ); AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST, msg, KiBitmap( move_field_xpm ) ); } - msg = AddHotkeyName( _("Rotate Text Mod." ), g_Module_Editor_Hokeys_Descr, + msg = AddHotkeyName( _("Rotate Text" ), g_Module_Editor_Hokeys_Descr, HK_ROTATE_ITEM ); AddMenuItem( PopMenu, ID_POPUP_PCB_ROTATE_TEXTMODULE, msg, KiBitmap( rotate_field_xpm ) ); if( !flags ) { - msg = AddHotkeyName( _("Edit Text Mod." ), g_Module_Editor_Hokeys_Descr, + msg = AddHotkeyName( _("Edit Text" ), g_Module_Editor_Hokeys_Descr, HK_EDIT_ITEM ); AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TEXTMODULE, msg, KiBitmap( edit_text_xpm ) ); if( ( static_cast( item ) )->GetType() == TEXTE_MODULE::TEXT_is_DIVERS ) { - msg = AddHotkeyName( _("Delete Text Mod." ), g_Module_Editor_Hokeys_Descr, + msg = AddHotkeyName( _("Delete Text" ), g_Module_Editor_Hokeys_Descr, HK_DELETE ); AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_TEXTMODULE, msg, KiBitmap( delete_text_xpm ) ); diff --git a/pcbnew/moduleframe.cpp b/pcbnew/moduleframe.cpp index bae419949c..bd05f70a8a 100644 --- a/pcbnew/moduleframe.cpp +++ b/pcbnew/moduleframe.cpp @@ -461,7 +461,7 @@ void FOOTPRINT_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event ) { if( GetScreen()->IsModify() ) { - int ii = DisplayExitDialog( this, _( "Save the changes in the module before closing?" ) ); + int ii = DisplayExitDialog( this, _( "Save the changes to the footprint before closing?" ) ); switch( ii ) { @@ -482,7 +482,7 @@ void FOOTPRINT_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event ) } else { - DisplayError( this, _( "Library is not set, the module could not be saved." ) ); + DisplayError( this, _( "Library is not set, the footprint could not be saved." ) ); } // fall through: cancel the close because of an error @@ -672,7 +672,7 @@ void FOOTPRINT_EDIT_FRAME::OnModify() void FOOTPRINT_EDIT_FRAME::updateTitle() { - wxString title = _( "Module Editor " ); + wxString title = _( "Footprint Editor " ); wxString nickname = GetCurrentLib(); @@ -688,7 +688,7 @@ void FOOTPRINT_EDIT_FRAME::updateTitle() bool writable = Prj().PcbFootprintLibs()->IsFootprintLibWritable( nickname ); // no exception was thrown, this means libPath is valid, but it may be read only. - title = _( "Module Editor (active library: " ) + nickname + wxT( ")" ); + title = _( "Footprint Editor (active library: " ) + nickname + wxT( ")" ); if( !writable ) title += _( " [Read Only]" ); diff --git a/pcbnew/modules.cpp b/pcbnew/modules.cpp index 60139f5761..0f55e5155f 100644 --- a/pcbnew/modules.cpp +++ b/pcbnew/modules.cpp @@ -262,7 +262,7 @@ bool PCB_EDIT_FRAME::Delete_Module( MODULE* aModule, wxDC* aDC, bool aAskBeforeD /* Confirm module delete. */ if( aAskBeforeDeleting ) { - msg.Printf( _( "Delete Module %s (value %s) ?" ), + msg.Printf( _( "Delete Footprint %s (value %s) ?" ), GetChars( aModule->GetReference() ), GetChars( aModule->GetValue() ) ); diff --git a/pcbnew/tool_modedit.cpp b/pcbnew/tool_modedit.cpp index d4fe6c2351..d5eac2b874 100644 --- a/pcbnew/tool_modedit.cpp +++ b/pcbnew/tool_modedit.cpp @@ -61,14 +61,14 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar() _( "Select active library" ) ); m_mainToolBar->AddTool( ID_MODEDIT_SAVE_LIBMODULE, wxEmptyString, KiBitmap( save_library_xpm ), - _( "Save module in active library" ) ); + _( "Save footprint in active library" ) ); m_mainToolBar->AddTool( ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART, wxEmptyString, KiBitmap( new_library_xpm ), - _( "Create new library and save current module" ) ); + _( "Create new library and save current footprint" ) ); m_mainToolBar->AddTool( ID_OPEN_MODULE_VIEWER, wxEmptyString, KiBitmap( modview_icon_xpm ), - _( "Open module viewer" ) ); + _( "Open footprint viewer" ) ); m_mainToolBar->AddSeparator(); m_mainToolBar->AddTool( ID_MODEDIT_DELETE_PART, wxEmptyString, KiBitmap( delete_xpm ), @@ -76,38 +76,38 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar() m_mainToolBar->AddSeparator(); m_mainToolBar->AddTool( ID_MODEDIT_NEW_MODULE, wxEmptyString, KiBitmap( new_footprint_xpm ), - _( "New module" ) ); + _( "New footprint" ) ); #ifdef KICAD_SCRIPTING m_mainToolBar->AddTool( ID_MODEDIT_NEW_MODULE_FROM_WIZARD, wxEmptyString, KiBitmap( module_wizard_xpm ), - _( "New module from footprint wizard" ) ); + _( "New footprint using wizard" ) ); #endif m_mainToolBar->AddTool( ID_MODEDIT_LOAD_MODULE, wxEmptyString, KiBitmap( load_module_lib_xpm ), - _( "Load module from library" ) ); + _( "Load footprint from library" ) ); m_mainToolBar->AddSeparator(); m_mainToolBar->AddTool( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, wxEmptyString, KiBitmap( load_module_board_xpm ), - _( "Load module from current board" ) ); + _( "Load footprint from current board" ) ); m_mainToolBar->AddTool( ID_MODEDIT_UPDATE_MODULE_IN_BOARD, wxEmptyString, KiBitmap( update_module_board_xpm ), - _( "Update module in current board" ) ); + _( "Update footprint in current board" ) ); m_mainToolBar->AddTool( ID_MODEDIT_INSERT_MODULE_IN_BOARD, wxEmptyString, KiBitmap( insert_module_board_xpm ), - _( "Insert module into current board" ) ); + _( "Insert footprint into current board" ) ); m_mainToolBar->AddSeparator(); m_mainToolBar->AddTool( ID_MODEDIT_IMPORT_PART, wxEmptyString, KiBitmap( import_module_xpm ), - _( "Import module" ) ); + _( "Import footprint" ) ); m_mainToolBar->AddTool( ID_MODEDIT_EXPORT_PART, wxEmptyString, KiBitmap( export_module_xpm ), - _( "Export module" ) ); + _( "Export footprint" ) ); m_mainToolBar->AddSeparator(); @@ -119,11 +119,11 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar() m_mainToolBar->AddSeparator(); m_mainToolBar->AddTool( ID_MODEDIT_EDIT_MODULE_PROPERTIES, wxEmptyString, KiBitmap( module_options_xpm ), - _( "Module properties" ) ); + _( "Footprint properties" ) ); m_mainToolBar->AddSeparator(); m_mainToolBar->AddTool( wxID_PRINT, wxEmptyString, KiBitmap( print_button_xpm ), - _( "Print module" ) ); + _( "Print footprint" ) ); m_mainToolBar->AddSeparator(); msg = AddHotkeyName( _( "Zoom in" ), g_Module_Editor_Hokeys_Descr, HK_ZOOM_IN, IS_COMMENT ); @@ -146,7 +146,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar() m_mainToolBar->AddSeparator(); m_mainToolBar->AddTool( ID_MODEDIT_CHECK, wxEmptyString, KiBitmap( module_check_xpm ), - _( "Check module" ) ); + _( "Check footprint" ) ); // after adding the buttons to the toolbar, must call Realize() to reflect the changes m_mainToolBar->Realize(); @@ -184,7 +184,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateVToolbar() m_drawToolBar->AddSeparator(); m_drawToolBar->AddTool( ID_MODEDIT_ANCHOR_TOOL, wxEmptyString, KiBitmap( anchor_xpm ), - _( "Place the footprint module reference anchor" ), + _( "Place the footprint reference anchor" ), wxITEM_CHECK ); m_drawToolBar->AddSeparator(); diff --git a/pcbnew/tool_pcb.cpp b/pcbnew/tool_pcb.cpp index 8c11346ada..e9f93716db 100644 --- a/pcbnew/tool_pcb.cpp +++ b/pcbnew/tool_pcb.cpp @@ -237,11 +237,11 @@ void PCB_EDIT_FRAME::ReCreateHToolbar() m_mainToolBar->AddSeparator(); m_mainToolBar->AddTool( ID_OPEN_MODULE_EDITOR, wxEmptyString, KiBitmap( module_editor_xpm ), - _( "Open module editor" ) ); + _( "Open footprint editor" ) ); m_mainToolBar->AddTool( ID_OPEN_MODULE_VIEWER, wxEmptyString, KiBitmap( modview_icon_xpm ), - _( "Open module viewer" ) ); + _( "Open footprint viewer" ) ); m_mainToolBar->AddSeparator(); msg = AddHotkeyName( HELP_UNDO, g_Board_Editor_Hokeys_Descr, HK_UNDO, IS_COMMENT ); @@ -297,7 +297,7 @@ void PCB_EDIT_FRAME::ReCreateHToolbar() m_mainToolBar->AddSeparator(); m_mainToolBar->AddTool( ID_TOOLBARH_PCB_MODE_MODULE, wxEmptyString, KiBitmap( mode_module_xpm ), - _( "Mode footprint: manual and automatic move and place modules" ), + _( "Mode footprint: manual and automatic movement and placement" ), wxITEM_CHECK ); m_mainToolBar->AddTool( ID_TOOLBARH_PCB_MODE_TRACKS, wxEmptyString, KiBitmap( mode_track_xpm ), _( "Mode track: autorouting" ), wxITEM_CHECK ); From bfdc13df61e0fcd807caff7139f15db2ea49f548 Mon Sep 17 00:00:00 2001 From: Mark Roszko Date: Wed, 8 Oct 2014 01:54:52 -0400 Subject: [PATCH 05/26] Update footprint property editor (activated from board editor) to use "Footprint". --- .../dialog_edit_module_for_BoardEditor_base.cpp | 6 +++--- .../dialog_edit_module_for_BoardEditor_base.fbp | 10 +++++----- .../dialogs/dialog_edit_module_for_BoardEditor_base.h | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.cpp b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.cpp index ee0a156d12..ecd0b04eff 100644 --- a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.cpp +++ b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 6 2013) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -128,10 +128,10 @@ DIALOG_MODULE_BOARD_EDITOR_BASE::DIALOG_MODULE_BOARD_EDITOR_BASE( wxWindow* pare m_PropRightSizer = new wxBoxSizer( wxVERTICAL ); - m_buttonExchange = new wxButton( m_PanelProperties, ID_MODULE_PROPERTIES_EXCHANGE, _("Change Module(s)"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonExchange = new wxButton( m_PanelProperties, ID_MODULE_PROPERTIES_EXCHANGE, _("Change Footprint(s)"), wxDefaultPosition, wxDefaultSize, 0 ); m_PropRightSizer->Add( m_buttonExchange, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - m_buttonModuleEditor = new wxButton( m_PanelProperties, ID_GOTO_MODULE_EDITOR, _("Module Editor"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonModuleEditor = new wxButton( m_PanelProperties, ID_GOTO_MODULE_EDITOR, _("Footprint Editor"), wxDefaultPosition, wxDefaultSize, 0 ); m_PropRightSizer->Add( m_buttonModuleEditor, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); wxBoxSizer* bSizerAttrib; diff --git a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.fbp b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.fbp index 032726aa21..8413a47ab2 100644 --- a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.fbp +++ b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -44,10 +44,10 @@ DIALOG_MODULE_BOARD_EDITOR_BASE - 499,591 + 499,630 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h - Module Properties + Footprint Properties @@ -2000,7 +2000,7 @@ 0 0 ID_MODULE_PROPERTIES_EXCHANGE - Change Module(s) + Change Footprint(s) 0 @@ -2088,7 +2088,7 @@ 0 0 ID_GOTO_MODULE_EDITOR - Module Editor + Footprint Editor 0 diff --git a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.h b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.h index 3a12366e63..335a04ed32 100644 --- a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.h +++ b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 6 2013) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -138,7 +138,7 @@ class DIALOG_MODULE_BOARD_EDITOR_BASE : public DIALOG_SHIM public: wxStaticBoxSizer* m_Sizer3DValues; - DIALOG_MODULE_BOARD_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Module Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 499,591 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_MODULE_BOARD_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Footprint Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 499,630 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_MODULE_BOARD_EDITOR_BASE(); }; From fcbfaac7c971db962ba2b7b9488b7431ca0670de Mon Sep 17 00:00:00 2001 From: Mark Roszko Date: Wed, 8 Oct 2014 01:58:59 -0400 Subject: [PATCH 06/26] Update footprint editor property dialog to use "Footprint" instead of "Module" --- pcbnew/dialogs/dialog_edit_module_for_Modedit_base.cpp | 2 +- pcbnew/dialogs/dialog_edit_module_for_Modedit_base.fbp | 6 +++--- pcbnew/dialogs/dialog_edit_module_for_Modedit_base.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.cpp b/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.cpp index 4431dc3b64..6e404ab13c 100644 --- a/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.cpp +++ b/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 6 2013) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! diff --git a/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.fbp b/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.fbp index 098cd0381c..11bfde271e 100644 --- a/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.fbp +++ b/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -44,10 +44,10 @@ DIALOG_MODULE_MODULE_EDITOR_BASE - 486,462 + 486,510 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h - Module Properties + Footprint Properties diff --git a/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.h b/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.h index 17e741b5d0..f617580944 100644 --- a/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.h +++ b/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 6 2013) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -117,7 +117,7 @@ class DIALOG_MODULE_MODULE_EDITOR_BASE : public DIALOG_SHIM public: - DIALOG_MODULE_MODULE_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Module Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 486,462 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_MODULE_MODULE_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Footprint Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 486,510 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_MODULE_MODULE_EDITOR_BASE(); }; From fbc4abc55ae2883549695b60a531c33725b4725e Mon Sep 17 00:00:00 2001 From: Mark Roszko Date: Wed, 8 Oct 2014 02:26:26 -0400 Subject: [PATCH 07/26] Update module to footprint in the little info bar at bottom of window Fix text in Get and Move Footprint Dialog Fix right click in board editor options --- pcbnew/class_module.cpp | 2 +- pcbnew/modules.cpp | 2 +- pcbnew/onrightclick.cpp | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index 6c9d860b9a..7bf8af178f 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -602,7 +602,7 @@ void MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) } aList.push_back( MSG_PANEL_ITEM( _( "Attrib" ), msg, BROWN ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Module" ), FROM_UTF8( m_fpid.Format().c_str() ), BLUE ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Footprint" ), FROM_UTF8( m_fpid.Format().c_str() ), BLUE ) ); msg = _( "No 3D shape" ); // Search the first active 3D shape in list diff --git a/pcbnew/modules.cpp b/pcbnew/modules.cpp index 0f55e5155f..0c6efb96e6 100644 --- a/pcbnew/modules.cpp +++ b/pcbnew/modules.cpp @@ -64,7 +64,7 @@ MODULE* PCB_BASE_FRAME::GetModuleByName() wxString moduleName; MODULE* module = NULL; - wxTextEntryDialog dlg( this, _( "Name:" ), _( "Search footprint" ), moduleName ); + wxTextEntryDialog dlg( this, _( "Reference:" ), _( "Search for footprint" ), moduleName ); if( dlg.ShowModal() != wxID_OK ) return NULL; //Aborted by user diff --git a/pcbnew/onrightclick.cpp b/pcbnew/onrightclick.cpp index 91b1b7cbc5..bafbffe37f 100644 --- a/pcbnew/onrightclick.cpp +++ b/pcbnew/onrightclick.cpp @@ -153,14 +153,14 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) if( !( (MODULE*) item )->IsLocked() ) { - msg = AddHotkeyName( _("Lock Module" ), g_Board_Editor_Hokeys_Descr, + msg = AddHotkeyName( _("Lock Footprint" ), g_Board_Editor_Hokeys_Descr, HK_LOCK_UNLOCK_FOOTPRINT ); AddMenuItem( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE, msg, KiBitmap( locked_xpm ) ); } else { - msg = AddHotkeyName( _( "Unlock Module" ), g_Board_Editor_Hokeys_Descr, + msg = AddHotkeyName( _( "Unlock Footprint" ), g_Board_Editor_Hokeys_Descr, HK_LOCK_UNLOCK_FOOTPRINT ); AddMenuItem( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FREE_MODULE, msg, KiBitmap( unlocked_xpm ) ); @@ -168,14 +168,14 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) if( !flags ) aPopMenu->Append( ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE, - _( "Automatically Place Module" ) ); + _( "Automatically Place Footprint" ) ); } if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_TRACKS ) ) { if( !flags ) aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_MODULE, - _( "Automatically Route Module" ) ); + _( "Automatically Route Footprint" ) ); } break; @@ -413,7 +413,7 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) _( "Select Layer Pair" ), KiBitmap( select_layer_pair_xpm ) ); commands->AppendSeparator(); commands->Append( ID_POPUP_PCB_AUTOROUTE_ALL_MODULES, - _( "Automatically Route All Modules" ) ); + _( "Automatically Route All Footprints" ) ); commands->AppendSeparator(); commands->Append( ID_POPUP_PCB_AUTOROUTE_RESET_UNROUTED, _( "Reset Unrouted" ) ); aPopMenu->AppendSeparator(); @@ -758,10 +758,10 @@ void PCB_EDIT_FRAME::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* menu AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_EDIT_MODULE_PRMS, msg, KiBitmap( edit_module_xpm ) ); AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_EDIT_MODULE_WITH_MODEDIT, - _( "Edit with Module Editor" ), + _( "Edit with Footprint Editor" ), KiBitmap( module_editor_xpm ) ); sub_menu_footprint->AppendSeparator(); - msg = AddHotkeyName( _( "Delete Module" ), + msg = AddHotkeyName( _( "Delete Footprint" ), g_Board_Editor_Hokeys_Descr, HK_DELETE ); AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DELETE_MODULE, msg, KiBitmap( delete_module_xpm ) ); From 1d80fb7410926cacf1e38caa3e822090bf5e8f08 Mon Sep 17 00:00:00 2001 From: Mark Roszko Date: Wed, 8 Oct 2014 18:40:39 -0400 Subject: [PATCH 08/26] Reword count labels to be more proper --- eeschema/dialogs/dialog_erc_base.cpp | 6 +++--- eeschema/dialogs/dialog_erc_base.fbp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eeschema/dialogs/dialog_erc_base.cpp b/eeschema/dialogs/dialog_erc_base.cpp index 7217988aa5..a204d6e0c0 100644 --- a/eeschema/dialogs/dialog_erc_base.cpp +++ b/eeschema/dialogs/dialog_erc_base.cpp @@ -42,21 +42,21 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin wxGridSizer* gSizeDiag; gSizeDiag = new wxGridSizer( 3, 2, 0, 0 ); - m_ErcTotalErrorsText = new wxStaticText( m_PanelERC, wxID_ANY, _("Total errors count: "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); + m_ErcTotalErrorsText = new wxStaticText( m_PanelERC, wxID_ANY, _("Total:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); m_ErcTotalErrorsText->Wrap( -1 ); gSizeDiag->Add( m_ErcTotalErrorsText, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_TotalErrCount = new wxTextCtrl( m_PanelERC, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); gSizeDiag->Add( m_TotalErrCount, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_WarnErcErrorsText = new wxStaticText( m_PanelERC, wxID_ANY, _("Warnings count:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); + m_WarnErcErrorsText = new wxStaticText( m_PanelERC, wxID_ANY, _("Warnings:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); m_WarnErcErrorsText->Wrap( -1 ); gSizeDiag->Add( m_WarnErcErrorsText, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_LastWarningCount = new wxTextCtrl( m_PanelERC, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); gSizeDiag->Add( m_LastWarningCount, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_LastErrCountText = new wxStaticText( m_PanelERC, wxID_ANY, _("Errors count:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); + m_LastErrCountText = new wxStaticText( m_PanelERC, wxID_ANY, _("Errors:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); m_LastErrCountText->Wrap( -1 ); gSizeDiag->Add( m_LastErrCountText, 0, wxALIGN_CENTER_VERTICAL, 5 ); diff --git a/eeschema/dialogs/dialog_erc_base.fbp b/eeschema/dialogs/dialog_erc_base.fbp index 19e8d94af9..554b236564 100644 --- a/eeschema/dialogs/dialog_erc_base.fbp +++ b/eeschema/dialogs/dialog_erc_base.fbp @@ -323,7 +323,7 @@ 0 0 wxID_ANY - Total errors count: + Total: 0 @@ -497,7 +497,7 @@ 0 0 wxID_ANY - Warnings count: + Warnings: 0 @@ -671,7 +671,7 @@ 0 0 wxID_ANY - Errors count: + Errors: 0 From c29ee59cf1eb2533a5ac3e0578eb8f98b0bd6f94 Mon Sep 17 00:00:00 2001 From: Mark Roszko Date: Wed, 8 Oct 2014 18:40:47 -0400 Subject: [PATCH 09/26] Centralize error count update logic, clear the count on marker deletion. --- eeschema/dialogs/dialog_erc.cpp | 44 +++++++++++++++------------------ eeschema/dialogs/dialog_erc.h | 1 + 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/eeschema/dialogs/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp index 32df02366a..114654f5b6 100644 --- a/eeschema/dialogs/dialog_erc.cpp +++ b/eeschema/dialogs/dialog_erc.cpp @@ -88,18 +88,7 @@ void DIALOG_ERC::Init() m_WriteResultOpt->SetValue( m_writeErcFile ); SCH_SCREENS screens; - int markers = screens.GetMarkerCount(); - int warnings = screens.GetMarkerCount( WAR ); - - wxString num; - num.Printf( wxT( "%d" ), markers ); - m_TotalErrCount->SetValue( num ); - - num.Printf( wxT( "%d" ), markers - warnings ); - m_LastErrCount->SetValue( num ); - - num.Printf( wxT( "%d" ), warnings ); - m_LastWarningCount->SetValue( num ); + updateMarkerCounts( &screens ); DisplayERC_MarkersList(); @@ -110,6 +99,22 @@ void DIALOG_ERC::Init() m_buttonERC->SetDefault(); } +void DIALOG_ERC::updateMarkerCounts( SCH_SCREENS *screens ) +{ + int markers = screens->GetMarkerCount(); + int warnings = screens->GetMarkerCount( WAR ); + + wxString num; + num.Printf( wxT( "%d" ), markers ); + m_TotalErrCount->SetValue( num ); + + num.Printf( wxT( "%d" ), markers - warnings ); + m_LastErrCount->SetValue( num ); + + num.Printf( wxT( "%d" ), warnings ); + m_LastWarningCount->SetValue( num ); +} + /* Delete the old ERC markers, over the whole hierarchy */ void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event ) @@ -117,6 +122,8 @@ void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event ) SCH_SCREENS ScreenList; ScreenList.DeleteAllMarkers( MARK_ERC ); + updateMarkerCounts( &ScreenList ); + m_MarkersList->ClearList(); m_parent->GetCanvas()->Refresh(); } @@ -521,18 +528,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList ) } // Displays global results: - wxString num; - int markers = screens.GetMarkerCount(); - int warnings = screens.GetMarkerCount( WAR ); - - num.Printf( wxT( "%d" ), markers ); - m_TotalErrCount->SetValue( num ); - - num.Printf( wxT( "%d" ), markers - warnings ); - m_LastErrCount->SetValue( num ); - - num.Printf( wxT( "%d" ), warnings ); - m_LastWarningCount->SetValue( num ); + updateMarkerCounts(&screens); // Display diags: DisplayERC_MarkersList(); diff --git a/eeschema/dialogs/dialog_erc.h b/eeschema/dialogs/dialog_erc.h index 91142eeea3..9102e9efbb 100644 --- a/eeschema/dialogs/dialog_erc.h +++ b/eeschema/dialogs/dialog_erc.h @@ -62,6 +62,7 @@ private: void ChangeErrorLevel( wxCommandEvent& event ); void ReBuildMatrixPanel(); void setDRCMatrixButtonState( wxBitmapButton *aButton, int aState ); + void updateMarkerCounts( SCH_SCREENS *screens ); }; From a398d4591452b8ec176208e99dcf8e86e9996b6c Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Wed, 8 Oct 2014 19:54:51 -0400 Subject: [PATCH 10/26] Fix coding policy violations missed in previous commit. --- eeschema/dialogs/dialog_erc.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/eeschema/dialogs/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp index 114654f5b6..4c41ee57ab 100644 --- a/eeschema/dialogs/dialog_erc.cpp +++ b/eeschema/dialogs/dialog_erc.cpp @@ -99,6 +99,7 @@ void DIALOG_ERC::Init() m_buttonERC->SetDefault(); } + void DIALOG_ERC::updateMarkerCounts( SCH_SCREENS *screens ) { int markers = screens->GetMarkerCount(); @@ -115,6 +116,7 @@ void DIALOG_ERC::updateMarkerCounts( SCH_SCREENS *screens ) m_LastWarningCount->SetValue( num ); } + /* Delete the old ERC markers, over the whole hierarchy */ void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event ) @@ -161,6 +163,7 @@ void DIALOG_ERC::OnErcCmpClick( wxCommandEvent& event ) m_MessagesList->AppendText( messageList[ii] ); } + void DIALOG_ERC::OnLeftClickMarkersList( wxCommandEvent& event ) { m_lastMarkerFound = NULL; @@ -180,6 +183,7 @@ void DIALOG_ERC::OnLeftClickMarkersList( wxCommandEvent& event ) for( sheet = SheetList.GetFirst(); sheet; sheet = SheetList.GetNext() ) { SCH_ITEM* item = (SCH_ITEM*) sheet->LastDrawList(); + for( ; item; item = item->Next() ) { if( item == marker ) @@ -223,7 +227,7 @@ void DIALOG_ERC::OnLeftDblClickMarkersList( wxCommandEvent& event ) if( m_lastMarkerFound ) { m_parent->SetCrossHairPosition( m_lastMarkerFound->m_Pos ); - m_parent->RedrawScreen( m_lastMarkerFound->m_Pos, true); + m_parent->RedrawScreen( m_lastMarkerFound->m_Pos, true ); // prevent a mouse left button release event in // coming from the ERC dialog double click // ( the button is released after closing this dialog and will generate @@ -238,8 +242,7 @@ void DIALOG_ERC::OnLeftDblClickMarkersList( wxCommandEvent& event ) void DIALOG_ERC::ReBuildMatrixPanel() { // Try to know the size of bitmap button used in drc matrix - wxBitmapButton * dummy = new wxBitmapButton( m_matrixPanel, wxID_ANY, - KiBitmap( ercerr_xpm ) ); + wxBitmapButton * dummy = new wxBitmapButton( m_matrixPanel, wxID_ANY, KiBitmap( ercerr_xpm ) ); wxSize bitmap_size = dummy->GetSize(); delete dummy; @@ -320,24 +323,24 @@ void DIALOG_ERC::setDRCMatrixButtonState( wxBitmapButton *aButton, int aState ) { case OK: bitmap_butt = erc_green_xpm; - tooltip = _("No error or warning"); + tooltip = _( "No error or warning" ); break; case WAR: bitmap_butt = ercwarn_xpm; - tooltip = _("Generate warning"); + tooltip = _( "Generate warning" ); break; case ERR: bitmap_butt = ercerr_xpm; - tooltip = _("Generate error"); + tooltip = _( "Generate error" ); break; } - + if( bitmap_butt ) { - aButton->SetBitmap(KiBitmap( bitmap_butt )); - aButton->SetToolTip(tooltip); + aButton->SetBitmap( KiBitmap( bitmap_butt ) ); + aButton->SetToolTip( tooltip ); } } @@ -348,6 +351,7 @@ void DIALOG_ERC::DisplayERC_MarkersList() m_MarkersList->ClearList(); SCH_SHEET_PATH* sheet = sheetList.GetFirst(); + for( ; sheet != NULL; sheet = sheetList.GetNext() ) { SCH_ITEM* item = sheet->LastDrawList(); @@ -373,7 +377,7 @@ void DIALOG_ERC::DisplayERC_MarkersList() void DIALOG_ERC::ResetDefaultERCDiag( wxCommandEvent& event ) { - memcpy( DiagErc, DefaultDiagErc, sizeof(DiagErc) ); + memcpy( DiagErc, DefaultDiagErc, sizeof( DiagErc ) ); ReBuildMatrixPanel(); } @@ -420,7 +424,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList ) if( !DiagErcTableInit ) { - memcpy( DiagErc, DefaultDiagErc, sizeof(DefaultDiagErc) ); + memcpy( DiagErc, DefaultDiagErc, sizeof( DefaultDiagErc ) ); DiagErcTableInit = true; } @@ -528,7 +532,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList ) } // Displays global results: - updateMarkerCounts(&screens); + updateMarkerCounts( &screens ); // Display diags: DisplayERC_MarkersList(); From ef2337ca16d0c9b4f938365fa2778bcdba2abb77 Mon Sep 17 00:00:00 2001 From: John Beard Date: Wed, 8 Oct 2014 20:49:29 -0400 Subject: [PATCH 11/26] Improve alias handling in component chooser dialog. --- eeschema/dialogs/dialog_choose_component.cpp | 71 +++++++++++++++++--- 1 file changed, 60 insertions(+), 11 deletions(-) diff --git a/eeschema/dialogs/dialog_choose_component.cpp b/eeschema/dialogs/dialog_choose_component.cpp index 9352c94dde..f491e4f9cd 100644 --- a/eeschema/dialogs/dialog_choose_component.cpp +++ b/eeschema/dialogs/dialog_choose_component.cpp @@ -49,7 +49,7 @@ DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT( SCH_BASE_FRAME* aParent, const m_searchBox->SetFocus(); m_componentDetails->SetEditable( false ); -#if wxCHECK_VERSION( 3, 0, 0 ) +#if wxCHECK_VERSION( 3, 0, 0 ) m_libraryComponentTree->ScrollTo( m_libraryComponentTree->GetFocusedItem() ); #endif @@ -76,7 +76,7 @@ LIB_ALIAS* DIALOG_CHOOSE_COMPONENT::GetSelectedAlias( int* aUnit ) const void DIALOG_CHOOSE_COMPONENT::OnSearchBoxChange( wxCommandEvent& aEvent ) { - m_search_container->UpdateSearchTerm( m_searchBox->GetLineText(0) ); + m_search_container->UpdateSearchTerm( m_searchBox->GetLineText( 0 ) ); updateSelection(); m_searchBox->SetFocus(); } @@ -114,7 +114,7 @@ void DIALOG_CHOOSE_COMPONENT::OnInterceptSearchBoxKey( wxKeyEvent& aKeyStroke ) selectIfValid( GetNextItem( *m_libraryComponentTree, sel ) ); break; - // The follwoing keys we can only hijack if they are not needed by the textbox itself. + // The following keys we can only hijack if they are not needed by the textbox itself. case WXK_LEFT: if( m_searchBox->GetInsertionPoint() == 0 ) @@ -215,31 +215,58 @@ bool DIALOG_CHOOSE_COMPONENT::updateSelection() font_bold.SetWeight( wxFONTWEIGHT_BOLD ); wxTextAttr headline_attribute; - headline_attribute.SetFont(font_bold); + headline_attribute.SetFont( font_bold ); wxTextAttr text_attribute; - text_attribute.SetFont(font_normal); + text_attribute.SetFont( font_normal ); + + const wxString name = selection->GetName(); + + if ( !name.empty() ) + { + m_componentDetails->SetDefaultStyle( headline_attribute ); + m_componentDetails->AppendText( name ); + } const wxString description = selection->GetDescription(); if( !description.empty() ) { + if ( !m_componentDetails->IsEmpty() ) + m_componentDetails->AppendText( wxT( "\n\n" ) ); + m_componentDetails->SetDefaultStyle( headline_attribute ); - m_componentDetails->AppendText( _("Description\n") ); + m_componentDetails->AppendText( _( "Description\n" ) ); m_componentDetails->SetDefaultStyle( text_attribute ); m_componentDetails->AppendText( description ); - m_componentDetails->AppendText( wxT("\n\n") ); } const wxString keywords = selection->GetKeyWords(); if( !keywords.empty() ) { + if ( !m_componentDetails->IsEmpty() ) + m_componentDetails->AppendText( wxT( "\n\n" ) ); + m_componentDetails->SetDefaultStyle( headline_attribute ); - m_componentDetails->AppendText( _("Keywords\n") ); + m_componentDetails->AppendText( _( "Keywords\n" ) ); m_componentDetails->SetDefaultStyle( text_attribute ); m_componentDetails->AppendText( keywords ); } + if ( !selection->IsRoot() ) + { + LIB_PART* root_part = selection->GetPart(); + const wxString root_component_name( root_part ? root_part->GetName() : _( "Unknown" ) ); + + if ( !m_componentDetails->IsEmpty() ) + m_componentDetails->AppendText( wxT( "\n\n" ) ); + + m_componentDetails->SetDefaultStyle( headline_attribute ); + m_componentDetails->AppendText( _( "Alias of " ) ); + m_componentDetails->SetDefaultStyle( text_attribute ); + m_componentDetails->AppendText( root_component_name ); + } + m_componentDetails->SetInsertionPoint( 0 ); // scroll up. m_componentDetails->Thaw(); @@ -250,18 +277,39 @@ bool DIALOG_CHOOSE_COMPONENT::updateSelection() void DIALOG_CHOOSE_COMPONENT::OnHandlePreviewRepaint( wxPaintEvent& aRepaintEvent ) { int unit = 0; - LIB_ALIAS* selection = m_search_container->GetSelectedAlias( &unit ); + LIB_ALIAS* selection = m_search_container->GetSelectedAlias( &unit ); + LIB_PART* part = selection ? selection->GetPart() : NULL; - renderPreview( selection ? selection->GetPart() : NULL, unit ); + // Don't draw anything (not even the background) if we don't have + // a part to show + if( !part ) + return; + + if( selection->IsRoot() ) + { + // just show the part directly + renderPreview( part, unit ); + } + else + { + // switch out the name temporarily for the alias name + wxString tmp( part->GetName() ); + part->SetName( selection->GetName() ); + + renderPreview( part, unit ); + + part->SetName( tmp ); + } } // Render the preview in our m_componentView. If this gets more complicated, we should // probably have a derived class from wxPanel; but this keeps things local. -void DIALOG_CHOOSE_COMPONENT::renderPreview( LIB_PART* aComponent, int aUnit ) +void DIALOG_CHOOSE_COMPONENT::renderPreview( LIB_PART* aComponent, int aUnit ) { wxPaintDC dc( m_componentView ); EDA_COLOR_T bgcolor = m_parent->GetDrawBgColor(); + dc.SetBackground( bgcolor == BLACK ? *wxBLACK_BRUSH : *wxWHITE_BRUSH ); dc.Clear(); @@ -323,6 +371,7 @@ static wxTreeItemId GetNextItem( const wxTreeCtrl& tree, const wxTreeItemId& ite for ( wxTreeItemId walk = item; walk.IsOk(); walk = tree.GetItemParent( walk ) ) { nextItem = tree.GetNextSibling( walk ); + if( nextItem.IsOk() ) break; } From a9ab824373cfedb9003569f66cb55b287eead25f Mon Sep 17 00:00:00 2001 From: Bernhard Stegmaier Date: Thu, 9 Oct 2014 19:45:58 -0400 Subject: [PATCH 12/26] Fix OSX wxPython scripting build when running parallel builds. --- pcbnew/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 1a6180ae55..7d2e506e4c 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -689,10 +689,11 @@ if( KICAD_SCRIPTING ) else() # put into bundle at build time, it is relocated at install add_custom_target( ScriptingPcbnewPyCopy ALL - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/pcbnew/pcbnew.py" "${PYTHON_DEST}" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/pcbnew/pcbnew.py" "${PYTHON_DEST}/" DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/pcbnew.py COMMENT "Copying pcbnew.py into ${PYTHON_DEST}" ) + add_dependencies( ScriptingPcbnewPyCopy ScriptingWxpythonCopy ) # scripting plugins install( DIRECTORY ${PROJECT_SOURCE_DIR}/pcbnew/scripting/plugins/ DESTINATION ${KICAD_DATA}/scripting/plugins @@ -713,10 +714,11 @@ if( KICAD_SCRIPTING_MODULES ) else() # put everything into bundle at build time, it is relocated at install add_custom_target( ScriptingModulesPcbnewPyCopy ALL - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/pcbnew/pcbnew.py" "${PYTHON_DEST}" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/pcbnew/pcbnew.py" "${PYTHON_DEST}/" DEPENDS FixSwigImportsModuleScripting COMMENT "Copying pcbnew.py into ${PYTHON_DEST}" ) + add_dependencies( ScriptingModulesPcbnewPyCopy ScriptingWxpythonCopy ) endif() if( MINGW ) @@ -724,10 +726,11 @@ if( KICAD_SCRIPTING_MODULES ) elseif( APPLE ) # put everything into bundle at build time, it is relocated at install add_custom_target( ScriptingModulesPcbnewSoCopy ALL - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/pcbnew/_pcbnew.so" "${PYTHON_DEST}" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/pcbnew/_pcbnew.so" "${PYTHON_DEST}/" DEPENDS _pcbnew COMMENT "Copying _pcbnew.so into ${PYTHON_DEST}" ) + add_dependencies( ScriptingModulesPcbnewSoCopy ScriptingWxpythonCopy ) else() install( FILES ${CMAKE_BINARY_DIR}/pcbnew/_pcbnew.so DESTINATION ${PYTHON_DEST} ) endif() From 655703ccc88329af5ecf93dd25753fdf0db23643 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Sat, 11 Oct 2014 17:22:50 -0400 Subject: [PATCH 13/26] CMake housekeeping. * Remove CMakeParseArguments.cmake to use the version that ships with CMake. * Remove FindPackageHandleStandardArgs.cmake to use the version that ships with CMake. * Remove FindPythonLibs.cmake to use the version that ships with CMake. * Edit FindPythonInterp.cmake to use the stock CMake version of FindPackageHandleStandardArgs.cmake since the local version was removed. --- CMakeModules/CMakeParseArguments.cmake | 160 -------- .../FindPackageHandleStandardArgs.cmake | 351 ------------------ CMakeModules/FindPythonInterp.cmake | 4 +- CMakeModules/FindPythonLibs.cmake | 338 ----------------- 4 files changed, 2 insertions(+), 851 deletions(-) delete mode 100644 CMakeModules/CMakeParseArguments.cmake delete mode 100644 CMakeModules/FindPackageHandleStandardArgs.cmake delete mode 100644 CMakeModules/FindPythonLibs.cmake diff --git a/CMakeModules/CMakeParseArguments.cmake b/CMakeModules/CMakeParseArguments.cmake deleted file mode 100644 index 4248176ad6..0000000000 --- a/CMakeModules/CMakeParseArguments.cmake +++ /dev/null @@ -1,160 +0,0 @@ -#.rst: -# CMakeParseArguments -# ------------------- -# -# -# -# CMAKE_PARSE_ARGUMENTS( -# args...) -# -# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions -# for parsing the arguments given to that macro or function. It -# processes the arguments and defines a set of variables which hold the -# values of the respective options. -# -# The argument contains all options for the respective macro, -# i.e. keywords which can be used when calling the macro without any -# value following, like e.g. the OPTIONAL keyword of the install() -# command. -# -# The argument contains all keywords for this macro -# which are followed by one value, like e.g. DESTINATION keyword of the -# install() command. -# -# The argument contains all keywords for this -# macro which can be followed by more than one value, like e.g. the -# TARGETS or FILES keywords of the install() command. -# -# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the -# keywords listed in , and -# a variable composed of the given -# followed by "_" and the name of the respective keyword. These -# variables will then hold the respective value from the argument list. -# For the keywords this will be TRUE or FALSE. -# -# All remaining arguments are collected in a variable -# _UNPARSED_ARGUMENTS, this can be checked afterwards to see -# whether your macro was called with unrecognized parameters. -# -# As an example here a my_install() macro, which takes similar arguments -# as the real install() command: -# -# :: -# -# function(MY_INSTALL) -# set(options OPTIONAL FAST) -# set(oneValueArgs DESTINATION RENAME) -# set(multiValueArgs TARGETS CONFIGURATIONS) -# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) -# ... -# -# -# -# Assume my_install() has been called like this: -# -# :: -# -# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub) -# -# -# -# After the cmake_parse_arguments() call the macro will have set the -# following variables: -# -# :: -# -# MY_INSTALL_OPTIONAL = TRUE -# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install() -# MY_INSTALL_DESTINATION = "bin" -# MY_INSTALL_RENAME = "" (was not used) -# MY_INSTALL_TARGETS = "foo;bar" -# MY_INSTALL_CONFIGURATIONS = "" (was not used) -# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL" -# -# -# -# You can then continue and process these variables. -# -# Keywords terminate lists of values, e.g. if directly after a -# one_value_keyword another recognized keyword follows, this is -# interpreted as the beginning of the new option. E.g. -# my_install(TARGETS foo DESTINATION OPTIONAL) would result in -# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION -# would be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor. - -#============================================================================= -# Copyright 2010 Alexander Neundorf -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - - -if(__CMAKE_PARSE_ARGUMENTS_INCLUDED) - return() -endif() -set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE) - - -function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames) - # first set all result variables to empty/FALSE - foreach(arg_name ${_singleArgNames} ${_multiArgNames}) - set(${prefix}_${arg_name}) - endforeach() - - foreach(option ${_optionNames}) - set(${prefix}_${option} FALSE) - endforeach() - - set(${prefix}_UNPARSED_ARGUMENTS) - - set(insideValues FALSE) - set(currentArgName) - - # now iterate over all arguments and fill the result variables - foreach(currentArg ${ARGN}) - list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword - list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword - list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword - - if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1) - if(insideValues) - if("${insideValues}" STREQUAL "SINGLE") - set(${prefix}_${currentArgName} ${currentArg}) - set(insideValues FALSE) - elseif("${insideValues}" STREQUAL "MULTI") - list(APPEND ${prefix}_${currentArgName} ${currentArg}) - endif() - else() - list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg}) - endif() - else() - if(NOT ${optionIndex} EQUAL -1) - set(${prefix}_${currentArg} TRUE) - set(insideValues FALSE) - elseif(NOT ${singleArgIndex} EQUAL -1) - set(currentArgName ${currentArg}) - set(${prefix}_${currentArgName}) - set(insideValues "SINGLE") - elseif(NOT ${multiArgIndex} EQUAL -1) - set(currentArgName ${currentArg}) - set(${prefix}_${currentArgName}) - set(insideValues "MULTI") - endif() - endif() - - endforeach() - - # propagate the result variables to the caller: - foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames}) - set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE) - endforeach() - set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE) - -endfunction() diff --git a/CMakeModules/FindPackageHandleStandardArgs.cmake b/CMakeModules/FindPackageHandleStandardArgs.cmake deleted file mode 100644 index 64281bd001..0000000000 --- a/CMakeModules/FindPackageHandleStandardArgs.cmake +++ /dev/null @@ -1,351 +0,0 @@ -#.rst: -# FindPackageHandleStandardArgs -# ----------------------------- -# -# -# -# FIND_PACKAGE_HANDLE_STANDARD_ARGS( ... ) -# -# This function is intended to be used in FindXXX.cmake modules files. -# It handles the REQUIRED, QUIET and version-related arguments to -# find_package(). It also sets the _FOUND variable. The -# package is considered found if all variables ... listed contain -# valid results, e.g. valid filepaths. -# -# There are two modes of this function. The first argument in both -# modes is the name of the Find-module where it is called (in original -# casing). -# -# The first simple mode looks like this: -# -# :: -# -# FIND_PACKAGE_HANDLE_STANDARD_ARGS( (DEFAULT_MSG|"Custom failure message") ... ) -# -# If the variables to are all valid, then -# _FOUND will be set to TRUE. If DEFAULT_MSG is given -# as second argument, then the function will generate itself useful -# success and error messages. You can also supply a custom error -# message for the failure case. This is not recommended. -# -# The second mode is more powerful and also supports version checking: -# -# :: -# -# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [FOUND_VAR ] -# [REQUIRED_VARS ...] -# [VERSION_VAR ] -# [HANDLE_COMPONENTS] -# [CONFIG_MODE] -# [FAIL_MESSAGE "Custom failure message"] ) -# -# -# -# In this mode, the name of the result-variable can be set either to -# either _FOUND or _FOUND using the -# FOUND_VAR option. Other names for the result-variable are not -# allowed. So for a Find-module named FindFooBar.cmake, the two -# possible names are FooBar_FOUND and FOOBAR_FOUND. It is recommended -# to use the original case version. If the FOUND_VAR option is not -# used, the default is _FOUND. -# -# As in the simple mode, if through are all valid, -# _FOUND will be set to TRUE. After REQUIRED_VARS the -# variables which are required for this package are listed. Following -# VERSION_VAR the name of the variable can be specified which holds the -# version of the package which has been found. If this is done, this -# version will be checked against the (potentially) specified required -# version used in the find_package() call. The EXACT keyword is also -# handled. The default messages include information about the required -# version and the version which has been actually found, both if the -# version is ok or not. If the package supports components, use the -# HANDLE_COMPONENTS option to enable handling them. In this case, -# find_package_handle_standard_args() will report which components have -# been found and which are missing, and the _FOUND variable -# will be set to FALSE if any of the required components (i.e. not the -# ones listed after OPTIONAL_COMPONENTS) are missing. Use the option -# CONFIG_MODE if your FindXXX.cmake module is a wrapper for a -# find_package(... NO_MODULE) call. In this case VERSION_VAR will be -# set to _VERSION and the macro will automatically check whether -# the Config module was found. Via FAIL_MESSAGE a custom failure -# message can be specified, if this is not used, the default message -# will be displayed. -# -# Example for mode 1: -# -# :: -# -# find_package_handle_standard_args(LibXml2 DEFAULT_MSG LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) -# -# -# -# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and -# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to -# TRUE. If it is not found and REQUIRED was used, it fails with -# FATAL_ERROR, independent whether QUIET was used or not. If it is -# found, success will be reported, including the content of . On -# repeated Cmake runs, the same message won't be printed again. -# -# Example for mode 2: -# -# :: -# -# find_package_handle_standard_args(LibXslt FOUND_VAR LibXslt_FOUND -# REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS -# VERSION_VAR LibXslt_VERSION_STRING) -# -# In this case, LibXslt is considered to be found if the variable(s) -# listed after REQUIRED_VAR are all valid, i.e. LibXslt_LIBRARIES and -# LibXslt_INCLUDE_DIRS in this case. The result will then be stored in -# LibXslt_FOUND . Also the version of LibXslt will be checked by using -# the version contained in LibXslt_VERSION_STRING. Since no -# FAIL_MESSAGE is given, the default messages will be printed. -# -# Another example for mode 2: -# -# :: -# -# find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4) -# find_package_handle_standard_args(Automoc4 CONFIG_MODE) -# -# In this case, FindAutmoc4.cmake wraps a call to find_package(Automoc4 -# NO_MODULE) and adds an additional search directory for automoc4. Here -# the result will be stored in AUTOMOC4_FOUND. The following -# FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper -# success/error message. - -#============================================================================= -# Copyright 2007-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -include(FindPackageMessage) -include(CMakeParseArguments) - -# internal helper macro -macro(_FPHSA_FAILURE_MESSAGE _msg) - if (${_NAME}_FIND_REQUIRED) - message(FATAL_ERROR "${_msg}") - else () - if (NOT ${_NAME}_FIND_QUIETLY) - message(STATUS "${_msg}") - endif () - endif () -endmacro() - - -# internal helper macro to generate the failure message when used in CONFIG_MODE: -macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE) - # _CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found: - if(${_NAME}_CONFIG) - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})") - else() - # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version. - # List them all in the error message: - if(${_NAME}_CONSIDERED_CONFIGS) - set(configsText "") - list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount) - math(EXPR configsCount "${configsCount} - 1") - foreach(currentConfigIndex RANGE ${configsCount}) - list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename) - list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version) - set(configsText "${configsText} ${filename} (version ${version})\n") - endforeach() - if (${_NAME}_NOT_FOUND_MESSAGE) - set(configsText "${configsText} Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n") - endif() - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}") - - else() - # Simple case: No Config-file was found at all: - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}") - endif() - endif() -endmacro() - - -function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) - -# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in -# new extended or in the "old" mode: - set(options CONFIG_MODE HANDLE_COMPONENTS) - set(oneValueArgs FAIL_MESSAGE VERSION_VAR FOUND_VAR) - set(multiValueArgs REQUIRED_VARS) - set(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} ) - list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX) - - if(${INDEX} EQUAL -1) - set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG}) - set(FPHSA_REQUIRED_VARS ${ARGN}) - set(FPHSA_VERSION_VAR) - else() - - CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN}) - - if(FPHSA_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"") - endif() - - if(NOT FPHSA_FAIL_MESSAGE) - set(FPHSA_FAIL_MESSAGE "DEFAULT_MSG") - endif() - endif() - -# now that we collected all arguments, process them - - if("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG") - set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}") - endif() - - # In config-mode, we rely on the variable _CONFIG, which is set by find_package() - # when it successfully found the config-file, including version checking: - if(FPHSA_CONFIG_MODE) - list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG) - list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS) - set(FPHSA_VERSION_VAR ${_NAME}_VERSION) - endif() - - if(NOT FPHSA_REQUIRED_VARS) - message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()") - endif() - - list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR) - - string(TOUPPER ${_NAME} _NAME_UPPER) - string(TOLOWER ${_NAME} _NAME_LOWER) - - if(FPHSA_FOUND_VAR) - if(FPHSA_FOUND_VAR MATCHES "^${_NAME}_FOUND$" OR FPHSA_FOUND_VAR MATCHES "^${_NAME_UPPER}_FOUND$") - set(_FOUND_VAR ${FPHSA_FOUND_VAR}) - else() - message(FATAL_ERROR "The argument for FOUND_VAR is \"${FPHSA_FOUND_VAR}\", but only \"${_NAME}_FOUND\" and \"${_NAME_UPPER}_FOUND\" are valid names.") - endif() - else() - set(_FOUND_VAR ${_NAME_UPPER}_FOUND) - endif() - - # collect all variables which were not found, so they can be printed, so the - # user knows better what went wrong (#6375) - set(MISSING_VARS "") - set(DETAILS "") - # check if all passed variables are valid - unset(${_FOUND_VAR}) - foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS}) - if(NOT ${_CURRENT_VAR}) - set(${_FOUND_VAR} FALSE) - set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}") - else() - set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]") - endif() - endforeach() - if(NOT "${${_FOUND_VAR}}" STREQUAL "FALSE") - set(${_FOUND_VAR} TRUE) - endif() - - # component handling - unset(FOUND_COMPONENTS_MSG) - unset(MISSING_COMPONENTS_MSG) - - if(FPHSA_HANDLE_COMPONENTS) - foreach(comp ${${_NAME}_FIND_COMPONENTS}) - if(${_NAME}_${comp}_FOUND) - - if(NOT DEFINED FOUND_COMPONENTS_MSG) - set(FOUND_COMPONENTS_MSG "found components: ") - endif() - set(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}") - - else() - - if(NOT DEFINED MISSING_COMPONENTS_MSG) - set(MISSING_COMPONENTS_MSG "missing components: ") - endif() - set(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}") - - if(${_NAME}_FIND_REQUIRED_${comp}) - set(${_FOUND_VAR} FALSE) - set(MISSING_VARS "${MISSING_VARS} ${comp}") - endif() - - endif() - endforeach() - set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}") - set(DETAILS "${DETAILS}[c${COMPONENT_MSG}]") - endif() - - # version handling: - set(VERSION_MSG "") - set(VERSION_OK TRUE) - set(VERSION ${${FPHSA_VERSION_VAR}} ) - if (${_NAME}_FIND_VERSION) - - if(VERSION) - - if(${_NAME}_FIND_VERSION_EXACT) # exact version required - if (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}") - set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"") - set(VERSION_OK FALSE) - else () - set(VERSION_MSG "(found suitable exact version \"${VERSION}\")") - endif () - - else() # minimum version specified: - if ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}") - set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"") - set(VERSION_OK FALSE) - else () - set(VERSION_MSG "(found suitable version \"${VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")") - endif () - endif() - - else() - - # if the package was not found, but a version was given, add that to the output: - if(${_NAME}_FIND_VERSION_EXACT) - set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")") - else() - set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")") - endif() - - endif() - else () - if(VERSION) - set(VERSION_MSG "(found version \"${VERSION}\")") - endif() - endif () - - if(VERSION_OK) - set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]") - else() - set(${_FOUND_VAR} FALSE) - endif() - - - # print the result: - if (${_FOUND_VAR}) - FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}") - else () - - if(FPHSA_CONFIG_MODE) - _FPHSA_HANDLE_FAILURE_CONFIG_MODE() - else() - if(NOT VERSION_OK) - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})") - else() - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}") - endif() - endif() - - endif () - - set(${_FOUND_VAR} ${${_FOUND_VAR}} PARENT_SCOPE) - -endfunction() diff --git a/CMakeModules/FindPythonInterp.cmake b/CMakeModules/FindPythonInterp.cmake index b2261f1466..75ae267eaf 100644 --- a/CMakeModules/FindPythonInterp.cmake +++ b/CMakeModules/FindPythonInterp.cmake @@ -91,7 +91,7 @@ unset(_PYTHON3_VERSIONS) # Search for newest python version if python executable isn't found if(NOT PYTHON_EXECUTABLE) - + # If using the MINGW compiler, we mustn't find the standard python # distribution because of multiple C-Runtime errors. We must instead # use the Python-a-mingw-us distribution @@ -110,7 +110,7 @@ if(NOT PYTHON_EXECUTABLE) else() list( APPEND _Python_PPATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath] ) endif() - + foreach(_CURRENT_VERSION ${_Python_VERSIONS}) set(_Python_NAMES python${_CURRENT_VERSION}) if(WIN32) diff --git a/CMakeModules/FindPythonLibs.cmake b/CMakeModules/FindPythonLibs.cmake deleted file mode 100644 index e2f73d8ea4..0000000000 --- a/CMakeModules/FindPythonLibs.cmake +++ /dev/null @@ -1,338 +0,0 @@ -# - Find python libraries -# This module finds if Python is installed and determines where the -# include files and libraries are. It also determines what the name of -# the library is. This code sets the following variables: -# -# PYTHONLIBS_FOUND - have the Python libs been found -# PYTHON_LIBRARIES - path to the python library -# PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated) -# PYTHON_INCLUDE_DIRS - path to where Python.h is found -# PYTHON_DEBUG_LIBRARIES - path to the debug library (deprecated) -# PYTHONLIBS_VERSION_STRING - version of the Python libs found (since CMake 2.8.8) -# -# The Python_ADDITIONAL_VERSIONS variable can be used to specify a list of -# version numbers that should be taken into account when searching for Python. -# You need to set this variable before calling find_package(PythonLibs). -# -# You can point to a preferred python install to use by setting the following -# to the point at the root directory of the python install: -# -# PYTHON_ROOT_DIR - The root directory of the python install -# -# If you'd like to specify the installation of Python to use, you should modify -# the following cache variables: -# PYTHON_LIBRARY - path to the python library -# PYTHON_INCLUDE_DIR - path to where Python.h is found - -#============================================================================= -# Copyright 2001-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindFrameworks.cmake) -# Search for the python framework on Apple. -CMAKE_FIND_FRAMEWORKS(Python) - -set(_PYTHON1_VERSIONS 1.6 1.5) -set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0) -set(_PYTHON3_VERSIONS 3.3 3.2 3.1 3.0) - -if(PythonLibs_FIND_VERSION) - if(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$") - string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonLibs_FIND_VERSION}") - string(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}") - unset(_PYTHON_FIND_OTHER_VERSIONS) - if(PythonLibs_FIND_VERSION_EXACT) - if(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION) - set(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}") - else() - set(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}" "${_PYTHON_FIND_MAJ_MIN}") - endif() - else() - foreach(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS}) - if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN) - list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V}) - endif() - endforeach() - endif() - unset(_PYTHON_FIND_MAJ_MIN) - unset(_PYTHON_FIND_MAJ) - else() - set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonLibs_FIND_VERSION}_VERSIONS}) - endif() -else() - set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS}) -endif() - -# Set up the versions we know about, in the order we will search. Always add -# the user supplied additional versions to the front. -set(_Python_VERSIONS - ${Python_ADDITIONAL_VERSIONS} - ${_PYTHON_FIND_OTHER_VERSIONS} - ) - -unset(_PYTHON_FIND_OTHER_VERSIONS) -unset(_PYTHON1_VERSIONS) -unset(_PYTHON2_VERSIONS) -unset(_PYTHON3_VERSIONS) - -foreach(_CURRENT_VERSION ${_Python_VERSIONS}) - string(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION}) - if(WIN32) - if(MINGW) - find_library(PYTHON_DEBUG_LIBRARY - NAMES python{$_CURRENT_VERSION}_d - PATHS - "${PYTHON_ROOT_DIR}" - "C:/python/${_CURRENT_VERSION}.9" - "C:/python/${_CURRENT_VERSION}.8" - "C:/python/${_CURRENT_VERSION}.7" - "C:/python/${_CURRENT_VERSION}.6" - "C:/python/${_CURRENT_VERSION}.5" - "C:/python/${_CURRENT_VERSION}.4" - "C:/python/${_CURRENT_VERSION}.3" - "C:/python/${_CURRENT_VERSION}.2" - "C:/python/${_CURRENT_VERSION}.1" - "C:/python/${_CURRENT_VERSION}.0" - NO_SYSTEM_ENVIRONMENT_PATH - ) - else() - find_library(PYTHON_DEBUG_LIBRARY - NAMES python${_CURRENT_VERSION_NO_DOTS}_d python - PATHS - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug - [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs - [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs - ) - endif() - endif() - - if(MINGW) - find_library(PYTHON_LIBRARY - NAMES python${_CURRENT_VERSION} - PATHS - "${PYTHON_ROOT_DIR}" - "C:/python/${_CURRENT_VERSION}.9" - "C:/python/${_CURRENT_VERSION}.8" - "C:/python/${_CURRENT_VERSION}.7" - "C:/python/${_CURRENT_VERSION}.6" - "C:/python/${_CURRENT_VERSION}.5" - "C:/python/${_CURRENT_VERSION}.4" - "C:/python/${_CURRENT_VERSION}.3" - "C:/python/${_CURRENT_VERSION}.2" - "C:/python/${_CURRENT_VERSION}.1" - "C:/python/${_CURRENT_VERSION}.0" - NO_SYSTEM_ENVIRONMENT_PATH - ) - else() - find_library(PYTHON_LIBRARY - NAMES - python${_CURRENT_VERSION_NO_DOTS} - python${_CURRENT_VERSION}mu - python${_CURRENT_VERSION}m - python${_CURRENT_VERSION}u - python${_CURRENT_VERSION} - PATHS - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs - [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs - # Avoid finding the .dll in the PATH. We want the .lib. - NO_SYSTEM_ENVIRONMENT_PATH - ) - endif() - - # Look for the static library in the Python config directory - find_library(PYTHON_LIBRARY - NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION} - # Avoid finding the .dll in the PATH. We want the .lib. - NO_SYSTEM_ENVIRONMENT_PATH - # This is where the static library is usually located - PATH_SUFFIXES python${_CURRENT_VERSION}/config - ) - - - # For backward compatibility, honour value of PYTHON_INCLUDE_PATH, if - # PYTHON_INCLUDE_DIR is not set. - if(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR) - set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH - "Path to where Python.h is found" FORCE) - endif() - - set(PYTHON_FRAMEWORK_INCLUDES) - if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR) - foreach(dir ${Python_FRAMEWORKS}) - set(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES} - ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION}) - endforeach() - endif() - - if(MINGW) - find_path(PYTHON_INCLUDE_DIR - NAMES Python.h - PATHS - "${PYTHON_ROOT_DIR}/include" - "C:/python/${_CURRENT_VERSION}.9/include" - "C:/python/${_CURRENT_VERSION}.8/include" - "C:/python/${_CURRENT_VERSION}.7/include" - "C:/python/${_CURRENT_VERSION}.6/include" - "C:/python/${_CURRENT_VERSION}.5/include" - "C:/python/${_CURRENT_VERSION}.4/include" - "C:/python/${_CURRENT_VERSION}.3/include" - "C:/python/${_CURRENT_VERSION}.2/include" - "C:/python/${_CURRENT_VERSION}.1/include" - "C:/python/${_CURRENT_VERSION}.0/include" - ) - else() - find_path(PYTHON_INCLUDE_DIR - NAMES Python.h - PATHS - ${PYTHON_FRAMEWORK_INCLUDES} - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include - [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include - PATH_SUFFIXES - python${_CURRENT_VERSION}mu - python${_CURRENT_VERSION}m - python${_CURRENT_VERSION}u - python${_CURRENT_VERSION} - ) - endif() - - # For backward compatibility, set PYTHON_INCLUDE_PATH. - set(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}") - - if(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h") - file(STRINGS "${PYTHON_INCLUDE_DIR}/patchlevel.h" python_version_str - REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"") - string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1" - PYTHONLIBS_VERSION_STRING "${python_version_str}") - unset(python_version_str) - endif() - - if(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR) - break() - endif() -endforeach() - -mark_as_advanced( - PYTHON_DEBUG_LIBRARY - PYTHON_LIBRARY - PYTHON_INCLUDE_DIR -) - -# We use PYTHON_INCLUDE_DIR, PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the -# cache entries because they are meant to specify the location of a single -# library. We now set the variables listed by the documentation for this -# module. -set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}") -set(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}") - -# These variables have been historically named in this module different from -# what SELECT_LIBRARY_CONFIGURATIONS() expects. -set(PYTHON_LIBRARY_DEBUG "${PYTHON_DEBUG_LIBRARY}") -set(PYTHON_LIBRARY_RELEASE "${PYTHON_LIBRARY}") -include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) -SELECT_LIBRARY_CONFIGURATIONS(PYTHON) -# SELECT_LIBRARY_CONFIGURATIONS() sets ${PREFIX}_FOUND if it has a library. -# Unset this, this prefix doesn't match the module prefix, they are different -# for historical reasons. -unset(PYTHON_FOUND) - -include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs - REQUIRED_VARS PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS - VERSION_VAR PYTHONLIBS_VERSION_STRING) - -# PYTHON_ADD_MODULE( src1 src2 ... srcN) is used to build modules for python. -# PYTHON_WRITE_MODULES_HEADER() writes a header file you can include -# in your sources to initialize the static python modules -function(PYTHON_ADD_MODULE _NAME ) - get_property(_TARGET_SUPPORTS_SHARED_LIBS - GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS) - option(PYTHON_ENABLE_MODULE_${_NAME} "Add module ${_NAME}" TRUE) - option(PYTHON_MODULE_${_NAME}_BUILD_SHARED - "Add module ${_NAME} shared" ${_TARGET_SUPPORTS_SHARED_LIBS}) - - # Mark these options as advanced - mark_as_advanced(PYTHON_ENABLE_MODULE_${_NAME} - PYTHON_MODULE_${_NAME}_BUILD_SHARED) - - if(PYTHON_ENABLE_MODULE_${_NAME}) - if(PYTHON_MODULE_${_NAME}_BUILD_SHARED) - set(PY_MODULE_TYPE MODULE) - else() - set(PY_MODULE_TYPE STATIC) - set_property(GLOBAL APPEND PROPERTY PY_STATIC_MODULES_LIST ${_NAME}) - endif() - - set_property(GLOBAL APPEND PROPERTY PY_MODULES_LIST ${_NAME}) - add_library(${_NAME} ${PY_MODULE_TYPE} ${ARGN}) -# target_link_libraries(${_NAME} ${PYTHON_LIBRARIES}) - - if(PYTHON_MODULE_${_NAME}_BUILD_SHARED) - set_target_properties(${_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}") - if(WIN32 AND NOT CYGWIN) - set_target_properties(${_NAME} PROPERTIES SUFFIX ".pyd") - endif() - endif() - - endif() -endfunction() - -function(PYTHON_WRITE_MODULES_HEADER _filename) - - get_property(PY_STATIC_MODULES_LIST GLOBAL PROPERTY PY_STATIC_MODULES_LIST) - - get_filename_component(_name "${_filename}" NAME) - string(REPLACE "." "_" _name "${_name}") - string(TOUPPER ${_name} _nameUpper) - set(_filename ${CMAKE_CURRENT_BINARY_DIR}/${_filename}) - - set(_filenameTmp "${_filename}.in") - file(WRITE ${_filenameTmp} "/*Created by cmake, do not edit, changes will be lost*/\n") - file(APPEND ${_filenameTmp} -"#ifndef ${_nameUpper} -#define ${_nameUpper} - -#include - -#ifdef __cplusplus -extern \"C\" { -#endif /* __cplusplus */ - -") - - foreach(_currentModule ${PY_STATIC_MODULES_LIST}) - file(APPEND ${_filenameTmp} "extern void init${PYTHON_MODULE_PREFIX}${_currentModule}(void);\n\n") - endforeach() - - file(APPEND ${_filenameTmp} -"#ifdef __cplusplus -} -#endif /* __cplusplus */ - -") - - - foreach(_currentModule ${PY_STATIC_MODULES_LIST}) - file(APPEND ${_filenameTmp} "int ${_name}_${_currentModule}(void) \n{\n static char name[]=\"${PYTHON_MODULE_PREFIX}${_currentModule}\"; return PyImport_AppendInittab(name, init${PYTHON_MODULE_PREFIX}${_currentModule});\n}\n\n") - endforeach() - - file(APPEND ${_filenameTmp} "void ${_name}_LoadAllPythonModules(void)\n{\n") - foreach(_currentModule ${PY_STATIC_MODULES_LIST}) - file(APPEND ${_filenameTmp} " ${_name}_${_currentModule}();\n") - endforeach() - file(APPEND ${_filenameTmp} "}\n\n") - file(APPEND ${_filenameTmp} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n ${_name}_LoadAllPythonModules();\n}\n#endif\n\n#endif\n") - -# with configure_file() cmake complains that you may not use a file created using file(WRITE) as input file for configure_file() - execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET) - -endfunction() From 716613b7daeac3a06e46a9e15d72db2026ab71b3 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Sat, 11 Oct 2014 17:50:18 -0400 Subject: [PATCH 14/26] Actually make FindPythonInterp.cmake use correct FindPackageHandleStandardArgs.cmake. --- CMakeModules/FindPythonInterp.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeModules/FindPythonInterp.cmake b/CMakeModules/FindPythonInterp.cmake index 75ae267eaf..9910699432 100644 --- a/CMakeModules/FindPythonInterp.cmake +++ b/CMakeModules/FindPythonInterp.cmake @@ -169,7 +169,7 @@ endif() # handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if # all listed variables are TRUE -include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonInterp REQUIRED_VARS PYTHON_EXECUTABLE VERSION_VAR PYTHON_VERSION_STRING) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PythonInterp REQUIRED_VARS PYTHON_EXECUTABLE VERSION_VAR PYTHON_VERSION_STRING) mark_as_advanced(PYTHON_EXECUTABLE) From 2d008c79fd419a6fa165325de700568ee826fab8 Mon Sep 17 00:00:00 2001 From: Mark Roszko Date: Sun, 12 Oct 2014 11:12:02 -0400 Subject: [PATCH 15/26] More module to footprint UI fixes. --- pcbnew/dialogs/dialog_block_options_base.cpp | 6 +- pcbnew/dialogs/dialog_block_options_base.fbp | 10 +- pcbnew/dialogs/dialog_block_options_base.h | 6 +- .../dialogs/dialog_display_options_base.cpp | 6 +- .../dialogs/dialog_display_options_base.fbp | 10 +- pcbnew/dialogs/dialog_display_options_base.h | 6 +- .../dialogs/dialog_exchange_modules_base.cpp | 6 +- .../dialogs/dialog_exchange_modules_base.fbp | 8 +- pcbnew/dialogs/dialog_exchange_modules_base.h | 4 +- ...log_global_modules_fields_edition_base.cpp | 4 +- ...log_global_modules_fields_edition_base.fbp | 6 +- ...ialog_global_modules_fields_edition_base.h | 2 +- .../dialog_global_pads_edition_base.cpp | 6 +- .../dialog_global_pads_edition_base.fbp | 8 +- .../dialogs/dialog_global_pads_edition_base.h | 2 +- .../dialog_graphic_items_options_base.cpp | 31 +++- .../dialog_graphic_items_options_base.fbp | 16 +- .../dialog_graphic_items_options_base.h | 21 ++- pcbnew/dialogs/dialog_netlist_fbp.cpp | 8 +- pcbnew/dialogs/dialog_netlist_fbp.fbp | 8 +- pcbnew/dialogs/dialog_netlist_fbp.h | 2 +- pcbnew/dialogs/dialog_pad_properties_base.cpp | 4 +- pcbnew/dialogs/dialog_pad_properties_base.fbp | 6 +- pcbnew/dialogs/dialog_pad_properties_base.h | 2 +- pcbnew/dialogs/dialog_plot_base.cpp | 13 +- pcbnew/dialogs/dialog_plot_base.fbp | 138 +++++++++--------- pcbnew/dialogs/dialog_plot_base.h | 2 +- pcbnew/tool_pcb.cpp | 4 +- pcbnew/toolbars_update_user_interface.cpp | 4 +- 29 files changed, 194 insertions(+), 155 deletions(-) diff --git a/pcbnew/dialogs/dialog_block_options_base.cpp b/pcbnew/dialogs/dialog_block_options_base.cpp index 6ad3e57e7e..c41d41d27a 100644 --- a/pcbnew/dialogs/dialog_block_options_base.cpp +++ b/pcbnew/dialogs/dialog_block_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -22,14 +22,14 @@ DIALOG_BLOCK_OPTIONS_BASE::DIALOG_BLOCK_OPTIONS_BASE( wxWindow* parent, wxWindow wxGridSizer* gSizer1; gSizer1 = new wxGridSizer( 4, 2, 0, 0 ); - m_Include_Modules = new wxCheckBox( this, wxID_ANY, _("Include modules"), wxDefaultPosition, wxDefaultSize, 0 ); + m_Include_Modules = new wxCheckBox( this, wxID_ANY, _("Include footprints"), wxDefaultPosition, wxDefaultSize, 0 ); gSizer1->Add( m_Include_Modules, 0, wxALL, 5 ); m_Include_PcbTextes = new wxCheckBox( this, wxID_ANY, _("Include text items"), wxDefaultPosition, wxDefaultSize, 0 ); m_Include_PcbTextes->SetValue(true); gSizer1->Add( m_Include_PcbTextes, 0, wxALL, 5 ); - m_IncludeLockedModules = new wxCheckBox( this, wxID_ANY, _("Include locked modules"), wxDefaultPosition, wxDefaultSize, 0 ); + m_IncludeLockedModules = new wxCheckBox( this, wxID_ANY, _("Include locked footprints"), wxDefaultPosition, wxDefaultSize, 0 ); gSizer1->Add( m_IncludeLockedModules, 0, wxALL, 5 ); m_Include_Draw_Items = new wxCheckBox( this, wxID_ANY, _("Include drawings"), wxDefaultPosition, wxDefaultSize, 0 ); diff --git a/pcbnew/dialogs/dialog_block_options_base.fbp b/pcbnew/dialogs/dialog_block_options_base.fbp index b43baec64d..8e2d8d23cc 100644 --- a/pcbnew/dialogs/dialog_block_options_base.fbp +++ b/pcbnew/dialogs/dialog_block_options_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -20,8 +20,10 @@ . 1 + 1 1 1 + UI 0 0 @@ -42,7 +44,7 @@ DIALOG_BLOCK_OPTIONS_BASE - 397,226 + 500,226 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h @@ -148,7 +150,7 @@ 0 0 wxID_ANY - Include modules + Include footprints 0 @@ -324,7 +326,7 @@ 0 0 wxID_ANY - Include locked modules + Include locked footprints 0 diff --git a/pcbnew/dialogs/dialog_block_options_base.h b/pcbnew/dialogs/dialog_block_options_base.h index f8ecf57bb1..f204a30c74 100644 --- a/pcbnew/dialogs/dialog_block_options_base.h +++ b/pcbnew/dialogs/dialog_block_options_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -11,6 +11,8 @@ #include #include #include +class DIALOG_SHIM; + #include "dialog_shim.h" #include #include @@ -57,7 +59,7 @@ class DIALOG_BLOCK_OPTIONS_BASE : public DIALOG_SHIM public: - DIALOG_BLOCK_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 397,226 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_BLOCK_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,226 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_BLOCK_OPTIONS_BASE(); }; diff --git a/pcbnew/dialogs/dialog_display_options_base.cpp b/pcbnew/dialogs/dialog_display_options_base.cpp index f72d6186e9..bd26aff8f9 100644 --- a/pcbnew/dialogs/dialog_display_options_base.cpp +++ b/pcbnew/dialogs/dialog_display_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -74,7 +74,7 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi wxString m_OptDisplayModEdgesChoices[] = { _("Line"), _("Filled"), _("Sketch") }; int m_OptDisplayModEdgesNChoices = sizeof( m_OptDisplayModEdgesChoices ) / sizeof( wxString ); - m_OptDisplayModEdges = new wxRadioBox( this, ID_EDGES_MODULES, _("Module Edges:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayModEdgesNChoices, m_OptDisplayModEdgesChoices, 1, wxRA_SPECIFY_COLS ); + m_OptDisplayModEdges = new wxRadioBox( this, ID_EDGES_MODULES, _("Footprint Edges:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayModEdgesNChoices, m_OptDisplayModEdgesChoices, 1, wxRA_SPECIFY_COLS ); m_OptDisplayModEdges->SetSelection( 1 ); bLModuleSizer->Add( m_OptDisplayModEdges, 0, wxALL|wxEXPAND, 5 ); @@ -128,7 +128,7 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi wxString m_Show_Page_LimitsChoices[] = { _("Yes"), _("No") }; int m_Show_Page_LimitsNChoices = sizeof( m_Show_Page_LimitsChoices ) / sizeof( wxString ); m_Show_Page_Limits = new wxRadioBox( this, wxID_ANY, _("Show page limits"), wxDefaultPosition, wxDefaultSize, m_Show_Page_LimitsNChoices, m_Show_Page_LimitsChoices, 1, wxRA_SPECIFY_COLS ); - m_Show_Page_Limits->SetSelection( 0 ); + m_Show_Page_Limits->SetSelection( 1 ); sRightUpperSizer->Add( m_Show_Page_Limits, 0, wxALL|wxEXPAND, 5 ); diff --git a/pcbnew/dialogs/dialog_display_options_base.fbp b/pcbnew/dialogs/dialog_display_options_base.fbp index 7907ebd8bd..0111ef1e2c 100644 --- a/pcbnew/dialogs/dialog_display_options_base.fbp +++ b/pcbnew/dialogs/dialog_display_options_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -20,8 +20,10 @@ . 1 + 1 1 1 + UI 1 0 @@ -42,7 +44,7 @@ DIALOG_DISPLAY_OPTIONS_BASE - 731,291 + 880,320 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Display options @@ -623,7 +625,7 @@ 0 0 ID_EDGES_MODULES - Module Edges: + Footprint Edges: 1 0 @@ -1303,7 +1305,7 @@ 1 Resizable - 0 + 1 1 wxRA_SPECIFY_COLS diff --git a/pcbnew/dialogs/dialog_display_options_base.h b/pcbnew/dialogs/dialog_display_options_base.h index aa2ca2df49..9a99ca4bd3 100644 --- a/pcbnew/dialogs/dialog_display_options_base.h +++ b/pcbnew/dialogs/dialog_display_options_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -11,6 +11,8 @@ #include #include #include +class DIALOG_SHIM; + #include "dialog_shim.h" #include #include @@ -68,7 +70,7 @@ class DIALOG_DISPLAY_OPTIONS_BASE : public DIALOG_SHIM public: - DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Display options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 731,291 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Display options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 880,320 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_DISPLAY_OPTIONS_BASE(); }; diff --git a/pcbnew/dialogs/dialog_exchange_modules_base.cpp b/pcbnew/dialogs/dialog_exchange_modules_base.cpp index e80b4c16af..c8cbddaa0d 100644 --- a/pcbnew/dialogs/dialog_exchange_modules_base.cpp +++ b/pcbnew/dialogs/dialog_exchange_modules_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 6 2013) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -52,10 +52,10 @@ DIALOG_EXCHANGE_MODULE_BASE::DIALOG_EXCHANGE_MODULE_BASE( wxWindow* parent, wxWi wxBoxSizer* bMiddleSizer; bMiddleSizer = new wxBoxSizer( wxVERTICAL ); - wxString m_SelectionChoices[] = { _("Change module"), _("Change same modules"), _("Ch. same module+value"), _("Change all") }; + wxString m_SelectionChoices[] = { _("Change footprint"), _("Change same footprint"), _("Ch. same footprint+value"), _("Change all") }; int m_SelectionNChoices = sizeof( m_SelectionChoices ) / sizeof( wxString ); m_Selection = new wxRadioBox( this, ID_SELECTION_CLICKED, _("Options"), wxDefaultPosition, wxDefaultSize, m_SelectionNChoices, m_SelectionChoices, 1, wxRA_SPECIFY_COLS ); - m_Selection->SetSelection( 2 ); + m_Selection->SetSelection( 1 ); bMiddleSizer->Add( m_Selection, 0, wxALL, 5 ); diff --git a/pcbnew/dialogs/dialog_exchange_modules_base.fbp b/pcbnew/dialogs/dialog_exchange_modules_base.fbp index 4e71f2ee55..99ee9a7b1c 100644 --- a/pcbnew/dialogs/dialog_exchange_modules_base.fbp +++ b/pcbnew/dialogs/dialog_exchange_modules_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -47,7 +47,7 @@ -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h - Exchange Modules + Exchange Footprints @@ -662,7 +662,7 @@ 1 0 - "Change module" "Change same modules" "Ch. same module+value" "Change all" + "Change footprint" "Change same footprint" "Ch. same footprint+value" "Change all" 1 1 @@ -694,7 +694,7 @@ 1 Resizable - 2 + 1 1 wxRA_SPECIFY_COLS diff --git a/pcbnew/dialogs/dialog_exchange_modules_base.h b/pcbnew/dialogs/dialog_exchange_modules_base.h index 089f374574..a0d071d875 100644 --- a/pcbnew/dialogs/dialog_exchange_modules_base.h +++ b/pcbnew/dialogs/dialog_exchange_modules_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 6 2013) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -62,7 +62,7 @@ class DIALOG_EXCHANGE_MODULE_BASE : public DIALOG_SHIM public: - DIALOG_EXCHANGE_MODULE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Exchange Modules"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_EXCHANGE_MODULE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Exchange Footprints"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_EXCHANGE_MODULE_BASE(); }; diff --git a/pcbnew/dialogs/dialog_global_modules_fields_edition_base.cpp b/pcbnew/dialogs/dialog_global_modules_fields_edition_base.cpp index 7d1754b3d1..6654ac2922 100644 --- a/pcbnew/dialogs/dialog_global_modules_fields_edition_base.cpp +++ b/pcbnew/dialogs/dialog_global_modules_fields_edition_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 8 2012) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -39,7 +39,7 @@ DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE::DIALOG_GLOBAL_MODULES_FIELDS_EDITION_ m_staticTextFilter = new wxStaticText( this, wxID_ANY, _("Footprint Filter:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextFilter->Wrap( -1 ); - m_staticTextFilter->SetToolTip( _("A string to filter modules to edit.\nIf not void, footprint names should match this filter.\nA filter can be something like SM* (case insensitive)") ); + m_staticTextFilter->SetToolTip( _("A string to filter footprints to edit.\nIf not void, footprint names should match this filter.\nA filter can be something like SM* (case insensitive)") ); bLeftSizer->Add( m_staticTextFilter, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); diff --git a/pcbnew/dialogs/dialog_global_modules_fields_edition_base.fbp b/pcbnew/dialogs/dialog_global_modules_fields_edition_base.fbp index 12fc5e59f1..b5a50432e1 100644 --- a/pcbnew/dialogs/dialog_global_modules_fields_edition_base.fbp +++ b/pcbnew/dialogs/dialog_global_modules_fields_edition_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -20,8 +20,10 @@ . 1 + 1 1 1 + UI 0 0 @@ -440,7 +442,7 @@ 0 - A string to filter modules to edit. If not void, footprint names should match this filter. A filter can be something like SM* (case insensitive) + A string to filter footprints to edit. If not void, footprint names should match this filter. A filter can be something like SM* (case insensitive) diff --git a/pcbnew/dialogs/dialog_global_modules_fields_edition_base.h b/pcbnew/dialogs/dialog_global_modules_fields_edition_base.h index ede869a8ea..a5a5ac3ddf 100644 --- a/pcbnew/dialogs/dialog_global_modules_fields_edition_base.h +++ b/pcbnew/dialogs/dialog_global_modules_fields_edition_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 8 2012) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! diff --git a/pcbnew/dialogs/dialog_global_pads_edition_base.cpp b/pcbnew/dialogs/dialog_global_pads_edition_base.cpp index d0d93ebf59..cfea6b48b4 100644 --- a/pcbnew/dialogs/dialog_global_pads_edition_base.cpp +++ b/pcbnew/dialogs/dialog_global_pads_edition_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 8 2012) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -46,10 +46,10 @@ DIALOG_GLOBAL_PADS_EDITION_BASE::DIALOG_GLOBAL_PADS_EDITION_BASE( wxWindow* pare bRightSizer->Add( 10, 10, 0, 0, 5 ); - m_buttonChangeModule = new wxButton( this, ID_CHANGE_CURRENT_MODULE, _("Change Pads on Module"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonChangeModule = new wxButton( this, ID_CHANGE_CURRENT_MODULE, _("Change Pads on Footprint"), wxDefaultPosition, wxDefaultSize, 0 ); bRightSizer->Add( m_buttonChangeModule, 0, wxALL|wxEXPAND, 5 ); - m_buttonIdModules = new wxButton( this, ID_CHANGE_ID_MODULES, _("Change Pads on Same Modules"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonIdModules = new wxButton( this, ID_CHANGE_ID_MODULES, _("Change Pads on Identical Footprints"), wxDefaultPosition, wxDefaultSize, 0 ); bRightSizer->Add( m_buttonIdModules, 0, wxALL|wxEXPAND, 5 ); m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); diff --git a/pcbnew/dialogs/dialog_global_pads_edition_base.fbp b/pcbnew/dialogs/dialog_global_pads_edition_base.fbp index eb5276aa01..3e6abef756 100644 --- a/pcbnew/dialogs/dialog_global_pads_edition_base.fbp +++ b/pcbnew/dialogs/dialog_global_pads_edition_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -20,8 +20,10 @@ . 1 + 1 1 1 + UI 0 0 @@ -520,7 +522,7 @@ 0 0 ID_CHANGE_CURRENT_MODULE - Change Pads on Module + Change Pads on Footprint 0 @@ -608,7 +610,7 @@ 0 0 ID_CHANGE_ID_MODULES - Change Pads on Same Modules + Change Pads on Identical Footprints 0 diff --git a/pcbnew/dialogs/dialog_global_pads_edition_base.h b/pcbnew/dialogs/dialog_global_pads_edition_base.h index 217d2010b1..8a444bd14d 100644 --- a/pcbnew/dialogs/dialog_global_pads_edition_base.h +++ b/pcbnew/dialogs/dialog_global_pads_edition_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 8 2012) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! diff --git a/pcbnew/dialogs/dialog_graphic_items_options_base.cpp b/pcbnew/dialogs/dialog_graphic_items_options_base.cpp index 6d1c4c9fea..683232e735 100644 --- a/pcbnew/dialogs/dialog_graphic_items_options_base.cpp +++ b/pcbnew/dialogs/dialog_graphic_items_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -9,7 +9,7 @@ /////////////////////////////////////////////////////////////////////////// -DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); @@ -27,6 +27,7 @@ DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE( wxWindow* sbSizerLeft->Add( m_GraphicSegmWidthTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_OptPcbSegmWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_OptPcbSegmWidth->SetMaxLength( 0 ); sbSizerLeft->Add( m_OptPcbSegmWidth, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_BoardEdgesWidthTitle = new wxStaticText( this, wxID_ANY, _("Board Edges Width"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -34,6 +35,7 @@ DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE( wxWindow* sbSizerLeft->Add( m_BoardEdgesWidthTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_OptPcbEdgesWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_OptPcbEdgesWidth->SetMaxLength( 0 ); sbSizerLeft->Add( m_OptPcbEdgesWidth, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_CopperTextWidthTitle = new wxStaticText( this, wxID_ANY, _("Copper Text Width"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -41,6 +43,7 @@ DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE( wxWindow* sbSizerLeft->Add( m_CopperTextWidthTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_OptPcbTextWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_OptPcbTextWidth->SetMaxLength( 0 ); sbSizerLeft->Add( m_OptPcbTextWidth, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_TextSizeVTitle = new wxStaticText( this, wxID_ANY, _("Text Size V"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -48,6 +51,7 @@ DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE( wxWindow* sbSizerLeft->Add( m_TextSizeVTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_OptPcbTextVSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_OptPcbTextVSize->SetMaxLength( 0 ); sbSizerLeft->Add( m_OptPcbTextVSize, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_TextSizeHTitle = new wxStaticText( this, wxID_ANY, _("Text Size H"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -55,41 +59,48 @@ DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE( wxWindow* sbSizerLeft->Add( m_TextSizeHTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_OptPcbTextHSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_OptPcbTextHSize->SetMaxLength( 0 ); sbSizerLeft->Add( m_OptPcbTextHSize, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bSizerUpper->Add( sbSizerLeft, 1, wxEXPAND|wxALL, 5 ); wxStaticBoxSizer* sbSizerMiddle; - sbSizerMiddle = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Modules:") ), wxVERTICAL ); + sbSizerMiddle = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprints:") ), wxVERTICAL ); - m_EdgeModWidthTitle = new wxStaticText( this, wxID_ANY, _("Edges Module Width"), wxDefaultPosition, wxDefaultSize, 0 ); + m_EdgeModWidthTitle = new wxStaticText( this, wxID_ANY, _("Edges Width"), wxDefaultPosition, wxDefaultSize, 0 ); m_EdgeModWidthTitle->Wrap( -1 ); sbSizerMiddle->Add( m_EdgeModWidthTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_OptModuleEdgesWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_OptModuleEdgesWidth->SetMaxLength( 0 ); sbSizerMiddle->Add( m_OptModuleEdgesWidth, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - m_TextModWidthTitle = new wxStaticText( this, wxID_ANY, _("Text Module Width"), wxDefaultPosition, wxDefaultSize, 0 ); + m_TextModWidthTitle = new wxStaticText( this, wxID_ANY, _("Text Width"), wxDefaultPosition, wxDefaultSize, 0 ); m_TextModWidthTitle->Wrap( -1 ); sbSizerMiddle->Add( m_TextModWidthTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_OptModuleTextWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_OptModuleTextWidth->SetMaxLength( 0 ); sbSizerMiddle->Add( m_OptModuleTextWidth, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - m_TextModSizeVTitle = new wxStaticText( this, wxID_ANY, _("Text Module Size V"), wxDefaultPosition, wxDefaultSize, 0 ); + m_TextModSizeVTitle = new wxStaticText( this, wxID_ANY, _("Text Size V"), wxDefaultPosition, wxDefaultSize, 0 ); m_TextModSizeVTitle->Wrap( -1 ); sbSizerMiddle->Add( m_TextModSizeVTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_OptModuleTextVSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_OptModuleTextVSize->SetMaxLength( 0 ); sbSizerMiddle->Add( m_OptModuleTextVSize, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - m_TextModSizeHTitle = new wxStaticText( this, wxID_ANY, _("Text Module Size H"), wxDefaultPosition, wxDefaultSize, 0 ); + m_TextModSizeHTitle = new wxStaticText( this, wxID_ANY, _("Text Size H"), wxDefaultPosition, wxDefaultSize, 0 ); m_TextModSizeHTitle->Wrap( -1 ); sbSizerMiddle->Add( m_TextModSizeHTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_OptModuleTextHSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_OptModuleTextHSize->SetMaxLength( 0 ); sbSizerMiddle->Add( m_OptModuleTextHSize, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + bSizerUpper->Add( sbSizerMiddle, 1, wxEXPAND|wxALL, 5 ); wxStaticBoxSizer* sbSizerRight; @@ -102,10 +113,13 @@ DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE( wxWindow* sbSizerRight->Add( m_DefaultPenSizeTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_DefaultPenSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_DefaultPenSizeCtrl->SetMaxLength( 0 ); sbSizerRight->Add( m_DefaultPenSizeCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bSizerUpper->Add( sbSizerRight, 1, wxEXPAND|wxALL, 5 ); + bSizerMain->Add( bSizerUpper, 1, wxEXPAND, 5 ); m_sdbSizer1 = new wxStdDialogButtonSizer(); @@ -114,8 +128,10 @@ DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE( wxWindow* m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); m_sdbSizer1->Realize(); + bSizerMain->Add( m_sdbSizer1, 0, wxALIGN_RIGHT|wxEXPAND|wxTOP|wxBOTTOM, 5 ); + this->SetSizer( bSizerMain ); this->Layout(); @@ -129,4 +145,5 @@ DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::~DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE() // Disconnect Events m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::OnCancelClick ), NULL, this ); m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE::OnOkClick ), NULL, this ); + } diff --git a/pcbnew/dialogs/dialog_graphic_items_options_base.fbp b/pcbnew/dialogs/dialog_graphic_items_options_base.fbp index 747c9b3f74..d29afa81d7 100644 --- a/pcbnew/dialogs/dialog_graphic_items_options_base.fbp +++ b/pcbnew/dialogs/dialog_graphic_items_options_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -20,8 +20,10 @@ . 1 + 1 1 1 + UI 0 0 @@ -42,7 +44,7 @@ DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE - 459,315 + 459,345 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Texts and Drawings @@ -990,7 +992,7 @@ 1 wxID_ANY - Modules: + Footprints: sbSizerMiddle wxVERTICAL @@ -1028,7 +1030,7 @@ 0 0 wxID_ANY - Edges Module Width + Edges Width 0 @@ -1202,7 +1204,7 @@ 0 0 wxID_ANY - Text Module Width + Text Width 0 @@ -1376,7 +1378,7 @@ 0 0 wxID_ANY - Text Module Size V + Text Size V 0 @@ -1550,7 +1552,7 @@ 0 0 wxID_ANY - Text Module Size H + Text Size H 0 diff --git a/pcbnew/dialogs/dialog_graphic_items_options_base.h b/pcbnew/dialogs/dialog_graphic_items_options_base.h index e7f5e1e17a..c889447144 100644 --- a/pcbnew/dialogs/dialog_graphic_items_options_base.h +++ b/pcbnew/dialogs/dialog_graphic_items_options_base.h @@ -1,15 +1,19 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __dialog_graphic_items_options_base__ -#define __dialog_graphic_items_options_base__ +#ifndef __DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE_H__ +#define __DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE_H__ +#include +#include #include +class DIALOG_SHIM; +#include "dialog_shim.h" #include #include #include @@ -28,7 +32,7 @@ /////////////////////////////////////////////////////////////////////////////// /// Class DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE /////////////////////////////////////////////////////////////////////////////// -class DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE : public wxDialog +class DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE : public DIALOG_SHIM { private: @@ -58,14 +62,15 @@ class DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE : public wxDialog wxButton* m_sdbSizer1Cancel; // Virtual event handlers, overide them in your derived class - virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } public: - DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Texts and Drawings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 459,315 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + + DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Texts and Drawings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 459,345 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE(); }; -#endif //__dialog_graphic_items_options_base__ +#endif //__DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE_H__ diff --git a/pcbnew/dialogs/dialog_netlist_fbp.cpp b/pcbnew/dialogs/dialog_netlist_fbp.cpp index 13ebd9d7ab..22b72881ba 100644 --- a/pcbnew/dialogs/dialog_netlist_fbp.cpp +++ b/pcbnew/dialogs/dialog_netlist_fbp.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 6 2013) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -30,7 +30,7 @@ DIALOG_NETLIST_FBP::DIALOG_NETLIST_FBP( wxWindow* parent, wxWindowID id, const w wxString m_Select_By_TimestampChoices[] = { _("Reference"), _("Timestamp") }; int m_Select_By_TimestampNChoices = sizeof( m_Select_By_TimestampChoices ) / sizeof( wxString ); - m_Select_By_Timestamp = new wxRadioBox( this, wxID_ANY, _("Module Selection"), wxDefaultPosition, wxDefaultSize, m_Select_By_TimestampNChoices, m_Select_By_TimestampChoices, 1, wxRA_SPECIFY_COLS ); + m_Select_By_Timestamp = new wxRadioBox( this, wxID_ANY, _("Footprint Selection"), wxDefaultPosition, wxDefaultSize, m_Select_By_TimestampNChoices, m_Select_By_TimestampChoices, 1, wxRA_SPECIFY_COLS ); m_Select_By_Timestamp->SetSelection( 0 ); m_Select_By_Timestamp->SetToolTip( _("Select how footprints are recognized:\nby their reference (U1, R3...) (normal setting)\nor their time stamp (special setting after a full schematic reannotation)") ); @@ -38,7 +38,7 @@ DIALOG_NETLIST_FBP::DIALOG_NETLIST_FBP( wxWindow* parent, wxWindowID id, const w wxString m_cmpNameSourceOptChoices[] = { _("From netlist"), _("From separate .cmp file") }; int m_cmpNameSourceOptNChoices = sizeof( m_cmpNameSourceOptChoices ) / sizeof( wxString ); - m_cmpNameSourceOpt = new wxRadioBox( this, wxID_ANY, _("Module Name Source"), wxDefaultPosition, wxDefaultSize, m_cmpNameSourceOptNChoices, m_cmpNameSourceOptChoices, 1, wxRA_SPECIFY_COLS ); + m_cmpNameSourceOpt = new wxRadioBox( this, wxID_ANY, _("Footprint Name Source"), wxDefaultPosition, wxDefaultSize, m_cmpNameSourceOptNChoices, m_cmpNameSourceOptChoices, 1, wxRA_SPECIFY_COLS ); m_cmpNameSourceOpt->SetSelection( 0 ); m_cmpNameSourceOpt->SetToolTip( _("Source of footprints names for component:\n- the netlist (if you have filled the footprint field of each component in schematic)\n- the .cmp file created by CvPcb") ); @@ -46,7 +46,7 @@ DIALOG_NETLIST_FBP::DIALOG_NETLIST_FBP( wxWindow* parent, wxWindowID id, const w wxString m_ChangeExistingFootprintCtrlChoices[] = { _("Keep"), _("Change") }; int m_ChangeExistingFootprintCtrlNChoices = sizeof( m_ChangeExistingFootprintCtrlChoices ) / sizeof( wxString ); - m_ChangeExistingFootprintCtrl = new wxRadioBox( this, wxID_ANY, _("Exchange Module"), wxDefaultPosition, wxDefaultSize, m_ChangeExistingFootprintCtrlNChoices, m_ChangeExistingFootprintCtrlChoices, 1, wxRA_SPECIFY_COLS ); + m_ChangeExistingFootprintCtrl = new wxRadioBox( this, wxID_ANY, _("Exchange Footprint"), wxDefaultPosition, wxDefaultSize, m_ChangeExistingFootprintCtrlNChoices, m_ChangeExistingFootprintCtrlChoices, 1, wxRA_SPECIFY_COLS ); m_ChangeExistingFootprintCtrl->SetSelection( 0 ); m_ChangeExistingFootprintCtrl->SetToolTip( _("Keep or change an existing footprint when the netlist gives a different footprint") ); diff --git a/pcbnew/dialogs/dialog_netlist_fbp.fbp b/pcbnew/dialogs/dialog_netlist_fbp.fbp index 393a071cb5..fe4568c299 100644 --- a/pcbnew/dialogs/dialog_netlist_fbp.fbp +++ b/pcbnew/dialogs/dialog_netlist_fbp.fbp @@ -1,6 +1,6 @@ - + C++ @@ -162,7 +162,7 @@ 0 0 wxID_ANY - Module Selection + Footprint Selection 1 0 @@ -252,7 +252,7 @@ 0 0 wxID_ANY - Module Name Source + Footprint Name Source 1 0 @@ -342,7 +342,7 @@ 0 0 wxID_ANY - Exchange Module + Exchange Footprint 1 0 diff --git a/pcbnew/dialogs/dialog_netlist_fbp.h b/pcbnew/dialogs/dialog_netlist_fbp.h index 72977ac72a..dcd4d7be0d 100644 --- a/pcbnew/dialogs/dialog_netlist_fbp.h +++ b/pcbnew/dialogs/dialog_netlist_fbp.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 6 2013) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! diff --git a/pcbnew/dialogs/dialog_pad_properties_base.cpp b/pcbnew/dialogs/dialog_pad_properties_base.cpp index c7a62c1d54..d4386af6fc 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.cpp +++ b/pcbnew/dialogs/dialog_pad_properties_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 30 2013) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -471,7 +471,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_staticText40->Wrap( -1 ); fgSizer41->Add( m_staticText40, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ); - wxString m_ZoneConnectionChoiceChoices[] = { _("From parent module"), _("Solid"), _("Thermal relief"), _("None") }; + wxString m_ZoneConnectionChoiceChoices[] = { _("From parent footprint"), _("Solid"), _("Thermal relief"), _("None") }; int m_ZoneConnectionChoiceNChoices = sizeof( m_ZoneConnectionChoiceChoices ) / sizeof( wxString ); m_ZoneConnectionChoice = new wxChoice( m_localSettingsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_ZoneConnectionChoiceNChoices, m_ZoneConnectionChoiceChoices, 0 ); m_ZoneConnectionChoice->SetSelection( 0 ); diff --git a/pcbnew/dialogs/dialog_pad_properties_base.fbp b/pcbnew/dialogs/dialog_pad_properties_base.fbp index 8696b831e5..e68730ff2f 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.fbp +++ b/pcbnew/dialogs/dialog_pad_properties_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -20,8 +20,10 @@ . 1 + 1 1 1 + UI 1 0 @@ -7460,7 +7462,7 @@ 1 0 - "From parent module" "Solid" "Thermal relief" "None" + "From parent footprint" "Solid" "Thermal relief" "None" 1 1 diff --git a/pcbnew/dialogs/dialog_pad_properties_base.h b/pcbnew/dialogs/dialog_pad_properties_base.h index 1170f7bf20..14b57ce29d 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.h +++ b/pcbnew/dialogs/dialog_pad_properties_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 30 2013) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! diff --git a/pcbnew/dialogs/dialog_plot_base.cpp b/pcbnew/dialogs/dialog_plot_base.cpp index ad69f5644f..3c4838ebe7 100644 --- a/pcbnew/dialogs/dialog_plot_base.cpp +++ b/pcbnew/dialogs/dialog_plot_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 5 2014) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -96,14 +96,15 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr bSizerPlotItems->Add( m_plotPads_on_Silkscreen, 0, wxALL, 2 ); - m_plotModuleValueOpt = new wxCheckBox( this, wxID_ANY, _("Plot module values"), wxDefaultPosition, wxDefaultSize, 0 ); + m_plotModuleValueOpt = new wxCheckBox( this, wxID_ANY, _("Plot footprint values"), wxDefaultPosition, wxDefaultSize, 0 ); + m_plotModuleValueOpt->SetValue(true); bSizerPlotItems->Add( m_plotModuleValueOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); - m_plotModuleRefOpt = new wxCheckBox( this, ID_PRINT_REF, _("Plot module references"), wxDefaultPosition, wxDefaultSize, 0 ); + m_plotModuleRefOpt = new wxCheckBox( this, ID_PRINT_REF, _("Plot footprint references"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerPlotItems->Add( m_plotModuleRefOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); - m_plotInvisibleText = new wxCheckBox( this, wxID_ANY, _("Force plot invisible values/references"), wxDefaultPosition, wxDefaultSize, 0 ); - m_plotInvisibleText->SetToolTip( _("Force plotting of invisible values and/or references") ); + m_plotInvisibleText = new wxCheckBox( this, wxID_ANY, _("Force plotting of invisible values/references"), wxDefaultPosition, wxDefaultSize, 0 ); + m_plotInvisibleText->SetToolTip( _("Force plot invisible values and/or references") ); bSizerPlotItems->Add( m_plotInvisibleText, 0, wxALL, 2 ); @@ -246,7 +247,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr int m_rbGerberFormatNChoices = sizeof( m_rbGerberFormatChoices ) / sizeof( wxString ); m_rbGerberFormat = new wxRadioBox( this, wxID_ANY, _("Format"), wxDefaultPosition, wxDefaultSize, m_rbGerberFormatNChoices, m_rbGerberFormatChoices, 1, wxRA_SPECIFY_COLS ); m_rbGerberFormat->SetSelection( 0 ); - m_rbGerberFormat->SetToolTip( _("Resolution of coordinates in Gerber files.\nUse the higher value if possible") ); + m_rbGerberFormat->SetToolTip( _("Resolution of coordinates in Gerber files.\nUse the higher value if possible.") ); m_GerberOptionsSizer->Add( m_rbGerberFormat, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); diff --git a/pcbnew/dialogs/dialog_plot_base.fbp b/pcbnew/dialogs/dialog_plot_base.fbp index 1cdc95bbe6..f4cebc7ed9 100644 --- a/pcbnew/dialogs/dialog_plot_base.fbp +++ b/pcbnew/dialogs/dialog_plot_base.fbp @@ -26,7 +26,7 @@ UI 1 0 - + 0 wxAUI_MGR_DEFAULT @@ -88,21 +88,21 @@ - + m_MainSizer wxHORIZONTAL protected - + 5 wxALL|wxEXPAND 1 - + bSizer12 wxVERTICAL none - + 5 wxEXPAND 0 @@ -579,20 +579,20 @@ - + 5 wxEXPAND 0 - + bUpperSizer wxHORIZONTAL none - + 3 wxALL|wxEXPAND 1 - + wxID_ANY Layers @@ -600,11 +600,11 @@ wxHORIZONTAL protected - + 5 wxEXPAND 1 - + 1 1 1 @@ -691,20 +691,20 @@ - + 5 0 - + m_PlotOptionsSizer wxVERTICAL protected - + 3 wxALL|wxEXPAND 0 - + wxID_ANY Options @@ -712,16 +712,16 @@ wxVERTICAL none - + 5 wxEXPAND 0 - + bSizer192 wxHORIZONTAL none - + 5 wxEXPAND 0 @@ -924,7 +924,7 @@ 1 0 - 0 + 1 1 1 @@ -939,7 +939,7 @@ 0 0 wxID_ANY - Plot module values + Plot footprint values 0 @@ -1027,7 +1027,7 @@ 0 0 ID_PRINT_REF - Plot module references + Plot footprint references 0 @@ -1612,11 +1612,11 @@ - + 3 wxRIGHT|wxLEFT 1 - + bSizer14 wxVERTICAL @@ -2314,11 +2314,11 @@ - + 5 wxEXPAND 1 - + wxID_ANY Current solder mask settings: @@ -2326,11 +2326,11 @@ wxVERTICAL none - + 5 wxEXPAND 1 - + 2 wxBOTH @@ -2342,11 +2342,11 @@ none 2 0 - + 5 wxALIGN_CENTER_VERTICAL|wxALL 0 - + 1 1 1 @@ -2425,11 +2425,11 @@ - + 5 wxALL 0 - + 1 1 1 @@ -2508,11 +2508,11 @@ - + 5 wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT 0 - + 1 1 1 @@ -2591,11 +2591,11 @@ - + 5 wxBOTTOM|wxRIGHT|wxLEFT 0 - + 1 1 1 @@ -2678,11 +2678,11 @@ - + 3 wxALL|wxEXPAND 0 - + wxID_ANY Gerber Options @@ -2690,11 +2690,11 @@ wxHORIZONTAL protected - + 5 wxALIGN_CENTER_VERTICAL 0 - + bSizerGbrOpt wxVERTICAL @@ -2787,11 +2787,11 @@ - + 2 wxALL 0 - + 1 1 1 @@ -2965,11 +2965,11 @@ - + 5 wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL 1 - + 1 1 1 @@ -3057,11 +3057,11 @@ - + 3 wxALL|wxEXPAND 0 - + wxID_ANY HPGL Options @@ -3069,20 +3069,20 @@ wxVERTICAL protected - + 5 wxEXPAND 1 - + bSizer22 wxHORIZONTAL none - + 5 wxEXPAND 1 - + bSizer20 wxVERTICAL @@ -3263,11 +3263,11 @@ - + 5 wxEXPAND 1 - + bSizer21 wxVERTICAL @@ -3843,20 +3843,20 @@ - + 5 wxEXPAND 1 - + bSizer191 wxVERTICAL none - + 5 wxRIGHT|wxLEFT 0 - + 1 1 1 @@ -3935,11 +3935,11 @@ - + 5 wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT 0 - + 1 1 1 @@ -4030,11 +4030,11 @@ - + 2 wxALL 0 - + 1 1 1 @@ -4124,11 +4124,11 @@ - + 5 wxEXPAND 1 - + wxID_ANY Messages: @@ -4229,11 +4229,11 @@ - + 5 wxALIGN_RIGHT|wxRIGHT|wxLEFT 0 - + bSizerButtons wxHORIZONTAL @@ -4507,11 +4507,11 @@ - + MyMenu m_popMenu protected - + 0 1 @@ -4526,7 +4526,7 @@ OnPopUpLayers - + 0 1 @@ -4541,7 +4541,7 @@ OnPopUpLayers - + 0 1 @@ -4556,7 +4556,7 @@ OnPopUpLayers - + 0 1 @@ -4571,7 +4571,7 @@ OnPopUpLayers - + 0 1 diff --git a/pcbnew/dialogs/dialog_plot_base.h b/pcbnew/dialogs/dialog_plot_base.h index 13c4972a29..d81971d2dc 100644 --- a/pcbnew/dialogs/dialog_plot_base.h +++ b/pcbnew/dialogs/dialog_plot_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 5 2014) +// C++ code generated with wxFormBuilder (version Jun 6 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! diff --git a/pcbnew/tool_pcb.cpp b/pcbnew/tool_pcb.cpp index e9f93716db..ea60a5079b 100644 --- a/pcbnew/tool_pcb.cpp +++ b/pcbnew/tool_pcb.cpp @@ -356,7 +356,7 @@ void PCB_EDIT_FRAME::ReCreateOptToolbar() _( "Show board ratsnest" ), wxITEM_CHECK ); m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_RATSNEST, wxEmptyString, KiBitmap( local_ratsnest_xpm ), - _( "Show module ratsnest when moving" ), + _( "Show footprint ratsnest when moving" ), wxITEM_CHECK ); m_optionsToolBar->AddSeparator(); @@ -439,7 +439,7 @@ void PCB_EDIT_FRAME::ReCreateVToolbar() m_drawToolBar->AddSeparator(); m_drawToolBar->AddTool( ID_PCB_MODULE_BUTT, wxEmptyString, KiBitmap( module_xpm ), - _( "Add modules" ), wxITEM_CHECK ); + _( "Add footprints" ), wxITEM_CHECK ); m_drawToolBar->AddTool( ID_TRACK_BUTT, wxEmptyString, KiBitmap( add_tracks_xpm ), _( "Add tracks and vias" ), wxITEM_CHECK ); diff --git a/pcbnew/toolbars_update_user_interface.cpp b/pcbnew/toolbars_update_user_interface.cpp index d1891935c2..7a4c120127 100644 --- a/pcbnew/toolbars_update_user_interface.cpp +++ b/pcbnew/toolbars_update_user_interface.cpp @@ -149,8 +149,8 @@ void PCB_EDIT_FRAME::OnUpdateShowModuleRatsnest( wxUpdateUIEvent& aEvent ) aEvent.Check( g_Show_Module_Ratsnest ); m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_RATSNEST, g_Show_Module_Ratsnest ? - _( "Hide module ratsnest" ) : - _( "Show module ratsnest" ) ); + _( "Hide footprint ratsnest" ) : + _( "Show footprint ratsnest" ) ); } From 82339a923525e0fef446e7878c75aa51c1a647b2 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 13 Oct 2014 10:40:34 +0200 Subject: [PATCH 16/26] Fix bug #1358742 (drill map file output faulty), which was Gerber format specific. Minor code change (which removes a SWIG warning) --- common/class_plotter.cpp | 11 +++-- pcbnew/legacy_plugin.cpp | 1 + pcbnew/pcb_parser.cpp | 1 + pcbnew/pcb_plot_params.cpp | 1 + pcbnew/pcb_plot_params.h | 47 +-------------------- pcbnew/pcb_plot_params_parser.h | 74 +++++++++++++++++++++++++++++++++ 6 files changed, 83 insertions(+), 52 deletions(-) create mode 100644 pcbnew/pcb_plot_params_parser.h diff --git a/common/class_plotter.cpp b/common/class_plotter.cpp index e726e93c3e..c9646710c8 100644 --- a/common/class_plotter.cpp +++ b/common/class_plotter.cpp @@ -194,7 +194,7 @@ void PLOTTER::markerSquare( const wxPoint& position, int radius ) corner.y = position.y + r; corner_list.push_back( corner ); - PlotPoly( corner_list, NO_FILL ); + PlotPoly( corner_list, NO_FILL, GetCurrentLineWidth() ); } /** @@ -202,7 +202,7 @@ void PLOTTER::markerSquare( const wxPoint& position, int radius ) */ void PLOTTER::markerCircle( const wxPoint& position, int radius ) { - Circle( position, radius * 2, NO_FILL ); + Circle( position, radius * 2, NO_FILL, GetCurrentLineWidth() ); } /** @@ -228,7 +228,7 @@ void PLOTTER::markerLozenge( const wxPoint& position, int radius ) corner.y = position.y + radius; corner_list.push_back( corner ); - PlotPoly( corner_list, NO_FILL ); + PlotPoly( corner_list, NO_FILL, GetCurrentLineWidth() ); } /** @@ -354,8 +354,8 @@ void PLOTTER::Marker( const wxPoint& position, int diametre, unsigned aShapeId ) }; if( aShapeId >= MARKER_COUNT ) { - // Fallback shape - markerCircle( position, radius ); + // Fallback shape + markerCircle( position, radius ); } else { @@ -376,7 +376,6 @@ void PLOTTER::Marker( const wxPoint& position, int diametre, unsigned aShapeId ) if( pat & 0100 ) markerCircle( position, radius ); } - } diff --git a/pcbnew/legacy_plugin.cpp b/pcbnew/legacy_plugin.cpp index bf33ae1142..f569278124 100644 --- a/pcbnew/legacy_plugin.cpp +++ b/pcbnew/legacy_plugin.cpp @@ -81,6 +81,7 @@ #include #include <3d_struct.h> #include +#include #include #include #include diff --git a/pcbnew/pcb_parser.cpp b/pcbnew/pcb_parser.cpp index 60e40795dc..0d53ff9263 100644 --- a/pcbnew/pcb_parser.cpp +++ b/pcbnew/pcb_parser.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/pcb_plot_params.cpp b/pcbnew/pcb_plot_params.cpp index ccad2c68a5..4855a89c1e 100644 --- a/pcbnew/pcb_plot_params.cpp +++ b/pcbnew/pcb_plot_params.cpp @@ -23,6 +23,7 @@ */ #include +#include #include #include #include diff --git a/pcbnew/pcb_plot_params.h b/pcbnew/pcb_plot_params.h index 9135475156..47eb89bbb4 100644 --- a/pcbnew/pcb_plot_params.h +++ b/pcbnew/pcb_plot_params.h @@ -24,56 +24,11 @@ */ #include -#include #include // EDA_DRAW_MODE_T #include #include -class PCB_PLOT_PARAMS; -class LINE_READER; - - -/** - * Class PCB_PLOT_PARAMS_PARSER - * is the parser class for PCB_PLOT_PARAMS. - */ -class PCB_PLOT_PARAMS_PARSER : public PCB_PLOT_PARAMS_LEXER -{ -public: - PCB_PLOT_PARAMS_PARSER( LINE_READER* aReader ); - PCB_PLOT_PARAMS_PARSER( char* aLine, const wxString& aSource ); - - LINE_READER* GetReader() { return reader; }; - - void Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) throw( PARSE_ERROR, IO_ERROR ); - -private: - bool parseBool(); - - /** - * Function parseInt - * parses an integer and constrains it between two values. - * @param aMin is the smallest return value. - * @param aMax is the largest return value. - * @return int - the parsed integer. - */ - int parseInt( int aMin, int aMax ); - - /** - * Function parseDouble - * parses a double - * @return double - the parsed double. - */ - double parseDouble(); - - /** - * Function skipCurrent - * Skip the current token level, i.e - * search for the RIGHT parenthesis which closes the current description - */ - void skipCurrent() throw( IO_ERROR, PARSE_ERROR ); -}; - +class PCB_PLOT_PARAMS_PARSER; /** * Class PCB_PLOT_PARAMS diff --git a/pcbnew/pcb_plot_params_parser.h b/pcbnew/pcb_plot_params_parser.h new file mode 100644 index 0000000000..221bc92570 --- /dev/null +++ b/pcbnew/pcb_plot_params_parser.h @@ -0,0 +1,74 @@ +#ifndef PCB_PLOT_PARAMS_PARSER_H_ +#define PCB_PLOT_PARAMS_PARSER_H_ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 1992-2011 KiCad Developers, see change_log.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +//#include + +class PCB_PLOT_PARAMS; +class LINE_READER; + + +/** + * Class PCB_PLOT_PARAMS_PARSER + * is the parser class for PCB_PLOT_PARAMS. + */ +class PCB_PLOT_PARAMS_PARSER : public PCB_PLOT_PARAMS_LEXER +{ +public: + PCB_PLOT_PARAMS_PARSER( LINE_READER* aReader ); + PCB_PLOT_PARAMS_PARSER( char* aLine, const wxString& aSource ); + + LINE_READER* GetReader() { return reader; }; + + void Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) throw( PARSE_ERROR, IO_ERROR ); + +private: + bool parseBool(); + + /** + * Function parseInt + * parses an integer and constrains it between two values. + * @param aMin is the smallest return value. + * @param aMax is the largest return value. + * @return int - the parsed integer. + */ + int parseInt( int aMin, int aMax ); + + /** + * Function parseDouble + * parses a double + * @return double - the parsed double. + */ + double parseDouble(); + + /** + * Function skipCurrent + * Skip the current token level, i.e + * search for the RIGHT parenthesis which closes the current description + */ + void skipCurrent() throw( IO_ERROR, PARSE_ERROR ); +}; + +#endif // PCB_PLOT_PARAMS_PARSER_H_ From 4280a1f5d3f3aa1e4e0a655bfd1ea671c502adca Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Oct 2014 13:14:02 +0200 Subject: [PATCH 17/26] Fix absence of PCB_TARGET class in python interface. --- pcbnew/class_mire.h | 5 +++++ pcbnew/scripting/board_item.i | 5 ++++- pcbnew/scripting/pcbnew.i | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pcbnew/class_mire.h b/pcbnew/class_mire.h index 01bbf40302..03bebba9fc 100644 --- a/pcbnew/class_mire.h +++ b/pcbnew/class_mire.h @@ -84,6 +84,11 @@ public: bool HitTest( const wxPoint& aPosition ) const; + wxString GetClass() const + { + return wxT( "PCB_TARGET" ); + } + /** @copydoc BOARD_ITEM::HitTest(const EDA_RECT& aRect, * bool aContained = true, int aAccuracy ) const */ diff --git a/pcbnew/scripting/board_item.i b/pcbnew/scripting/board_item.i index 42a421de04..93f3026491 100644 --- a/pcbnew/scripting/board_item.i +++ b/pcbnew/scripting/board_item.i @@ -47,8 +47,9 @@ EDGE_MODULE* Cast_to_EDGE_MODULE() { return dynamic_cast(self); } D_PAD* Cast_to_D_PAD() { return dynamic_cast(self); } TRACK* Cast_to_TRACK() { return dynamic_cast(self); } - ZONE_CONTAINER* Cast_to_ZONE_CONTAINER() { return dynamic_cast(self);} VIA* Cast_to_VIA() { return dynamic_cast(self); } + ZONE_CONTAINER* Cast_to_ZONE_CONTAINER() { return dynamic_cast(self);} + PCB_TARGET* Cast_to_PCB_TARGET() { return dynamic_cast(self); } %pythoncode @@ -77,6 +78,8 @@ return self.Cast_to_VIA() elif ct=="TRACK": return self.Cast_to_TRACK() + elif ct=="PCB_TARGET": + return self.Cast_to_PCB_TARGET() elif ct=="ZONE_CONTAINER": return self.Cast_to_ZONE_CONTAINER() else: diff --git a/pcbnew/scripting/pcbnew.i b/pcbnew/scripting/pcbnew.i index 6c50e1b3f1..dcb791f3ea 100644 --- a/pcbnew/scripting/pcbnew.i +++ b/pcbnew/scripting/pcbnew.i @@ -97,6 +97,7 @@ #include #include #include + #include #include #include #include @@ -133,6 +134,7 @@ %include %include %include +%include %include %include %include From 1c74019f4caf8bded6c4d1669598b330d5062907 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 13 Oct 2014 15:22:14 +0200 Subject: [PATCH 18/26] pcbnew: Added "Get and Move" in pcbnew (GAL canvas). --- pcbnew/tools/common_actions.cpp | 6 ++++++ pcbnew/tools/common_actions.h | 3 +++ pcbnew/tools/selection_tool.cpp | 23 +++++++++++++++++++++++ pcbnew/tools/selection_tool.h | 3 +++ 4 files changed, 35 insertions(+) diff --git a/pcbnew/tools/common_actions.cpp b/pcbnew/tools/common_actions.cpp index a313877e10..15ce48f1ae 100644 --- a/pcbnew/tools/common_actions.cpp +++ b/pcbnew/tools/common_actions.cpp @@ -40,6 +40,9 @@ TOOL_ACTION COMMON_ACTIONS::selectionClear( "pcbnew.InteractiveSelection.Clear", AS_GLOBAL, 0, "", "" ); // No description, it is not supposed to be shown anywhere +TOOL_ACTION COMMON_ACTIONS::findMove( "pcbnew.InteractiveSelection.FindMove", + AS_GLOBAL, 'T'); + // Edit tool actions TOOL_ACTION COMMON_ACTIONS::editActivate( "pcbnew.InteractiveEdit", @@ -486,6 +489,9 @@ boost::optional COMMON_ACTIONS::TranslateLegacyId( int aId ) case ID_TB_OPTIONS_SELECT_CURSOR: return COMMON_ACTIONS::switchCursor.MakeEvent(); + case ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST: + return COMMON_ACTIONS::findMove.MakeEvent(); + case ID_NO_TOOL_SELECTED: return COMMON_ACTIONS::selectionTool.MakeEvent(); diff --git a/pcbnew/tools/common_actions.h b/pcbnew/tools/common_actions.h index 69a188a38c..b2e354622a 100644 --- a/pcbnew/tools/common_actions.h +++ b/pcbnew/tools/common_actions.h @@ -217,6 +217,9 @@ public: static TOOL_ACTION showHelp; static TOOL_ACTION toBeDone; + /// Find an item and start moving + static TOOL_ACTION findMove; + /** * Function TranslateLegacyId() * Translates legacy tool ids to the corresponding TOOL_ACTION name. diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 095f643bca..be2e0b2c5f 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -176,6 +176,11 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent ) selectSingle( getView()->ToWorld( getViewControls()->GetMousePosition() ) ); } + else if( evt->IsAction( &COMMON_ACTIONS::findMove ) ) + { + findMove( *evt ); + } + else if( evt->IsCancel() || evt->Action() == TA_UNDO_REDO || evt->IsAction( &COMMON_ACTIONS::selectionClear ) ) { @@ -386,6 +391,7 @@ void SELECTION_TOOL::setTransitions() Go( &SELECTION_TOOL::Main, COMMON_ACTIONS::selectionActivate.MakeEvent() ); Go( &SELECTION_TOOL::SingleSelection, COMMON_ACTIONS::selectionSingle.MakeEvent() ); Go( &SELECTION_TOOL::ClearSelection, COMMON_ACTIONS::selectionClear.MakeEvent() ); + Go( &SELECTION_TOOL::findMove, COMMON_ACTIONS::findMove.MakeEvent() ); } @@ -449,6 +455,23 @@ int SELECTION_TOOL::ClearSelection( TOOL_EVENT& aEvent ) } +int SELECTION_TOOL::findMove( TOOL_EVENT& aEvent ) +{ + MODULE* module = m_frame->GetModuleByName(); + + if( module ) + { + clearSelection(); + toggleSelection( module ); + m_toolMgr->InvokeTool( "pcbnew.InteractiveEdit" ); + } + + setTransitions(); + + return 0; +} + + void SELECTION_TOOL::clearSelection() { if( m_selection.Empty() ) diff --git a/pcbnew/tools/selection_tool.h b/pcbnew/tools/selection_tool.h index beceefee5d..43744db529 100644 --- a/pcbnew/tools/selection_tool.h +++ b/pcbnew/tools/selection_tool.h @@ -187,6 +187,9 @@ private: */ bool selectMultiple(); + ///> Find an item and start moving. + int findMove( TOOL_EVENT& aEvent ); + ///> Sets up handlers for various events. void setTransitions(); From ad2df709531b7777ed601e6c952be78842f20ff1 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 13 Oct 2014 15:22:45 +0200 Subject: [PATCH 19/26] Added EDA_DRAW_PANEL_GAL::ForceRefresh(). --- common/draw_panel_gal.cpp | 10 ++++++++-- include/class_draw_panel_gal.h | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/common/draw_panel_gal.cpp b/common/draw_panel_gal.cpp index 5d00f85654..f0be4b0316 100644 --- a/common/draw_panel_gal.cpp +++ b/common/draw_panel_gal.cpp @@ -168,8 +168,7 @@ void EDA_DRAW_PANEL_GAL::Refresh( bool aEraseBackground, const wxRect* aRect ) if( delta >= MinRefreshPeriod ) { - wxPaintEvent redrawEvent; - wxPostEvent( this, redrawEvent ); + ForceRefresh(); m_pendingRefresh = true; } else @@ -181,6 +180,13 @@ void EDA_DRAW_PANEL_GAL::Refresh( bool aEraseBackground, const wxRect* aRect ) } +void EDA_DRAW_PANEL_GAL::ForceRefresh() +{ + wxPaintEvent redrawEvent; + wxPostEvent( this, redrawEvent ); +} + + void EDA_DRAW_PANEL_GAL::SetEventDispatcher( TOOL_DISPATCHER* aEventDispatcher ) { m_eventDispatcher = aEventDispatcher; diff --git a/include/class_draw_panel_gal.h b/include/class_draw_panel_gal.h index 8795d94f29..d070548682 100644 --- a/include/class_draw_panel_gal.h +++ b/include/class_draw_panel_gal.h @@ -110,6 +110,12 @@ public: /// @copydoc wxWindow::Refresh() void Refresh( bool aEraseBackground = true, const wxRect* aRect = NULL ); + /** + * Function ForceRefresh() + * Forces a redraw. + */ + void ForceRefresh(); + /** * Function SetEventDispatcher() * Sets a dispatcher that processes events and forwards them to tools. From 18c9a62c6ef4f258ff27055952b81ad43f8ece15 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 13 Oct 2014 15:23:30 +0200 Subject: [PATCH 20/26] pcbnew: DIALOG_FIND allows to change warp options and set callbacks for found items. --- pcbnew/dialogs/dialog_find.cpp | 37 ++++++++++++++-------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/pcbnew/dialogs/dialog_find.cpp b/pcbnew/dialogs/dialog_find.cpp index db151b7483..559adc8611 100644 --- a/pcbnew/dialogs/dialog_find.cpp +++ b/pcbnew/dialogs/dialog_find.cpp @@ -36,26 +36,7 @@ #include #include -#include - - -class DIALOG_FIND : public DIALOG_FIND_BASE -{ -public: - DIALOG_FIND( PCB_BASE_FRAME* aParent ); - -private: - PCB_BASE_FRAME* parent; - - int itemCount, markerCount; - static wxString prevSearchString; - static bool warpMouse; - - void onButtonFindItemClick( wxCommandEvent& event ); - void onButtonFindMarkerClick( wxCommandEvent& event ); - void onButtonCloseClick( wxCommandEvent& event ); - void onClose( wxCloseEvent& event ); -}; +#include // Initialize static member variables @@ -66,6 +47,7 @@ bool DIALOG_FIND::warpMouse = true; DIALOG_FIND::DIALOG_FIND( PCB_BASE_FRAME* aParent ) : DIALOG_FIND_BASE( aParent ) { parent = aParent; + foundItem = NULL; GetSizer()->SetSizeHints( this ); m_SearchTextCtrl->AppendText( prevSearchString ); @@ -78,6 +60,11 @@ DIALOG_FIND::DIALOG_FIND( PCB_BASE_FRAME* aParent ) : DIALOG_FIND_BASE( aParent Center(); } +void DIALOG_FIND::EnableWarp( bool aEnabled ) +{ + m_NoMouseWarpCheckBox->SetValue( !aEnabled ); + warpMouse = aEnabled; +} void DIALOG_FIND::onButtonCloseClick( wxCommandEvent& aEvent ) { @@ -89,8 +76,8 @@ void DIALOG_FIND::onButtonFindItemClick( wxCommandEvent& aEvent ) { PCB_SCREEN* screen = (PCB_SCREEN*) ( parent->GetScreen() ); wxPoint pos; - BOARD_ITEM* foundItem = 0; + foundItem = NULL; wxString searchString = m_SearchTextCtrl->GetValue(); if( !searchString.IsSameAs( prevSearchString, false ) ) @@ -149,6 +136,9 @@ void DIALOG_FIND::onButtonFindItemClick( wxCommandEvent& aEvent ) DisplayError( this, msg, 10 ); itemCount = 0; } + + if( callback ) + callback( foundItem ); } @@ -156,7 +146,7 @@ void DIALOG_FIND::onButtonFindMarkerClick( wxCommandEvent& aEvent ) { PCB_SCREEN* screen = (PCB_SCREEN*) ( parent->GetScreen() ); wxPoint pos; - BOARD_ITEM* foundItem = 0; + foundItem = NULL; parent->GetCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y ); @@ -184,6 +174,9 @@ void DIALOG_FIND::onButtonFindMarkerClick( wxCommandEvent& aEvent ) DisplayError( this, msg, 10 ); markerCount = 0; } + + if( callback ) + callback( foundItem ); } From ac7bdfc7f6d9bb5f8dc9c91ba5e4aebb081f1249 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 13 Oct 2014 15:25:16 +0200 Subject: [PATCH 21/26] pcbnew: Fixed 'Find Item' (GAL canvas). --- pcbnew/tools/common_actions.cpp | 7 +++++++ pcbnew/tools/common_actions.h | 3 +++ pcbnew/tools/selection_tool.cpp | 30 ++++++++++++++++++++++++++++++ pcbnew/tools/selection_tool.h | 6 ++++++ 4 files changed, 46 insertions(+) diff --git a/pcbnew/tools/common_actions.cpp b/pcbnew/tools/common_actions.cpp index 15ce48f1ae..1efb778a7f 100644 --- a/pcbnew/tools/common_actions.cpp +++ b/pcbnew/tools/common_actions.cpp @@ -40,6 +40,10 @@ TOOL_ACTION COMMON_ACTIONS::selectionClear( "pcbnew.InteractiveSelection.Clear", AS_GLOBAL, 0, "", "" ); // No description, it is not supposed to be shown anywhere +TOOL_ACTION COMMON_ACTIONS::find( "pcbnew.InteractiveSelection.Find", + AS_GLOBAL, 0, + "Find an item", "Searches the document for an item" ); + TOOL_ACTION COMMON_ACTIONS::findMove( "pcbnew.InteractiveSelection.FindMove", AS_GLOBAL, 'T'); @@ -489,6 +493,9 @@ boost::optional COMMON_ACTIONS::TranslateLegacyId( int aId ) case ID_TB_OPTIONS_SELECT_CURSOR: return COMMON_ACTIONS::switchCursor.MakeEvent(); + case ID_FIND_ITEMS: + return COMMON_ACTIONS::find.MakeEvent(); + case ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST: return COMMON_ACTIONS::findMove.MakeEvent(); diff --git a/pcbnew/tools/common_actions.h b/pcbnew/tools/common_actions.h index b2e354622a..399dc3934c 100644 --- a/pcbnew/tools/common_actions.h +++ b/pcbnew/tools/common_actions.h @@ -217,6 +217,9 @@ public: static TOOL_ACTION showHelp; static TOOL_ACTION toBeDone; + /// Find an item + static TOOL_ACTION find; + /// Find an item and start moving static TOOL_ACTION findMove; diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index be2e0b2c5f..8b6eac6b42 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -176,6 +177,11 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent ) selectSingle( getView()->ToWorld( getViewControls()->GetMousePosition() ) ); } + else if( evt->IsAction( &COMMON_ACTIONS::find ) ) + { + find( *evt ); + } + else if( evt->IsAction( &COMMON_ACTIONS::findMove ) ) { findMove( *evt ); @@ -391,6 +397,7 @@ void SELECTION_TOOL::setTransitions() Go( &SELECTION_TOOL::Main, COMMON_ACTIONS::selectionActivate.MakeEvent() ); Go( &SELECTION_TOOL::SingleSelection, COMMON_ACTIONS::selectionSingle.MakeEvent() ); Go( &SELECTION_TOOL::ClearSelection, COMMON_ACTIONS::selectionClear.MakeEvent() ); + Go( &SELECTION_TOOL::find, COMMON_ACTIONS::find.MakeEvent() ); Go( &SELECTION_TOOL::findMove, COMMON_ACTIONS::findMove.MakeEvent() ); } @@ -455,6 +462,29 @@ int SELECTION_TOOL::ClearSelection( TOOL_EVENT& aEvent ) } +void SELECTION_TOOL::findCallback( BOARD_ITEM* aItem ) +{ + clearSelection(); + + if( aItem ) + toggleSelection( aItem ); + + m_frame->GetGalCanvas()->ForceRefresh(); +} + + +int SELECTION_TOOL::find( TOOL_EVENT& aEvent ) +{ + DIALOG_FIND dlg( m_frame ); + dlg.EnableWarp( false ); + dlg.SetCallback( boost::bind( &SELECTION_TOOL::findCallback, this, _1 ) ); + dlg.ShowModal(); + setTransitions(); + + return 0; +} + + int SELECTION_TOOL::findMove( TOOL_EVENT& aEvent ) { MODULE* module = m_frame->GetModuleByName(); diff --git a/pcbnew/tools/selection_tool.h b/pcbnew/tools/selection_tool.h index 43744db529..70e18cd7bd 100644 --- a/pcbnew/tools/selection_tool.h +++ b/pcbnew/tools/selection_tool.h @@ -187,6 +187,12 @@ private: */ bool selectMultiple(); + ///> Find dialog callback. + void findCallback( BOARD_ITEM* aItem ); + + ///> Find an item. + int find( TOOL_EVENT& aEvent ); + ///> Find an item and start moving. int findMove( TOOL_EVENT& aEvent ); From 0d7b7b02e791ca1d8f2e9b18f286f88a3d4a24f6 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 13 Oct 2014 15:26:06 +0200 Subject: [PATCH 22/26] pcbnew: Apply display settings on canvas switch (GAL canvas). --- pcbnew/pcb_draw_panel_gal.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp index e08f32bd62..bb7ce1bae5 100644 --- a/pcbnew/pcb_draw_panel_gal.cpp +++ b/pcbnew/pcb_draw_panel_gal.cpp @@ -55,22 +55,6 @@ const LAYER_NUM GAL_LAYER_ORDER[] = NETNAMES_GAL_LAYER( F_Cu ), F_Cu, F_SilkS, F_Paste, F_Adhes, -#if 0 // was: - NETNAMES_GAL_LAYER( LAYER_15_NETNAMES_VISIBLE ), LAYER_N_15, - NETNAMES_GAL_LAYER( LAYER_14_NETNAMES_VISIBLE ), LAYER_N_14, - NETNAMES_GAL_LAYER( LAYER_13_NETNAMES_VISIBLE ), LAYER_N_13, - NETNAMES_GAL_LAYER( LAYER_12_NETNAMES_VISIBLE ), LAYER_N_12, - NETNAMES_GAL_LAYER( LAYER_11_NETNAMES_VISIBLE ), LAYER_N_11, - NETNAMES_GAL_LAYER( LAYER_10_NETNAMES_VISIBLE ), LAYER_N_10, - NETNAMES_GAL_LAYER( LAYER_9_NETNAMES_VISIBLE ), LAYER_N_9, - NETNAMES_GAL_LAYER( LAYER_8_NETNAMES_VISIBLE ), LAYER_N_8, - NETNAMES_GAL_LAYER( LAYER_7_NETNAMES_VISIBLE ), LAYER_N_7, - NETNAMES_GAL_LAYER( LAYER_6_NETNAMES_VISIBLE ), LAYER_N_6, - NETNAMES_GAL_LAYER( LAYER_5_NETNAMES_VISIBLE ), LAYER_N_5, - NETNAMES_GAL_LAYER( LAYER_4_NETNAMES_VISIBLE ), LAYER_N_4, - NETNAMES_GAL_LAYER( LAYER_3_NETNAMES_VISIBLE ), LAYER_N_3, - NETNAMES_GAL_LAYER( LAYER_2_NETNAMES_VISIBLE ), LAYER_N_2, -#else NETNAMES_GAL_LAYER( In1_Cu ), In1_Cu, NETNAMES_GAL_LAYER( In2_Cu ), In2_Cu, NETNAMES_GAL_LAYER( In3_Cu ), In3_Cu, @@ -101,7 +85,7 @@ const LAYER_NUM GAL_LAYER_ORDER[] = NETNAMES_GAL_LAYER( In28_Cu ), In28_Cu, NETNAMES_GAL_LAYER( In29_Cu ), In29_Cu, NETNAMES_GAL_LAYER( In30_Cu ), In30_Cu, -#endif + NETNAMES_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_BK_VISIBLE ), B_Mask, NETNAMES_GAL_LAYER( B_Cu ), B_Cu, @@ -214,6 +198,7 @@ void PCB_DRAW_PANEL_GAL::DisplayBoard( const BOARD* aBoard ) m_view->Add( m_ratsnest ); UseColorScheme( aBoard->GetColorsSettings() ); + static_cast( m_view->GetPainter()->GetSettings() )->LoadDisplayOptions( DisplayOpt ); m_view->RecacheAllItems( true ); } From d12ffd307f6524042669a56b981a2206afb98a4f Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 13 Oct 2014 15:30:57 +0200 Subject: [PATCH 23/26] Added missing header file. --- pcbnew/dialogs/dialog_find.h | 57 ++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 pcbnew/dialogs/dialog_find.h diff --git a/pcbnew/dialogs/dialog_find.h b/pcbnew/dialogs/dialog_find.h new file mode 100644 index 0000000000..d374c41daf --- /dev/null +++ b/pcbnew/dialogs/dialog_find.h @@ -0,0 +1,57 @@ +/* + * This program source code file is part of KICAD, a free EDA CAD application. + * + * Copyright (C) 2012 Marco Mattila + * Copyright (C) 2006 Jean-Pierre Charras + * Copyright (C) 1992-2012 Kicad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef DIALOG_FIND_BASE_H +#define DIALOG_FIND_BASE_H + +#include +#include + +class DIALOG_FIND : public DIALOG_FIND_BASE +{ +public: + DIALOG_FIND( PCB_BASE_FRAME* aParent ); + inline BOARD_ITEM* GetItem() const { return foundItem; } + void EnableWarp( bool aEnabled ); + void SetCallback( boost::function aCallback ) { callback = aCallback; } + +private: + PCB_BASE_FRAME* parent; + + int itemCount, markerCount; + static wxString prevSearchString; + static bool warpMouse; + BOARD_ITEM* foundItem; + + // Function called when an item is found + boost::function callback; + + void onButtonFindItemClick( wxCommandEvent& event ); + void onButtonFindMarkerClick( wxCommandEvent& event ); + void onButtonCloseClick( wxCommandEvent& event ); + void onClose( wxCloseEvent& event ); +}; + +#endif /* DIALOG_FIND_BASE_H */ From 7c9418f6674856c001774b4ba9a08d8f0c7a3161 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 13 Oct 2014 18:42:28 +0200 Subject: [PATCH 24/26] Add FILE_NAME_WITH_PATH_CHAR_VALIDATOR, a custom wxValidator which allows file names with paths, in schematic sheet editor ( FILE_NAME_CHAR_VALIDATOR previously used in this dialog does not allow chars used in path names, like / and on Windows \ and : ) --- eeschema/dialogs/dialog_sch_sheet_props.cpp | 2 +- include/validators.h | 37 ++++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/eeschema/dialogs/dialog_sch_sheet_props.cpp b/eeschema/dialogs/dialog_sch_sheet_props.cpp index 4f47e572b1..8b34f4838c 100644 --- a/eeschema/dialogs/dialog_sch_sheet_props.cpp +++ b/eeschema/dialogs/dialog_sch_sheet_props.cpp @@ -6,7 +6,7 @@ DIALOG_SCH_SHEET_PROPS::DIALOG_SCH_SHEET_PROPS( wxWindow* parent ) : DIALOG_SCH_SHEET_PROPS_BASE( parent ) { - m_textFileName->SetValidator( FILE_NAME_CHAR_VALIDATOR() ); + m_textFileName->SetValidator( FILE_NAME_WITH_PATH_CHAR_VALIDATOR() ); m_textFileName->SetFocus(); m_sdbSizer1OK->SetDefault(); } diff --git a/include/validators.h b/include/validators.h index 9cca5b0951..124fd0897f 100644 --- a/include/validators.h +++ b/include/validators.h @@ -43,7 +43,7 @@ public: wxTextValidator( wxFILTER_EXCLUDE_CHAR_LIST, aValue ) { // The Windows (DOS) file system forbidden characters already include the forbidden - // file name characters for both Posix and OSX systems. The characters \/*?|"<> are + // file name characters for both Posix and OSX systems. The characters \/:*?|"<> are // illegal and filtered by the validator. wxString illegalChars = wxFileName::GetForbiddenChars( wxPATH_DOS ); wxTextValidator nameValidator( wxFILTER_EXCLUDE_CHAR_LIST ); @@ -55,3 +55,38 @@ public: SetExcludes( illegalCharList ); } }; + +/** + * Class FILE_NAME_WITH_PATH_CHAR_VALIDATOR + * + * This class provides a custom wxValidator object for limiting the allowable characters when + * defining file names with path, for instance in schematic sheet file names. + */ +class FILE_NAME_WITH_PATH_CHAR_VALIDATOR : public wxTextValidator +{ +public: + FILE_NAME_WITH_PATH_CHAR_VALIDATOR( wxString* aValue = NULL ) : + wxTextValidator( wxFILTER_EXCLUDE_CHAR_LIST, aValue ) + { + // The Windows (DOS) file system forbidden characters already include the forbidden + // file name characters for both Posix and OSX systems. The characters *?|"<> are + // illegal and filtered by the validator, but /\: are valid (\ and : only on Windows. + wxString illegalChars = wxFileName::GetForbiddenChars(wxPATH_DOS ); + wxTextValidator nameValidator( wxFILTER_EXCLUDE_CHAR_LIST ); + wxArrayString illegalCharList; + + for( unsigned i = 0; i < illegalChars.size(); i++ ) + { + if( illegalChars[i] == '/' ) + continue; + +#if defined (__WINDOWS__) + if( illegalChars[i] == '\\' || illegalChars[i] == ':' ) + continue; +#endif + illegalCharList.Add( wxString( illegalChars[i] ) ); + } + + SetExcludes( illegalCharList ); + } +}; From 788a25438a0df92fa8989aad8dde41e87d712d9f Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 13 Oct 2014 20:27:36 +0200 Subject: [PATCH 25/26] pcbnew: Minor fixes to 'Find Item' dialog (GAL canvas). --- pcbnew/pcbframe.cpp | 2 ++ pcbnew/tools/common_actions.cpp | 5 ++++- pcbnew/tools/common_actions.h | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index a27fac240c..6dd46c9862 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -695,6 +695,8 @@ void PCB_EDIT_FRAME::UseGalCanvas( bool aEnable ) } else { + m_toolManager->ResetTools( TOOL_BASE::GAL_SWITCH ); + // Redirect all events to the legacy canvas GetGalCanvas()->SetEventDispatcher( NULL ); } diff --git a/pcbnew/tools/common_actions.cpp b/pcbnew/tools/common_actions.cpp index 1efb778a7f..c73fdaf16c 100644 --- a/pcbnew/tools/common_actions.cpp +++ b/pcbnew/tools/common_actions.cpp @@ -41,9 +41,12 @@ TOOL_ACTION COMMON_ACTIONS::selectionClear( "pcbnew.InteractiveSelection.Clear", "", "" ); // No description, it is not supposed to be shown anywhere TOOL_ACTION COMMON_ACTIONS::find( "pcbnew.InteractiveSelection.Find", - AS_GLOBAL, 0, + AS_GLOBAL, 0, // it is handled by wxWidgets hotkey system "Find an item", "Searches the document for an item" ); +TOOL_ACTION COMMON_ACTIONS::findDummy( "pcbnew.Find.Dummy", // only block the hotkey + AS_GLOBAL, MD_CTRL + int( 'F' ) ); + TOOL_ACTION COMMON_ACTIONS::findMove( "pcbnew.InteractiveSelection.FindMove", AS_GLOBAL, 'T'); diff --git a/pcbnew/tools/common_actions.h b/pcbnew/tools/common_actions.h index 399dc3934c..c24bc0910f 100644 --- a/pcbnew/tools/common_actions.h +++ b/pcbnew/tools/common_actions.h @@ -223,6 +223,8 @@ public: /// Find an item and start moving static TOOL_ACTION findMove; + /// Blocks CTRL+F, it is handled by wxWidgets + static TOOL_ACTION findDummy; /** * Function TranslateLegacyId() * Translates legacy tool ids to the corresponding TOOL_ACTION name. From f8cea8188bc29dbade96f20a5e055c28e2e825de Mon Sep 17 00:00:00 2001 From: Konstantin Baranovskiy Date: Tue, 14 Oct 2014 09:18:48 -0400 Subject: [PATCH 26/26] Fix CvPcb menu accelerator bug in Linux. (fixes lp:1375232) --- cvpcb/class_components_listbox.cpp | 2 ++ cvpcb/class_footprints_listbox.cpp | 2 ++ cvpcb/class_library_listbox.cpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/cvpcb/class_components_listbox.cpp b/cvpcb/class_components_listbox.cpp index acc59a1c04..3b79ad8a6c 100644 --- a/cvpcb/class_components_listbox.cpp +++ b/cvpcb/class_components_listbox.cpp @@ -168,6 +168,8 @@ void COMPONENTS_LISTBOX::OnChar( wxKeyEvent& event ) break; } } + + event.Skip(); } diff --git a/cvpcb/class_footprints_listbox.cpp b/cvpcb/class_footprints_listbox.cpp index fc486d128c..1ba1669a3a 100644 --- a/cvpcb/class_footprints_listbox.cpp +++ b/cvpcb/class_footprints_listbox.cpp @@ -286,4 +286,6 @@ void FOOTPRINTS_LISTBOX::OnChar( wxKeyEvent& event ) break; } } + + event.Skip(); } diff --git a/cvpcb/class_library_listbox.cpp b/cvpcb/class_library_listbox.cpp index ee2ea62717..366c208478 100644 --- a/cvpcb/class_library_listbox.cpp +++ b/cvpcb/class_library_listbox.cpp @@ -213,6 +213,8 @@ void LIBRARY_LISTBOX::OnChar( wxKeyEvent& event ) break; } } + + event.Skip(); }