From 077fff6f5fd08a658c1fbad69830fe7b21a9486e Mon Sep 17 00:00:00 2001 From: charras Date: Thu, 5 Nov 2009 20:59:42 +0000 Subject: [PATCH] Pcbnew: control of masks clearance: Pad Editor Dialog rewritten to handle local mask clearances and a local Net clearance --- CHANGELOG.txt | 6 + kicad/mainframe.cpp | 13 +- pcbnew/class_board_connected_item.cpp | 6 - pcbnew/class_pad.cpp | 33 + pcbnew/class_pad.h | 13 +- pcbnew/dialog_pad_properties.cpp | 213 +- pcbnew/dialog_pad_properties_base.cpp | 296 +- pcbnew/dialog_pad_properties_base.fbp | 5188 +++++++++++++++++++------ pcbnew/dialog_pad_properties_base.h | 78 +- 9 files changed, 4437 insertions(+), 1409 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 91e7f1b095..c2fde8dab2 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,12 @@ Please add newer entries at the top, list the date and your name with email address. +2009-Nov-05 UPDATE Jean-Pierre Charras +================================================================================ +++pcbnew + control of masks clearance: Pad Editor Dialog rewritten to handle mask clearances + and a locad Net clearance + 2009-Nov-5 UPDATE Dick Hollenbeck ================================================================================ ++all diff --git a/kicad/mainframe.cpp b/kicad/mainframe.cpp index 8428128762..c5c3aa3386 100644 --- a/kicad/mainframe.cpp +++ b/kicad/mainframe.cpp @@ -126,12 +126,12 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent, m_auimgr.AddPane(m_HToolBar, wxAuiPaneInfo(horiz).Name(wxT("m_HToolBar")).Top()); - m_auimgr.AddPane(m_DialogWin, - wxAuiPaneInfo(horiz).Name(wxT("m_DialogWin")).Center()); - m_auimgr.AddPane(m_CommandWin, wxAuiPaneInfo().Name(wxT("m_CommandWin")).CentrePane()); + m_auimgr.AddPane(m_DialogWin, + wxAuiPaneInfo(horiz).Name(wxT("m_DialogWin")).CentrePane()); + m_auimgr.AddPane(m_LeftWin, wxAuiPaneInfo(horiz).Name(wxT("m_LeftWin")).Left().BestSize(clientsize.x/3,clientsize.y)); m_auimgr.Update(); @@ -215,6 +215,10 @@ void WinEDA_MainFrame::OnSashDrag( wxSashEvent& event ) void WinEDA_MainFrame::OnSize( wxSizeEvent& event ) /************************************************/ { +#if defined(KICAD_AUIMANAGER) + if(m_auimgr.GetManagedWindow()) + m_auimgr.Update(); +#else if( m_CommandWin && m_BottomWin ) { int w, h, dy; @@ -236,9 +240,6 @@ void WinEDA_MainFrame::OnSize( wxSizeEvent& event ) layout.LayoutFrame( this ); if( m_CommandWin ) m_CommandWin->Refresh( TRUE ); -#if defined(KICAD_AUIMANAGER) - if(m_auimgr.GetManagedWindow()) - m_auimgr.Update(); #endif event.Skip(); } diff --git a/pcbnew/class_board_connected_item.cpp b/pcbnew/class_board_connected_item.cpp index 06a7aed849..0fc73f42cc 100644 --- a/pcbnew/class_board_connected_item.cpp +++ b/pcbnew/class_board_connected_item.cpp @@ -141,12 +141,6 @@ NETCLASS* BOARD_CONNECTED_ITEM::GetNetClass() const wxLogWarning(wxT("BOARD_CONNECTED_ITEM::GetNetClass(): NULL netclass") ); #endif } - else - { -#ifdef __WXDEBUG__ - wxLogWarning(wxT("BOARD_CONNECTED_ITEM::GetNetClass(): NULL net") ); -#endif - } if( netclass ) return netclass; diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index 725baed273..80e2f147db 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -203,6 +203,7 @@ void D_PAD::Copy( D_PAD* source ) m_PadShape = source->m_PadShape; // forme CERCLE, PAD_RECT PAD_OVAL PAD_TRAPEZOID ou libre m_Attribut = source->m_Attribut; // NORMAL, PAD_SMD, PAD_CONN, Bit 7 = STACK m_Orient = source->m_Orient; // en 1/10 degres + m_LocalClearance = source->m_LocalClearance; m_LocalSolderMaskMargin = source->m_LocalSolderMaskMargin; m_LocalSolderPasteMargin = source->m_LocalSolderPasteMargin; m_LocalSolderPasteMarginRatio = source->m_LocalSolderPasteMarginRatio; @@ -213,6 +214,38 @@ void D_PAD::Copy( D_PAD* source ) m_ShortNetname = source->m_ShortNetname; } +/** Virtual function GetClearance + * returns the clearance in 1/10000 inches. If \a aItem is not NULL then the + * returned clearance is the greater of this object's NETCLASS clearance and + * aItem's NETCLASS clearance. If \a aItem is NULL, then this objects clearance + * is returned. + * @param aItem is another BOARD_CONNECTED_ITEM or NULL + * @return int - the clearance in 1/10000 inches. +*/ +int D_PAD::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const +{ + int clearance = m_LocalClearance; + if ( clearance == 0 ) + { + if( GetParent() && ((MODULE*)GetParent())->m_LocalClearance ) + clearance = ((MODULE*)GetParent())->m_LocalClearance; + } + + if( clearance == 0 ) + return BOARD_CONNECTED_ITEM::GetClearance( aItem ); + + if( aItem ) + { + NETCLASS* hisclass = aItem->GetNetClass(); + if( hisclass ) + { + int hisClearance = hisclass->GetClearance(); + return max( hisClearance, clearance ); + } + } + + return clearance; +} // Mask margins handling: diff --git a/pcbnew/class_pad.h b/pcbnew/class_pad.h index 78808b8f0e..e0200c4a34 100644 --- a/pcbnew/class_pad.h +++ b/pcbnew/class_pad.h @@ -143,7 +143,18 @@ public: } - // Mask margins handling: + /** + * Function GetClearance + * returns the clearance in 1/10000 inches. If \a aItem is not NULL then the + * returned clearance is the greater of this object's NETCLASS clearance and + * aItem's NETCLASS clearance. If \a aItem is NULL, then this objects clearance + * is returned. + * @param aItem is another BOARD_CONNECTED_ITEM or NULL + * @return int - the clearance in 1/10000 inches. + */ + virtual int GetClearance( BOARD_CONNECTED_ITEM* aItem = NULL ) const; + + // Mask margins handling: /** Function GetSolderMaskMargin * @return the margin for the solder mask layer diff --git a/pcbnew/dialog_pad_properties.cpp b/pcbnew/dialog_pad_properties.cpp index aa56c2976e..9a72a542dd 100644 --- a/pcbnew/dialog_pad_properties.cpp +++ b/pcbnew/dialog_pad_properties.cpp @@ -48,25 +48,19 @@ static long Std_Pad_Layers[NBTYPES] = /********************************************************************/ -/* class DialogPadProperties, derived from DialogPadPropertiesBase, */ +/* class DIALOG_PAD_PROPERTIES, derived from DIALOG_PAD_PROPERTIES_BASE, */ /* created by wxFormBuilder */ /********************************************************************/ -class DialogPadProperties : public DialogPadPropertiesBase +class DIALOG_PAD_PROPERTIES : public DIALOG_PAD_PROPERTIES_BASE { public: WinEDA_BasePcbFrame* m_Parent; wxDC* m_DC; D_PAD* m_CurrentPad; - WinEDA_SizeCtrl* m_PadSizeCtrl; - WinEDA_PositionCtrl* m_PadPositionCtrl; - WinEDA_SizeCtrl* m_PadDeltaSizeCtrl; - WinEDA_SizeCtrl* m_PadOffsetCtrl; - WinEDA_SizeCtrl* m_PadDrillCtrl; - public: - DialogPadProperties( WinEDA_BasePcbFrame* parent, D_PAD* Pad, wxDC* DC ); - void Init( ); + DIALOG_PAD_PROPERTIES( WinEDA_BasePcbFrame* parent, D_PAD* Pad, wxDC* DC ); + void InitDialog( ); void OnPadShapeSelection( wxCommandEvent& event ); void OnDrillShapeSelected( wxCommandEvent& event ); void PadOrientEvent( wxCommandEvent& event ); @@ -78,8 +72,8 @@ public: /*******************************************************************************************/ -DialogPadProperties::DialogPadProperties( WinEDA_BasePcbFrame* parent, D_PAD* Pad, wxDC* DC ) : - DialogPadPropertiesBase( parent ) +DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( WinEDA_BasePcbFrame* parent, D_PAD* Pad, wxDC* DC ) : + DIALOG_PAD_PROPERTIES_BASE( parent ) /*******************************************************************************************/ { m_Parent = parent; @@ -92,7 +86,7 @@ DialogPadProperties::DialogPadProperties( WinEDA_BasePcbFrame* parent, D_PAD* Pa g_Current_PadName = m_CurrentPad->ReturnStringPadName(); } - Init( ); + InitDialog( ); if( GetSizer() ) { GetSizer()->SetSizeHints( this ); @@ -104,18 +98,18 @@ DialogPadProperties::DialogPadProperties( WinEDA_BasePcbFrame* parent, D_PAD* Pa void WinEDA_BasePcbFrame::InstallPadOptionsFrame( D_PAD* Pad, wxDC* DC, const wxPoint& pos ) /*************************************************************/ { - DialogPadProperties* frame = new DialogPadProperties( this, Pad, DC ); - - frame->ShowModal(); frame->Destroy(); + DIALOG_PAD_PROPERTIES dlg( this, Pad, DC ); + dlg.ShowModal(); } /**************************************************************/ -void DialogPadProperties::Init( ) +void DIALOG_PAD_PROPERTIES::InitDialog( ) /**************************************************************/ { int tmp; wxCommandEvent cmd_event; + int internalUnits = m_Parent->m_InternalUnits; SetFocus(); // Required under wxGTK if we want to demiss the dialog with the ESC key @@ -125,31 +119,45 @@ void DialogPadProperties::Init( ) if( pad == NULL ) pad = &g_Pad_Master; - m_PadPositionCtrl = new WinEDA_PositionCtrl( this, _( "Pad Position" ), - pad->m_Pos, - g_UnitMetric, m_PadPositionBoxSizer, - m_Parent->m_InternalUnits ); + // Display current unit name in dialog: + m_PadPosX_Unit->SetLabel( GetUnitsLabel( g_UnitMetric ) ); + m_PadPosY_Unit->SetLabel( GetUnitsLabel( g_UnitMetric ) ); + m_PadDrill_X_Unit->SetLabel( GetUnitsLabel( g_UnitMetric ) ); + m_PadDrill_Y_Unit->SetLabel( GetUnitsLabel( g_UnitMetric ) ); + m_PadShapeSizeX_Unit->SetLabel( GetUnitsLabel( g_UnitMetric ) ); + m_PadShapeSizeY_Unit->SetLabel( GetUnitsLabel( g_UnitMetric ) ); + m_PadShapeOffsetX_Unit->SetLabel( GetUnitsLabel( g_UnitMetric ) ); + m_PadShapeOffsetY_Unit->SetLabel( GetUnitsLabel( g_UnitMetric ) ); + m_PadShapeDeltaX_Unit->SetLabel( GetUnitsLabel( g_UnitMetric ) ); + m_PadShapeDeltaY_Unit->SetLabel( GetUnitsLabel( g_UnitMetric ) ); + m_NetClearanceUnits->SetLabel( GetUnitsLabel( g_UnitMetric ) ); + // Display current pad masks clearances units + m_NetClearanceUnits->SetLabel( GetUnitsLabel( g_UnitMetric ) ); + m_SolderMaskMarginUnits->SetLabel( GetUnitsLabel( g_UnitMetric ) ); + m_SolderPasteMarginUnits->SetLabel( GetUnitsLabel( g_UnitMetric ) ); - m_PadSizeCtrl = new WinEDA_SizeCtrl( this, _( "Pad Size" ), - pad->m_Size, - g_UnitMetric, m_PadPositionBoxSizer, - m_Parent->m_InternalUnits ); + // Display current pad parameters units: + PutValueInLocalUnits( *m_PadPosition_X_Ctrl, pad->m_Pos.x, internalUnits ); + PutValueInLocalUnits( *m_PadPosition_Y_Ctrl, pad->m_Pos.y, internalUnits ); - m_PadDeltaSizeCtrl = new WinEDA_SizeCtrl( this, _( "Delta" ), - pad->m_DeltaSize, - g_UnitMetric, m_PadPositionBoxSizer, - m_Parent->m_InternalUnits ); + PutValueInLocalUnits( *m_PadDrill_X_Ctrl, pad->m_Drill.x, internalUnits ); + PutValueInLocalUnits( *m_PadDrill_Y_Ctrl, pad->m_Drill.y, internalUnits ); - m_PadOffsetCtrl = new WinEDA_SizeCtrl( this, _( "Offset" ), - pad->m_Offset, - g_UnitMetric, m_PadPositionBoxSizer, - m_Parent->m_InternalUnits ); + PutValueInLocalUnits( *m_ShapeSize_X_Ctrl, pad->m_Size.x, internalUnits ); + PutValueInLocalUnits( *m_ShapeSize_Y_Ctrl, pad->m_Size.y, internalUnits ); - /* In second column */ - m_PadDrillCtrl = new WinEDA_SizeCtrl( this, _( "Pad drill" ), - pad->m_Drill, - g_UnitMetric, m_DrillShapeBoxSizer, - m_Parent->m_InternalUnits ); + PutValueInLocalUnits( *m_ShapeOffset_X_Ctrl, pad->m_Offset.x, internalUnits ); + PutValueInLocalUnits( *m_ShapeOffset_Y_Ctrl, pad->m_Offset.y, internalUnits ); + + PutValueInLocalUnits( *m_ShapeDelta_X_Ctrl, pad->m_DeltaSize.x, internalUnits ); + PutValueInLocalUnits( *m_ShapeDelta_Y_Ctrl, pad->m_DeltaSize.y, internalUnits ); + + PutValueInLocalUnits( *m_NetClearanceValueCtrl, pad->m_LocalClearance, internalUnits ); + PutValueInLocalUnits( *m_SolderMaskMarginCtrl, pad->m_LocalSolderMaskMargin, internalUnits ); + PutValueInLocalUnits( *m_SolderPasteMarginCtrl, pad->m_LocalSolderPasteMargin, internalUnits ); + wxString msg; + msg.Printf( wxT( "%.1f" ), pad->m_LocalSolderPasteMarginRatio * 100.0 ); + m_SolderPasteMarginRatioCtrl->SetValue( msg ); if( m_CurrentPad ) { @@ -158,7 +166,8 @@ void DialogPadProperties::Init( ) } else tmp = g_Pad_Master.m_Orient; - wxString msg; msg << tmp; + msg.Clear(); + msg << tmp; m_PadOrientCtrl->SetValue( msg ); @@ -167,25 +176,25 @@ void DialogPadProperties::Init( ) { case 0: m_PadOrient->SetSelection( 0 ); - m_PadOrientCtrl->Enable( FALSE ); + m_PadOrientCtrl->Enable( false ); break; case - 2700: case 900: m_PadOrient->SetSelection( 1 ); - m_PadOrientCtrl->Enable( FALSE ); + m_PadOrientCtrl->Enable( false ); break; case - 900: case 2700: m_PadOrient->SetSelection( 2 ); - m_PadOrientCtrl->Enable( FALSE ); + m_PadOrientCtrl->Enable( false ); break; case 1800: case - 1800: m_PadOrient->SetSelection( 3 ); - m_PadOrientCtrl->Enable( FALSE ); + m_PadOrientCtrl->Enable( false ); break; default: @@ -246,91 +255,98 @@ void DialogPadProperties::Init( ) /*********************************************************************/ -void DialogPadProperties::OnPadShapeSelection( wxCommandEvent& event ) +void DIALOG_PAD_PROPERTIES::OnPadShapeSelection( wxCommandEvent& event ) /*********************************************************************/ { switch( m_PadShape->GetSelection() ) { case 0: //CIRCLE: - m_PadDeltaSizeCtrl->Enable( FALSE, FALSE ); - m_PadSizeCtrl->Enable( TRUE, FALSE ); + m_ShapeDelta_X_Ctrl->Enable( false ); + m_ShapeDelta_Y_Ctrl->Enable( false ); + m_ShapeSize_Y_Ctrl->Enable( false ); break; case 1: //OVALE: - m_PadDeltaSizeCtrl->Enable( FALSE, FALSE ); - m_PadSizeCtrl->Enable( TRUE, TRUE ); + m_ShapeDelta_X_Ctrl->Enable( false ); + m_ShapeDelta_Y_Ctrl->Enable( false ); + m_ShapeSize_Y_Ctrl->Enable( true ); break; case 2: // PAD_RECT: - m_PadDeltaSizeCtrl->Enable( FALSE, FALSE ); - m_PadSizeCtrl->Enable( TRUE, TRUE ); + m_ShapeDelta_X_Ctrl->Enable( false ); + m_ShapeDelta_Y_Ctrl->Enable( false ); + m_ShapeSize_Y_Ctrl->Enable( true ); break; case 3: //TRAPEZE: - m_PadDeltaSizeCtrl->Enable( TRUE, TRUE ); - m_PadSizeCtrl->Enable( TRUE, TRUE ); + m_ShapeDelta_X_Ctrl->Enable( true ); + m_ShapeDelta_Y_Ctrl->Enable( true ); + m_ShapeSize_Y_Ctrl->Enable( true ); break; } } /**********************************************************************/ -void DialogPadProperties::OnDrillShapeSelected( wxCommandEvent& event ) +void DIALOG_PAD_PROPERTIES::OnDrillShapeSelected( wxCommandEvent& event ) /**********************************************************************/ { if ( (m_PadType->GetSelection() == 1) || (m_PadType->GetSelection() == 2) ) { // pad type = SMD or CONN: no hole allowed - m_PadDrillCtrl->Enable( FALSE, FALSE ); + m_PadDrill_X_Ctrl->Enable( false ); + m_PadDrill_Y_Ctrl->Enable( false ); return; } switch( m_DrillShapeCtrl->GetSelection() ) { case 0: //CIRCLE: - m_PadDrillCtrl->Enable( TRUE, FALSE ); + m_PadDrill_X_Ctrl->Enable( true ); + m_PadDrill_Y_Ctrl->Enable( false ); break; case 1: //OVALE: - m_PadDrillCtrl->Enable( TRUE, TRUE ); + m_PadDrill_X_Ctrl->Enable( true ); + m_PadDrill_Y_Ctrl->Enable( true ); break; } } /*******************************************************************/ -void DialogPadProperties::PadOrientEvent( wxCommandEvent& event ) +void DIALOG_PAD_PROPERTIES::PadOrientEvent( wxCommandEvent& event ) /********************************************************************/ { switch( m_PadOrient->GetSelection() ) { case 0: m_PadOrientCtrl->SetValue( wxT( "0" ) ); - m_PadOrientCtrl->Enable( FALSE ); + m_PadOrientCtrl->Enable( false ); break; case 1: m_PadOrientCtrl->SetValue( wxT( "900" ) ); - m_PadOrientCtrl->Enable( FALSE ); + m_PadOrientCtrl->Enable( false ); break; case 2: m_PadOrientCtrl->SetValue( wxT( "2700" ) ); - m_PadOrientCtrl->Enable( FALSE ); + m_PadOrientCtrl->Enable( false ); break; case 3: m_PadOrientCtrl->SetValue( wxT( "1800" ) ); - m_PadOrientCtrl->Enable( FALSE ); + m_PadOrientCtrl->Enable( false ); break; default: - m_PadOrientCtrl->Enable( TRUE ); + m_PadOrientCtrl->Enable( true ); break; } } /*****************************************************************/ -void DialogPadProperties::PadTypeSelected( wxCommandEvent& event ) +void DIALOG_PAD_PROPERTIES::PadTypeSelected( wxCommandEvent& event ) /*****************************************************************/ /* Adjust the better mask layer according to the selected pad type @@ -353,7 +369,7 @@ void DialogPadProperties::PadTypeSelected( wxCommandEvent& event ) /****************************************************************/ -void DialogPadProperties::SetPadLayersList( long layer_mask ) +void DIALOG_PAD_PROPERTIES::SetPadLayersList( long layer_mask ) /****************************************************************/ /** SetPadLayersList @@ -384,29 +400,44 @@ void DialogPadProperties::SetPadLayersList( long layer_mask ) /*************************************************************************/ -void DialogPadProperties::PadPropertiesAccept( wxCommandEvent& event ) +void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event ) /*************************************************************************/ /* Met a jour les differents parametres pour le composant en cours d'édition */ { long PadLayerMask; - bool error = FALSE; + bool error = false; bool RastnestIsChanged = false; + int internalUnits = m_Parent->m_InternalUnits; + wxString msg; if( m_DC ) m_Parent->DrawPanel->CursorOff( m_DC ); g_Pad_Master.m_Attribut = CodeType[m_PadType->GetSelection()]; g_Pad_Master.m_PadShape = CodeShape[m_PadShape->GetSelection()]; - g_Pad_Master.m_Pos = m_PadPositionCtrl->GetValue(); + + // Read pad clearances values: + g_Pad_Master.m_LocalClearance = ReturnValueFromTextCtrl( *m_NetClearanceValueCtrl, internalUnits ); + g_Pad_Master.m_LocalSolderMaskMargin = ReturnValueFromTextCtrl( *m_SolderMaskMarginCtrl, internalUnits ); + g_Pad_Master.m_LocalSolderPasteMargin = ReturnValueFromTextCtrl( *m_SolderPasteMarginCtrl, internalUnits ); + double dtmp; + msg = m_SolderPasteMarginRatioCtrl->GetValue(); + msg.ToDouble( &dtmp ); + // A margin ratio de -50% means no paste on a pad, the ratio must be >= 50 % + if( dtmp < -50 ) + dtmp = -50; + g_Pad_Master.m_LocalSolderPasteMarginRatio = dtmp / 100; + + // Read pad position: + g_Pad_Master.m_Pos.x = ReturnValueFromTextCtrl( *m_PadPosition_X_Ctrl, internalUnits ); + g_Pad_Master.m_Pos.y = ReturnValueFromTextCtrl( *m_PadPosition_Y_Ctrl, internalUnits ); g_Pad_Master.m_Pos0 = g_Pad_Master.m_Pos; - g_Pad_Master.m_Size = m_PadSizeCtrl->GetValue(); - if( g_Pad_Master.m_PadShape == PAD_CIRCLE ) - g_Pad_Master.m_Size.y = g_Pad_Master.m_Size.x; - g_Pad_Master.m_DeltaSize = m_PadDeltaSizeCtrl->GetValue(); - g_Pad_Master.m_Offset = m_PadOffsetCtrl->GetValue(); - g_Pad_Master.m_Drill = m_PadDrillCtrl->GetValue(); + + // Read pad drill: + g_Pad_Master.m_Drill.x = ReturnValueFromTextCtrl( *m_PadDrill_X_Ctrl, internalUnits ); + g_Pad_Master.m_Drill.y = ReturnValueFromTextCtrl( *m_PadDrill_Y_Ctrl, internalUnits ); if( m_DrillShapeCtrl->GetSelection() == 0 ) { g_Pad_Master.m_DrillShape = PAD_CIRCLE; @@ -414,10 +445,25 @@ void DialogPadProperties::PadPropertiesAccept( wxCommandEvent& event ) } else g_Pad_Master.m_DrillShape = PAD_OVAL; - long ovalue = 0; - wxString msg = m_PadOrientCtrl->GetValue(); - msg.ToLong( &ovalue ); - g_Pad_Master.m_Orient = ovalue; + + // Read pad shape size: + g_Pad_Master.m_Size.x = ReturnValueFromTextCtrl( *m_ShapeSize_X_Ctrl, internalUnits ); + g_Pad_Master.m_Size.y = ReturnValueFromTextCtrl( *m_ShapeSize_Y_Ctrl, internalUnits ); + if( g_Pad_Master.m_PadShape == PAD_CIRCLE ) + g_Pad_Master.m_Size.y = g_Pad_Master.m_Size.x; + + // Read pad shape delta size: + g_Pad_Master.m_DeltaSize.x = ReturnValueFromTextCtrl( *m_ShapeDelta_X_Ctrl, internalUnits ); + g_Pad_Master.m_DeltaSize.y = ReturnValueFromTextCtrl( *m_ShapeDelta_Y_Ctrl, internalUnits ); + + // Read pad shape offset: + g_Pad_Master.m_Offset.x = ReturnValueFromTextCtrl( *m_ShapeOffset_X_Ctrl, internalUnits ); + g_Pad_Master.m_Offset.y = ReturnValueFromTextCtrl( *m_ShapeOffset_Y_Ctrl, internalUnits ); + + long orient_value = 0; + msg = m_PadOrientCtrl->GetValue(); + msg.ToLong( &orient_value ); + g_Pad_Master.m_Orient = orient_value; g_Current_PadName = m_PadNumCtrl->GetValue().Left( 4 ); Current_PadNetName = m_PadNetNameCtrl->GetValue(); @@ -426,13 +472,13 @@ void DialogPadProperties::PadPropertiesAccept( wxCommandEvent& event ) if( (g_Pad_Master.m_Size.x < g_Pad_Master.m_Drill.x) || (g_Pad_Master.m_Size.y < g_Pad_Master.m_Drill.y) ) { - error = TRUE; + error = true; DisplayError( this, _( "Incorrect value for pad drill: pad drill bigger than pad size" ) ); } if( ( g_Pad_Master.m_Size.x / 2 <= ABS( g_Pad_Master.m_Offset.x ) ) || ( g_Pad_Master.m_Size.y / 2 <= ABS( g_Pad_Master.m_Offset.y ) ) ) { - error = TRUE; + error = true; DisplayError( this, _( "Incorrect value for pad offset" ) ); } @@ -475,7 +521,7 @@ void DialogPadProperties::PadPropertiesAccept( wxCommandEvent& event ) g_Pad_Master.m_Masque_Layer = PadLayerMask; - if( m_CurrentPad ) // Set Pad Name & Num + if( m_CurrentPad ) // Set current Pad parameters { MODULE* Module = (MODULE*) m_CurrentPad->GetParent(); m_Parent->SaveCopyInUndoList( Module, UR_CHANGED ); @@ -573,6 +619,11 @@ void DialogPadProperties::PadPropertiesAccept( wxCommandEvent& event ) break; } + m_CurrentPad->m_LocalClearance = g_Pad_Master.m_LocalClearance; + m_CurrentPad->m_LocalSolderMaskMargin = g_Pad_Master.m_LocalSolderMaskMargin; + m_CurrentPad->m_LocalSolderPasteMargin = g_Pad_Master.m_LocalSolderPasteMargin; + m_CurrentPad->m_LocalSolderPasteMarginRatio = g_Pad_Master.m_LocalSolderPasteMarginRatio; + m_CurrentPad->ComputeRayon(); Module->Set_Rectangle_Encadrement(); @@ -591,7 +642,7 @@ void DialogPadProperties::PadPropertiesAccept( wxCommandEvent& event ) } /*********************************************************************/ -void DialogPadProperties::OnCancelButtonClick( wxCommandEvent& event ) +void DIALOG_PAD_PROPERTIES::OnCancelButtonClick( wxCommandEvent& event ) /*********************************************************************/ { EndModal(0); diff --git a/pcbnew/dialog_pad_properties_base.cpp b/pcbnew/dialog_pad_properties_base.cpp index 09a2fe2ef2..1ea0273d36 100644 --- a/pcbnew/dialog_pad_properties_base.cpp +++ b/pcbnew/dialog_pad_properties_base.cpp @@ -9,12 +9,15 @@ /////////////////////////////////////////////////////////////////////////// -DialogPadPropertiesBase::DialogPadPropertiesBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); wxBoxSizer* m_MainSizer; - m_MainSizer = new wxBoxSizer( wxHORIZONTAL ); + m_MainSizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bGeneralSizer; + bGeneralSizer = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer* m_LeftBoxSizer; m_LeftBoxSizer = new wxBoxSizer( wxVERTICAL ); @@ -33,11 +36,153 @@ DialogPadPropertiesBase::DialogPadPropertiesBase( wxWindow* parent, wxWindowID i m_PadNetNameCtrl = new wxTextCtrl( this, wxID_PADNETNAMECTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_LeftBoxSizer->Add( m_PadNetNameCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - m_PadPositionBoxSizer = new wxBoxSizer( wxVERTICAL ); + wxStaticBoxSizer* sbSizer2; + sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pad Geometry:") ), wxVERTICAL ); - m_LeftBoxSizer->Add( m_PadPositionBoxSizer, 0, wxEXPAND, 5 ); + wxFlexGridSizer* fgSizerGeometry; + fgSizerGeometry = new wxFlexGridSizer( 9, 3, 0, 0 ); + fgSizerGeometry->SetFlexibleDirection( wxBOTH ); + fgSizerGeometry->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_MainSizer->Add( m_LeftBoxSizer, 0, wxBOTTOM|wxLEFT, 5 ); + m_staticText4 = new wxStaticText( this, wxID_ANY, _("Pad pos X"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText4->Wrap( -1 ); + fgSizerGeometry->Add( m_staticText4, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + m_PadPosition_X_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerGeometry->Add( m_PadPosition_X_Ctrl, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_PadPosX_Unit = new wxStaticText( this, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 ); + m_PadPosX_Unit->Wrap( -1 ); + fgSizerGeometry->Add( m_PadPosX_Unit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_staticText41 = new wxStaticText( this, wxID_ANY, _("Pad pos Y"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText41->Wrap( -1 ); + fgSizerGeometry->Add( m_staticText41, 0, wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + + m_PadPosition_Y_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerGeometry->Add( m_PadPosition_Y_Ctrl, 0, wxALL, 5 ); + + m_PadPosY_Unit = new wxStaticText( this, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 ); + m_PadPosY_Unit->Wrap( -1 ); + fgSizerGeometry->Add( m_PadPosY_Unit, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticline7 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + fgSizerGeometry->Add( m_staticline7, 0, wxEXPAND | wxALL, 5 ); + + m_staticline8 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + fgSizerGeometry->Add( m_staticline8, 0, wxEXPAND | wxALL, 5 ); + + m_staticline9 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + fgSizerGeometry->Add( m_staticline9, 0, wxEXPAND | wxALL, 5 ); + + m_textPadDrillX = new wxStaticText( this, wxID_ANY, _("Pad Drill X"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textPadDrillX->Wrap( -1 ); + fgSizerGeometry->Add( m_textPadDrillX, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxALIGN_RIGHT, 5 ); + + m_PadDrill_X_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerGeometry->Add( m_PadDrill_X_Ctrl, 0, wxALL, 5 ); + + m_PadDrill_X_Unit = new wxStaticText( this, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 ); + m_PadDrill_X_Unit->Wrap( -1 ); + fgSizerGeometry->Add( m_PadDrill_X_Unit, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_textPadDrillY = new wxStaticText( this, wxID_ANY, _("Pad Drill Y"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textPadDrillY->Wrap( -1 ); + fgSizerGeometry->Add( m_textPadDrillY, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + m_PadDrill_Y_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerGeometry->Add( m_PadDrill_Y_Ctrl, 0, wxALL, 5 ); + + m_PadDrill_Y_Unit = new wxStaticText( this, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 ); + m_PadDrill_Y_Unit->Wrap( -1 ); + fgSizerGeometry->Add( m_PadDrill_Y_Unit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_staticline4 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + fgSizerGeometry->Add( m_staticline4, 0, wxEXPAND | wxALL, 5 ); + + m_staticline5 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + fgSizerGeometry->Add( m_staticline5, 0, wxEXPAND | wxALL, 5 ); + + m_staticline6 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + fgSizerGeometry->Add( m_staticline6, 0, wxEXPAND | wxALL, 5 ); + + m_staticText12 = new wxStaticText( this, wxID_ANY, _("Shape size X"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText12->Wrap( -1 ); + fgSizerGeometry->Add( m_staticText12, 0, wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + + m_ShapeSize_X_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerGeometry->Add( m_ShapeSize_X_Ctrl, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_PadShapeSizeX_Unit = new wxStaticText( this, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 ); + m_PadShapeSizeX_Unit->Wrap( -1 ); + fgSizerGeometry->Add( m_PadShapeSizeX_Unit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_staticText15 = new wxStaticText( this, wxID_ANY, _("Shape size Y"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText15->Wrap( -1 ); + fgSizerGeometry->Add( m_staticText15, 0, wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + + m_ShapeSize_Y_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerGeometry->Add( m_ShapeSize_Y_Ctrl, 0, wxALL, 5 ); + + m_PadShapeSizeY_Unit = new wxStaticText( this, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 ); + m_PadShapeSizeY_Unit->Wrap( -1 ); + fgSizerGeometry->Add( m_PadShapeSizeY_Unit, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText17 = new wxStaticText( this, wxID_ANY, _("Shape Offset X"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText17->Wrap( -1 ); + fgSizerGeometry->Add( m_staticText17, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + m_ShapeOffset_X_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerGeometry->Add( m_ShapeOffset_X_Ctrl, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_PadShapeOffsetX_Unit = new wxStaticText( this, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 ); + m_PadShapeOffsetX_Unit->Wrap( -1 ); + fgSizerGeometry->Add( m_PadShapeOffsetX_Unit, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText19 = new wxStaticText( this, wxID_ANY, _("Shape Offset Y"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText19->Wrap( -1 ); + fgSizerGeometry->Add( m_staticText19, 0, wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + + m_ShapeOffset_Y_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerGeometry->Add( m_ShapeOffset_Y_Ctrl, 0, wxALL, 5 ); + + m_PadShapeOffsetY_Unit = new wxStaticText( this, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 ); + m_PadShapeOffsetY_Unit->Wrap( -1 ); + fgSizerGeometry->Add( m_PadShapeOffsetY_Unit, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText21 = new wxStaticText( this, wxID_ANY, _("Shape delta X"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText21->Wrap( -1 ); + fgSizerGeometry->Add( m_staticText21, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 ); + + m_ShapeDelta_X_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerGeometry->Add( m_ShapeDelta_X_Ctrl, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_PadShapeDeltaX_Unit = new wxStaticText( this, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 ); + m_PadShapeDeltaX_Unit->Wrap( -1 ); + fgSizerGeometry->Add( m_PadShapeDeltaX_Unit, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText23 = new wxStaticText( this, wxID_ANY, _("Shape delta Y"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText23->Wrap( -1 ); + fgSizerGeometry->Add( m_staticText23, 0, wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + + m_ShapeDelta_Y_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerGeometry->Add( m_ShapeDelta_Y_Ctrl, 0, wxALL, 5 ); + + m_PadShapeDeltaY_Unit = new wxStaticText( this, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 ); + m_PadShapeDeltaY_Unit->Wrap( -1 ); + fgSizerGeometry->Add( m_PadShapeDeltaY_Unit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + sbSizer2->Add( fgSizerGeometry, 1, wxEXPAND, 5 ); + + m_LeftBoxSizer->Add( sbSizer2, 1, wxEXPAND, 5 ); + + bGeneralSizer->Add( m_LeftBoxSizer, 0, wxBOTTOM|wxLEFT, 5 ); + + wxBoxSizer* bMiddleSizer; + bMiddleSizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bMiddleUpperSizer; + bMiddleUpperSizer = new wxBoxSizer( wxHORIZONTAL ); m_DrillShapeBoxSizer = new wxBoxSizer( wxVERTICAL ); @@ -47,16 +192,13 @@ DialogPadPropertiesBase::DialogPadPropertiesBase( wxWindow* parent, wxWindowID i m_PadShape->SetSelection( 0 ); m_DrillShapeBoxSizer->Add( m_PadShape, 0, wxALL|wxEXPAND, 5 ); - - m_DrillShapeBoxSizer->Add( 0, 8, 1, wxEXPAND, 5 ); - wxString m_DrillShapeCtrlChoices[] = { _("Circle"), _("Oval") }; int m_DrillShapeCtrlNChoices = sizeof( m_DrillShapeCtrlChoices ) / sizeof( wxString ); m_DrillShapeCtrl = new wxRadioBox( this, ID_RADIOBOX_DRILL_SHAPE, _("Drill Shape:"), wxDefaultPosition, wxDefaultSize, m_DrillShapeCtrlNChoices, m_DrillShapeCtrlChoices, 1, wxRA_SPECIFY_COLS ); - m_DrillShapeCtrl->SetSelection( 1 ); + m_DrillShapeCtrl->SetSelection( 0 ); m_DrillShapeBoxSizer->Add( m_DrillShapeCtrl, 0, wxALL|wxEXPAND, 5 ); - m_MainSizer->Add( m_DrillShapeBoxSizer, 1, wxBOTTOM, 5 ); + bMiddleUpperSizer->Add( m_DrillShapeBoxSizer, 1, wxBOTTOM, 5 ); wxBoxSizer* m_MiddleRightBoxSizer; m_MiddleRightBoxSizer = new wxBoxSizer( wxVERTICAL ); @@ -74,29 +216,91 @@ DialogPadPropertiesBase::DialogPadPropertiesBase( wxWindow* parent, wxWindowID i m_PadOrientCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_MiddleRightBoxSizer->Add( m_PadOrientCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bMiddleUpperSizer->Add( m_MiddleRightBoxSizer, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - m_MiddleRightBoxSizer->Add( 0, 8, 1, wxEXPAND, 5 ); + bMiddleSizer->Add( bMiddleUpperSizer, 0, wxEXPAND, 5 ); + + wxStaticBoxSizer* sbClearancesSizer; + sbClearancesSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Clearances:") ), wxVERTICAL ); + + m_staticText20 = new wxStaticText( this, wxID_ANY, _("Set these values to 0\nto use Parent footprint or global values"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText20->Wrap( -1 ); + m_staticText20->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + sbClearancesSizer->Add( m_staticText20, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + wxFlexGridSizer* fgClearancesGridSizer; + fgClearancesGridSizer = new wxFlexGridSizer( 4, 3, 0, 0 ); + fgClearancesGridSizer->SetFlexibleDirection( wxBOTH ); + fgClearancesGridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticTextNetClearance = new wxStaticText( this, wxID_ANY, _("Net Clearance"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextNetClearance->Wrap( -1 ); + fgClearancesGridSizer->Add( m_staticTextNetClearance, 0, wxLEFT|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_NetClearanceValueCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgClearancesGridSizer->Add( m_NetClearanceValueCtrl, 0, wxALL, 5 ); + + m_NetClearanceUnits = new wxStaticText( this, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 ); + m_NetClearanceUnits->Wrap( -1 ); + fgClearancesGridSizer->Add( m_NetClearanceUnits, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + fgClearancesGridSizer->Add( m_staticline1, 0, wxEXPAND|wxALL, 5 ); + + m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + fgClearancesGridSizer->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 ); + + m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + fgClearancesGridSizer->Add( m_staticline3, 0, wxEXPAND | wxALL, 5 ); + + m_MaskClearanceTitle = new wxStaticText( this, wxID_ANY, _("Solder mask clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_MaskClearanceTitle->Wrap( -1 ); + fgClearancesGridSizer->Add( m_MaskClearanceTitle, 0, wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + + m_SolderMaskMarginCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgClearancesGridSizer->Add( m_SolderMaskMarginCtrl, 0, wxALL, 5 ); + + m_SolderMaskMarginUnits = new wxStaticText( this, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 ); + m_SolderMaskMarginUnits->Wrap( -1 ); + fgClearancesGridSizer->Add( m_SolderMaskMarginUnits, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextSolderPaste = new wxStaticText( this, wxID_ANY, _("Solder paste clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextSolderPaste->Wrap( -1 ); + fgClearancesGridSizer->Add( m_staticTextSolderPaste, 0, wxLEFT|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_SolderPasteMarginCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgClearancesGridSizer->Add( m_SolderPasteMarginCtrl, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_SolderPasteMarginUnits = new wxStaticText( this, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 ); + m_SolderPasteMarginUnits->Wrap( -1 ); + fgClearancesGridSizer->Add( m_SolderPasteMarginUnits, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextRatio = new wxStaticText( this, wxID_ANY, _("Solder mask ratio clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextRatio->Wrap( -1 ); + fgClearancesGridSizer->Add( m_staticTextRatio, 0, wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + + m_SolderPasteMarginRatioCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgClearancesGridSizer->Add( m_SolderPasteMarginRatioCtrl, 0, wxALL, 5 ); + + m_SolderPasteRatioMarginUnits = new wxStaticText( this, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 ); + m_SolderPasteRatioMarginUnits->Wrap( -1 ); + fgClearancesGridSizer->Add( m_SolderPasteRatioMarginUnits, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + sbClearancesSizer->Add( fgClearancesGridSizer, 1, wxEXPAND, 5 ); + + bMiddleSizer->Add( sbClearancesSizer, 1, wxEXPAND, 5 ); + + bGeneralSizer->Add( bMiddleSizer, 1, wxEXPAND, 5 ); + + wxBoxSizer* m_RightBoxSizer; + m_RightBoxSizer = new wxBoxSizer( wxVERTICAL ); wxString m_PadTypeChoices[] = { _("Standard"), _("SMD"), _("Conn") }; int m_PadTypeNChoices = sizeof( m_PadTypeChoices ) / sizeof( wxString ); m_PadType = new wxRadioBox( this, ID_LISTBOX_TYPE_PAD, _("Pad Type:"), wxDefaultPosition, wxDefaultSize, m_PadTypeNChoices, m_PadTypeChoices, 1, wxRA_SPECIFY_COLS ); m_PadType->SetSelection( 0 ); - m_MiddleRightBoxSizer->Add( m_PadType, 0, wxALL|wxEXPAND, 5 ); - - m_MainSizer->Add( m_MiddleRightBoxSizer, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - wxBoxSizer* m_RightBoxSizer; - m_RightBoxSizer = new wxBoxSizer( wxVERTICAL ); - - m_buttonOk = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonOk->SetDefault(); - m_RightBoxSizer->Add( m_buttonOk, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - m_RightBoxSizer->Add( m_buttonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - - m_RightBoxSizer->Add( 0, 8, 1, wxEXPAND, 5 ); + m_RightBoxSizer->Add( m_PadType, 0, wxALL|wxEXPAND, 5 ); wxStaticBoxSizer* m_LayersSizer; m_LayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layers:") ), wxVERTICAL ); @@ -158,7 +362,17 @@ DialogPadPropertiesBase::DialogPadPropertiesBase( wxWindow* parent, wxWindowID i m_RightBoxSizer->Add( m_LayersSizer, 0, 0, 5 ); - m_MainSizer->Add( m_RightBoxSizer, 0, wxBOTTOM|wxRIGHT, 5 ); + bGeneralSizer->Add( m_RightBoxSizer, 0, wxBOTTOM|wxRIGHT, 5 ); + + m_MainSizer->Add( bGeneralSizer, 1, wxEXPAND, 5 ); + + m_sdbSizer1 = new wxStdDialogButtonSizer(); + m_sdbSizer1OK = new wxButton( this, wxID_OK ); + m_sdbSizer1->AddButton( m_sdbSizer1OK ); + m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); + m_sdbSizer1->Realize(); + m_MainSizer->Add( m_sdbSizer1, 0, wxEXPAND, 5 ); this->SetSizer( m_MainSizer ); this->Layout(); @@ -166,21 +380,21 @@ DialogPadPropertiesBase::DialogPadPropertiesBase( wxWindow* parent, wxWindowID i this->Centre( wxBOTH ); // Connect Events - m_PadShape->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogPadPropertiesBase::OnPadShapeSelection ), NULL, this ); - m_DrillShapeCtrl->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogPadPropertiesBase::OnDrillShapeSelected ), NULL, this ); - m_PadOrient->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogPadPropertiesBase::PadOrientEvent ), NULL, this ); - m_PadType->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogPadPropertiesBase::PadTypeSelected ), NULL, this ); - m_buttonOk->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogPadPropertiesBase::PadPropertiesAccept ), NULL, this ); - m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogPadPropertiesBase::OnCancelButtonClick ), NULL, this ); + m_PadShape->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPadShapeSelection ), NULL, this ); + m_DrillShapeCtrl->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnDrillShapeSelected ), NULL, this ); + m_PadOrient->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::PadOrientEvent ), NULL, this ); + m_PadType->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::PadTypeSelected ), NULL, this ); + m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this ); + m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::PadPropertiesAccept ), NULL, this ); } -DialogPadPropertiesBase::~DialogPadPropertiesBase() +DIALOG_PAD_PROPERTIES_BASE::~DIALOG_PAD_PROPERTIES_BASE() { // Disconnect Events - m_PadShape->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogPadPropertiesBase::OnPadShapeSelection ), NULL, this ); - m_DrillShapeCtrl->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogPadPropertiesBase::OnDrillShapeSelected ), NULL, this ); - m_PadOrient->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogPadPropertiesBase::PadOrientEvent ), NULL, this ); - m_PadType->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogPadPropertiesBase::PadTypeSelected ), NULL, this ); - m_buttonOk->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogPadPropertiesBase::PadPropertiesAccept ), NULL, this ); - m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogPadPropertiesBase::OnCancelButtonClick ), NULL, this ); + m_PadShape->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPadShapeSelection ), NULL, this ); + m_DrillShapeCtrl->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnDrillShapeSelected ), NULL, this ); + m_PadOrient->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::PadOrientEvent ), NULL, this ); + m_PadType->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::PadTypeSelected ), NULL, this ); + m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this ); + m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::PadPropertiesAccept ), NULL, this ); } diff --git a/pcbnew/dialog_pad_properties_base.fbp b/pcbnew/dialog_pad_properties_base.fbp index b2d583d4e5..152d984945 100644 --- a/pcbnew/dialog_pad_properties_base.fbp +++ b/pcbnew/dialog_pad_properties_base.fbp @@ -30,9 +30,9 @@ wxID_DIALOG_EDIT_PAD - DialogPadPropertiesBase + DIALOG_PAD_PROPERTIES_BASE - 520,396 + 673,466 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER Pad Properties @@ -73,758 +73,42 @@ m_MainSizer - wxHORIZONTAL + wxVERTICAL none 5 - wxBOTTOM|wxLEFT - 0 - - - m_LeftBoxSizer - wxVERTICAL - none - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Pad Num : - - - m_PadNumText - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 0 - - - - 1 - - - 0 - wxID_PADNUMCTRL - - 0 - - m_PadNumCtrl - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Pad Net Name : - - - m_PadNameText - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_PADNETNAMECTRL - - 0 - - m_PadNetNameCtrl - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 - - - m_PadPositionBoxSizer - wxVERTICAL - protected - - - - - - 5 - wxBOTTOM + wxEXPAND 1 - m_DrillShapeBoxSizer - wxVERTICAL - protected - - 5 - wxALL|wxEXPAND - 0 - - - "Circle" "Oval" "Rect" "Trapezoidal" - - 1 - - - 0 - ID_LISTBOX_SHAPE_PAD - Pad Shape: - 1 - - - m_PadShape - protected - - 0 - - wxRA_SPECIFY_COLS - - - - - - - - - - - - - - - - - - - - - - - OnPadShapeSelection - - - - - - - - - - 5 - wxEXPAND - 1 - - 8 - protected - 0 - - - - 5 - wxALL|wxEXPAND - 0 - - - "Circle" "Oval" - - 1 - - - 0 - ID_RADIOBOX_DRILL_SHAPE - Drill Shape: - 1 - - - m_DrillShapeCtrl - protected - - 1 - - wxRA_SPECIFY_COLS - - - - - - - - - - - - - - - - - - - - - - - OnDrillShapeSelected - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - - m_MiddleRightBoxSizer - wxVERTICAL + bGeneralSizer + wxHORIZONTAL none 5 - wxALL|wxEXPAND + wxBOTTOM|wxLEFT 0 - - - "0" "90" "-90" "180" "User" - - 1 - - - 0 - ID_LISTBOX_ORIENT_PAD - Pad Orient: - 1 - + - m_PadOrient - protected - - 0 - - wxRA_SPECIFY_COLS - - - - - - - - - - - - - - - - - - - - - - - PadOrientEvent - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Pad Orient (0.1 deg) - - - m_PadOrientText - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - - 0 - - m_PadOrientCtrl - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 8 - protected - 0 - - - - 5 - wxALL|wxEXPAND - 0 - - - "Standard" "SMD" "Conn" - - 1 - - - 0 - ID_LISTBOX_TYPE_PAD - Pad Type: - 1 - - - m_PadType - protected - - 0 - - wxRA_SPECIFY_COLS - - - - - - - - - - - - - - - - - - - - - - - PadTypeSelected - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT - 0 - - - m_RightBoxSizer - wxVERTICAL - none - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND - 0 - - - - 1 - 1 - - - 0 - wxID_OK - Ok - - - m_buttonOk - protected - - - - - - - - - PadPropertiesAccept - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND - 0 - - - - 0 - 1 - - - 0 - wxID_CANCEL - Cancel - - - m_buttonCancel - protected - - - - - - - - - OnCancelButtonClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 8 - protected - 0 - - - - 5 - - 0 - - wxID_ANY - Layers: - - m_LayersSizer + m_LeftBoxSizer wxVERTICAL none - 5 wxTOP|wxRIGHT|wxLEFT 0 - + - 0 1 0 wxID_ANY - Copper layer + Pad Num : - m_PadLayerCu + m_PadNumText protected @@ -834,8 +118,8 @@ + -1 - @@ -862,32 +146,31 @@ 5 - wxALL + wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND 0 - + - 0 1 0 - wxID_ANY - Component layer + wxID_PADNUMCTRL + 0 - m_PadLayerCmp + m_PadNumCtrl protected + - @@ -909,6 +192,116 @@ + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Pad Net Name : + + + m_PadNameText + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_PADNETNAMECTRL + + 0 + + m_PadNetNameCtrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -916,40 +309,3108 @@ 5 wxEXPAND 1 - - 8 - protected - 0 + + wxID_ANY + Pad Geometry: + + sbSizer2 + wxVERTICAL + none + + + 5 + wxEXPAND + 1 + + 3 + wxBOTH + + + 0 + + fgSizerGeometry + wxFLEX_GROWMODE_SPECIFIED + none + 9 + 0 + + 5 + wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Pad pos X + + + m_staticText4 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_PadPosition_X_Ctrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + + + 1 + + + 0 + wxID_ANY + Inch + + + m_PadPosX_Unit + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 0 + + + + 1 + + + 0 + wxID_ANY + Pad pos Y + + + m_staticText41 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_PadPosition_Y_Ctrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxALIGN_CENTER_VERTICAL + 0 + + + + 1 + + + 0 + wxID_ANY + Inch + + + m_PadPosY_Unit + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline7 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline8 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline9 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxLEFT|wxALIGN_RIGHT + 0 + + + + 1 + + + 0 + wxID_ANY + Pad Drill X + + + m_textPadDrillX + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_PadDrill_X_Ctrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxALIGN_CENTER_VERTICAL + 0 + + + + 1 + + + 0 + wxID_ANY + Inch + + + m_PadDrill_X_Unit + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Pad Drill Y + + + m_textPadDrillY + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_PadDrill_Y_Ctrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + + + 1 + + + 0 + wxID_ANY + Inch + + + m_PadDrill_Y_Unit + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline4 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline5 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline6 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 0 + + + + 1 + + + 0 + wxID_ANY + Shape size X + + + m_staticText12 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_ShapeSize_X_Ctrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + + + 1 + + + 0 + wxID_ANY + Inch + + + m_PadShapeSizeX_Unit + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 0 + + + + 1 + + + 0 + wxID_ANY + Shape size Y + + + m_staticText15 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_ShapeSize_Y_Ctrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxALIGN_CENTER_VERTICAL + 0 + + + + 1 + + + 0 + wxID_ANY + Inch + + + m_PadShapeSizeY_Unit + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Shape Offset X + + + m_staticText17 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_ShapeOffset_X_Ctrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxALIGN_CENTER_VERTICAL + 0 + + + + 1 + + + 0 + wxID_ANY + Inch + + + m_PadShapeOffsetX_Unit + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 0 + + + + 1 + + + 0 + wxID_ANY + Shape Offset Y + + + m_staticText19 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_ShapeOffset_Y_Ctrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxALIGN_CENTER_VERTICAL + 0 + + + + 1 + + + 0 + wxID_ANY + Inch + + + m_PadShapeOffsetY_Unit + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Shape delta X + + + m_staticText21 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_ShapeDelta_X_Ctrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxALIGN_CENTER_VERTICAL + 0 + + + + 1 + + + 0 + wxID_ANY + Inch + + + m_PadShapeDeltaX_Unit + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 0 + + + + 1 + + + 0 + wxID_ANY + Shape delta Y + + + m_staticText23 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_ShapeDelta_Y_Ctrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + + + 1 + + + 0 + wxID_ANY + Inch + + + m_PadShapeDeltaY_Unit + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + + bMiddleSizer + wxVERTICAL + none + + 5 + wxEXPAND + 0 + + + bMiddleUpperSizer + wxHORIZONTAL + none + + 5 + wxBOTTOM + 1 + + + m_DrillShapeBoxSizer + wxVERTICAL + protected + + 5 + wxALL|wxEXPAND + 0 + + + "Circle" "Oval" "Rect" "Trapezoidal" + + 1 + + + 0 + ID_LISTBOX_SHAPE_PAD + Pad Shape: + 1 + + + m_PadShape + protected + + 0 + + wxRA_SPECIFY_COLS + + + + + + + + + + + + + + + + + + + + + + + OnPadShapeSelection + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + "Circle" "Oval" + + 1 + + + 0 + ID_RADIOBOX_DRILL_SHAPE + Drill Shape: + 1 + + + m_DrillShapeCtrl + protected + + 0 + + wxRA_SPECIFY_COLS + + + + + + + + + + + + + + + + + + + + + + + OnDrillShapeSelected + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + + m_MiddleRightBoxSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + + "0" "90" "-90" "180" "User" + + 1 + + + 0 + ID_LISTBOX_ORIENT_PAD + Pad Orient: + 1 + + + m_PadOrient + protected + + 0 + + wxRA_SPECIFY_COLS + + + + + + + + + + + + + + + + + + + + + + + PadOrientEvent + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Pad Orient (0.1 deg) + + + m_PadOrientText + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_PadOrientCtrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 - wxTOP|wxRIGHT|wxLEFT + wxEXPAND + 1 + + wxID_ANY + Clearances: + + sbClearancesSizer + wxVERTICAL + none + + + 5 + wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + + + 1 + + ,90,92,-1,70,0 + 0 + wxID_ANY + Set these values to 0 to use Parent footprint or global values + + + m_staticText20 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 3 + wxBOTH + + + 0 + + fgClearancesGridSizer + wxFLEX_GROWMODE_SPECIFIED + none + 4 + 0 + + 5 + wxLEFT|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL + 0 + + + + 1 + + + 0 + wxID_ANY + Net Clearance + + + m_staticTextNetClearance + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_NetClearanceValueCtrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxALIGN_CENTER_VERTICAL + 0 + + + + 1 + + + 0 + wxID_ANY + Inch + + + m_NetClearanceUnits + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline1 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline2 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline3 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 0 + + + + 1 + + + 0 + wxID_ANY + Solder mask clearance: + + + m_MaskClearanceTitle + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_SolderMaskMarginCtrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxALIGN_CENTER_VERTICAL + 0 + + + + 1 + + + 0 + wxID_ANY + Inch + + + m_SolderMaskMarginUnits + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL + 0 + + + + 1 + + + 0 + wxID_ANY + Solder paste clearance: + + + m_staticTextSolderPaste + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_SolderPasteMarginCtrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxALIGN_CENTER_VERTICAL + 0 + + + + 1 + + + 0 + wxID_ANY + Inch + + + m_SolderPasteMarginUnits + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 0 + + + + 1 + + + 0 + wxID_ANY + Solder mask ratio clearance: + + + m_staticTextRatio + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_SolderPasteMarginRatioCtrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxALIGN_CENTER_VERTICAL + 0 + + + + 1 + + + 0 + wxID_ANY + % + + + m_SolderPasteRatioMarginUnits + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT + 0 + + + m_RightBoxSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND 0 - + - 0 + "Standard" "SMD" "Conn" 1 0 - wxID_ANY - Adhesive Cmp + ID_LISTBOX_TYPE_PAD + Pad Type: + 1 - m_PadLayerAdhCmp + m_PadType protected + 0 - + wxRA_SPECIFY_COLS - @@ -966,6 +3427,7 @@ + PadTypeSelected @@ -976,528 +3438,734 @@ 5 - wxTOP|wxRIGHT|wxLEFT + 0 - - - 0 - - 1 - - - 0 + wxID_ANY - Adhesive Copper - + Layers: - m_PadLayerAdhCu - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Solder paste Cmp - - - m_PadLayerPateCmp - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Solder paste Copper - - - m_PadLayerPateCu - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Silkscreen Cmp - - - m_PadLayerSilkCmp - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Silkscreen Copper - - - m_PadLayerSilkCu - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Solder mask Cmp - - - m_PadLayerMaskCmp - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Solder mask Copper - - - m_PadLayerMaskCu - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - E.C.O.1 layer - - - m_PadLayerECO1 - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - E.C.O.2 layer - - - m_PadLayerECO2 - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Draft layer - - - m_PadLayerDraft - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + m_LayersSizer + wxVERTICAL + none + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Copper layer + + + m_PadLayerCu + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Component layer + + + m_PadLayerCmp + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 8 + protected + 0 + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Adhesive Cmp + + + m_PadLayerAdhCmp + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Adhesive Copper + + + m_PadLayerAdhCu + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Solder paste Cmp + + + m_PadLayerPateCmp + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Solder paste Copper + + + m_PadLayerPateCu + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Silkscreen Cmp + + + m_PadLayerSilkCmp + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Silkscreen Copper + + + m_PadLayerSilkCu + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Solder mask Cmp + + + m_PadLayerMaskCmp + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Solder mask Copper + + + m_PadLayerMaskCu + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + E.C.O.1 layer + + + m_PadLayerECO1 + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + E.C.O.2 layer + + + m_PadLayerECO2 + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Draft layer + + + m_PadLayerDraft + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer1 + protected + + OnCancelButtonClick + + + + PadPropertiesAccept + + + + diff --git a/pcbnew/dialog_pad_properties_base.h b/pcbnew/dialog_pad_properties_base.h index 5ec4ce6a29..710b107bcc 100644 --- a/pcbnew/dialog_pad_properties_base.h +++ b/pcbnew/dialog_pad_properties_base.h @@ -17,19 +17,20 @@ #include #include #include +#include #include -#include -#include -#include #include +#include +#include +#include #include /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -/// Class DialogPadPropertiesBase +/// Class DIALOG_PAD_PROPERTIES_BASE /////////////////////////////////////////////////////////////////////////////// -class DialogPadPropertiesBase : public wxDialog +class DIALOG_PAD_PROPERTIES_BASE : public wxDialog { private: @@ -49,19 +50,65 @@ class DialogPadPropertiesBase : public wxDialog wxTextCtrl* m_PadNumCtrl; wxStaticText* m_PadNameText; wxTextCtrl* m_PadNetNameCtrl; - wxBoxSizer* m_PadPositionBoxSizer; + wxStaticText* m_staticText4; + wxTextCtrl* m_PadPosition_X_Ctrl; + wxStaticText* m_PadPosX_Unit; + wxStaticText* m_staticText41; + wxTextCtrl* m_PadPosition_Y_Ctrl; + wxStaticText* m_PadPosY_Unit; + wxStaticLine* m_staticline7; + wxStaticLine* m_staticline8; + wxStaticLine* m_staticline9; + wxStaticText* m_textPadDrillX; + wxTextCtrl* m_PadDrill_X_Ctrl; + wxStaticText* m_PadDrill_X_Unit; + wxStaticText* m_textPadDrillY; + wxTextCtrl* m_PadDrill_Y_Ctrl; + wxStaticText* m_PadDrill_Y_Unit; + wxStaticLine* m_staticline4; + wxStaticLine* m_staticline5; + wxStaticLine* m_staticline6; + wxStaticText* m_staticText12; + wxTextCtrl* m_ShapeSize_X_Ctrl; + wxStaticText* m_PadShapeSizeX_Unit; + wxStaticText* m_staticText15; + wxTextCtrl* m_ShapeSize_Y_Ctrl; + wxStaticText* m_PadShapeSizeY_Unit; + wxStaticText* m_staticText17; + wxTextCtrl* m_ShapeOffset_X_Ctrl; + wxStaticText* m_PadShapeOffsetX_Unit; + wxStaticText* m_staticText19; + wxTextCtrl* m_ShapeOffset_Y_Ctrl; + wxStaticText* m_PadShapeOffsetY_Unit; + wxStaticText* m_staticText21; + wxTextCtrl* m_ShapeDelta_X_Ctrl; + wxStaticText* m_PadShapeDeltaX_Unit; + wxStaticText* m_staticText23; + wxTextCtrl* m_ShapeDelta_Y_Ctrl; + wxStaticText* m_PadShapeDeltaY_Unit; wxBoxSizer* m_DrillShapeBoxSizer; wxRadioBox* m_PadShape; - wxRadioBox* m_DrillShapeCtrl; wxRadioBox* m_PadOrient; wxStaticText* m_PadOrientText; wxTextCtrl* m_PadOrientCtrl; - + wxStaticText* m_staticText20; + wxStaticText* m_staticTextNetClearance; + wxTextCtrl* m_NetClearanceValueCtrl; + wxStaticText* m_NetClearanceUnits; + wxStaticLine* m_staticline1; + wxStaticLine* m_staticline2; + wxStaticLine* m_staticline3; + wxStaticText* m_MaskClearanceTitle; + wxTextCtrl* m_SolderMaskMarginCtrl; + wxStaticText* m_SolderMaskMarginUnits; + wxStaticText* m_staticTextSolderPaste; + wxTextCtrl* m_SolderPasteMarginCtrl; + wxStaticText* m_SolderPasteMarginUnits; + wxStaticText* m_staticTextRatio; + wxTextCtrl* m_SolderPasteMarginRatioCtrl; + wxStaticText* m_SolderPasteRatioMarginUnits; wxRadioBox* m_PadType; - wxButton* m_buttonOk; - wxButton* m_buttonCancel; - wxCheckBox* m_PadLayerCu; wxCheckBox* m_PadLayerCmp; @@ -76,19 +123,22 @@ class DialogPadPropertiesBase : public wxDialog wxCheckBox* m_PadLayerECO1; wxCheckBox* m_PadLayerECO2; wxCheckBox* m_PadLayerDraft; + wxStdDialogButtonSizer* m_sdbSizer1; + wxButton* m_sdbSizer1OK; + wxButton* m_sdbSizer1Cancel; // Virtual event handlers, overide them in your derived class virtual void OnPadShapeSelection( wxCommandEvent& event ){ event.Skip(); } virtual void OnDrillShapeSelected( wxCommandEvent& event ){ event.Skip(); } virtual void PadOrientEvent( wxCommandEvent& event ){ event.Skip(); } virtual void PadTypeSelected( wxCommandEvent& event ){ event.Skip(); } - virtual void PadPropertiesAccept( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancelButtonClick( wxCommandEvent& event ){ event.Skip(); } + virtual void PadPropertiesAccept( wxCommandEvent& event ){ event.Skip(); } public: - DialogPadPropertiesBase( wxWindow* parent, wxWindowID id = wxID_DIALOG_EDIT_PAD, const wxString& title = _("Pad Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 520,396 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSUNKEN_BORDER ); - ~DialogPadPropertiesBase(); + DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_DIALOG_EDIT_PAD, const wxString& title = _("Pad Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 673,466 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSUNKEN_BORDER ); + ~DIALOG_PAD_PROPERTIES_BASE(); };