diff --git a/eeschema/dialogs/panel_eeschema_settings.cpp b/eeschema/dialogs/panel_eeschema_settings.cpp index d50b8a373e..efd597415b 100644 --- a/eeschema/dialogs/panel_eeschema_settings.cpp +++ b/eeschema/dialogs/panel_eeschema_settings.cpp @@ -53,6 +53,8 @@ bool PANEL_EESCHEMA_SETTINGS::TransferDataToWindow() m_mouseDragIsDrag->SetValue( m_frame->GetDragActionIsMove() ); + m_cbPinSelectionOpt->SetValue( m_frame->GetSelectPinSelectSymbol() ); + return true; } @@ -82,6 +84,8 @@ bool PANEL_EESCHEMA_SETTINGS::TransferDataFromWindow() m_frame->SetDragActionIsMove( !m_mouseDragIsDrag->GetValue() ); + m_frame->SetSelectPinSelectSymbol( m_cbPinSelectionOpt->GetValue() ); + return true; } diff --git a/eeschema/dialogs/panel_eeschema_settings_base.cpp b/eeschema/dialogs/panel_eeschema_settings_base.cpp index 84c6470b1a..965d9d2e3e 100644 --- a/eeschema/dialogs/panel_eeschema_settings_base.cpp +++ b/eeschema/dialogs/panel_eeschema_settings_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Jul 10 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -13,124 +13,141 @@ BEGIN_EVENT_TABLE( PANEL_EESCHEMA_SETTINGS_BASE, wxPanel ) EVT_CHOICE( wxID_ANY, PANEL_EESCHEMA_SETTINGS_BASE::_wxFB_OnChooseUnits ) END_EVENT_TABLE() -PANEL_EESCHEMA_SETTINGS_BASE::PANEL_EESCHEMA_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +PANEL_EESCHEMA_SETTINGS_BASE::PANEL_EESCHEMA_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name ) { wxBoxSizer* bPanelSizer; - bPanelSizer = new wxBoxSizer( wxVERTICAL ); - + bPanelSizer = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* bLeftColumn; bLeftColumn = new wxBoxSizer( wxVERTICAL ); - - wxFlexGridSizer* fgSizer3; - fgSizer3 = new wxFlexGridSizer( 0, 3, 5, 5 ); - fgSizer3->AddGrowableCol( 0 ); - fgSizer3->AddGrowableCol( 1 ); - fgSizer3->AddGrowableCol( 2 ); - fgSizer3->SetFlexibleDirection( wxBOTH ); - fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - + + wxFlexGridSizer* fgSizerRepeatOpt; + fgSizerRepeatOpt = new wxFlexGridSizer( 0, 3, 5, 5 ); + fgSizerRepeatOpt->AddGrowableCol( 0 ); + fgSizerRepeatOpt->AddGrowableCol( 1 ); + fgSizerRepeatOpt->AddGrowableCol( 2 ); + fgSizerRepeatOpt->SetFlexibleDirection( wxBOTH ); + fgSizerRepeatOpt->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + m_staticText2 = new wxStaticText( this, wxID_ANY, _("&Measurement units:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText2->Wrap( -1 ); - fgSizer3->Add( m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - + fgSizerRepeatOpt->Add( m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + wxString m_choiceUnitsChoices[] = { _("inches"), _("millimeters") }; int m_choiceUnitsNChoices = sizeof( m_choiceUnitsChoices ) / sizeof( wxString ); m_choiceUnits = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitsNChoices, m_choiceUnitsChoices, 0 ); m_choiceUnits->SetSelection( 0 ); - fgSizer3->Add( m_choiceUnits, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - fgSizer3->Add( 0, 0, 1, wxEXPAND, 3 ); - + fgSizerRepeatOpt->Add( m_choiceUnits, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + fgSizerRepeatOpt->Add( 0, 0, 1, wxEXPAND, 3 ); + m_textSizeLabel = new wxStaticText( this, wxID_ANY, _("Default schematic text size:"), wxDefaultPosition, wxDefaultSize, 0 ); m_textSizeLabel->Wrap( -1 ); - fgSizer3->Add( m_textSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - + fgSizerRepeatOpt->Add( m_textSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + m_textSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); - fgSizer3->Add( m_textSizeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 10 ); - + fgSizerRepeatOpt->Add( m_textSizeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 10 ); + m_textSizeUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); m_textSizeUnits->Wrap( -1 ); - fgSizer3->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); - + fgSizerRepeatOpt->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_hPitchLabel = new wxStaticText( this, wxID_ANY, _("&Horizontal pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 ); m_hPitchLabel->Wrap( -1 ); - fgSizer3->Add( m_hPitchLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - + fgSizerRepeatOpt->Add( m_hPitchLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + m_hPitchCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); - fgSizer3->Add( m_hPitchCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - + fgSizerRepeatOpt->Add( m_hPitchCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + m_hPitchUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); m_hPitchUnits->Wrap( -1 ); - fgSizer3->Add( m_hPitchUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); - + fgSizerRepeatOpt->Add( m_hPitchUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_vPitchLabel = new wxStaticText( this, wxID_ANY, _("&Vertical pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 ); m_vPitchLabel->Wrap( -1 ); - fgSizer3->Add( m_vPitchLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - + fgSizerRepeatOpt->Add( m_vPitchLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + m_vPitchCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); - fgSizer3->Add( m_vPitchCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - + fgSizerRepeatOpt->Add( m_vPitchCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + m_vPitchUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); m_vPitchUnits->Wrap( -1 ); - fgSizer3->Add( m_vPitchUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); - + fgSizerRepeatOpt->Add( m_vPitchUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_staticText16 = new wxStaticText( this, wxID_ANY, _("&Increment of repeated labels:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText16->Wrap( -1 ); - fgSizer3->Add( m_staticText16, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - + fgSizerRepeatOpt->Add( m_staticText16, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + m_spinRepeatLabel = new wxSpinCtrl( this, wxID_ANY, wxT("1"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -10, 10, 1 ); - fgSizer3->Add( m_spinRepeatLabel, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - - fgSizer3->Add( 0, 0, 1, wxEXPAND, 3 ); - - - bLeftColumn->Add( fgSizer3, 0, wxLEFT|wxRIGHT, 5 ); - - wxStaticBoxSizer* sbSizer11; - sbSizer11 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Editing") ), wxVERTICAL ); - - m_checkHVOrientation = new wxCheckBox( sbSizer11->GetStaticBox(), wxID_ANY, _("&Restrict buses and wires to H and V orientation"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkHVOrientation->SetValue(true); - sbSizer11->Add( m_checkHVOrientation, 0, wxRIGHT|wxLEFT, 5 ); - - m_mouseDragIsDrag = new wxCheckBox( sbSizer11->GetStaticBox(), wxID_ANY, _("Mouse drag performs drag (G) operation"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerRepeatOpt->Add( m_spinRepeatLabel, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + + fgSizerRepeatOpt->Add( 0, 0, 1, wxEXPAND, 3 ); + + + bLeftColumn->Add( fgSizerRepeatOpt, 0, wxLEFT|wxRIGHT, 5 ); + + wxStaticBoxSizer* sbSizerEditOpt; + sbSizerEditOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Editing") ), wxVERTICAL ); + + m_checkHVOrientation = new wxCheckBox( sbSizerEditOpt->GetStaticBox(), wxID_ANY, _("&Restrict buses and wires to H and V orientation"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkHVOrientation->SetValue(true); + sbSizerEditOpt->Add( m_checkHVOrientation, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_mouseDragIsDrag = new wxCheckBox( sbSizerEditOpt->GetStaticBox(), wxID_ANY, _("Mouse drag performs drag (G) operation"), wxDefaultPosition, wxDefaultSize, 0 ); m_mouseDragIsDrag->SetToolTip( _("If unchecked, mouse drag will perform move (M) operation") ); - - sbSizer11->Add( m_mouseDragIsDrag, 0, wxALL, 5 ); - - - bLeftColumn->Add( sbSizer11, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - - wxStaticBoxSizer* sbSizer1; - sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Symbol Field Automatic Placement") ), wxVERTICAL ); - - m_checkAutoplaceFields = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("A&utomatically place symbol fields"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizer1->Add( m_checkAutoplaceFields, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - m_checkAutoplaceJustify = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("A&llow field autoplace to change justification"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizer1->Add( m_checkAutoplaceJustify, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_checkAutoplaceAlign = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Al&ways align autoplaced fields to the 50 mil grid"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizer1->Add( m_checkAutoplaceAlign, 0, wxEXPAND|wxALL, 5 ); - - - bLeftColumn->Add( sbSizer1, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - - wxBoxSizer* bSizer9; - bSizer9 = new wxBoxSizer( wxVERTICAL ); - - m_footprintPreview = new wxCheckBox( this, wxID_ANY, _("Show footprint previews in symbol chooser"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer9->Add( m_footprintPreview, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - - - bLeftColumn->Add( bSizer9, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - + + sbSizerEditOpt->Add( m_mouseDragIsDrag, 0, wxALL, 5 ); + + + bLeftColumn->Add( sbSizerEditOpt, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + wxStaticBoxSizer* sbSizerPinSel; + sbSizerPinSel = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Selection") ), wxVERTICAL ); + + m_cbPinSelectionOpt = new wxCheckBox( sbSizerPinSel->GetStaticBox(), wxID_ANY, _("Select a pin select the symbol"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbPinSelectionOpt->SetToolTip( _("In schematic editor:\nIf enabled, clicking on a pin select the parent symbol.\nIf disabled, clicking on a pin select only the pin.") ); + + sbSizerPinSel->Add( m_cbPinSelectionOpt, 0, wxALL, 5 ); + + + bLeftColumn->Add( sbSizerPinSel, 0, wxEXPAND, 5 ); + + bPanelSizer->Add( bLeftColumn, 0, wxRIGHT|wxLEFT, 5 ); - - + + wxBoxSizer* bRightColumn; + bRightColumn = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbSizerFieldAutoPlace; + sbSizerFieldAutoPlace = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Symbol Field Automatic Placement") ), wxVERTICAL ); + + m_checkAutoplaceFields = new wxCheckBox( sbSizerFieldAutoPlace->GetStaticBox(), wxID_ANY, _("A&utomatically place symbol fields"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizerFieldAutoPlace->Add( m_checkAutoplaceFields, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_checkAutoplaceJustify = new wxCheckBox( sbSizerFieldAutoPlace->GetStaticBox(), wxID_ANY, _("A&llow field autoplace to change justification"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizerFieldAutoPlace->Add( m_checkAutoplaceJustify, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_checkAutoplaceAlign = new wxCheckBox( sbSizerFieldAutoPlace->GetStaticBox(), wxID_ANY, _("Al&ways align autoplaced fields to the 50 mil grid"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizerFieldAutoPlace->Add( m_checkAutoplaceAlign, 0, wxEXPAND|wxALL, 5 ); + + + bRightColumn->Add( sbSizerFieldAutoPlace, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + wxBoxSizer* bSizerPreviewOpt; + bSizerPreviewOpt = new wxBoxSizer( wxVERTICAL ); + + m_footprintPreview = new wxCheckBox( this, wxID_ANY, _("Show footprint previews in symbol chooser"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerPreviewOpt->Add( m_footprintPreview, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + + + bRightColumn->Add( bSizerPreviewOpt, 0, wxALL, 5 ); + + + bPanelSizer->Add( bRightColumn, 1, wxEXPAND, 5 ); + + this->SetSizer( bPanelSizer ); this->Layout(); bPanelSizer->Fit( this ); diff --git a/eeschema/dialogs/panel_eeschema_settings_base.fbp b/eeschema/dialogs/panel_eeschema_settings_base.fbp index 6bc9b6da1f..37e6734dd7 100644 --- a/eeschema/dialogs/panel_eeschema_settings_base.fbp +++ b/eeschema/dialogs/panel_eeschema_settings_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,6 +14,8 @@ panel_eeschema_settings_base 1000 none + + 1 PanelEeschemaSettingsBase @@ -24,6 +26,7 @@ 1 1 UI + 0 1 0 @@ -48,40 +51,10 @@ wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bPanelSizer - wxVERTICAL + wxHORIZONTAL none 5 @@ -103,7 +76,7 @@ 5 - fgSizer3 + fgSizerRepeatOpt wxFLEX_GROWMODE_SPECIFIED none 0 @@ -141,6 +114,7 @@ 0 wxID_ANY &Measurement units: + 0 0 @@ -166,29 +140,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -253,30 +204,7 @@ - OnChooseUnits - - - - - - - - - - - - - - - - - - - - - - @@ -322,6 +250,7 @@ 0 wxID_ANY Default schematic text size: + 0 0 @@ -347,29 +276,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -434,33 +340,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -496,6 +375,7 @@ 0 wxID_ANY mils + 0 0 @@ -521,29 +401,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -579,6 +436,7 @@ 0 wxID_ANY &Horizontal pitch of repeated items: + 0 0 @@ -604,29 +462,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -691,33 +526,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -753,6 +561,7 @@ 0 wxID_ANY mils + 0 0 @@ -778,29 +587,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -836,6 +622,7 @@ 0 wxID_ANY &Vertical pitch of repeated items: + 0 0 @@ -861,29 +648,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -948,33 +712,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1010,6 +747,7 @@ 0 wxID_ANY mils + 0 0 @@ -1035,29 +773,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -1093,6 +808,7 @@ 0 wxID_ANY &Increment of repeated labels: + 0 0 @@ -1118,29 +834,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -1203,32 +896,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1251,14 +918,13 @@ wxID_ANY Editing - sbSizer11 + sbSizerEditOpt wxVERTICAL 1 none - 5 - wxRIGHT|wxLEFT + wxTOP|wxRIGHT|wxLEFT 0 1 @@ -1318,30 +984,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1406,34 +1048,99 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + 5 + wxEXPAND + 0 + + wxID_ANY + Selection + + sbSizerPinSel + wxVERTICAL + 1 + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Select a pin select the symbol + + 0 + + + 0 + + 1 + m_cbPinSelectionOpt + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + In schematic editor: If enabled, clicking on a pin select the parent symbol. If disabled, clicking on a pin select only the pin. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + 5 + wxEXPAND + 1 + + + bRightColumn + wxVERTICAL + none 5 wxEXPAND|wxTOP|wxBOTTOM @@ -1442,14 +1149,13 @@ wxID_ANY Symbol Field Automatic Placement - sbSizer1 + sbSizerFieldAutoPlace wxVERTICAL 1 none - 5 - wxEXPAND|wxRIGHT|wxLEFT + wxEXPAND|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -1509,30 +1215,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1597,30 +1279,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1685,41 +1343,17 @@ - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxBOTTOM|wxRIGHT + wxALL 0 - bSizer9 + bSizerPreviewOpt wxVERTICAL none @@ -1784,30 +1418,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/eeschema/dialogs/panel_eeschema_settings_base.h b/eeschema/dialogs/panel_eeschema_settings_base.h index 9a0fb8394e..bd9a5058fe 100644 --- a/eeschema/dialogs/panel_eeschema_settings_base.h +++ b/eeschema/dialogs/panel_eeschema_settings_base.h @@ -1,12 +1,11 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Jul 10 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __PANEL_EESCHEMA_SETTINGS_BASE_H__ -#define __PANEL_EESCHEMA_SETTINGS_BASE_H__ +#pragma once #include #include @@ -30,15 +29,15 @@ /////////////////////////////////////////////////////////////////////////////// /// Class PANEL_EESCHEMA_SETTINGS_BASE /////////////////////////////////////////////////////////////////////////////// -class PANEL_EESCHEMA_SETTINGS_BASE : public wxPanel +class PANEL_EESCHEMA_SETTINGS_BASE : public wxPanel { DECLARE_EVENT_TABLE() private: - + // Private event handlers void _wxFB_OnChooseUnits( wxCommandEvent& event ){ OnChooseUnits( event ); } - - + + protected: wxStaticText* m_staticText2; wxChoice* m_choiceUnits; @@ -55,20 +54,20 @@ class PANEL_EESCHEMA_SETTINGS_BASE : public wxPanel wxSpinCtrl* m_spinRepeatLabel; wxCheckBox* m_checkHVOrientation; wxCheckBox* m_mouseDragIsDrag; + wxCheckBox* m_cbPinSelectionOpt; wxCheckBox* m_checkAutoplaceFields; wxCheckBox* m_checkAutoplaceJustify; wxCheckBox* m_checkAutoplaceAlign; wxCheckBox* m_footprintPreview; - + // Virtual event handlers, overide them in your derived class virtual void OnChooseUnits( wxCommandEvent& event ) { event.Skip(); } - - + + public: - - PANEL_EESCHEMA_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + + PANEL_EESCHEMA_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); ~PANEL_EESCHEMA_SETTINGS_BASE(); - + }; -#endif //__PANEL_EESCHEMA_SETTINGS_BASE_H__ diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index b289dcfe73..9255396803 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -322,6 +322,7 @@ static const wxString RepeatStepYEntry = "RepeatStepY"; static const wxString RepeatLabelIncrementEntry = "RepeatLabelIncrement"; static const wxString ShowIllegalSymboLibDialog = "ShowIllegalSymbolLibDialog"; static const wxString showSheetFileNameCaseSensitivityDlg = "ShowSheetFileNameCaseSensitivityDlg"; +static const wxString SelectPinSelectSymbolEntry = "SelectPinSelectSymbolOpt"; // Library editor wxConfig entry names. static const wxChar defaultLibWidthEntry[] = wxT( "LibeditLibWidth" ); @@ -410,6 +411,7 @@ void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg ) aCfg->Read( DragActionIsMoveEntry, &m_dragActionIsMove, true ); aCfg->Read( ShowHiddenPinsEntry, &m_showAllPins, false ); + aCfg->Read( SelectPinSelectSymbolEntry, &m_selectPinSelectSymbol, true ); aCfg->Read( HorzVertLinesOnlyEntry, &m_forceHVLines, true ); aCfg->Read( AutoplaceFieldsEntry, &m_autoplaceFields, true ); aCfg->Read( AutoplaceJustifyEntry, &m_autoplaceJustify, true ); @@ -453,6 +455,7 @@ void SCH_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg ) aCfg->Write( DefaultWireWidthEntry, (long) GetDefaultWireThickness() ); aCfg->Write( DefaultJctSizeEntry, (long) SCH_JUNCTION::GetSymbolSize() ); aCfg->Write( ShowHiddenPinsEntry, m_showAllPins ); + aCfg->Write( SelectPinSelectSymbolEntry, GetSelectPinSelectSymbol() ); aCfg->Write( HorzVertLinesOnlyEntry, GetForceHVLines() ); aCfg->Write( AutoplaceFieldsEntry, m_autoplaceFields ); aCfg->Write( AutoplaceJustifyEntry, m_autoplaceJustify ); diff --git a/eeschema/sch_base_frame.h b/eeschema/sch_base_frame.h index ca75f4ecc1..63e727394a 100644 --- a/eeschema/sch_base_frame.h +++ b/eeschema/sch_base_frame.h @@ -112,6 +112,12 @@ public: */ virtual bool GetShowAllPins() const { return true; } + /** + * Allow some frames to select the parent symbol when trying to select a pin. + * The default impl select the pin. + */ + virtual bool GetSelectPinSelectSymbol() const { return false; } + /** * Allow some frames to show/hide pin electrical type names. */ diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index cd4922cd7b..9dac3acf53 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -234,6 +234,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ): m_showBorderAndTitleBlock = true; // true to show sheet references m_showAllPins = false; + m_selectPinSelectSymbol = true; m_printMonochrome = true; m_printSheetReference = true; SetShowPageLimits( true ); diff --git a/eeschema/sch_edit_frame.h b/eeschema/sch_edit_frame.h index c8df4ca280..420b87cfb9 100644 --- a/eeschema/sch_edit_frame.h +++ b/eeschema/sch_edit_frame.h @@ -142,6 +142,9 @@ private: /// Flag to indicate show hidden pins. bool m_showAllPins; + /// Flag to indicate the pin selection (on a left click) select the paren symbol. + bool m_selectPinSelectSymbol; + /// The name of the destination directory to use when generating plot files. wxString m_plotDirectoryName; @@ -205,6 +208,9 @@ public: bool GetShowAllPins() const override { return m_showAllPins; } void SetShowAllPins( bool aEnable ) { m_showAllPins = aEnable; } + bool GetSelectPinSelectSymbol() const override { return m_selectPinSelectSymbol; } + void SetSelectPinSelectSymbol( bool aEnable ) { m_selectPinSelectSymbol = aEnable; } + bool GetShowFootprintPreviews() const { return m_footprintPreview; } void SetShowFootprintPreviews( bool aEnable ) { m_footprintPreview = aEnable; } diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 2c0c25debb..ce70654346 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -549,14 +549,24 @@ void EE_SELECTION_TOOL::GuessSelectionCandidates( EE_COLLECTOR& collector, const collector.Remove( other ); } - // Prefer a symbol to a pin + // Prefer a symbol to a pin or the opposite, when both a symbol and a pin are selected + // We need to be able to select only a pin: + // - to display its characteristics (especially if an ERC is attached to the pin) + // - for cross probing, to select the corresponding pad. + // Note also the case happens only in schematic editor. In symbol editor, the symbol + // itself is never selected for( int i = 0; collector.GetCount() == 2 && i < 2; ++i ) { EDA_ITEM* item = collector[ i ]; EDA_ITEM* other = collector[ ( i + 1 ) % 2 ]; if( item->Type() == SCH_COMPONENT_T && other->Type() == SCH_PIN_T ) - collector.Remove( other ); + { + if( m_frame->GetSelectPinSelectSymbol() ) + collector.Remove( other ); + else + collector.Remove( item ); + } } // Prefer a field to a symbol