KiCad PCB EDA Suite
DIALOG_PAD_PROPERTIES Class Reference

class DIALOG_PAD_PROPERTIES, derived from DIALOG_PAD_PROPERTIES_BASE, created by wxFormBuilder More...

#include <dialog_pad_properties.h>

Inheritance diagram for DIALOG_PAD_PROPERTIES:
DIALOG_PAD_PROPERTIES_BASE DIALOG_SHIM KIWAY_HOLDER

Public Member Functions

 DIALOG_PAD_PROPERTIES (PCB_BASE_FRAME *aParent, D_PAD *aPad)
 
 ~DIALOG_PAD_PROPERTIES ()
 
int ShowQuasiModal ()
 
void EndQuasiModal (int retCode)
 
bool IsQuasiModal ()
 
bool Show (bool show) override
 
bool Enable (bool enable) override
 
KIWAYKiway () const
 Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in. More...
 
PROJECTPrj () const
 Function Prj returns a reference to the PROJECT "associated with" this KIWAY. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 Function SetKiway. More...
 

Protected Types

enum  { wxID_DIALOG_EDIT_PAD = 1000, wxID_PADNUMCTRL, wxID_PADNETNAMECTRL }
 

Protected Member Functions

void FinishDialogSettings ()
 In all dialogs, we must call the same functions to fix minimal dlg size, the default position and perhaps some others to fix a few issues depending on Windows Managers this helper function does these calls. More...
 
void FixOSXCancelButtonIssue ()
 A ugly hack to fix an issue on OSX: when typing ctrl+c in a wxTextCtrl inside a dialog, it is closed instead of copying a text if a button with wxID_CANCEL is used in a wxStdDialogButtonSizer, when the dlg is created by wxFormBuilder: the label is &Cancel, and this accelerator key has priority to copy text standard accelerator, and the dlg is closed when trying to copy text this function do nothing on other platforms. More...
 

Protected Attributes

wxNotebook * m_notebook
 
wxPanel * m_panelGeneral
 
wxStaticText * m_PadNumText
 
wxTextCtrl * m_PadNumCtrl
 
wxStaticText * m_PadNameText
 
wxTextCtrl * m_PadNetNameCtrl
 
wxStaticText * m_staticText44
 
wxChoice * m_PadType
 
wxStaticText * m_staticText45
 
wxChoice * m_PadShape
 
wxStaticText * m_staticText4
 
wxTextCtrl * m_PadPosition_X_Ctrl
 
wxStaticText * m_PadPosX_Unit
 
wxStaticText * m_staticText41
 
wxTextCtrl * m_PadPosition_Y_Ctrl
 
wxStaticText * m_PadPosY_Unit
 
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_PadOrientText
 
wxChoice * m_PadOrient
 
wxStaticText * m_staticText491
 
wxTextCtrl * m_PadOrientCtrl
 
wxStaticText * m_customOrientUnits
 
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_staticText38
 
wxTextCtrl * m_LengthPadToDieCtrl
 
wxStaticText * m_PadLengthDie_Unit
 
wxStaticLine * m_staticline4
 
wxStaticLine * m_staticline5
 
wxStaticLine * m_staticline6
 
wxStaticText * m_staticText21
 
wxTextCtrl * m_ShapeDelta_Ctrl
 
wxStaticText * m_PadShapeDelta_Unit
 
wxStaticText * m_staticText23
 
wxChoice * m_trapDeltaDirChoice
 
wxStaticLine * m_staticline7
 
wxStaticLine * m_staticline8
 
wxStaticLine * m_staticline9
 
wxStaticText * m_staticTextCornerSizeRatio
 
wxTextCtrl * m_tcCornerSizeRatio
 
wxStaticText * m_staticTextCornerSizeRatioUnit
 
wxStaticText * m_staticTextCornerRadius
 
wxStaticText * m_staticTextCornerRadiusValue
 
wxStaticText * m_staticTextCornerSizeUnit
 
wxStaticText * m_staticText47
 
wxChoice * m_DrillShapeCtrl
 
wxStaticText * m_staticText51
 
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
 
wxStaticText * m_staticText511
 
wxChoice * m_rbCopperLayersSel
 
wxCheckBox * m_PadLayerAdhCmp
 
wxCheckBox * m_PadLayerAdhCu
 
wxCheckBox * m_PadLayerPateCmp
 
wxCheckBox * m_PadLayerPateCu
 
wxCheckBox * m_PadLayerSilkCmp
 
wxCheckBox * m_PadLayerSilkCu
 
wxCheckBox * m_PadLayerMaskCmp
 
wxCheckBox * m_PadLayerMaskCu
 
wxCheckBox * m_PadLayerDraft
 
wxCheckBox * m_PadLayerECO1
 
wxCheckBox * m_PadLayerECO2
 
wxStaticText * m_staticTitleModuleRot
 
wxStaticText * m_staticModuleRotValue
 
wxStaticText * m_staticTitleModuleSide
 
wxStaticText * m_staticModuleSideValue
 
wxPanel * m_localSettingsPanel
 
wxStaticText * m_staticTextNetClearance
 
wxTextCtrl * m_NetClearanceValueCtrl
 
wxStaticText * m_NetClearanceUnits
 
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
 
wxStaticBoxSizer * m_sbSizerZonesSettings
 
wxStaticText * m_staticText40
 
wxChoice * m_ZoneConnectionChoice
 
wxStaticText * m_staticText49
 
wxTextCtrl * m_ThermalWidthCtrl
 
wxStaticText * m_ThermalWidthUnits
 
wxStaticText * m_staticText52
 
wxTextCtrl * m_ThermalGapCtrl
 
wxStaticText * m_ThermalGapUnits
 
wxStaticText * m_staticTextcps
 
wxChoice * m_ZoneCustomPadShape
 
wxStaticText * m_staticTextWarning
 
wxPanel * m_panelCustomShapePrimitives
 
wxBoxSizer * m_bSizerPanelPrimitives
 
wxStaticText * m_staticTextPrimitivesList
 
wxStaticText * m_staticTextPrimitiveListWarning
 
wxListView * m_listCtrlPrimitives
 
wxButton * m_buttonDel
 
wxButton * m_buttonEditShape
 
wxButton * m_buttonAddShape
 
wxButton * m_buttonDup
 
wxButton * m_buttonGeometry
 
wxButton * m_buttonImport
 
wxPanel * m_panelShowPad
 
PCB_DRAW_PANEL_GALm_panelShowPadGal
 
KIGFX::GAL_DISPLAY_OPTIONS m_galOptions
 
wxStaticText * m_staticTextWarningPadFlipped
 
wxStdDialogButtonSizer * m_sdbSizer
 
wxButton * m_sdbSizerOK
 
wxButton * m_sdbSizerCancel
 
std::string m_hash_key
 
EVENT_LOOPm_qmodal_loop
 
bool m_qmodal_showing
 
WDO_ENABLE_DISABLEm_qmodal_parent_disabler
 

Private Member Functions

void prepareCanvas ()
 
void initValues ()
 
void displayPrimitivesList ()
 
bool padValuesOK ()
 test if all values are acceptable for the pad More...
 
void redraw ()
 
void editPrimitive ()
 
void updateRoundRectCornerValues ()
 
void enablePrimitivePage (bool aEnable)
 enable (or disable) the primitive page editor More...
 
void setPadLayersList (LSET layer_mask)
 Function setPadLayersList updates the CheckBox states in pad layers list,. More...
 
bool transferDataToPad (D_PAD *aPad)
 Copy values from dialog field to aPad's members. More...
 
void OnInitDialog (wxInitDialogEvent &event) override
 
void OnResize (wxSizeEvent &event)
 
void OnPadShapeSelection (wxCommandEvent &event) override
 
void OnDrillShapeSelected (wxCommandEvent &event) override
 
void PadOrientEvent (wxCommandEvent &event) override
 
void PadTypeSelected (wxCommandEvent &event) override
 
void OnSetLayers (wxCommandEvent &event) override
 
void OnPaintShowPanel (wxPaintEvent &event) override
 
void onCornerSizePercentChange (wxCommandEvent &event) override
 
void OnValuesChanged (wxCommandEvent &event) override
 Called when a dimension has changed. More...
 
bool TransferDataFromWindow () override
 Updates the different parameters for the component being edited. More...
 
bool TransferDataToWindow () override
 
void onDeletePrimitive (wxCommandEvent &event) override
 Event handlers of basic shapes list panel. More...
 
void onEditPrimitive (wxCommandEvent &event) override
 
void onAddPrimitive (wxCommandEvent &event) override
 
void onImportPrimitives (wxCommandEvent &event) override
 
void onGeometryTransform (wxCommandEvent &event) override
 
void onDuplicatePrimitive (wxCommandEvent &event) override
 
void onPrimitiveDClick (wxMouseEvent &event) override
 Called on a double click on the basic shapes list. More...
 
void OnPrimitiveSelection (wxListEvent &event) override
 Called on selection/deselection of a basic shape. More...
 

Private Attributes

PCB_BASE_FRAMEm_parent
 
KIGFX::ORIGIN_VIEWITEMm_axisOrigin
 
D_PADm_currentPad
 
D_PADm_dummyPad
 
D_PADm_padMaster
 
BOARDm_board
 
bool m_isFlipped
 
bool m_canUpdate
 
bool m_canEditNetName
 
std::vector< PAD_CS_PRIMITIVEm_primitives
 
std::vector< DRAWSEGMENT * > m_highligth
 
wxFloatingPointValidator< double > m_OrientValidator
 
double m_OrientValue
 

Detailed Description

class DIALOG_PAD_PROPERTIES, derived from DIALOG_PAD_PROPERTIES_BASE, created by wxFormBuilder

Definition at line 56 of file dialog_pad_properties.h.

Member Enumeration Documentation

anonymous enum
protectedinherited

Constructor & Destructor Documentation

DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES ( PCB_BASE_FRAME aParent,
D_PAD aPad 
)

Definition at line 107 of file dialog_pad_properties.cpp.

References DIALOG_SHIM::FinishDialogSettings(), PCB_BASE_FRAME::GetBoard(), PCB_BASE_FRAME::GetDesignSettings(), initValues(), m_board, m_canUpdate, m_currentPad, m_dummyPad, m_OrientValidator, BOARD_DESIGN_SETTINGS::m_Pad_Master, m_padMaster, DIALOG_PAD_PROPERTIES_BASE::m_PadOrientCtrl, m_parent, DIALOG_PAD_PROPERTIES_BASE::m_sdbSizerOK, prepareCanvas(), and TransferDataToWindow().

107  :
108  DIALOG_PAD_PROPERTIES_BASE( aParent ),
110 {
111  m_canUpdate = false;
112  m_parent = aParent;
113  m_currentPad = aPad; // aPad can be NULL, if the dialog is called
114  // from the footprint editor to set default pad setup
115 
117 
118  m_OrientValidator.SetRange( -360.0, 360.0 );
119  m_PadOrientCtrl->SetValidator( m_OrientValidator );
120  m_OrientValidator.SetWindow( m_PadOrientCtrl );
121 
123  m_dummyPad = new D_PAD( (MODULE*) NULL );
124 
125  if( aPad )
126  *m_dummyPad = *aPad;
127  else // We are editing a "master" pad, i.e. a template to create new pads
129 
130  initValues();
131 
132  // Usually, TransferDataToWindow is called by OnInitDialog
133  // calling it here fixes all widgets sizes, and FinishDialogSettings can
134  // safely fix minsizes
136 
137  // Initialize canvas to be able to display the dummy pad:
138  prepareCanvas();
139 
140  m_sdbSizerOK->SetDefault();
141  m_canUpdate = true;
142 
143  // Now all widgets have the size fixed, call FinishDialogSettings
145 }
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
wxFloatingPointValidator< double > m_OrientValidator
BOARD * GetBoard() const
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
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(785, 659), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSUNKEN_BORDER)
D_PAD m_Pad_Master
A dummy pad to store all default parameters.
DIALOG_PAD_PROPERTIES::~DIALOG_PAD_PROPERTIES ( )
inline

Definition at line 60 of file dialog_pad_properties.h.

References m_axisOrigin, and m_dummyPad.

61  {
62  delete m_dummyPad;
63  delete m_axisOrigin;
64  }
KIGFX::ORIGIN_VIEWITEM * m_axisOrigin

Member Function Documentation

void DIALOG_PAD_PROPERTIES::displayPrimitivesList ( )
private

Definition at line 695 of file dialog_pad_properties.cpp.

References CoordinateToString(), FMT_ANGLE, Format(), formatCoord(), PAD_CS_PRIMITIVE::m_ArcAngle, PAD_CS_PRIMITIVE::m_End, DIALOG_PAD_PROPERTIES_BASE::m_listCtrlPrimitives, PAD_CS_PRIMITIVE::m_Poly, m_primitives, PAD_CS_PRIMITIVE::m_Radius, PAD_CS_PRIMITIVE::m_Shape, PAD_CS_PRIMITIVE::m_Start, PAD_CS_PRIMITIVE::m_Thickness, S_ARC, S_CIRCLE, S_POLYGON, and S_SEGMENT.

Referenced by editPrimitive(), initValues(), onAddPrimitive(), onDeletePrimitive(), onDuplicatePrimitive(), and onGeometryTransform().

696 {
697  m_listCtrlPrimitives->ClearAll();
698 
699  wxListItem itemCol;
700  itemCol.SetImage(-1);
701 
702  for( int ii = 0; ii < 5; ++ii )
703  m_listCtrlPrimitives->InsertColumn(ii, itemCol);
704 
705  wxString bs_info[5];
706 
707  for( unsigned ii = 0; ii < m_primitives.size(); ++ii )
708  {
709  const PAD_CS_PRIMITIVE& primitive = m_primitives[ii];
710 
711  for( unsigned jj = 0; jj < 5; ++jj )
712  bs_info[jj].Empty();
713 
714  bs_info[4] = wxString::Format( _( "width %s" ),
715  CoordinateToString( primitive.m_Thickness, true ) );
716 
717  switch( primitive.m_Shape )
718  {
719  case S_SEGMENT: // usual segment : line with rounded ends
720  bs_info[0] = _( "Segment" );
721  bs_info[1] = _( "from " ) + formatCoord( primitive.m_Start );
722  bs_info[2] = _( "to " ) + formatCoord( primitive.m_End );
723  break;
724 
725  case S_ARC: // Arc with rounded ends
726  bs_info[0] = _( "Arc" );
727  bs_info[1] = _( "center " ) + formatCoord( primitive.m_Start ); // Center
728  bs_info[2] = _( "start " ) + formatCoord( primitive.m_End ); // Start point
729  bs_info[3] = wxString::Format( _( "angle %s" ), FMT_ANGLE( primitive.m_ArcAngle ) );
730  break;
731 
732  case S_CIRCLE: // ring or circle
733  if( primitive.m_Thickness )
734  bs_info[0] = _( "ring" );
735  else
736  bs_info[0] = _( "circle" );
737 
738  bs_info[1] = formatCoord( primitive.m_Start );
739  bs_info[2] = wxString::Format( _( "radius %s" ),
740  CoordinateToString( primitive.m_Radius, true ) );
741  break;
742 
743  case S_POLYGON: // polygon
744  bs_info[0] = "Polygon";
745  bs_info[1] = wxString::Format( _( "corners count %d" ), primitive.m_Poly.size() );
746  break;
747 
748  default:
749  bs_info[0] = "Unknown primitive";
750  break;
751  }
752 
753  long tmp = m_listCtrlPrimitives->InsertItem(ii, bs_info[0]);
754  m_listCtrlPrimitives->SetItemData(tmp, ii);
755 
756  for( int jj = 0, col = 0; jj < 5; ++jj )
757  {
758  m_listCtrlPrimitives->SetItem(tmp, col++, bs_info[jj]);
759  }
760  }
761 
762  // Now columns are filled, ensure correct width of columns
763  for( unsigned ii = 0; ii < 5; ++ii )
764  m_listCtrlPrimitives->SetColumnWidth( ii, wxLIST_AUTOSIZE );
765 }
wxString CoordinateToString(int aValue, bool aConvertToMils)
Function CoordinateToString is a helper to convert the integer coordinate aValue to a string in inche...
Definition: base_units.cpp:117
wxPoint m_Start
angle of an arc, from its starting point, in 0.1 deg
Definition: class_pad.h:99
polygon (not yet used for tracks, but could be in microwave apps)
usual segment : line with rounded ends
#define FMT_ANGLE
int m_Radius
thickness of segment or outline For filled S_CIRCLE shape, thickness = 0.
Definition: class_pad.h:97
std::vector< wxPoint > m_Poly
is also the start point of the arc
Definition: class_pad.h:101
Arcs (with rounded ends)
Helper class to handle a primitive (basic shape: polygon, segment, circle or arc) to build a custom p...
Definition: class_pad.h:90
wxPoint m_End
is also the center of the circle and arc
Definition: class_pad.h:100
STROKE_T m_Shape
Definition: class_pad.h:93
int m_Thickness
S_SEGMENT, S_ARC, S_CIRCLE, S_POLYGON only (same as DRAWSEGMENT)
Definition: class_pad.h:94
std::vector< PAD_CS_PRIMITIVE > m_primitives
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
static wxString formatCoord(wxPoint aCoord)
double m_ArcAngle
radius of a circle
Definition: class_pad.h:98
void DIALOG_PAD_PROPERTIES::editPrimitive ( )
private

Definition at line 1718 of file dialog_pad_properties.cpp.

References displayPrimitivesList(), m_canUpdate, m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_listCtrlPrimitives, m_primitives, PAD_CS_PRIMITIVE::m_Shape, redraw(), S_POLYGON, DIALOG_PAD_PRIMITIVES_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::TransferDataFromWindow(), and transferDataToPad().

Referenced by onEditPrimitive(), and onPrimitiveDClick().

1719 {
1720  long select = m_listCtrlPrimitives->GetFirstSelected();
1721 
1722  if( select < 0 )
1723  {
1724  wxMessageBox( _( "No shape selected" ) );
1725  return;
1726  }
1727 
1728  PAD_CS_PRIMITIVE& shape = m_primitives[select];
1729 
1730  if( shape.m_Shape == S_POLYGON )
1731  {
1732  DIALOG_PAD_PRIMITIVE_POLY_PROPS dlg( this, &shape );
1733 
1734  if( dlg.ShowModal() != wxID_OK )
1735  return;
1736 
1737  dlg.TransferDataFromWindow();
1738  }
1739 
1740  else
1741  {
1742  DIALOG_PAD_PRIMITIVES_PROPERTIES dlg( this, &shape );
1743 
1744  if( dlg.ShowModal() != wxID_OK )
1745  return;
1746 
1747  dlg.TransferDataFromWindow();
1748  }
1749 
1751 
1752  if( m_canUpdate )
1753  {
1755  redraw();
1756  }
1757 }
bool transferDataToPad(D_PAD *aPad)
Copy values from dialog field to aPad's members.
polygon (not yet used for tracks, but could be in microwave apps)
Helper class to handle a primitive (basic shape: polygon, segment, circle or arc) to build a custom p...
Definition: class_pad.h:90
STROKE_T m_Shape
Definition: class_pad.h:93
a dialog to edit basic polygonal shape parameters
std::vector< PAD_CS_PRIMITIVE > m_primitives
a dialog to edit basics shapes parameters.
bool DIALOG_SHIM::Enable ( bool  enable)
overrideinherited

Definition at line 182 of file dialog_shim.cpp.

Referenced by DIALOG_PRINT_USING_PRINTER::InitValues().

183 {
184  // so we can do logging of this state change:
185 
186 #if defined(DEBUG)
187  const char* type_id = typeid( *this ).name();
188  printf( "wxDialog %s: %s\n", type_id, enable ? "enabled" : "disabled" );
189 #endif
190 
191  return wxDialog::Enable( enable );
192 }
void DIALOG_PAD_PROPERTIES::enablePrimitivePage ( bool  aEnable)
private

enable (or disable) the primitive page editor

Definition at line 155 of file dialog_pad_properties.cpp.

References DIALOG_PAD_PROPERTIES_BASE::m_buttonAddShape, DIALOG_PAD_PROPERTIES_BASE::m_buttonDel, DIALOG_PAD_PROPERTIES_BASE::m_buttonDup, DIALOG_PAD_PROPERTIES_BASE::m_buttonEditShape, DIALOG_PAD_PROPERTIES_BASE::m_buttonGeometry, DIALOG_PAD_PROPERTIES_BASE::m_buttonImport, and DIALOG_PAD_PROPERTIES_BASE::m_listCtrlPrimitives.

Referenced by initValues(), and OnPadShapeSelection().

156 {
157  // Enable or disable the widgets in page managing custom shape primitives
158  m_listCtrlPrimitives->Enable( aEnable );
159  m_buttonDel->Enable( aEnable );
160  m_buttonEditShape->Enable( aEnable );
161  m_buttonAddShape->Enable( aEnable );
162  m_buttonDup->Enable( aEnable );
163  m_buttonGeometry->Enable( aEnable );
164  m_buttonImport->Enable( aEnable );
165 }
void DIALOG_SHIM::EndQuasiModal ( int  retCode)
inherited

Definition at line 540 of file dialog_shim.cpp.

References DIALOG_SHIM::IsQuasiModal(), DIALOG_SHIM::m_qmodal_loop, DIALOG_SHIM::m_qmodal_parent_disabler, DIALOG_SHIM::m_qmodal_showing, and DIALOG_SHIM::Show().

Referenced by HK_PROMPT_DIALOG::EndFlexible(), DIALOG_SHIM::OnButton(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnCancelButtonClick(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnCancelButtonClick(), DIALOG_EDIT_ONE_FIELD::OnCancelClick(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnCloseDialog(), DIALOG_EDIT_ONE_FIELD::OnCloseDialog(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnCloseDialog(), DIALOG_CHOOSE_COMPONENT::OnCloseTimer(), DIALOG_SHIM::OnCloseWindow(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnOKButtonClick(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick(), DIALOG_EDIT_ONE_FIELD::OnOkClick(), DIALOG_EXCHANGE_MODULE::OnQuit(), DIALOG_CHOOSE_COMPONENT::OnSchViewDClick(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp(), and DIALOG_SHIM::~DIALOG_SHIM().

541 {
542  // Hook up validator and transfer data from controls handling so quasi-modal dialogs
543  // handle validation in the same way as other dialogs.
544  if( ( retCode == wxID_OK ) && ( !Validate() || !TransferDataFromWindow() ) )
545  return;
546 
547  SetReturnCode( retCode );
548 
549  if( !IsQuasiModal() )
550  {
551  wxFAIL_MSG( wxT( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal wasn't called" ) );
552  return;
553  }
554 
555  m_qmodal_showing = false;
556 
557  if( m_qmodal_loop )
558  {
559  if( m_qmodal_loop->IsRunning() )
560  m_qmodal_loop->Exit( 0 );
561  else
562  m_qmodal_loop->ScheduleExit( 0 );
563 
564  m_qmodal_loop = NULL;
565  }
566 
569 
570  Show( false );
571 }
bool m_qmodal_showing
Definition: dialog_shim.h:132
EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:131
bool IsQuasiModal()
Definition: dialog_shim.h:93
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:133
void DIALOG_SHIM::FinishDialogSettings ( )
protectedinherited

In all dialogs, we must call the same functions to fix minimal dlg size, the default position and perhaps some others to fix a few issues depending on Windows Managers this helper function does these calls.

FinishDialogSettings must be called from derived classes, when all widgets are initialized, and therefore their size fixed. If TransferDataToWindow() is used to initialize widgets, at end of TransferDataToWindow, or better at end of a wxInitDialogEvent handler

In any case, the best way is to call it in a wxInitDialogEvent handler after calling TransfertDataToWindow(), which is the default wxInitDialogEvent handler wxDialog

Definition at line 104 of file dialog_shim.cpp.

References PCAD2KICAD::Center.

Referenced by COLOR4D_PICKER_DLG::COLOR4D_PICKER_DLG(), DIALOG_BOM::DIALOG_BOM(), DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE(), DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES(), DIALOG_DIMENSION_EDITOR::DIALOG_DIMENSION_EDITOR(), DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS(), DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY(), DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS(), DIALOG_ENUM_PADS::DIALOG_ENUM_PADS(), DIALOG_EXPORT_3DFILE::DIALOG_EXPORT_3DFILE(), DIALOG_EXPORT_IDF3::DIALOG_EXPORT_IDF3(), DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP(), DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST(), DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG(), DIALOG_KEEPOUT_AREA_PROPERTIES::DIALOG_KEEPOUT_AREA_PROPERTIES(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_LIB_EDIT_DRAW_ITEM::DIALOG_LIB_EDIT_DRAW_ITEM(), DIALOG_LIB_EDIT_TEXT::DIALOG_LIB_EDIT_TEXT(), DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT(), DIALOG_LIBEDIT_OPTIONS::DIALOG_LIBEDIT_OPTIONS(), DIALOG_PAD_PROPERTIES(), DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC(), DIALOG_SCH_EDIT_SHEET_PIN::DIALOG_SCH_EDIT_SHEET_PIN(), DIALOG_SCH_SHEET_PROPS::DIALOG_SCH_SHEET_PROPS(), DIALOG_SELECT_PRETTY_LIB::DIALOG_SELECT_PRETTY_LIB(), DIALOG_TRACK_VIA_SIZE::DIALOG_TRACK_VIA_SIZE(), DIALOG_EDIT_ONE_FIELD::init(), NETLIST_DIALOG::NETLIST_DIALOG(), DIALOG_LIB_EDIT_PIN::OnInitDialog(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnInitDialog(), DIALOG_TRACK_VIA_PROPERTIES::OnInitDlg(), DIALOG_GRAPHIC_ITEMS_OPTIONS::OnInitDlg(), DialogEditModuleText::OnInitDlg(), DIALOG_SET_GRID::OnInitDlg(), DIALOG_PCB_TEXT_PROPERTIES::OnInitDlg(), DIALOG_PRINT_FOR_MODEDIT::OnInitDlg(), DIALOG_GRAPHIC_ITEM_PROPERTIES::OnInitDlg(), DIALOG_MODULE_MODULE_EDITOR::OnInitDlg(), DIALOG_SIM_SETTINGS::onInitDlg(), DIALOG_SPICE_MODEL::onInitDlg(), DIALOG_MODULE_BOARD_EDITOR::OnInitDlg(), DIALOG_PRINT_USING_PRINTER::OnInitDlg(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnInitDlg(), TARGET_PROPERTIES_DIALOG_EDITOR::TARGET_PROPERTIES_DIALOG_EDITOR(), and DIALOG_SIGNAL_LIST::TransferDataToWindow().

105 {
106  // must be called from the constructor of derived classes,
107  // when all widgets are initialized, and therefore their size fixed
108 
109  // SetSizeHints fixes the minimal size of sizers in the dialog
110  // (SetSizeHints calls Fit(), so no need to call it)
111  GetSizer()->SetSizeHints( this );
112 
113  // the default position, when calling the first time the dlg
114  Center();
115 }
void DIALOG_SHIM::FixOSXCancelButtonIssue ( )
protectedinherited

A ugly hack to fix an issue on OSX: when typing ctrl+c in a wxTextCtrl inside a dialog, it is closed instead of copying a text if a button with wxID_CANCEL is used in a wxStdDialogButtonSizer, when the dlg is created by wxFormBuilder: the label is &Cancel, and this accelerator key has priority to copy text standard accelerator, and the dlg is closed when trying to copy text this function do nothing on other platforms.

Definition at line 117 of file dialog_shim.cpp.

Referenced by DIALOG_SHIM::Show().

118 {
119 #ifdef __WXMAC__
120  // A ugly hack to fix an issue on OSX: ctrl+c closes the dialog instead of
121  // copying a text if a button with wxID_CANCEL is used in a wxStdDialogButtonSizer
122  // created by wxFormBuilder: the label is &Cancel, and this accelerator key has priority
123  // to copy text standard accelerator, and the dlg is closed when trying to copy text
124  wxButton* button = dynamic_cast< wxButton* > ( wxWindow::FindWindowById( wxID_CANCEL, this ) );
125 
126  if( button )
127  button->SetLabel( _( "Cancel" ) );
128 #endif
129 }
void DIALOG_PAD_PROPERTIES::initValues ( )
private

Definition at line 414 of file dialog_pad_properties.cpp.

References PNS::angle(), B_Adhes, B_Cu, B_Mask, B_Paste, B_SilkS, CHOICE_SHAPE_CIRCLE, CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR, CHOICE_SHAPE_CUSTOM_RECT_ANCHOR, CHOICE_SHAPE_OVAL, CHOICE_SHAPE_RECT, CHOICE_SHAPE_ROUNDRECT, CHOICE_SHAPE_TRAPEZOID, code_type, CUST_PAD_SHAPE_IN_ZONE_CONVEXHULL, DIM, displayPrimitivesList(), Dwgs_User, Eco1_User, Eco2_User, enablePrimitivePage(), F_Adhes, F_Cu, F_Mask, F_Paste, F_SilkS, FlipLayerMask(), D_PAD::FlipPrimitives(), FRAME_PCB, g_UserUnit, GetAbbreviatedUnitsLabel(), D_PAD::GetAnchorPadShape(), D_PAD::GetAttribute(), D_PAD::GetCustomShapeInZoneOpt(), D_PAD::GetDelta(), D_PAD::GetDrillShape(), D_PAD::GetDrillSize(), BOARD::GetLayerName(), D_PAD::GetLayerSet(), D_PAD::GetLocalClearance(), D_PAD::GetLocalSolderMaskMargin(), D_PAD::GetLocalSolderPasteMargin(), D_PAD::GetLocalSolderPasteMarginRatio(), D_PAD::GetName(), BOARD_CONNECTED_ITEM::GetNetname(), D_PAD::GetOffset(), MODULE::GetOrientation(), D_PAD::GetOrientation(), MODULE::GetOrientationDegrees(), D_PAD::GetPadToDieLength(), D_PAD::GetParent(), D_PAD::GetPosition(), D_PAD::GetPrimitives(), D_PAD::GetShape(), D_PAD::GetSize(), D_PAD::GetThermalGap(), D_PAD::GetThermalWidth(), D_PAD::GetZoneConnection(), D_PAD::IsFlipped(), EDA_BASE_FRAME::IsType(), m_board, m_canEditNetName, m_currentPad, DIALOG_PAD_PROPERTIES_BASE::m_DrillShapeCtrl, m_dummyPad, m_isFlipped, DIALOG_PAD_PROPERTIES_BASE::m_LengthPadToDieCtrl, DIALOG_PAD_PROPERTIES_BASE::m_NetClearanceUnits, DIALOG_PAD_PROPERTIES_BASE::m_NetClearanceValueCtrl, m_OrientValue, DIALOG_PAD_PROPERTIES_BASE::m_PadDrill_X_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_PadDrill_X_Unit, DIALOG_PAD_PROPERTIES_BASE::m_PadDrill_Y_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_PadDrill_Y_Unit, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerAdhCmp, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerAdhCu, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerDraft, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerECO1, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerECO2, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerMaskCmp, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerMaskCu, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerPateCmp, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerPateCu, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerSilkCmp, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerSilkCu, DIALOG_PAD_PROPERTIES_BASE::m_PadLengthDie_Unit, DIALOG_PAD_PROPERTIES_BASE::m_PadNetNameCtrl, DIALOG_PAD_PROPERTIES_BASE::m_PadNumCtrl, DIALOG_PAD_PROPERTIES_BASE::m_PadOrient, DIALOG_PAD_PROPERTIES_BASE::m_PadPosition_X_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_PadPosition_Y_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_PadPosX_Unit, DIALOG_PAD_PROPERTIES_BASE::m_PadPosY_Unit, DIALOG_PAD_PROPERTIES_BASE::m_PadShape, DIALOG_PAD_PROPERTIES_BASE::m_PadShapeDelta_Unit, DIALOG_PAD_PROPERTIES_BASE::m_PadShapeOffsetX_Unit, DIALOG_PAD_PROPERTIES_BASE::m_PadShapeOffsetY_Unit, DIALOG_PAD_PROPERTIES_BASE::m_PadShapeSizeX_Unit, DIALOG_PAD_PROPERTIES_BASE::m_PadShapeSizeY_Unit, DIALOG_PAD_PROPERTIES_BASE::m_PadType, m_parent, m_primitives, DIALOG_PAD_PROPERTIES_BASE::m_rbCopperLayersSel, DIALOG_PAD_PROPERTIES_BASE::m_ShapeDelta_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_ShapeOffset_X_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_ShapeOffset_Y_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_ShapeSize_X_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_ShapeSize_Y_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_SolderMaskMarginCtrl, DIALOG_PAD_PROPERTIES_BASE::m_SolderMaskMarginUnits, DIALOG_PAD_PROPERTIES_BASE::m_SolderPasteMarginCtrl, DIALOG_PAD_PROPERTIES_BASE::m_SolderPasteMarginRatioCtrl, DIALOG_PAD_PROPERTIES_BASE::m_SolderPasteMarginUnits, DIALOG_PAD_PROPERTIES_BASE::m_staticModuleRotValue, DIALOG_PAD_PROPERTIES_BASE::m_staticModuleSideValue, DIALOG_PAD_PROPERTIES_BASE::m_staticTextCornerSizeUnit, DIALOG_PAD_PROPERTIES_BASE::m_staticTextWarningPadFlipped, DIALOG_PAD_PROPERTIES_BASE::m_ThermalGapCtrl, DIALOG_PAD_PROPERTIES_BASE::m_ThermalGapUnits, DIALOG_PAD_PROPERTIES_BASE::m_ThermalWidthCtrl, DIALOG_PAD_PROPERTIES_BASE::m_ThermalWidthUnits, DIALOG_PAD_PROPERTIES_BASE::m_trapDeltaDirChoice, DIALOG_PAD_PROPERTIES_BASE::m_ZoneConnectionChoice, DIALOG_PAD_PROPERTIES_BASE::m_ZoneCustomPadShape, NORMALIZE_ANGLE_180(), OnDrillShapeSelected(), OnPadShapeSelection(), PAD_ATTRIB_HOLE_NOT_PLATED, PAD_DRILL_SHAPE_OBLONG, PAD_SHAPE_CIRCLE, PAD_SHAPE_CUSTOM, PAD_SHAPE_OVAL, PAD_SHAPE_RECT, PAD_SHAPE_ROUNDRECT, PAD_SHAPE_TRAPEZOID, PAD_ZONE_CONN_FULL, PAD_ZONE_CONN_INHERITED, PAD_ZONE_CONN_NONE, PAD_ZONE_CONN_THERMAL, PutValueInLocalUnits(), D_PAD::SetDelta(), D_PAD::SetLayerSet(), D_PAD::SetOffset(), D_PAD::SetOrientation(), setPadLayersList(), updateRoundRectCornerValues(), wxPoint::x, and wxPoint::y.

Referenced by DIALOG_PAD_PROPERTIES().

415 {
416  wxString msg;
417  double angle;
418 
419  // Disable pad net name wxTextCtrl if the caller is the footprint editor
420  // because nets are living only in the board managed by the board editor
422 
423 
424  // Setup layers names from board
425  // Should be made first, before calling m_rbCopperLayersSel->SetSelection()
426  m_rbCopperLayersSel->SetString( 0, m_board->GetLayerName( F_Cu ) );
427  m_rbCopperLayersSel->SetString( 1, m_board->GetLayerName( B_Cu ) );
428 
429  m_PadLayerAdhCmp->SetLabel( m_board->GetLayerName( F_Adhes ) );
430  m_PadLayerAdhCu->SetLabel( m_board->GetLayerName( B_Adhes ) );
432  m_PadLayerPateCu->SetLabel( m_board->GetLayerName( B_Paste ) );
434  m_PadLayerSilkCu->SetLabel( m_board->GetLayerName( B_SilkS ) );
435  m_PadLayerMaskCmp->SetLabel( m_board->GetLayerName( F_Mask ) );
436  m_PadLayerMaskCu->SetLabel( m_board->GetLayerName( B_Mask ) );
437  m_PadLayerECO1->SetLabel( m_board->GetLayerName( Eco1_User ) );
438  m_PadLayerECO2->SetLabel( m_board->GetLayerName( Eco2_User ) );
440 
441  m_isFlipped = false;
442 
443  if( m_currentPad )
444  {
446 
447  if( m_isFlipped )
448  m_staticModuleSideValue->SetLabel( _( "Back side (footprint is mirrored)" ) );
449 
450  // Diplay footprint rotation ( angles are in 0.1 degree )
451  MODULE* footprint = m_currentPad->GetParent();
452 
453  if( footprint )
454  msg.Printf( "%.1f", footprint->GetOrientationDegrees() );
455  else
456  msg = _("No footprint" );
457 
458  m_staticModuleRotValue->SetLabel( msg );
459  }
460 
461  if( m_isFlipped )
462  {
463  wxPoint pt = m_dummyPad->GetOffset();
464  pt.y = -pt.y;
465  m_dummyPad->SetOffset( pt );
466 
467  wxSize sz = m_dummyPad->GetDelta();
468  sz.y = -sz.y;
469  m_dummyPad->SetDelta( sz );
470 
471  // flip pad's layers
473 
474  // flip custom pad shapes
476  }
477 
479 
481 
482  m_PadNumCtrl->SetValue( m_dummyPad->GetName() );
483  m_PadNetNameCtrl->SetValue( m_dummyPad->GetNetname() );
484 
485  // Set the unit name in dialog:
486  wxStaticText* unitTexts[] =
487  {
495  };
496 
497  for( unsigned ii = 0; ii < DIM( unitTexts ); ++ii )
498  unitTexts[ii]->SetLabel( GetAbbreviatedUnitsLabel( g_UserUnit ) );
499 
500  // Display current pad parameters units:
503 
506 
509 
512 
513  if( m_dummyPad->GetDelta().x )
514  {
516  m_trapDeltaDirChoice->SetSelection( 0 );
517  }
518  else
519  {
521  m_trapDeltaDirChoice->SetSelection( 1 );
522  }
523 
525 
530 
531  // These 2 parameters are usually < 0, so prepare entering a negative value, if current is 0
533 
535  m_SolderPasteMarginCtrl->SetValue( wxT( "-" ) + m_SolderPasteMarginCtrl->GetValue() );
536 
537  msg.Printf( wxT( "%f" ), m_dummyPad->GetLocalSolderPasteMarginRatio() * 100.0 );
538 
539  if( m_dummyPad->GetLocalSolderPasteMarginRatio() == 0.0 && msg[0] == '0' )
540  // Sometimes Printf adds a sign if the value is small
541  m_SolderPasteMarginRatioCtrl->SetValue( wxT( "-" ) + msg );
542  else
543  m_SolderPasteMarginRatioCtrl->SetValue( msg );
544 
545  switch( m_dummyPad->GetZoneConnection() )
546  {
547  default:
549  m_ZoneConnectionChoice->SetSelection( 0 );
550  break;
551 
552  case PAD_ZONE_CONN_FULL:
553  m_ZoneConnectionChoice->SetSelection( 1 );
554  break;
555 
557  m_ZoneConnectionChoice->SetSelection( 2 );
558  break;
559 
560  case PAD_ZONE_CONN_NONE:
561  m_ZoneConnectionChoice->SetSelection( 3 );
562  break;
563  }
564 
566  m_ZoneCustomPadShape->SetSelection( 1 );
567  else
568  m_ZoneCustomPadShape->SetSelection( 0 );
569 
570  if( m_currentPad )
571  {
572  angle = m_currentPad->GetOrientation();
573  MODULE* footprint = m_currentPad->GetParent();
574 
575  if( footprint )
576  angle -= footprint->GetOrientation();
577 
578  if( m_isFlipped )
579  angle = -angle;
580 
581  m_dummyPad->SetOrientation( angle );
582  }
583 
584  angle = m_dummyPad->GetOrientation();
585 
586  NORMALIZE_ANGLE_180( angle ); // ? normalizing is in D_PAD::SetOrientation()
587 
588  // Set layers used by this pad: :
590 
591  // Pad Orient
592  switch( int( angle ) )
593  {
594  case 0:
595  m_PadOrient->SetSelection( 0 );
596  break;
597 
598  case 900:
599  m_PadOrient->SetSelection( 1 );
600  break;
601 
602  case -900:
603  m_PadOrient->SetSelection( 2 );
604  break;
605 
606  case 1800:
607  case -1800:
608  m_PadOrient->SetSelection( 3 );
609  break;
610 
611  default:
612  m_PadOrient->SetSelection( 4 );
613  break;
614  }
615 
616  switch( m_dummyPad->GetShape() )
617  {
618  default:
619  case PAD_SHAPE_CIRCLE:
620  m_PadShape->SetSelection( CHOICE_SHAPE_CIRCLE );
621  break;
622 
623  case PAD_SHAPE_OVAL:
624  m_PadShape->SetSelection( CHOICE_SHAPE_OVAL );
625  break;
626 
627  case PAD_SHAPE_RECT:
628  m_PadShape->SetSelection( CHOICE_SHAPE_RECT );
629  break;
630 
631  case PAD_SHAPE_TRAPEZOID:
632  m_PadShape->SetSelection( CHOICE_SHAPE_TRAPEZOID );
633  break;
634 
635  case PAD_SHAPE_ROUNDRECT:
636  m_PadShape->SetSelection( CHOICE_SHAPE_ROUNDRECT );
637  break;
638 
639  case PAD_SHAPE_CUSTOM:
642  else
644  break;
645  }
646 
648 
649  m_OrientValue = angle / 10.0;
650 
651  // Type of pad selection
652  m_PadType->SetSelection( 0 );
653 
654  for( unsigned ii = 0; ii < DIM( code_type ); ii++ )
655  {
656  if( code_type[ii] == m_dummyPad->GetAttribute() )
657  {
658  m_PadType->SetSelection( ii );
659  break;
660  }
661  }
662 
663  // Enable/disable Pad name,and pad length die
664  // (disable for NPTH pads (mechanical pads)
666 
667  m_PadNumCtrl->Enable( enable );
668  m_PadNetNameCtrl->Enable( m_canEditNetName && enable && m_currentPad != NULL );
669  m_LengthPadToDieCtrl->Enable( enable );
670 
672  m_DrillShapeCtrl->SetSelection( 0 );
673  else
674  m_DrillShapeCtrl->SetSelection( 1 );
675 
676  // Update some dialog widgets state (Enable/disable options):
677  wxCommandEvent cmd_event;
679  OnDrillShapeSelected( cmd_event );
680  OnPadShapeSelection( cmd_event );
682 
683  // Update basic shapes list
685 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
PAD_SHAPE_T GetAnchorPadShape() const
Function GetAnchorPadShape.
Definition: class_pad.h:212
LSET FlipLayerMask(LSET aMask, int aCopperLayersCount)
Calculate the mask layer when flipping a footprint BACK and FRONT copper layers, mask, paste, solder layers are swapped internal layers are flipped only if the copper layers count is known.
Definition: lset.cpp:491
const std::vector< PAD_CS_PRIMITIVE > & GetPrimitives() const
Accessor to the basic shape list.
Definition: class_pad.h:322
void enablePrimitivePage(bool aEnable)
enable (or disable) the primitive page editor
void FlipPrimitives()
Flip the basic shapes, in custom pads.
Definition: class_pad.cpp:434
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:384
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:65
int GetPadToDieLength() const
Definition: class_pad.h:387
void setPadLayersList(LSET layer_mask)
Function setPadLayersList updates the CheckBox states in pad layers list,.
int GetLocalSolderMaskMargin() const
Definition: class_pad.h:389
MODULE * GetParent() const
Definition: class_pad.h:148
PAD_DRILL_SHAPE_T GetDrillShape() const
Definition: class_pad.h:367
void NORMALIZE_ANGLE_180(T &Angle)
Definition: trigo.h:300
const wxSize & GetDrillSize() const
Definition: class_pad.h:261
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:202
Pads are not covered.
Definition: zones.h:57
static PAD_ATTR_T code_type[]
double GetOrientationDegrees() const
Definition: class_module.h:161
double GetOrientation() const
Definition: class_module.h:160
const wxPoint & GetPosition() const override
Definition: class_pad.h:206
wxString GetAbbreviatedUnitsLabel(EDA_UNITS_T aUnit)
Definition: base_units.cpp:479
ZoneConnection GetZoneConnection() const
Definition: class_pad.cpp:650
LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_pad.h:381
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
int GetThermalWidth() const
Definition: class_pad.cpp:661
void OnPadShapeSelection(wxCommandEvent &event) override
int GetThermalGap() const
Definition: class_pad.cpp:672
const wxSize & GetSize() const
Definition: class_pad.h:255
const wxString & GetName() const
Definition: class_pad.h:176
void OnDrillShapeSelected(wxCommandEvent &event) override
int GetLocalSolderPasteMargin() const
Definition: class_pad.h:395
bool IsFlipped() const
Definition: class_pad.cpp:126
int GetLocalClearance() const
Definition: class_pad.h:392
double GetLocalSolderPasteMarginRatio() const
Definition: class_pad.h:398
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
void PutValueInLocalUnits(wxTextCtrl &aTextCtr, int aValue)
Function PutValueInLocalUnits converts aValue from internal units to user units and append the units ...
Definition: base_units.cpp:265
void SetLayerSet(LSET aLayerMask)
Definition: class_pad.h:380
std::vector< PAD_CS_PRIMITIVE > m_primitives
const wxString & GetNetname() const
Function GetNetname.
CUST_PAD_SHAPE_IN_ZONE GetCustomShapeInZoneOpt() const
Definition: class_pad.h:218
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in tenths of degrees, but soon degrees.
Definition: class_pad.h:361
const wxSize & GetDelta() const
Definition: class_pad.h:258
void SetOrientation(double aAngle)
Function SetOrientation sets the rotation angle of the pad.
Definition: class_pad.cpp:401
bool IsType(FRAME_T aType) const
Definition: wxstruct.h:229
void SetOffset(const wxPoint &aOffset)
Definition: class_pad.h:263
Use thermal relief for pads.
Definition: zones.h:58
const wxPoint & GetOffset() const
Definition: class_pad.h:264
void SetDelta(const wxSize &aSize)
Definition: class_pad.h:257
pads are covered by copper
Definition: zones.h:59
KIWAY& KIWAY_HOLDER::Kiway ( ) const
inlineinherited

Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in.

A KIWAY_HOLDER is not necessarily a KIWAY_PLAYER.

Definition at line 60 of file kiway_player.h.

References KIWAY_HOLDER::m_kiway.

Referenced by SCH_EDIT_FRAME::AppendOneEEProject(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_CHOOSE_COMPONENT::ConstructRightPanel(), CVPCB_MAINFRAME::CreateScreenCmp(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_SHIM::DIALOG_SHIM(), EDIT_TOOL::editFootprintInFpEditor(), SCH_EDIT_FRAME::EditSheet(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_EDIT_FRAME::GetPlotSettings(), SCH_EDIT_FRAME::ImportFile(), PCB_EDIT_FRAME::ImportFile(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::initBuffers(), LIB_EDIT_FRAME::InstallConfigFrame(), PCB_EDIT_FRAME::InstallModuleOptionsFrame(), KIWAY_PLAYER::language_change(), SCH_SHEET::Load(), CVPCB_MAINFRAME::LoadFootprintFiles(), KIWAY_PLAYER::OnChangeIconsOptions(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), SCH_BASE_FRAME::OnEditSymbolLibTable(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), SCH_EDIT_FRAME::OnLeftClick(), SCH_BASE_FRAME::OnOpenLibraryViewer(), SCH_EDIT_FRAME::OnSimulate(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateReplaceModuleInBoard(), SCH_EDIT_FRAME::OpenProjectFiles(), KIWAY_HOLDER::Prj(), PCB_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Special_Functions(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), LIB_EDIT_FRAME::refreshSchematic(), SCH_EDIT_FRAME::SaveEEFile(), CVPCB_MAINFRAME::SaveFootprintAssociation(), SCH_BASE_FRAME::SelectComponentFromLibBrowser(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlist(), FOOTPRINT_EDIT_FRAME::SetPlotSettings(), DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame(), FOOTPRINT_VIEWER_FRAME::Show3D_Frame(), FOOTPRINT_EDIT_FRAME::Show3D_Frame(), FOOTPRINT_WIZARD_FRAME::Show3D_Frame(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::showButtonHandler(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::showButtonHandler(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), and DIALOG_EXCHANGE_MODULE::ViewAndSelectFootprint().

61  {
62  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
63  return *m_kiway;
64  }
KIWAY * m_kiway
Definition: kiway_player.h:85
void DIALOG_PAD_PROPERTIES::onAddPrimitive ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 1810 of file dialog_pad_properties.cpp.

References DIM, displayPrimitivesList(), m_canUpdate, m_dummyPad, m_primitives, redraw(), S_ARC, S_CIRCLE, S_POLYGON, S_SEGMENT, and transferDataToPad().

1811 {
1812  // Ask user for shape type
1813  wxString shapelist[] =
1814  {
1815  _( "Segment" ), _( "Arc" ), _( "ring/circle" ), _( "polygon" )
1816  };
1817 
1818  int type = wxGetSingleChoiceIndex( wxEmptyString, _( "Select shape type:" ),
1819  DIM( shapelist ), shapelist, 0 );
1820 
1821  STROKE_T listtype[] =
1822  {
1824  };
1825 
1826  PAD_CS_PRIMITIVE primitive( listtype[type] );
1827 
1828  if( listtype[type] == S_POLYGON )
1829  {
1830  DIALOG_PAD_PRIMITIVE_POLY_PROPS dlg( this, &primitive );
1831 
1832  if( dlg.ShowModal() != wxID_OK )
1833  return;
1834  }
1835  else
1836  {
1837  DIALOG_PAD_PRIMITIVES_PROPERTIES dlg( this, &primitive );
1838 
1839  if( dlg.ShowModal() != wxID_OK )
1840  return;
1841  }
1842 
1843  m_primitives.push_back( primitive );
1844 
1846 
1847  if( m_canUpdate )
1848  {
1850  redraw();
1851  }
1852 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
bool transferDataToPad(D_PAD *aPad)
Copy values from dialog field to aPad's members.
polygon (not yet used for tracks, but could be in microwave apps)
usual segment : line with rounded ends
Arcs (with rounded ends)
Helper class to handle a primitive (basic shape: polygon, segment, circle or arc) to build a custom p...
Definition: class_pad.h:90
STROKE_T
Enum STROKE_T is the set of shapes for segments (graphic segments and tracks) which are often in the ...
a dialog to edit basic polygonal shape parameters
std::vector< PAD_CS_PRIMITIVE > m_primitives
a dialog to edit basics shapes parameters.
void DIALOG_PAD_PROPERTIES::onCornerSizePercentChange ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 383 of file dialog_pad_properties.cpp.

References g_UserUnit, D_PAD::GetRoundRectCornerRadius(), D_PAD::GetShape(), m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_staticTextCornerRadiusValue, DIALOG_PAD_PROPERTIES_BASE::m_tcCornerSizeRatio, PAD_SHAPE_ROUNDRECT, redraw(), StringFromValue(), and transferDataToPad().

384 {
386  return;
387 
388  wxString value = m_tcCornerSizeRatio->GetValue();
389  double rrRadiusRatioPercent;
390 
391  if( value.ToDouble( &rrRadiusRatioPercent ) )
392  {
393  // Clamp rrRadiusRatioPercent to acceptable value (0.0 to 50.0)
394  if( rrRadiusRatioPercent < 0.0 )
395  {
396  rrRadiusRatioPercent = 0.0;
397  m_tcCornerSizeRatio->ChangeValue( "0.0" );
398  }
399 
400  if( rrRadiusRatioPercent > 50.0 )
401  {
402  rrRadiusRatioPercent = 0.5;
403  m_tcCornerSizeRatio->ChangeValue( "50.0" );
404  }
405 
409  redraw();
410  }
411 }
bool transferDataToPad(D_PAD *aPad)
Copy values from dialog field to aPad's members.
wxString StringFromValue(EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymbol)
Function StringFromValue returns the string from aValue according to units (inch, mm ...
Definition: base_units.cpp:203
int GetRoundRectCornerRadius() const
Function GetRoundRectCornerRadius Has meaning only for rounded rect pads.
Definition: class_pad.h:497
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:202
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
void DIALOG_PAD_PROPERTIES::onDeletePrimitive ( wxCommandEvent &  event)
overrideprivatevirtual

Event handlers of basic shapes list panel.

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 1782 of file dialog_pad_properties.cpp.

References displayPrimitivesList(), m_canUpdate, m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_listCtrlPrimitives, m_primitives, redraw(), and transferDataToPad().

1783 {
1784  long select = m_listCtrlPrimitives->GetFirstSelected();
1785 
1786  if( select < 0 )
1787  return;
1788 
1789  // Multiple selections are allowed. get them and remove corresponding shapes
1790  std::vector<long> indexes;
1791  indexes.push_back( select );
1792 
1793  while( ( select = m_listCtrlPrimitives->GetNextSelected( select ) ) >= 0 )
1794  indexes.push_back( select );
1795 
1796  // Erase all select shapes
1797  for( unsigned ii = indexes.size(); ii > 0; --ii )
1798  m_primitives.erase( m_primitives.begin() + indexes[ii-1] );
1799 
1801 
1802  if( m_canUpdate )
1803  {
1805  redraw();
1806  }
1807 }
bool transferDataToPad(D_PAD *aPad)
Copy values from dialog field to aPad's members.
std::vector< PAD_CS_PRIMITIVE > m_primitives
void DIALOG_PAD_PROPERTIES::OnDrillShapeSelected ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 855 of file dialog_pad_properties.cpp.

References DIALOG_PAD_PROPERTIES_BASE::m_DrillShapeCtrl, m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_PadDrill_X_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_PadDrill_Y_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_PadType, redraw(), and transferDataToPad().

Referenced by initValues(), and PadTypeSelected().

856 {
857  if( m_PadType->GetSelection() == 1 || m_PadType->GetSelection() == 2 )
858  {
859  // pad type = SMD or CONN: no hole allowed
860  m_PadDrill_X_Ctrl->Enable( false );
861  m_PadDrill_Y_Ctrl->Enable( false );
862  }
863  else
864  {
865  switch( m_DrillShapeCtrl->GetSelection() )
866  {
867  case 0: //CIRCLE:
868  m_PadDrill_X_Ctrl->Enable( true );
869  m_PadDrill_Y_Ctrl->Enable( false );
870  break;
871 
872  case 1: //OVALE:
873  m_PadDrill_X_Ctrl->Enable( true );
874  m_PadDrill_Y_Ctrl->Enable( true );
875  break;
876  }
877  }
878 
880  redraw();
881 }
bool transferDataToPad(D_PAD *aPad)
Copy values from dialog field to aPad's members.
void DIALOG_PAD_PROPERTIES::onDuplicatePrimitive ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 1902 of file dialog_pad_properties.cpp.

References displayPrimitivesList(), DIALOG_PAD_PRIMITIVES_TRANSFORM::GetDuplicateCount(), m_canUpdate, m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_listCtrlPrimitives, m_primitives, redraw(), transferDataToPad(), and DIALOG_PAD_PRIMITIVES_TRANSFORM::Transform().

1903 {
1904  long select = m_listCtrlPrimitives->GetFirstSelected();
1905 
1906  if( select < 0 )
1907  {
1908  wxMessageBox( _( "No shape selected" ) );
1909  return;
1910  }
1911 
1912  // Multiple selections are allowed. Build selected shapes list
1913  std::vector<long> indexes;
1914  indexes.push_back( select );
1915 
1916  std::vector<PAD_CS_PRIMITIVE*> shapeList;
1917  shapeList.push_back( &m_primitives[select] );
1918 
1919  while( ( select = m_listCtrlPrimitives->GetNextSelected( select ) ) >= 0 )
1920  {
1921  indexes.push_back( select );
1922  shapeList.push_back( &m_primitives[select] );
1923  }
1924 
1925  DIALOG_PAD_PRIMITIVES_TRANSFORM dlg( this, shapeList, true );
1926 
1927  if( dlg.ShowModal() != wxID_OK )
1928  return;
1929 
1930  // Transfert new settings:
1931  dlg.Transform( &m_primitives, dlg.GetDuplicateCount() );
1932 
1934 
1935  if( m_canUpdate )
1936  {
1938  redraw();
1939  }
1940 }
bool transferDataToPad(D_PAD *aPad)
Copy values from dialog field to aPad's members.
std::vector< PAD_CS_PRIMITIVE > m_primitives
A dialog to apply geometry transforms to a shape or set of shapes (move, rotate around origin...
void DIALOG_PAD_PROPERTIES::onEditPrimitive ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 1776 of file dialog_pad_properties.cpp.

References editPrimitive().

1777 {
1778  editPrimitive();
1779 }
void DIALOG_PAD_PROPERTIES::onGeometryTransform ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 1861 of file dialog_pad_properties.cpp.

References displayPrimitivesList(), m_canUpdate, m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_listCtrlPrimitives, m_primitives, redraw(), transferDataToPad(), and DIALOG_PAD_PRIMITIVES_TRANSFORM::Transform().

1862 {
1863  long select = m_listCtrlPrimitives->GetFirstSelected();
1864 
1865  if( select < 0 )
1866  {
1867  wxMessageBox( _( "No shape selected" ) );
1868  return;
1869  }
1870 
1871  // Multiple selections are allowed. Build selected shapes list
1872  std::vector<long> indexes;
1873  indexes.push_back( select );
1874 
1875  std::vector<PAD_CS_PRIMITIVE*> shapeList;
1876  shapeList.push_back( &m_primitives[select] );
1877 
1878  while( ( select = m_listCtrlPrimitives->GetNextSelected( select ) ) >= 0 )
1879  {
1880  indexes.push_back( select );
1881  shapeList.push_back( &m_primitives[select] );
1882  }
1883 
1884  DIALOG_PAD_PRIMITIVES_TRANSFORM dlg( this, shapeList, false );
1885 
1886  if( dlg.ShowModal() != wxID_OK )
1887  return;
1888 
1889  // Transfert new settings:
1890  dlg.Transform();
1891 
1893 
1894  if( m_canUpdate )
1895  {
1897  redraw();
1898  }
1899 }
bool transferDataToPad(D_PAD *aPad)
Copy values from dialog field to aPad's members.
std::vector< PAD_CS_PRIMITIVE > m_primitives
A dialog to apply geometry transforms to a shape or set of shapes (move, rotate around origin...
void DIALOG_PAD_PROPERTIES::onImportPrimitives ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 1855 of file dialog_pad_properties.cpp.

1856 {
1857  wxMessageBox( "Not yet available" );
1858 }
void DIALOG_PAD_PROPERTIES::OnInitDialog ( wxInitDialogEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 148 of file dialog_pad_properties.cpp.

References DIALOG_PAD_PROPERTIES_BASE::m_PadNumCtrl.

149 {
150  m_PadNumCtrl->SetFocus();
151  m_PadNumCtrl->SetSelection( -1, -1 );
152 }
void DIALOG_PAD_PROPERTIES::OnPadShapeSelection ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 774 of file dialog_pad_properties.cpp.

References CHOICE_SHAPE_CIRCLE, CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR, CHOICE_SHAPE_CUSTOM_RECT_ANCHOR, CHOICE_SHAPE_OVAL, CHOICE_SHAPE_RECT, CHOICE_SHAPE_ROUNDRECT, CHOICE_SHAPE_TRAPEZOID, enablePrimitivePage(), Format(), D_PAD::GetRoundRectRadiusRatio(), m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_PadShape, DIALOG_PAD_PROPERTIES_BASE::m_ShapeDelta_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_ShapeOffset_X_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_ShapeOffset_Y_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_ShapeSize_Y_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_tcCornerSizeRatio, DIALOG_PAD_PROPERTIES_BASE::m_ThermalGapCtrl, DIALOG_PAD_PROPERTIES_BASE::m_ThermalWidthCtrl, DIALOG_PAD_PROPERTIES_BASE::m_trapDeltaDirChoice, DIALOG_PAD_PROPERTIES_BASE::m_ZoneConnectionChoice, DIALOG_PAD_PROPERTIES_BASE::m_ZoneCustomPadShape, redraw(), transferDataToPad(), and updateRoundRectCornerValues().

Referenced by initValues().

775 {
776  bool is_custom = false;
777 
778  switch( m_PadShape->GetSelection() )
779  {
780  case CHOICE_SHAPE_CIRCLE:
781  m_ShapeDelta_Ctrl->Enable( false );
782  m_trapDeltaDirChoice->Enable( false );
783  m_ShapeSize_Y_Ctrl->Enable( false );
784  m_ShapeOffset_X_Ctrl->Enable( false );
785  m_ShapeOffset_Y_Ctrl->Enable( false );
786  break;
787 
788  case CHOICE_SHAPE_OVAL:
789  m_ShapeDelta_Ctrl->Enable( false );
790  m_trapDeltaDirChoice->Enable( false );
791  m_ShapeSize_Y_Ctrl->Enable( true );
792  m_ShapeOffset_X_Ctrl->Enable( true );
793  m_ShapeOffset_Y_Ctrl->Enable( true );
794  break;
795 
796  case CHOICE_SHAPE_RECT:
797  m_ShapeDelta_Ctrl->Enable( false );
798  m_trapDeltaDirChoice->Enable( false );
799  m_ShapeSize_Y_Ctrl->Enable( true );
800  m_ShapeOffset_X_Ctrl->Enable( true );
801  m_ShapeOffset_Y_Ctrl->Enable( true );
802  break;
803 
805  m_ShapeDelta_Ctrl->Enable( true );
806  m_trapDeltaDirChoice->Enable( true );
807  m_ShapeSize_Y_Ctrl->Enable( true );
808  m_ShapeOffset_X_Ctrl->Enable( true );
809  m_ShapeOffset_Y_Ctrl->Enable( true );
810  break;
811 
813  m_ShapeDelta_Ctrl->Enable( false );
814  m_trapDeltaDirChoice->Enable( false );
815  m_ShapeSize_Y_Ctrl->Enable( true );
816  m_ShapeOffset_X_Ctrl->Enable( true );
817  m_ShapeOffset_Y_Ctrl->Enable( true );
818  // Ensure m_tcCornerSizeRatio contains the right value:
819  m_tcCornerSizeRatio->ChangeValue( wxString::Format( "%.1f",
821  break;
822 
823  case CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR: // PAD_SHAPE_CUSTOM, circular anchor
824  case CHOICE_SHAPE_CUSTOM_RECT_ANCHOR: // PAD_SHAPE_CUSTOM, rect anchor
825  is_custom = true;
826  m_ShapeDelta_Ctrl->Enable( false );
827  m_trapDeltaDirChoice->Enable( false );
828  m_ShapeSize_Y_Ctrl->Enable(
829  m_PadShape->GetSelection() == CHOICE_SHAPE_CUSTOM_RECT_ANCHOR );
830  m_ShapeOffset_X_Ctrl->Enable( false );
831  m_ShapeOffset_Y_Ctrl->Enable( false );
832  break;
833  }
834 
835  enablePrimitivePage( is_custom );
836 
837  // A few widgets are enabled only for rounded rect pads:
838  m_tcCornerSizeRatio->Enable( m_PadShape->GetSelection() == CHOICE_SHAPE_ROUNDRECT );
839 
840  // PAD_SHAPE_CUSTOM type has constraints for zone connection and thermal shape:
841  // only not connected is allowed to avoid destroying the shape.
842  // Enable/disable options
843  m_ZoneConnectionChoice->Enable( !is_custom );
844  m_ThermalWidthCtrl->Enable( !is_custom );
845  m_ThermalGapCtrl->Enable( !is_custom );
846  m_ZoneCustomPadShape->Enable( is_custom );
847 
849 
851  redraw();
852 }
void enablePrimitivePage(bool aEnable)
enable (or disable) the primitive page editor
bool transferDataToPad(D_PAD *aPad)
Copy values from dialog field to aPad's members.
double GetRoundRectRadiusRatio() const
has meaning only for rounded rect pads
Definition: class_pad.h:594
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
void DIALOG_PAD_PROPERTIES::OnPaintShowPanel ( wxPaintEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 203 of file dialog_pad_properties.cpp.

References abs, B_Cu, BLACK, color, PCB_GENERAL_SETTINGS::Colors(), CYAN, DARKGRAY, D_PAD::DrawShape(), PAD_CS_PRIMITIVE::ExportTo(), F_Cu, DRAWSEGMENT::GetArcEnd(), DRAWSEGMENT::GetArcStart(), D_PAD::GetAttribute(), D_PAD::GetBoundingRadius(), DRAWSEGMENT::GetCenter(), D_PAD::GetDelta(), D_PAD::GetDrillSize(), DRAWSEGMENT::GetEnd(), COLORS_DESIGN_SETTINGS::GetItemColor(), D_PAD::GetLayerSet(), D_PAD::GetLocalClearance(), D_PAD::GetOrientation(), DRAWSEGMENT::GetPolyPoints(), D_PAD::GetPosition(), D_PAD::GetShape(), D_PAD::GetSize(), DRAWSEGMENT::GetStart(), GRArc1(), GRCircle(), GRClosedPoly(), GRFilledCircle(), GRFilledSegment(), GRLine(), GRResetPenAndBrush(), LAYER_PAD_BK, LAYER_PAD_FR, LIGHTBLUE, LIGHTGRAY, PAD_DRAWINFO::m_Color, PAD_DRAWINFO::m_Display_netname, PAD_DRAWINFO::m_Display_padnum, m_dummyPad, PAD_DRAWINFO::m_HoleColor, DIALOG_PAD_PROPERTIES_BASE::m_listCtrlPrimitives, PAD_DRAWINFO::m_Offset, PAD_DRAWINFO::m_PadClearance, DIALOG_PAD_PROPERTIES_BASE::m_panelShowPad, m_parent, m_primitives, PAD_CS_PRIMITIVE::m_Radius, PAD_CS_PRIMITIVE::m_Shape, PAD_DRAWINFO::m_ShowNotPlatedHole, PAD_CS_PRIMITIVE::m_Thickness, min, PAD_ATTRIB_HOLE_NOT_PLATED, PAD_SHAPE_CIRCLE, DRAWSEGMENT::Rotate(), S_ARC, S_CIRCLE, S_POLYGON, S_SEGMENT, scale, and PCB_BASE_FRAME::Settings().

204 {
205  wxPaintDC dc( m_panelShowPad );
206  PAD_DRAWINFO drawInfo;
207 
209 
210  if( m_dummyPad->GetLayerSet()[F_Cu] )
211  {
213  }
214 
215  if( m_dummyPad->GetLayerSet()[B_Cu] )
216  {
217  color = color.LegacyMix( m_parent->Settings().Colors().GetItemColor( LAYER_PAD_BK ) );
218  }
219 
220  // What could happen: the pad color is *actually* black, or no
221  // copper was selected
222  if( color == BLACK )
223  color = LIGHTGRAY;
224 
225  drawInfo.m_Color = color;
226  drawInfo.m_HoleColor = DARKGRAY;
227  drawInfo.m_Offset = m_dummyPad->GetPosition();
228  drawInfo.m_Display_padnum = true;
229  drawInfo.m_Display_netname = true;
230 
232  drawInfo.m_ShowNotPlatedHole = true;
233 
234  // Shows the local pad clearance
236 
237  wxSize dc_size = dc.GetSize();
238  dc.SetDeviceOrigin( dc_size.x / 2, dc_size.y / 2 );
239 
240  // Calculate a suitable scale to fit the available draw area
241  int dim = m_dummyPad->GetBoundingRadius() *2;
242 
243  // Invalid x size. User could enter zero, or have deleted all text prior to
244  // entering a new value; this is also treated as zero. If dim is left at
245  // zero, the drawing scale is zero and we get a crash.
246  if( dim == 0 )
247  {
248  // If drill size has been set, use that. Otherwise default to 1mm.
249  dim = m_dummyPad->GetDrillSize().x;
250  if( dim == 0 )
251  dim = Millimeter2iu( 1.0 );
252  }
253 
254  if( m_dummyPad->GetLocalClearance() > 0 )
255  dim += m_dummyPad->GetLocalClearance() * 2;
256 
257  double scale = (double) dc_size.x / dim;
258 
259  // If the pad is a circle, use the x size here instead.
260  int ysize;
261 
263  ysize = m_dummyPad->GetSize().x;
264  else
265  ysize = m_dummyPad->GetSize().y;
266 
267  dim = ysize + std::abs( m_dummyPad->GetDelta().x );
268 
269  // Invalid y size. See note about x size above.
270  if( dim == 0 )
271  {
272  dim = m_dummyPad->GetDrillSize().y;
273  if( dim == 0 )
274  dim = Millimeter2iu( 0.1 );
275  }
276 
277  if( m_dummyPad->GetLocalClearance() > 0 )
278  dim += m_dummyPad->GetLocalClearance() * 2;
279 
280  double altscale = (double) dc_size.y / dim;
281  scale = std::min( scale, altscale );
282 
283  // Give a margin
284  scale *= 0.7;
285  dc.SetUserScale( scale, scale );
286 
287  GRResetPenAndBrush( &dc );
288  m_dummyPad->DrawShape( NULL, &dc, drawInfo );
289 
290  // draw selected primitives:
291  COLOR4D hcolor = CYAN;
292  long select = m_listCtrlPrimitives->GetFirstSelected();
293  wxPoint start, end, center;
294 
295  while( select >= 0 )
296  {
297  PAD_CS_PRIMITIVE& primitive = m_primitives[select];
298 
299  // The best way to calculate parameters to draw a primitive is to
300  // use a dummy DRAWSEGMENT and use its methods
301  // Note: in legacy canvas, the pad has the 0,0 position
302  DRAWSEGMENT dummySegment;
303  primitive.ExportTo( &dummySegment );
304  dummySegment.Rotate( wxPoint( 0, 0), m_dummyPad->GetOrientation() );
305 
306  switch( primitive.m_Shape )
307  {
308  case S_SEGMENT: // usual segment : line with rounded ends
309  GRFilledSegment( NULL, &dc, dummySegment.GetStart(), dummySegment.GetEnd(),
310  primitive.m_Thickness, hcolor );
311  break;
312 
313  case S_ARC: // Arc with rounded ends
314  GRArc1( NULL, &dc, dummySegment.GetArcEnd(), dummySegment.GetArcStart(),
315  dummySegment.GetCenter(), primitive.m_Thickness, hcolor );
316  break;
317 
318  case S_CIRCLE: // ring or circle
319  if( primitive.m_Thickness )
320  {
321  GRCircle( NULL, &dc, dummySegment.GetCenter(), primitive.m_Radius,
322  primitive.m_Thickness, hcolor );
323  }
324  else
325  {
326  GRFilledCircle( NULL, &dc, dummySegment.GetCenter(),
327  primitive.m_Radius, hcolor );
328  }
329  break;
330 
331  case S_POLYGON: // polygon
332  {
333  std::vector<wxPoint> poly = dummySegment.GetPolyPoints();
334  GRClosedPoly( NULL, &dc, poly.size(), &poly[0], /* filled */ true,
335  primitive.m_Thickness, hcolor, hcolor );
336  }
337  break;
338 
339  default:
340  break;
341  }
342 
343  select = m_listCtrlPrimitives->GetNextSelected( select );
344  }
345 
346  // Draw X and Y axis. This is particularly useful to show the
347  // reference position of pads with offset and no hole, or custom pad shapes
348  const int linethickness = 0;
349  GRLine( NULL, &dc, -int( dc_size.x/scale ), 0, int( dc_size.x/scale ), 0,
350  linethickness, LIGHTBLUE ); // X axis
351  GRLine( NULL, &dc, 0, -int( dc_size.y/scale ), 0, int( dc_size.y/scale ),
352  linethickness, LIGHTBLUE ); // Y axis
353 
354  event.Skip();
355 }
void GRResetPenAndBrush(wxDC *DC)
Definition: gr_basic.cpp:196
bool m_Display_padnum
Definition: class_pad.h:74
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:384
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:65
const wxPoint GetCenter() const override
Function GetCenter()
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color)
Definition: gr_basic.cpp:352
void ExportTo(DRAWSEGMENT *aTarget)
returns the start point of an arc
polygon (not yet used for tracks, but could be in microwave apps)
usual segment : line with rounded ends
const wxSize & GetDrillSize() const
Definition: class_pad.h:261
void GRFilledCircle(EDA_RECT *ClipBox, wxDC *DC, int x, int y, int r, int width, COLOR4D Color, COLOR4D BgColor)
Definition: gr_basic.cpp:833
const std::vector< wxPoint > GetPolyPoints() const
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:202
#define abs(a)
Definition: auxiliary.h:84
smd pads, back layer
void GRClosedPoly(EDA_RECT *ClipBox, wxDC *DC, int n, wxPoint Points[], bool Fill, COLOR4D Color, COLOR4D BgColor)
Function GRClosedPoly draws a closed polygon onto the drawing context aDC and optionally fills and/or...
Definition: gr_basic.cpp:777
const wxPoint & GetArcStart() const
COLOR4D GetItemColor(int aItemIdx) const
Function GetItemColor.
int m_Radius
thickness of segment or outline For filled S_CIRCLE shape, thickness = 0.
Definition: class_pad.h:97
const wxPoint & GetEnd() const
Function GetEnd returns the ending point of the graphic.
int GetBoundingRadius() const
Function GetBoundingRadius returns the radius of a minimum sized circle which fully encloses this pad...
Definition: class_pad.h:572
PCB_GENERAL_SETTINGS & Settings()
const wxPoint & GetPosition() const override
Definition: class_pad.h:206
Arcs (with rounded ends)
Helper class to handle a primitive (basic shape: polygon, segment, circle or arc) to build a custom p...
Definition: class_pad.h:90
LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_pad.h:381
Definition: colors.h:59
COLOR4D m_HoleColor
Definition: class_pad.h:69
const wxSize & GetSize() const
Definition: class_pad.h:255
bool m_ShowNotPlatedHole
Definition: class_pad.h:79
void DrawShape(EDA_RECT *aClipBox, wxDC *aDC, PAD_DRAWINFO &aDrawInfo)
Function DrawShape basic function to draw a pad.
STROKE_T m_Shape
Definition: class_pad.h:93
int m_PadClearance
Definition: class_pad.h:72
int GetLocalClearance() const
Definition: class_pad.h:392
COLORS_DESIGN_SETTINGS & Colors()
int m_Thickness
S_SEGMENT, S_ARC, S_CIRCLE, S_POLYGON only (same as DRAWSEGMENT)
Definition: class_pad.h:94
virtual void Rotate(const wxPoint &aRotCentre, double aAngle) override
Function Rotate Rotate this object.
wxPoint m_Offset
Definition: class_pad.h:82
const int scale
smd pads, front layer
std::vector< PAD_CS_PRIMITIVE > m_primitives
void GRFilledSegment(EDA_RECT *aClipBox, wxDC *aDC, wxPoint aStart, wxPoint aEnd, int aWidth, COLOR4D aColor)
Definition: gr_basic.cpp:592
void GRCircle(EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, int r, int width, COLOR4D Color)
Definition: gr_basic.cpp:791
const wxPoint GetArcEnd() const
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in tenths of degrees, but soon degrees.
Definition: class_pad.h:361
const wxSize & GetDelta() const
Definition: class_pad.h:258
COLOR4D m_Color
Definition: class_pad.h:67
Definition: colors.h:45
bool m_Display_netname
Definition: class_pad.h:75
const wxPoint & GetStart() const
Function GetStart returns the starting point of the graphic.
#define min(a, b)
Definition: auxiliary.h:85
void GRArc1(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int xc, int yc, COLOR4D Color)
Definition: gr_basic.cpp:873
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
void DIALOG_PAD_PROPERTIES::onPrimitiveDClick ( wxMouseEvent &  event)
overrideprivatevirtual

Called on a double click on the basic shapes list.

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 1769 of file dialog_pad_properties.cpp.

References editPrimitive().

1770 {
1771  editPrimitive();
1772 }
void DIALOG_PAD_PROPERTIES::OnPrimitiveSelection ( wxListEvent &  event)
overrideprivatevirtual

Called on selection/deselection of a basic shape.

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 1760 of file dialog_pad_properties.cpp.

References redraw().

1761 {
1762  // Called on a double click on the basic shapes list
1763  // To Do: highligth the primitive(s) currently selected.
1764  redraw();
1765 }
void DIALOG_PAD_PROPERTIES::OnResize ( wxSizeEvent &  event)
private

Definition at line 767 of file dialog_pad_properties.cpp.

References redraw().

Referenced by prepareCanvas().

768 {
769  redraw();
770  event.Skip();
771 }
void DIALOG_PAD_PROPERTIES::OnSetLayers ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 977 of file dialog_pad_properties.cpp.

References m_dummyPad, redraw(), and transferDataToPad().

978 {
980  redraw();
981 }
bool transferDataToPad(D_PAD *aPad)
Copy values from dialog field to aPad's members.
void DIALOG_PAD_PROPERTIES::OnValuesChanged ( wxCommandEvent &  event)
overrideprivatevirtual

Called when a dimension has changed.

Update the graphical pad shown in the panel.

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 1705 of file dialog_pad_properties.cpp.

References m_canUpdate, m_dummyPad, redraw(), transferDataToPad(), and updateRoundRectCornerValues().

1706 {
1707  if( m_canUpdate )
1708  {
1710  // If the pad size has changed, update the displayed values
1711  // for rounded rect pads
1713 
1714  redraw();
1715  }
1716 }
bool transferDataToPad(D_PAD *aPad)
Copy values from dialog field to aPad's members.
void DIALOG_PAD_PROPERTIES::PadOrientEvent ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 884 of file dialog_pad_properties.cpp.

References D_PAD::GetOrientation(), m_dummyPad, m_OrientValidator, m_OrientValue, DIALOG_PAD_PROPERTIES_BASE::m_PadOrient, redraw(), D_PAD::SetOrientation(), and transferDataToPad().

885 {
886  switch( m_PadOrient->GetSelection() )
887  {
888  case 0:
890  break;
891 
892  case 1:
893  m_dummyPad->SetOrientation( 900 );
894  break;
895 
896  case 2:
897  m_dummyPad->SetOrientation( -900 );
898  break;
899 
900  case 3:
901  m_dummyPad->SetOrientation( 1800 );
902  break;
903 
904  default:
905  break;
906  }
907 
909  m_OrientValidator.TransferToWindow();
910 
912  redraw();
913 }
bool transferDataToPad(D_PAD *aPad)
Copy values from dialog field to aPad's members.
wxFloatingPointValidator< double > m_OrientValidator
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in tenths of degrees, but soon degrees.
Definition: class_pad.h:361
void SetOrientation(double aAngle)
Function SetOrientation sets the rotation angle of the pad.
Definition: class_pad.cpp:401
void DIALOG_PAD_PROPERTIES::PadTypeSelected ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 916 of file dialog_pad_properties.cpp.

References code_type, DIM, m_canEditNetName, m_currentPad, DIALOG_PAD_PROPERTIES_BASE::m_DrillShapeCtrl, DIALOG_PAD_PROPERTIES_BASE::m_LengthPadToDieCtrl, DIALOG_PAD_PROPERTIES_BASE::m_PadNetNameCtrl, DIALOG_PAD_PROPERTIES_BASE::m_PadNumCtrl, DIALOG_PAD_PROPERTIES_BASE::m_PadType, OnDrillShapeSelected(), and setPadLayersList().

917 {
918  unsigned ii = m_PadType->GetSelection();
919 
920  if( ii >= DIM( code_type ) ) // catches < 0 also
921  ii = 0;
922 
923  LSET layer_mask = std_pad_layers[ii];
924  setPadLayersList( layer_mask );
925 
926  // Enable/disable drill dialog items:
927  event.SetId( m_DrillShapeCtrl->GetSelection() );
928  OnDrillShapeSelected( event );
929 
930  if( ii == 0 || ii == DIM( code_type )-1 )
931  m_DrillShapeCtrl->Enable( true );
932  else
933  m_DrillShapeCtrl->Enable( false );
934 
935  // Enable/disable Pad name,and pad length die
936  // (disable for NPTH pads (mechanical pads)
937  bool enable = ii != 3;
938  m_PadNumCtrl->Enable( enable );
939  m_PadNetNameCtrl->Enable( m_canEditNetName && enable && m_currentPad != NULL );
940  m_LengthPadToDieCtrl->Enable( enable );
941 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
void setPadLayersList(LSET layer_mask)
Function setPadLayersList updates the CheckBox states in pad layers list,.
static PAD_ATTR_T code_type[]
Class LSET is a set of PCB_LAYER_IDs.
void OnDrillShapeSelected(wxCommandEvent &event) override
static const LSET std_pad_layers[]
bool DIALOG_PAD_PROPERTIES::padValuesOK ( )
private

test if all values are acceptable for the pad

Definition at line 985 of file dialog_pad_properties.cpp.

References abs, B_Cu, B_Paste, F_Cu, F_Paste, D_PAD::GetAttribute(), D_PAD::GetDrillSize(), D_PAD::GetLayerSet(), D_PAD::GetLocalClearance(), D_PAD::GetLocalSolderMaskMargin(), D_PAD::GetLocalSolderPasteMargin(), D_PAD::GetOffset(), D_PAD::GetShape(), D_PAD::GetSize(), LSET::InternalCuMask(), HTML_MESSAGE_BOX::ListSet(), m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_tcCornerSizeRatio, D_PAD::MergePrimitivesAsPolygon(), PAD_ATTRIB_CONN, PAD_ATTRIB_HOLE_NOT_PLATED, PAD_ATTRIB_SMD, PAD_ATTRIB_STANDARD, PAD_SHAPE_CIRCLE, PAD_SHAPE_CUSTOM, PAD_SHAPE_ROUNDRECT, transferDataToPad(), wxPoint::x, and wxPoint::y.

Referenced by TransferDataFromWindow().

986 {
987  bool error = transferDataToPad( m_dummyPad );
988  bool skip_tstoffset = false; // the offset prm is not always tested
989 
990  wxArrayString error_msgs;
991  wxString msg;
992 
993  // Test for incorrect values
994  if( (m_dummyPad->GetSize().x <= 0) ||
995  ((m_dummyPad->GetSize().y <= 0) && (m_dummyPad->GetShape() != PAD_SHAPE_CIRCLE)) )
996  {
997  error_msgs.Add( _( "Pad size must be greater than zero" ) );
998  }
999 
1000  if( (m_dummyPad->GetSize().x < m_dummyPad->GetDrillSize().x) ||
1001  (m_dummyPad->GetSize().y < m_dummyPad->GetDrillSize().y) )
1002  {
1003  error_msgs.Add( _( "Incorrect value for pad drill: pad drill bigger than pad size" ) );
1004  skip_tstoffset = true; // offset prm will be not tested because if the drill value
1005  // is incorrect the offset prm is always seen as incorrect, even if it is 0
1006  }
1007 
1008  if( m_dummyPad->GetLocalClearance() < 0 )
1009  {
1010  error_msgs.Add( _( "Pad local clearance must be zero or greater than zero" ) );
1011  }
1012 
1014  {
1015  error_msgs.Add( _( "Pad local solder mask clearance must be zero or greater than zero" ) );
1016  }
1017 
1019  {
1020  error_msgs.Add( _( "Pad local solder paste clearance must be zero or less than zero" ) );
1021  }
1022 
1023  LSET padlayers_mask = m_dummyPad->GetLayerSet();
1024 
1025  if( padlayers_mask == 0 )
1026  error_msgs.Add( _( "Error: pad has no layer" ) );
1027 
1028  if( !padlayers_mask[F_Cu] && !padlayers_mask[B_Cu] )
1029  {
1030  if( m_dummyPad->GetDrillSize().x || m_dummyPad->GetDrillSize().y )
1031  {
1032  // Note: he message is shown in an HTML window
1033  msg = _( "Error: the pad is not on a copper layer and has a hole" );
1034 
1036  {
1037  msg += wxT( "<br><br><i>" );
1038  msg += _( "For NPTH pad, set pad size value to pad drill value,"
1039  " if you do not want this pad plotted in gerber files"
1040  );
1041  }
1042 
1043  error_msgs.Add( msg );
1044  }
1045  }
1046 
1047  if( !skip_tstoffset )
1048  {
1049  wxPoint max_size;
1050  max_size.x = std::abs( m_dummyPad->GetOffset().x );
1051  max_size.y = std::abs( m_dummyPad->GetOffset().y );
1052  max_size.x += m_dummyPad->GetDrillSize().x / 2;
1053  max_size.y += m_dummyPad->GetDrillSize().y / 2;
1054 
1055  if( ( m_dummyPad->GetSize().x / 2 < max_size.x ) ||
1056  ( m_dummyPad->GetSize().y / 2 < max_size.y ) )
1057  {
1058  error_msgs.Add( _( "Incorrect value for pad offset" ) );
1059  }
1060  }
1061 
1062  if( error )
1063  {
1064  error_msgs.Add( _( "Too large value for pad delta size" ) );
1065  }
1066 
1067  switch( m_dummyPad->GetAttribute() )
1068  {
1069  case PAD_ATTRIB_HOLE_NOT_PLATED: // Not plated, but through hole, a hole is expected
1070  case PAD_ATTRIB_STANDARD : // Pad through hole, a hole is also expected
1071  if( m_dummyPad->GetDrillSize().x <= 0 )
1072  error_msgs.Add( _( "Error: Through hole pad: drill diameter set to 0" ) );
1073  break;
1074 
1075  case PAD_ATTRIB_CONN: // Connector pads are smd pads, just they do not have solder paste.
1076  if( padlayers_mask[B_Paste] || padlayers_mask[F_Paste] )
1077  error_msgs.Add( _( "Error: Connector pads are not on the solder paste layer\n"
1078  "Use SMD pads instead" ) );
1079  // Fall trough
1080  case PAD_ATTRIB_SMD: // SMD and Connector pads (One external copper layer only)
1081  {
1082  LSET innerlayers_mask = padlayers_mask & LSET::InternalCuMask();
1083 
1084  if( ( padlayers_mask[F_Cu] && padlayers_mask[B_Cu] ) ||
1085  innerlayers_mask.count() != 0 )
1086  error_msgs.Add( _( "Error: only one external copper layer allowed for SMD or Connector pads" ) );
1087  }
1088  break;
1089  }
1090 
1091 
1093  {
1094  wxString value = m_tcCornerSizeRatio->GetValue();
1095  double rrRadiusRatioPercent;
1096 
1097  if( !value.ToDouble( &rrRadiusRatioPercent ) )
1098  error_msgs.Add( _( "Incorrect corner size value" ) );
1099  else
1100  {
1101  if( rrRadiusRatioPercent < 0.0 )
1102  error_msgs.Add( _( "Incorrect (negative) corner size value" ) );
1103  else if( rrRadiusRatioPercent > 50.0 )
1104  error_msgs.Add( _( "Corner size value must be smaller than 50%" ) );
1105  }
1106  }
1107 
1109  {
1111  error_msgs.Add(
1112  _( "Incorrect pad shape: the shape must be equivalent to only one polygon" ) );
1113  }
1114 
1115 
1116  if( error_msgs.GetCount() )
1117  {
1118  HTML_MESSAGE_BOX dlg( this, _("Pad setup errors list" ) );
1119  dlg.ListSet( error_msgs );
1120  dlg.ShowModal();
1121  }
1122 
1123  return error_msgs.GetCount() == 0;
1124 }
bool MergePrimitivesAsPolygon(SHAPE_POLY_SET *aMergedPolygon=NULL, int aCircleToSegmentsCount=32)
Merge all basic shapes, converted to a polygon in one polygon, in m_customShapeAsPolygon.
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:384
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:65
bool transferDataToPad(D_PAD *aPad)
Copy values from dialog field to aPad's members.
int GetLocalSolderMaskMargin() const
Definition: class_pad.h:389
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:61
const wxSize & GetDrillSize() const
Definition: class_pad.h:261
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:202
#define abs(a)
Definition: auxiliary.h:84
Class LSET is a set of PCB_LAYER_IDs.
LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_pad.h:381
static LSET InternalCuMask()
Function InternalCuMask() returns a complete set of internal copper layers, which is all Cu layers ex...
Definition: lset.cpp:606
const wxSize & GetSize() const
Definition: class_pad.h:255
int GetLocalSolderPasteMargin() const
Definition: class_pad.h:395
Class HTML_MESSAGE_BOX.
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
Definition: pad_shapes.h:62
int GetLocalClearance() const
Definition: class_pad.h:392
Usual pad.
Definition: pad_shapes.h:60
const wxPoint & GetOffset() const
Definition: class_pad.h:264
void DIALOG_PAD_PROPERTIES::prepareCanvas ( )
private

Definition at line 168 of file dialog_pad_properties.cpp.

References KIGFX::VIEW::Add(), PCB_GENERAL_SETTINGS::Colors(), KIGFX::ORIGIN_VIEWITEM::CROSS, EDA_DRAW_PANEL_GAL::GetBackend(), EDA_DRAW_FRAME::GetGalCanvas(), D_PAD::GetPosition(), EDA_DRAW_PANEL_GAL::GetView(), EDA_DRAW_FRAME::IsGalCanvasActive(), LIGHTBLUE, m_axisOrigin, m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_panelShowPad, DIALOG_PAD_PROPERTIES_BASE::m_panelShowPadGal, m_parent, OnResize(), KIGFX::ORIGIN_VIEWITEM::SetDrawAtZero(), PCB_BASE_FRAME::Settings(), EDA_DRAW_PANEL_GAL::StartDrawing(), PCB_DRAW_PANEL_GAL::SwitchBackend(), and PCB_DRAW_PANEL_GAL::UseColorScheme().

Referenced by DIALOG_PAD_PROPERTIES().

169 {
170  // Initialize the canvases (legacy or gal) to display the pad
171  // Enable the suitable canvas and make some inits
172 
173  // Show the X and Y axis. It is usefull because pad shape can have an offset
174  // or be a complex shape.
175  KIGFX::COLOR4D axis_color = LIGHTBLUE;
176 
177  m_axisOrigin = new KIGFX::ORIGIN_VIEWITEM( axis_color,
179  Millimeter2iu( 0.2 ),
181  m_axisOrigin->SetDrawAtZero( true );
182 
183  if( m_parent->IsGalCanvasActive() )
184  {
187  m_panelShowPadGal->Show();
188  m_panelShowPad->Hide();
191 
193  Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_PAD_PROPERTIES::OnResize ) );
194  }
195  else
196  {
197  m_panelShowPad->Show();
198  m_panelShowPadGal->Hide();
199  }
200 }
GAL_TYPE GetBackend() const
Function GetBackend Returns the type of backend currently used by GAL canvas.
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
KIGFX::ORIGIN_VIEWITEM * m_axisOrigin
VECTOR2< double > VECTOR2D
Definition: vector2d.h:589
PCB_GENERAL_SETTINGS & Settings()
const wxPoint & GetPosition() const override
Definition: class_pad.h:206
void SetDrawAtZero(bool aDrawFlag)
Function SetDrawAtZero() Set the draw at zero flag.
void OnResize(wxSizeEvent &event)
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:862
void StartDrawing()
Function StartDrawing() Begins drawing if it was stopped previously.
void UseColorScheme(const COLORS_DESIGN_SETTINGS *aSettings)
Function UseColorScheme Applies layer color settings.
COLORS_DESIGN_SETTINGS & Colors()
bool SwitchBackend(GAL_TYPE aGalType) override
Function SwitchBackend Switches method of rendering graphics.
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:870
void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:312
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
PROJECT & KIWAY_HOLDER::Prj ( ) const
inherited

Function Prj returns a reference to the PROJECT "associated with" this KIWAY.

Definition at line 34 of file kiway_holder.cpp.

References KIWAY_HOLDER::Kiway(), and KIWAY::Prj().

Referenced by SCH_EDIT_FRAME::AnnotateComponents(), SCH_EDIT_FRAME::AppendOneEEProject(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), SCH_EDIT_FRAME::backAnnotateFootprints(), LIB_VIEW_FRAME::BestZoom(), DIALOG_MODULE_MODULE_EDITOR::BrowseAndAdd3DShapeFile(), DIALOG_MODULE_BOARD_EDITOR::BrowseAndAdd3DShapeFile(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::BrowseAndSelectDocFile(), DIALOG_EXCHANGE_MODULE::BrowseAndSelectFootprint(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_MODULE_MODULE_EDITOR::Cfg3DPath(), DIALOG_MODULE_BOARD_EDITOR::Cfg3DPath(), SCH_EDIT_FRAME::CheckAnnotate(), SCH_SCREEN::CheckComponentsToPartsLinks(), SCH_EDIT_FRAME::ConvertPart(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), SCH_EDIT_FRAME::CreateArchiveLibrary(), SCH_EDIT_FRAME::CreateNetlist(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), DIALOG_PLOT_SCHEMATIC::createPlotFileName(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromCurrentLibrary(), LIB_EDIT_FRAME::DeleteOnePart(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG(), DIALOG_FP_LIB_TABLE::DIALOG_FP_LIB_TABLE(), DIALOG_MODULE_BOARD_EDITOR::DIALOG_MODULE_BOARD_EDITOR(), DIALOG_MODULE_MODULE_EDITOR::DIALOG_MODULE_MODULE_EDITOR(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), DIALOG_SYMBOL_LIB_TABLE::DIALOG_SYMBOL_LIB_TABLE(), LIB_VIEW_FRAME::DisplayLibInfos(), SCH_BASE_FRAME::DisplayListComponentsInLib(), PCB_EDIT_FRAME::doAutoSave(), DIALOG_MODULE_MODULE_EDITOR::Edit3DShapeFileName(), DIALOG_MODULE_BOARD_EDITOR::Edit3DShapeFileName(), SCH_EDIT_FRAME::EditComponentFieldText(), SCH_EDIT_FRAME::EditSheet(), PCB_EDIT_FRAME::Export_IDF3(), PCB_EDIT_FRAME::ExportToGenCAD(), PCB_EDIT_FRAME::ExportVRML_File(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::GenD356File(), NETLIST_DIALOG::GenNetlist(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), LIB_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), LIB_EDIT_FRAME::GetCurPart(), FOOTPRINT_EDIT_FRAME::GetCurrentLib(), FOOTPRINT_EDIT_FRAME::getLibPath(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), DIALOG_BOM::getPluginFileName(), LIB_VIEW_FRAME::getSelectedAlias(), FP_THREAD_IFACE::GetTable(), SCH_EDIT_FRAME::ImportFile(), PCB_EDIT_FRAME::ImportFile(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers(), DIALOG_MODULE_MODULE_EDITOR::initModeditProperties(), DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties(), LIB_EDIT_FRAME::InstallConfigFrame(), SCH_EDIT_FRAME::InstallConfigFrame(), PCB_EDIT_FRAME::InstallNetlistFrame(), SCH_EDIT_FRAME::IsSearchCacheObsolete(), SCH_EDIT_FRAME::Load_Component(), SCH_EDIT_FRAME::LoadCmpToFootprintLinkFile(), DIALOG_BOM_EDITOR::LoadComponents(), CVPCB_MAINFRAME::LoadFootprintFiles(), SCH_EDIT_FRAME::LoadOneEEFile(), LIB_EDIT_FRAME::LoadOneLibraryPart(), LIB_EDIT_FRAME::LoadOneSymbol(), CVPCB_MAINFRAME::LoadProjectFile(), SCH_EDIT_FRAME::LoadProjectFile(), PCB_EDIT_FRAME::LoadProjectSettings(), DIALOG_DRC_CONTROL::makeValidFileNameReport(), FOOTPRINT_VIEWER_FRAME::OnActivate(), DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick(), DIALOG_EESCHEMA_CONFIG::OnAddOrInsertPath(), DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick(), LIB_EDIT_FRAME::OnCloseWindow(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), SCH_BASE_FRAME::OnEditSymbolLibTable(), DIALOG_GENDRILL::OnGenReportFile(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), PCB_EDIT_FRAME::OnLeftClick(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick(), DIALOG_NETLIST::OnOpenNetlistClick(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_SVG_PRINT::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), DIALOG_GEN_MODULE_POSITION::OnOutputDirectoryBrowseClicked(), LIB_EDIT_FRAME::OnPlotCurrentComponent(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), SCH_EDIT_FRAME::OnRightClick(), DIALOG_BOM::OnRunPlugin(), DIALOG_NETLIST::OnSaveMessagesToFile(), SCH_EDIT_FRAME::OnSaveProject(), DIALOG_SPICE_MODEL::onSelectIcLib(), LIB_VIEW_FRAME::OnSelectSymbol(), SCH_EDIT_FRAME::OnSelectUnit(), DIALOG_SPICE_MODEL::onSemiSelectLib(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnTestChipName(), FOOTPRINT_EDIT_FRAME::OnUpdateSelectCurrentLib(), LIB_EDIT_FRAME::OnViewEntryDoc(), LIB_VIEW_FRAME::onViewSymbolDocument(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_EDITOR_CONTROL::PlaceModule(), SCH_EDIT_FRAME::prepareForNetlist(), SCH_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Config(), SCH_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::ProcessCmpToFootprintLinkFile(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), LIB_VIEW_FRAME::ReCreateHToolbar(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), LIB_VIEW_FRAME::ReCreateListCmp(), LIB_VIEW_FRAME::ReCreateListLib(), LIB_VIEW_FRAME::RedrawActiveWindow(), EDA_3D_VIEWER::ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), SCH_EDIT_FRAME::RescueProject(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), SCH_SCREEN::Save(), LIB_EDIT_FRAME::SaveActiveLibrary(), SCH_EDIT_FRAME::SaveEEFile(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), LIB_EDIT_FRAME::SaveOneSymbol(), CVPCB_MAINFRAME::SaveProjectFile(), SCH_EDIT_FRAME::SaveProjectSettings(), PCB_EDIT_FRAME::SaveProjectSettings(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), SCH_BASE_FRAME::SelectComponentFromLibrary(), FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint(), PCB_BASE_FRAME::SelectLibrary(), SCH_BASE_FRAME::SelectLibraryFromList(), SCH_EDIT_FRAME::sendNetlist(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), LIB_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), LIB_EDIT_FRAME::SetCurPart(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), EDA_3D_VIEWER::takeScreenshot(), DIALOG_ERC::TestErc(), DIALOG_SPICE_MODEL::updateFromFile(), SIM_PLOT_FRAME::updateNetlistExporter(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), CVPCB_MAINFRAME::UpdateTitle(), FOOTPRINT_EDIT_FRAME::updateTitle(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_MODULE_BOARD_EDITOR::~DIALOG_MODULE_BOARD_EDITOR(), and DIALOG_MODULE_MODULE_EDITOR::~DIALOG_MODULE_MODULE_EDITOR().

35 {
36  return Kiway().Prj();
37 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:60
VTBL_ENTRY PROJECT & Prj() const
Function Prj returns the PROJECT associated with this KIWAY.
Definition: kiway.cpp:144
void DIALOG_PAD_PROPERTIES::redraw ( )
private

Definition at line 1127 of file dialog_pad_properties.cpp.

References PAD_CS_PRIMITIVE::ExportTo(), F_SilkS, DRAWSEGMENT::GetCenter(), D_PAD::GetOrientation(), BOX2< Vec >::GetOrigin(), DRAWSEGMENT::GetPolyShape(), D_PAD::GetPosition(), KIGFX::VIEW::GetScale(), BOX2< Vec >::GetSize(), EDA_DRAW_PANEL_GAL::GetView(), BOX2< Vec >::Inflate(), EDA_DRAW_FRAME::IsGalCanvasActive(), SHAPE_POLY_SET::Iterate(), m_dummyPad, m_highligth, DIALOG_PAD_PROPERTIES_BASE::m_listCtrlPrimitives, DIALOG_PAD_PROPERTIES_BASE::m_panelShowPad, DIALOG_PAD_PROPERTIES_BASE::m_panelShowPadGal, m_parent, m_primitives, PAD_CS_PRIMITIVE::m_Radius, PAD_CS_PRIMITIVE::m_Shape, PAD_CS_PRIMITIVE::m_Thickness, BOX2< Vec >::Move(), DRAWSEGMENT::Move(), EDA_DRAW_PANEL_GAL::Refresh(), DRAWSEGMENT::Rotate(), S_ARC, S_CIRCLE, S_POLYGON, S_SEGMENT, DRAWSEGMENT::SetEnd(), BOARD_ITEM::SetLayer(), DRAWSEGMENT::SetWidth(), EDA_DRAW_PANEL_GAL::StartDrawing(), EDA_DRAW_PANEL_GAL::StopDrawing(), D_PAD::ViewBBox(), wxPoint::x, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by editPrimitive(), onAddPrimitive(), onCornerSizePercentChange(), onDeletePrimitive(), OnDrillShapeSelected(), onDuplicatePrimitive(), onGeometryTransform(), OnPadShapeSelection(), OnPrimitiveSelection(), OnResize(), OnSetLayers(), OnValuesChanged(), and PadOrientEvent().

1128 {
1129  if( m_parent->IsGalCanvasActive() )
1130  {
1131  auto view = m_panelShowPadGal->GetView();
1133 
1134  view->SetTopLayer( F_SilkS );
1135 
1136  view->Update( m_dummyPad );
1137 
1138  // delete previous items if highlight list
1139  while( m_highligth.size() )
1140  {
1141  delete m_highligth.back(); // the dtor also removes item from view
1142  m_highligth.pop_back();
1143  }
1144 
1145  // highlight selected primitives:
1146  long select = m_listCtrlPrimitives->GetFirstSelected();
1147 
1148  while( select >= 0 )
1149  {
1150  PAD_CS_PRIMITIVE& primitive = m_primitives[select];
1151 
1152  DRAWSEGMENT* dummySegment = new DRAWSEGMENT;
1153  dummySegment->SetLayer( F_SilkS );
1154  primitive.ExportTo( dummySegment );
1155  dummySegment->Rotate( wxPoint( 0, 0), m_dummyPad->GetOrientation() );
1156  dummySegment->Move( m_dummyPad->GetPosition() );
1157 
1158  // Update selected primitive (highligth selected)
1159  switch( primitive.m_Shape )
1160  {
1161  case S_SEGMENT:
1162  case S_ARC:
1163  break;
1164 
1165  case S_CIRCLE: // ring or circle
1166  if( primitive.m_Thickness == 0 ) // filled circle
1167  { // the filled circle option does not exist in a DRAWSEGMENT
1168  // but it is easy to create it with a circle having the
1169  // right radius and outline width
1170  wxPoint end = dummySegment->GetCenter();
1171  end.x += primitive.m_Radius/2;
1172  dummySegment->SetEnd( end );
1173  dummySegment->SetWidth( primitive.m_Radius );
1174  }
1175  break;
1176 
1177  case S_POLYGON: // polygon
1178  {
1179  for( auto iter = dummySegment->GetPolyShape().Iterate(); iter; iter++ )
1180  {
1181  (*iter) += VECTOR2I( m_dummyPad->GetPosition() );
1182  }
1183  }
1184  break;
1185 
1186  default:
1187  delete dummySegment;
1188  dummySegment = nullptr;
1189  break;
1190  }
1191 
1192  if( dummySegment )
1193  {
1194  view->Add( dummySegment );
1195  m_highligth.push_back( dummySegment );
1196  }
1197 
1198  select = m_listCtrlPrimitives->GetNextSelected( select );
1199  }
1200 
1201  BOX2I bbox = m_dummyPad->ViewBBox();
1202 
1203  if( bbox.GetSize().x > 0 && bbox.GetSize().y > 0 )
1204  {
1205  // gives a size to the full drawable area
1206  BOX2I drawbox;
1207  drawbox.Move( m_dummyPad->GetPosition() );
1208  drawbox.Inflate( bbox.GetSize().x*2, bbox.GetSize().y*2 );
1209  view->SetBoundary( drawbox );
1210 
1211  // Autozoom
1212  view->SetViewport( BOX2D( bbox.GetOrigin(), bbox.GetSize() ) );
1213 
1214  // Add a margin
1215  view->SetScale( m_panelShowPadGal->GetView()->GetScale() * 0.7 );
1216 
1219  }
1220  }
1221  else
1222  {
1223  m_panelShowPad->Refresh();
1224  }
1225 }
const Vec & GetOrigin() const
Definition: box2.h:181
void Move(const Vec &aMoveVector)
Function Move moves the rectangle by the aMoveVector.
Definition: box2.h:108
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
const wxPoint GetCenter() const override
Function GetCenter()
void ExportTo(DRAWSEGMENT *aTarget)
returns the start point of an arc
polygon (not yet used for tracks, but could be in microwave apps)
BOX2< VECTOR2D > BOX2D
Definition: box2.h:469
usual segment : line with rounded ends
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
ITERATOR Iterate(int aFirst, int aLast, bool aIterateHoles=false)
Function Iterate returns an object to iterate through the points of the polygons between aFirst and a...
const Vec & GetSize() const
Definition: box2.h:177
VECTOR2< int > VECTOR2I
Definition: vector2d.h:590
virtual const BOX2I ViewBBox() const override
Function ViewBBox() returns the bounding box of the item covering all its layers. ...
Definition: class_pad.cpp:1283
int m_Radius
thickness of segment or outline For filled S_CIRCLE shape, thickness = 0.
Definition: class_pad.h:97
const wxPoint & GetPosition() const override
Definition: class_pad.h:206
Arcs (with rounded ends)
Helper class to handle a primitive (basic shape: polygon, segment, circle or arc) to build a custom p...
Definition: class_pad.h:90
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:862
SHAPE_POLY_SET & GetPolyShape()
STROKE_T m_Shape
Definition: class_pad.h:93
void StartDrawing()
Function StartDrawing() Begins drawing if it was stopped previously.
virtual void Move(const wxPoint &aMoveVector) override
Function Move move this object.
void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it bu a python script (note: it is automatically called by a...
int m_Thickness
S_SEGMENT, S_ARC, S_CIRCLE, S_POLYGON only (same as DRAWSEGMENT)
Definition: class_pad.h:94
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
Definition: box2.h:266
virtual void Rotate(const wxPoint &aRotCentre, double aAngle) override
Function Rotate Rotate this object.
std::vector< PAD_CS_PRIMITIVE > m_primitives
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in tenths of degrees, but soon degrees.
Definition: class_pad.h:361
std::vector< DRAWSEGMENT * > m_highligth
void SetEnd(const wxPoint &aEnd)
double GetScale() const
Function GetScale()
Definition: view.h:265
void StopDrawing()
Function StopDrawing() Prevents the GAL canvas from further drawing till it is recreated or StartDraw...
void SetWidth(int aWidth)
void KIWAY_HOLDER::SetKiway ( wxWindow *  aDest,
KIWAY aKiway 
)
inherited

Function SetKiway.

Parameters
aDestis the recipient of aKiway pointer. It is only used for debugging, since "this" is not a wxWindow*. "this" is a KIWAY_HOLDER mix-in.
aKiwayis often from a parent window, or from KIFACE::CreateWindow().

Definition at line 41 of file kiway_holder.cpp.

References KIWAY_HOLDER::m_kiway, and name.

Referenced by DIALOG_SHIM::DIALOG_SHIM(), and SIM_PLOT_FRAME::SIM_PLOT_FRAME().

42 {
43 #if defined(DEBUG)
44  // offer a trap point for debugging most any window
45  wxASSERT( aDest );
46  if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) )
47  {
48  int breakhere=1;
49  (void) breakhere;
50  }
51 #endif
52 
53  (void) aDest;
54 
55  m_kiway = aKiway;
56 }
KIWAY * m_kiway
Definition: kiway_player.h:85
const char * name
void DIALOG_PAD_PROPERTIES::setPadLayersList ( LSET  layer_mask)
private

Function setPadLayersList updates the CheckBox states in pad layers list,.

Parameters
layer_mask= pad layer mask (ORed layers bit mask)

Definition at line 944 of file dialog_pad_properties.cpp.

References LSET::AllCuMask(), B_Adhes, B_Cu, B_Mask, B_Paste, B_SilkS, Dwgs_User, Eco1_User, Eco2_User, F_Adhes, F_Cu, F_Mask, F_Paste, F_SilkS, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerAdhCmp, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerAdhCu, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerDraft, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerECO1, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerECO2, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerMaskCmp, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerMaskCu, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerPateCmp, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerPateCu, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerSilkCmp, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerSilkCu, and DIALOG_PAD_PROPERTIES_BASE::m_rbCopperLayersSel.

Referenced by initValues(), and PadTypeSelected().

945 {
946  LSET cu_set = layer_mask & LSET::AllCuMask();
947 
948  if( cu_set == LSET( F_Cu ) )
949  m_rbCopperLayersSel->SetSelection( 0 );
950  else if( cu_set == LSET( B_Cu ) )
951  m_rbCopperLayersSel->SetSelection( 1 );
952  else if( cu_set.any() )
953  m_rbCopperLayersSel->SetSelection( 2 );
954  else
955  m_rbCopperLayersSel->SetSelection( 3 );
956 
957  m_PadLayerAdhCmp->SetValue( layer_mask[F_Adhes] );
958  m_PadLayerAdhCu->SetValue( layer_mask[B_Adhes] );
959 
960  m_PadLayerPateCmp->SetValue( layer_mask[F_Paste] );
961  m_PadLayerPateCu->SetValue( layer_mask[B_Paste] );
962 
963  m_PadLayerSilkCmp->SetValue( layer_mask[F_SilkS] );
964  m_PadLayerSilkCu->SetValue( layer_mask[B_SilkS] );
965 
966  m_PadLayerMaskCmp->SetValue( layer_mask[F_Mask] );
967  m_PadLayerMaskCu->SetValue( layer_mask[B_Mask] );
968 
969  m_PadLayerECO1->SetValue( layer_mask[Eco1_User] );
970  m_PadLayerECO2->SetValue( layer_mask[Eco2_User] );
971 
972  m_PadLayerDraft->SetValue( layer_mask[Dwgs_User] );
973 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:646
Class LSET is a set of PCB_LAYER_IDs.
bool DIALOG_SHIM::Show ( bool  show)
overrideinherited

Definition at line 139 of file dialog_shim.cpp.

References class_map, DIALOG_SHIM::FixOSXCancelButtonIssue(), EDA_RECT::GetPosition(), EDA_RECT::GetSize(), DIALOG_SHIM::m_hash_key, wxPoint::x, and wxPoint::y.

Referenced by DisplayHotkeyList(), DIALOG_SHIM::EndQuasiModal(), InvokeDialogERC(), DIALOG_ANNOTATE::OnApplyClick(), DIALOG_SCH_FIND::OnCancel(), DIALOG_ANNOTATE::OnCancelClick(), DIALOG_DRC_CONTROL::OnLeftDClickClearance(), DIALOG_DRC_CONTROL::OnLeftDClickUnconnected(), DIALOG_DRC_CONTROL::OnPopupMenu(), DIALOG_EXCHANGE_MODULE::OnQuit(), POSITION_RELATIVE_TOOL::PositionRelative(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), DRC::ShowDRCDialog(), and DIALOG_SHIM::ShowQuasiModal().

140 {
141  bool ret;
142  const char* hash_key;
143 
144  if( m_hash_key.size() )
145  {
146  // a special case like EDA_LIST_DIALOG, which has multiple uses.
147  hash_key = m_hash_key.c_str();
148  }
149  else
150  {
151  hash_key = typeid(*this).name();
152  }
153 
154  // Show or hide the window. If hiding, save current position and size.
155  // If showing, use previous position and size.
156  if( show )
157  {
158  wxDialog::Raise(); // Needed on OS X and some other window managers (i.e. Unity)
159  ret = wxDialog::Show( show );
160 
161  // classname is key, returns a zeroed out default EDA_RECT if none existed before.
162  EDA_RECT r = class_map[ hash_key ];
163 
164  if( r.GetSize().x != 0 && r.GetSize().y != 0 )
165  SetSize( r.GetPosition().x, r.GetPosition().y, r.GetSize().x, r.GetSize().y, 0 );
166  }
167  else
168  {
169  // Save the dialog's position & size before hiding, using classname as key
170  EDA_RECT r( wxDialog::GetPosition(), wxDialog::GetSize() );
171  class_map[ hash_key ] = r;
172 
173  ret = wxDialog::Show( show );
174  }
175 
177 
178  return ret;
179 }
std::string m_hash_key
Definition: dialog_shim.h:128
void FixOSXCancelButtonIssue()
A ugly hack to fix an issue on OSX: when typing ctrl+c in a wxTextCtrl inside a dialog, it is closed instead of copying a text if a button with wxID_CANCEL is used in a wxStdDialogButtonSizer, when the dlg is created by wxFormBuilder: the label is &Cancel, and this accelerator key has priority to copy text standard accelerator, and the dlg is closed when trying to copy text this function do nothing on other platforms.
static RECT_MAP class_map
const wxPoint & GetPosition() const
Class EDA_RECT handles the component boundary box.
const wxSize & GetSize() const
int DIALOG_SHIM::ShowQuasiModal ( )
inherited

Definition at line 495 of file dialog_shim.cpp.

References DBG, DIALOG_SHIM::m_qmodal_loop, DIALOG_SHIM::m_qmodal_parent_disabler, DIALOG_SHIM::m_qmodal_showing, and DIALOG_SHIM::Show().

Referenced by LIB_EDIT_FRAME::DeleteOnePart(), SCH_EDIT_FRAME::EditComponent(), SCH_EDIT_FRAME::EditComponentFieldText(), LIB_EDIT_FRAME::EditField(), EDIT_TOOL::ExchangeFootprints(), PCB_EDIT_FRAME::InstallExchangeModuleFrame(), LIB_EDIT_FRAME::InstallFieldsEditorDialog(), SCH_EDIT_FRAME::InstallHierarchyFrame(), InvokeDialogCreateBOMEditor(), InvokeDialogUpdateFields(), LIB_VIEW_FRAME::OnSelectSymbol(), and SCH_BASE_FRAME::SelectComponentFromLibrary().

496 {
497  // This is an exception safe way to zero a pointer before returning.
498  // Yes, even though DismissModal() clears this first normally, this is
499  // here in case there's an exception before the dialog is dismissed.
500  struct NULLER
501  {
502  void*& m_what;
503  NULLER( void*& aPtr ) : m_what( aPtr ) {}
504  ~NULLER() { m_what = 0; } // indeed, set it to NULL on destruction
505  } clear_this( (void*&) m_qmodal_loop );
506 
507  // release the mouse if it's currently captured as the window having it
508  // will be disabled when this dialog is shown -- but will still keep the
509  // capture making it impossible to do anything in the modal dialog itself
510  wxWindow* win = wxWindow::GetCapture();
511  if( win )
512  win->ReleaseMouse();
513 
514  // Get the optimal parent
515  wxWindow* parent = GetParentForModalDialog( GetParent(), GetWindowStyle() );
516 
517  // Show the optimal parent
518  DBG( if( parent ) printf( "%s: optimal parent: %s\n", __func__, typeid(*parent).name() );)
519 
520  wxASSERT_MSG( !m_qmodal_parent_disabler,
521  wxT( "Caller using ShowQuasiModal() twice on same window?" ) );
522 
523  // quasi-modal: disable only my "optimal" parent
525 
526  Show( true );
527 
528  m_qmodal_showing = true;
529 
530  EVENT_LOOP event_loop;
531 
532  m_qmodal_loop = &event_loop;
533 
534  event_loop.Run();
535 
536  return GetReturnCode();
537 }
bool m_qmodal_showing
Definition: dialog_shim.h:132
EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:131
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:133
Toggle a window's "enable" status to disabled, then enabled on destruction.
Definition: dialog_shim.cpp:33
#define DBG(x)
Definition: fctsys.h:33
bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow ( )
overrideprivate

Updates the different parameters for the component being edited.

Automatically fired from the OK button click.

Definition at line 1243 of file dialog_pad_properties.cpp.

References MODULE::CalculateBoundingBox(), EDA_ITEM::ClearFlags(), D_PAD::DeletePrimitivesList(), DisplayError(), DO_NOT_DRAW, BOARD::FindNet(), FlipLayerMask(), D_PAD::FlipPrimitives(), D_PAD::GetAnchorPadShape(), D_PAD::GetAttribute(), D_PAD::GetBoundingBox(), EDA_DRAW_FRAME::GetCanvas(), D_PAD::GetCustomShapeInZoneOpt(), D_PAD::GetDelta(), D_PAD::GetDrillShape(), D_PAD::GetDrillSize(), D_PAD::GetLayerSet(), D_PAD::GetLocalClearance(), D_PAD::GetLocalSolderMaskMargin(), D_PAD::GetLocalSolderPasteMargin(), D_PAD::GetLocalSolderPasteMarginRatio(), D_PAD::GetName(), NETINFO_ITEM::GetNet(), BOARD_CONNECTED_ITEM::GetNetname(), D_PAD::GetOffset(), MODULE::GetOrientation(), D_PAD::GetOrientation(), D_PAD::GetPadToDieLength(), D_PAD::GetParent(), MODULE::GetPosition(), D_PAD::GetPosition(), D_PAD::GetPrimitives(), D_PAD::GetRoundRectRadiusRatio(), D_PAD::GetShape(), D_PAD::GetSize(), D_PAD::GetThermalGap(), D_PAD::GetThermalWidth(), D_PAD::GetZoneConnection(), m_board, m_currentPad, m_isFlipped, DIALOG_PAD_PROPERTIES_BASE::m_localSettingsPanel, m_padMaster, DIALOG_PAD_PROPERTIES_BASE::m_PadNetNameCtrl, DIALOG_PAD_PROPERTIES_BASE::m_panelGeneral, m_parent, BOARD::m_Status_Pcb, COMMIT::Modify(), PAD_ATTRIB_HOLE_NOT_PLATED, PAD_SHAPE_CUSTOM, PAD_SHAPE_RECT, PAD_SHAPE_ROUNDRECT, padValuesOK(), BOARD_COMMIT::Push(), EDA_DRAW_PANEL::RefreshDrawingRect(), RotatePoint(), D_PAD::SetAnchorPadShape(), D_PAD::SetAttribute(), D_PAD::SetCustomShapeInZoneOpt(), D_PAD::SetDelta(), D_PAD::SetDrillShape(), D_PAD::SetDrillSize(), EDA_ITEM::SetFlags(), MODULE::SetLastEditTime(), D_PAD::SetLayerSet(), D_PAD::SetLocalClearance(), D_PAD::SetLocalSolderMaskMargin(), D_PAD::SetLocalSolderPasteMargin(), D_PAD::SetLocalSolderPasteMarginRatio(), EDA_DRAW_FRAME::SetMsgPanel(), D_PAD::SetName(), BOARD_CONNECTED_ITEM::SetNetCode(), D_PAD::SetOffset(), D_PAD::SetOrientation(), D_PAD::SetPadToDieLength(), D_PAD::SetPos0(), D_PAD::SetPosition(), D_PAD::SetPrimitives(), D_PAD::SetRoundRectRadiusRatio(), D_PAD::SetShape(), D_PAD::SetSize(), D_PAD::SetThermalGap(), D_PAD::SetThermalWidth(), D_PAD::SetZoneConnection(), transferDataToPad(), NETINFO_LIST::UNCONNECTED, and wxPoint::y.

1244 {
1245  BOARD_COMMIT commit( m_parent );
1246 
1247  if( !wxDialog::TransferDataFromWindow() )
1248  return false;
1249 
1250  if( !m_panelGeneral->TransferDataFromWindow() )
1251  return false;
1252 
1253  if( !m_localSettingsPanel->TransferDataFromWindow() )
1254  return false;
1255 
1256  if( !padValuesOK() )
1257  return false;
1258 
1259  bool rastnestIsChanged = false;
1260  int isign = m_isFlipped ? -1 : 1;
1261 
1263  // m_padMaster is a pattern: ensure there is no net for this pad:
1265 
1266  if( !m_currentPad ) // Set current Pad parameters
1267  return true;
1268 
1269  commit.Modify( m_currentPad );
1270 
1271  // redraw the area where the pad was, without pad (delete pad on screen)
1275 
1276  // Update values
1279 
1281  {
1283  rastnestIsChanged = true;
1284  }
1285 
1286  wxSize size;
1287  MODULE* footprint = m_currentPad->GetParent();
1288 
1289  if( footprint )
1290  {
1291  footprint->SetLastEditTime();
1292 
1293  // compute the pos 0 value, i.e. pad position for footprint with orientation = 0
1294  // i.e. relative to footprint origin (footprint position)
1295  wxPoint pt = m_currentPad->GetPosition() - footprint->GetPosition();
1296  RotatePoint( &pt, -footprint->GetOrientation() );
1297  m_currentPad->SetPos0( pt );
1299  + footprint->GetOrientation() );
1300  }
1301 
1303 
1304  size = m_padMaster->GetDelta();
1305  size.y *= isign;
1306  m_currentPad->SetDelta( size );
1307 
1310 
1311  wxPoint offset = m_padMaster->GetOffset();
1312  offset.y *= isign;
1313  m_currentPad->SetOffset( offset );
1314 
1316 
1319 
1320 
1323 
1324  if( m_isFlipped )
1325  {
1328  }
1329 
1331  {
1332  rastnestIsChanged = true;
1334  }
1335 
1336  if( m_isFlipped )
1337  {
1339  }
1340 
1342 
1343  wxString padNetname;
1344 
1345  // For PAD_ATTRIB_HOLE_NOT_PLATED, ensure there is no net name selected
1347  padNetname = m_PadNetNameCtrl->GetValue();
1348 
1349  if( m_currentPad->GetNetname() != padNetname )
1350  {
1351  const NETINFO_ITEM* netinfo = m_board->FindNet( padNetname );
1352 
1353  if( !padNetname.IsEmpty() && netinfo == NULL )
1354  {
1355  DisplayError( NULL, _( "Unknown netname, netname not changed" ) );
1356  }
1357  else if( netinfo )
1358  {
1359  rastnestIsChanged = true;
1360  m_currentPad->SetNetCode( netinfo->GetNet() );
1361  }
1362  }
1363 
1372 
1373  // rounded rect pads with radius ratio = 0 are in fact rect pads.
1374  // So set the right shape (and perhaps issues with a radius = 0)
1377  {
1379  }
1380 
1381  // define the way the clearnce area is defined in zones
1383 
1384  if( footprint )
1385  footprint->CalculateBoundingBox();
1386 
1388 
1389  // redraw the area where the pad was
1391 
1392  commit.Push( _( "Modify pad" ) );
1393 
1394  if( rastnestIsChanged ) // The net ratsnest must be recalculated
1395  m_board->m_Status_Pcb = 0;
1396 
1397  return true;
1398 }
PAD_SHAPE_T GetAnchorPadShape() const
Function GetAnchorPadShape.
Definition: class_pad.h:212
LSET FlipLayerMask(LSET aMask, int aCopperLayersCount)
Calculate the mask layer when flipping a footprint BACK and FRONT copper layers, mask, paste, solder layers are swapped internal layers are flipped only if the copper layers count is known.
Definition: lset.cpp:491
const std::vector< PAD_CS_PRIMITIVE > & GetPrimitives() const
Accessor to the basic shape list.
Definition: class_pad.h:322
void FlipPrimitives()
Flip the basic shapes, in custom pads.
Definition: class_pad.cpp:434
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:384
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:65
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:337
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
int GetPadToDieLength() const
Definition: class_pad.h:387
bool transferDataToPad(D_PAD *aPad)
Copy values from dialog field to aPad's members.
const wxPoint & GetPosition() const override
Definition: class_module.h:155
int GetLocalSolderMaskMargin() const
Definition: class_pad.h:389
MODULE * GetParent() const
Definition: class_pad.h:148
void SetPosition(const wxPoint &aPos) override
Definition: class_pad.h:205
void RefreshDrawingRect(const EDA_RECT &aRect, bool aEraseBackground=true)
Function RefreshDrawingRect redraws the contents of aRect in drawing units.
Definition: draw_panel.cpp:305
PAD_DRILL_SHAPE_T GetDrillShape() const
Definition: class_pad.h:367
void SetDrillSize(const wxSize &aSize)
Definition: class_pad.h:260
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
const wxSize & GetDrillSize() const
Definition: class_pad.h:261
void SetRoundRectRadiusRatio(double aRadiusScale)
has meaning only for rounded rect pads Set the scaling factor between the smaller Y or Y size and the...
Definition: class_pad.h:606
void SetLastEditTime(time_t aTime)
Definition: class_module.h:282
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:202
void SetAnchorPadShape(PAD_SHAPE_T aShape)
Function SetAnchorPadShape Set the shape of the anchor pad for custm shped pads.
Definition: class_pad.h:239
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:267
void SetZoneConnection(ZoneConnection aType)
Definition: class_pad.h:455
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Function SetMsgPanel clears the message panel and populates it with the contents of aList...
Definition: draw_frame.cpp:784
void SetName(const wxString &aName)
Set the pad name (sometimes called pad number, although it can be an array reference like AA12)...
Definition: class_pad.h:168
double GetOrientation() const
Definition: class_module.h:160
void SetPos0(const wxPoint &aPos)
Definition: class_pad.h:248
const wxPoint & GetPosition() const override
Definition: class_pad.h:206
ZoneConnection GetZoneConnection() const
Definition: class_pad.cpp:650
LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_pad.h:381
int GetThermalWidth() const
Definition: class_pad.cpp:661
int GetThermalGap() const
Definition: class_pad.cpp:672
void SetThermalWidth(int aWidth)
Definition: class_pad.h:458
const wxSize & GetSize() const
Definition: class_pad.h:255
void SetSize(const wxSize &aSize)
Definition: class_pad.h:254
bool SetNetCode(int aNetCode, bool aNoAssert=false)
Function SetNetCode sets net using a net code.
const wxString & GetName() const
Definition: class_pad.h:176
int GetLocalSolderPasteMargin() const
Definition: class_pad.h:395
void SetPadToDieLength(int aLength)
Definition: class_pad.h:386
int GetNet() const
Function GetNet.
void SetAttribute(PAD_ATTR_T aAttribute)
Definition: class_pad.cpp:392
int GetLocalClearance() const
Definition: class_pad.h:392
void SetLocalClearance(int aClearance)
Definition: class_pad.h:393
double GetLocalSolderPasteMarginRatio() const
Definition: class_pad.h:398
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: class_pad.h:399
void SetLayerSet(LSET aLayerMask)
Definition: class_pad.h:380
Class NETINFO_ITEM handles the data for a net.
Definition: class_netinfo.h:69
const wxString & GetNetname() const
Function GetNetname.
double GetRoundRectRadiusRatio() const
has meaning only for rounded rect pads
Definition: class_pad.h:594
void SetDrillShape(PAD_DRILL_SHAPE_T aDrillShape)
Definition: class_pad.h:365
void SetLocalSolderMaskMargin(int aMargin)
Definition: class_pad.h:390
CUST_PAD_SHAPE_IN_ZONE GetCustomShapeInZoneOpt() const
Definition: class_pad.h:218
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in tenths of degrees, but soon degrees.
Definition: class_pad.h:361
const wxSize & GetDelta() const
Definition: class_pad.h:258
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
void SetShape(PAD_SHAPE_T aShape)
Definition: class_pad.h:203
void SetOrientation(double aAngle)
Function SetOrientation sets the rotation angle of the pad.
Definition: class_pad.cpp:401
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:268
bool padValuesOK()
test if all values are acceptable for the pad
void SetLocalSolderPasteMargin(int aMargin)
Definition: class_pad.h:396
void SetCustomShapeInZoneOpt(CUST_PAD_SHAPE_IN_ZONE aOption)
Set the option for the custom pad shape to use as clearance area in copper zones. ...
Definition: class_pad.h:228
void SetOffset(const wxPoint &aOffset)
Definition: class_pad.h:263
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:71
void SetThermalGap(int aGap)
Definition: class_pad.h:461
static const int UNCONNECTED
Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are ...
bool SetPrimitives(const std::vector< PAD_CS_PRIMITIVE > &aPrimitivesList)
Import to the basic shape list.
void DeletePrimitivesList()
clear the basic shapes list
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
Definition: class_pad.cpp:199
const wxPoint & GetOffset() const
Definition: class_pad.h:264
#define DO_NOT_DRAW
Used to disable draw function.
Definition: base_struct.h:139
void SetDelta(const wxSize &aSize)
Definition: class_pad.h:257
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:237
bool DIALOG_PAD_PROPERTIES::transferDataToPad ( D_PAD aPad)
private

Copy values from dialog field to aPad's members.

Definition at line 1401 of file dialog_pad_properties.cpp.

References LSET::AllCuMask(), B_Adhes, B_Cu, B_Mask, B_Paste, B_SilkS, CHOICE_SHAPE_CUSTOM_RECT_ANCHOR, code_shape, code_type, CUST_PAD_SHAPE_IN_ZONE_CONVEXHULL, CUST_PAD_SHAPE_IN_ZONE_OUTLINE, delta, DisplayError(), Dwgs_User, Eco1_User, Eco2_User, F_Adhes, F_Cu, F_Mask, F_Paste, F_SilkS, BOARD::FindNet(), D_PAD::GetAnchorPadShape(), D_PAD::GetAttribute(), NETINFO_ITEM::GetNet(), D_PAD::GetShape(), D_PAD::GetSize(), m_board, DIALOG_PAD_PROPERTIES_BASE::m_DrillShapeCtrl, DIALOG_PAD_PROPERTIES_BASE::m_LengthPadToDieCtrl, DIALOG_PAD_PROPERTIES_BASE::m_localSettingsPanel, DIALOG_PAD_PROPERTIES_BASE::m_NetClearanceValueCtrl, m_OrientValidator, m_OrientValue, DIALOG_PAD_PROPERTIES_BASE::m_PadDrill_X_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_PadDrill_Y_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerAdhCmp, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerAdhCu, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerDraft, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerECO1, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerECO2, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerMaskCmp, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerMaskCu, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerPateCmp, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerPateCu, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerSilkCmp, DIALOG_PAD_PROPERTIES_BASE::m_PadLayerSilkCu, DIALOG_PAD_PROPERTIES_BASE::m_PadNetNameCtrl, DIALOG_PAD_PROPERTIES_BASE::m_PadNumCtrl, DIALOG_PAD_PROPERTIES_BASE::m_PadPosition_X_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_PadPosition_Y_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_PadShape, DIALOG_PAD_PROPERTIES_BASE::m_PadType, DIALOG_PAD_PROPERTIES_BASE::m_panelGeneral, m_primitives, DIALOG_PAD_PROPERTIES_BASE::m_rbCopperLayersSel, DIALOG_PAD_PROPERTIES_BASE::m_ShapeDelta_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_ShapeOffset_X_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_ShapeOffset_Y_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_ShapeSize_X_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_ShapeSize_Y_Ctrl, DIALOG_PAD_PROPERTIES_BASE::m_SolderMaskMarginCtrl, DIALOG_PAD_PROPERTIES_BASE::m_SolderPasteMarginCtrl, DIALOG_PAD_PROPERTIES_BASE::m_SolderPasteMarginRatioCtrl, DIALOG_PAD_PROPERTIES_BASE::m_tcCornerSizeRatio, DIALOG_PAD_PROPERTIES_BASE::m_ThermalGapCtrl, DIALOG_PAD_PROPERTIES_BASE::m_ThermalWidthCtrl, DIALOG_PAD_PROPERTIES_BASE::m_trapDeltaDirChoice, DIALOG_PAD_PROPERTIES_BASE::m_ZoneConnectionChoice, DIALOG_PAD_PROPERTIES_BASE::m_ZoneCustomPadShape, PAD_ATTRIB_CONN, PAD_ATTRIB_HOLE_NOT_PLATED, PAD_ATTRIB_SMD, PAD_ATTRIB_STANDARD, PAD_DRILL_SHAPE_CIRCLE, PAD_DRILL_SHAPE_OBLONG, PAD_SHAPE_CIRCLE, PAD_SHAPE_CUSTOM, PAD_SHAPE_OVAL, PAD_SHAPE_RECT, PAD_SHAPE_ROUNDRECT, PAD_SHAPE_TRAPEZOID, PAD_ZONE_CONN_FULL, PAD_ZONE_CONN_INHERITED, PAD_ZONE_CONN_NONE, PAD_ZONE_CONN_THERMAL, D_PAD::SetAnchorPadShape(), D_PAD::SetAttribute(), D_PAD::SetCustomShapeInZoneOpt(), D_PAD::SetDelta(), D_PAD::SetDrillShape(), D_PAD::SetDrillSize(), D_PAD::SetLayerSet(), D_PAD::SetLocalClearance(), D_PAD::SetLocalSolderMaskMargin(), D_PAD::SetLocalSolderPasteMargin(), D_PAD::SetLocalSolderPasteMarginRatio(), D_PAD::SetName(), BOARD_CONNECTED_ITEM::SetNetCode(), D_PAD::SetOffset(), D_PAD::SetOrientation(), D_PAD::SetPadToDieLength(), D_PAD::SetPos0(), D_PAD::SetPosition(), D_PAD::SetPrimitives(), D_PAD::SetRoundRectRadiusRatio(), D_PAD::SetShape(), D_PAD::SetSize(), D_PAD::SetThermalGap(), D_PAD::SetThermalWidth(), D_PAD::SetZoneConnection(), NETINFO_LIST::UNCONNECTED, and ValueFromTextCtrl().

Referenced by editPrimitive(), onAddPrimitive(), onCornerSizePercentChange(), onDeletePrimitive(), OnDrillShapeSelected(), onDuplicatePrimitive(), onGeometryTransform(), OnPadShapeSelection(), OnSetLayers(), OnValuesChanged(), PadOrientEvent(), padValuesOK(), and TransferDataFromWindow().

1402 {
1403  wxString msg;
1404  int x, y;
1405 
1406  if( !Validate() )
1407  return true;
1408  if( !m_panelGeneral->Validate() )
1409  return true;
1410  if( !m_localSettingsPanel->Validate() )
1411  return true;
1412 
1413  m_OrientValidator.TransferFromWindow();
1414 
1415  aPad->SetAttribute( code_type[m_PadType->GetSelection()] );
1416  aPad->SetShape( code_shape[m_PadShape->GetSelection()] );
1419 
1420  if( aPad->GetShape() == PAD_SHAPE_CUSTOM )
1421  aPad->SetPrimitives( m_primitives );
1422 
1423  // Read pad clearances values:
1429  double dtmp = 0.0;
1430  msg = m_SolderPasteMarginRatioCtrl->GetValue();
1431  msg.ToDouble( &dtmp );
1432 
1433  // A -50% margin ratio means no paste on a pad, the ratio must be >= -50%
1434  if( dtmp < -50.0 )
1435  dtmp = -50.0;
1436  // A margin ratio is always <= 0
1437  // 0 means use full pad copper area
1438  if( dtmp > 0.0 )
1439  dtmp = 0.0;
1440 
1441  aPad->SetLocalSolderPasteMarginRatio( dtmp / 100 );
1442 
1443  switch( m_ZoneConnectionChoice->GetSelection() )
1444  {
1445  default:
1446  case 0:
1448  break;
1449 
1450  case 1:
1452  break;
1453 
1454  case 2:
1456  break;
1457 
1458  case 3:
1460  break;
1461  }
1462 
1463  // Read pad position:
1466 
1467  aPad->SetPosition( wxPoint( x, y ) );
1468  aPad->SetPos0( wxPoint( x, y ) );
1469 
1470  // Read pad drill:
1473 
1474  if( m_DrillShapeCtrl->GetSelection() == 0 )
1475  {
1477  y = x;
1478  }
1479  else
1481 
1482  aPad->SetDrillSize( wxSize( x, y ) );
1483 
1484  // Read pad shape size:
1487 
1488  if( aPad->GetShape() == PAD_SHAPE_CIRCLE )
1489  y = x;
1490 
1491  // for custom shped pads, the pad size is the anchor pad size:
1492  if( aPad->GetShape() == PAD_SHAPE_CUSTOM && aPad->GetAnchorPadShape() == PAD_SHAPE_CIRCLE )
1493  y = x;
1494 
1495  aPad->SetSize( wxSize( x, y ) );
1496 
1497  // Read pad length die
1499 
1500  // For a trapezoid, test delta value (be sure delta is not too large for pad size)
1501  // remember DeltaSize.x is the Y size variation
1502  bool error = false;
1503 
1504  if( aPad->GetShape() == PAD_SHAPE_TRAPEZOID )
1505  {
1506  wxSize delta;
1507 
1508  // For a trapezoid, only one of delta.x or delta.y is not 0, depending on
1509  // the direction.
1510  if( m_trapDeltaDirChoice->GetSelection() == 0 )
1511  delta.x = ValueFromTextCtrl( *m_ShapeDelta_Ctrl );
1512  else
1513  delta.y = ValueFromTextCtrl( *m_ShapeDelta_Ctrl );
1514 
1515  if( delta.x < 0 && delta.x <= -aPad->GetSize().y )
1516  {
1517  delta.x = -aPad->GetSize().y + 2;
1518  error = true;
1519  }
1520 
1521  if( delta.x > 0 && delta.x >= aPad->GetSize().y )
1522  {
1523  delta.x = aPad->GetSize().y - 2;
1524  error = true;
1525  }
1526 
1527  if( delta.y < 0 && delta.y <= -aPad->GetSize().x )
1528  {
1529  delta.y = -aPad->GetSize().x + 2;
1530  error = true;
1531  }
1532 
1533  if( delta.y > 0 && delta.y >= aPad->GetSize().x )
1534  {
1535  delta.y = aPad->GetSize().x - 2;
1536  error = true;
1537  }
1538 
1539  aPad->SetDelta( delta );
1540  }
1541 
1542  // Read pad shape offset:
1545  aPad->SetOffset( wxPoint( x, y ) );
1546 
1547  aPad->SetOrientation( m_OrientValue * 10.0 );
1548  aPad->SetName( m_PadNumCtrl->GetValue() );
1549 
1550  // Check if user has set an existing net name
1551  const NETINFO_ITEM* netinfo = m_board->FindNet( m_PadNetNameCtrl->GetValue() );
1552 
1553  if( netinfo != NULL )
1554  aPad->SetNetCode( netinfo->GetNet() );
1555  else
1557 
1558  // Clear some values, according to the pad type and shape
1559  switch( aPad->GetShape() )
1560  {
1561  case PAD_SHAPE_CIRCLE:
1562  aPad->SetOffset( wxPoint( 0, 0 ) );
1563  aPad->SetDelta( wxSize( 0, 0 ) );
1564  x = aPad->GetSize().x;
1565  aPad->SetSize( wxSize( x, x ) );
1566  break;
1567 
1568  case PAD_SHAPE_RECT:
1569  aPad->SetDelta( wxSize( 0, 0 ) );
1570  break;
1571 
1572  case PAD_SHAPE_OVAL:
1573  aPad->SetDelta( wxSize( 0, 0 ) );
1574  break;
1575 
1576  case PAD_SHAPE_TRAPEZOID:
1577  break;
1578 
1579  case PAD_SHAPE_ROUNDRECT:
1580  aPad->SetDelta( wxSize( 0, 0 ) );
1581  break;
1582 
1583  case PAD_SHAPE_CUSTOM:
1584  aPad->SetOffset( wxPoint( 0, 0 ) );
1585  aPad->SetDelta( wxSize( 0, 0 ) );
1586 
1587  // The pad custom has a "anchor pad" (a basic shape: round or rect pad)
1588  // that is the minimal area of this pad, and is usefull to ensure a hole
1589  // diameter is acceptable, and is used in Gerber files as flashed area
1590  // reference
1591  if( aPad->GetAnchorPadShape() == PAD_SHAPE_CIRCLE )
1592  {
1593  x = aPad->GetSize().x;
1594  aPad->SetSize( wxSize( x, x ) );
1595  }
1596 
1597  // define the way the clearance area is defined in zones
1598  aPad->SetCustomShapeInZoneOpt( m_ZoneCustomPadShape->GetSelection() == 0 ?
1601 
1602  break;
1603 
1604  default:
1605  ;
1606  }
1607 
1608  switch( aPad->GetAttribute() )
1609  {
1610  case PAD_ATTRIB_STANDARD:
1611  break;
1612 
1613  case PAD_ATTRIB_CONN:
1614  case PAD_ATTRIB_SMD:
1615  // SMD and PAD_ATTRIB_CONN has no hole.
1616  // basically, SMD and PAD_ATTRIB_CONN are same type of pads
1617  // PAD_ATTRIB_CONN has just a default non technical layers that differs from SMD
1618  // and are intended to be used in virtual edge board connectors
1619  // However we can accept a non null offset,
1620  // mainly to allow complex pads build from a set of basic pad shapes
1621  aPad->SetDrillSize( wxSize( 0, 0 ) );
1622  break;
1623 
1625  // Mechanical purpose only:
1626  // no offset, no net name, no pad name allowed
1627  aPad->SetOffset( wxPoint( 0, 0 ) );
1628  aPad->SetName( wxEmptyString );
1630  break;
1631 
1632  default:
1633  DisplayError( NULL, wxT( "Error: unknown pad type" ) );
1634  break;
1635  }
1636 
1637  if( aPad->GetShape() == PAD_SHAPE_ROUNDRECT )
1638  {
1639  wxString value = m_tcCornerSizeRatio->GetValue();
1640  double rrRadiusRatioPercent;
1641 
1642  if( value.ToDouble( &rrRadiusRatioPercent ) )
1643  aPad->SetRoundRectRadiusRatio( rrRadiusRatioPercent / 100.0 );
1644  }
1645 
1646  LSET padLayerMask;
1647 
1648  switch( m_rbCopperLayersSel->GetSelection() )
1649  {
1650  case 0:
1651  padLayerMask.set( F_Cu );
1652  break;
1653 
1654  case 1:
1655  padLayerMask.set( B_Cu );
1656  break;
1657 
1658  case 2:
1659  padLayerMask |= LSET::AllCuMask();
1660  break;
1661 
1662  case 3: // No copper layers
1663  break;
1664  }
1665 
1666  if( m_PadLayerAdhCmp->GetValue() )
1667  padLayerMask.set( F_Adhes );
1668 
1669  if( m_PadLayerAdhCu->GetValue() )
1670  padLayerMask.set( B_Adhes );
1671 
1672  if( m_PadLayerPateCmp->GetValue() )
1673  padLayerMask.set( F_Paste );
1674 
1675  if( m_PadLayerPateCu->GetValue() )
1676  padLayerMask.set( B_Paste );
1677 
1678  if( m_PadLayerSilkCmp->GetValue() )
1679  padLayerMask.set( F_SilkS );
1680 
1681  if( m_PadLayerSilkCu->GetValue() )
1682  padLayerMask.set( B_SilkS );
1683 
1684  if( m_PadLayerMaskCmp->GetValue() )
1685  padLayerMask.set( F_Mask );
1686 
1687  if( m_PadLayerMaskCu->GetValue() )
1688  padLayerMask.set( B_Mask );
1689 
1690  if( m_PadLayerECO1->GetValue() )
1691  padLayerMask.set( Eco1_User );
1692 
1693  if( m_PadLayerECO2->GetValue() )
1694  padLayerMask.set( Eco2_User );
1695 
1696  if( m_PadLayerDraft->GetValue() )
1697  padLayerMask.set( Dwgs_User );
1698 
1699  aPad->SetLayerSet( padLayerMask );
1700 
1701  return error;
1702 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:646
PAD_SHAPE_T GetAnchorPadShape() const
Function GetAnchorPadShape.
Definition: class_pad.h:212
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:384
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:65
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:61
wxFloatingPointValidator< double > m_OrientValidator
void SetPosition(const wxPoint &aPos) override
Definition: class_pad.h:205
void SetDrillSize(const wxSize &aSize)
Definition: class_pad.h:260
void SetRoundRectRadiusRatio(double aRadiusScale)
has meaning only for rounded rect pads Set the scaling factor between the smaller Y or Y size and the...
Definition: class_pad.h:606
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:202
static const int delta[8][2]
Definition: solve.cpp:112
static PAD_SHAPE_T code_shape[]
Pads are not covered.
Definition: zones.h:57
static PAD_ATTR_T code_type[]
void SetAnchorPadShape(PAD_SHAPE_T aShape)
Function SetAnchorPadShape Set the shape of the anchor pad for custm shped pads.
Definition: class_pad.h:239
Class LSET is a set of PCB_LAYER_IDs.
void SetZoneConnection(ZoneConnection aType)
Definition: class_pad.h:455
void SetName(const wxString &aName)
Set the pad name (sometimes called pad number, although it can be an array reference like AA12)...
Definition: class_pad.h:168
void SetPos0(const wxPoint &aPos)
Definition: class_pad.h:248
void SetThermalWidth(int aWidth)
Definition: class_pad.h:458
const wxSize & GetSize() const
Definition: class_pad.h:255
void SetSize(const wxSize &aSize)
Definition: class_pad.h:254
bool SetNetCode(int aNetCode, bool aNoAssert=false)
Function SetNetCode sets net using a net code.
void SetPadToDieLength(int aLength)
Definition: class_pad.h:386
int GetNet() const
Function GetNet.
int ValueFromTextCtrl(const wxTextCtrl &aTextCtr)
Convert the number Value in a string according to the internal units and the selected unit (g_UserUni...
Definition: base_units.cpp:384
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
Definition: pad_shapes.h:62
void SetAttribute(PAD_ATTR_T aAttribute)
Definition: class_pad.cpp:392
void SetLocalClearance(int aClearance)
Definition: class_pad.h:393
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: class_pad.h:399
void SetLayerSet(LSET aLayerMask)
Definition: class_pad.h:380
Class NETINFO_ITEM handles the data for a net.
Definition: class_netinfo.h:69
std::vector< PAD_CS_PRIMITIVE > m_primitives
void SetDrillShape(PAD_DRILL_SHAPE_T aDrillShape)
Definition: class_pad.h:365
void SetLocalSolderMaskMargin(int aMargin)
Definition: class_pad.h:390
Usual pad.
Definition: pad_shapes.h:60
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
void SetShape(PAD_SHAPE_T aShape)
Definition: class_pad.h:203
void SetOrientation(double aAngle)
Function SetOrientation sets the rotation angle of the pad.
Definition: class_pad.cpp:401
void SetLocalSolderPasteMargin(int aMargin)
Definition: class_pad.h:396
void SetCustomShapeInZoneOpt(CUST_PAD_SHAPE_IN_ZONE aOption)
Set the option for the custom pad shape to use as clearance area in copper zones. ...
Definition: class_pad.h:228
void SetOffset(const wxPoint &aOffset)
Definition: class_pad.h:263
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:71
void SetThermalGap(int aGap)
Definition: class_pad.h:461
static const int UNCONNECTED
Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are ...
Use thermal relief for pads.
Definition: zones.h:58
bool SetPrimitives(const std::vector< PAD_CS_PRIMITIVE > &aPrimitivesList)
Import to the basic shape list.
void SetDelta(const wxSize &aSize)
Definition: class_pad.h:257
pads are covered by copper
Definition: zones.h:59
bool DIALOG_PAD_PROPERTIES::TransferDataToWindow ( )
overrideprivate

Definition at line 1228 of file dialog_pad_properties.cpp.

References DIALOG_PAD_PROPERTIES_BASE::m_localSettingsPanel, and DIALOG_PAD_PROPERTIES_BASE::m_panelGeneral.

Referenced by DIALOG_PAD_PROPERTIES().

1229 {
1230  if( !wxDialog::TransferDataToWindow() )
1231  return false;
1232 
1233  if( !m_panelGeneral->TransferDataToWindow() )
1234  return false;
1235 
1236  if( !m_localSettingsPanel->TransferDataToWindow() )
1237  return false;
1238 
1239  return true;
1240 }
void DIALOG_PAD_PROPERTIES::updateRoundRectCornerValues ( )
private

Definition at line 358 of file dialog_pad_properties.cpp.

References Format(), g_UserUnit, D_PAD::GetRoundRectCornerRadius(), D_PAD::GetRoundRectRadiusRatio(), D_PAD::GetShape(), m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_staticTextCornerRadiusValue, DIALOG_PAD_PROPERTIES_BASE::m_tcCornerSizeRatio, PAD_SHAPE_RECT, PAD_SHAPE_ROUNDRECT, and StringFromValue().

Referenced by initValues(), OnPadShapeSelection(), and OnValuesChanged().

359 {
360  // Note:
361  // To avoid generating a wxEVT_TEXT event from m_tcCornerSizeRatio
362  // we use ChangeValue instead of SetValue, to set the displayed string
364  {
365  m_tcCornerSizeRatio->ChangeValue( wxString::Format( "%.1f",
369  }
370  else if( m_dummyPad->GetShape() == PAD_SHAPE_RECT )
371  {
372  m_tcCornerSizeRatio->ChangeValue( "0" );
373  m_staticTextCornerRadiusValue->SetLabel( "0" );
374  }
375  else
376  {
377  m_tcCornerSizeRatio->ChangeValue( wxEmptyString );
378  m_staticTextCornerRadiusValue->SetLabel( wxEmptyString );
379  }
380 }
wxString StringFromValue(EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymbol)
Function StringFromValue returns the string from aValue according to units (inch, mm ...
Definition: base_units.cpp:203
int GetRoundRectCornerRadius() const
Function GetRoundRectCornerRadius Has meaning only for rounded rect pads.
Definition: class_pad.h:497
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:202
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
double GetRoundRectRadiusRatio() const
has meaning only for rounded rect pads
Definition: class_pad.h:594
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205

Member Data Documentation

KIGFX::ORIGIN_VIEWITEM* DIALOG_PAD_PROPERTIES::m_axisOrigin
private

Definition at line 68 of file dialog_pad_properties.h.

Referenced by prepareCanvas(), and ~DIALOG_PAD_PROPERTIES().

BOARD* DIALOG_PAD_PROPERTIES::m_board
private
wxBoxSizer* DIALOG_PAD_PROPERTIES_BASE::m_bSizerPanelPrimitives
protectedinherited
wxButton* DIALOG_PAD_PROPERTIES_BASE::m_buttonAddShape
protectedinherited
wxButton* DIALOG_PAD_PROPERTIES_BASE::m_buttonDel
protectedinherited
wxButton* DIALOG_PAD_PROPERTIES_BASE::m_buttonDup
protectedinherited
wxButton* DIALOG_PAD_PROPERTIES_BASE::m_buttonEditShape
protectedinherited
wxButton* DIALOG_PAD_PROPERTIES_BASE::m_buttonGeometry
protectedinherited
wxButton* DIALOG_PAD_PROPERTIES_BASE::m_buttonImport
protectedinherited
bool DIALOG_PAD_PROPERTIES::m_canEditNetName
private

Definition at line 81 of file dialog_pad_properties.h.

Referenced by initValues(), and PadTypeSelected().

bool DIALOG_PAD_PROPERTIES::m_canUpdate
private
D_PAD* DIALOG_PAD_PROPERTIES::m_currentPad
private
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_customOrientUnits
protectedinherited
KIGFX::GAL_DISPLAY_OPTIONS DIALOG_PAD_PROPERTIES_BASE::m_galOptions
protectedinherited
std::string DIALOG_SHIM::m_hash_key
protectedinherited
std::vector<DRAWSEGMENT*> DIALOG_PAD_PROPERTIES::m_highligth
private

Definition at line 88 of file dialog_pad_properties.h.

Referenced by redraw().

bool DIALOG_PAD_PROPERTIES::m_isFlipped
private

Definition at line 78 of file dialog_pad_properties.h.

Referenced by initValues(), and TransferDataFromWindow().

wxTextCtrl* DIALOG_PAD_PROPERTIES_BASE::m_LengthPadToDieCtrl
protectedinherited
wxPanel* DIALOG_PAD_PROPERTIES_BASE::m_localSettingsPanel
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_MaskClearanceTitle
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_NetClearanceUnits
protectedinherited
wxTextCtrl* DIALOG_PAD_PROPERTIES_BASE::m_NetClearanceValueCtrl
protectedinherited
wxNotebook* DIALOG_PAD_PROPERTIES_BASE::m_notebook
protectedinherited
wxFloatingPointValidator<double> DIALOG_PAD_PROPERTIES::m_OrientValidator
private
double DIALOG_PAD_PROPERTIES::m_OrientValue
private

Definition at line 91 of file dialog_pad_properties.h.

Referenced by initValues(), PadOrientEvent(), and transferDataToPad().

wxTextCtrl* DIALOG_PAD_PROPERTIES_BASE::m_PadDrill_X_Ctrl
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_PadDrill_X_Unit
protectedinherited
wxTextCtrl* DIALOG_PAD_PROPERTIES_BASE::m_PadDrill_Y_Ctrl
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_PadDrill_Y_Unit
protectedinherited
wxCheckBox* DIALOG_PAD_PROPERTIES_BASE::m_PadLayerAdhCmp
protectedinherited
wxCheckBox* DIALOG_PAD_PROPERTIES_BASE::m_PadLayerAdhCu
protectedinherited
wxCheckBox* DIALOG_PAD_PROPERTIES_BASE::m_PadLayerDraft
protectedinherited
wxCheckBox* DIALOG_PAD_PROPERTIES_BASE::m_PadLayerECO1
protectedinherited
wxCheckBox* DIALOG_PAD_PROPERTIES_BASE::m_PadLayerECO2
protectedinherited
wxCheckBox* DIALOG_PAD_PROPERTIES_BASE::m_PadLayerMaskCmp
protectedinherited
wxCheckBox* DIALOG_PAD_PROPERTIES_BASE::m_PadLayerMaskCu
protectedinherited
wxCheckBox* DIALOG_PAD_PROPERTIES_BASE::m_PadLayerPateCmp
protectedinherited
wxCheckBox* DIALOG_PAD_PROPERTIES_BASE::m_PadLayerPateCu
protectedinherited
wxCheckBox* DIALOG_PAD_PROPERTIES_BASE::m_PadLayerSilkCmp
protectedinherited
wxCheckBox* DIALOG_PAD_PROPERTIES_BASE::m_PadLayerSilkCu
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_PadLengthDie_Unit
protectedinherited
D_PAD* DIALOG_PAD_PROPERTIES::m_padMaster
private

Definition at line 71 of file dialog_pad_properties.h.

Referenced by DIALOG_PAD_PROPERTIES(), and TransferDataFromWindow().

wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_PadNameText
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_PadNumText
protectedinherited
wxChoice* DIALOG_PAD_PROPERTIES_BASE::m_PadOrient
protectedinherited
wxTextCtrl* DIALOG_PAD_PROPERTIES_BASE::m_PadOrientCtrl
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_PadOrientText
protectedinherited
wxTextCtrl* DIALOG_PAD_PROPERTIES_BASE::m_PadPosition_X_Ctrl
protectedinherited
wxTextCtrl* DIALOG_PAD_PROPERTIES_BASE::m_PadPosition_Y_Ctrl
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_PadPosX_Unit
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_PadPosY_Unit
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_PadShapeDelta_Unit
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_PadShapeOffsetX_Unit
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_PadShapeOffsetY_Unit
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_PadShapeSizeX_Unit
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_PadShapeSizeY_Unit
protectedinherited
wxPanel* DIALOG_PAD_PROPERTIES_BASE::m_panelCustomShapePrimitives
protectedinherited
wxPanel* DIALOG_PAD_PROPERTIES_BASE::m_panelGeneral
protectedinherited
wxPanel* DIALOG_PAD_PROPERTIES_BASE::m_panelShowPad
protectedinherited
PCB_DRAW_PANEL_GAL* DIALOG_PAD_PROPERTIES_BASE::m_panelShowPadGal
protectedinherited
PCB_BASE_FRAME* DIALOG_PAD_PROPERTIES::m_parent
private
EVENT_LOOP* DIALOG_SHIM::m_qmodal_loop
protectedinherited

Definition at line 131 of file dialog_shim.h.

Referenced by DIALOG_SHIM::EndQuasiModal(), and DIALOG_SHIM::ShowQuasiModal().

WDO_ENABLE_DISABLE* DIALOG_SHIM::m_qmodal_parent_disabler
protectedinherited
bool DIALOG_SHIM::m_qmodal_showing
protectedinherited
wxChoice* DIALOG_PAD_PROPERTIES_BASE::m_rbCopperLayersSel
protectedinherited
wxStaticBoxSizer* DIALOG_PAD_PROPERTIES_BASE::m_sbSizerZonesSettings
protectedinherited
wxStdDialogButtonSizer* DIALOG_PAD_PROPERTIES_BASE::m_sdbSizer
protectedinherited
wxButton* DIALOG_PAD_PROPERTIES_BASE::m_sdbSizerCancel
protectedinherited
wxButton* DIALOG_PAD_PROPERTIES_BASE::m_sdbSizerOK
protectedinherited
wxTextCtrl* DIALOG_PAD_PROPERTIES_BASE::m_ShapeDelta_Ctrl
protectedinherited
wxTextCtrl* DIALOG_PAD_PROPERTIES_BASE::m_ShapeOffset_X_Ctrl
protectedinherited
wxTextCtrl* DIALOG_PAD_PROPERTIES_BASE::m_ShapeOffset_Y_Ctrl
protectedinherited
wxTextCtrl* DIALOG_PAD_PROPERTIES_BASE::m_ShapeSize_X_Ctrl
protectedinherited
wxTextCtrl* DIALOG_PAD_PROPERTIES_BASE::m_ShapeSize_Y_Ctrl
protectedinherited
wxTextCtrl* DIALOG_PAD_PROPERTIES_BASE::m_SolderMaskMarginCtrl
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_SolderMaskMarginUnits
protectedinherited
wxTextCtrl* DIALOG_PAD_PROPERTIES_BASE::m_SolderPasteMarginCtrl
protectedinherited
wxTextCtrl* DIALOG_PAD_PROPERTIES_BASE::m_SolderPasteMarginRatioCtrl
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_SolderPasteMarginUnits
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_SolderPasteRatioMarginUnits
protectedinherited
wxStaticLine* DIALOG_PAD_PROPERTIES_BASE::m_staticline4
protectedinherited
wxStaticLine* DIALOG_PAD_PROPERTIES_BASE::m_staticline5
protectedinherited
wxStaticLine* DIALOG_PAD_PROPERTIES_BASE::m_staticline6
protectedinherited
wxStaticLine* DIALOG_PAD_PROPERTIES_BASE::m_staticline7
protectedinherited
wxStaticLine* DIALOG_PAD_PROPERTIES_BASE::m_staticline8
protectedinherited
wxStaticLine* DIALOG_PAD_PROPERTIES_BASE::m_staticline9
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_staticModuleRotValue
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_staticModuleSideValue
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_staticText12
protectedinherited
wxStaticText* DIALOG_PAD_PROPERTIES_BASE::m_staticText15
protectedinherited

Definition at line 79 of file