diff --git a/common/project/project_local_settings.cpp b/common/project/project_local_settings.cpp index 13f1b98b15..e78b70b7a3 100644 --- a/common/project/project_local_settings.cpp +++ b/common/project/project_local_settings.cpp @@ -320,6 +320,7 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin ret["pins"] = m_SchSelectionFilter.pins; ret["graphics"] = m_SchSelectionFilter.graphics; ret["images"] = m_SchSelectionFilter.images; + ret["ruleAreas"] = m_SchSelectionFilter.ruleAreas; ret["otherItems"] = m_SchSelectionFilter.otherItems; return ret; @@ -337,6 +338,7 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin SetIfPresent( aVal, "pins", m_SchSelectionFilter.pins ); SetIfPresent( aVal, "graphics", m_SchSelectionFilter.graphics ); SetIfPresent( aVal, "images", m_SchSelectionFilter.images ); + SetIfPresent( aVal, "ruleAreas", m_SchSelectionFilter.ruleAreas ); SetIfPresent( aVal, "otherItems", m_SchSelectionFilter.otherItems ); }, { @@ -348,6 +350,7 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin { "pins", true }, { "graphics", true }, { "images", true }, + { "ruleAreas", true }, { "otherItems", true } } ) ); diff --git a/eeschema/tools/sch_selection_tool.cpp b/eeschema/tools/sch_selection_tool.cpp index 3f42bf26f2..3575846be0 100644 --- a/eeschema/tools/sch_selection_tool.cpp +++ b/eeschema/tools/sch_selection_tool.cpp @@ -2062,6 +2062,12 @@ bool SCH_SELECTION_TOOL::itemPassesFilter( EDA_ITEM* aItem ) break; + case SCH_RULE_AREA_T: + if( !m_filter.ruleAreas ) + return false; + + break; + default: if( !m_filter.otherItems ) return false; diff --git a/eeschema/widgets/panel_sch_selection_filter.cpp b/eeschema/widgets/panel_sch_selection_filter.cpp index 11d690d709..66d374678f 100644 --- a/eeschema/widgets/panel_sch_selection_filter.cpp +++ b/eeschema/widgets/panel_sch_selection_filter.cpp @@ -41,6 +41,7 @@ PANEL_SCH_SELECTION_FILTER::PANEL_SCH_SELECTION_FILTER( wxWindow* aParent ) : m_cbImages->SetFont( font ); m_cbOtherItems->SetFont( font ); m_cbAllItems->SetFont( font ); + m_cbRuleAreas->SetFont( font ); SetBorders( true, false, false, false ); @@ -59,6 +60,7 @@ PANEL_SCH_SELECTION_FILTER::PANEL_SCH_SELECTION_FILTER( wxWindow* aParent ) : m_cbGraphics->Bind( wxEVT_RIGHT_DOWN, &PANEL_SCH_SELECTION_FILTER::onRightClick, this ); m_cbImages->Bind( wxEVT_RIGHT_DOWN, &PANEL_SCH_SELECTION_FILTER::onRightClick, this ); m_cbOtherItems->Bind( wxEVT_RIGHT_DOWN, &PANEL_SCH_SELECTION_FILTER::onRightClick, this ); + m_cbRuleAreas->Bind( wxEVT_RIGHT_DOWN, &PANEL_SCH_SELECTION_FILTER::onRightClick, this ); if( m_frame->GetFrameType() == FRAME_SCH_SYMBOL_EDITOR ) { @@ -71,6 +73,7 @@ PANEL_SCH_SELECTION_FILTER::PANEL_SCH_SELECTION_FILTER( wxWindow* aParent ) : m_cbWires->Hide(); m_cbLabels->Hide(); m_cbImages->Hide(); + m_cbRuleAreas->Hide(); m_gridSizer->SetItemPosition( m_cbPins, wxGBPosition( 1, 0 ) ); m_gridSizer->SetItemPosition( m_cbText, wxGBPosition( 1, 1 ) ); @@ -101,6 +104,7 @@ void PANEL_SCH_SELECTION_FILTER::SetCheckboxesFromFilter( SCH_SELECTION_FILTER_O m_cbPins->SetValue( aOptions.pins ); m_cbGraphics->SetValue( aOptions.graphics ); m_cbImages->SetValue( aOptions.images ); + m_cbRuleAreas->SetValue( aOptions.ruleAreas ); m_cbOtherItems->SetValue( aOptions.otherItems ); m_cbAllItems->SetValue( aOptions.All() ); @@ -122,6 +126,7 @@ void PANEL_SCH_SELECTION_FILTER::OnFilterChanged( wxCommandEvent& aEvent ) m_cbPins->SetValue( newState ); m_cbGraphics->SetValue( newState ); m_cbImages->SetValue( newState ); + m_cbRuleAreas->SetValue( newState ); m_cbOtherItems->SetValue( newState ); } @@ -143,6 +148,7 @@ bool PANEL_SCH_SELECTION_FILTER::setFilterFromCheckboxes( SCH_SELECTION_FILTER_O aOptions.pins = m_cbPins->GetValue(); aOptions.graphics = m_cbGraphics->GetValue(); aOptions.images = m_cbImages->GetValue(); + aOptions.ruleAreas = m_cbRuleAreas->GetValue(); aOptions.otherItems = m_cbOtherItems->GetValue(); return aOptions.All(); @@ -185,6 +191,7 @@ void PANEL_SCH_SELECTION_FILTER::onPopupSelection( wxCommandEvent& aEvent ) m_cbGraphics->SetValue( false ); m_cbImages->SetValue( false ); m_cbOtherItems->SetValue( false ); + m_cbRuleAreas->SetValue( false ); m_onlyCheckbox->SetValue( true ); m_onlyCheckbox = nullptr; @@ -206,6 +213,7 @@ void PANEL_SCH_SELECTION_FILTER::OnLanguageChanged( wxCommandEvent& aEvent ) m_cbPins->SetLabel( _( "Pins" ) ); m_cbGraphics->SetLabel( _( "Graphics" ) ); m_cbImages->SetLabel( _( "Images" ) ); + m_cbRuleAreas->SetLabel( _( "Rule Areas" ) ); m_cbOtherItems->SetLabel( _( "Other items" ) ); m_cbAllItems->GetParent()->Layout(); diff --git a/eeschema/widgets/panel_sch_selection_filter_base.cpp b/eeschema/widgets/panel_sch_selection_filter_base.cpp index 5142d42ff3..6605d6a491 100644 --- a/eeschema/widgets/panel_sch_selection_filter_base.cpp +++ b/eeschema/widgets/panel_sch_selection_filter_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf-dirty) +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -19,6 +19,10 @@ PANEL_SCH_SELECTION_FILTER_BASE::PANEL_SCH_SELECTION_FILTER_BASE( wxWindow* pare m_cbAllItems->SetValue(true); m_gridSizer->Add( m_cbAllItems, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxLEFT|wxTOP, 5 ); + m_cbRuleAreas = new wxCheckBox( this, wxID_ANY, _("Rule Areas"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbRuleAreas->SetValue(true); + m_gridSizer->Add( m_cbRuleAreas, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxLEFT|wxRIGHT|wxTOP, 5 ); + m_cbLockedItems = new wxCheckBox( this, wxID_ANY, _("Locked items"), wxDefaultPosition, wxDefaultSize, 0 ); m_cbLockedItems->SetValue(true); m_cbLockedItems->Hide(); diff --git a/eeschema/widgets/panel_sch_selection_filter_base.fbp b/eeschema/widgets/panel_sch_selection_filter_base.fbp index 927dbcbfc9..dc8898c712 100644 --- a/eeschema/widgets/panel_sch_selection_filter_base.fbp +++ b/eeschema/widgets/panel_sch_selection_filter_base.fbp @@ -1,34 +1,36 @@ - + - ; C++ - 1 - source_name - 0 - 0 + ; + 1 + connect + none + + + 0 + 0 res UTF-8 - connect panel_sch_selection_filter_base 1000 - none - - 1 + 1 + UI Selection Filter - . - + 0 + source_name + 1 + 0 + source_name + + + 1 1 - 1 - 1 - 1 - UI - 0 - 0 0 + 0 0 wxAUI_MGR_DEFAULT @@ -53,7 +55,7 @@ wxTAB_TRAVERSAL - + wxBOTH @@ -76,10 +78,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -133,6 +135,74 @@ OnFilterChanged + + 5 + 1 + 1 + wxLEFT|wxRIGHT|wxTOP + 0 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Rule Areas + + 0 + + + 0 + + 1 + m_cbRuleAreas + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + 5 1 @@ -145,10 +215,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -214,10 +284,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -283,10 +353,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -352,10 +422,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -421,10 +491,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -490,10 +560,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -559,10 +629,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -628,10 +698,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -697,10 +767,10 @@ 1 1 1 - + 0 - - + 0 + 0 diff --git a/eeschema/widgets/panel_sch_selection_filter_base.h b/eeschema/widgets/panel_sch_selection_filter_base.h index 94be6cfc58..e64b8fafe0 100644 --- a/eeschema/widgets/panel_sch_selection_filter_base.h +++ b/eeschema/widgets/panel_sch_selection_filter_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf-dirty) +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -22,7 +22,6 @@ /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// /// Class PANEL_SCH_SELECTION_FILTER_BASE /////////////////////////////////////////////////////////////////////////////// @@ -33,6 +32,7 @@ class PANEL_SCH_SELECTION_FILTER_BASE : public WX_PANEL protected: wxGridBagSizer* m_gridSizer; wxCheckBox* m_cbAllItems; + wxCheckBox* m_cbRuleAreas; wxCheckBox* m_cbLockedItems; wxCheckBox* m_cbSymbols; wxCheckBox* m_cbPins; diff --git a/include/project/sch_project_settings.h b/include/project/sch_project_settings.h index a23d0eb008..4191823dc9 100644 --- a/include/project/sch_project_settings.h +++ b/include/project/sch_project_settings.h @@ -31,6 +31,7 @@ struct SCH_SELECTION_FILTER_OPTIONS bool pins; ///< Symbol and sheet pins bool graphics; ///< Graphic lines, shapes, polygons bool images; ///< Bitmap/vector images + bool ruleAreas; ///< Rule areas bool otherItems; ///< Anything not fitting one of the above categories SCH_SELECTION_FILTER_OPTIONS() @@ -43,6 +44,7 @@ struct SCH_SELECTION_FILTER_OPTIONS pins = true; graphics = true; images = true; + ruleAreas = true; otherItems = true; } @@ -51,7 +53,7 @@ struct SCH_SELECTION_FILTER_OPTIONS */ bool Any() { - return ( symbols || text || wires || labels || pins || graphics || images || otherItems ); + return ( symbols || text || wires || labels || pins || graphics || images || ruleAreas || otherItems ); } /** @@ -59,7 +61,7 @@ struct SCH_SELECTION_FILTER_OPTIONS */ bool All() { - return ( symbols && text && wires && labels && pins && graphics && images && otherItems ); + return ( symbols && text && wires && labels && pins && graphics && images && ruleAreas && otherItems ); } void SetDefaults() @@ -72,6 +74,7 @@ struct SCH_SELECTION_FILTER_OPTIONS pins = true; graphics = true; images = true; + ruleAreas = true; otherItems = true; } };