diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 9b8f4850d0..8f24e9e17c 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -856,11 +856,13 @@ void DIALOG_PAD_PROPERTIES::OnPadShapeSelection( wxCommandEvent& event ) // PAD_SHAPE_CUSTOM type has constraints for zone connection and thermal shape: // only not connected is allowed to avoid destroying the shape. - // Enable/disable options + // Enable/disable options only available for custom shaped pads m_ZoneConnectionChoice->Enable( !is_custom ); m_ThermalWidthCtrl->Enable( !is_custom ); m_ThermalGapCtrl->Enable( !is_custom ); - m_ZoneCustomPadShape->Enable( is_custom ); + + m_sbSizerZonesSettings->Show( !is_custom ); + m_sbSizerCustomShapedZonesSettings->Show( is_custom ); transferDataToPad( m_dummyPad ); @@ -1399,11 +1401,16 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow() m_currentPad->SetLocalSolderMaskMargin( m_padMaster->GetLocalSolderMaskMargin() ); m_currentPad->SetLocalSolderPasteMargin( m_padMaster->GetLocalSolderPasteMargin() ); m_currentPad->SetLocalSolderPasteMarginRatio( m_padMaster->GetLocalSolderPasteMarginRatio() ); - m_currentPad->SetZoneConnection( m_padMaster->GetZoneConnection() ); m_currentPad->SetThermalWidth( m_padMaster->GetThermalWidth() ); m_currentPad->SetThermalGap( m_padMaster->GetThermalGap() ); m_currentPad->SetRoundRectRadiusRatio( m_padMaster->GetRoundRectRadiusRatio() ); + if( m_currentPad->GetShape() == PAD_SHAPE_CUSTOM ) + m_currentPad->SetZoneConnection( PAD_ZONE_CONN_NONE ); + else + m_currentPad->SetZoneConnection( m_padMaster->GetZoneConnection() ); + + // rounded rect pads with radius ratio = 0 are in fact rect pads. // So set the right shape (and perhaps issues with a radius = 0) if( m_currentPad->GetShape() == PAD_SHAPE_ROUNDRECT && @@ -1412,7 +1419,7 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow() m_currentPad->SetShape( PAD_SHAPE_RECT ); } - // define the way the clearnce area is defined in zones + // define the way the clearance area is defined in zones m_currentPad->SetCustomShapeInZoneOpt( m_padMaster->GetCustomShapeInZoneOpt() ); if( footprint ) diff --git a/pcbnew/dialogs/dialog_pad_properties_base.cpp b/pcbnew/dialogs/dialog_pad_properties_base.cpp index bd5b98afe1..dfc7be0734 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 Oct 17 2016) +// C++ code generated with wxFormBuilder (version Jul 2 2017) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -421,6 +421,12 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind wxBoxSizer* bSizerClearance; bSizerClearance = new wxBoxSizer( wxVERTICAL ); + m_staticTextWarning = new wxStaticText( m_localSettingsPanel, wxID_ANY, _("Set fields to 0 to use parent or global values"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextWarning->Wrap( -1 ); + m_staticTextWarning->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); + + bSizerClearance->Add( m_staticTextWarning, 0, wxALL, 5 ); + wxStaticBoxSizer* sbClearancesSizer; sbClearancesSizer = new wxStaticBoxSizer( new wxStaticBox( m_localSettingsPanel, wxID_ANY, _("Clearances") ), wxVERTICAL ); @@ -488,7 +494,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind bSizerClearance->Add( sbClearancesSizer, 0, wxALL|wxEXPAND, 5 ); - m_sbSizerZonesSettings = new wxStaticBoxSizer( new wxStaticBox( m_localSettingsPanel, wxID_ANY, _("Copper Zones") ), wxVERTICAL ); + m_sbSizerZonesSettings = new wxStaticBoxSizer( new wxStaticBox( m_localSettingsPanel, wxID_ANY, _("Connection to Copper Zones") ), wxVERTICAL ); wxFlexGridSizer* fgSizerCopperZonesOpts; fgSizerCopperZonesOpts = new wxFlexGridSizer( 0, 3, 0, 0 ); @@ -531,30 +537,42 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_ThermalGapUnits->Wrap( -1 ); fgSizerCopperZonesOpts->Add( m_ThermalGapUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - m_staticTextcps = new wxStaticText( m_sbSizerZonesSettings->GetStaticBox(), wxID_ANY, _("Custom pad shape in zone:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextcps->Wrap( -1 ); - fgSizerCopperZonesOpts->Add( m_staticTextcps, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - wxString m_ZoneCustomPadShapeChoices[] = { _("Use pad shape"), _("Use pad convex hull") }; - int m_ZoneCustomPadShapeNChoices = sizeof( m_ZoneCustomPadShapeChoices ) / sizeof( wxString ); - m_ZoneCustomPadShape = new wxChoice( m_sbSizerZonesSettings->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_ZoneCustomPadShapeNChoices, m_ZoneCustomPadShapeChoices, 0 ); - m_ZoneCustomPadShape->SetSelection( 0 ); - fgSizerCopperZonesOpts->Add( m_ZoneCustomPadShape, 0, wxEXPAND|wxBOTTOM|wxLEFT, 5 ); - - - fgSizerCopperZonesOpts->Add( 0, 0, 1, wxEXPAND, 5 ); - m_sbSizerZonesSettings->Add( fgSizerCopperZonesOpts, 0, wxEXPAND, 5 ); bSizerClearance->Add( m_sbSizerZonesSettings, 0, wxALL|wxEXPAND, 5 ); - m_staticTextWarning = new wxStaticText( m_localSettingsPanel, wxID_ANY, _("Set fields to 0 to use parent or global values"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextWarning->Wrap( -1 ); - m_staticTextWarning->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); + m_sbSizerCustomShapedZonesSettings = new wxStaticBoxSizer( new wxStaticBox( m_localSettingsPanel, wxID_ANY, _("Connection to Copper Zones") ), wxVERTICAL ); - bSizerClearance->Add( m_staticTextWarning, 0, wxALL, 5 ); + wxFlexGridSizer* fgSizerCustomShapedCopperZonesOpts; + fgSizerCustomShapedCopperZonesOpts = new wxFlexGridSizer( 0, 2, 0, 0 ); + fgSizerCustomShapedCopperZonesOpts->AddGrowableCol( 1 ); + fgSizerCustomShapedCopperZonesOpts->SetFlexibleDirection( wxBOTH ); + fgSizerCustomShapedCopperZonesOpts->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticTextCsZconnTitle = new wxStaticText( m_sbSizerCustomShapedZonesSettings->GetStaticBox(), wxID_ANY, _("Pad connection:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextCsZconnTitle->Wrap( -1 ); + fgSizerCustomShapedCopperZonesOpts->Add( m_staticTextCsZconnTitle, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ); + + m_textCtrlNone = new wxTextCtrl( m_sbSizerCustomShapedZonesSettings->GetStaticBox(), wxID_ANY, _("None"), wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); + fgSizerCustomShapedCopperZonesOpts->Add( m_textCtrlNone, 0, wxALL|wxEXPAND, 5 ); + + m_staticTextcps = new wxStaticText( m_sbSizerCustomShapedZonesSettings->GetStaticBox(), wxID_ANY, _("Custom pad shape in zone:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextcps->Wrap( -1 ); + fgSizerCustomShapedCopperZonesOpts->Add( m_staticTextcps, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + wxString m_ZoneCustomPadShapeChoices[] = { _("Use pad shape"), _("Use pad convex hull") }; + int m_ZoneCustomPadShapeNChoices = sizeof( m_ZoneCustomPadShapeChoices ) / sizeof( wxString ); + m_ZoneCustomPadShape = new wxChoice( m_sbSizerCustomShapedZonesSettings->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_ZoneCustomPadShapeNChoices, m_ZoneCustomPadShapeChoices, 0 ); + m_ZoneCustomPadShape->SetSelection( 0 ); + fgSizerCustomShapedCopperZonesOpts->Add( m_ZoneCustomPadShape, 0, wxEXPAND|wxBOTTOM|wxLEFT, 5 ); + + + m_sbSizerCustomShapedZonesSettings->Add( fgSizerCustomShapedCopperZonesOpts, 0, wxEXPAND, 5 ); + + + bSizerClearance->Add( m_sbSizerCustomShapedZonesSettings, 1, wxEXPAND, 5 ); bSizerPanelClearance->Add( bSizerClearance, 0, wxALL|wxEXPAND, 5 ); diff --git a/pcbnew/dialogs/dialog_pad_properties_base.fbp b/pcbnew/dialogs/dialog_pad_properties_base.fbp index 5e6811336d..2163e6eb09 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.fbp +++ b/pcbnew/dialogs/dialog_pad_properties_base.fbp @@ -97,16 +97,16 @@ 5 wxEXPAND 1 - + bSizerUpper wxHORIZONTAL none - + 5 wxALL|wxEXPAND 0 - + 1 1 1 @@ -7031,11 +7031,11 @@ - + Local Clearance and Settings 0 - + 1 1 1 @@ -7109,21 +7109,104 @@ - + bSizerPanelClearance wxVERTICAL none - + 5 wxALL|wxEXPAND 0 - + bSizerClearance wxVERTICAL none + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + ,90,92,-1,70,0 + 0 + 0 + wxID_ANY + Set fields to 0 to use parent or global values + + 0 + + + 0 + + 1 + m_staticTextWarning + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + 5 wxALL|wxEXPAND 0 @@ -8190,7 +8273,7 @@ 0 wxID_ANY - Copper Zones + Connection to Copper Zones m_sbSizerZonesSettings wxVERTICAL @@ -8908,11 +8991,218 @@ - + + + + + + 5 + wxEXPAND + 1 + + wxID_ANY + Connection to Copper Zones + + m_sbSizerCustomShapedZonesSettings + wxVERTICAL + 1 + protected + + + 5 + wxEXPAND + 0 + + 2 + wxBOTH + 1 + + 0 + + fgSizerCustomShapedCopperZonesOpts + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 0 + + 5 + wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Pad connection: + + 0 + + + 0 + + 1 + m_staticTextCsZconnTitle + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_textCtrlNone + 1 + + + protected + 1 + + Resizable + 1 + + wxTE_READONLY + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -8991,11 +9281,11 @@ - + 5 wxEXPAND|wxBOTTOM|wxLEFT 0 - + 1 1 1 @@ -9079,103 +9369,10 @@ - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - ,90,92,-1,70,0 - 0 - 0 - wxID_ANY - Set fields to 0 to use parent or global values - - 0 - - - 0 - - 1 - m_staticTextWarning - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pcbnew/dialogs/dialog_pad_properties_base.h b/pcbnew/dialogs/dialog_pad_properties_base.h index a6aeab2e8c..db3a86776f 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 Oct 17 2016) +// C++ code generated with wxFormBuilder (version Jul 2 2017) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -138,6 +138,7 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM wxStaticText* m_staticTitleModuleSide; wxStaticText* m_staticModuleSideValue; wxPanel* m_localSettingsPanel; + wxStaticText* m_staticTextWarning; wxStaticText* m_staticTextNetClearance; TEXT_CTRL_EVAL* m_NetClearanceValueCtrl; wxStaticText* m_NetClearanceUnits; @@ -159,9 +160,11 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM wxStaticText* m_staticText52; TEXT_CTRL_EVAL* m_ThermalGapCtrl; wxStaticText* m_ThermalGapUnits; + wxStaticBoxSizer* m_sbSizerCustomShapedZonesSettings; + wxStaticText* m_staticTextCsZconnTitle; + wxTextCtrl* m_textCtrlNone; wxStaticText* m_staticTextcps; wxChoice* m_ZoneCustomPadShape; - wxStaticText* m_staticTextWarning; wxPanel* m_panelCustomShapePrimitives; wxBoxSizer* m_bSizerPanelPrimitives; wxStaticText* m_staticTextPrimitivesList;