Unify negative zero and percent handling in UNIT_BINDER.

Some values, such as solder mask margins, are usually negative and it
helps to display zero as "-0.0".
This commit is contained in:
Jeff Young 2021-08-06 15:26:08 +01:00
parent e81b7b4a14
commit a10f2b284c
22 changed files with 412 additions and 473 deletions

View File

@ -43,13 +43,14 @@ UNIT_BINDER::UNIT_BINDER( EDA_DRAW_FRAME* aParent, wxStaticText* aLabel, wxWindo
m_label( aLabel ),
m_valueCtrl( aValueCtrl ),
m_unitLabel( aUnitLabel ),
m_negativeZero( false ),
m_dataType( EDA_DATA_TYPE::DISTANCE ),
m_precision( 0 ),
m_eval( aParent->GetUserUnits() ),
m_originTransforms( aParent->GetOriginTransforms() ),
m_coordType( ORIGIN_TRANSFORMS::NOT_A_COORD )
{
m_units = aParent->GetUserUnits();
m_dataType = EDA_DATA_TYPE::DISTANCE;
m_precision = 0;
m_allowEval = allowEval && dynamic_cast<wxTextEntry*>( m_valueCtrl );
m_needsEval = false;
m_selStart = 0;
@ -60,7 +61,10 @@ UNIT_BINDER::UNIT_BINDER( EDA_DRAW_FRAME* aParent, wxStaticText* aLabel, wxWindo
if( textEntry )
{
// Use ChangeValue() instead of SetValue() so we don't generate events.
textEntry->ChangeValue( wxT( "0" ) );
if( m_negativeZero )
textEntry->ChangeValue( wxT( "-0" ) );
else
textEntry->ChangeValue( wxT( "0" ) );
}
if( m_unitLabel )
@ -245,7 +249,11 @@ void UNIT_BINDER::SetValue( int aValue )
{
double value = aValue;
double displayValue = m_originTransforms.ToDisplay( value, m_coordType );
SetValue( StringFromValue( m_units, displayValue, false, m_dataType ) );
if( displayValue == 0 && m_negativeZero )
SetValue( wxT( "-" ) + StringFromValue( m_units, displayValue, false, m_dataType ) );
else
SetValue( StringFromValue( m_units, displayValue, false, m_dataType ) );
}
@ -253,7 +261,11 @@ void UNIT_BINDER::SetDoubleValue( double aValue )
{
double displayValue = m_originTransforms.ToDisplay( aValue, m_coordType );
displayValue = setPrecision( displayValue, false );
SetValue( StringFromValue( m_units, displayValue, false, m_dataType ) );
if( displayValue == 0 && m_negativeZero )
SetValue( wxT( "-" ) + StringFromValue( m_units, displayValue, false, m_dataType ) );
else
SetValue( StringFromValue( m_units, displayValue, false, m_dataType ) );
}
@ -279,7 +291,23 @@ void UNIT_BINDER::ChangeValue( int aValue )
{
double value = aValue;
double displayValue = m_originTransforms.ToDisplay( value, m_coordType );
ChangeValue( StringFromValue( m_units, displayValue, false ) );
if( displayValue == 0 && m_negativeZero )
ChangeValue( wxT( "-" ) + StringFromValue( m_units, displayValue, false ) );
else
ChangeValue( StringFromValue( m_units, displayValue, false ) );
}
void UNIT_BINDER::ChangeDoubleValue( double aValue )
{
double displayValue = m_originTransforms.ToDisplay( aValue, m_coordType );
displayValue = setPrecision( displayValue, false );
if( displayValue == 0 && m_negativeZero )
ChangeValue( wxT( "-" ) + StringFromValue( m_units, displayValue, false, m_dataType ) );
else
ChangeValue( StringFromValue( m_units, displayValue, false, m_dataType ) );
}

View File

@ -64,6 +64,8 @@ public:
*/
virtual void SetUnits( EDA_UNITS aUnits );
virtual void SetNegativeZero() { m_negativeZero = true; }
/**
* Normally not needed, but can be used to set the precision when using
* internal units that are floats (not integers) like DEGREES or PERCENT.
@ -81,8 +83,6 @@ public:
/**
* Set new value (in Internal Units) for the text field, taking care of units conversion.
*
* @param aValue is the new value.
*/
virtual void SetValue( int aValue );
@ -91,22 +91,26 @@ public:
/**
* Set new value (in Internal Units) for the text field, taking care of units conversion.
*
* @param aValue is the new value.
* the initialized value will be truncated according to the precision set by SetPrecision()
* (if not <= 0)
* The value will be truncated according to the precision set by SetPrecision() (if not <= 0).
*/
virtual void SetDoubleValue( double aValue );
/**
* Change the value (in Internal Units) for the text field, taking care of units conversion
* but does not trigger the update routine
*
* @param aValue is the new value.
* Set new value (in Internal Units) for the text field, taking care of units conversion
* WITHOUT triggering the update routine.
*/
virtual void ChangeValue( int aValue );
void ChangeValue( const wxString& aValue );
/**
* Set new value (in Internal Units) for the text field, taking care of units conversion
* WITHOUT triggering the update routine.
*
* The value will be truncated according to the precision set by SetPrecision() (if not <= 0).
*/
virtual void ChangeDoubleValue( double aValue );
/**
* Return the current value in Internal Units.
*/
@ -201,23 +205,21 @@ protected:
///< The bound widgets
wxStaticText* m_label;
wxWindow* m_valueCtrl;
wxStaticText* m_unitLabel; // Can be nullptr
wxStaticText* m_unitLabel; ///< Can be nullptr
///< Currently used units.
EDA_UNITS m_units;
bool m_negativeZero; ///< Indicates "-0" should be displayed for 0.
EDA_DATA_TYPE m_dataType;
int m_precision; // 0 to 6
int m_precision; ///< 0 to 6
///< Validation support.
wxString m_errorMessage;
///< Evaluator
NUMERIC_EVALUATOR m_eval;
bool m_allowEval;
bool m_needsEval;
///< Selection start and end of the original text
long m_selStart;
long m_selStart; ///< Selection start and end of the original text
long m_selEnd;
/// A reference to an ORIGIN_TRANSFORMS object

View File

@ -61,8 +61,12 @@ DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParen
m_posY( aParent, m_YPosLabel, m_ModPositionY, m_YPosUnit ),
m_orientValidator( 3, &m_orientValue ),
m_netClearance( aParent, m_NetClearanceLabel, m_NetClearanceCtrl, m_NetClearanceUnits ),
m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl, m_SolderMaskMarginUnits ),
m_solderPaste( aParent, m_SolderPasteMarginLabel, m_SolderPasteMarginCtrl, m_SolderPasteMarginUnits ),
m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl,
m_SolderMaskMarginUnits ),
m_solderPaste( aParent, m_SolderPasteMarginLabel, m_SolderPasteMarginCtrl,
m_SolderPasteMarginUnits ),
m_solderPasteRatio( aParent, m_PasteMarginRatioLabel, m_PasteMarginRatioCtrl,
m_PasteMarginRatioUnits ),
m_returnValue( FP_PROPS_CANCEL )
{
// Create the 3D models page
@ -133,6 +137,11 @@ DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParen
SetInitialFocus( m_NetClearanceCtrl );
}
m_solderPaste.SetNegativeZero();
m_solderPasteRatio.SetUnits( EDA_UNITS::PERCENT );
m_solderPasteRatio.SetNegativeZero();
m_sdbSizerStdButtonsOK->SetDefault();
m_orientValue = 0;
@ -319,21 +328,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow()
m_netClearance.SetValue( m_footprint->GetLocalClearance() );
m_solderMask.SetValue( m_footprint->GetLocalSolderMaskMargin() );
m_solderPaste.SetValue( m_footprint->GetLocalSolderPasteMargin() );
// Prefer "-0" to "0" for normally negative values
if( m_footprint->GetLocalSolderPasteMargin() == 0 )
m_SolderPasteMarginCtrl->SetValue( wxT( "-" ) + m_SolderPasteMarginCtrl->GetValue() );
// Add solder paste margin ratio in percent
// for the usual default value 0.0, display -0.0 (or -0,0 in some countries)
wxString msg;
msg.Printf( wxT( "%f" ), m_footprint->GetLocalSolderPasteMarginRatio() * 100.0 );
if( m_footprint->GetLocalSolderPasteMarginRatio() == 0.0 &&
msg[0] == '0') // Sometimes Printf adds a sign if the value is very small (0.0)
m_SolderPasteMarginRatioCtrl->SetValue( wxT("-") + msg );
else
m_SolderPasteMarginRatioCtrl->SetValue( msg );
m_solderPasteRatio.SetDoubleValue( m_footprint->GetLocalSolderPasteMarginRatio() * 100.0 );
switch( m_footprint->GetZoneConnection() )
{
@ -461,20 +456,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow()
m_footprint->SetLocalClearance( m_netClearance.GetValue() );
m_footprint->SetLocalSolderMaskMargin( m_solderMask.GetValue() );
m_footprint->SetLocalSolderPasteMargin( m_solderPaste.GetValue() );
double dtmp = 0.0;
wxString msg = m_SolderPasteMarginRatioCtrl->GetValue();
msg.ToDouble( &dtmp );
// A -50% margin ratio means no paste on a pad, the ratio must be >= -50%
if( dtmp < -50.0 )
dtmp = -50.0;
// A margin ratio is always <= 0
// 0 means use full pad copper area
if( dtmp > 0.0 )
dtmp = 0.0;
m_footprint->SetLocalSolderPasteMarginRatio( dtmp / 100 );
m_footprint->SetLocalSolderPasteMarginRatio( m_solderPasteRatio.GetDoubleValue() / 100.0 );
switch( m_ZoneConnectionChoice->GetSelection() )
{

View File

@ -101,6 +101,7 @@ private:
UNIT_BINDER m_netClearance;
UNIT_BINDER m_solderMask;
UNIT_BINDER m_solderPaste;
UNIT_BINDER m_solderPasteRatio;
wxString m_delayedErrorMessage;
wxGrid* m_delayedFocusGrid;

View File

@ -379,18 +379,18 @@ DIALOG_FOOTPRINT_PROPERTIES_BASE::DIALOG_FOOTPRINT_PROPERTIES_BASE( wxWindow* pa
m_SolderPasteMarginUnits->Wrap( -1 );
fgSizerClearances->Add( m_SolderPasteMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_staticTextRatio = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("Solder paste relative clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextRatio->Wrap( -1 );
m_staticTextRatio->SetToolTip( _("This is the local clearance ratio in percent between pads and the solder paste for this footprint.\nA value of 10 means the clearance value is 10 percent of the pad size.\nThis value can be superseded by a pad local value.\nThe final clearance value is the sum of this value and the clearance value.\nA negative value means a smaller mask size than pad size.") );
m_PasteMarginRatioLabel = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("Solder paste relative clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_PasteMarginRatioLabel->Wrap( -1 );
m_PasteMarginRatioLabel->SetToolTip( _("This is the local clearance ratio in percent between pads and the solder paste for this footprint.\nA value of 10 means the clearance value is 10 percent of the pad size.\nThis value can be superseded by a pad local value.\nThe final clearance value is the sum of this value and the clearance value.\nA negative value means a smaller mask size than pad size.") );
fgSizerClearances->Add( m_staticTextRatio, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
fgSizerClearances->Add( m_PasteMarginRatioLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
m_SolderPasteMarginRatioCtrl = new TEXT_CTRL_EVAL( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerClearances->Add( m_SolderPasteMarginRatioCtrl, 1, wxALL|wxEXPAND, 5 );
m_PasteMarginRatioCtrl = new TEXT_CTRL_EVAL( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerClearances->Add( m_PasteMarginRatioCtrl, 1, wxALL|wxEXPAND, 5 );
m_SolderPasteRatioMarginUnits = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_SolderPasteRatioMarginUnits->Wrap( -1 );
fgSizerClearances->Add( m_SolderPasteRatioMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
m_PasteMarginRatioUnits = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_PasteMarginRatioUnits->Wrap( -1 );
fgSizerClearances->Add( m_PasteMarginRatioUnits, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
sbSizerLocalProperties->Add( fgSizerClearances, 1, wxEXPAND, 5 );

View File

@ -2512,11 +2512,11 @@
</object>
</object>
</object>
<object class="notebookpage" expanded="0">
<object class="notebookpage" expanded="1">
<property name="bitmap"></property>
<property name="label">Clearance Overrides and Settings</property>
<property name="select">1</property>
<object class="wxPanel" expanded="0">
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -3382,7 +3382,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextRatio</property>
<property name="name">m_PasteMarginRatioLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -3442,7 +3442,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_SolderPasteMarginRatioCtrl</property>
<property name="name">m_PasteMarginRatioCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -3507,7 +3507,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_SolderPasteRatioMarginUnits</property>
<property name="name">m_PasteMarginRatioUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>

View File

@ -102,9 +102,9 @@ class DIALOG_FOOTPRINT_PROPERTIES_BASE : public DIALOG_SHIM
wxStaticText* m_SolderPasteMarginLabel;
wxTextCtrl* m_SolderPasteMarginCtrl;
wxStaticText* m_SolderPasteMarginUnits;
wxStaticText* m_staticTextRatio;
TEXT_CTRL_EVAL* m_SolderPasteMarginRatioCtrl;
wxStaticText* m_SolderPasteRatioMarginUnits;
wxStaticText* m_PasteMarginRatioLabel;
TEXT_CTRL_EVAL* m_PasteMarginRatioCtrl;
wxStaticText* m_PasteMarginRatioUnits;
wxStaticText* m_staticTextInfoCopper;
wxStaticText* m_staticTextInfoPaste;
wxStaticText* m_staticText16;

View File

@ -67,7 +67,9 @@ DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(
m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl,
m_SolderMaskMarginUnits ),
m_solderPaste( aParent, m_SolderPasteMarginLabel, m_SolderPasteMarginCtrl,
m_SolderPasteMarginUnits )
m_SolderPasteMarginUnits ),
m_solderPasteRatio( aParent, m_PasteMarginRatioLabel, m_PasteMarginRatioCtrl,
m_PasteMarginRatioUnits )
{
// Create the 3D models page
m_3dPanel = new PANEL_FP_PROPERTIES_3D_MODEL( m_frame, m_footprint, this, m_NoteBook );
@ -126,6 +128,11 @@ DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(
SetInitialFocus( m_NetClearanceCtrl );
}
m_solderPaste.SetNegativeZero();
m_solderPasteRatio.SetUnits( EDA_UNITS::PERCENT );
m_solderPasteRatio.SetNegativeZero();
m_sdbSizerStdButtonsOK->SetDefault();
// Configure button logos
@ -219,21 +226,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataToWindow()
m_netClearance.SetValue( m_footprint->GetLocalClearance() );
m_solderMask.SetValue( m_footprint->GetLocalSolderMaskMargin() );
m_solderPaste.SetValue( m_footprint->GetLocalSolderPasteMargin() );
// Prefer "-0" to "0" for normally negative values
if( m_footprint->GetLocalSolderPasteMargin() == 0 )
m_SolderPasteMarginCtrl->SetValue( wxT( "-" ) + m_SolderPasteMarginCtrl->GetValue() );
// Add solder paste margin ratio in percent
// for the usual default value 0.0, display -0.0 (or -0,0 in some countries)
wxString msg;
msg.Printf( wxT( "%f" ), m_footprint->GetLocalSolderPasteMarginRatio() * 100.0 );
if( m_footprint->GetLocalSolderPasteMarginRatio() == 0.0 &&
msg[0] == '0') // Sometimes Printf adds a sign if the value is very small (0.0)
m_SolderPasteMarginRatioCtrl->SetValue( wxT("-") + msg );
else
m_SolderPasteMarginRatioCtrl->SetValue( msg );
m_solderPasteRatio.SetDoubleValue( m_footprint->GetLocalSolderPasteMarginRatio() * 100.0 );
switch( m_footprint->GetZoneConnection() )
{
@ -437,21 +430,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataFromWindow()
m_footprint->SetLocalClearance( m_netClearance.GetValue() );
m_footprint->SetLocalSolderMaskMargin( m_solderMask.GetValue() );
m_footprint->SetLocalSolderPasteMargin( m_solderPaste.GetValue() );
double dtmp = 0.0;
wxString msg = m_SolderPasteMarginRatioCtrl->GetValue();
msg.ToDouble( &dtmp );
// A -50% margin ratio means no paste on a pad, the ratio must be >= -50%
if( dtmp < -50.0 )
dtmp = -50.0;
// A margin ratio is always <= 0
// 0 means use full pad copper area
if( dtmp > 0.0 )
dtmp = 0.0;
m_footprint->SetLocalSolderPasteMarginRatio( dtmp / 100 );
m_footprint->SetLocalSolderPasteMarginRatio( m_solderPasteRatio.GetDoubleValue() / 100.0 );
switch( m_ZoneConnectionChoice->GetSelection() )
{

View File

@ -79,6 +79,7 @@ private:
UNIT_BINDER m_netClearance;
UNIT_BINDER m_solderMask;
UNIT_BINDER m_solderPaste;
UNIT_BINDER m_solderPasteRatio;
wxControl* m_delayedFocusCtrl;
NOTEBOOK_PAGES m_delayedFocusPage;

View File

@ -280,18 +280,18 @@ DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_BASE::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITO
m_SolderPasteMarginUnits->Wrap( -1 );
fgSizerClearances->Add( m_SolderPasteMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_staticTextRatio = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("Solder paste relative clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextRatio->Wrap( -1 );
m_staticTextRatio->SetToolTip( _("This is the local clearance ratio in percent between pads and the\nsolder paste for this footprint.\nA value of 10 means the clearance value is 10 percent of the pad size.\nThe final clearance value is the sum of this value and the clearance value.\nA negative value means a smaller mask size than pad size.\nThis value can be overridden on a pad-by-pad basis in the Local\nClearance and Settings tab of Pad Properties.") );
m_PasteMarginRatioLabel = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("Solder paste relative clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_PasteMarginRatioLabel->Wrap( -1 );
m_PasteMarginRatioLabel->SetToolTip( _("This is the local clearance ratio in percent between pads and the\nsolder paste for this footprint.\nA value of 10 means the clearance value is 10 percent of the pad size.\nThe final clearance value is the sum of this value and the clearance value.\nA negative value means a smaller mask size than pad size.\nThis value can be overridden on a pad-by-pad basis in the Local\nClearance and Settings tab of Pad Properties.") );
fgSizerClearances->Add( m_staticTextRatio, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
fgSizerClearances->Add( m_PasteMarginRatioLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
m_SolderPasteMarginRatioCtrl = new TEXT_CTRL_EVAL( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerClearances->Add( m_SolderPasteMarginRatioCtrl, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_PasteMarginRatioCtrl = new TEXT_CTRL_EVAL( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerClearances->Add( m_PasteMarginRatioCtrl, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_SolderPasteRatioMarginUnits = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_SolderPasteRatioMarginUnits->Wrap( -1 );
fgSizerClearances->Add( m_SolderPasteRatioMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_PasteMarginRatioUnits = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_PasteMarginRatioUnits->Wrap( -1 );
fgSizerClearances->Add( m_PasteMarginRatioUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
sbSizerLocalProperties->Add( fgSizerClearances, 1, wxEXPAND, 5 );

View File

@ -2375,7 +2375,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextRatio</property>
<property name="name">m_PasteMarginRatioLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -2435,7 +2435,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_SolderPasteMarginRatioCtrl</property>
<property name="name">m_PasteMarginRatioCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -2500,7 +2500,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_SolderPasteRatioMarginUnits</property>
<property name="name">m_PasteMarginRatioUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>

View File

@ -83,9 +83,9 @@ class DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_BASE : public DIALOG_SHIM
wxStaticText* m_SolderPasteMarginLabel;
wxTextCtrl* m_SolderPasteMarginCtrl;
wxStaticText* m_SolderPasteMarginUnits;
wxStaticText* m_staticTextRatio;
TEXT_CTRL_EVAL* m_SolderPasteMarginRatioCtrl;
wxStaticText* m_SolderPasteRatioMarginUnits;
wxStaticText* m_PasteMarginRatioLabel;
TEXT_CTRL_EVAL* m_PasteMarginRatioCtrl;
wxStaticText* m_PasteMarginRatioUnits;
wxStaticText* m_staticTextInfoCopper;
wxStaticText* m_staticTextInfoPaste;
wxStaticText* m_staticText16;

View File

@ -122,26 +122,34 @@ void PCB_BASE_FRAME::ShowPadPropertiesDialog( PAD* aPad )
DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, PAD* aPad ) :
DIALOG_PAD_PROPERTIES_BASE( aParent ),
m_parent( aParent ),
m_canUpdate( false ),
m_posX( aParent, m_posXLabel, m_posXCtrl, m_posXUnits ),
m_posY( aParent, m_posYLabel, m_posYCtrl, m_posYUnits ),
m_sizeX( aParent, m_sizeXLabel, m_sizeXCtrl, m_sizeXUnits ),
m_sizeY( aParent, m_sizeYLabel, m_sizeYCtrl, m_sizeYUnits ),
m_offsetX( aParent, m_offsetXLabel, m_offsetXCtrl, m_offsetXUnits ),
m_offsetY( aParent, m_offsetYLabel, m_offsetYCtrl, m_offsetYUnits ),
m_padToDie( aParent, m_padToDieLabel, m_padToDieCtrl, m_padToDieUnits ),
m_trapDelta( aParent, m_trapDeltaLabel, m_trapDeltaCtrl, m_trapDeltaUnits ),
m_cornerRadius( aParent, m_cornerRadiusLabel, m_tcCornerRadius, m_cornerRadiusUnits ),
m_holeX( aParent, m_holeXLabel, m_holeXCtrl, m_holeXUnits ),
m_holeY( aParent, m_holeYLabel, m_holeYCtrl, m_holeYUnits ),
m_OrientValidator( 3, &m_OrientValue ),
m_clearance( aParent, m_clearanceLabel, m_clearanceCtrl, m_clearanceUnits ),
m_maskClearance( aParent, m_maskClearanceLabel, m_maskClearanceCtrl, m_maskClearanceUnits ),
m_pasteClearance( aParent, m_pasteClearanceLabel, m_pasteClearanceCtrl, m_pasteClearanceUnits ),
m_spokeWidth( aParent, m_spokeWidthLabel, m_spokeWidthCtrl, m_spokeWidthUnits ),
m_thermalGap( aParent, m_thermalGapLabel, m_thermalGapCtrl, m_thermalGapUnits )
DIALOG_PAD_PROPERTIES_BASE( aParent ),
m_parent( aParent ),
m_canUpdate( false ),
m_posX( aParent, m_posXLabel, m_posXCtrl, m_posXUnits ),
m_posY( aParent, m_posYLabel, m_posYCtrl, m_posYUnits ),
m_sizeX( aParent, m_sizeXLabel, m_sizeXCtrl, m_sizeXUnits ),
m_sizeY( aParent, m_sizeYLabel, m_sizeYCtrl, m_sizeYUnits ),
m_offsetX( aParent, m_offsetXLabel, m_offsetXCtrl, m_offsetXUnits ),
m_offsetY( aParent, m_offsetYLabel, m_offsetYCtrl, m_offsetYUnits ),
m_padToDie( aParent, m_padToDieLabel, m_padToDieCtrl, m_padToDieUnits ),
m_trapDelta( aParent, m_trapDeltaLabel, m_trapDeltaCtrl, m_trapDeltaUnits ),
m_cornerRadius( aParent, m_cornerRadiusLabel, m_cornerRadiusCtrl, m_cornerRadiusUnits ),
m_cornerRatio( aParent, m_cornerRatioLabel, m_cornerRatioCtrl, m_cornerRatioUnits ),
m_chamferRatio( aParent, m_chamferRatioLabel, m_chamferRatioCtrl, m_chamferRatioUnits ),
m_mixedCornerRatio( aParent, m_mixedCornerRatioLabel, m_mixedCornerRatioCtrl,
m_mixedCornerRatioUnits ),
m_mixedChamferRatio( aParent, m_mixedChamferRatioLabel, m_mixedChamferRatioCtrl,
m_mixedChamferRatioUnits ),
m_holeX( aParent, m_holeXLabel, m_holeXCtrl, m_holeXUnits ),
m_holeY( aParent, m_holeYLabel, m_holeYCtrl, m_holeYUnits ),
m_OrientValidator( 3, &m_OrientValue ),
m_clearance( aParent, m_clearanceLabel, m_clearanceCtrl, m_clearanceUnits ),
m_maskMargin( aParent, m_maskMarginLabel, m_maskMarginCtrl, m_maskMarginUnits ),
m_pasteMargin( aParent, m_pasteMarginLabel, m_pasteMarginCtrl, m_pasteMarginUnits ),
m_pasteMarginRatio( aParent, m_pasteMarginRatioLabel, m_pasteMarginRatioCtrl,
m_pasteMarginRatioUnits ),
m_spokeWidth( aParent, m_spokeWidthLabel, m_spokeWidthCtrl, m_spokeWidthUnits ),
m_thermalGap( aParent, m_thermalGapLabel, m_thermalGapCtrl, m_thermalGapUnits )
{
SetName( PAD_PROPERTIES_DLG_NAME );
m_isFpEditor = dynamic_cast<FOOTPRINT_EDIT_FRAME*>( aParent ) != nullptr;
@ -185,6 +193,16 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, PAD* aPad
if( !m_dummyPad->GetParent() )
m_dummyPad->SetParent( m_board );
m_cornerRatio.SetUnits( EDA_UNITS::PERCENT );
m_chamferRatio.SetUnits( EDA_UNITS::PERCENT );
m_mixedCornerRatio.SetUnits( EDA_UNITS::PERCENT );
m_mixedChamferRatio.SetUnits( EDA_UNITS::PERCENT );
m_pasteMargin.SetNegativeZero();
m_pasteMarginRatio.SetUnits( EDA_UNITS::PERCENT );
m_pasteMarginRatio.SetNegativeZero();
initValues();
wxFont infoFont = KIUI::GetInfoFont();
@ -330,16 +348,13 @@ void DIALOG_PAD_PROPERTIES::prepareCanvas()
void DIALOG_PAD_PROPERTIES::updateRoundRectCornerValues()
{
// Note: use m_tcCornerSizeRatio->ChangeValue() to avoid generating a wxEVT_TEXT event
// Note: use ChangeValue() to avoid generating a wxEVT_TEXT event
wxString ratio = wxString::Format( "%.1f", m_dummyPad->GetRoundRectRadiusRatio() * 100 );
m_tcCornerSizeRatio->ChangeValue( ratio );
m_tcMixedCornerSizeRatio->ChangeValue( ratio );
m_cornerRadius.ChangeValue( m_dummyPad->GetRoundRectCornerRadius() );
m_cornerRatio.ChangeDoubleValue( m_dummyPad->GetRoundRectRadiusRatio() * 100.0 );
m_mixedCornerRatio.ChangeDoubleValue( m_dummyPad->GetRoundRectRadiusRatio() * 100.0 );
ratio = wxString::Format( "%.1f", m_dummyPad->GetChamferRectRatio() * 100 );
m_tcChamferRatio->ChangeValue( ratio );
m_tcMixedChamferRatio->ChangeValue( ratio );
m_chamferRatio.ChangeDoubleValue( m_dummyPad->GetChamferRectRatio() * 100.0 );
m_mixedChamferRatio.ChangeDoubleValue( m_dummyPad->GetChamferRectRatio() * 100.0 );
}
@ -347,22 +362,18 @@ void DIALOG_PAD_PROPERTIES::onCornerRadiusChange( wxCommandEvent& event )
{
if( m_dummyPad->GetShape() != PAD_SHAPE::ROUNDRECT &&
m_dummyPad->GetShape() != PAD_SHAPE::CHAMFERED_RECT )
return;
double rrRadius = m_cornerRadius.GetValue();
if( rrRadius < 0.0 )
{
rrRadius = 0.0;
m_tcCornerRadius->ChangeValue( wxString::Format( "%.1f", rrRadius ) );
return;
}
transferDataToPad( m_dummyPad );
m_dummyPad->SetRoundRectCornerRadius( rrRadius );
if( m_cornerRadius.GetValue() < 0 )
m_cornerRadiusCtrl->ChangeValue( "0" );
auto ratio = wxString::Format( "%.1f", m_dummyPad->GetRoundRectRadiusRatio() * 100 );
m_tcCornerSizeRatio->ChangeValue( ratio );
m_tcMixedCornerSizeRatio->ChangeValue( ratio );
transferDataToPad( m_dummyPad );
m_dummyPad->SetRoundRectCornerRadius( m_cornerRadius.GetValue() );
m_cornerRatio.ChangeDoubleValue( m_dummyPad->GetRoundRectRadiusRatio() * 100.0 );
m_mixedCornerRatio.ChangeDoubleValue( m_dummyPad->GetRoundRectRadiusRatio() * 100.0 );
redraw();
}
@ -380,7 +391,7 @@ void DIALOG_PAD_PROPERTIES::onCornerSizePercentChange( wxCommandEvent& event )
wxString value = event.GetString();
bool changed = false;
if( ctrl == m_tcCornerSizeRatio || ctrl == m_tcMixedCornerSizeRatio )
if( ctrl == m_cornerRatioCtrl || ctrl == m_mixedCornerRatioCtrl )
{
double ratioPercent;
@ -389,29 +400,24 @@ void DIALOG_PAD_PROPERTIES::onCornerSizePercentChange( wxCommandEvent& event )
// 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_tcMixedCornerSizeRatio->ChangeValue( value );
m_cornerRatio.SetDoubleValue( 0.0 );
m_mixedCornerRatio.SetDoubleValue( 0.0 );
}
if( ratioPercent > 50.0 )
else if( ratioPercent > 50.0 )
{
ratioPercent = 0.5;
value.Printf( "%.1f", ratioPercent*100.0 );
m_tcCornerSizeRatio->ChangeValue( value );
m_tcMixedCornerSizeRatio->ChangeValue( value );
m_cornerRatio.SetDoubleValue( 50.0 );
m_mixedCornerRatio.SetDoubleValue( 50.0 );
}
if( ctrl == m_tcCornerSizeRatio )
m_tcMixedCornerSizeRatio->ChangeValue( value );
if( ctrl == m_cornerRatioCtrl )
m_mixedCornerRatioCtrl->ChangeValue( value );
else
m_tcCornerSizeRatio->ChangeValue( value );
m_cornerRatioCtrl->ChangeValue( value );
changed = true;
}
}
else if( ctrl == m_tcChamferRatio || ctrl == m_tcMixedChamferRatio )
else if( ctrl == m_chamferRatioCtrl || ctrl == m_mixedChamferRatioCtrl )
{
double ratioPercent;
@ -420,24 +426,19 @@ void DIALOG_PAD_PROPERTIES::onCornerSizePercentChange( wxCommandEvent& event )
// 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_tcMixedChamferRatio->ChangeValue( value );
m_chamferRatio.SetDoubleValue( 0.0 );
m_mixedChamferRatio.SetDoubleValue( 0.0 );
}
if( ratioPercent > 50.0 )
else if( ratioPercent > 50.0 )
{
ratioPercent = 0.5;
value.Printf( "%.1f", ratioPercent*100.0 );
m_tcChamferRatio->ChangeValue( value );
m_tcMixedChamferRatio->ChangeValue( value );
m_chamferRatio.SetDoubleValue( 50.0 );
m_mixedChamferRatio.SetDoubleValue( 50.0 );
}
if( ctrl == m_tcChamferRatio )
m_tcMixedChamferRatio->ChangeValue( value );
if( ctrl == m_chamferRatioCtrl )
m_mixedChamferRatioCtrl->ChangeValue( value );
else
m_tcChamferRatio->ChangeValue( value );
m_chamferRatioCtrl->ChangeValue( value );
changed = true;
}
@ -546,22 +547,11 @@ void DIALOG_PAD_PROPERTIES::initValues()
m_padToDie.ChangeValue( m_dummyPad->GetPadToDieLength() );
m_clearance.ChangeValue( m_dummyPad->GetLocalClearance() );
m_maskClearance.ChangeValue( m_dummyPad->GetLocalSolderMaskMargin() );
m_maskMargin.ChangeValue( m_dummyPad->GetLocalSolderMaskMargin() );
m_spokeWidth.ChangeValue( m_dummyPad->GetThermalSpokeWidth() );
m_thermalGap.ChangeValue( m_dummyPad->GetThermalGap() );
m_pasteClearance.ChangeValue( m_dummyPad->GetLocalSolderPasteMargin() );
// Prefer "-0" to "0" for normally negative values
if( m_dummyPad->GetLocalSolderPasteMargin() == 0 )
m_pasteClearanceCtrl->ChangeValue( wxT( "-" ) + m_pasteClearanceCtrl->GetValue() );
msg.Printf( wxT( "%f" ), m_dummyPad->GetLocalSolderPasteMarginRatio() * 100.0 );
if( m_dummyPad->GetLocalSolderPasteMarginRatio() == 0.0 && msg[0] == '0' )
// Sometimes Printf adds a sign if the value is small
m_SolderPasteMarginRatioCtrl->ChangeValue( wxT( "-" ) + msg );
else
m_SolderPasteMarginRatioCtrl->ChangeValue( msg );
m_pasteMargin.ChangeValue( m_dummyPad->GetLocalSolderPasteMargin() );
m_pasteMarginRatio.ChangeDoubleValue( m_dummyPad->GetLocalSolderPasteMarginRatio() * 100.0 );
switch( m_dummyPad->GetZoneConnection() )
{
@ -810,7 +800,7 @@ void DIALOG_PAD_PROPERTIES::OnPadShapeSelection( wxCommandEvent& event )
// A reasonable default (from IPC-7351C)
if( m_dummyPad->GetRoundRectRadiusRatio() == 0.0 )
m_tcCornerSizeRatio->ChangeValue( "25" );
m_cornerRatio.ChangeValue( 25 );
break;
}
@ -823,8 +813,7 @@ void DIALOG_PAD_PROPERTIES::OnPadShapeSelection( wxCommandEvent& event )
m_dummyPad->SetChamferRectRatio( 0.2 );
// Ensure the displayed value is up to date:
m_tcChamferRatio->ChangeValue( wxString::Format( "%.1f",
m_dummyPad->GetChamferRectRatio() * 100 ) );
m_chamferRatio.ChangeDoubleValue( m_dummyPad->GetChamferRectRatio() * 100.0 );
// A reasonable default is one corner chamfered (usual for some SMD pads).
if( !m_cbTopLeft->GetValue() && !m_cbTopRight->GetValue()
@ -853,10 +842,8 @@ void DIALOG_PAD_PROPERTIES::OnPadShapeSelection( wxCommandEvent& event )
}
// Ensure the displayed values are up to date:
m_tcMixedChamferRatio->ChangeValue( wxString::Format( "%.1f",
m_dummyPad->GetChamferRectRatio() * 100 ) );
m_tcMixedCornerSizeRatio->ChangeValue( wxString::Format( "%.1f",
m_dummyPad->GetRoundRectRadiusRatio() * 100 ) );
m_mixedChamferRatio.ChangeDoubleValue( m_dummyPad->GetChamferRectRatio() * 100.0 );
m_mixedCornerRatio.ChangeDoubleValue( m_dummyPad->GetRoundRectRadiusRatio() * 100.0 );
break;
case CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR: // PAD_SHAPE::CUSTOM, circular anchor
@ -1401,21 +1388,12 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
if( m_dummyPad->GetShape() == PAD_SHAPE::ROUNDRECT ||
m_dummyPad->GetShape() == PAD_SHAPE::CHAMFERED_RECT )
{
wxASSERT( m_tcCornerSizeRatio->GetValue() == m_tcMixedCornerSizeRatio->GetValue() );
wxString value = m_tcCornerSizeRatio->GetValue();
double rrRadiusRatioPercent;
wxASSERT( m_cornerRatio.GetValue() == m_mixedCornerRatio.GetValue() );
if( !value.ToDouble( &rrRadiusRatioPercent ) )
{
error_msgs.Add( _( "Error: Corner size not a number." ) );
}
else
{
if( rrRadiusRatioPercent < 0.0 )
error_msgs.Add( _( "Error: Negative corner size." ) );
else if( rrRadiusRatioPercent > 50.0 )
warning_msgs.Add( _( "Warning: Corner size will make pad circular." ) );
}
if( m_cornerRatio.GetDoubleValue() < 0.0 )
error_msgs.Add( _( "Error: Negative corner size." ) );
else if( m_cornerRatio.GetDoubleValue() > 50.0 )
warning_msgs.Add( _( "Warning: Corner size will make pad circular." ) );
}
// PADSTACKS TODO: this will need to check each layer in the pad...
@ -1716,16 +1694,12 @@ bool DIALOG_PAD_PROPERTIES::transferDataToPad( PAD* aPad )
// Read pad clearances values:
aPad->SetLocalClearance( m_clearance.GetValue() );
aPad->SetLocalSolderMaskMargin( m_maskClearance.GetValue() );
aPad->SetLocalSolderPasteMargin( m_pasteClearance.GetValue() );
aPad->SetLocalSolderMaskMargin( m_maskMargin.GetValue() );
aPad->SetLocalSolderPasteMargin( m_pasteMargin.GetValue() );
aPad->SetLocalSolderPasteMarginRatio( m_pasteMarginRatio.GetDoubleValue() / 100.0 );
aPad->SetThermalSpokeWidth( m_spokeWidth.GetValue() );
aPad->SetThermalGap( m_thermalGap.GetValue() );
double dtmp = 0.0;
msg = m_SolderPasteMarginRatioCtrl->GetValue();
msg.ToDouble( &dtmp );
aPad->SetLocalSolderPasteMarginRatio( dtmp / 100 );
switch( m_ZoneConnectionChoice->GetSelection() )
{
default:
@ -1885,30 +1859,18 @@ bool DIALOG_PAD_PROPERTIES::transferDataToPad( PAD* aPad )
if( aPad->GetShape() == PAD_SHAPE::ROUNDRECT )
{
double ratioPercent;
m_tcCornerSizeRatio->GetValue().ToDouble( &ratioPercent );
aPad->SetRoundRectRadiusRatio( ratioPercent / 100.0 );
aPad->SetRoundRectRadiusRatio( m_cornerRatio.GetDoubleValue() / 100.0 );
}
if( aPad->GetShape() == PAD_SHAPE::CHAMFERED_RECT )
else if( aPad->GetShape() == PAD_SHAPE::CHAMFERED_RECT )
{
if( m_PadShapeSelector->GetSelection() == CHOICE_SHAPE_CHAMFERED_ROUNDED_RECT )
{
double ratioPercent;
m_tcMixedCornerSizeRatio->GetValue().ToDouble( &ratioPercent );
aPad->SetRoundRectRadiusRatio( ratioPercent / 100.0 );
m_tcMixedChamferRatio->GetValue().ToDouble( &ratioPercent );
aPad->SetChamferRectRatio( ratioPercent / 100.0 );
aPad->SetChamferRectRatio( m_mixedChamferRatio.GetDoubleValue() / 100.0 );
aPad->SetRoundRectRadiusRatio( m_mixedCornerRatio.GetDoubleValue() / 100.0 );
}
else // Choice is CHOICE_SHAPE_CHAMFERED_RECT, no rounded corner
{
double ratioPercent;
m_tcChamferRatio->GetValue().ToDouble( &ratioPercent );
aPad->SetChamferRectRatio( ratioPercent / 100.0 );
aPad->SetChamferRectRatio( m_chamferRatio.GetDoubleValue() / 100.0 );
aPad->SetRoundRectRadiusRatio( 0 );
}
}

View File

@ -153,12 +153,15 @@ private:
UNIT_BINDER m_offsetX, m_offsetY;
UNIT_BINDER m_padToDie;
UNIT_BINDER m_trapDelta;
UNIT_BINDER m_cornerRadius;
UNIT_BINDER m_cornerRatio, m_cornerRadius;
UNIT_BINDER m_chamferRatio;
UNIT_BINDER m_mixedCornerRatio, m_mixedChamferRatio;
UNIT_BINDER m_holeX, m_holeY;
wxFloatingPointValidator<double> m_OrientValidator;
double m_OrientValue;
UNIT_BINDER m_clearance;
UNIT_BINDER m_maskClearance, m_pasteClearance;
UNIT_BINDER m_maskMargin;
UNIT_BINDER m_pasteMargin, m_pasteMarginRatio;
UNIT_BINDER m_spokeWidth, m_thermalGap;
};

View File

@ -156,18 +156,18 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind
fgSizerRoundingProps->SetFlexibleDirection( wxBOTH );
fgSizerRoundingProps->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
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.") );
m_cornerRatioLabel = new wxStaticText( m_roudingProps, wxID_ANY, _("Corner size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_cornerRatioLabel->Wrap( -1 );
m_cornerRatioLabel->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|wxRIGHT, 5 );
fgSizerRoundingProps->Add( m_cornerRatioLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 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_cornerRatioCtrl = new TEXT_CTRL_EVAL( m_roudingProps, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerRoundingProps->Add( m_cornerRatioCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_staticTextCornerSizeRatioUnit = new wxStaticText( m_roudingProps, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextCornerSizeRatioUnit->Wrap( -1 );
fgSizerRoundingProps->Add( m_staticTextCornerSizeRatioUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_cornerRatioUnits = new wxStaticText( m_roudingProps, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_cornerRatioUnits->Wrap( -1 );
fgSizerRoundingProps->Add( m_cornerRatioUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_cornerRadiusLabel = new wxStaticText( m_roudingProps, wxID_ANY, _("Corner radius:"), wxDefaultPosition, wxDefaultSize, 0 );
m_cornerRadiusLabel->Wrap( -1 );
@ -175,8 +175,8 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind
fgSizerRoundingProps->Add( m_cornerRadiusLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 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_cornerRadiusCtrl = new wxTextCtrl( m_roudingProps, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerRoundingProps->Add( m_cornerRadiusCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_cornerRadiusUnits = new wxStaticText( m_roudingProps, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_cornerRadiusUnits->Wrap( -1 );
@ -194,18 +194,18 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind
fgSizerChamferProps->SetFlexibleDirection( wxBOTH );
fgSizerChamferProps->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
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.") );
m_chamferRatioLabel = new wxStaticText( m_chamferProps, wxID_ANY, _("Chamfer size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_chamferRatioLabel->Wrap( -1 );
m_chamferRatioLabel->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|wxRIGHT, 5 );
fgSizerChamferProps->Add( m_chamferRatioLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 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_chamferRatioCtrl = new TEXT_CTRL_EVAL( m_chamferProps, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerChamferProps->Add( m_chamferRatioCtrl, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_staticTextChamferRatioUnit = new wxStaticText( m_chamferProps, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextChamferRatioUnit->Wrap( -1 );
fgSizerChamferProps->Add( m_staticTextChamferRatioUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_chamferRatioUnits = new wxStaticText( m_chamferProps, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_chamferRatioUnits->Wrap( -1 );
fgSizerChamferProps->Add( m_chamferRatioUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_staticTextChamferCorner = new wxStaticText( m_chamferProps, wxID_ANY, _("Chamfer corners:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextChamferCorner->Wrap( -1 );
@ -244,18 +244,18 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind
fgMixedProps->SetFlexibleDirection( wxBOTH );
fgMixedProps->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_stMixedChamferRatio = new wxStaticText( m_mixedProps, wxID_ANY, _("Chamfer size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_stMixedChamferRatio->Wrap( -1 );
m_stMixedChamferRatio->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.") );
m_mixedChamferRatioLabel = new wxStaticText( m_mixedProps, wxID_ANY, _("Chamfer size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_mixedChamferRatioLabel->Wrap( -1 );
m_mixedChamferRatioLabel->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_stMixedChamferRatio, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgMixedProps->Add( m_mixedChamferRatioLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_tcMixedChamferRatio = new TEXT_CTRL_EVAL( m_mixedProps, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgMixedProps->Add( m_tcMixedChamferRatio, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_mixedChamferRatioCtrl = new TEXT_CTRL_EVAL( m_mixedProps, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgMixedProps->Add( m_mixedChamferRatioCtrl, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_stMixedChamferRatioUnit = new wxStaticText( m_mixedProps, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_stMixedChamferRatioUnit->Wrap( -1 );
fgMixedProps->Add( m_stMixedChamferRatioUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_mixedChamferRatioUnits = new wxStaticText( m_mixedProps, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_mixedChamferRatioUnits->Wrap( -1 );
fgMixedProps->Add( m_mixedChamferRatioUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_staticTextChamferCorner1 = new wxStaticText( m_mixedProps, wxID_ANY, _("Chamfer corners:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextChamferCorner1->Wrap( -1 );
@ -285,18 +285,18 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind
fgMixedProps->Add( 0, 0, 1, wxEXPAND, 5 );
m_stMixedCornerSizeRatio = new wxStaticText( m_mixedProps, wxID_ANY, _("Corner radius:"), wxDefaultPosition, wxDefaultSize, 0 );
m_stMixedCornerSizeRatio->Wrap( -1 );
m_stMixedCornerSizeRatio->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.") );
m_mixedCornerRatioLabel = new wxStaticText( m_mixedProps, wxID_ANY, _("Corner size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_mixedCornerRatioLabel->Wrap( -1 );
m_mixedCornerRatioLabel->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_stMixedCornerSizeRatio, 0, wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
fgMixedProps->Add( m_mixedCornerRatioLabel, 0, wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
m_tcMixedCornerSizeRatio = new TEXT_CTRL_EVAL( m_mixedProps, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgMixedProps->Add( m_tcMixedCornerSizeRatio, 0, wxEXPAND|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_mixedCornerRatioCtrl = new TEXT_CTRL_EVAL( m_mixedProps, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgMixedProps->Add( m_mixedCornerRatioCtrl, 0, wxEXPAND|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_stMixedCornerSizeRatioUnit = new wxStaticText( m_mixedProps, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_stMixedCornerSizeRatioUnit->Wrap( -1 );
fgMixedProps->Add( m_stMixedCornerSizeRatioUnit, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_mixedCornerRatioUnits = new wxStaticText( m_mixedProps, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_mixedCornerRatioUnits->Wrap( -1 );
fgMixedProps->Add( m_mixedCornerRatioUnits, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_mixedProps->SetSizer( fgMixedProps );
@ -622,44 +622,44 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind
m_clearanceUnits->Wrap( -1 );
fgClearancesGridSizer->Add( m_clearanceUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
m_maskClearanceLabel = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("Solder mask clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_maskClearanceLabel->Wrap( -1 );
m_maskClearanceLabel->SetToolTip( _("This is the local clearance between this pad and the solder mask.\nIf 0, the footprint local value or the global value is used.") );
m_maskMarginLabel = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("Solder mask clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_maskMarginLabel->Wrap( -1 );
m_maskMarginLabel->SetToolTip( _("This is the local clearance between this pad and the solder mask.\nIf 0, the footprint local value or the global value is used.") );
fgClearancesGridSizer->Add( m_maskClearanceLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP, 5 );
fgClearancesGridSizer->Add( m_maskMarginLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP, 5 );
m_maskClearanceCtrl = new wxTextCtrl( sbClearancesSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgClearancesGridSizer->Add( m_maskClearanceCtrl, 0, wxEXPAND|wxLEFT|wxTOP, 5 );
m_maskMarginCtrl = new wxTextCtrl( sbClearancesSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgClearancesGridSizer->Add( m_maskMarginCtrl, 0, wxEXPAND|wxLEFT|wxTOP, 5 );
m_maskClearanceUnits = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 );
m_maskClearanceUnits->Wrap( -1 );
fgClearancesGridSizer->Add( m_maskClearanceUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
m_maskMarginUnits = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 );
m_maskMarginUnits->Wrap( -1 );
fgClearancesGridSizer->Add( m_maskMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
m_pasteClearanceLabel = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("Solder paste absolute clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_pasteClearanceLabel->Wrap( -1 );
m_pasteClearanceLabel->SetToolTip( _("This is the local clearance between this pad and the solder paste.\nIf 0, the footprint value or the global value is used.\nThe final clearance value is the sum of this value and the clearance value ratio.\nA negative value means a smaller mask size than pad size.") );
m_pasteMarginLabel = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("Solder paste absolute clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_pasteMarginLabel->Wrap( -1 );
m_pasteMarginLabel->SetToolTip( _("This is the local clearance between this pad and the solder paste.\nIf 0, the footprint value or the global value is used.\nThe final clearance value is the sum of this value and the clearance value ratio.\nA negative value means a smaller mask size than pad size.") );
fgClearancesGridSizer->Add( m_pasteClearanceLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP, 5 );
fgClearancesGridSizer->Add( m_pasteMarginLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP, 5 );
m_pasteClearanceCtrl = new wxTextCtrl( sbClearancesSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgClearancesGridSizer->Add( m_pasteClearanceCtrl, 0, wxEXPAND|wxLEFT|wxTOP, 5 );
m_pasteMarginCtrl = new wxTextCtrl( sbClearancesSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgClearancesGridSizer->Add( m_pasteMarginCtrl, 0, wxEXPAND|wxLEFT|wxTOP, 5 );
m_pasteClearanceUnits = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 );
m_pasteClearanceUnits->Wrap( -1 );
fgClearancesGridSizer->Add( m_pasteClearanceUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
m_pasteMarginUnits = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 );
m_pasteMarginUnits->Wrap( -1 );
fgClearancesGridSizer->Add( m_pasteMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
m_staticTextRatio = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("Solder paste relative clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextRatio->Wrap( -1 );
m_staticTextRatio->SetToolTip( _("This is the local clearance ratio in percent between this pad and the solder paste.\nA value of 10 means the clearance value is 10 percent of the pad size.\nIf 0, the footprint value or the global value is used.\nThe final clearance value is the sum of this value and the clearance value.\nA negative value means a smaller mask size than pad size.") );
m_pasteMarginRatioLabel = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("Solder paste relative clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_pasteMarginRatioLabel->Wrap( -1 );
m_pasteMarginRatioLabel->SetToolTip( _("This is the local clearance ratio in percent between this pad and the solder paste.\nA value of 10 means the clearance value is 10 percent of the pad size.\nIf 0, the footprint value or the global value is used.\nThe final clearance value is the sum of this value and the clearance value.\nA negative value means a smaller mask size than pad size.") );
fgClearancesGridSizer->Add( m_staticTextRatio, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 );
fgClearancesGridSizer->Add( m_pasteMarginRatioLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 );
m_SolderPasteMarginRatioCtrl = new TEXT_CTRL_EVAL( sbClearancesSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgClearancesGridSizer->Add( m_SolderPasteMarginRatioCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxTOP, 5 );
m_pasteMarginRatioCtrl = new TEXT_CTRL_EVAL( sbClearancesSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgClearancesGridSizer->Add( m_pasteMarginRatioCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxTOP, 5 );
m_SolderPasteRatioMarginUnits = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_SolderPasteRatioMarginUnits->Wrap( -1 );
fgClearancesGridSizer->Add( m_SolderPasteRatioMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_pasteMarginRatioUnits = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_pasteMarginRatioUnits->Wrap( -1 );
fgClearancesGridSizer->Add( m_pasteMarginRatioUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
sbClearancesSizer->Add( fgClearancesGridSizer, 0, wxEXPAND, 5 );
@ -1012,19 +1012,19 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind
m_PadShapeSelector->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPadShapeSelection ), NULL, this );
m_trapDeltaCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this );
m_trapAxisCtrl->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this );
m_tcCornerSizeRatio->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerSizePercentChange ), NULL, this );
m_tcCornerRadius->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerRadiusChange ), NULL, this );
m_tcChamferRatio->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerSizePercentChange ), NULL, this );
m_cornerRatioCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerSizePercentChange ), NULL, this );
m_cornerRadiusCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerRadiusChange ), NULL, this );
m_chamferRatioCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerSizePercentChange ), NULL, this );
m_cbTopLeft->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this );
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_tcMixedChamferRatio->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerSizePercentChange ), NULL, this );
m_mixedChamferRatioCtrl->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_tcMixedCornerSizeRatio->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerSizePercentChange ), NULL, this );
m_mixedCornerRatioCtrl->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 );
@ -1072,19 +1072,19 @@ DIALOG_PAD_PROPERTIES_BASE::~DIALOG_PAD_PROPERTIES_BASE()
m_PadShapeSelector->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPadShapeSelection ), NULL, this );
m_trapDeltaCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this );
m_trapAxisCtrl->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this );
m_tcCornerSizeRatio->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerSizePercentChange ), NULL, this );
m_tcCornerRadius->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerRadiusChange ), NULL, this );
m_tcChamferRatio->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerSizePercentChange ), NULL, this );
m_cornerRatioCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerSizePercentChange ), NULL, this );
m_cornerRadiusCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerRadiusChange ), NULL, this );
m_chamferRatioCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerSizePercentChange ), NULL, this );
m_cbTopLeft->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this );
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_tcMixedChamferRatio->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerSizePercentChange ), NULL, this );
m_mixedChamferRatioCtrl->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_tcMixedCornerSizeRatio->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCornerSizePercentChange ), NULL, this );
m_mixedCornerRatioCtrl->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 );

View File

@ -1388,10 +1388,10 @@
<property name="window_style">wxTAB_TRAVERSAL</property>
</object>
</object>
<object class="simplebookpage" expanded="0">
<object class="simplebookpage" expanded="1">
<property name="label">a page</property>
<property name="select">0</property>
<object class="wxPanel" expanded="0">
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1770,10 +1770,10 @@
</object>
</object>
</object>
<object class="simplebookpage" expanded="0">
<object class="simplebookpage" expanded="1">
<property name="label">a page</property>
<property name="select">0</property>
<object class="wxPanel" expanded="0">
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1824,7 +1824,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxFlexGridSizer" expanded="0">
<object class="wxFlexGridSizer" expanded="1">
<property name="cols">3</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">1</property>
@ -1877,7 +1877,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextCornerSizeRatio</property>
<property name="name">m_cornerRatioLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1937,7 +1937,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_tcCornerSizeRatio</property>
<property name="name">m_cornerRatioCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -2003,7 +2003,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextCornerSizeRatioUnit</property>
<property name="name">m_cornerRatioUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -2124,7 +2124,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_tcCornerRadius</property>
<property name="name">m_cornerRadiusCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -2213,10 +2213,10 @@
</object>
</object>
</object>
<object class="simplebookpage" expanded="0">
<object class="simplebookpage" expanded="1">
<property name="label">a page</property>
<property name="select">0</property>
<object class="wxPanel" expanded="0">
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -2267,7 +2267,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxFlexGridSizer" expanded="0">
<object class="wxFlexGridSizer" expanded="1">
<property name="cols">3</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">1</property>
@ -2320,7 +2320,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextChamferRatio</property>
<property name="name">m_chamferRatioLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -2380,7 +2380,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_tcChamferRatio</property>
<property name="name">m_chamferRatioCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -2446,7 +2446,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextChamferRatioUnit</property>
<property name="name">m_chamferRatioUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -2911,7 +2911,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_stMixedChamferRatio</property>
<property name="name">m_mixedChamferRatioLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -2971,7 +2971,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_tcMixedChamferRatio</property>
<property name="name">m_mixedChamferRatioCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -3037,7 +3037,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_stMixedChamferRatioUnit</property>
<property name="name">m_mixedChamferRatioUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -3434,7 +3434,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Corner radius:</property>
<property name="label">Corner size:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
@ -3443,7 +3443,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_stMixedCornerSizeRatio</property>
<property name="name">m_mixedCornerRatioLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -3503,7 +3503,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_tcMixedCornerSizeRatio</property>
<property name="name">m_mixedCornerRatioCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -3569,7 +3569,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_stMixedCornerSizeRatioUnit</property>
<property name="name">m_mixedCornerRatioUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -4878,7 +4878,7 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="proportion">0</property>
@ -5015,11 +5015,11 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">25</property>
<property name="flag">wxEXPAND|wxLEFT|wxRESERVE_SPACE_EVEN_IF_HIDDEN</property>
<property name="proportion">0</property>
<object class="wxFlexGridSizer" expanded="0">
<object class="wxFlexGridSizer" expanded="1">
<property name="cols">6</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">1,4</property>
@ -6884,11 +6884,11 @@
</object>
</object>
</object>
<object class="notebookpage" expanded="0">
<object class="notebookpage" expanded="1">
<property name="bitmap"></property>
<property name="label">Clearance Overrides and Settings</property>
<property name="select">0</property>
<object class="wxPanel" expanded="0">
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -7392,7 +7392,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_maskClearanceLabel</property>
<property name="name">m_maskMarginLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -7452,7 +7452,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_maskClearanceCtrl</property>
<property name="name">m_maskMarginCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -7517,7 +7517,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_maskClearanceUnits</property>
<property name="name">m_maskMarginUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -7578,7 +7578,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_pasteClearanceLabel</property>
<property name="name">m_pasteMarginLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -7638,7 +7638,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_pasteClearanceCtrl</property>
<property name="name">m_pasteMarginCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -7703,7 +7703,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_pasteClearanceUnits</property>
<property name="name">m_pasteMarginUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -7764,7 +7764,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextRatio</property>
<property name="name">m_pasteMarginRatioLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -7824,7 +7824,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_SolderPasteMarginRatioCtrl</property>
<property name="name">m_pasteMarginRatioCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -7889,7 +7889,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_SolderPasteRatioMarginUnits</property>
<property name="name">m_pasteMarginRatioUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>

View File

@ -90,33 +90,33 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM
wxChoice* m_trapAxisCtrl;
wxPanel* m_roudingProps;
wxFlexGridSizer* fgSizerRoundingProps;
wxStaticText* m_staticTextCornerSizeRatio;
TEXT_CTRL_EVAL* m_tcCornerSizeRatio;
wxStaticText* m_staticTextCornerSizeRatioUnit;
wxStaticText* m_cornerRatioLabel;
TEXT_CTRL_EVAL* m_cornerRatioCtrl;
wxStaticText* m_cornerRatioUnits;
wxStaticText* m_cornerRadiusLabel;
wxTextCtrl* m_tcCornerRadius;
wxTextCtrl* m_cornerRadiusCtrl;
wxStaticText* m_cornerRadiusUnits;
wxPanel* m_chamferProps;
wxStaticText* m_staticTextChamferRatio;
TEXT_CTRL_EVAL* m_tcChamferRatio;
wxStaticText* m_staticTextChamferRatioUnit;
wxStaticText* m_chamferRatioLabel;
TEXT_CTRL_EVAL* m_chamferRatioCtrl;
wxStaticText* m_chamferRatioUnits;
wxStaticText* m_staticTextChamferCorner;
wxCheckBox* m_cbTopLeft;
wxCheckBox* m_cbTopRight;
wxCheckBox* m_cbBottomLeft;
wxCheckBox* m_cbBottomRight;
wxPanel* m_mixedProps;
wxStaticText* m_stMixedChamferRatio;
TEXT_CTRL_EVAL* m_tcMixedChamferRatio;
wxStaticText* m_stMixedChamferRatioUnit;
wxStaticText* m_mixedChamferRatioLabel;
TEXT_CTRL_EVAL* m_mixedChamferRatioCtrl;
wxStaticText* m_mixedChamferRatioUnits;
wxStaticText* m_staticTextChamferCorner1;
wxCheckBox* m_cbTopLeft1;
wxCheckBox* m_cbTopRight1;
wxCheckBox* m_cbBottomLeft1;
wxCheckBox* m_cbBottomRight1;
wxStaticText* m_stMixedCornerSizeRatio;
TEXT_CTRL_EVAL* m_tcMixedCornerSizeRatio;
wxStaticText* m_stMixedCornerSizeRatioUnit;
wxStaticText* m_mixedCornerRatioLabel;
TEXT_CTRL_EVAL* m_mixedCornerRatioCtrl;
wxStaticText* m_mixedCornerRatioUnits;
wxStaticText* m_sizeXLabel;
wxTextCtrl* m_sizeXCtrl;
wxStaticText* m_sizeXUnits;
@ -175,15 +175,15 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM
wxStaticText* m_clearanceLabel;
wxTextCtrl* m_clearanceCtrl;
wxStaticText* m_clearanceUnits;
wxStaticText* m_maskClearanceLabel;
wxTextCtrl* m_maskClearanceCtrl;
wxStaticText* m_maskClearanceUnits;
wxStaticText* m_pasteClearanceLabel;
wxTextCtrl* m_pasteClearanceCtrl;
wxStaticText* m_pasteClearanceUnits;
wxStaticText* m_staticTextRatio;
TEXT_CTRL_EVAL* m_SolderPasteMarginRatioCtrl;
wxStaticText* m_SolderPasteRatioMarginUnits;
wxStaticText* m_maskMarginLabel;
wxTextCtrl* m_maskMarginCtrl;
wxStaticText* m_maskMarginUnits;
wxStaticText* m_pasteMarginLabel;
wxTextCtrl* m_pasteMarginCtrl;
wxStaticText* m_pasteMarginUnits;
wxStaticText* m_pasteMarginRatioLabel;
TEXT_CTRL_EVAL* m_pasteMarginRatioCtrl;
wxStaticText* m_pasteMarginRatioUnits;
wxSimplebook* m_nonCopperWarningBook;
wxStaticText* m_nonCopperNote;
wxStaticText* m_staticTextInfoPaste;

View File

@ -32,12 +32,19 @@
PANEL_SETUP_MASK_AND_PASTE::PANEL_SETUP_MASK_AND_PASTE( PAGED_DIALOG* aParent,
PCB_EDIT_FRAME* aFrame ) :
PANEL_SETUP_MASK_AND_PASTE_BASE( aParent->GetTreebook() ),
m_maskMargin( aFrame, m_MaskMarginLabel, m_MaskMarginCtrl, m_MaskMarginUnits ),
m_maskMinWidth( aFrame, m_MaskMinWidthLabel, m_MaskMinWidthCtrl, m_MaskMinWidthUnits ),
m_pasteMargin( aFrame, m_PasteMarginLabel, m_PasteMarginCtrl, m_PasteMarginUnits )
m_maskMargin( aFrame, m_maskMarginLabel, m_maskMarginCtrl, m_maskMarginUnits ),
m_maskMinWidth( aFrame, m_maskMinWidthLabel, m_maskMinWidthCtrl, m_maskMinWidthUnits ),
m_pasteMargin( aFrame, m_pasteMarginLabel, m_pasteMarginCtrl, m_pasteMarginUnits ),
m_pasteMarginRatio( aFrame, m_pasteMarginRatioLabel, m_pasteMarginRatioCtrl,
m_pasteMarginRatioUnits )
{
m_Frame = aFrame;
m_BrdSettings = &m_Frame->GetBoard()->GetDesignSettings();
m_pasteMargin.SetNegativeZero();
m_pasteMarginRatio.SetUnits( EDA_UNITS::PERCENT );
m_pasteMarginRatio.SetNegativeZero();
}
@ -46,21 +53,7 @@ bool PANEL_SETUP_MASK_AND_PASTE::TransferDataToWindow()
m_maskMargin.SetValue( m_BrdSettings->m_SolderMaskMargin );
m_maskMinWidth.SetValue( m_BrdSettings->m_SolderMaskMinWidth );
m_pasteMargin.SetValue( m_BrdSettings->m_SolderPasteMargin );
// Prefer "-0" to "0" for normally negative values
if( m_BrdSettings->m_SolderPasteMargin == 0 )
m_PasteMarginCtrl->SetValue( wxT( "-" ) + m_PasteMarginCtrl->GetValue() );
// Add solder paste margin ratio in percent
// for the usual default value 0.0, display -0.0 (or -0,0 in some countries)
wxString msg;
msg.Printf( wxT( "%f" ), m_BrdSettings->m_SolderPasteMarginRatio * 100.0 );
// Sometimes Printf adds a sign if the value is small
if( m_BrdSettings->m_SolderPasteMarginRatio == 0.0 && msg[0] == '0' )
m_SolderPasteMarginRatioCtrl->SetValue( wxT( "-" ) + msg );
else
m_SolderPasteMarginRatioCtrl->SetValue( msg );
m_pasteMarginRatio.SetDoubleValue( m_BrdSettings->m_SolderPasteMarginRatio * 100.0 );
return true;
}
@ -71,21 +64,8 @@ bool PANEL_SETUP_MASK_AND_PASTE::TransferDataFromWindow()
// These are all stored in project file, not board, so no need for OnModify()
m_BrdSettings->m_SolderMaskMargin = m_maskMargin.GetValue();
m_BrdSettings->m_SolderMaskMinWidth = m_maskMinWidth.GetValue();
m_BrdSettings->m_SolderPasteMargin = m_pasteMargin.GetValue();
double dtmp = 0.0;
wxString 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;
if( dtmp > +100 )
dtmp = +100;
m_BrdSettings->m_SolderPasteMarginRatio = dtmp / 100;
m_BrdSettings->m_SolderPasteMarginRatio = m_pasteMarginRatio.GetDoubleValue() / 100.0;
return true;
}

View File

@ -44,6 +44,7 @@ private:
UNIT_BINDER m_maskMargin;
UNIT_BINDER m_maskMinWidth;
UNIT_BINDER m_pasteMargin;
UNIT_BINDER m_pasteMarginRatio;
public:
PANEL_SETUP_MASK_AND_PASTE( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame );

View File

@ -55,35 +55,35 @@ PANEL_SETUP_MASK_AND_PASTE_BASE::PANEL_SETUP_MASK_AND_PASTE_BASE( wxWindow* pare
fgGridSolderMaskSizer->SetFlexibleDirection( wxBOTH );
fgGridSolderMaskSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_MaskMarginLabel = new wxStaticText( this, wxID_ANY, _("Solder mask clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_MaskMarginLabel->Wrap( -1 );
m_MaskMarginLabel->SetToolTip( _("Global clearance between pads and the solder mask.\nThis value can be superseded by local values for a footprint or a pad.") );
m_maskMarginLabel = new wxStaticText( this, wxID_ANY, _("Solder mask clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_maskMarginLabel->Wrap( -1 );
m_maskMarginLabel->SetToolTip( _("Global clearance between pads and the solder mask.\nThis value can be superseded by local values for a footprint or a pad.") );
fgGridSolderMaskSizer->Add( m_MaskMarginLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
fgGridSolderMaskSizer->Add( m_maskMarginLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_MaskMarginCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_MaskMarginCtrl->SetToolTip( _("Positive clearance means area bigger than the pad (usual for solder mask clearance).") );
m_maskMarginCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_maskMarginCtrl->SetToolTip( _("Positive clearance means area bigger than the pad (usual for solder mask clearance).") );
fgGridSolderMaskSizer->Add( m_MaskMarginCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
fgGridSolderMaskSizer->Add( m_maskMarginCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_MaskMarginUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_MaskMarginUnits->Wrap( -1 );
fgGridSolderMaskSizer->Add( m_MaskMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_maskMarginUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_maskMarginUnits->Wrap( -1 );
fgGridSolderMaskSizer->Add( m_maskMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_MaskMinWidthLabel = new wxStaticText( this, wxID_ANY, _("Solder mask minimum bridge width:"), wxDefaultPosition, wxDefaultSize, 0 );
m_MaskMinWidthLabel->Wrap( -1 );
m_MaskMinWidthLabel->SetToolTip( _("Min. dist between 2 pad areas.\nTwo pad areas nearer than this value will be merged during plotting.\nThis parameter is only used to plot solder mask layers.\nLeave at 0 unless you know what you are doing.") );
m_maskMinWidthLabel = new wxStaticText( this, wxID_ANY, _("Solder mask minimum bridge width:"), wxDefaultPosition, wxDefaultSize, 0 );
m_maskMinWidthLabel->Wrap( -1 );
m_maskMinWidthLabel->SetToolTip( _("Min. dist between 2 pad areas.\nTwo pad areas nearer than this value will be merged during plotting.\nThis parameter is only used to plot solder mask layers.\nLeave at 0 unless you know what you are doing.") );
fgGridSolderMaskSizer->Add( m_MaskMinWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
fgGridSolderMaskSizer->Add( m_maskMinWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_MaskMinWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_MaskMinWidthCtrl->SetToolTip( _("Minimum distance between openings in the solder mask. Pad openings closer than this distance will be plotted as a single opening.") );
m_maskMinWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_maskMinWidthCtrl->SetToolTip( _("Minimum distance between openings in the solder mask. Pad openings closer than this distance will be plotted as a single opening.") );
fgGridSolderMaskSizer->Add( m_MaskMinWidthCtrl, 0, wxEXPAND|wxALL, 5 );
fgGridSolderMaskSizer->Add( m_maskMinWidthCtrl, 0, wxEXPAND|wxALL, 5 );
m_MaskMinWidthUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_MaskMinWidthUnits->Wrap( -1 );
fgGridSolderMaskSizer->Add( m_MaskMinWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_maskMinWidthUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_maskMinWidthUnits->Wrap( -1 );
fgGridSolderMaskSizer->Add( m_maskMinWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
fgGridSolderMaskSizer->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 10 );
@ -94,35 +94,35 @@ PANEL_SETUP_MASK_AND_PASTE_BASE::PANEL_SETUP_MASK_AND_PASTE_BASE( wxWindow* pare
fgGridSolderMaskSizer->Add( 0, 0, 1, wxEXPAND, 5 );
m_PasteMarginLabel = new wxStaticText( this, wxID_ANY, _("Solder paste absolute clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_PasteMarginLabel->Wrap( -1 );
m_PasteMarginLabel->SetToolTip( _("Global clearance between pads and the solder paste.\nThis value can be superseded by local values for a footprint or a pad.\nFinal clearance value is the sum of this value and the clearance value ratio.") );
m_pasteMarginLabel = new wxStaticText( this, wxID_ANY, _("Solder paste absolute clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_pasteMarginLabel->Wrap( -1 );
m_pasteMarginLabel->SetToolTip( _("Global clearance between pads and the solder paste.\nThis value can be superseded by local values for a footprint or a pad.\nFinal clearance value is the sum of this value and the clearance value ratio.") );
fgGridSolderMaskSizer->Add( m_PasteMarginLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
fgGridSolderMaskSizer->Add( m_pasteMarginLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_PasteMarginCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_PasteMarginCtrl->SetToolTip( _("Negative clearance means area smaller than the pad (usual for solder paste clearance).") );
m_pasteMarginCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_pasteMarginCtrl->SetToolTip( _("Negative clearance means area smaller than the pad (usual for solder paste clearance).") );
fgGridSolderMaskSizer->Add( m_PasteMarginCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
fgGridSolderMaskSizer->Add( m_pasteMarginCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_PasteMarginUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_PasteMarginUnits->Wrap( -1 );
fgGridSolderMaskSizer->Add( m_PasteMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_pasteMarginUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_pasteMarginUnits->Wrap( -1 );
fgGridSolderMaskSizer->Add( m_pasteMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_staticTextRatio = new wxStaticText( this, wxID_ANY, _("Solder paste relative clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextRatio->Wrap( -1 );
m_staticTextRatio->SetToolTip( _("Global clearance ratio in percent between pads and the solder paste.\nA value of 10 means the clearance value is 10 percent of the pad size.\nThis value can be superseded by local values for a footprint or a pad.\nFinal clearance value is the sum of this value and the clearance value.") );
m_pasteMarginRatioLabel = new wxStaticText( this, wxID_ANY, _("Solder paste relative clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_pasteMarginRatioLabel->Wrap( -1 );
m_pasteMarginRatioLabel->SetToolTip( _("Global clearance ratio in percent between pads and the solder paste.\nA value of 10 means the clearance value is 10 percent of the pad size.\nThis value can be superseded by local values for a footprint or a pad.\nFinal clearance value is the sum of this value and the clearance value.") );
fgGridSolderMaskSizer->Add( m_staticTextRatio, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
fgGridSolderMaskSizer->Add( m_pasteMarginRatioLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_SolderPasteMarginRatioCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SolderPasteMarginRatioCtrl->SetToolTip( _("Additional clearance as a percentage of the pad size.") );
m_pasteMarginRatioCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_pasteMarginRatioCtrl->SetToolTip( _("Additional clearance as a percentage of the pad size.") );
fgGridSolderMaskSizer->Add( m_SolderPasteMarginRatioCtrl, 0, wxEXPAND|wxALL, 5 );
fgGridSolderMaskSizer->Add( m_pasteMarginRatioCtrl, 0, wxEXPAND|wxALL, 5 );
m_SolderPasteRatioMarginUnits = new wxStaticText( this, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_SolderPasteRatioMarginUnits->Wrap( -1 );
fgGridSolderMaskSizer->Add( m_SolderPasteRatioMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_pasteMarginRatioUnits = new wxStaticText( this, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_pasteMarginRatioUnits->Wrap( -1 );
fgGridSolderMaskSizer->Add( m_pasteMarginRatioUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
bSizer3->Add( fgGridSolderMaskSizer, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );

View File

@ -390,7 +390,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_MaskMarginLabel</property>
<property name="name">m_maskMarginLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -450,7 +450,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_MaskMarginCtrl</property>
<property name="name">m_maskMarginCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -515,7 +515,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_MaskMarginUnits</property>
<property name="name">m_maskMarginUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -576,7 +576,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_MaskMinWidthLabel</property>
<property name="name">m_maskMinWidthLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -636,7 +636,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_MaskMinWidthCtrl</property>
<property name="name">m_maskMinWidthCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -701,7 +701,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_MaskMinWidthUnits</property>
<property name="name">m_maskMinWidthUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -792,7 +792,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_PasteMarginLabel</property>
<property name="name">m_pasteMarginLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -852,7 +852,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_PasteMarginCtrl</property>
<property name="name">m_pasteMarginCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -917,7 +917,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_PasteMarginUnits</property>
<property name="name">m_pasteMarginUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -978,7 +978,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextRatio</property>
<property name="name">m_pasteMarginRatioLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1038,7 +1038,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_SolderPasteMarginRatioCtrl</property>
<property name="name">m_pasteMarginRatioCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1103,7 +1103,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_SolderPasteRatioMarginUnits</property>
<property name="name">m_pasteMarginRatioUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>

View File

@ -39,18 +39,18 @@ class PANEL_SETUP_MASK_AND_PASTE_BASE : public wxPanel
wxStaticText* m_staticTextInfoMaskMinWidth;
wxStaticText* m_staticTextInfoMaskMinWidth1;
wxStaticLine* m_staticline1;
wxStaticText* m_MaskMarginLabel;
wxTextCtrl* m_MaskMarginCtrl;
wxStaticText* m_MaskMarginUnits;
wxStaticText* m_MaskMinWidthLabel;
wxTextCtrl* m_MaskMinWidthCtrl;
wxStaticText* m_MaskMinWidthUnits;
wxStaticText* m_PasteMarginLabel;
wxTextCtrl* m_PasteMarginCtrl;
wxStaticText* m_PasteMarginUnits;
wxStaticText* m_staticTextRatio;
wxTextCtrl* m_SolderPasteMarginRatioCtrl;
wxStaticText* m_SolderPasteRatioMarginUnits;
wxStaticText* m_maskMarginLabel;
wxTextCtrl* m_maskMarginCtrl;
wxStaticText* m_maskMarginUnits;
wxStaticText* m_maskMinWidthLabel;
wxTextCtrl* m_maskMinWidthCtrl;
wxStaticText* m_maskMinWidthUnits;
wxStaticText* m_pasteMarginLabel;
wxTextCtrl* m_pasteMarginCtrl;
wxStaticText* m_pasteMarginUnits;
wxStaticText* m_pasteMarginRatioLabel;
wxTextCtrl* m_pasteMarginRatioCtrl;
wxStaticText* m_pasteMarginRatioUnits;
wxStaticText* m_staticTextInfoPaste;
public: