From 7876bab0e0d530f826f7f4edb38532bb4fffd4a0 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 4 Jun 2020 16:07:23 +0100 Subject: [PATCH] Implement another shape choice for Chamfer + Rounded. --- pcbnew/dialogs/dialog_pad_properties.cpp | 236 ++-- pcbnew/dialogs/dialog_pad_properties_base.cpp | 278 +++-- pcbnew/dialogs/dialog_pad_properties_base.fbp | 1015 ++++++++++++++--- pcbnew/dialogs/dialog_pad_properties_base.h | 20 +- 4 files changed, 1225 insertions(+), 324 deletions(-) diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 0e5cb0fb11..a01dc3d590 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -55,8 +55,9 @@ static PAD_SHAPE_T code_shape[] = PAD_SHAPE_TRAPEZOID, PAD_SHAPE_ROUNDRECT, PAD_SHAPE_CHAMFERED_RECT, - PAD_SHAPE_CUSTOM, // choice = CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR - PAD_SHAPE_CUSTOM // choice = PAD_SHAPE_CUSTOM_RECT_ANCHOR + PAD_SHAPE_CHAMFERED_RECT, // choice = CHOICE_SHAPE_CHAMFERED_ROUNDED_RECT + PAD_SHAPE_CUSTOM, // choice = CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR + PAD_SHAPE_CUSTOM // choice = PAD_SHAPE_CUSTOM_RECT_ANCHOR }; // the ordered index of the pad shape wxChoice in dialog. @@ -69,6 +70,7 @@ enum CODE_CHOICE CHOICE_SHAPE_TRAPEZOID, CHOICE_SHAPE_ROUNDRECT, CHOICE_SHAPE_CHAMFERED_RECT, + CHOICE_SHAPE_CHAMFERED_ROUNDED_RECT, CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR, CHOICE_SHAPE_CUSTOM_RECT_ANCHOR }; @@ -303,22 +305,14 @@ void DIALOG_PAD_PROPERTIES::updateRoundRectCornerValues() if( m_dummyPad->GetShape() == PAD_SHAPE_ROUNDRECT || m_dummyPad->GetShape() == PAD_SHAPE_CHAMFERED_RECT ) { - auto ratio = wxString::Format( "%.1f", m_dummyPad->GetRoundRectRadiusRatio() * 100 ); + wxString ratio = wxString::Format( "%.1f", m_dummyPad->GetRoundRectRadiusRatio() * 100 ); m_tcCornerSizeRatio->ChangeValue( ratio ); - m_cornerRadius.SetValue( m_dummyPad->GetRoundRectCornerRadius() ); + m_tcCornerSizeRatio1->ChangeValue( ratio ); + m_cornerRadius.ChangeValue( m_dummyPad->GetRoundRectCornerRadius() ); ratio = wxString::Format( "%.1f", m_dummyPad->GetChamferRectRatio() * 100 ); m_tcChamferRatio->ChangeValue( ratio ); - } - else if( m_dummyPad->GetShape() == PAD_SHAPE_RECT ) - { - m_tcCornerSizeRatio->ChangeValue( "0" ); - m_cornerRadius.SetValue( 0 ); - } - else - { - m_tcCornerSizeRatio->ChangeValue( wxEmptyString ); - m_cornerRadius.SetValue( wxEmptyString ); + m_tcChamferRatio1->ChangeValue( ratio ); } } @@ -338,10 +332,11 @@ void DIALOG_PAD_PROPERTIES::onCornerRadiusChange( wxCommandEvent& event ) } transferDataToPad( m_dummyPad ); - m_dummyPad->SetRoundRectCornerRadius(rrRadius ); + m_dummyPad->SetRoundRectCornerRadius( rrRadius ); auto ratio = wxString::Format( "%.1f", m_dummyPad->GetRoundRectRadiusRatio() * 100 ); m_tcCornerSizeRatio->ChangeValue( ratio ); + m_tcCornerSizeRatio1->ChangeValue( ratio ); redraw(); } @@ -350,56 +345,78 @@ void DIALOG_PAD_PROPERTIES::onCornerSizePercentChange( wxCommandEvent& event ) { if( m_dummyPad->GetShape() != PAD_SHAPE_ROUNDRECT && m_dummyPad->GetShape() != PAD_SHAPE_CHAMFERED_RECT ) + { return; - - wxString value = m_tcCornerSizeRatio->GetValue(); - double ratioPercent; - - bool asChanged = false; - - if( value.ToDouble( &ratioPercent ) ) - { - // Clamp ratioPercent to acceptable value (0.0 to 50.0) - if( ratioPercent < 0.0 ) - { - ratioPercent = 0.0; - value.Printf( "%.1f", ratioPercent ); - m_tcCornerSizeRatio->ChangeValue( value ); - } - - if( ratioPercent > 50.0 ) - { - ratioPercent = 0.5; - value.Printf( "%.1f", ratioPercent*100.0 ); - m_tcCornerSizeRatio->ChangeValue( value ); - } - - asChanged = true; } - value = m_tcChamferRatio->GetValue(); + wxObject* ctrl = event.GetEventObject(); + wxString value = event.GetString(); + bool changed = false; - if( value.ToDouble( &ratioPercent ) ) + if( ctrl == m_tcCornerSizeRatio || ctrl == m_tcCornerSizeRatio1 ) { - // Clamp ratioPercent to acceptable value (0.0 to 50.0) - if( ratioPercent < 0.0 ) - { - ratioPercent = 0.0; - value.Printf( "%.1f", ratioPercent ); - m_tcChamferRatio->ChangeValue( value ); - } + double ratioPercent; - if( ratioPercent > 50.0 ) + if( value.ToDouble( &ratioPercent ) ) { - ratioPercent = 0.5; - value.Printf( "%.1f", ratioPercent*100.0 ); - m_tcChamferRatio->ChangeValue( value ); - } + // Clamp ratioPercent to acceptable value (0.0 to 50.0) + if( ratioPercent < 0.0 ) + { + ratioPercent = 0.0; + value.Printf( "%.1f", ratioPercent ); + m_tcCornerSizeRatio->ChangeValue( value ); + m_tcCornerSizeRatio1->ChangeValue( value ); + } - asChanged = true; + if( ratioPercent > 50.0 ) + { + ratioPercent = 0.5; + value.Printf( "%.1f", ratioPercent*100.0 ); + m_tcCornerSizeRatio->ChangeValue( value ); + m_tcCornerSizeRatio1->ChangeValue( value ); + } + + if( ctrl == m_tcCornerSizeRatio ) + m_tcCornerSizeRatio1->ChangeValue( value ); + else + m_tcCornerSizeRatio->ChangeValue( value ); + + changed = true; + } + } + else if( ctrl == m_tcChamferRatio || ctrl == m_tcChamferRatio1 ) + { + double ratioPercent; + + if( value.ToDouble( &ratioPercent ) ) + { + // Clamp ratioPercent to acceptable value (0.0 to 50.0) + if( ratioPercent < 0.0 ) + { + ratioPercent = 0.0; + value.Printf( "%.1f", ratioPercent ); + m_tcChamferRatio->ChangeValue( value ); + m_tcChamferRatio1->ChangeValue( value ); + } + + if( ratioPercent > 50.0 ) + { + ratioPercent = 0.5; + value.Printf( "%.1f", ratioPercent*100.0 ); + m_tcChamferRatio->ChangeValue( value ); + m_tcChamferRatio1->ChangeValue( value ); + } + + if( ctrl == m_tcChamferRatio ) + m_tcChamferRatio1->ChangeValue( value ); + else + m_tcChamferRatio->ChangeValue( value ); + + changed = true; + } } - if( asChanged ) + if( changed ) { transferDataToPad( m_dummyPad ); m_cornerRadius.ChangeValue( m_dummyPad->GetRoundRectCornerRadius() ); @@ -528,18 +545,10 @@ void DIALOG_PAD_PROPERTIES::initValues() switch( m_dummyPad->GetLocalZoneConnection() ) { default: - case ZONE_CONNECTION::INHERITED: - m_ZoneConnectionChoice->SetSelection( 0 ); - break; - case ZONE_CONNECTION::FULL: - m_ZoneConnectionChoice->SetSelection( 1 ); - break; - case ZONE_CONNECTION::THERMAL: - m_ZoneConnectionChoice->SetSelection( 2 ); - break; - case ZONE_CONNECTION::NONE: - m_ZoneConnectionChoice->SetSelection( 3 ); - break; + case ZONE_CONNECTION::INHERITED: m_ZoneConnectionChoice->SetSelection( 0 ); break; + case ZONE_CONNECTION::FULL: m_ZoneConnectionChoice->SetSelection( 1 ); break; + case ZONE_CONNECTION::THERMAL: m_ZoneConnectionChoice->SetSelection( 2 ); break; + case ZONE_CONNECTION::NONE: m_ZoneConnectionChoice->SetSelection( 3 ); break; } if( m_dummyPad->GetCustomShapeInZoneOpt() == CUST_PAD_SHAPE_IN_ZONE_CONVEXHULL ) @@ -575,12 +584,18 @@ void DIALOG_PAD_PROPERTIES::initValues() switch( m_dummyPad->GetShape() ) { default: - case PAD_SHAPE_CIRCLE: m_PadShape->SetSelection( CHOICE_SHAPE_CIRCLE ); break; - case PAD_SHAPE_OVAL: m_PadShape->SetSelection( CHOICE_SHAPE_OVAL ); break; - case PAD_SHAPE_RECT: m_PadShape->SetSelection( CHOICE_SHAPE_RECT ); break; - case PAD_SHAPE_TRAPEZOID: m_PadShape->SetSelection( CHOICE_SHAPE_TRAPEZOID ); break; - case PAD_SHAPE_ROUNDRECT: m_PadShape->SetSelection( CHOICE_SHAPE_ROUNDRECT ); break; - case PAD_SHAPE_CHAMFERED_RECT: m_PadShape->SetSelection( CHOICE_SHAPE_CHAMFERED_RECT ); break; + case PAD_SHAPE_CIRCLE: m_PadShape->SetSelection( CHOICE_SHAPE_CIRCLE ); break; + case PAD_SHAPE_OVAL: m_PadShape->SetSelection( CHOICE_SHAPE_OVAL ); break; + case PAD_SHAPE_RECT: m_PadShape->SetSelection( CHOICE_SHAPE_RECT ); break; + case PAD_SHAPE_TRAPEZOID: m_PadShape->SetSelection( CHOICE_SHAPE_TRAPEZOID ); break; + case PAD_SHAPE_ROUNDRECT: m_PadShape->SetSelection( CHOICE_SHAPE_ROUNDRECT ); break; + + case PAD_SHAPE_CHAMFERED_RECT: + if( m_dummyPad->GetRoundRectRadiusRatio() > 0.0 ) + m_PadShape->SetSelection( CHOICE_SHAPE_CHAMFERED_ROUNDED_RECT ); + else + m_PadShape->SetSelection( CHOICE_SHAPE_CHAMFERED_RECT ); + break; case PAD_SHAPE_CUSTOM: if( m_dummyPad->GetAnchorPadShape() == PAD_SHAPE_RECT ) @@ -590,11 +605,16 @@ void DIALOG_PAD_PROPERTIES::initValues() break; } - m_cbTopLeft->SetValue( (m_dummyPad->GetChamferPositions() & RECT_CHAMFER_TOP_LEFT) ); + m_cbTopLeft1->SetValue( (m_dummyPad->GetChamferPositions() & RECT_CHAMFER_TOP_LEFT) ); m_cbTopRight->SetValue( (m_dummyPad->GetChamferPositions() & RECT_CHAMFER_TOP_RIGHT) ); + m_cbTopRight1->SetValue( (m_dummyPad->GetChamferPositions() & RECT_CHAMFER_TOP_RIGHT) ); m_cbBottomLeft->SetValue( (m_dummyPad->GetChamferPositions() & RECT_CHAMFER_BOTTOM_LEFT) ); + m_cbBottomLeft1->SetValue( (m_dummyPad->GetChamferPositions() & RECT_CHAMFER_BOTTOM_LEFT) ); m_cbBottomRight->SetValue( (m_dummyPad->GetChamferPositions() & RECT_CHAMFER_BOTTOM_RIGHT) ); + m_cbBottomRight1->SetValue( (m_dummyPad->GetChamferPositions() & RECT_CHAMFER_BOTTOM_RIGHT) ); + + updateRoundRectCornerValues(); enablePrimitivePage( PAD_SHAPE_CUSTOM == m_dummyPad->GetShape() ); @@ -642,9 +662,7 @@ void DIALOG_PAD_PROPERTIES::initValues() // Update some dialog widgets state (Enable/disable options): wxCommandEvent cmd_event; setPadLayersList( m_dummyPad->GetLayerSet() ); - OnDrillShapeSelected( cmd_event ); OnPadShapeSelection( cmd_event ); - updateRoundRectCornerValues(); // Update basic shapes list displayPrimitivesList(); @@ -778,11 +796,13 @@ void DIALOG_PAD_PROPERTIES::OnPadShapeSelection( wxCommandEvent& event ) break; case CHOICE_SHAPE_ROUNDRECT: + { m_shapePropsBook->SetSelection( 2 ); - // Ensure m_tcCornerSizeRatio contains the right value: - m_tcCornerSizeRatio->ChangeValue( wxString::Format( "%.1f", - m_dummyPad->GetRoundRectRadiusRatio()*100 ) ); + // A reasonable default (from IPC-7351C) + if( m_dummyPad->GetRoundRectRadiusRatio() == 0.0 ) + m_tcCornerSizeRatio->SetValue( "25" ); + } break; case CHOICE_SHAPE_CHAMFERED_RECT: @@ -799,6 +819,19 @@ void DIALOG_PAD_PROPERTIES::OnPadShapeSelection( wxCommandEvent& event ) } break; + case CHOICE_SHAPE_CHAMFERED_ROUNDED_RECT: + { + m_shapePropsBook->SetSelection( 4 ); + + // Reasonable defaults (corner radius from IPC-7351C) + if( m_dummyPad->GetRoundRectRadiusRatio() == 0.0 ) + m_tcCornerSizeRatio->SetValue( "25" ); + + if( m_dummyPad->GetChamferRectRatio() == 0.0 ) + m_tcChamferRatio1->ChangeValue( "20" ); + } + break; + case CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR: // PAD_SHAPE_CUSTOM, circular anchor case CHOICE_SHAPE_CUSTOM_RECT_ANCHOR: // PAD_SHAPE_CUSTOM, rect anchor m_shapePropsBook->SetSelection( 0 ); @@ -934,7 +967,9 @@ void DIALOG_PAD_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event ) m_padToDieOpt->SetValue( false ); // Show/hide extra properties - m_shapePropsBook->Show( m_shapePropsBook->GetSelection() > 0 ); + wxSize size = m_shapePropsBook->GetSize(); + size.y = m_shapePropsBook->GetPage( m_shapePropsBook->GetSelection() )->GetBestSize().y; + m_shapePropsBook->SetMaxSize( size ); // Show/hide offset controls m_offsetCtrls->Show( m_offsetShapeOpt->GetValue() ); @@ -1129,6 +1164,7 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK() if( m_dummyPad->GetShape() == PAD_SHAPE_ROUNDRECT || m_dummyPad->GetShape() == PAD_SHAPE_CHAMFERED_RECT ) { + wxASSERT( m_tcCornerSizeRatio->GetValue() == m_tcCornerSizeRatio1->GetValue() ); wxString value = m_tcCornerSizeRatio->GetValue(); double rrRadiusRatioPercent; @@ -1566,7 +1602,7 @@ bool DIALOG_PAD_PROPERTIES::transferDataToPad( D_PAD* aPad ) int chamfers = 0; - if( aPad->GetShape() == PAD_SHAPE_CHAMFERED_RECT ) + if( m_PadShape->GetSelection() == CHOICE_SHAPE_CHAMFERED_RECT ) { if( m_cbTopLeft->GetValue() ) chamfers |= RECT_CHAMFER_TOP_LEFT; @@ -1580,7 +1616,20 @@ bool DIALOG_PAD_PROPERTIES::transferDataToPad( D_PAD* aPad ) if( m_cbBottomRight->GetValue() ) chamfers |= RECT_CHAMFER_BOTTOM_RIGHT; } + else if( m_PadShape->GetSelection() == CHOICE_SHAPE_CHAMFERED_ROUNDED_RECT ) + { + if( m_cbTopLeft1->GetValue() ) + chamfers |= RECT_CHAMFER_TOP_LEFT; + if( m_cbTopRight1->GetValue() ) + chamfers |= RECT_CHAMFER_TOP_RIGHT; + + if( m_cbBottomLeft1->GetValue() ) + chamfers |= RECT_CHAMFER_BOTTOM_LEFT; + + if( m_cbBottomRight1->GetValue() ) + chamfers |= RECT_CHAMFER_BOTTOM_RIGHT; + } aPad->SetChamferPositions( chamfers ); if( aPad->GetShape() == PAD_SHAPE_CUSTOM ) @@ -1626,12 +1675,29 @@ bool DIALOG_PAD_PROPERTIES::transferDataToPad( D_PAD* aPad ) break; } - double ratioPercent = 0.0; - if( aPad->GetShape() == PAD_SHAPE_ROUNDRECT ) - m_tcCornerSizeRatio->GetValue().ToDouble( &ratioPercent ); + { + double ratioPercent; - aPad->SetRoundRectRadiusRatio( ratioPercent / 100.0 ); + m_tcCornerSizeRatio->GetValue().ToDouble( &ratioPercent ); + aPad->SetRoundRectRadiusRatio( ratioPercent / 100.0 ); + } + else if( aPad->GetShape() == PAD_SHAPE_CHAMFERED_RECT + && m_PadShape->GetSelection() == CHOICE_SHAPE_CHAMFERED_ROUNDED_RECT ) + { + double ratioPercent; + + m_tcCornerSizeRatio1->GetValue().ToDouble( &ratioPercent ); + aPad->SetRoundRectRadiusRatio( ratioPercent / 100.0 ); + } + + if( aPad->GetShape() == PAD_SHAPE_CHAMFERED_RECT ) + { + double ratioPercent; + + m_tcChamferRatio->GetValue().ToDouble( &ratioPercent ); + aPad->SetChamferRectRatio( ratioPercent / 100.0 ); + } aPad->SetProperty( getSelectedProperty() ); diff --git a/pcbnew/dialogs/dialog_pad_properties_base.cpp b/pcbnew/dialogs/dialog_pad_properties_base.cpp index dbdd0a1f81..33134ef243 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.cpp +++ b/pcbnew/dialogs/dialog_pad_properties_base.cpp @@ -31,55 +31,55 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_LeftBoxSizer = new wxBoxSizer( wxVERTICAL ); wxGridBagSizer* gbSizerCommon; - gbSizerCommon = new wxGridBagSizer( 0, 0 ); + gbSizerCommon = new wxGridBagSizer( 4, 0 ); gbSizerCommon->SetFlexibleDirection( wxBOTH ); gbSizerCommon->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); m_padTypeLabel = new wxStaticText( m_panelGeneral, wxID_ANY, _("Pad type:"), wxDefaultPosition, wxDefaultSize, 0 ); m_padTypeLabel->Wrap( -1 ); - gbSizerCommon->Add( m_padTypeLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + gbSizerCommon->Add( m_padTypeLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); wxString m_PadTypeChoices[] = { _("Through-hole"), _("SMD"), _("Edge Connector"), _("NPTH, Mechanical"), _("SMD Aperture") }; int m_PadTypeNChoices = sizeof( m_PadTypeChoices ) / sizeof( wxString ); m_PadType = new wxChoice( m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_PadTypeNChoices, m_PadTypeChoices, 0 ); m_PadType->SetSelection( 0 ); - gbSizerCommon->Add( m_PadType, wxGBPosition( 0, 1 ), wxGBSpan( 1, 5 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + gbSizerCommon->Add( m_PadType, wxGBPosition( 0, 1 ), wxGBSpan( 1, 5 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 ); m_PadNumText = new wxStaticText( m_panelGeneral, wxID_ANY, _("Pad number:"), wxDefaultPosition, wxDefaultSize, 0 ); m_PadNumText->Wrap( -1 ); - gbSizerCommon->Add( m_PadNumText, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); + gbSizerCommon->Add( m_PadNumText, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_PadNumCtrl = new wxTextCtrl( m_panelGeneral, wxID_PADNUMCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - gbSizerCommon->Add( m_PadNumCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 5 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); + gbSizerCommon->Add( m_PadNumCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 5 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_PadNameText = new wxStaticText( m_panelGeneral, wxID_ANY, _("Net name:"), wxDefaultPosition, wxDefaultSize, 0 ); m_PadNameText->Wrap( -1 ); - gbSizerCommon->Add( m_PadNameText, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + gbSizerCommon->Add( m_PadNameText, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_PadNetSelector = new NET_SELECTOR( m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - gbSizerCommon->Add( m_PadNetSelector, wxGBPosition( 2, 1 ), wxGBSpan( 1, 5 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxEXPAND, 5 ); + gbSizerCommon->Add( m_PadNetSelector, wxGBPosition( 2, 1 ), wxGBSpan( 1, 5 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 ); m_posXLabel = new wxStaticText( m_panelGeneral, wxID_ANY, _("Position X:"), wxDefaultPosition, wxDefaultSize, 0 ); m_posXLabel->Wrap( -1 ); - gbSizerCommon->Add( m_posXLabel, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + gbSizerCommon->Add( m_posXLabel, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_posXCtrl = new wxTextCtrl( m_panelGeneral, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - gbSizerCommon->Add( m_posXCtrl, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP, 5 ); + gbSizerCommon->Add( m_posXCtrl, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); m_posXUnits = new wxStaticText( m_panelGeneral, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_posXUnits->Wrap( -1 ); - gbSizerCommon->Add( m_posXUnits, wxGBPosition( 3, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + gbSizerCommon->Add( m_posXUnits, wxGBPosition( 3, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_posYLabel = new wxStaticText( m_panelGeneral, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 ); m_posYLabel->Wrap( -1 ); - gbSizerCommon->Add( m_posYLabel, wxGBPosition( 3, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + gbSizerCommon->Add( m_posYLabel, wxGBPosition( 3, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_posYCtrl = new wxTextCtrl( m_panelGeneral, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - gbSizerCommon->Add( m_posYCtrl, wxGBPosition( 3, 4 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP, 5 ); + gbSizerCommon->Add( m_posYCtrl, wxGBPosition( 3, 4 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); m_posYUnits = new wxStaticText( m_panelGeneral, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_posYUnits->Wrap( -1 ); - gbSizerCommon->Add( m_posYUnits, wxGBPosition( 3, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + gbSizerCommon->Add( m_posYUnits, wxGBPosition( 3, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); gbSizerCommon->AddGrowableCol( 1 ); @@ -94,7 +94,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_LeftBoxSizer->Add( m_staticline5, 0, wxEXPAND, 5 ); - m_LeftBoxSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + m_LeftBoxSizer->Add( 0, 0, 0, wxEXPAND|wxBOTTOM, 5 ); wxBoxSizer* bSizerShape; bSizerShape = new wxBoxSizer( wxHORIZONTAL ); @@ -103,172 +103,232 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_shapeLabel->Wrap( -1 ); bSizerShape->Add( m_shapeLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - wxString m_PadShapeChoices[] = { _("Circular"), _("Oval"), _("Rectangular"), _("Trapezoidal"), _("Rounded Rectangle"), _("Chamfered Rectangle"), _("Custom (Circ. Anchor)"), _("Custom (Rect. Anchor)") }; + wxString m_PadShapeChoices[] = { _("Circular"), _("Oval"), _("Rectangular"), _("Trapezoidal"), _("Rounded rectangle"), _("Chamfered rectangle"), _("Chamfered with other corners rounded"), _("Custom (circular base)"), _("Custom (rectangular base)") }; int m_PadShapeNChoices = sizeof( m_PadShapeChoices ) / sizeof( wxString ); m_PadShape = new wxChoice( m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_PadShapeNChoices, m_PadShapeChoices, 0 ); m_PadShape->SetSelection( 0 ); - bSizerShape->Add( m_PadShape, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 3 ); + bSizerShape->Add( m_PadShape, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_LeftBoxSizer->Add( bSizerShape, 0, wxEXPAND|wxTOP, 5 ); - wxBoxSizer* bSizerShapeProps; - bSizerShapeProps = new wxBoxSizer( wxVERTICAL ); - - - m_LeftBoxSizer->Add( bSizerShapeProps, 0, wxEXPAND|wxLEFT, 25 ); - m_shapePropsBook = new wxSimplebook( m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - m_pageSimple = new wxPanel( m_shapePropsBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_shapePropsBook->AddPage( m_pageSimple, _("a page"), false ); - m_pageTrap = new wxPanel( m_shapePropsBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - fgSizerTrapProps = new wxFlexGridSizer( 0, 3, 0, 0 ); + m_emptyProps = new wxPanel( m_shapePropsBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_shapePropsBook->AddPage( m_emptyProps, _("a page"), false ); + m_trapProps = new wxPanel( m_shapePropsBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + fgSizerTrapProps = new wxFlexGridSizer( 0, 3, 4, 0 ); fgSizerTrapProps->AddGrowableCol( 1 ); fgSizerTrapProps->SetFlexibleDirection( wxBOTH ); fgSizerTrapProps->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_trapDeltaLabel = new wxStaticText( m_pageTrap, wxID_ANY, _("Trapezoid delta:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_trapDeltaLabel = new wxStaticText( m_trapProps, wxID_ANY, _("Trapezoid delta:"), wxDefaultPosition, wxDefaultSize, 0 ); m_trapDeltaLabel->Wrap( -1 ); - fgSizerTrapProps->Add( m_trapDeltaLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP, 5 ); + fgSizerTrapProps->Add( m_trapDeltaLabel, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_trapDeltaCtrl = new wxTextCtrl( m_pageTrap, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizerTrapProps->Add( m_trapDeltaCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5 ); + m_trapDeltaCtrl = new wxTextCtrl( m_trapProps, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerTrapProps->Add( m_trapDeltaCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - m_trapDeltaUnits = new wxStaticText( m_pageTrap, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_trapDeltaUnits = new wxStaticText( m_trapProps, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_trapDeltaUnits->Wrap( -1 ); - fgSizerTrapProps->Add( m_trapDeltaUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 ); + fgSizerTrapProps->Add( m_trapDeltaUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - m_trapAxisLabel = new wxStaticText( m_pageTrap, wxID_ANY, _("Trapezoid axis:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_trapAxisLabel = new wxStaticText( m_trapProps, wxID_ANY, _("Trapezoid axis:"), wxDefaultPosition, wxDefaultSize, 0 ); m_trapAxisLabel->Wrap( -1 ); - fgSizerTrapProps->Add( m_trapAxisLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP, 5 ); + fgSizerTrapProps->Add( m_trapAxisLabel, 0, wxALIGN_CENTER_VERTICAL, 5 ); wxString m_trapAxisCtrlChoices[] = { _("Horizontal"), _("Vertical") }; int m_trapAxisCtrlNChoices = sizeof( m_trapAxisCtrlChoices ) / sizeof( wxString ); - m_trapAxisCtrl = new wxChoice( m_pageTrap, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_trapAxisCtrlNChoices, m_trapAxisCtrlChoices, 0 ); + m_trapAxisCtrl = new wxChoice( m_trapProps, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_trapAxisCtrlNChoices, m_trapAxisCtrlChoices, 0 ); m_trapAxisCtrl->SetSelection( 0 ); - fgSizerTrapProps->Add( m_trapAxisCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5 ); + fgSizerTrapProps->Add( m_trapAxisCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - m_pageTrap->SetSizer( fgSizerTrapProps ); - m_pageTrap->Layout(); - fgSizerTrapProps->Fit( m_pageTrap ); - m_shapePropsBook->AddPage( m_pageTrap, _("a page"), false ); - m_pageRounding = new wxPanel( m_shapePropsBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - fgSizerRoundingProps = new wxFlexGridSizer( 0, 3, 0, 0 ); + m_trapProps->SetSizer( fgSizerTrapProps ); + m_trapProps->Layout(); + fgSizerTrapProps->Fit( m_trapProps ); + m_shapePropsBook->AddPage( m_trapProps, _("a page"), false ); + m_roudingProps = new wxPanel( m_shapePropsBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + fgSizerRoundingProps = new wxFlexGridSizer( 0, 3, 4, 0 ); fgSizerRoundingProps->AddGrowableCol( 1 ); fgSizerRoundingProps->SetFlexibleDirection( wxBOTH ); fgSizerRoundingProps->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_staticTextCornerSizeRatio = new wxStaticText( m_pageRounding, wxID_ANY, _("Corner size:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextCornerSizeRatio = new wxStaticText( m_roudingProps, wxID_ANY, _("Corner size:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextCornerSizeRatio->Wrap( -1 ); m_staticTextCornerSizeRatio->SetToolTip( _("Corner radius in percent of the pad width.\nThe width is the smaller value between size X and size Y.\nThe max value is 50 percent.") ); - fgSizerRoundingProps->Add( m_staticTextCornerSizeRatio, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 ); + fgSizerRoundingProps->Add( m_staticTextCornerSizeRatio, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - m_tcCornerSizeRatio = new TEXT_CTRL_EVAL( m_pageRounding, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizerRoundingProps->Add( m_tcCornerSizeRatio, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5 ); + m_tcCornerSizeRatio = new TEXT_CTRL_EVAL( m_roudingProps, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerRoundingProps->Add( m_tcCornerSizeRatio, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - m_staticTextCornerSizeRatioUnit = new wxStaticText( m_pageRounding, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextCornerSizeRatioUnit = new wxStaticText( m_roudingProps, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextCornerSizeRatioUnit->Wrap( -1 ); - fgSizerRoundingProps->Add( m_staticTextCornerSizeRatioUnit, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 ); + fgSizerRoundingProps->Add( m_staticTextCornerSizeRatioUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - m_cornerRadiusLabel = new wxStaticText( m_pageRounding, wxID_ANY, _("Corner radius:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cornerRadiusLabel = new wxStaticText( m_roudingProps, wxID_ANY, _("Corner radius:"), wxDefaultPosition, wxDefaultSize, 0 ); m_cornerRadiusLabel->Wrap( -1 ); m_cornerRadiusLabel->SetToolTip( _("Corner radius.\nCan be no more than half pad width.\nThe width is the smaller value between size X and size Y.\nNote: IPC norm gives a max value = 0.25mm.") ); - fgSizerRoundingProps->Add( m_cornerRadiusLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 ); + fgSizerRoundingProps->Add( m_cornerRadiusLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - m_tcCornerRadius = new wxTextCtrl( m_pageRounding, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizerRoundingProps->Add( m_tcCornerRadius, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5 ); + m_tcCornerRadius = new wxTextCtrl( m_roudingProps, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerRoundingProps->Add( m_tcCornerRadius, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - m_cornerRadiusUnits = new wxStaticText( m_pageRounding, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cornerRadiusUnits = new wxStaticText( m_roudingProps, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_cornerRadiusUnits->Wrap( -1 ); - fgSizerRoundingProps->Add( m_cornerRadiusUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 ); + fgSizerRoundingProps->Add( m_cornerRadiusUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - m_pageRounding->SetSizer( fgSizerRoundingProps ); - m_pageRounding->Layout(); - fgSizerRoundingProps->Fit( m_pageRounding ); - m_shapePropsBook->AddPage( m_pageRounding, _("a page"), false ); - m_pageChamfer = new wxPanel( m_shapePropsBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_roudingProps->SetSizer( fgSizerRoundingProps ); + m_roudingProps->Layout(); + fgSizerRoundingProps->Fit( m_roudingProps ); + m_shapePropsBook->AddPage( m_roudingProps, _("a page"), false ); + m_chamferProps = new wxPanel( m_shapePropsBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxFlexGridSizer* fgSizerChamferProps; - fgSizerChamferProps = new wxFlexGridSizer( 0, 3, 0, 0 ); + fgSizerChamferProps = new wxFlexGridSizer( 0, 3, 4, 0 ); fgSizerChamferProps->AddGrowableCol( 1 ); fgSizerChamferProps->SetFlexibleDirection( wxBOTH ); fgSizerChamferProps->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_staticTextChamferRatio = new wxStaticText( m_pageChamfer, wxID_ANY, _("Chamfer size:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextChamferRatio = new wxStaticText( m_chamferProps, wxID_ANY, _("Chamfer size:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextChamferRatio->Wrap( -1 ); m_staticTextChamferRatio->SetToolTip( _("Chamfer size in percent of the pad width.\nThe width is the smaller value between size X and size Y.\nThe max value is 50 percent.") ); - fgSizerChamferProps->Add( m_staticTextChamferRatio, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + fgSizerChamferProps->Add( m_staticTextChamferRatio, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - m_tcChamferRatio = new TEXT_CTRL_EVAL( m_pageChamfer, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizerChamferProps->Add( m_tcChamferRatio, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); + m_tcChamferRatio = new TEXT_CTRL_EVAL( m_chamferProps, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerChamferProps->Add( m_tcChamferRatio, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - m_staticTextChamferRatioUnit = new wxStaticText( m_pageChamfer, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextChamferRatioUnit = new wxStaticText( m_chamferProps, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextChamferRatioUnit->Wrap( -1 ); - fgSizerChamferProps->Add( m_staticTextChamferRatioUnit, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + fgSizerChamferProps->Add( m_staticTextChamferRatioUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - m_staticTextChamferCorner = new wxStaticText( m_pageChamfer, wxID_ANY, _("Chamfer corners:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextChamferCorner = new wxStaticText( m_chamferProps, wxID_ANY, _("Chamfer corners:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextChamferCorner->Wrap( -1 ); m_staticTextChamferCorner->SetToolTip( _("Chamfered corners. The position is relative to a pad orientation 0 degree.") ); - fgSizerChamferProps->Add( m_staticTextChamferCorner, 0, wxTOP, 5 ); + fgSizerChamferProps->Add( m_staticTextChamferCorner, 0, 0, 5 ); wxGridSizer* gCornersSizer; - gCornersSizer = new wxGridSizer( 0, 2, 3, 6 ); + gCornersSizer = new wxGridSizer( 0, 2, 2, 6 ); - m_cbTopLeft = new wxCheckBox( m_pageChamfer, wxID_ANY, _("Top left"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbTopLeft = new wxCheckBox( m_chamferProps, wxID_ANY, _("Top left"), wxDefaultPosition, wxDefaultSize, 0 ); m_cbTopLeft->SetValue(true); gCornersSizer->Add( m_cbTopLeft, 0, 0, 5 ); - m_cbTopRight = new wxCheckBox( m_pageChamfer, wxID_ANY, _("Top right"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbTopRight = new wxCheckBox( m_chamferProps, wxID_ANY, _("Top right"), wxDefaultPosition, wxDefaultSize, 0 ); gCornersSizer->Add( m_cbTopRight, 0, 0, 5 ); - m_cbBottomLeft = new wxCheckBox( m_pageChamfer, wxID_ANY, _("Bottom left"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbBottomLeft = new wxCheckBox( m_chamferProps, wxID_ANY, _("Bottom left"), wxDefaultPosition, wxDefaultSize, 0 ); gCornersSizer->Add( m_cbBottomLeft, 0, 0, 5 ); - m_cbBottomRight = new wxCheckBox( m_pageChamfer, wxID_ANY, _("Bottom right"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbBottomRight = new wxCheckBox( m_chamferProps, wxID_ANY, _("Bottom right"), wxDefaultPosition, wxDefaultSize, 0 ); gCornersSizer->Add( m_cbBottomRight, 0, 0, 5 ); - fgSizerChamferProps->Add( gCornersSizer, 1, wxEXPAND|wxALL, 5 ); + fgSizerChamferProps->Add( gCornersSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - m_pageChamfer->SetSizer( fgSizerChamferProps ); - m_pageChamfer->Layout(); - fgSizerChamferProps->Fit( m_pageChamfer ); - m_shapePropsBook->AddPage( m_pageChamfer, _("a page"), false ); + m_chamferProps->SetSizer( fgSizerChamferProps ); + m_chamferProps->Layout(); + fgSizerChamferProps->Fit( m_chamferProps ); + m_shapePropsBook->AddPage( m_chamferProps, _("a page"), false ); + m_mixedProps = new wxPanel( m_shapePropsBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxFlexGridSizer* fgMixedProps; + fgMixedProps = new wxFlexGridSizer( 0, 3, 4, 0 ); + fgMixedProps->AddGrowableCol( 1 ); + fgMixedProps->SetFlexibleDirection( wxBOTH ); + fgMixedProps->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticTextChamferRatio1 = new wxStaticText( m_mixedProps, wxID_ANY, _("Chamfer size:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextChamferRatio1->Wrap( -1 ); + m_staticTextChamferRatio1->SetToolTip( _("Chamfer size in percent of the pad width.\nThe width is the smaller value between size X and size Y.\nThe max value is 50 percent.") ); + + fgMixedProps->Add( m_staticTextChamferRatio1, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_tcChamferRatio1 = new TEXT_CTRL_EVAL( m_mixedProps, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgMixedProps->Add( m_tcChamferRatio1, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + m_staticTextChamferRatioUnit1 = new wxStaticText( m_mixedProps, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextChamferRatioUnit1->Wrap( -1 ); + fgMixedProps->Add( m_staticTextChamferRatioUnit1, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_staticTextChamferCorner1 = new wxStaticText( m_mixedProps, wxID_ANY, _("Chamfer corners:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextChamferCorner1->Wrap( -1 ); + m_staticTextChamferCorner1->SetToolTip( _("Chamfered corners. The position is relative to a pad orientation 0 degree.") ); + + fgMixedProps->Add( m_staticTextChamferCorner1, 0, 0, 5 ); + + wxGridSizer* gCornersSizer1; + gCornersSizer1 = new wxGridSizer( 0, 2, 2, 6 ); + + m_cbTopLeft1 = new wxCheckBox( m_mixedProps, wxID_ANY, _("Top left"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbTopLeft1->SetValue(true); + gCornersSizer1->Add( m_cbTopLeft1, 0, 0, 5 ); + + m_cbTopRight1 = new wxCheckBox( m_mixedProps, wxID_ANY, _("Top right"), wxDefaultPosition, wxDefaultSize, 0 ); + gCornersSizer1->Add( m_cbTopRight1, 0, 0, 5 ); + + m_cbBottomLeft1 = new wxCheckBox( m_mixedProps, wxID_ANY, _("Bottom left"), wxDefaultPosition, wxDefaultSize, 0 ); + gCornersSizer1->Add( m_cbBottomLeft1, 0, 0, 5 ); + + m_cbBottomRight1 = new wxCheckBox( m_mixedProps, wxID_ANY, _("Bottom right"), wxDefaultPosition, wxDefaultSize, 0 ); + gCornersSizer1->Add( m_cbBottomRight1, 0, 0, 5 ); + + + fgMixedProps->Add( gCornersSizer1, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + + fgMixedProps->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticTextCornerSizeRatio1 = new wxStaticText( m_mixedProps, wxID_ANY, _("Other corners:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextCornerSizeRatio1->Wrap( -1 ); + m_staticTextCornerSizeRatio1->SetToolTip( _("Corner radius in percent of the pad width.\nThe width is the smaller value between size X and size Y.\nThe max value is 50 percent.") ); + + fgMixedProps->Add( m_staticTextCornerSizeRatio1, 0, wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_tcCornerSizeRatio1 = new TEXT_CTRL_EVAL( m_mixedProps, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgMixedProps->Add( m_tcCornerSizeRatio1, 0, wxEXPAND|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextCornerSizeRatioUnit1 = new wxStaticText( m_mixedProps, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextCornerSizeRatioUnit1->Wrap( -1 ); + fgMixedProps->Add( m_staticTextCornerSizeRatioUnit1, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + + + m_mixedProps->SetSizer( fgMixedProps ); + m_mixedProps->Layout(); + fgMixedProps->Fit( m_mixedProps ); + m_shapePropsBook->AddPage( m_mixedProps, _("a page"), false ); m_LeftBoxSizer->Add( m_shapePropsBook, 0, wxEXPAND|wxLEFT, 20 ); wxGridBagSizer* gbSizerPadOrientation; - gbSizerPadOrientation = new wxGridBagSizer( 0, 0 ); + gbSizerPadOrientation = new wxGridBagSizer( 3, 0 ); gbSizerPadOrientation->SetFlexibleDirection( wxBOTH ); gbSizerPadOrientation->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); m_sizeXLabel = new wxStaticText( m_panelGeneral, wxID_ANY, _("Pad size X:"), wxDefaultPosition, wxDefaultSize, 0 ); m_sizeXLabel->Wrap( -1 ); - gbSizerPadOrientation->Add( m_sizeXLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + gbSizerPadOrientation->Add( m_sizeXLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_sizeXCtrl = new wxTextCtrl( m_panelGeneral, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), 0 ); - gbSizerPadOrientation->Add( m_sizeXCtrl, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + gbSizerPadOrientation->Add( m_sizeXCtrl, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); m_sizeXUnits = new wxStaticText( m_panelGeneral, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_sizeXUnits->Wrap( -1 ); - gbSizerPadOrientation->Add( m_sizeXUnits, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + gbSizerPadOrientation->Add( m_sizeXUnits, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_sizeYLabel = new wxStaticText( m_panelGeneral, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 ); m_sizeYLabel->Wrap( -1 ); - gbSizerPadOrientation->Add( m_sizeYLabel, wxGBPosition( 0, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + gbSizerPadOrientation->Add( m_sizeYLabel, wxGBPosition( 0, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_sizeYCtrl = new wxTextCtrl( m_panelGeneral, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - gbSizerPadOrientation->Add( m_sizeYCtrl, wxGBPosition( 0, 4 ), wxGBSpan( 1, 1 ), wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + gbSizerPadOrientation->Add( m_sizeYCtrl, wxGBPosition( 0, 4 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); m_sizeYUnits = new wxStaticText( m_panelGeneral, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_sizeYUnits->Wrap( -1 ); - gbSizerPadOrientation->Add( m_sizeYUnits, wxGBPosition( 0, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + gbSizerPadOrientation->Add( m_sizeYUnits, wxGBPosition( 0, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_PadOrientText = new wxStaticText( m_panelGeneral, wxID_ANY, _("Angle:"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); m_PadOrientText->Wrap( -1 ); @@ -286,65 +346,59 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind gbSizerPadOrientation->Add( m_orientationUnits, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - m_LeftBoxSizer->Add( gbSizerPadOrientation, 0, wxEXPAND, 5 ); + m_LeftBoxSizer->Add( gbSizerPadOrientation, 0, wxEXPAND|wxTOP, 5 ); m_LeftBoxSizer->Add( 0, 0, 1, wxEXPAND, 5 ); m_staticline6 = new wxStaticLine( m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - m_LeftBoxSizer->Add( m_staticline6, 0, wxEXPAND, 5 ); - - - m_LeftBoxSizer->Add( 0, 5, 1, wxEXPAND, 5 ); + m_LeftBoxSizer->Add( m_staticline6, 0, wxEXPAND|wxBOTTOM, 5 ); wxGridBagSizer* gbSizerHole; - gbSizerHole = new wxGridBagSizer( 0, 0 ); + gbSizerHole = new wxGridBagSizer( 4, 0 ); gbSizerHole->SetFlexibleDirection( wxBOTH ); gbSizerHole->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); m_holeShapeLabel = new wxStaticText( m_panelGeneral, wxID_ANY, _("Hole shape:"), wxDefaultPosition, wxDefaultSize, 0 ); m_holeShapeLabel->Wrap( -1 ); - gbSizerHole->Add( m_holeShapeLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + gbSizerHole->Add( m_holeShapeLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxRIGHT|wxLEFT, 5 ); wxString m_holeShapeCtrlChoices[] = { _("Circular"), _("Oval") }; int m_holeShapeCtrlNChoices = sizeof( m_holeShapeCtrlChoices ) / sizeof( wxString ); m_holeShapeCtrl = new wxChoice( m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_holeShapeCtrlNChoices, m_holeShapeCtrlChoices, 0 ); m_holeShapeCtrl->SetSelection( 0 ); - gbSizerHole->Add( m_holeShapeCtrl, wxGBPosition( 0, 1 ), wxGBSpan( 1, 5 ), wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + gbSizerHole->Add( m_holeShapeCtrl, wxGBPosition( 0, 1 ), wxGBSpan( 1, 5 ), wxEXPAND|wxRIGHT, 5 ); m_holeXLabel = new wxStaticText( m_panelGeneral, wxID_ANY, _("Hole size X:"), wxDefaultPosition, wxDefaultSize, 0 ); m_holeXLabel->Wrap( -1 ); - gbSizerHole->Add( m_holeXLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); + gbSizerHole->Add( m_holeXLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_holeXCtrl = new wxTextCtrl( m_panelGeneral, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); gbSizerHole->Add( m_holeXCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_holeXUnits = new wxStaticText( m_panelGeneral, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_holeXUnits->Wrap( -1 ); - gbSizerHole->Add( m_holeXUnits, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + gbSizerHole->Add( m_holeXUnits, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_holeYLabel = new wxStaticText( m_panelGeneral, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 ); m_holeYLabel->Wrap( -1 ); - gbSizerHole->Add( m_holeYLabel, wxGBPosition( 1, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + gbSizerHole->Add( m_holeYLabel, wxGBPosition( 1, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_holeYCtrl = new wxTextCtrl( m_panelGeneral, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); gbSizerHole->Add( m_holeYCtrl, wxGBPosition( 1, 4 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_holeYUnits = new wxStaticText( m_panelGeneral, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_holeYUnits->Wrap( -1 ); - gbSizerHole->Add( m_holeYUnits, wxGBPosition( 1, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + gbSizerHole->Add( m_holeYUnits, wxGBPosition( 1, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - m_LeftBoxSizer->Add( gbSizerHole, 0, wxEXPAND, 5 ); + m_LeftBoxSizer->Add( gbSizerHole, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); m_LeftBoxSizer->Add( 0, 0, 1, wxEXPAND, 5 ); m_staticline7 = new wxStaticLine( m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - m_LeftBoxSizer->Add( m_staticline7, 0, wxEXPAND, 5 ); - - - m_LeftBoxSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + m_LeftBoxSizer->Add( m_staticline7, 0, wxEXPAND|wxBOTTOM, 5 ); wxBoxSizer* bSizer35; bSizer35 = new wxBoxSizer( wxHORIZONTAL ); @@ -357,10 +411,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind bSizer35->Add( m_offsetShapeOptLabel, 0, wxRIGHT, 5 ); - m_LeftBoxSizer->Add( bSizer35, 0, wxEXPAND, 5 ); - - - m_LeftBoxSizer->Add( 0, 3, 0, wxEXPAND, 5 ); + m_LeftBoxSizer->Add( bSizer35, 0, wxEXPAND|wxTOP, 5 ); m_offsetCtrls = new wxFlexGridSizer( 0, 6, 0, 0 ); m_offsetCtrls->AddGrowableCol( 1 ); @@ -423,6 +474,9 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_LeftBoxSizer->Add( fgSizerPadToDie, 0, wxEXPAND, 5 ); + m_LeftBoxSizer->Add( 0, 3, 1, wxEXPAND, 5 ); + + bGeneralSizer->Add( m_LeftBoxSizer, 0, wxEXPAND|wxALL, 5 ); m_middleBoxSizer = new wxBoxSizer( wxVERTICAL ); @@ -867,6 +921,12 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_cbTopRight->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_cbBottomLeft->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_cbBottomRight->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); + m_tcChamferRatio1->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerSizePercentChange ), NULL, this ); + m_cbTopLeft1->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); + m_cbTopRight1->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); + m_cbBottomLeft1->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); + m_cbBottomRight1->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); + m_tcCornerSizeRatio1->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerSizePercentChange ), NULL, this ); m_sizeXCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_sizeYCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_orientation->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::PadOrientEvent ), NULL, this ); @@ -921,6 +981,12 @@ DIALOG_PAD_PROPERTIES_BASE::~DIALOG_PAD_PROPERTIES_BASE() m_cbTopRight->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_cbBottomLeft->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_cbBottomRight->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); + m_tcChamferRatio1->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerSizePercentChange ), NULL, this ); + m_cbTopLeft1->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); + m_cbTopRight1->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); + m_cbBottomLeft1->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); + m_cbBottomRight1->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); + m_tcCornerSizeRatio1->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerSizePercentChange ), NULL, this ); m_sizeXCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_sizeYCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_orientation->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::PadOrientEvent ), NULL, this ); diff --git a/pcbnew/dialogs/dialog_pad_properties_base.fbp b/pcbnew/dialogs/dialog_pad_properties_base.fbp index 7ab6ec4829..b6522fa82a 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.fbp +++ b/pcbnew/dialogs/dialog_pad_properties_base.fbp @@ -209,12 +209,12 @@ gbSizerCommon wxFLEX_GROWMODE_SPECIFIED none - 0 + 4 5 1 0 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -278,7 +278,7 @@ 5 5 1 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT 0 1 @@ -346,7 +346,7 @@ 5 1 0 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 1 1 @@ -410,7 +410,7 @@ 5 5 1 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT 1 1 @@ -478,7 +478,7 @@ 5 1 0 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 2 1 @@ -542,7 +542,7 @@ 5 5 1 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxEXPAND + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT 2 1 @@ -607,7 +607,7 @@ 5 1 0 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 3 1 @@ -671,7 +671,7 @@ 5 1 1 - wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP + wxALIGN_CENTER_VERTICAL|wxEXPAND 3 1 @@ -738,7 +738,7 @@ 5 1 2 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 3 1 @@ -802,7 +802,7 @@ 5 1 3 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 3 1 @@ -866,7 +866,7 @@ 5 1 4 - wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP + wxALIGN_CENTER_VERTICAL|wxEXPAND 3 1 @@ -933,7 +933,7 @@ 5 1 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 3 1 @@ -1065,8 +1065,8 @@ 5 - wxEXPAND - 1 + wxEXPAND|wxBOTTOM + 0 0 protected @@ -1144,7 +1144,7 @@ - 3 + 5 wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT 1 @@ -1161,7 +1161,7 @@ 1 0 - "Circular" "Oval" "Rectangular" "Trapezoidal" "Rounded Rectangle" "Chamfered Rectangle" "Custom (Circ. Anchor)" "Custom (Rect. Anchor)" + "Circular" "Oval" "Rectangular" "Trapezoidal" "Rounded rectangle" "Chamfered rectangle" "Chamfered with other corners rounded" "Custom (circular base)" "Custom (rectangular base)" 1 1 @@ -1210,17 +1210,6 @@ - - 25 - wxEXPAND|wxLEFT - 0 - - - bSizerShapeProps - wxVERTICAL - none - - 20 wxEXPAND|wxLEFT @@ -1314,7 +1303,7 @@ 0 1 - m_pageSimple + m_emptyProps 1 @@ -1370,7 +1359,7 @@ 0 1 - m_pageTrap + m_trapProps 1 @@ -1397,10 +1386,10 @@ wxFLEX_GROWMODE_SPECIFIED protected 0 - 0 + 4 5 - wxALIGN_CENTER_VERTICAL|wxTOP + wxALIGN_CENTER_VERTICAL 0 1 @@ -1461,7 +1450,7 @@ 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT 0 1 @@ -1526,7 +1515,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -1587,7 +1576,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxTOP + wxALIGN_CENTER_VERTICAL 0 1 @@ -1648,7 +1637,7 @@ 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT 0 1 @@ -1752,7 +1741,7 @@ 0 1 - m_pageRounding + m_roudingProps 1 @@ -1779,10 +1768,10 @@ wxFLEX_GROWMODE_SPECIFIED protected 0 - 0 + 4 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -1843,7 +1832,7 @@ 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT 0 1 @@ -1908,7 +1897,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -1969,7 +1958,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -2030,7 +2019,7 @@ 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT 0 1 @@ -2095,7 +2084,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -2193,9 +2182,9 @@ 0 - -1,-1 + 1 - m_pageChamfer + m_chamferProps 1 @@ -2211,7 +2200,7 @@ wxTAB_TRAVERSAL - + 3 wxBOTH 1 @@ -2222,10 +2211,10 @@ wxFLEX_GROWMODE_SPECIFIED none 0 - 0 + 4 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -2286,7 +2275,7 @@ 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT 1 1 @@ -2351,7 +2340,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -2412,7 +2401,7 @@ 5 - wxTOP + 0 1 @@ -2473,7 +2462,7 @@ 5 - wxEXPAND|wxALL + wxEXPAND|wxRIGHT|wxLEFT 1 2 @@ -2482,7 +2471,7 @@ gCornersSizer none 0 - 3 + 2 5 @@ -2748,13 +2737,801 @@ + + a page + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_mixedProps + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + wxTAB_TRAVERSAL + + 3 + wxBOTH + 1 + + 0 + + fgMixedProps + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 4 + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Chamfer size: + 0 + + 0 + + + 0 + + 1 + m_staticTextChamferRatio1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Chamfer size in percent of the pad width. The width is the smaller value between size X and size Y. The max value is 50 percent. + + + + -1 + + + + 5 + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_tcChamferRatio1 + 1 + + + protected + 1 + + Resizable + 1 + + + TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + onCornerSizePercentChange + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + % + 0 + + 0 + + + 0 + + 1 + m_staticTextChamferRatioUnit1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Chamfer corners: + 0 + + 0 + + + 0 + + 1 + m_staticTextChamferCorner1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Chamfered corners. The position is relative to a pad orientation 0 degree. + + + + -1 + + + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 1 + + 2 + 6 + + gCornersSizer1 + none + 0 + 2 + + 5 + + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Top left + + 0 + + + 0 + + 1 + m_cbTopLeft1 + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnValuesChanged + + + + 5 + + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Top right + + 0 + + + 0 + + 1 + m_cbTopRight1 + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnValuesChanged + + + + 5 + + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Bottom left + + 0 + + + 0 + + 1 + m_cbBottomLeft1 + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnValuesChanged + + + + 5 + + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Bottom right + + 0 + + + 0 + + 1 + m_cbBottomRight1 + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnValuesChanged + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Other corners: + 0 + + 0 + + + 0 + + 1 + m_staticTextCornerSizeRatio1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Corner radius in percent of the pad width. The width is the smaller value between size X and size Y. The max value is 50 percent. + + + + -1 + + + + 5 + wxEXPAND|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_tcCornerSizeRatio1 + 1 + + + protected + 1 + + Resizable + 1 + + + TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + onCornerSizePercentChange + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + % + 0 + + 0 + + + 0 + + 1 + m_staticTextCornerSizeRatioUnit1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + 5 - wxEXPAND + wxEXPAND|wxTOP 0 - + wxBOTH @@ -2764,12 +3541,12 @@ gbSizerPadOrientation wxFLEX_GROWMODE_SPECIFIED none - 0 - + 3 + 5 1 0 - wxALL|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -2829,11 +3606,11 @@ -1 - + 5 1 1 - wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL|wxEXPAND + wxALIGN_CENTER_VERTICAL|wxEXPAND 0 1 @@ -2897,11 +3674,11 @@ OnValuesChanged - + 5 1 2 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -2961,11 +3738,11 @@ -1 - + 5 1 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -3025,11 +3802,11 @@ -1 - + 5 1 4 - wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL|wxEXPAND + wxALIGN_CENTER_VERTICAL|wxEXPAND 0 1 @@ -3093,11 +3870,11 @@ OnValuesChanged - + 5 1 5 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -3157,7 +3934,7 @@ -1 - + 5 1 0 @@ -3221,7 +3998,7 @@ -1 - + 5 1 1 @@ -3291,7 +4068,7 @@ PadOrientEvent - + 5 1 2 @@ -3369,7 +4146,7 @@ 5 - wxEXPAND + wxEXPAND|wxBOTTOM 0 1 @@ -3427,19 +4204,9 @@ 5 - wxEXPAND - 1 - - 5 - protected - 0 - - - - 5 - wxEXPAND + wxEXPAND|wxTOP|wxBOTTOM 0 - + wxBOTH @@ -3449,12 +4216,12 @@ gbSizerHole wxFLEX_GROWMODE_SPECIFIED none - 0 - + 4 + 5 1 0 - wxALL + wxRIGHT|wxLEFT 0 1 @@ -3514,11 +4281,11 @@ -1 - + 5 5 1 - wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT + wxEXPAND|wxRIGHT 0 1 @@ -3582,11 +4349,11 @@ OnDrillShapeSelected - + 5 1 0 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT + wxALIGN_CENTER_VERTICAL|wxLEFT 1 1 @@ -3646,7 +4413,7 @@ -1 - + 5 1 1 @@ -3714,11 +4481,11 @@ OnValuesChanged - + 5 1 2 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 1 1 @@ -3778,11 +4545,11 @@ -1 - + 5 1 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 1 1 @@ -3842,7 +4609,7 @@ -1 - + 5 1 4 @@ -3910,11 +4677,11 @@ OnValuesChanged - + 5 1 5 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 1 1 @@ -3988,7 +4755,7 @@ 5 - wxEXPAND + wxEXPAND|wxBOTTOM 0 1 @@ -4046,17 +4813,7 @@ 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxEXPAND + wxEXPAND|wxTOP 0 @@ -4191,16 +4948,6 @@ - - 5 - wxEXPAND - 0 - - 3 - protected - 0 - - 25 wxEXPAND|wxLEFT @@ -4597,7 +5344,7 @@ 5 wxEXPAND 0 - + 3 wxBOTH 1 @@ -4609,20 +5356,20 @@ none 14 0 - + 5 wxEXPAND|wxRIGHT 0 - + bSizer34 wxHORIZONTAL none - + 5 wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT 0 - + 1 1 1 @@ -4683,11 +5430,11 @@ OnPadToDieCheckbox - + 5 wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT 0 - + 1 1 1 @@ -4873,6 +5620,16 @@ + + 5 + wxEXPAND + 1 + + 3 + protected + 0 + + diff --git a/pcbnew/dialogs/dialog_pad_properties_base.h b/pcbnew/dialogs/dialog_pad_properties_base.h index 790c9c04f7..180f514887 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.h +++ b/pcbnew/dialogs/dialog_pad_properties_base.h @@ -79,15 +79,15 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM wxStaticText* m_shapeLabel; wxChoice* m_PadShape; wxSimplebook* m_shapePropsBook; - wxPanel* m_pageSimple; - wxPanel* m_pageTrap; + wxPanel* m_emptyProps; + wxPanel* m_trapProps; wxFlexGridSizer* fgSizerTrapProps; wxStaticText* m_trapDeltaLabel; wxTextCtrl* m_trapDeltaCtrl; wxStaticText* m_trapDeltaUnits; wxStaticText* m_trapAxisLabel; wxChoice* m_trapAxisCtrl; - wxPanel* m_pageRounding; + wxPanel* m_roudingProps; wxFlexGridSizer* fgSizerRoundingProps; wxStaticText* m_staticTextCornerSizeRatio; TEXT_CTRL_EVAL* m_tcCornerSizeRatio; @@ -95,7 +95,7 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM wxStaticText* m_cornerRadiusLabel; wxTextCtrl* m_tcCornerRadius; wxStaticText* m_cornerRadiusUnits; - wxPanel* m_pageChamfer; + wxPanel* m_chamferProps; wxStaticText* m_staticTextChamferRatio; TEXT_CTRL_EVAL* m_tcChamferRatio; wxStaticText* m_staticTextChamferRatioUnit; @@ -104,6 +104,18 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM wxCheckBox* m_cbTopRight; wxCheckBox* m_cbBottomLeft; wxCheckBox* m_cbBottomRight; + wxPanel* m_mixedProps; + wxStaticText* m_staticTextChamferRatio1; + TEXT_CTRL_EVAL* m_tcChamferRatio1; + wxStaticText* m_staticTextChamferRatioUnit1; + wxStaticText* m_staticTextChamferCorner1; + wxCheckBox* m_cbTopLeft1; + wxCheckBox* m_cbTopRight1; + wxCheckBox* m_cbBottomLeft1; + wxCheckBox* m_cbBottomRight1; + wxStaticText* m_staticTextCornerSizeRatio1; + TEXT_CTRL_EVAL* m_tcCornerSizeRatio1; + wxStaticText* m_staticTextCornerSizeRatioUnit1; wxStaticText* m_sizeXLabel; wxTextCtrl* m_sizeXCtrl; wxStaticText* m_sizeXUnits;