KiCad PCB EDA Suite
DIALOG_PAD_PROPERTIES Class Reference

#include <dialog_pad_properties.h>

Inheritance diagram for DIALOG_PAD_PROPERTIES:
DIALOG_PAD_PROPERTIES_BASE DIALOG_SHIM KIWAY_HOLDER

Public Types

enum  HOLDER_TYPE { DIALOG , FRAME , PANEL }
 

Public Member Functions

 DIALOG_PAD_PROPERTIES (PCB_BASE_FRAME *aParent, PAD *aPad)
 
 ~DIALOG_PAD_PROPERTIES ()
 
void SetInitialFocus (wxWindow *aWindow)
 Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown. More...
 
int ShowQuasiModal ()
 
void EndQuasiModal (int retCode)
 
bool IsQuasiModal () const
 
bool Enable (bool enable) override
 
void OnPaint (wxPaintEvent &event)
 
void OnModify ()
 
void SetPosition (const wxPoint &aNewPosition)
 Force the position of the dialog to a new position. More...
 
EDA_UNITS GetUserUnits () const
 
void SetupStandardButtons (std::map< int, wxString > aLabels={})
 
HOLDER_TYPE GetType () const
 
KIWAYKiway () const
 Return a reference to the KIWAY that this object has an opportunity to participate in. More...
 
bool HasKiway () const
 Safety check before asking for the Kiway reference. More...
 
PROJECTPrj () const
 Return a reference to the PROJECT associated with this KIWAY. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 It is only used for debugging, since "this" is not a wxWindow*. More...
 

Static Public Member Functions

static bool IsCtrl (int aChar, const wxKeyEvent &e)
 
static bool IsShiftCtrl (int aChar, const wxKeyEvent &e)
 

Protected Types

enum  { wxID_DIALOG_EDIT_PAD = 1000 , wxID_PADNUMCTRL }
 

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 setSizeInDU (int x, int y)
 Set the dialog to the given dimensions in "dialog units". More...
 
int horizPixelsFromDU (int x) const
 Convert an integer number of dialog units to pixels, horizontally. More...
 
int vertPixelsFromDU (int y) const
 Convert an integer number of dialog units to pixels, vertically. More...
 
void resetSize ()
 Clear the existing dialog size and position. More...
 
virtual void OnCharHook (wxKeyEvent &aEvt)
 

Protected Attributes

wxBoxSizer * m_MainSizer
 
wxNotebook * m_notebook
 
wxPanel * m_panelGeneral
 
wxBoxSizer * m_LeftBoxSizer
 
wxStaticText * m_padTypeLabel
 
wxChoice * m_padType
 
wxStaticText * m_padNumLabel
 
wxTextCtrl * m_padNumCtrl
 
wxStaticText * m_padNetLabel
 
NET_SELECTORm_padNetSelector
 
wxStaticText * m_posXLabel
 
wxTextCtrl * m_posXCtrl
 
wxStaticText * m_posXUnits
 
wxStaticText * m_posYLabel
 
wxTextCtrl * m_posYCtrl
 
wxStaticText * m_posYUnits
 
wxStaticLine * m_staticline5
 
wxStaticText * m_shapeLabel
 
wxChoice * m_PadShapeSelector
 
wxSimplebook * m_shapePropsBook
 
wxPanel * m_emptyProps
 
wxPanel * m_trapProps
 
wxFlexGridSizer * fgSizerTrapProps
 
wxStaticText * m_trapDeltaLabel
 
wxTextCtrl * m_trapDeltaCtrl
 
wxStaticText * m_trapDeltaUnits
 
wxStaticText * m_trapAxisLabel
 
wxChoice * m_trapAxisCtrl
 
wxPanel * m_roudingProps
 
wxFlexGridSizer * fgSizerRoundingProps
 
wxStaticText * m_cornerRatioLabel
 
TEXT_CTRL_EVALm_cornerRatioCtrl
 
wxStaticText * m_cornerRatioUnits
 
wxStaticText * m_cornerRadiusLabel
 
wxTextCtrl * m_cornerRadiusCtrl
 
wxStaticText * m_cornerRadiusUnits
 
wxPanel * m_chamferProps
 
wxStaticText * m_chamferRatioLabel
 
TEXT_CTRL_EVALm_chamferRatioCtrl
 
wxStaticText * m_chamferRatioUnits
 
wxStaticText * m_staticTextChamferCorner
 
wxCheckBox * m_cbTopLeft
 
wxCheckBox * m_cbTopRight
 
wxCheckBox * m_cbBottomLeft
 
wxCheckBox * m_cbBottomRight
 
wxPanel * m_mixedProps
 
wxStaticText * m_mixedChamferRatioLabel
 
TEXT_CTRL_EVALm_mixedChamferRatioCtrl
 
wxStaticText * m_mixedChamferRatioUnits
 
wxStaticText * m_staticTextChamferCorner1
 
wxCheckBox * m_cbTopLeft1
 
wxCheckBox * m_cbTopRight1
 
wxCheckBox * m_cbBottomLeft1
 
wxCheckBox * m_cbBottomRight1
 
wxStaticText * m_mixedCornerRatioLabel
 
TEXT_CTRL_EVALm_mixedCornerRatioCtrl
 
wxStaticText * m_mixedCornerRatioUnits
 
wxStaticText * m_sizeXLabel
 
wxTextCtrl * m_sizeXCtrl
 
wxStaticText * m_sizeXUnits
 
wxStaticText * m_sizeYLabel
 
wxTextCtrl * m_sizeYCtrl
 
wxStaticText * m_sizeYUnits
 
wxStaticText * m_PadOrientText
 
wxComboBox * m_cb_padrotation
 
wxStaticText * m_orientationUnits
 
wxStaticLine * m_staticline6
 
wxGridBagSizer * m_gbSizerHole
 
wxStaticText * m_holeShapeLabel
 
wxChoice * m_holeShapeCtrl
 
wxStaticText * m_holeXLabel
 
wxTextCtrl * m_holeXCtrl
 
wxStaticText * m_holeXUnits
 
wxStaticText * m_holeYLabel
 
wxTextCtrl * m_holeYCtrl
 
wxStaticText * m_holeYUnits
 
wxStaticLine * m_staticline7
 
wxCheckBox * m_offsetShapeOpt
 
wxStaticText * m_offsetShapeOptLabel
 
wxFlexGridSizer * m_offsetCtrls
 
wxStaticText * m_offsetXLabel
 
wxTextCtrl * m_offsetXCtrl
 
wxStaticText * m_offsetXUnits
 
wxStaticText * m_offsetYLabel
 
wxTextCtrl * m_offsetYCtrl
 
wxStaticText * m_offsetYUnits
 
wxStaticLine * m_staticline71
 
wxCheckBox * m_padToDieOpt
 
wxStaticText * m_padToDieLabel
 
wxTextCtrl * m_padToDieCtrl
 
wxStaticText * m_padToDieUnits
 
wxBoxSizer * m_middleBoxSizer
 
wxBoxSizer * m_FlippedWarningSizer
 
wxStaticBitmap * m_FlippedWarningIcon
 
wxStaticText * m_staticText86
 
wxStaticText * m_copperLayersLabel
 
wxChoice * m_rbCopperLayersSel
 
wxStaticText * m_techLayersLabel
 
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_staticTextFabProperty
 
wxChoice * m_choiceFabProperty
 
wxPanel * m_localSettingsPanel
 
wxStaticText * m_staticTextInfoPosValue
 
wxStaticText * m_staticTextInfoNegVal
 
wxStaticText * m_clearanceLabel
 
wxTextCtrl * m_clearanceCtrl
 
wxStaticText * m_clearanceUnits
 
wxStaticText * m_maskMarginLabel
 
wxTextCtrl * m_maskMarginCtrl
 
wxStaticText * m_maskMarginUnits
 
wxStaticText * m_pasteMarginLabel
 
wxTextCtrl * m_pasteMarginCtrl
 
wxStaticText * m_pasteMarginUnits
 
wxStaticText * m_pasteMarginRatioLabel
 
TEXT_CTRL_EVALm_pasteMarginRatioCtrl
 
wxStaticText * m_pasteMarginRatioUnits
 
wxSimplebook * m_nonCopperWarningBook
 
wxStaticText * m_nonCopperNote
 
wxStaticText * m_staticTextInfoPaste
 
wxStaticBitmap * m_nonCopperWarningIcon
 
wxStaticText * m_nonCopperWarningText
 
wxStaticBoxSizer * m_sbSizerZonesSettings
 
wxStaticText * m_staticText40
 
wxChoice * m_ZoneConnectionChoice
 
wxStaticText * m_staticTextcps
 
wxChoice * m_ZoneCustomPadShape
 
wxStaticText * m_thermalGapLabel
 
wxTextCtrl * m_thermalGapCtrl
 
wxStaticText * m_thermalGapUnits
 
wxStaticText * m_spokeWidthLabel
 
wxTextCtrl * m_spokeWidthCtrl
 
wxStaticText * m_spokeWidthUnits
 
wxStaticText * m_spokeAngleLabel
 
wxTextCtrl * m_spokeAngleCtrl
 
wxStaticText * m_spokeAngleUnits
 
wxPanel * m_panelCustomShapePrimitives
 
wxBoxSizer * m_bSizerPanelPrimitives
 
wxStaticText * m_staticTextPrimitivesList
 
wxStaticText * m_staticTextPrimitiveListWarning
 
wxListView * m_listCtrlPrimitives
 
wxButton * m_buttonAddShape
 
wxButton * m_buttonEditShape
 
wxButton * m_buttonDup
 
wxButton * m_buttonGeometry
 
wxButton * m_buttonDel
 
wxSimplebook * m_stackupImagesBook
 
wxPanel * page0
 
wxStaticBitmap * m_stackupImage0
 
wxPanel * page1
 
wxStaticBitmap * m_stackupImage1
 
wxPanel * page2
 
wxStaticBitmap * m_stackupImage2
 
wxPanel * page3
 
wxPanel * page4
 
wxStaticBitmap * m_stackupImage4
 
wxPanel * page5
 
wxStaticBitmap * m_stackupImage5
 
wxPanel * page6
 
wxStaticBitmap * m_stackupImage6
 
wxPanel * page7
 
wxStaticBitmap * m_stackupImage7
 
wxPanel * m_boardViewPanel
 
wxBoxSizer * m_padPreviewSizer
 
wxStaticText * m_parentInfo
 
wxCheckBox * m_cbShowPadOutline
 
wxStdDialogButtonSizer * m_sdbSizer
 
wxButton * m_sdbSizerOK
 
wxButton * m_sdbSizerCancel
 
EDA_UNITS m_units
 
std::string m_hash_key
 
bool m_useCalculatedSize
 
bool m_firstPaintEvent
 
wxWindow * m_initialFocusTarget
 
WX_EVENT_LOOPm_qmodal_loop
 
bool m_qmodal_showing
 
WDO_ENABLE_DISABLEm_qmodal_parent_disabler
 
EDA_BASE_FRAMEm_parentFrame
 
std::vector< wxWindow * > m_tabOrder
 
wxSize m_initialSize
 

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 updatePadLayersList (LSET layer_mask, bool remove_unconnected, bool keep_top_bottom)
 Updates the CheckBox states in pad layers list, based on the layer_mask (if non-empty) or the default layers for the current pad type. More...
 
bool transferDataToPad (PAD *aPad)
 Copy values from dialog field to aPad's members. More...
 
bool Show (bool aShow) override
 
void OnInitDialog (wxInitDialogEvent &event) override
 
void OnResize (wxSizeEvent &event)
 
void OnCancel (wxCommandEvent &event) override
 
void OnUpdateUI (wxUpdateUIEvent &event) override
 
void OnUpdateUINonCopperWarning (wxUpdateUIEvent &event) override
 
void OnPadShapeSelection (wxCommandEvent &event) override
 
void OnDrillShapeSelected (wxCommandEvent &event) override
 
void onChangePadMode (wxCommandEvent &event) override
 
void OnOffsetCheckbox (wxCommandEvent &event) override
 
void OnPadToDieCheckbox (wxCommandEvent &event) override
 
void PadOrientEvent (wxCommandEvent &event) override
 
void PadTypeSelected (wxCommandEvent &event) override
 
void UpdateLayersDropdown ()
 
void OnSetCopperLayers (wxCommandEvent &event) override
 
void OnSetLayers (wxCommandEvent &event) override
 
void onCornerSizePercentChange (wxCommandEvent &event) override
 
void onCornerRadiusChange (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 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...
 
PAD_PROP getSelectedProperty ()
 Return the pad property currently selected. More...
 
void updateHoleControls ()
 
void updatePadSizeControls ()
 
void OnCloseWindow (wxCloseEvent &aEvent)
 Properly handle the wxCloseEvent when in the quasimodal mode when not calling EndQuasiModal which is possible with any dialog derived from DIALOG_SHIM. More...
 
void OnButton (wxCommandEvent &aEvent)
 Properly handle the default button events when in the quasimodal mode when not calling EndQuasiModal which is possible with any dialog derived from DIALOG_SHIM. More...
 
void OnGridEditorShown (wxGridEvent &event)
 
void OnGridEditorHidden (wxGridEvent &event)
 
 DECLARE_EVENT_TABLE ()
 

Private Attributes

PCB_BASE_FRAMEm_parent
 
PADm_currentPad
 
PADm_dummyPad
 
PADm_padMaster
 
BOARDm_board
 
bool m_isFlipped
 
bool m_canUpdate
 
bool m_canEditNetName
 
bool m_isFpEditor
 
std::vector< std::shared_ptr< PCB_SHAPE > > m_primitives
 
COLOR4D m_selectedColor
 
std::vector< PCB_SHAPE * > m_highlight
 
PCB_DRAW_PANEL_GALm_padPreviewGAL
 
KIGFX::ORIGIN_VIEWITEMm_axisOrigin
 
UNIT_BINDER m_posX
 
UNIT_BINDER m_posY
 
UNIT_BINDER m_sizeX
 
UNIT_BINDER m_sizeY
 
UNIT_BINDER m_offsetX
 
UNIT_BINDER m_offsetY
 
UNIT_BINDER m_padToDie
 
UNIT_BINDER m_trapDelta
 
UNIT_BINDER m_cornerRadius
 
UNIT_BINDER m_cornerRatio
 
UNIT_BINDER m_chamferRatio
 
UNIT_BINDER m_mixedCornerRatio
 
UNIT_BINDER m_mixedChamferRatio
 
UNIT_BINDER m_holeX
 
UNIT_BINDER m_holeY
 
UNIT_BINDER m_clearance
 
UNIT_BINDER m_maskMargin
 
UNIT_BINDER m_pasteMargin
 
UNIT_BINDER m_pasteMarginRatio
 
UNIT_BINDER m_thermalGap
 
UNIT_BINDER m_spokeWidth
 
UNIT_BINDER m_spokeAngle
 
UNIT_BINDER m_pad_orientation
 
KIWAYm_kiway
 
HOLDER_TYPE m_type
 

Static Private Attributes

static bool m_sketchPreview = false
 

Detailed Description

Definition at line 49 of file dialog_pad_properties.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
wxID_DIALOG_EDIT_PAD 
wxID_PADNUMCTRL 

Definition at line 53 of file dialog_pad_properties_base.h.

◆ HOLDER_TYPE

enum KIWAY_HOLDER::HOLDER_TYPE
inherited
Enumerator
DIALOG 
FRAME 
PANEL 

Definition at line 39 of file kiway_holder.h.

Constructor & Destructor Documentation

◆ DIALOG_PAD_PROPERTIES()

DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES ( PCB_BASE_FRAME aParent,
PAD aPad 
)

Definition at line 113 of file dialog_pad_properties.cpp.

113 :
115 m_parent( aParent ),
116 m_canUpdate( false ),
143{
144 SetName( PAD_PROPERTIES_DLG_NAME );
145 m_isFpEditor = dynamic_cast<FOOTPRINT_EDIT_FRAME*>( aParent ) != nullptr;
146
147 m_currentPad = aPad; // aPad can be NULL, if the dialog is called
148 // from the footprint editor to set default pad setup
149
151
152 // Configure display origin transforms
155
158
160
163
165 m_dummyPad = new PAD( (FOOTPRINT*) nullptr );
166
167 if( aPad )
168 {
169 SetTitle( _( "Pad Properties" ) );
170
171 *m_dummyPad = *aPad;
173 }
174 else
175 {
176 SetTitle( _( "Default Pad Properties for Add Pad Tool" ) );
177
179 }
180
181 if( m_isFpEditor )
182 {
183 m_padNetLabel->Show( false );
184 m_padNetSelector->Show( false );
185 }
186
187 // Pad needs to have a parent for painting; use the parent board for its design settings
188 if( !m_dummyPad->GetParent() )
190
197
200
202
205
206 initValues();
207
208 wxFont infoFont = KIUI::GetInfoFont( this );
209 m_copperLayersLabel->SetFont( infoFont );
210 m_techLayersLabel->SetFont( infoFont );
211 m_parentInfo->SetFont( infoFont );
212
213 infoFont.SetStyle( wxFONTSTYLE_ITALIC );
214 m_nonCopperNote->SetFont( infoFont );
215 m_staticTextInfoPaste->SetFont( infoFont );
216 m_staticTextPrimitiveListWarning->SetFont( infoFont );
217
220
221 // Usually, TransferDataToWindow is called by OnInitDialog
222 // calling it here fixes all widget sizes so FinishDialogSettings can safely fix minsizes
224
225 // Initialize canvas to be able to display the dummy pad:
227
230 m_canUpdate = true;
231
232 m_padNetSelector->Connect( NET_SELECTED,
233 wxCommandEventHandler( DIALOG_PAD_PROPERTIES::OnValuesChanged ),
234 nullptr, this );
235
236 if( m_padType->GetSelection() != PTH_DLG_TYPE && m_padType->GetSelection() != NPTH_DLG_TYPE )
237 {
238 m_gbSizerHole->Show( false );
239 m_staticline6->Show( false );
240 }
241
242 // Now all widgets have the size fixed, call FinishDialogSettings
244
245 // Update widgets
246 wxUpdateUIEvent dummyUI;
247 OnUpdateUI( dummyUI );
248
249 // Post a dummy size event to force the pad preview panel to update the
250 // view: actual size, best zoom ... after the frame is shown
251 PostSizeEvent();
252}
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:105
@ dialog_warning
std::unique_ptr< PAD > m_Pad_Master
const NETINFO_LIST & GetNetInfo() const
Definition: board.h:765
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(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void OnValuesChanged(wxCommandEvent &event) override
Called when a dimension has changed.
void OnUpdateUI(wxUpdateUIEvent &event) override
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:97
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:141
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:100
void SetBoard(BOARD *aBoard)
void SetNetInfo(NETINFO_LIST *aNetInfoList)
FOOTPRINT * GetParent() const
Definition: pad.cpp:1486
BOARD * GetBoard() const
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
virtual void SetPrecision(int aLength)
Normally not needed, but can be used to set the precision when using internal units that are floats (...
virtual void SetUnits(EDA_UNITS aUnits)
Normally not needed (as the UNIT_BINDER inherits from the parent frame), but can be used to set to DE...
virtual void SetNegativeZero()
Definition: unit_binder.h:71
void SetCoordType(ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
Set the current origin transform mode.
Definition: unit_binder.h:187
#define NPTH_DLG_TYPE
#define PTH_DLG_TYPE
#define PAD_PROPERTIES_DLG_NAME
DIALOG_PAD_PROPERTIES, derived from DIALOG_PAD_PROPERTIES_BASE, created by wxFormBuilder.
#define _(s)
#define BRIGHTENED
item is drawn with a bright contour
#define SELECTED
Item was manually selected by the user.
wxFont GetInfoFont(wxWindow *aWindow)
Definition: ui_common.cpp:156

References _, ORIGIN_TRANSFORMS::ABS_X_COORD, ORIGIN_TRANSFORMS::ABS_Y_COORD, BRIGHTENED, EDA_ITEM::ClearFlags(), DEGREES, dialog_warning, DIALOG_SHIM::finishDialogSettings(), PCB_BASE_FRAME::GetBoard(), PCB_BASE_FRAME::GetDesignSettings(), KIUI::GetInfoFont(), BOARD::GetNetInfo(), PAD::GetParent(), initValues(), KiBitmap(), m_board, m_canUpdate, DIALOG_PAD_PROPERTIES_BASE::m_cbShowPadOutline, m_chamferRatio, DIALOG_PAD_PROPERTIES_BASE::m_copperLayersLabel, m_cornerRatio, m_currentPad, m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_FlippedWarningIcon, DIALOG_PAD_PROPERTIES_BASE::m_gbSizerHole, m_isFpEditor, m_mixedChamferRatio, m_mixedCornerRatio, DIALOG_PAD_PROPERTIES_BASE::m_nonCopperNote, DIALOG_PAD_PROPERTIES_BASE::m_nonCopperWarningIcon, BOARD_DESIGN_SETTINGS::m_Pad_Master, m_pad_orientation, m_padMaster, DIALOG_PAD_PROPERTIES_BASE::m_padNetLabel, DIALOG_PAD_PROPERTIES_BASE::m_padNetSelector, DIALOG_PAD_PROPERTIES_BASE::m_padNumCtrl, DIALOG_PAD_PROPERTIES_BASE::m_padType, m_parent, DIALOG_PAD_PROPERTIES_BASE::m_parentInfo, m_pasteMargin, m_pasteMarginRatio, m_posX, m_posY, m_sketchPreview, m_spokeAngle, DIALOG_PAD_PROPERTIES_BASE::m_staticline6, DIALOG_PAD_PROPERTIES_BASE::m_staticTextInfoPaste, DIALOG_PAD_PROPERTIES_BASE::m_staticTextPrimitiveListWarning, DIALOG_PAD_PROPERTIES_BASE::m_techLayersLabel, NPTH_DLG_TYPE, OnUpdateUI(), OnValuesChanged(), PAD, PAD_PROPERTIES_DLG_NAME, PERCENT, prepareCanvas(), PTH_DLG_TYPE, SELECTED, NET_SELECTOR::SetBoard(), UNIT_BINDER::SetCoordType(), DIALOG_SHIM::SetInitialFocus(), UNIT_BINDER::SetNegativeZero(), NET_SELECTOR::SetNetInfo(), EDA_ITEM::SetParent(), UNIT_BINDER::SetPrecision(), UNIT_BINDER::SetUnits(), DIALOG_SHIM::SetupStandardButtons(), TransferDataToWindow(), updateHoleControls(), and updatePadSizeControls().

◆ ~DIALOG_PAD_PROPERTIES()

DIALOG_PAD_PROPERTIES::~DIALOG_PAD_PROPERTIES ( )

Definition at line 255 of file dialog_pad_properties.cpp.

256{
257 m_padNetSelector->Disconnect( NET_SELECTED,
258 wxCommandEventHandler( DIALOG_PAD_PROPERTIES::OnValuesChanged ),
259 nullptr, this );
260
261 delete m_dummyPad;
262 delete m_axisOrigin;
263}
KIGFX::ORIGIN_VIEWITEM * m_axisOrigin

References m_axisOrigin, m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_padNetSelector, and OnValuesChanged().

Member Function Documentation

◆ DECLARE_EVENT_TABLE()

DIALOG_SHIM::DECLARE_EVENT_TABLE ( )
privateinherited

◆ displayPrimitivesList()

void DIALOG_PAD_PROPERTIES::displayPrimitivesList ( )
private

Definition at line 679 of file dialog_pad_properties.cpp.

680{
681 m_listCtrlPrimitives->ClearAll();
682
683 wxListItem itemCol;
684 itemCol.SetImage(-1);
685
686 for( int ii = 0; ii < 5; ++ii )
687 m_listCtrlPrimitives->InsertColumn(ii, itemCol);
688
689 wxString bs_info[5];
690
691 for( unsigned ii = 0; ii < m_primitives.size(); ++ii )
692 {
693 const std::shared_ptr<PCB_SHAPE>& primitive = m_primitives[ii];
694
695 for( wxString& s : bs_info )
696 s.Empty();
697
698 bs_info[4] = _( "width" ) + wxS( " " )+ EDA_UNIT_UTILS::UI::MessageTextFromValue( pcbIUScale, m_units,
699 primitive->GetWidth() );
700
701 switch( primitive->GetShape() )
702 {
703 case SHAPE_T::SEGMENT:
704 bs_info[0] = _( "Segment" );
705 bs_info[1] = _( "from" ) + wxS( " " ) + formatCoord( m_units, primitive->GetStart() );
706 bs_info[2] = _( "to" ) + wxS( " " ) + formatCoord( m_units, primitive->GetEnd() );
707 break;
708
709 case SHAPE_T::BEZIER:
710 bs_info[0] = _( "Bezier" );
711 bs_info[1] = _( "from" ) + wxS( " " ) + formatCoord( m_units, primitive->GetStart() );
712 bs_info[2] = _( "to" ) + wxS( " " ) + formatCoord( m_units, primitive->GetEnd() );
713 break;
714
715 case SHAPE_T::ARC:
716 bs_info[0] = _( "Arc" );
717 bs_info[1] = _( "center" ) + wxS( " " ) + formatCoord( m_units, primitive->GetCenter() );
718 bs_info[2] = _( "start" ) + wxS( " " ) + formatCoord( m_units, primitive->GetStart() );
719 bs_info[3] = _( "angle" ) + wxS( " " ) + EDA_UNIT_UTILS::FormatAngle( primitive->GetArcAngle() );
720 break;
721
722 case SHAPE_T::CIRCLE:
723 if( primitive->GetWidth() )
724 bs_info[0] = _( "Ring" );
725 else
726 bs_info[0] = _( "Circle" );
727
728 bs_info[1] = _( "at" ) + wxS( " " ) + formatCoord( m_units, primitive->GetStart() );
729 bs_info[2] = _( "radius" ) + wxS( " " ) + EDA_UNIT_UTILS::UI::MessageTextFromValue( pcbIUScale, m_units,
730 primitive->GetRadius() );
731 break;
732
733 case SHAPE_T::POLY:
734 bs_info[0] = _( "Polygon" );
735 bs_info[1] = wxString::Format( _( "corners count %d" ),
736 primitive->GetPolyShape().Outline( 0 ).PointCount() );
737 break;
738
739 case SHAPE_T::RECT:
740 if( primitive->IsAnnotationProxy() )
741 bs_info[0] = _( "Number box" );
742 else
743 bs_info[0] = _( "Rectangle" );
744
745 bs_info[1] = _( "from" ) + wxS( " " ) + formatCoord( m_units, primitive->GetStart() );
746 bs_info[2] = _( "to" ) + wxS( " " ) + formatCoord( m_units, primitive->GetEnd() );
747 break;
748
749 default:
750 bs_info[0] = _( "Unknown primitive" );
751 break;
752 }
753
754 long tmp = m_listCtrlPrimitives->InsertItem( ii, bs_info[0] );
755 m_listCtrlPrimitives->SetItemData( tmp, ii );
756
757 for( int jj = 0, col = 0; jj < 5; ++jj )
758 m_listCtrlPrimitives->SetItem( tmp, col++, bs_info[jj] );
759 }
760
761 // Now columns are filled, ensure correct width of columns
762 for( unsigned ii = 0; ii < 5; ++ii )
763 m_listCtrlPrimitives->SetColumnWidth( ii, wxLIST_AUTOSIZE );
764}
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
std::vector< std::shared_ptr< PCB_SHAPE > > m_primitives
EDA_UNITS m_units
Definition: dialog_shim.h:202
static wxString formatCoord(EDA_UNITS aUnits, VECTOR2I aCoord)
wxString MessageTextFromValue(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, double aValue, bool aAddUnitsText=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A helper to convert the double length aValue to a string in inches, millimeters, or unscaled units.
Definition: eda_units.cpp:326
std::string FormatAngle(const EDA_ANGLE &aAngle)
Converts aAngle from board units to a string appropriate for writing to file.
Definition: eda_units.cpp:131
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200

References _, ARC, BEZIER, CIRCLE, Format(), EDA_UNIT_UTILS::FormatAngle(), formatCoord(), DIALOG_PAD_PROPERTIES_BASE::m_listCtrlPrimitives, m_primitives, DIALOG_SHIM::m_units, EDA_UNIT_UTILS::UI::MessageTextFromValue(), pcbIUScale, POLY, RECT, and SEGMENT.

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

◆ editPrimitive()

void DIALOG_PAD_PROPERTIES::editPrimitive ( )
private

Definition at line 2074 of file dialog_pad_properties.cpp.

2075{
2076 long select = m_listCtrlPrimitives->GetFirstSelected();
2077
2078 if( select < 0 )
2079 {
2080 wxMessageBox( _( "No shape selected" ) );
2081 return;
2082 }
2083
2084 std::shared_ptr<PCB_SHAPE>& shape = m_primitives[select];
2085
2086 if( shape->GetShape() == SHAPE_T::POLY )
2087 {
2088 DIALOG_PAD_PRIMITIVE_POLY_PROPS dlg( this, m_parent, shape.get() );
2089
2090 if( dlg.ShowModal() != wxID_OK )
2091 return;
2092
2093 dlg.TransferDataFromWindow();
2094 }
2095
2096 else
2097 {
2098 DIALOG_PAD_PRIMITIVES_PROPERTIES dlg( this, m_parent, shape.get() );
2099
2100 if( dlg.ShowModal() != wxID_OK )
2101 return;
2102
2103 dlg.TransferDataFromWindow();
2104 }
2105
2107
2109 redraw();
2110}
A dialog to edit basic shape parameters.
A dialog to edit basic polygonal shape parameters.
bool transferDataToPad(PAD *aPad)
Copy values from dialog field to aPad's members.

References _, displayPrimitivesList(), m_canUpdate, m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_listCtrlPrimitives, m_parent, m_primitives, POLY, redraw(), DIALOG_PAD_PRIMITIVES_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::TransferDataFromWindow(), and transferDataToPad().

Referenced by onEditPrimitive(), and onPrimitiveDClick().

◆ Enable()

bool DIALOG_SHIM::Enable ( bool  enable)
overrideinherited

Definition at line 318 of file dialog_shim.cpp.

319{
320 // so we can do logging of this state change:
321 return wxDialog::Enable( enable );
322}

◆ enablePrimitivePage()

void DIALOG_PAD_PROPERTIES::enablePrimitivePage ( bool  aEnable)
private

enable (or disable) the primitive page editor

Definition at line 291 of file dialog_pad_properties.cpp.

292{
293 // Enable or disable the widgets in page managing custom shape primitives
294 m_listCtrlPrimitives->Enable( aEnable );
295 m_buttonDel->Enable( aEnable );
296 m_buttonEditShape->Enable( aEnable );
297 m_buttonAddShape->Enable( aEnable );
298 m_buttonDup->Enable( aEnable );
299 m_buttonGeometry->Enable( aEnable );
300}

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, and DIALOG_PAD_PROPERTIES_BASE::m_listCtrlPrimitives.

Referenced by initValues(), and OnPadShapeSelection().

◆ EndQuasiModal()

void DIALOG_SHIM::EndQuasiModal ( int  retCode)
inherited

Definition at line 486 of file dialog_shim.cpp.

487{
488 // Hook up validator and transfer data from controls handling so quasi-modal dialogs
489 // handle validation in the same way as other dialogs.
490 if( ( retCode == wxID_OK ) && ( !Validate() || !TransferDataFromWindow() ) )
491 return;
492
493 SetReturnCode( retCode );
494
495 if( !IsQuasiModal() )
496 {
497 wxFAIL_MSG( wxT( "Either DIALOG_SHIM::EndQuasiModal was called twice, or ShowQuasiModal"
498 "wasn't called" ) );
499 return;
500 }
501
502 if( m_qmodal_loop )
503 {
504 if( m_qmodal_loop->IsRunning() )
505 m_qmodal_loop->Exit( 0 );
506 else
507 m_qmodal_loop->ScheduleExit( 0 );
508
509 m_qmodal_loop = nullptr;
510 }
511
513 m_qmodal_parent_disabler = nullptr;
514
515 Show( false );
516}
bool Show(bool show) override
bool IsQuasiModal() const
Definition: dialog_shim.h:106
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:218
WX_EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:215

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

Referenced by EDA_3D_CONTROLLER::Main(), DIALOG_EXPORT_NETLIST::OnAddGenerator(), DIALOG_SHIM::OnButton(), DIALOG_EDIT_SYMBOLS_LIBID::onCancel(), DIALOG_LIB_SYMBOL_PROPERTIES::OnCancelButtonClick(), DIALOG_SYMBOL_PROPERTIES::OnCancelButtonClick(), DIALOG_LIB_EDIT_PIN_TABLE::OnClose(), DIALOG_CHOOSE_FOOTPRINT::OnCloseTimer(), DIALOG_SHIM::OnCloseWindow(), DIALOG_EXPORT_NETLIST::OnDelGenerator(), DIALOG_SYMBOL_PROPERTIES::OnEditLibrarySymbol(), DIALOG_SYMBOL_PROPERTIES::OnEditSymbol(), DIALOG_SYMBOL_PROPERTIES::OnExchangeSymbol(), PCB_ONE_LAYER_SELECTOR::OnLeftGridCellClick(), PCB_ONE_LAYER_SELECTOR::OnRightGridCellClick(), DIALOG_SYMBOL_PROPERTIES::OnUpdateSymbol(), DIALOG_CHOOSE_FOOTPRINT::OnUseBrowser(), DIALOG_PUSH_PAD_PROPERTIES::PadPropertiesAccept(), and DIALOG_SHIM::~DIALOG_SHIM().

◆ finishDialogSettings()

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 after all widgets have been initialized, and therefore their size fixed. If TransferDataToWindow() is used to initialize widgets, at the end of TransferDataToWindow, or better yet, at end of a wxInitDialogEvent handler.

Definition at line 157 of file dialog_shim.cpp.

158{
159 // must be called from the constructor of derived classes,
160 // when all widgets are initialized, and therefore their size fixed
161
162 // SetSizeHints fixes the minimal size of sizers in the dialog
163 // (SetSizeHints calls Fit(), so no need to call it)
164 GetSizer()->SetSizeHints( this );
165}

Referenced by CONVERT_SETTINGS_DIALOG::CONVERT_SETTINGS_DIALOG(), DIALOG_ANNOTATE::DIALOG_ANNOTATE(), DIALOG_ASSIGN_NETCLASS::DIALOG_ASSIGN_NETCLASS(), DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE(), DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP(), DIALOG_BOM::DIALOG_BOM(), DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS(), DIALOG_CLEANUP_TRACKS_AND_VIAS::DIALOG_CLEANUP_TRACKS_AND_VIAS(), DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_DRC::DIALOG_DRC(), DIALOG_EDIT_SYMBOLS_LIBID::DIALOG_EDIT_SYMBOLS_LIBID(), DIALOG_ENUM_PADS::DIALOG_ENUM_PADS(), DIALOG_ERC::DIALOG_ERC(), DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS(), DIALOG_EXPORT_3DFILE::DIALOG_EXPORT_3DFILE(), DIALOG_EXPORT_IDF3::DIALOG_EXPORT_IDF3(), DIALOG_EXPORT_NETLIST::DIALOG_EXPORT_NETLIST(), DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP(), DIALOG_EXPORT_SVG::DIALOG_EXPORT_SVG(), DIALOG_FOOTPRINT_CHECKER::DIALOG_FOOTPRINT_CHECKER(), DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(), DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST(), DIALOG_GENCAD_EXPORT_OPTIONS::DIALOG_GENCAD_EXPORT_OPTIONS(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS(), DIALOG_GLOBAL_LIB_TABLE_CONFIG::DIALOG_GLOBAL_LIB_TABLE_CONFIG(), DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS(), DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES(), DIALOG_IBIS_PARSER_REPORTER::DIALOG_IBIS_PARSER_REPORTER(), DIALOG_IMAGE_PROPERTIES::DIALOG_IMAGE_PROPERTIES(), DIALOG_IMPORT_NETLIST::DIALOG_IMPORT_NETLIST(), DIALOG_IMPORTED_LAYERS::DIALOG_IMPORTED_LAYERS(), DIALOG_INSPECTOR::DIALOG_INSPECTOR(), DIALOG_JUNCTION_PROPS::DIALOG_JUNCTION_PROPS(), DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES(), DIALOG_LIB_NEW_SYMBOL::DIALOG_LIB_NEW_SYMBOL(), DIALOG_LIB_SHAPE_PROPERTIES::DIALOG_LIB_SHAPE_PROPERTIES(), DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES(), DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES(), DIALOG_LIB_TEXTBOX_PROPERTIES::DIALOG_LIB_TEXTBOX_PROPERTIES(), DIALOG_LINE_PROPERTIES::DIALOG_LINE_PROPERTIES(), DIALOG_LIST_HOTKEYS::DIALOG_LIST_HOTKEYS(), DIALOG_LOCKED_ITEMS_QUERY::DIALOG_LOCKED_ITEMS_QUERY(), DIALOG_MANAGE_REPOSITORIES::DIALOG_MANAGE_REPOSITORIES(), DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT(), DIALOG_NET_INSPECTOR::DIALOG_NET_INSPECTOR(), DIALOG_NON_COPPER_ZONES_EDITOR::DIALOG_NON_COPPER_ZONES_EDITOR(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::DIALOG_PAD_PRIMITIVE_POLY_PROPS(), DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PROPERTIES(), DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL(), DIALOG_PCM::DIALOG_PCM(), DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES(), DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC(), DIALOG_PNS_SETTINGS::DIALOG_PNS_SETTINGS(), DIALOG_POSITION_RELATIVE::DIALOG_POSITION_RELATIVE(), DIALOG_PRINT_GENERIC::DIALOG_PRINT_GENERIC(), DIALOG_PRINT_PCBNEW::DIALOG_PRINT_PCBNEW(), DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER(), DIALOG_PUSH_PAD_PROPERTIES::DIALOG_PUSH_PAD_PROPERTIES(), DIALOG_REGULATOR_FORM::DIALOG_REGULATOR_FORM(), DIALOG_RULE_AREA_PROPERTIES::DIALOG_RULE_AREA_PROPERTIES(), DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP(), DIALOG_SELECT_3DMODEL::DIALOG_SELECT_3DMODEL(), DIALOG_SHAPE_PROPERTIES::DIALOG_SHAPE_PROPERTIES(), DIALOG_SHEET_PIN_PROPERTIES::DIALOG_SHEET_PIN_PROPERTIES(), DIALOG_SIM_MODEL< T_symbol, T_field >::DIALOG_SIM_MODEL(), DIALOG_SWAP_LAYERS::DIALOG_SWAP_LAYERS(), DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE(), DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES(), DIALOG_TARGET_PROPERTIES::DIALOG_TARGET_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TEXTBOX_PROPERTIES::DIALOG_TEXTBOX_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), DIALOG_TRACK_VIA_SIZE::DIALOG_TRACK_VIA_SIZE(), DIALOG_UNUSED_PAD_LAYERS::DIALOG_UNUSED_PAD_LAYERS(), DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB(), DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB(), DIALOG_UPDATE_SYMBOL_FIELDS::DIALOG_UPDATE_SYMBOL_FIELDS(), DIALOG_WIRE_BUS_PROPERTIES::DIALOG_WIRE_BUS_PROPERTIES(), PAGED_DIALOG::finishInitialization(), DIALOG_CONSTRAINTS_REPORTER::FinishInitialization(), DIALOG_FIELD_PROPERTIES::init(), DIALOG_EDIT_LIBRARY_TABLES::InstallPanel(), NETLIST_VIEW_DIALOG::NETLIST_VIEW_DIALOG(), DIALOG_SHEET_PROPERTIES::OnInitDlg(), DIALOG_SIM_COMMAND::onInitDlg(), DIALOG_SYMBOL_PROPERTIES::OnInitDlg(), DIALOG_GRAPHIC_ITEM_PROPERTIES::OnInitDlg(), TEARDROP_DIALOG::TEARDROP_DIALOG(), DIALOG_SIGNAL_LIST::TransferDataToWindow(), DIALOG_COLOR_PICKER::TransferDataToWindow(), and DIALOG_BOARD_STATISTICS::TransferDataToWindow().

◆ getSelectedProperty()

PAD_PROP DIALOG_PAD_PROPERTIES::getSelectedProperty ( )
private

Return the pad property currently selected.

Definition at line 1675 of file dialog_pad_properties.cpp.

1676{
1677 PAD_PROP prop = PAD_PROP::NONE;
1678
1679 switch( m_choiceFabProperty->GetSelection() )
1680 {
1681 case 0: prop = PAD_PROP::NONE; break;
1682 case 1: prop = PAD_PROP::BGA; break;
1683 case 2: prop = PAD_PROP::FIDUCIAL_LOCAL; break;
1684 case 3: prop = PAD_PROP::FIDUCIAL_GLBL; break;
1685 case 4: prop = PAD_PROP::TESTPOINT; break;
1686 case 5: prop = PAD_PROP::HEATSINK; break;
1687 case 6: prop = PAD_PROP::CASTELLATED; break;
1688 }
1689
1690 return prop;
1691}
PAD_PROP
The set of pad properties used in Gerber files (Draw files, and P&P files) to define some properties ...
Definition: pad_shapes.h:97
@ FIDUCIAL_LOCAL
a fiducial (usually a smd) local to the parent footprint
@ FIDUCIAL_GLBL
a fiducial (usually a smd) for the full board
@ HEATSINK
a pad used as heat sink, usually in SMD footprints
@ NONE
no special fabrication property
@ TESTPOINT
a test point pad
@ CASTELLATED
a pad with a castellated through hole
@ BGA
Smd pad, used in BGA footprints.

References BGA, CASTELLATED, FIDUCIAL_GLBL, FIDUCIAL_LOCAL, HEATSINK, DIALOG_PAD_PROPERTIES_BASE::m_choiceFabProperty, NONE, and TESTPOINT.

Referenced by TransferDataFromWindow(), and transferDataToPad().

◆ GetType()

HOLDER_TYPE KIWAY_HOLDER::GetType ( ) const
inlineinherited

Definition at line 46 of file kiway_holder.h.

46{ return m_type; }
HOLDER_TYPE m_type
Definition: kiway_holder.h:85

References KIWAY_HOLDER::m_type.

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ GetUserUnits()

◆ HasKiway()

bool KIWAY_HOLDER::HasKiway ( ) const
inlineinherited

Safety check before asking for the Kiway reference.

Returns
true if kiway is non-null

Definition at line 63 of file kiway_holder.h.

64 {
65 return m_kiway != nullptr;
66 }
KIWAY * m_kiway
Definition: kiway_holder.h:84

References KIWAY_HOLDER::m_kiway.

Referenced by DIALOG_SHIM::~DIALOG_SHIM().

◆ horizPixelsFromDU()

int DIALOG_SHIM::horizPixelsFromDU ( int  x) const
protectedinherited

Convert an integer number of dialog units to pixels, horizontally.

See SetSizeInDU or wxDialog documentation for more information.

Definition at line 175 of file dialog_shim.cpp.

176{
177 wxSize sz( x, 0 );
178 return ConvertDialogToPixels( sz ).x;
179}

Referenced by DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), and DIALOG_CHOOSE_SYMBOL::DIALOG_CHOOSE_SYMBOL().

◆ initValues()

void DIALOG_PAD_PROPERTIES::initValues ( )
private

Definition at line 462 of file dialog_pad_properties.cpp.

463{
464 wxString msg;
465
466 // Disable pad net name wxTextCtrl if the caller is the footprint editor
467 // because nets are living only in the board managed by the board editor
469
481
482 if( m_currentPad )
483 {
485
486 FOOTPRINT* footprint = m_currentPad->GetParent();
487
488 if( footprint )
489 {
492
493 // Display parent footprint info
494 msg.Printf( _("Footprint %s (%s), %s, rotated %g deg"),
495 footprint->Reference().GetShownText(),
496 footprint->Value().GetShownText(),
497 footprint->IsFlipped() ? _( "back side (mirrored)" ) : _( "front side" ),
498 footprint->GetOrientation().AsDegrees() );
499 }
500
501 m_parentInfo->SetLabel( msg );
502 }
503 else
504 {
505 m_isFlipped = false;
506 }
507
508 if( m_isFlipped )
509 {
510 // flip pad (up/down) around its position
512 }
513
515
517
518 if( m_currentPad )
519 {
520 m_padNumCtrl->SetValue( m_dummyPad->GetNumber() );
521 }
522 else
523 {
525 m_padNumCtrl->SetValue( padTool->GetLastPadNumber() );
526 }
527
529
530 // Display current pad parameters units:
533
536
539
540 m_offsetShapeOpt->SetValue( m_dummyPad->GetOffset() != wxPoint() );
543
544 if( m_dummyPad->GetDelta().x )
545 {
547 m_trapAxisCtrl->SetSelection( 0 );
548 }
549 else
550 {
552 m_trapAxisCtrl->SetSelection( 1 );
553 }
554
555 m_padToDieOpt->SetValue( m_dummyPad->GetPadToDieLength() != 0 );
557
566
567 switch( m_dummyPad->GetZoneConnection() )
568 {
569 default:
570 case ZONE_CONNECTION::INHERITED: m_ZoneConnectionChoice->SetSelection( 0 ); break;
571 case ZONE_CONNECTION::FULL: m_ZoneConnectionChoice->SetSelection( 1 ); break;
572 case ZONE_CONNECTION::THERMAL: m_ZoneConnectionChoice->SetSelection( 2 ); break;
573 case ZONE_CONNECTION::NONE: m_ZoneConnectionChoice->SetSelection( 3 ); break;
574 }
575
577 m_ZoneCustomPadShape->SetSelection( 1 );
578 else
579 m_ZoneCustomPadShape->SetSelection( 0 );
580
581 switch( m_dummyPad->GetShape() )
582 {
583 default:
584 case PAD_SHAPE::CIRCLE: m_PadShapeSelector->SetSelection( CHOICE_SHAPE_CIRCLE ); break;
585 case PAD_SHAPE::OVAL: m_PadShapeSelector->SetSelection( CHOICE_SHAPE_OVAL ); break;
586 case PAD_SHAPE::RECT: m_PadShapeSelector->SetSelection( CHOICE_SHAPE_RECT ); break;
589
593 else
595 break;
596
600 else
602 break;
603 }
604
613
615
617
618 // Type of pad selection
620
621 if( aperture )
622 {
623 m_padType->SetSelection( APERTURE_DLG_TYPE );
624 }
625 else
626 {
627 switch( m_dummyPad->GetAttribute() )
628 {
629 case PAD_ATTRIB::PTH: m_padType->SetSelection( PTH_DLG_TYPE ); break;
630 case PAD_ATTRIB::SMD: m_padType->SetSelection( SMD_DLG_TYPE ); break;
631 case PAD_ATTRIB::CONN: m_padType->SetSelection( CONN_DLG_TYPE ); break;
632 case PAD_ATTRIB::NPTH: m_padType->SetSelection( NPTH_DLG_TYPE ); break;
633 }
634 }
635
636 switch( m_dummyPad->GetProperty() )
637 {
638 case PAD_PROP::NONE: m_choiceFabProperty->SetSelection( 0 ); break;
639 case PAD_PROP::BGA: m_choiceFabProperty->SetSelection( 1 ); break;
640 case PAD_PROP::FIDUCIAL_LOCAL: m_choiceFabProperty->SetSelection( 2 ); break;
641 case PAD_PROP::FIDUCIAL_GLBL: m_choiceFabProperty->SetSelection( 3 ); break;
642 case PAD_PROP::TESTPOINT: m_choiceFabProperty->SetSelection( 4 ); break;
643 case PAD_PROP::HEATSINK: m_choiceFabProperty->SetSelection( 5 ); break;
644 case PAD_PROP::CASTELLATED: m_choiceFabProperty->SetSelection( 6 ); break;
645 }
646
647 // Ensure the pad property is compatible with the pad type
649 {
650 m_choiceFabProperty->SetSelection( 0 );
651 m_choiceFabProperty->Enable( false );
652 }
653
655 m_holeShapeCtrl->SetSelection( 0 );
656 else
657 m_holeShapeCtrl->SetSelection( 1 );
658
661
662 // Update some dialog widgets state (Enable/disable options):
663 wxCommandEvent cmd_event;
664 OnPadShapeSelection( cmd_event );
665 OnOffsetCheckbox( cmd_event );
666
667 // Update basic shapes list
669}
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:452
void OnPadShapeSelection(wxCommandEvent &event) override
void OnOffsetCheckbox(wxCommandEvent &event) override
void updatePadLayersList(LSET layer_mask, bool remove_unconnected, bool keep_top_bottom)
Updates the CheckBox states in pad layers list, based on the layer_mask (if non-empty) or the default...
void enablePrimitivePage(bool aEnable)
enable (or disable) the primitive page editor
double AsDegrees() const
Definition: eda_angle.h:149
bool IsType(FRAME_T aType) const
EDA_ANGLE GetOrientation() const
Definition: footprint.h:191
bool IsFlipped() const
Definition: footprint.h:324
FP_TEXT & Value()
read/write accessors:
Definition: footprint.h:567
FP_TEXT & Reference()
Definition: footprint.h:568
virtual wxString GetShownText(int aDepth=0, bool aAllowExtraText=true) const override
Return the string actually shown after processing of the base text.
Definition: fp_text.cpp:415
void SetSelectedNetcode(int aNetcode)
Tool relating to pads and pad settings.
Definition: pad_tool.h:37
wxString GetLastPadNumber() const
Definition: pad_tool.h:65
int GetLocalClearance(wxString *aSource) const override
Return any local clearances set in the "classic" (ie: pre-rule) system.
Definition: pad.cpp:814
bool IsAperturePad() const
Definition: pad.h:407
PAD_PROP GetProperty() const
Definition: pad.h:403
bool GetRemoveUnconnected() const
Definition: pad.h:609
PAD_DRILL_SHAPE_T GetDrillShape() const
Definition: pad.h:383
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pad.h:397
const VECTOR2I & GetDrillSize() const
Definition: pad.h:267
PAD_ATTRIB GetAttribute() const
Definition: pad.h:400
ZONE_CONNECTION GetZoneConnection() const
Definition: pad.h:522
const wxString & GetNumber() const
Definition: pad.h:135
double GetLocalSolderPasteMarginRatio() const
Definition: pad.h:425
VECTOR2I GetPosition() const override
Definition: pad.h:202
const std::vector< std::shared_ptr< PCB_SHAPE > > & GetPrimitives() const
Accessor to the basic shape list for custom-shaped pads.
Definition: pad.h:330
EDA_ANGLE GetThermalSpokeAngle() const
Definition: pad.h:541
const VECTOR2I & GetOffset() const
Definition: pad.h:274
int GetLocalSolderMaskMargin() const
Definition: pad.h:415
bool GetKeepTopBottom() const
Definition: pad.h:615
CUST_PAD_SHAPE_IN_ZONE GetCustomShapeInZoneOpt() const
Definition: pad.h:212
const VECTOR2I & GetDelta() const
Definition: pad.h:264
PAD_SHAPE GetShape() const
Definition: pad.h:194
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
Definition: pad.h:370
void Flip(const VECTOR2I &VECTOR2I, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: pad.cpp:718
int GetThermalSpokeWidth() const
Definition: pad.h:531
int GetLocalSolderPasteMargin() const
Definition: pad.h:422
void SetOrientation(const EDA_ANGLE &aAngle)
Set the rotation angle of the pad.
Definition: pad.cpp:709
int GetChamferPositions() const
Definition: pad.h:594
double GetRoundRectRadiusRatio() const
Definition: pad.h:575
int GetThermalGap() const
Definition: pad.h:554
const VECTOR2I & GetSize() const
Definition: pad.h:257
PAD_SHAPE GetAnchorPadShape() const
Definition: pad.h:207
bool IsFlipped() const
Definition: pad.cpp:231
int GetPadToDieLength() const
Definition: pad.h:413
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:54
virtual void ChangeDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion WITHOUT trigger...
virtual void ChangeAngleValue(const EDA_ANGLE &aValue)
virtual void ChangeValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion WITHOUT trigger...
#define APERTURE_DLG_TYPE
#define CONN_DLG_TYPE
#define SMD_DLG_TYPE
@ CHOICE_SHAPE_CIRCLE
@ CHOICE_SHAPE_ROUNDRECT
@ CHOICE_SHAPE_CUSTOM_RECT_ANCHOR
@ CHOICE_SHAPE_CHAMFERED_RECT
@ CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR
@ CHOICE_SHAPE_RECT
@ CHOICE_SHAPE_OVAL
@ CHOICE_SHAPE_TRAPEZOID
@ CHOICE_SHAPE_CHAMFERED_ROUNDED_RECT
@ FRAME_PCB_EDITOR
Definition: frame_type.h:40
@ B_Adhes
Definition: layer_ids.h:97
@ Dwgs_User
Definition: layer_ids.h:109
@ F_Paste
Definition: layer_ids.h:101
@ F_Adhes
Definition: layer_ids.h:98
@ B_Mask
Definition: layer_ids.h:106
@ Eco1_User
Definition: layer_ids.h:111
@ F_Mask
Definition: layer_ids.h:107
@ B_Paste
Definition: layer_ids.h:100
@ F_SilkS
Definition: layer_ids.h:104
@ Eco2_User
Definition: layer_ids.h:112
@ B_SilkS
Definition: layer_ids.h:103
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
@ CUST_PAD_SHAPE_IN_ZONE_CONVEXHULL
Definition: pad.h:45
@ NPTH
like PAD_PTH, but not plated
@ SMD
Smd pad, appears on the solder paste layer (default)
@ PTH
Plated through hole pad.
@ CONN
Like smd, does not appear on the solder paste layer (default)
@ PAD_DRILL_SHAPE_OBLONG
Definition: pad_shapes.h:71
@ THERMAL
Use thermal relief for pads.
@ NONE
Pads are not covered.
@ FULL
pads are covered by copper

References _, PNS::angle(), APERTURE_DLG_TYPE, EDA_ANGLE::AsDegrees(), B_Adhes, B_Mask, B_Paste, B_SilkS, BGA, CASTELLATED, CHAMFERED_RECT, UNIT_BINDER::ChangeAngleValue(), UNIT_BINDER::ChangeDoubleValue(), UNIT_BINDER::ChangeValue(), CHOICE_SHAPE_CHAMFERED_RECT, CHOICE_SHAPE_CHAMFERED_ROUNDED_RECT, 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, CIRCLE, CONN, CONN_DLG_TYPE, CUST_PAD_SHAPE_IN_ZONE_CONVEXHULL, CUSTOM, displayPrimitivesList(), Dwgs_User, Eco1_User, Eco2_User, enablePrimitivePage(), F_Adhes, F_Mask, F_Paste, F_SilkS, FIDUCIAL_GLBL, FIDUCIAL_LOCAL, PAD::Flip(), FRAME_PCB_EDITOR, FULL, PAD::GetAnchorPadShape(), PAD::GetAttribute(), PAD::GetChamferPositions(), PAD::GetCustomShapeInZoneOpt(), PAD::GetDelta(), PAD::GetDrillShape(), PAD::GetDrillSize(), PAD::GetKeepTopBottom(), PAD_TOOL::GetLastPadNumber(), BOARD::GetLayerName(), PAD::GetLayerSet(), PAD::GetLocalClearance(), PAD::GetLocalSolderMaskMargin(), PAD::GetLocalSolderPasteMargin(), PAD::GetLocalSolderPasteMarginRatio(), BOARD_CONNECTED_ITEM::GetNetCode(), PAD::GetNumber(), PAD::GetOffset(), FOOTPRINT::GetOrientation(), PAD::GetOrientation(), PAD::GetPadToDieLength(), PAD::GetParent(), PAD::GetPosition(), PAD::GetPrimitives(), PAD::GetProperty(), PAD::GetRemoveUnconnected(), PAD::GetRoundRectRadiusRatio(), PAD::GetShape(), FP_TEXT::GetShownText(), PAD::GetSize(), PAD::GetThermalGap(), PAD::GetThermalSpokeAngle(), PAD::GetThermalSpokeWidth(), TOOL_MANAGER::GetTool(), TOOLS_HOLDER::GetToolManager(), PAD::GetZoneConnection(), HEATSINK, INHERITED, PAD::IsAperturePad(), FOOTPRINT::IsFlipped(), PAD::IsFlipped(), EDA_BASE_FRAME::IsType(), m_board, m_canEditNetName, DIALOG_PAD_PROPERTIES_BASE::m_cbBottomLeft, DIALOG_PAD_PROPERTIES_BASE::m_cbBottomLeft1, DIALOG_PAD_PROPERTIES_BASE::m_cbBottomRight, DIALOG_PAD_PROPERTIES_BASE::m_cbBottomRight1, DIALOG_PAD_PROPERTIES_BASE::m_cbTopLeft, DIALOG_PAD_PROPERTIES_BASE::m_cbTopLeft1, DIALOG_PAD_PROPERTIES_BASE::m_cbTopRight, DIALOG_PAD_PROPERTIES_BASE::m_cbTopRight1, DIALOG_PAD_PROPERTIES_BASE::m_choiceFabProperty, m_clearance, m_currentPad, m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_FlippedWarningSizer, DIALOG_PAD_PROPERTIES_BASE::m_holeShapeCtrl, m_holeX, m_holeY, m_isFlipped, m_maskMargin, DIALOG_PAD_PROPERTIES_BASE::m_offsetShapeOpt, m_offsetX, m_offsetY, m_pad_orientation, 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_padNetSelector, DIALOG_PAD_PROPERTIES_BASE::m_padNumCtrl, DIALOG_PAD_PROPERTIES_BASE::m_PadShapeSelector, m_padToDie, DIALOG_PAD_PROPERTIES_BASE::m_padToDieOpt, DIALOG_PAD_PROPERTIES_BASE::m_padType, m_parent, DIALOG_PAD_PROPERTIES_BASE::m_parentInfo, m_pasteMargin, m_pasteMarginRatio, m_posX, m_posY, m_primitives, m_sizeX, m_sizeY, m_spokeAngle, m_spokeWidth, m_thermalGap, DIALOG_PAD_PROPERTIES_BASE::m_trapAxisCtrl, m_trapDelta, DIALOG_PAD_PROPERTIES_BASE::m_ZoneConnectionChoice, DIALOG_PAD_PROPERTIES_BASE::m_ZoneCustomPadShape, NONE, NPTH, NPTH_DLG_TYPE, OnOffsetCheckbox(), OnPadShapeSelection(), OVAL, PAD_DRILL_SHAPE_OBLONG, PTH, PTH_DLG_TYPE, RECT, RECT_CHAMFER_BOTTOM_LEFT, RECT_CHAMFER_BOTTOM_RIGHT, RECT_CHAMFER_TOP_LEFT, RECT_CHAMFER_TOP_RIGHT, FOOTPRINT::Reference(), ROUNDRECT, PAD::SetOrientation(), NET_SELECTOR::SetSelectedNetcode(), SMD, SMD_DLG_TYPE, TESTPOINT, THERMAL, TRAPEZOID, updatePadLayersList(), updateRoundRectCornerValues(), FOOTPRINT::Value(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by DIALOG_PAD_PROPERTIES().

◆ IsCtrl()

static bool DIALOG_SHIM::IsCtrl ( int  aChar,
const wxKeyEvent &  e 
)
inlinestaticinherited

Definition at line 128 of file dialog_shim.h.

129 {
130 return e.GetKeyCode() == aChar && e.ControlDown() && !e.AltDown() &&
131 !e.ShiftDown() && !e.MetaDown();
132 }

◆ IsQuasiModal()

◆ IsShiftCtrl()

static bool DIALOG_SHIM::IsShiftCtrl ( int  aChar,
const wxKeyEvent &  e 
)
inlinestaticinherited

Definition at line 134 of file dialog_shim.h.

135 {
136 return e.GetKeyCode() == aChar && e.ControlDown() && !e.AltDown() &&
137 e.ShiftDown() && !e.MetaDown();
138 }

◆ Kiway()

KIWAY & KIWAY_HOLDER::Kiway ( ) const
inlineinherited

Return 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 53 of file kiway_holder.h.

54 {
55 wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
56 return *m_kiway;
57 }

References KIWAY_HOLDER::m_kiway.

Referenced by PROJECT_TREE_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_BASE_EDIT_FRAME::AddLibrary(), SYMBOL_EDIT_FRAME::AddLibraryFile(), SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic(), SCH_EDIT_FRAME::AskToSaveChanges(), IMPORT_PROJ_HELPER::AssociateFileWithProj(), CVPCB_MAINFRAME::BuildLibrariesListBox(), FOOTPRINT_EDIT_FRAME::buildSaveAsDialog(), SYMBOL_EDIT_FRAME::buildSaveAsDialog(), SYMBOL_EDIT_FRAME::CanCloseSymbolFromSchematic(), SCH_EDIT_FRAME::canCloseWindow(), PCB_EDIT_FRAME::canCloseWindow(), KICAD_MANAGER_FRAME::CloseProject(), COMMON_CONTROL::ConfigurePaths(), DIALOG_CHOOSE_SYMBOL::ConstructRightPanel(), DIALOG_CHOOSE_FOOTPRINT::ConstructRightPanel(), PCB_BASE_FRAME::CreateAndShow3D_Frame(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), SYMBOL_EDIT_FRAME::DdAddLibrary(), DIALOG_LIST_HOTKEYS::DIALOG_LIST_HOTKEYS(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_SHIM::DIALOG_SHIM(), SCH_EDIT_FRAME::doCloseWindow(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), FIELDS_GRID_TRICKS::doPopupSelection(), BOARD_EDITOR_CONTROL::EditFpInFpEditor(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), BACK_ANNOTATE::FetchNetlistFromPCB(), PCB_EDIT_FRAME::FetchNetlistFromSchematic(), SCRIPTING_TOOL::Init(), EDA_DRAW_FRAME::IsScriptingConsoleVisible(), KIWAY_PLAYER::language_change(), KICAD_MANAGER_FRAME::language_change(), DIALOG_CHANGE_SYMBOLS::launchMatchIdSymbolBrowser(), DIALOG_CHANGE_SYMBOLS::launchNewIdSymbolBrowser(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), PGM_SINGLE_TOP::MacOpenFile(), SIM_PLOT_FRAME::menuExit(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), TEXT_BUTTON_FP_CHOOSER::OnButtonClick(), PL_EDITOR_FRAME::OnExit(), SCH_EDIT_FRAME::OnExit(), FOOTPRINT_EDIT_FRAME::OnExitKiCad(), SYMBOL_EDIT_FRAME::OnExitKiCad(), FOOTPRINT_VIEWER_FRAME::OnExitKiCad(), SAVE_AS_TRAVERSER::OnFile(), DIALOG_CHOOSE_SYMBOL::OnInitDialog(), KIGFX::WX_VIEW_CONTROLS::onMotion(), SCH_EDIT_FRAME::OnOpenCvpcb(), SCH_EDIT_FRAME::OnOpenPcbnew(), SIM_PLOT_FRAME::onProbe(), PCB_EDIT_FRAME::OnQuit(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), DIALOG_FIELD_PROPERTIES::OnTextValueSelectButtonClick(), SIM_PLOT_FRAME::onTune(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadFootprintFromBoard(), SCH_EDIT_FRAME::OnUpdatePCB(), FOOTPRINT_EDIT_FRAME::OnUpdateSaveFootprintToBoard(), SCH_BASE_FRAME::PickSymbolFromLibBrowser(), KIWAY_HOLDER::Prj(), SCH_EDIT_TOOL::Properties(), BACK_ANNOTATE::PushNewLinksToPCB(), FOOTPRINT_WIZARD_FRAME::PythonPluginsReload(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), SYMBOL_VIEWER_FRAME::ReCreateLibList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), SCH_EDITOR_CONTROL::rescueProject(), PCB_EDIT_FRAME::RunEeschema(), EE_INSPECTION_TOOL::RunSimulation(), SYMBOL_EDIT_FRAME::Save(), SYMBOL_EDIT_FRAME::saveCurrentSymbol(), CVPCB_MAINFRAME::SaveFootprintAssociation(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), EDA_DRAW_FRAME::ScriptingConsoleEnableDisable(), PCB_BASE_FRAME::SelectFootprintFromLibBrowser(), PCB_BASE_FRAME::SelectLibrary(), CVPCB_MAINFRAME::SendComponentSelectionToSch(), SCH_EDIT_FRAME::SendCrossProbeClearHighlight(), PCB_EDIT_FRAME::SendCrossProbeItem(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), SCH_EDIT_FRAME::sendNetlistToCvpcb(), SCH_EDIT_FRAME::SendSelectItemsToPcb(), PCB_EDIT_FRAME::SendSelectItemsToSch(), SCH_EDIT_FRAME::SetCrossProbeConnection(), SYMBOL_EDIT_FRAME::SetCurSymbol(), PCB_EDIT_FRAME::ShowBoardSetupDialog(), PCB_EDIT_FRAME::ShowFootprintPropertiesDialog(), CVPCB_CONTROL::ShowFootprintViewer(), COMMON_CONTROL::ShowLibraryTable(), COMMON_CONTROL::ShowPlayer(), KICAD_MANAGER_CONTROL::ShowPlayer(), EDA_BASE_FRAME::ShowPreferences(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), PCB_EDIT_FRAME::TestStandalone(), BOARD_EDITOR_CONTROL::UpdateSchematicFromPCB(), DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint(), and DIALOG_SHIM::~DIALOG_SHIM().

◆ onAddPrimitive()

void DIALOG_PAD_PROPERTIES::onAddPrimitive ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 2158 of file dialog_pad_properties.cpp.

2159{
2160 // Ask user for shape type
2161 wxString shapelist[] = {
2162 _( "Segment" ),
2163 _( "Arc" ),
2164 _( "Bezier" ),
2165 _( "Ring/Circle" ),
2166 _( "Polygon" ),
2167 _( "Number box" ),
2168 };
2169
2170 int type = wxGetSingleChoiceIndex( _( "Shape type:" ), _( "Add Primitive" ),
2171 arrayDim( shapelist ), shapelist, 0, this );
2172
2173 // User pressed cancel
2174 if( type == -1 )
2175 return;
2176
2179
2180 PCB_SHAPE* primitive = new PCB_SHAPE();
2181 primitive->SetShape( listtype[type] );
2182
2183 if( type == static_cast<int>( arrayDim( shapelist ) ) - 1 )
2184 primitive->SetIsAnnotationProxy();
2185
2188 primitive->SetFilled( true );
2189
2190 if( listtype[type] == SHAPE_T::POLY )
2191 {
2192 DIALOG_PAD_PRIMITIVE_POLY_PROPS dlg( this, m_parent, primitive );
2193
2194 if( dlg.ShowModal() != wxID_OK )
2195 return;
2196 }
2197 else
2198 {
2199 DIALOG_PAD_PRIMITIVES_PROPERTIES dlg( this, m_parent, primitive );
2200
2201 if( dlg.ShowModal() != wxID_OK )
2202 return;
2203 }
2204
2205 m_primitives.emplace_back( primitive );
2206
2208
2210 redraw();
2211}
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
Definition: arraydim.h:31
int GetLineThickness(PCB_LAYER_ID aLayer) const
Return the default graphic segment thickness from the layer class for the given layer.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:682
void SetFilled(bool aFlag)
Definition: eda_shape.h:95
void SetShape(SHAPE_T aShape)
Definition: eda_shape.h:112
void SetIsAnnotationProxy(bool aIsProxy=true)
Definition: eda_shape.h:88
void SetStroke(const STROKE_PARAMS &aStroke) override
Definition: pcb_shape.h:72
Simple container to manage line stroke parameters.
Definition: stroke_params.h:88
SHAPE_T
Definition: eda_shape.h:41
@ F_Cu
Definition: layer_ids.h:64

References _, ARC, arrayDim(), BEZIER, CIRCLE, displayPrimitivesList(), F_Cu, BOARD::GetDesignSettings(), BOARD_DESIGN_SETTINGS::GetLineThickness(), m_board, m_canUpdate, m_dummyPad, m_parent, m_primitives, POLY, RECT, redraw(), SEGMENT, EDA_SHAPE::SetFilled(), EDA_SHAPE::SetIsAnnotationProxy(), EDA_SHAPE::SetShape(), PCB_SHAPE::SetStroke(), SOLID, and transferDataToPad().

◆ OnButton()

void DIALOG_SHIM::OnButton ( wxCommandEvent &  aEvent)
privateinherited

Properly handle the default button events when in the quasimodal mode when not calling EndQuasiModal which is possible with any dialog derived from DIALOG_SHIM.

Definition at line 532 of file dialog_shim.cpp.

533{
534 const int id = aEvent.GetId();
535
536 // If we are pressing a button to exit, we need to enable the escapeID
537 // otherwise the dialog does not process cancel
538 if( id == wxID_CANCEL )
539 SetEscapeId( wxID_ANY );
540
541 if( IsQuasiModal() )
542 {
543 if( id == GetAffirmativeId() )
544 {
545 EndQuasiModal( id );
546 }
547 else if( id == wxID_APPLY )
548 {
549 // Dialogs that provide Apply buttons should make sure data is valid before
550 // allowing a transfer, as there is no other way to indicate failure
551 // (i.e. the dialog can't refuse to close as it might with OK, because it
552 // isn't closing anyway)
553 if( Validate() )
554 {
555 ignore_unused( TransferDataFromWindow() );
556 }
557 }
558 else if( id == GetEscapeId() || (id == wxID_CANCEL && GetEscapeId() == wxID_ANY) )
559 {
560 EndQuasiModal( wxID_CANCEL );
561 }
562 else // not a standard button
563 {
564 aEvent.Skip();
565 }
566
567 return;
568 }
569
570 // This is mandatory to allow wxDialogBase::OnButton() to be called.
571 aEvent.Skip();
572}
void EndQuasiModal(int retCode)
void ignore_unused(const T &)
Definition: ignore.h:24

References DIALOG_SHIM::EndQuasiModal(), ignore_unused(), and DIALOG_SHIM::IsQuasiModal().

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ OnCancel()

void DIALOG_PAD_PROPERTIES::OnCancel ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 280 of file dialog_pad_properties.cpp.

281{
282 // Mandatory to avoid m_panelShowPadGal trying to draw something
283 // in a non valid context during closing process:
285
286 // Now call default handler for wxID_CANCEL command event
287 event.Skip();
288}
PCB_DRAW_PANEL_GAL * m_padPreviewGAL
void StopDrawing()
Prevent the GAL canvas from further drawing until it is recreated or StartDrawing() is called.

References m_padPreviewGAL, and EDA_DRAW_PANEL_GAL::StopDrawing().

◆ onChangePadMode()

void DIALOG_PAD_PROPERTIES::onChangePadMode ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 774 of file dialog_pad_properties.cpp.

775{
777
779
780 // fix the pad render mode (filled/not filled)
781 auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
782
783 settings->m_ForcePadSketchModeOn = m_cbShowPadOutline->IsChecked();
784 settings->SetHighContrast( false );
785 settings->m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL;
786
787 redraw();
788}
@ NORMAL
Inactive layers are shown normally (no high-contrast mode)
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
PCB specific render settings.
Definition: pcb_painter.h:72
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:69
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:213
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.

References KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), PCB_DRAW_PANEL_GAL::GetView(), DIALOG_PAD_PROPERTIES_BASE::m_cbShowPadOutline, KIGFX::PCB_RENDER_SETTINGS::m_ForcePadSketchModeOn, m_padPreviewGAL, m_sketchPreview, NORMAL, and redraw().

◆ OnCharHook()

void DIALOG_SHIM::OnCharHook ( wxKeyEvent &  aEvt)
protectedvirtualinherited

Reimplemented in HK_PROMPT_DIALOG, DIALOG_CHOOSE_SYMBOL, and HTML_MESSAGE_BOX.

Definition at line 575 of file dialog_shim.cpp.

576{
577 if( aEvt.GetKeyCode() == 'U' && aEvt.GetModifiers() == wxMOD_CONTROL )
578 {
579 if( m_parentFrame )
580 {
582 return;
583 }
584 }
585 // shift-return (Mac default) or Ctrl-Return (GTK) for OK
586 else if( aEvt.GetKeyCode() == WXK_RETURN && ( aEvt.ShiftDown() || aEvt.ControlDown() ) )
587 {
588 wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
589 return;
590 }
591 else if( aEvt.GetKeyCode() == WXK_TAB && !aEvt.ControlDown() )
592 {
593 wxWindow* currentWindow = wxWindow::FindFocus();
594 int currentIdx = -1;
595 int delta = aEvt.ShiftDown() ? -1 : 1;
596
597 auto advance =
598 [&]( int& idx )
599 {
600 // Wrap-around modulus
601 int size = (int) m_tabOrder.size();
602 idx = ( ( idx + delta ) % size + size ) % size;
603 };
604
605 for( size_t i = 0; i < m_tabOrder.size(); ++i )
606 {
607 if( m_tabOrder[i] == currentWindow )
608 {
609 currentIdx = (int) i;
610 break;
611 }
612 }
613
614 if( currentIdx >= 0 )
615 {
616 advance( currentIdx );
617
618 //todo: We don't currently have non-textentry dialog boxes but this will break if
619 // we add them.
620#ifdef __APPLE__
621 while( dynamic_cast<wxTextEntry*>( m_tabOrder[ currentIdx ] ) == nullptr )
622 advance( currentIdx );
623#endif
624
625 m_tabOrder[ currentIdx ]->SetFocus();
626 return;
627 }
628 }
629
630 aEvt.Skip();
631}
std::vector< wxWindow * > m_tabOrder
Definition: dialog_shim.h:222
EDA_BASE_FRAME * m_parentFrame
Definition: dialog_shim.h:220
virtual void ToggleUserUnits()
constexpr int delta

References delta, DIALOG_SHIM::m_parentFrame, DIALOG_SHIM::m_tabOrder, and EDA_BASE_FRAME::ToggleUserUnits().

Referenced by DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TEXTBOX_PROPERTIES::DIALOG_TEXTBOX_PROPERTIES(), and DIALOG_TEXTBOX_PROPERTIES::~DIALOG_TEXTBOX_PROPERTIES().

◆ OnCloseWindow()

void DIALOG_SHIM::OnCloseWindow ( wxCloseEvent &  aEvent)
privateinherited

Properly handle the wxCloseEvent when in the quasimodal mode when not calling EndQuasiModal which is possible with any dialog derived from DIALOG_SHIM.

Definition at line 519 of file dialog_shim.cpp.

520{
521 if( IsQuasiModal() )
522 {
523 EndQuasiModal( wxID_CANCEL );
524 return;
525 }
526
527 // This is mandatory to allow wxDialogBase::OnCloseWindow() to be called.
528 aEvent.Skip();
529}

References DIALOG_SHIM::EndQuasiModal(), and DIALOG_SHIM::IsQuasiModal().

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ onCornerRadiusChange()

void DIALOG_PAD_PROPERTIES::onCornerRadiusChange ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 367 of file dialog_pad_properties.cpp.

368{
371 {
372 return;
373 }
374
375 if( m_cornerRadius.GetValue() < 0 )
376 m_cornerRadiusCtrl->ChangeValue( "0" );
377
379 {
381
384
385 redraw();
386 }
387}
void SetRoundRectCornerRadius(double aRadius)
Has meaning only for rounded rectangle pads.
Definition: pad.cpp:351
virtual long long int GetValue()
Return the current value in Internal Units.

References CHAMFERED_RECT, UNIT_BINDER::ChangeDoubleValue(), PAD::GetRoundRectRadiusRatio(), PAD::GetShape(), UNIT_BINDER::GetValue(), m_cornerRadius, DIALOG_PAD_PROPERTIES_BASE::m_cornerRadiusCtrl, m_cornerRatio, m_dummyPad, m_mixedCornerRatio, redraw(), ROUNDRECT, PAD::SetRoundRectCornerRadius(), and transferDataToPad().

◆ onCornerSizePercentChange()

void DIALOG_PAD_PROPERTIES::onCornerSizePercentChange ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 390 of file dialog_pad_properties.cpp.

391{
394 {
395 return;
396 }
397
398 wxObject* ctrl = event.GetEventObject();
399 wxString value = event.GetString();
400 bool changed = false;
401
402 if( ctrl == m_cornerRatioCtrl || ctrl == m_mixedCornerRatioCtrl )
403 {
404 double ratioPercent;
405
406 if( value.ToDouble( &ratioPercent ) )
407 {
408 // Clamp ratioPercent to acceptable value (0.0 to 50.0)
409 if( ratioPercent < 0.0 )
410 {
413 }
414 else if( ratioPercent > 50.0 )
415 {
418 }
419
420 if( ctrl == m_cornerRatioCtrl )
421 m_mixedCornerRatioCtrl->ChangeValue( value );
422 else
423 m_cornerRatioCtrl->ChangeValue( value );
424
425 changed = true;
426 }
427 }
428 else if( ctrl == m_chamferRatioCtrl || ctrl == m_mixedChamferRatioCtrl )
429 {
430 double ratioPercent;
431
432 if( value.ToDouble( &ratioPercent ) )
433 {
434 // Clamp ratioPercent to acceptable value (0.0 to 50.0)
435 if( ratioPercent < 0.0 )
436 {
439 }
440 else if( ratioPercent > 50.0 )
441 {
444 }
445
446 if( ctrl == m_chamferRatioCtrl )
447 m_mixedChamferRatioCtrl->ChangeValue( value );
448 else
449 m_chamferRatioCtrl->ChangeValue( value );
450
451 changed = true;
452 }
453 }
454
455 if( changed && transferDataToPad( m_dummyPad ) )
457
458 redraw();
459}
int GetRoundRectCornerRadius() const
Definition: pad.cpp:345
virtual void SetDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.

References CHAMFERED_RECT, UNIT_BINDER::ChangeValue(), PAD::GetRoundRectCornerRadius(), PAD::GetShape(), m_chamferRatio, DIALOG_PAD_PROPERTIES_BASE::m_chamferRatioCtrl, m_cornerRadius, m_cornerRatio, DIALOG_PAD_PROPERTIES_BASE::m_cornerRatioCtrl, m_dummyPad, m_mixedChamferRatio, DIALOG_PAD_PROPERTIES_BASE::m_mixedChamferRatioCtrl, m_mixedCornerRatio, DIALOG_PAD_PROPERTIES_BASE::m_mixedCornerRatioCtrl, redraw(), ROUNDRECT, UNIT_BINDER::SetDoubleValue(), and transferDataToPad().

◆ onDeletePrimitive()

void DIALOG_PAD_PROPERTIES::onDeletePrimitive ( wxCommandEvent &  event)
overrideprivatevirtual

Event handlers of basic shapes list panel.

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 2133 of file dialog_pad_properties.cpp.

2134{
2135 long select = m_listCtrlPrimitives->GetFirstSelected();
2136
2137 if( select < 0 )
2138 return;
2139
2140 // Multiple selections are allowed. get them and remove corresponding shapes
2141 std::vector<long> indexes;
2142 indexes.push_back( select );
2143
2144 while( ( select = m_listCtrlPrimitives->GetNextSelected( select ) ) >= 0 )
2145 indexes.push_back( select );
2146
2147 // Erase all select shapes
2148 for( unsigned ii = indexes.size(); ii > 0; --ii )
2149 m_primitives.erase( m_primitives.begin() + indexes[ii-1] );
2150
2152
2154 redraw();
2155}

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

◆ OnDrillShapeSelected()

void DIALOG_PAD_PROPERTIES::OnDrillShapeSelected ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 915 of file dialog_pad_properties.cpp.

916{
919 redraw();
920}

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

◆ onDuplicatePrimitive()

void DIALOG_PAD_PROPERTIES::onDuplicatePrimitive ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 2245 of file dialog_pad_properties.cpp.

2246{
2247 long select = m_listCtrlPrimitives->GetFirstSelected();
2248
2249 if( select < 0 )
2250 {
2251 wxMessageBox( _( "No shape selected" ) );
2252 return;
2253 }
2254
2255 // Multiple selections are allowed. Build selected shapes list
2256 std::vector<std::shared_ptr<PCB_SHAPE>> shapeList;
2257 shapeList.emplace_back( m_primitives[select] );
2258
2259 while( ( select = m_listCtrlPrimitives->GetNextSelected( select ) ) >= 0 )
2260 shapeList.emplace_back( m_primitives[select] );
2261
2262 DIALOG_PAD_PRIMITIVES_TRANSFORM dlg( this, m_parent, shapeList, true );
2263
2264 if( dlg.ShowModal() != wxID_OK )
2265 return;
2266
2267 // Transfer new settings
2268 // save duplicates to a separate vector to avoid m_primitives reallocation,
2269 // as shapeList contains pointers to its elements
2270 std::vector<std::shared_ptr<PCB_SHAPE>> duplicates;
2271 dlg.Transform( &duplicates, dlg.GetDuplicateCount() );
2272 std::move( duplicates.begin(), duplicates.end(), std::back_inserter( m_primitives ) );
2273
2275
2277 redraw();
2278}
A dialog to apply geometry transforms to a shape or set of shapes (move, rotate around origin,...

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

◆ onEditPrimitive()

void DIALOG_PAD_PROPERTIES::onEditPrimitive ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 2127 of file dialog_pad_properties.cpp.

2128{
2129 editPrimitive();
2130}

References editPrimitive().

◆ onGeometryTransform()

void DIALOG_PAD_PROPERTIES::onGeometryTransform ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 2214 of file dialog_pad_properties.cpp.

2215{
2216 long select = m_listCtrlPrimitives->GetFirstSelected();
2217
2218 if( select < 0 )
2219 {
2220 wxMessageBox( _( "No shape selected" ) );
2221 return;
2222 }
2223
2224 // Multiple selections are allowed. Build selected shapes list
2225 std::vector<std::shared_ptr<PCB_SHAPE>> shapeList;
2226 shapeList.emplace_back( m_primitives[select] );
2227
2228 while( ( select = m_listCtrlPrimitives->GetNextSelected( select ) ) >= 0 )
2229 shapeList.emplace_back( m_primitives[select] );
2230
2231 DIALOG_PAD_PRIMITIVES_TRANSFORM dlg( this, m_parent, shapeList, false );
2232
2233 if( dlg.ShowModal() != wxID_OK )
2234 return;
2235
2236 dlg.Transform();
2237
2239
2241 redraw();
2242}

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

◆ OnGridEditorHidden()

void DIALOG_SHIM::OnGridEditorHidden ( wxGridEvent &  event)
privateinherited

Definition at line 641 of file dialog_shim.cpp.

642{
643 SetEscapeId( wxID_ANY );
644 event.Skip();
645}

◆ OnGridEditorShown()

void DIALOG_SHIM::OnGridEditorShown ( wxGridEvent &  event)
privateinherited

Definition at line 634 of file dialog_shim.cpp.

635{
636 SetEscapeId( wxID_NONE );
637 event.Skip();
638}

◆ OnInitDialog()

void DIALOG_PAD_PROPERTIES::OnInitDialog ( wxInitDialogEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 270 of file dialog_pad_properties.cpp.

271{
272 m_selectedColor = COLOR4D( 1.0, 1.0, 1.0, 0.7 );
273
274 // Needed on some WM to be sure the pad is redrawn according to the final size
275 // of the canvas, with the right zoom factor
276 redraw();
277}
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104

References m_selectedColor, and redraw().

◆ OnModify()

◆ OnOffsetCheckbox()

void DIALOG_PAD_PROPERTIES::OnOffsetCheckbox ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 2032 of file dialog_pad_properties.cpp.

2033{
2034 if( m_offsetShapeOpt->GetValue() )
2035 {
2038 }
2039
2040 // Show/hide controls depending on m_offsetShapeOpt being enabled
2041 m_offsetCtrls->Show( m_offsetShapeOpt->GetValue() );
2042 m_offsetShapeOptLabel->Show( m_offsetShapeOpt->GetValue() );
2043
2044 for( size_t i = 0; i < m_notebook->GetPageCount(); ++i )
2045 m_notebook->GetPage( i )->Layout();
2046
2047 OnValuesChanged( event );
2048}
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.

References PAD::GetOffset(), m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_notebook, DIALOG_PAD_PROPERTIES_BASE::m_offsetCtrls, DIALOG_PAD_PROPERTIES_BASE::m_offsetShapeOpt, DIALOG_PAD_PROPERTIES_BASE::m_offsetShapeOptLabel, m_offsetX, m_offsetY, OnValuesChanged(), UNIT_BINDER::SetValue(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by initValues().

◆ OnPadShapeSelection()

void DIALOG_PAD_PROPERTIES::OnPadShapeSelection ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 791 of file dialog_pad_properties.cpp.

792{
793 switch( m_PadShapeSelector->GetSelection() )
794 {
798 m_shapePropsBook->SetSelection( 0 );
799 break;
800
802 m_shapePropsBook->SetSelection( 1 );
803 break;
804
806 {
807 m_shapePropsBook->SetSelection( 2 );
808
809 // A reasonable default (from IPC-7351C)
810 if( m_dummyPad->GetRoundRectRadiusRatio() == 0.0 )
812
813 break;
814 }
815
817 m_shapePropsBook->SetSelection( 3 );
818
819 // Reasonable default
820 if( m_dummyPad->GetChamferRectRatio() == 0.0 )
822
823 // Ensure the displayed value is up to date:
825
826 // A reasonable default is one corner chamfered (usual for some SMD pads).
827 if( !m_cbTopLeft->GetValue() && !m_cbTopRight->GetValue()
828 && !m_cbBottomLeft->GetValue() && !m_cbBottomRight->GetValue() )
829 {
830 m_cbTopLeft->SetValue( true );
831 m_cbTopRight->SetValue( false );
832 m_cbBottomLeft->SetValue( false );
833 m_cbBottomRight->SetValue( false );
834 }
835
836 break;
837
839 m_shapePropsBook->SetSelection( 4 );
840
841 // Reasonable defaults (corner radius from IPC-7351C)
843 && m_dummyPad->GetChamferRectRatio() == 0.0 )
844 {
845 if( m_dummyPad->GetRoundRectRadiusRatio() == 0.0 )
847
848 if( m_dummyPad->GetChamferRectRatio() == 0.0 )
850 }
851
852 // Ensure the displayed values are up to date:
855 break;
856
857 case CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR: // PAD_SHAPE::CUSTOM, circular anchor
858 case CHOICE_SHAPE_CUSTOM_RECT_ANCHOR: // PAD_SHAPE::CUSTOM, rect anchor
859 m_shapePropsBook->SetSelection( 0 );
860 break;
861 }
862
863 // Note: must do this before enabling/disabling m_sizeY as we're using that as a flag to see
864 // what the last shape was.
865 if( m_PadShapeSelector->GetSelection() == CHOICE_SHAPE_CIRCLE )
866 {
867 if( m_sizeYCtrl->IsEnabled() && m_spokeAngle.GetAngleValue() == ANGLE_90 )
869 }
870 else
871 {
872 if( !m_sizeYCtrl->IsEnabled() && m_spokeAngle.GetAngleValue() == ANGLE_45 )
874 }
875
876 // Readjust props book size
877 wxSize size = m_shapePropsBook->GetSize();
878 size.y = m_shapePropsBook->GetPage( m_shapePropsBook->GetSelection() )->GetBestSize().y;
879 m_shapePropsBook->SetMaxSize( size );
880
883
887
888 if( !m_offsetShapeOpt->IsEnabled() )
889 m_offsetShapeOpt->SetValue( false );
890
891 // Show/hide controls depending on m_offsetShapeOpt being enabled
892 m_offsetCtrls->Show( m_offsetShapeOpt->GetValue() );
893 m_offsetShapeOptLabel->Show( m_offsetShapeOpt->GetValue() );
894
895 bool is_custom = m_PadShapeSelector->GetSelection() == CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR
897
898 enablePrimitivePage( is_custom );
899
902
903 for( size_t i = 0; i < m_notebook->GetPageCount(); ++i )
904 m_notebook->GetPage( i )->Layout();
905
906 // Resize the dialog if its height is too small to show all widgets:
907 if( m_MainSizer->GetSize().y < m_MainSizer->GetMinSize().y )
908 m_MainSizer->SetSizeHints( this );
909
911 redraw();
912}
void SetChamferRectRatio(double aChamferScale)
Has meaning only for chamfered rectangular pads.
Definition: pad.cpp:368
void SetRoundRectRadiusRatio(double aRadiusScale)
Has meaning only for rounded rectangle pads.
Definition: pad.cpp:360
double GetChamferRectRatio() const
Definition: pad.h:584
void Enable(bool aEnable)
Enable/disable the label, widget and units label.
virtual EDA_ANGLE GetAngleValue()
virtual void SetAngleValue(const EDA_ANGLE &aValue)
static constexpr EDA_ANGLE & ANGLE_45
Definition: eda_angle.h:413
static constexpr EDA_ANGLE & ANGLE_90
Definition: eda_angle.h:414

References ANGLE_45, ANGLE_90, UNIT_BINDER::ChangeDoubleValue(), CHOICE_SHAPE_CHAMFERED_RECT, CHOICE_SHAPE_CHAMFERED_ROUNDED_RECT, 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, UNIT_BINDER::Enable(), enablePrimitivePage(), UNIT_BINDER::GetAngleValue(), PAD::GetChamferRectRatio(), PAD::GetRoundRectRadiusRatio(), DIALOG_PAD_PROPERTIES_BASE::m_cbBottomLeft, DIALOG_PAD_PROPERTIES_BASE::m_cbBottomRight, DIALOG_PAD_PROPERTIES_BASE::m_cbTopLeft, DIALOG_PAD_PROPERTIES_BASE::m_cbTopRight, m_chamferRatio, m_cornerRatio, m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_MainSizer, m_mixedChamferRatio, m_mixedCornerRatio, DIALOG_PAD_PROPERTIES_BASE::m_notebook, DIALOG_PAD_PROPERTIES_BASE::m_offsetCtrls, DIALOG_PAD_PROPERTIES_BASE::m_offsetShapeOpt, DIALOG_PAD_PROPERTIES_BASE::m_offsetShapeOptLabel, DIALOG_PAD_PROPERTIES_BASE::m_PadShapeSelector, DIALOG_PAD_PROPERTIES_BASE::m_shapePropsBook, m_sizeY, DIALOG_PAD_PROPERTIES_BASE::m_sizeYCtrl, m_spokeAngle, redraw(), UNIT_BINDER::SetAngleValue(), PAD::SetChamferRectRatio(), PAD::SetRoundRectRadiusRatio(), transferDataToPad(), updatePadSizeControls(), and updateRoundRectCornerValues().

Referenced by initValues().

◆ OnPadToDieCheckbox()

void DIALOG_PAD_PROPERTIES::OnPadToDieCheckbox ( wxCommandEvent &  event)
overrideprivatevirtual

◆ OnPaint()

void DIALOG_SHIM::OnPaint ( wxPaintEvent &  event)
inherited

Definition at line 386 of file dialog_shim.cpp.

387{
389 {
391
392 selectAllInTextCtrls( GetChildren() );
393
396 else
397 KIPLATFORM::UI::ForceFocus( this ); // Focus the dialog itself
398
399 m_firstPaintEvent = false;
400 }
401
402 event.Skip();
403}
bool m_firstPaintEvent
Definition: dialog_shim.h:212
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:213
static void selectAllInTextCtrls(wxWindowList &children)
void FixupCancelButtonCmdKeyCollision(wxWindow *aWindow)
Definition: gtk/ui.cpp:71
void ForceFocus(wxWindow *aWindow)
Pass the current focus to the window.
Definition: gtk/ui.cpp:44

References KIPLATFORM::UI::FixupCancelButtonCmdKeyCollision(), KIPLATFORM::UI::ForceFocus(), DIALOG_SHIM::m_firstPaintEvent, DIALOG_SHIM::m_initialFocusTarget, and selectAllInTextCtrls().

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ onPrimitiveDClick()

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 2121 of file dialog_pad_properties.cpp.

2122{
2123 editPrimitive();
2124}

References editPrimitive().

◆ OnPrimitiveSelection()

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 2113 of file dialog_pad_properties.cpp.

2114{
2115 // Called on a double click on the basic shapes list
2116 // To Do: highlight the primitive(s) currently selected.
2117 redraw();
2118}

References redraw().

◆ OnResize()

void DIALOG_PAD_PROPERTIES::OnResize ( wxSizeEvent &  event)
private

Definition at line 767 of file dialog_pad_properties.cpp.

768{
769 redraw();
770 event.Skip();
771}

References redraw().

Referenced by prepareCanvas().

◆ OnSetCopperLayers()

void DIALOG_PAD_PROPERTIES::OnSetCopperLayers ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 1221 of file dialog_pad_properties.cpp.

1222{
1224 redraw();
1225}

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

◆ OnSetLayers()

void DIALOG_PAD_PROPERTIES::OnSetLayers ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 1228 of file dialog_pad_properties.cpp.

1229{
1231 redraw();
1232}

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

◆ OnUpdateUI()

void DIALOG_PAD_PROPERTIES::OnUpdateUI ( wxUpdateUIEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 1023 of file dialog_pad_properties.cpp.

1024{
1025 bool hasHole = true;
1026 bool hasConnection = true;
1027
1028 switch( m_padType->GetSelection() )
1029 {
1030 case PTH_DLG_TYPE: /* PTH */ hasHole = true; hasConnection = true; break;
1031 case SMD_DLG_TYPE: /* SMD */ hasHole = false; hasConnection = true; break;
1032 case CONN_DLG_TYPE: /* CONN */ hasHole = false; hasConnection = true; break;
1033 case NPTH_DLG_TYPE: /* NPTH */ hasHole = true; hasConnection = false; break;
1034 case APERTURE_DLG_TYPE: /* Aperture */ hasHole = false; hasConnection = false; break;
1035 }
1036
1037 // Enable/disable hole controls
1038 m_holeShapeLabel->Enable( hasHole );
1039 m_holeShapeCtrl->Enable( hasHole );
1040 m_holeX.Enable( hasHole );
1041 m_holeY.Enable( hasHole && m_holeShapeCtrl->GetSelection() == CHOICE_SHAPE_OVAL );
1042
1043 // Enable/disable number and net
1044 m_padNumLabel->Enable( hasConnection );
1045 m_padNumCtrl->Enable( hasConnection );
1046
1047 if( m_padNetLabel->IsShown() )
1048 {
1049 m_padNetLabel->Enable( hasConnection && m_canEditNetName && m_currentPad );
1050 m_padNetSelector->Enable( hasConnection && m_canEditNetName && m_currentPad );
1051 }
1052
1053 // Enable/disable pad length-to-die
1054 m_padToDieOpt->Enable( hasConnection );
1055
1056 if( !m_padToDieOpt->IsEnabled() )
1057 m_padToDieOpt->SetValue( false );
1058
1059 // We can show/hide this here because it doesn't require the layout to be refreshed.
1060 // All the others have to be done in their event handlers because doing a layout here
1061 // causes infinite looping on MSW.
1062 m_padToDie.Show( m_padToDieOpt->GetValue() );
1063
1064 // Enable/disable Copper Layers control
1065 m_rbCopperLayersSel->Enable( m_padType->GetSelection() != APERTURE_DLG_TYPE );
1066
1068
1069 switch( m_padType->GetSelection() )
1070 {
1071 case PTH_DLG_TYPE:
1072 if( !cu_set.any() )
1073 m_stackupImagesBook->SetSelection( 3 );
1074 else if( !m_dummyPad->GetRemoveUnconnected() )
1075 m_stackupImagesBook->SetSelection( 0 );
1076 else if( m_dummyPad->GetKeepTopBottom() )
1077 m_stackupImagesBook->SetSelection( 1 );
1078 else
1079 m_stackupImagesBook->SetSelection( 2 );
1080
1081 break;
1082
1083 case NPTH_DLG_TYPE:
1084 if( cu_set.test( F_Cu ) && cu_set.test( B_Cu ) )
1085 m_stackupImagesBook->SetSelection( 4 );
1086 else if( cu_set.test( F_Cu ) )
1087 m_stackupImagesBook->SetSelection( 5 );
1088 else if( cu_set.test( B_Cu ) )
1089 m_stackupImagesBook->SetSelection( 6 );
1090 else
1091 m_stackupImagesBook->SetSelection( 7 );
1092
1093 break;
1094
1095 case SMD_DLG_TYPE:
1096 case CONN_DLG_TYPE:
1097 case APERTURE_DLG_TYPE:
1098 m_stackupImagesBook->ChangeSelection( 3 );
1099 break;
1100 }
1101}
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:530
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:773
void Show(bool aShow, bool aResize=false)
Show/hide the label, widget and units label.
@ B_Cu
Definition: layer_ids.h:95

References LSET::AllCuMask(), APERTURE_DLG_TYPE, B_Cu, CHOICE_SHAPE_OVAL, CONN_DLG_TYPE, UNIT_BINDER::Enable(), F_Cu, PAD::GetKeepTopBottom(), PAD::GetLayerSet(), PAD::GetRemoveUnconnected(), m_canEditNetName, m_currentPad, m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_holeShapeCtrl, DIALOG_PAD_PROPERTIES_BASE::m_holeShapeLabel, m_holeX, m_holeY, DIALOG_PAD_PROPERTIES_BASE::m_padNetLabel, DIALOG_PAD_PROPERTIES_BASE::m_padNetSelector, DIALOG_PAD_PROPERTIES_BASE::m_padNumCtrl, DIALOG_PAD_PROPERTIES_BASE::m_padNumLabel, m_padToDie, DIALOG_PAD_PROPERTIES_BASE::m_padToDieOpt, DIALOG_PAD_PROPERTIES_BASE::m_padType, DIALOG_PAD_PROPERTIES_BASE::m_rbCopperLayersSel, DIALOG_PAD_PROPERTIES_BASE::m_stackupImagesBook, NPTH_DLG_TYPE, PTH_DLG_TYPE, UNIT_BINDER::Show(), and SMD_DLG_TYPE.

Referenced by DIALOG_PAD_PROPERTIES().

◆ OnUpdateUINonCopperWarning()

void DIALOG_PAD_PROPERTIES::OnUpdateUINonCopperWarning ( wxUpdateUIEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 1104 of file dialog_pad_properties.cpp.

1105{
1106 bool isOnCopperLayer = ( m_dummyPad->GetLayerSet() & LSET::AllCuMask() ).any();
1107 m_nonCopperWarningBook->ChangeSelection( isOnCopperLayer ? 0 : 1 );
1108}

References LSET::AllCuMask(), PAD::GetLayerSet(), m_dummyPad, and DIALOG_PAD_PROPERTIES_BASE::m_nonCopperWarningBook.

◆ OnValuesChanged()

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 2060 of file dialog_pad_properties.cpp.

2061{
2062 if( m_canUpdate )
2063 {
2065 return;
2066
2067 // If the pad size has changed, update the displayed values for rounded rect pads.
2069
2070 redraw();
2071 }
2072}

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

Referenced by DIALOG_PAD_PROPERTIES(), OnOffsetCheckbox(), OnPadToDieCheckbox(), and ~DIALOG_PAD_PROPERTIES().

◆ PadOrientEvent()

void DIALOG_PAD_PROPERTIES::PadOrientEvent ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 923 of file dialog_pad_properties.cpp.

924{
926 redraw();
927}

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

◆ PadTypeSelected()

void DIALOG_PAD_PROPERTIES::PadTypeSelected ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAD_PROPERTIES_BASE.

Definition at line 967 of file dialog_pad_properties.cpp.

968{
969 bool hasHole = true;
970 bool hasConnection = true;
971 bool hasProperty = true;
972
973 switch( m_padType->GetSelection() )
974 {
975 case PTH_DLG_TYPE: hasHole = true; hasConnection = true; hasProperty = true; break;
976 case SMD_DLG_TYPE: hasHole = false; hasConnection = true; hasProperty = true; break;
977 case CONN_DLG_TYPE: hasHole = false; hasConnection = true; hasProperty = true; break;
978 case NPTH_DLG_TYPE: hasHole = true; hasConnection = false; hasProperty = false; break;
979 case APERTURE_DLG_TYPE: hasHole = false; hasConnection = false; hasProperty = true; break;
980 }
981
982 // Update Layers dropdown list and selects the "best" layer set for the new pad type:
984
985 m_gbSizerHole->Show( hasHole );
986 m_staticline6->Show( hasHole );
987 if( !hasHole )
988 {
989 m_holeX.ChangeValue( 0 );
990 m_holeY.ChangeValue( 0 );
991 }
992 else if ( m_holeX.GetValue() == 0 && m_currentPad )
993 {
996 }
997
998 if( !hasConnection )
999 {
1000 m_padNumCtrl->ChangeValue( wxEmptyString );
1002 m_padToDieOpt->SetValue( false );
1003 }
1004 else if( m_padNumCtrl->GetValue().IsEmpty() && m_currentPad )
1005 {
1006 m_padNumCtrl->ChangeValue( m_currentPad->GetNumber() );
1008 }
1009
1010 if( !hasProperty )
1011 m_choiceFabProperty->SetSelection( 0 );
1012
1013 m_choiceFabProperty->Enable( hasProperty );
1014
1016
1017 // Layout adjustment is needed if the hole details got shown/hidden
1018 m_LeftBoxSizer->Layout();
1019 redraw();
1020}

References APERTURE_DLG_TYPE, UNIT_BINDER::ChangeValue(), CONN_DLG_TYPE, PAD::GetDrillSize(), PAD::GetKeepTopBottom(), BOARD_CONNECTED_ITEM::GetNetCode(), PAD::GetNumber(), PAD::GetRemoveUnconnected(), UNIT_BINDER::GetValue(), DIALOG_PAD_PROPERTIES_BASE::m_choiceFabProperty, m_currentPad, m_dummyPad, DIALOG_PAD_PROPERTIES_BASE::m_gbSizerHole, m_holeX, m_holeY, DIALOG_PAD_PROPERTIES_BASE::m_LeftBoxSizer, DIALOG_PAD_PROPERTIES_BASE::m_padNetSelector, DIALOG_PAD_PROPERTIES_BASE::m_padNumCtrl, DIALOG_PAD_PROPERTIES_BASE::m_padToDieOpt, DIALOG_PAD_PROPERTIES_BASE::m_padType, DIALOG_PAD_PROPERTIES_BASE::m_staticline6, NPTH_DLG_TYPE, PTH_DLG_TYPE, redraw(), NET_SELECTOR::SetSelectedNetcode(), SMD_DLG_TYPE, transferDataToPad(), updatePadLayersList(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ padValuesOK()

bool DIALOG_PAD_PROPERTIES::padValuesOK ( )
private

test if all values are acceptable for the pad

Definition at line 1235 of file dialog_pad_properties.cpp.

1236{
1237 bool error = !transferDataToPad( m_dummyPad );
1238
1239 wxArrayString error_msgs;
1240 wxArrayString warning_msgs;
1241 VECTOR2I pad_size = m_dummyPad->GetSize();
1242 VECTOR2I drill_size = m_dummyPad->GetDrillSize();
1243
1245 {
1246 // allow 0-sized anchor pads
1247 }
1248 else if( m_dummyPad->GetShape() == PAD_SHAPE::CIRCLE )
1249 {
1250 if( pad_size.x <= 0 )
1251 error_msgs.Add( _( "Error: Pad must have a positive size." ) );
1252 }
1253 else
1254 {
1255 if( pad_size.x <= 0 || pad_size.y <= 0 )
1256 error_msgs.Add( _( "Error: Pad must have a positive size." ) );
1257 }
1258
1259 // Test hole against pad shape
1261 {
1262 int maxError = m_board->GetDesignSettings().m_MaxError;
1263 SHAPE_POLY_SET padOutline;
1264
1265 m_dummyPad->TransformShapeToPolygon( padOutline, UNDEFINED_LAYER, 0, maxError,
1266 ERROR_INSIDE );
1267
1268 if( !padOutline.Collide( m_dummyPad->GetPosition() ) )
1269 {
1270 warning_msgs.Add( _( "Warning: Pad hole not inside pad shape." ) );
1271 }
1272 else if( m_dummyPad->GetAttribute() == PAD_ATTRIB::PTH )
1273 {
1274 std::shared_ptr<SHAPE_SEGMENT> slot = m_dummyPad->GetEffectiveHoleShape();
1275 SHAPE_POLY_SET slotOutline;
1276
1277 TransformOvalToPolygon( slotOutline, slot->GetSeg().A, slot->GetSeg().B,
1278 slot->GetWidth(), maxError, ERROR_INSIDE );
1279
1280 padOutline.BooleanSubtract( slotOutline, SHAPE_POLY_SET::PM_FAST );
1281
1282 if( padOutline.IsEmpty() )
1283 warning_msgs.Add( _( "Warning: Pad hole will leave no copper." ) );
1284 }
1285 }
1286
1287 if( m_dummyPad->GetLocalClearance() < 0 )
1288 warning_msgs.Add( _( "Warning: Negative local clearance values will have no effect." ) );
1289
1290 // Some pads need a negative solder mask clearance (mainly for BGA with small pads)
1291 // However the negative solder mask clearance must not create negative mask size
1292 // Therefore test for minimal acceptable negative value
1294 {
1295 int absMargin = abs( m_dummyPad->GetLocalSolderMaskMargin() );
1296
1298 {
1299 for( const std::shared_ptr<PCB_SHAPE>& shape : m_dummyPad->GetPrimitives() )
1300 {
1301 BOX2I shapeBBox = shape->GetBoundingBox();
1302
1303 if( absMargin > shapeBBox.GetWidth() || absMargin > shapeBBox.GetHeight() )
1304 {
1305 warning_msgs.Add( _( "Warning: Negative solder mask clearances larger than "
1306 "some shape primitives. Results may be surprising." ) );
1307
1308 break;
1309 }
1310 }
1311 }
1312 else if( absMargin > pad_size.x || absMargin > pad_size.y )
1313 {
1314 warning_msgs.Add( _( "Warning: Negative solder mask clearance larger than pad. No "
1315 "solder mask will be generated." ) );
1316 }
1317 }
1318
1319 // Some pads need a positive solder paste clearance (mainly for BGA with small pads)
1320 // However, a positive value can create issues if the resulting shape is too big.
1321 // (like a solder paste creating a solder paste area on a neighbor pad or on the solder mask)
1322 // So we could ask for user to confirm the choice
1323 // For now we just check for disappearing paste
1324 wxSize paste_size;
1325 int paste_margin = m_dummyPad->GetLocalSolderPasteMargin();
1326 double paste_ratio = m_dummyPad->GetLocalSolderPasteMarginRatio();
1327
1328 paste_size.x = pad_size.x + paste_margin + KiROUND( pad_size.x * paste_ratio );
1329 paste_size.y = pad_size.y + paste_margin + KiROUND( pad_size.y * paste_ratio );
1330
1331 if( paste_size.x <= 0 || paste_size.y <= 0 )
1332 {
1333 warning_msgs.Add( _( "Warning: Negative solder paste margins larger than pad. No solder "
1334 "paste mask will be generated." ) );
1335 }
1336
1337 LSET padlayers_mask = m_dummyPad->GetLayerSet();
1338
1339 if( padlayers_mask == 0 )
1340 error_msgs.Add( _( "Error: pad has no layer." ) );
1341
1342 if( !padlayers_mask[F_Cu] && !padlayers_mask[B_Cu] )
1343 {
1344 if( ( drill_size.x || drill_size.y ) && m_dummyPad->GetAttribute() != PAD_ATTRIB::NPTH )
1345 {
1346 warning_msgs.Add( _( "Warning: Plated through holes should normally have a copper pad "
1347 "on at least one layer." ) );
1348 }
1349 }
1350
1351 if( error )
1352 error_msgs.Add( _( "Error: Trapazoid delta is too large." ) );
1353
1354 switch( m_dummyPad->GetAttribute() )
1355 {
1356 case PAD_ATTRIB::NPTH: // Not plated, but through hole, a hole is expected
1357 case PAD_ATTRIB::PTH: // Pad through hole, a hole is also expected
1358 if( drill_size.x <= 0
1359 || ( drill_size.y <= 0 && m_dummyPad->GetDrillShape() == PAD_DRILL_SHAPE_OBLONG ) )
1360 {
1361 error_msgs.Add( _( "Error: Through hole pad has no hole." ) );
1362 }
1363 break;
1364
1365 case PAD_ATTRIB::CONN: // Connector pads are smd pads, just they do not have solder paste.
1366 if( padlayers_mask[B_Paste] || padlayers_mask[F_Paste] )
1367 {
1368 warning_msgs.Add( _( "Warning: Connector pads normally have no solder paste. Use a "
1369 "SMD pad instead." ) );
1370 }
1372
1373 case PAD_ATTRIB::SMD: // SMD and Connector pads (One external copper layer only)
1374 {
1375 if( drill_size.x > 0 || drill_size.y > 0 )
1376 {
1377 error_msgs.Add( _( "Error: SMD pad has a hole." ) );
1378 }
1379
1380 LSET innerlayers_mask = padlayers_mask & LSET::InternalCuMask();
1381
1382 if( ( padlayers_mask[F_Cu] && padlayers_mask[B_Cu] ) || innerlayers_mask.count() != 0 )
1383 warning_msgs.Add( _( "Warning: SMD pad has no outer layers." ) );
1384 }
1385 break;
1386 }
1387
1391 {
1392 warning_msgs.Add( _( "Warning: Fiducial property makes no sense on NPTH pads." ) );
1393 }
1394
1397 {
1398 warning_msgs.Add( _( "Warning: Testpoint property makes no sense on NPTH pads." ) );
1399 }
1400
1403 {
1404 warning_msgs.Add( _( "Warning: Heatsink property makes no sense of NPTH pads." ) );
1405 }
1406
1409 {
1410 warning_msgs.Add( _( "Warning: Castellated property is for PTH pads." ) );
1411 }
1412
1415 {
1416 warning_msgs.Add( _( "Warning: BGA property is for SMD pads." ) );
1417 }
1418
1421 {
1423
1424 if( m_cornerRatio.GetDoubleValue() < 0.0 )
1425 error_msgs.Add( _( "Error: Negative corner size." ) );
1426 else if( m_cornerRatio.GetDoubleValue() > 50.0 )
1427 warning_msgs.Add( _( "Warning: Corner size will make pad circular." ) );
1428 }
1429
1430 // PADSTACKS TODO: this will need to check each layer in the pad...
1432 {
1433 SHAPE_POLY_SET mergedPolygon;
1434 m_dummyPad->MergePrimitivesAsPolygon( &mergedPolygon );
1435
1436 if( mergedPolygon.OutlineCount() > 1 )
1437 error_msgs.Add( _( "Error: Custom pad shape must resolve to a single polygon." ) );
1438 }
1439
1440
1441 if( error_msgs.GetCount() || warning_msgs.GetCount() )
1442 {
1443 wxString title = error_msgs.GetCount() ? _( "Pad Properties Errors" )
1444 : _( "Pad Properties Warnings" );
1445 HTML_MESSAGE_BOX dlg( this, title );
1446
1447 wxArrayString msgs = error_msgs;
1448
1449 for( const wxString& msg : warning_msgs )
1450 msgs.Add( msg );
1451
1452 dlg.ListSet( msgs );
1453
1454 dlg.ShowModal();
1455 }
1456
1457 return error_msgs.GetCount() == 0;
1458}
coord_type GetHeight() const
Definition: box2.h:188
coord_type GetWidth() const
Definition: box2.h:187
static LSET InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
Definition: lset.cpp:733
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aMaxError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the pad shape to a closed polygon.
Definition: pad.cpp:1601
void MergePrimitivesAsPolygon(SHAPE_POLY_SET *aMergedPolygon, ERROR_LOC aErrorLoc=ERROR_INSIDE) const
Merge all basic shapes to a SHAPE_POLY_SET.
bool IsOnCopperLayer() const override
Definition: pad.h:242
std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const override
Return a SHAPE_SEGMENT object representing the pad's hole.
Definition: pad.cpp:422
Represent a set of closed polygons.
void BooleanSubtract(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Perform boolean polyset intersection For aFastMode meaning, see function booleanOp.
bool IsEmpty() const
bool Collide(const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if the boundary of shape (this) lies closer to the shape aShape than aClearance,...
int OutlineCount() const
Return the number of vertices in a given outline/hole.
virtual double GetDoubleValue()
Return the current value in Internal Units.
void TransformOvalToPolygon(SHAPE_POLY_SET &aBuffer, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, int aError, ERROR_LOC aErrorLoc, int aMinSegCount=0)
Convert a oblong shape to a polygon, using multiple segments.
@ ERROR_INSIDE
@ UNDEFINED_LAYER
Definition: layer_ids.h:60
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:83
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition: eda_angle.h:401
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:85

References _, std::abs(), B_Cu, B_Paste, BGA, SHAPE_POLY_SET::BooleanSubtract(), CASTELLATED, CHAMFERED_RECT, CIRCLE, SHAPE_POLY_SET::Collide(), CONN, CUSTOM, ERROR_INSIDE, F_Cu, F_Paste, FIDUCIAL_GLBL, FIDUCIAL_LOCAL, PAD::GetAttribute(), BOARD::GetDesignSettings(), UNIT_BINDER::GetDoubleValue(), PAD::GetDrillShape(), PAD::GetDrillSize(), PAD::GetEffectiveHoleShape(), BOX2< Vec >::GetHeight(), PAD::GetLayerSet(), PAD::GetLocalClearance(), PAD::GetLocalSolderMaskMargin(), PAD::GetLocalSolderPasteMargin(), PAD::GetLocalSolderPasteMarginRatio(), PAD::GetPosition(), PAD::GetPrimitives(), PAD::GetProperty(), PAD::GetShape(), PAD::GetSize(), BOX2< Vec >::GetWidth(), HEATSINK, LSET::InternalCuMask(), SHAPE_POLY_SET::IsEmpty(), PAD::IsOnCopperLayer(), KI_FALLTHROUGH, KiROUND(), HTML_MESSAGE_BOX::ListSet(), m_board, m_cornerRatio, m_dummyPad, BOARD_DESIGN_SETTINGS::m_MaxError, m_mixedCornerRatio, PAD::MergePrimitivesAsPolygon(), NPTH, SHAPE_POLY_SET::OutlineCount(), PAD_DRILL_SHAPE_OBLONG, SHAPE_POLY_SET::PM_FAST, PTH, ROUNDRECT, SMD, TESTPOINT, transferDataToPad(), TransformOvalToPolygon(), PAD::TransformShapeToPolygon(), UNDEFINED_LAYER, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by TransferDataFromWindow().

◆ prepareCanvas()

void DIALOG_PAD_PROPERTIES::prepareCanvas ( )
private

Definition at line 303 of file dialog_pad_properties.cpp.

304{
305 // Initialize the canvas to display the pad
306 m_padPreviewGAL = new PCB_DRAW_PANEL_GAL( m_boardViewPanel, -1, wxDefaultPosition,
307 wxDefaultSize,
310
311 m_padPreviewSizer->Add( m_padPreviewGAL, 12, wxEXPAND | wxALL, 5 );
312
313 // Show the X and Y axis. It is useful because pad shape can have an offset
314 // or be a complex shape.
315 KIGFX::COLOR4D axis_color = LIGHTBLUE;
316
318 pcbIUScale.mmToIU( 0.2 ),
321
324 m_padPreviewGAL->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER );
325
326 KIGFX::VIEW_CONTROLS* parentViewControls = m_parent->GetCanvas()->GetViewControls();
327 m_padPreviewGAL->GetViewControls()->ApplySettings( parentViewControls->GetSettings() );
328
329 m_padPreviewGAL->Show();
330
332
333 // fix the pad render mode (filled/not filled)
334 auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
335
336 settings->m_ForcePadSketchModeOn = m_cbShowPadOutline->IsChecked();
337 settings->SetHighContrast( false );
338 settings->m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL;
339
340 // gives a non null grid size (0.001mm) because GAL layer does not like a 0 size grid:
341 double gridsize = 0.001 * pcbIUScale.IU_PER_MM;
342 view->GetGAL()->SetGridSize( VECTOR2D( gridsize, gridsize ) );
343
344 // And do not show the grid:
345 view->GetGAL()->SetGridVisibility( false );
346 view->Add( m_dummyPad );
347 view->Add( m_axisOrigin );
348
350 Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_PAD_PROPERTIES::OnResize ) );
351}
void OnResize(wxSizeEvent &event)
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
GAL_TYPE GetBackend() const
Return the type of backend currently used by GAL canvas.
KIGFX::VIEW_CONTROLS * GetViewControls() const
Return a pointer to the #VIEW_CONTROLS instance used in the panel.
void StartDrawing()
Begin drawing if it was stopped previously.
void SetStealsFocus(bool aStealsFocus)
Set whether focus is taken on certain events (mouseover, keys, etc).
void SetGridSize(const VECTOR2D &aGridSize)
Set the grid size.
void SetGridVisibility(bool aVisibility)
Set the visibility setting of the grid.
void SetDrawAtZero(bool aDrawFlag)
Set the draw at zero flag.
An interface for classes handling user events controlling the view behavior such as zooming,...
void ApplySettings(const VC_SETTINGS &aSettings)
Load new settings from program common settings.
const VC_SETTINGS & GetSettings() const
Apply VIEW_CONTROLS settings from an object.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition: view.cpp:316
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
Definition: view.h:195
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void UpdateColors()
Update the color settings in the painter and GAL.
@ LIGHTBLUE
Definition: color4d.h:62
const double IU_PER_MM
Definition: base_units.h:77
constexpr int mmToIU(double mm) const
Definition: base_units.h:89
VECTOR2< double > VECTOR2D
Definition: vector2d.h:617

References KIGFX::VIEW::Add(), KIGFX::VIEW_CONTROLS::ApplySettings(), KIGFX::ORIGIN_VIEWITEM::CROSS, EDA_DRAW_PANEL_GAL::GetBackend(), PCB_BASE_FRAME::GetCanvas(), KIGFX::VIEW::GetGAL(), EDA_DRAW_FRAME::GetGalDisplayOptions(), KIGFX::VIEW::GetPainter(), PAD::GetPosition(), KIGFX::VIEW_CONTROLS::GetSettings(), KIGFX::PAINTER::GetSettings(), PCB_DRAW_PANEL_GAL::GetView(), EDA_DRAW_PANEL_GAL::GetViewControls(), EDA_IU_SCALE::IU_PER_MM, LIGHTBLUE, m_axisOrigin, DIALOG_PAD_PROPERTIES_BASE::m_boardViewPanel, DIALOG_PAD_PROPERTIES_BASE::m_cbShowPadOutline, m_dummyPad, KIGFX::PCB_RENDER_SETTINGS::m_ForcePadSketchModeOn, m_padPreviewGAL, DIALOG_PAD_PROPERTIES_BASE::m_padPreviewSizer, m_parent, EDA_IU_SCALE::mmToIU(), NORMAL, OnResize(), pcbIUScale, KIGFX::ORIGIN_VIEWITEM::SetDrawAtZero(), KIGFX::GAL::SetGridSize(), KIGFX::GAL::SetGridVisibility(), EDA_DRAW_PANEL_GAL::SetStealsFocus(), EDA_DRAW_PANEL_GAL::StartDrawing(), and PCB_DRAW_PANEL_GAL::UpdateColors().

Referenced by DIALOG_PAD_PROPERTIES().

◆ Prj()

PROJECT & KIWAY_HOLDER::Prj ( ) const
inherited

Return a reference to the PROJECT associated with this KIWAY.

Definition at line 36 of file kiway_holder.cpp.

37{
38 return Kiway().Prj();
39}
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
Definition: kiway.cpp:192

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

Referenced by SYMBOL_TREE_MODEL_ADAPTER::AddLibraries(), FP_TREE_MODEL_ADAPTER::AddLibraries(), SYMBOL_LIBRARY_MANAGER::addLibrary(), PCB_BASE_EDIT_FRAME::AddLibrary(), SYMBOL_EDIT_FRAME::addLibTableEntry(), SCH_EDIT_FRAME::AppendSchematic(), AskSaveBoardFileName(), DIALOG_SYMBOL_REMAP::backupProject(), CVPCB_MAINFRAME::buildEquivalenceList(), CVPCB_MAINFRAME::BuildLibrariesListBox(), FOOTPRINT_EDIT_FRAME::buildSaveAsDialog(), SYMBOL_EDIT_FRAME::buildSaveAsDialog(), PCB_BASE_FRAME::canCloseWindow(), SIM_PLOT_FRAME::canCloseWindow(), PANEL_FP_PROPERTIES_3D_MODEL::Cfg3DPath(), SYMBOL_VIEWER_FRAME::ClickOnLibList(), KICAD_MANAGER_FRAME::CloseProject(), PCB_BASE_EDIT_FRAME::createNewLibrary(), PCB_BASE_EDIT_FRAME::CreateNewProjectLibrary(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), SCH_EDIT_FRAME::CreateScreens(), FOOTPRINT_EDIT_FRAME::DeleteFootprintFromLibrary(), DIALOG_ANNOTATE::DIALOG_ANNOTATE(), DIALOG_ASSIGN_NETCLASS::DIALOG_ASSIGN_NETCLASS(), DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE(), DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP(), DIALOG_BOARD_STATISTICS::DIALOG_BOARD_STATISTICS(), DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CHOOSE_SYMBOL::DIALOG_CHOOSE_SYMBOL(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS(), DIALOG_EXPORT_SVG::DIALOG_EXPORT_SVG(), DIALOG_GEN_FOOTPRINT_POSITION::DIALOG_GEN_FOOTPRINT_POSITION(), DIALOG_IBIS_PARSER_REPORTER::DIALOG_IBIS_PARSER_REPORTER(), DIALOG_IMPORT_NETLIST::DIALOG_IMPORT_NETLIST(), DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_PLOT::DIALOG_PLOT(), DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC(), DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP(), DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE(), DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP(), DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB(), DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB(), PL_DRAW_PANEL_GAL::DisplayDrawingSheet(), FOOTPRINT_PREVIEW_PANEL::DisplayFootprint(), SYMBOL_VIEWER_FRAME::DisplayLibInfos(), CVPCB_MAINFRAME::DisplayStatus(), SCH_EDIT_FRAME::doAutoSave(), PCB_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::doCloseWindow(), FOOTPRINT_EDIT_FRAME::doCloseWindow(), PCB_BASE_EDIT_FRAME::doCloseWindow(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), FIELDS_GRID_TRICKS::doPopupSelection(), FOOTPRINT_EDIT_FRAME::DuplicateFootprint(), KICAD_MANAGER_CONTROL::Execute(), PCB_EDIT_FRAME::Export_IDF3(), PCB_EDIT_FRAME::ExportFootprintsToLibrary(), BOARD_EDITOR_CONTROL::ExportNetlist(), SYMBOL_EDITOR_CONTROL::ExportSymbolAsSVG(), SYMBOL_EDITOR_CONTROL::ExportView(), PCB_EDIT_FRAME::ExportVRML_File(), BACK_ANNOTATE::FetchNetlistFromPCB(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::GenD356File(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), SYMBOL_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), SIM_PLOT_FRAME::getDefaultFilename(), SIM_PLOT_FRAME::getDefaultPath(), PCB_BASE_EDIT_FRAME::GetDesignRulesPath(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), PCB_EDIT_FRAME::GetLastPath(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), SCH_BASE_FRAME::GetLibSymbol(), DIALOG_PLOT_SCHEMATIC::getOutputPath(), KICAD_MANAGER_FRAME::GetProjectFileName(), SCH_EDIT_FRAME::GetSchematicJunctionSize(), SYMBOL_VIEWER_FRAME::GetSelectedSymbol(), SCH_NAVIGATE_TOOL::HypertextCommand(), SCH_EDIT_FRAME::importFile(), SCH_EDITOR_CONTROL::ImportFPAssignments(), DIALOG_CONFIG_EQUFILES::Init(), FIELDS_GRID_TABLE< T >::initGrid(), FOOTPRINT_EDIT_FRAME::initLibraryTree(), SYMBOL_EDIT_FRAME::KiwayMailIn(), FOOTPRINT_EDIT_FRAME::KiwayMailIn(), EDA_DRAW_FRAME::LibraryFileBrowser(), SYMBOL_VIEWER_FRAME::loadAllLibraries(), PCB_BASE_FRAME::loadFootprint(), CVPCB_MAINFRAME::LoadFootprintFiles(), PCB_EDIT_FRAME::LoadFootprints(), SCH_EDIT_FRAME::LoadProject(), KICAD_MANAGER_FRAME::LoadProject(), SCH_EDIT_FRAME::LoadProjectSettings(), PCB_EDIT_FRAME::LoadProjectSettings(), SIM_PLOT_FRAME::LoadSettings(), SCH_EDIT_FRAME::LoadSheetFromFile(), SYMBOL_EDIT_FRAME::LoadSymbol(), SYMBOL_EDIT_FRAME::LoadSymbolFromCurrentLib(), EDA_BASE_FRAME::LoadWindowState(), SIM_PLOT_FRAME::loadWorkbook(), SIM_PLOT_FRAME::menuSaveWorkbook(), SIM_PLOT_FRAME::menuSaveWorkbookAs(), PANEL_FP_PROPERTIES_3D_MODEL::On3DModelCellChanged(), FOOTPRINT_VIEWER_FRAME::OnActivate(), PANEL_FP_PROPERTIES_3D_MODEL::OnAdd3DModel(), DIALOG_BOARD_SETUP::onAuxiliaryAction(), PCB_EDIT_FRAME::onBoardLoaded(), KICAD_MANAGER_FRAME::OnBrowseInFileExplorer(), DIALOG_IMPORT_NETLIST::onBrowseNetlistFiles(), WX_HTML_REPORT_PANEL::onBtnSaveToFile(), TEXT_BUTTON_URL::OnButtonClick(), TEXT_BUTTON_FILE_BROWSER::OnButtonClick(), DIALOG_EDIT_SYMBOLS_LIBID::onClickOrphansButton(), DIALOG_SYMBOL_FIELDS_TABLE::OnExport(), DIALOG_GENDRILL::OnGenReportFile(), KICAD_MANAGER_FRAME::OnIdle(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_CHOOSE_SYMBOL::OnInitDialog(), DIALOG_CONFIG_EQUFILES::OnOkClick(), SCH_EDIT_FRAME::OnOpenCvpcb(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), SCH_EDIT_FRAME::OnOpenPcbnew(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), DIALOG_EXPORT_SVG::OnOutputDirectoryBrowseClicked(), DIALOG_GEN_FOOTPRINT_POSITION::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_SCHEMATIC_SETUP::onPageChanged(), DIALOG_BOARD_SETUP::onPageChanged(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng(), DIALOG_ERC::OnSaveReport(), DIALOG_DRC::OnSaveReport(), DIALOG_SCH_FIELD_PROPERTIES::onScintillaCharAdded(), DIALOG_TEXT_PROPERTIES::onScintillaCharAdded(), PROPERTIES_FRAME::onScintillaCharAdded(), SYMBOL_VIEWER_FRAME::OnSelectSymbol(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), SCH_EDIT_FRAME::OnUpdatePCB(), DIALOG_PAGES_SETTINGS::OnWksFileSelection(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), PANEL_FP_PROPERTIES_3D_MODEL::PANEL_FP_PROPERTIES_3D_MODEL(), PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL(), SCH_EDITOR_CONTROL::Paste(), FOOTPRINT_EDITOR_CONTROL::PasteFootprint(), SCH_BASE_FRAME::PickSymbolFromLibTree(), SYMBOL_EDITOR_CONTROL::PinLibrary(), FOOTPRINT_EDITOR_CONTROL::PinLibrary(), LIB_TREE_MODEL_ADAPTER::PinLibrary(), DIALOG_CHOOSE_SYMBOL::PopulateFootprintSelector(), SCH_EDITOR_CONTROL::Print(), EDA_DRAW_FRAME::PrintDrawingSheet(), SCH_EDIT_FRAME::PrintPage(), KICAD_MANAGER_FRAME::PrintPrjInfo(), CVPCB_MAINFRAME::readNetListAndFpFiles(), APPEARANCE_CONTROLS::rebuildNets(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), SYMBOL_VIEWER_FRAME::ReCreateLibList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), SYMBOL_VIEWER_FRAME::ReCreateSymbolList(), PANEL_FP_PROPERTIES_3D_MODEL::ReloadModelsFromFootprint(), EDA_3D_VIEWER_FRAME::ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), FOOTPRINT_EDITOR_CONTROL::RenameFootprint(), SYMBOL_EDIT_FRAME::replaceLibTableEntry(), SCH_EDITOR_CONTROL::RescueLegacyProject(), SCH_EDITOR_CONTROL::RescueSymbolLibTableProject(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), PCB_EDIT_FRAME::RunEeschema(), FOOTPRINT_EDITOR_CONTROL::SaveAs(), FOOTPRINT_EDIT_FRAME::SaveFootprint(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), SYMBOL_EDIT_FRAME::saveLibrary(), PCB_EDIT_FRAME::SavePcbFile(), SCH_EDIT_FRAME::SaveProject(), SCH_EDIT_FRAME::SaveProjectSettings(), PCB_EDIT_FRAME::SaveProjectSettings(), DIALOG_BOARD_STATISTICS::saveReportClicked(), SCH_EDIT_FRAME::saveSchematicFile(), EDA_BASE_FRAME::SaveSettings(), SIM_PLOT_FRAME::SaveSettings(), SCH_BASE_FRAME::saveSymbolLibTables(), SIM_PLOT_FRAME::saveWorkbook(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), PCB_BASE_FRAME::SelectFootprintFromLibTree(), PCB_BASE_FRAME::SelectLibrary(), SCH_BASE_FRAME::SelectLibraryFromList(), PCB_BASE_EDIT_FRAME::selectLibTable(), SCH_BASE_FRAME::SelectSymLibTable(), PCB_EDIT_FRAME::SetBoard(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), SYMBOL_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), SYMBOL_EDIT_FRAME::SetCurSymbol(), PCB_EDIT_FRAME::SetLastPath(), GERBVIEW_FRAME::SetPageSettings(), EE_INSPECTION_TOOL::ShowDatasheet(), DIALOG_CHOOSE_SYMBOL::ShowFootprintFor(), COMMON_CONTROL::ShowHelp(), FOOTPRINT_VIEWER_FRAME::ShowModal(), SYMBOL_VIEWER_FRAME::ShowModal(), APPEARANCE_CONTROLS::showNetclass(), SYMBOL_LIBRARY_MANAGER::symTable(), FP_TREE_SYNCHRONIZING_ADAPTER::Sync(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync(), FOOTPRINT_EDIT_FRAME::SyncLibraryTree(), EDA_3D_VIEWER_FRAME::takeScreenshot(), PCB_EDIT_FRAME::TestStandalone(), DIALOG_EDIT_SYMBOLS_LIBID::TransferDataFromWindow(), DIALOG_EXPORT_NETLIST::TransferDataFromWindow(), DIALOG_SHEET_PROPERTIES::TransferDataFromWindow(), DIALOG_ASSIGN_NETCLASS::TransferDataFromWindow(), PANEL_SETUP_RULES::TransferDataFromWindow(), PANEL_SETUP_RULES::TransferDataToWindow(), SYMBOL_EDITOR_CONTROL::UnpinLibrary(), FOOTPRINT_EDITOR_CONTROL::UnpinLibrary(), LIB_TREE_MODEL_ADAPTER::UnpinLibrary(), SCH_EDIT_FRAME::updateAutoSaveFile(), DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample(), SCH_EDIT_FRAME::updateTitle(), SIM_PLOT_FRAME::updateTitle(), FOOTPRINT_EDIT_FRAME::UpdateTitle(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), SIM_PLOT_FRAME::UpdateTunerValue(), PANEL_FP_PROPERTIES_3D_MODEL::validateModelExists(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_FOOTPRINT_PROPERTIES::~DIALOG_FOOTPRINT_PROPERTIES(), EDA_3D_VIEWER_FRAME::~EDA_3D_VIEWER_FRAME(), PANEL_FP_PROPERTIES_3D_MODEL::~PANEL_FP_PROPERTIES_3D_MODEL(), and SCH_EDIT_FRAME::~SCH_EDIT_FRAME().

◆ redraw()

void DIALOG_PAD_PROPERTIES::redraw ( )
private

Definition at line 1461 of file dialog_pad_properties.cpp.

1462{
1463 if( !m_canUpdate )
1464 return;
1465
1468
1469 // The layer used to place primitive items selected when editing custom pad shapes
1470 // we use here a layer never used in a pad:
1471 #define SELECTED_ITEMS_LAYER Dwgs_User
1472
1474 KIGFX::PCB_RENDER_SETTINGS* settings =
1475 static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
1477
1478 view->Update( m_dummyPad );
1479
1480 // delete previous items if highlight list
1481 while( m_highlight.size() )
1482 {
1483 delete m_highlight.back(); // the dtor also removes item from view
1484 m_highlight.pop_back();
1485 }
1486
1487 // highlight selected primitives:
1488 long select = m_listCtrlPrimitives->GetFirstSelected();
1489
1490 while( select >= 0 )
1491 {
1492 PCB_SHAPE* dummyShape = static_cast<PCB_SHAPE*>( m_primitives[select]->Clone() );
1493 dummyShape->SetLayer( SELECTED_ITEMS_LAYER );
1494 dummyShape->Rotate( VECTOR2I( 0, 0), m_dummyPad->GetOrientation() );
1495 dummyShape->Move( m_dummyPad->GetPosition() );
1496
1497 view->Add( dummyShape );
1498 m_highlight.push_back( dummyShape );
1499
1500 select = m_listCtrlPrimitives->GetNextSelected( select );
1501 }
1502
1503 BOX2I bbox = m_dummyPad->ViewBBox();
1504
1505 if( bbox.GetSize().x > 0 && bbox.GetSize().y > 0 )
1506 {
1507 // The origin always goes in the middle of the canvas; we want offsetting the pad
1508 // shape to move the pad, not the hole
1509 bbox.Move( -m_dummyPad->GetPosition() );
1510 int maxXExtent = std::max( abs( bbox.GetLeft() ), abs( bbox.GetRight() ) );
1511 int maxYExtent = std::max( abs( bbox.GetTop() ), abs( bbox.GetBottom() ) );
1512
1513 // Don't blow up the GAL on too-large numbers
1514 if( maxXExtent > INT_MAX / 4 )
1515 maxXExtent = INT_MAX / 4;
1516
1517 if( maxYExtent > INT_MAX / 4 )
1518 maxYExtent = INT_MAX / 4;
1519
1520 BOX2D viewBox( m_dummyPad->GetPosition(), {0, 0} );
1521 BOX2D canvasBox( m_dummyPad->GetPosition(), {0, 0} );
1522 viewBox.Inflate( maxXExtent * 1.4, maxYExtent * 1.4 ); // add a margin
1523 canvasBox.Inflate( maxXExtent * 2.0, maxYExtent * 2.0 );
1524
1525 view->SetBoundary( canvasBox );
1526
1527 // Autozoom
1528 view->SetViewport( viewBox );
1529
1532 }
1533}
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:214
coord_type GetTop() const
Definition: box2.h:194
void Move(const Vec &aMoveVector)
Move the rectangle by the aMoveVector.
Definition: box2.h:111
coord_type GetRight() const
Definition: box2.h:189
coord_type GetLeft() const
Definition: box2.h:193
const Vec & GetSize() const
Definition: box2.h:179
coord_type GetBottom() const
Definition: box2.h:190
std::vector< PCB_SHAPE * > m_highlight
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void SetLayerColor(int aLayer, const COLOR4D &aColor)
Change the color used to draw a layer.
void SetViewport(const BOX2D &aViewport)
Set the visible area of the VIEW.
Definition: view.cpp:523
void SetBoundary(const BOX2D &aBoundary)
Set limits for view area.
Definition: view.h:279
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1589
virtual void SetTopLayer(int aLayer, bool aEnabled=true)
Set given layer to be displayed on the top or sets back the default order of layers.
Definition: view.cpp:825
virtual const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
Definition: pad.cpp:1462
virtual void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
Definition: pcb_shape.cpp:191
virtual void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: pcb_shape.cpp:163
#define SELECTED_ITEMS_LAYER
VECTOR2< int > VECTOR2I
Definition: vector2d.h:618

References std::abs(), KIGFX::VIEW::Add(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), PAD::GetOrientation(), KIGFX::VIEW::GetPainter(), PAD::GetPosition(), BOX2< Vec >::GetRight(), KIGFX::PAINTER::GetSettings(), BOX2< Vec >::GetSize(), BOX2< Vec >::GetTop(), PCB_DRAW_PANEL_GAL::GetView(), BOX2< Vec >::Inflate(), m_canUpdate, m_dummyPad, m_highlight, DIALOG_PAD_PROPERTIES_BASE::m_listCtrlPrimitives, m_padPreviewGAL, m_primitives, m_selectedColor, BOX2< Vec >::Move(), PCB_SHAPE::Move(), EDA_DRAW_PANEL_GAL::Refresh(), PCB_SHAPE::Rotate(), SELECTED_ITEMS_LAYER, KIGFX::VIEW::SetBoundary(), BOARD_ITEM::SetLayer(), KIGFX::RENDER_SETTINGS::SetLayerColor(), KIGFX::VIEW::SetTopLayer(), KIGFX::VIEW::SetViewport(), EDA_DRAW_PANEL_GAL::StartDrawing(), EDA_DRAW_PANEL_GAL::StopDrawing(), KIGFX::VIEW::Update(), PAD::ViewBBox(), VECTOR2< T >::x, and VECTOR2< T >::y.

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

◆ resetSize()

void DIALOG_SHIM::resetSize ( )
protectedinherited

Clear the existing dialog size and position.

This will cause the dialog size to be clear so the next time the dialog is shown the sizers will layout the dialog accordingly. This useful when there are dialog windows that size changes due to layout dependency hidden controls.

Definition at line 293 of file dialog_shim.cpp.

294{
295 const char* hash_key;
296
297 if( m_hash_key.size() )
298 {
299 // a special case like EDA_LIST_DIALOG, which has multiple uses.
300 hash_key = m_hash_key.c_str();
301 }
302 else
303 {
304 hash_key = typeid(*this).name();
305 }
306
307 std::unordered_map<std::string, wxRect>::iterator it = class_map.find( hash_key );
308
309 if( it == class_map.end() )
310 return;
311
312 wxRect rect = it->second;
313 rect.SetSize( wxSize( 0, 0 ) );
314 class_map[ hash_key ] = rect;
315}
std::string m_hash_key
Definition: dialog_shim.h:203
static std::unordered_map< std::string, wxRect > class_map

References class_map, and DIALOG_SHIM::m_hash_key.

Referenced by DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES().

◆ SetInitialFocus()

void DIALOG_SHIM::SetInitialFocus ( wxWindow *  aWindow)
inlineinherited

Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.

Definition at line 97 of file dialog_shim.h.

98 {
99 m_initialFocusTarget = aWindow;
100 }

References DIALOG_SHIM::m_initialFocusTarget.

Referenced by FOOTPRINT_EDIT_FRAME::buildSaveAsDialog(), SYMBOL_EDIT_FRAME::buildSaveAsDialog(), DIALOG_BOM::DIALOG_BOM(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CHOOSE_SYMBOL::DIALOG_CHOOSE_SYMBOL(), DIALOG_CONFIGURE_PATHS::DIALOG_CONFIGURE_PATHS(), DIALOG_FIND::DIALOG_FIND(), DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(), DIALOG_FP_PLUGIN_OPTIONS::DIALOG_FP_PLUGIN_OPTIONS(), DIALOG_GET_FOOTPRINT_BY_NAME::DIALOG_GET_FOOTPRINT_BY_NAME(), DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES(), DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS(), DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES(), DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX(), DIALOG_JUNCTION_PROPS::DIALOG_JUNCTION_PROPS(), DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES(), DIALOG_LIB_SHAPE_PROPERTIES::DIALOG_LIB_SHAPE_PROPERTIES(), DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES(), DIALOG_LIB_TEXTBOX_PROPERTIES::DIALOG_LIB_TEXTBOX_PROPERTIES(), DIALOG_LINE_PROPERTIES::DIALOG_LINE_PROPERTIES(), DIALOG_LOCKED_ITEMS_QUERY::DIALOG_LOCKED_ITEMS_QUERY(), DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PROPERTIES(), DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES(), DIALOG_POSITION_RELATIVE::DIALOG_POSITION_RELATIVE(), DIALOG_SCH_FIND::DIALOG_SCH_FIND(), DIALOG_SHAPE_PROPERTIES::DIALOG_SHAPE_PROPERTIES(), DIALOG_SHEET_PIN_PROPERTIES::DIALOG_SHEET_PIN_PROPERTIES(), DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE(), DIALOG_TARGET_PROPERTIES::DIALOG_TARGET_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TEXTBOX_PROPERTIES::DIALOG_TEXTBOX_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), DIALOG_WIRE_BUS_PROPERTIES::DIALOG_WIRE_BUS_PROPERTIES(), EDA_VIEW_SWITCHER::EDA_VIEW_SWITCHER(), HK_PROMPT_DIALOG::HK_PROMPT_DIALOG(), DIALOG_FIELD_PROPERTIES::init(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchAllClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchIDClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchRefClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchSelectedClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchValueClicked(), PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE(), PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE(), DIALOG_COPPER_ZONE::TransferDataToWindow(), DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataToWindow(), DIALOG_RULE_AREA_PROPERTIES::TransferDataToWindow(), and WX_TEXT_ENTRY_DIALOG::WX_TEXT_ENTRY_DIALOG().

◆ SetKiway()

void KIWAY_HOLDER::SetKiway ( wxWindow *  aDest,
KIWAY aKiway 
)
inherited

It is only used for debugging, since "this" is not a wxWindow*.

"this" is a KIWAY_HOLDER mix-in.

Parameters
aDestis the recipient of aKiway pointer.
aKiwayis often from a parent window or from #KIFACE::CreateWindow().

Definition at line 43 of file kiway_holder.cpp.

44{
45#if defined(DEBUG)
46 // offer a trap point for debugging most any window
47 wxASSERT( aDest );
48 if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) )
49 {
50 int breakhere=1;
51 ignore_unused( breakhere );
52 }
53#endif
54
55 ignore_unused( aDest );
56
57 m_kiway = aKiway;
58}
const char * name
Definition: DXF_plotter.cpp:56

References ignore_unused(), KIWAY_HOLDER::m_kiway, and name.

Referenced by PCB::IFACE::CreateKiWindow(), InvokePcbLibTableEditor(), InvokeSchEditSymbolLibTable(), PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME(), and SIM_PLOT_FRAME::SIM_PLOT_FRAME().

◆ SetPosition()

void DIALOG_SHIM::SetPosition ( const wxPoint &  aNewPosition)
inherited

Force the position of the dialog to a new position.

Parameters
aNewPositionis the new forced position

Definition at line 196 of file dialog_shim.cpp.

197{
198 wxDialog::SetPosition( aNewPosition );
199
200 // Now update the stored position:
201 const char* hash_key;
202
203 if( m_hash_key.size() )
204 {
205 // a special case like EDA_LIST_DIALOG, which has multiple uses.
206 hash_key = m_hash_key.c_str();
207 }
208 else
209 {
210 hash_key = typeid(*this).name();
211 }
212
213 std::unordered_map<std::string, wxRect>::iterator it = class_map.find( hash_key );
214
215 if( it == class_map.end() )
216 return;
217
218 wxRect rect = it->second;
219 rect.SetPosition( aNewPosition );
220
221 class_map[ hash_key ] = rect;
222}
void SetPosition(const wxString &aStr, const wxString &aDefaultMeasurementUnit, int *aX, int *aY, const wxString &aActualConversion)

References class_map, DIALOG_SHIM::m_hash_key, and PCAD2KICAD::SetPosition().

Referenced by PCB_BASE_FRAME::SelectOneLayer().

◆ setSizeInDU()

void DIALOG_SHIM::setSizeInDU ( int  x,
int  y 
)
protectedinherited

Set the dialog to the given dimensions in "dialog units".

These are units equivalent to 4* the average character width and 8* the average character height, allowing a dialog to be sized in a way that scales it with the system font.

Definition at line 168 of file dialog_shim.cpp.

169{
170 wxSize sz( x, y );
171 SetSize( ConvertDialogToPixels( sz ) );
172}

Referenced by HTML_MESSAGE_BOX::HTML_MESSAGE_BOX(), and HTML_MESSAGE_BOX::SetDialogSizeInDU().

◆ SetupStandardButtons()

void DIALOG_SHIM::SetupStandardButtons ( std::map< int, wxString >  aLabels = {})
inherited

Definition at line 708 of file dialog_shim.cpp.

709{
710 recursiveDescent( GetSizer(), aLabels );
711}
static void recursiveDescent(wxSizer *aSizer, std::map< int, wxString > &aLabels)

References recursiveDescent().

Referenced by CONVERT_SETTINGS_DIALOG::CONVERT_SETTINGS_DIALOG(), DIALOG_ANNOTATE::DIALOG_ANNOTATE(), DIALOG_ASSIGN_NETCLASS::DIALOG_ASSIGN_NETCLASS(), DIALOG_BOM::DIALOG_BOM(), DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CHOOSE_SYMBOL::DIALOG_CHOOSE_SYMBOL(), DIALOG_CLEANUP_GRAPHICS::DIALOG_CLEANUP_GRAPHICS(), DIALOG_COLOR_PICKER::DIALOG_COLOR_PICKER(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_CONFIGURE_PATHS::DIALOG_CONFIGURE_PATHS(), DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE(), DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY(), DIALOG_DIELECTRIC_MATERIAL::DIALOG_DIELECTRIC_MATERIAL(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_DRC::DIALOG_DRC(), DIALOG_ERC::DIALOG_ERC(), DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS(), DIALOG_EXPORT_3DFILE::DIALOG_EXPORT_3DFILE(), DIALOG_EXPORT_IDF3::DIALOG_EXPORT_IDF3(), DIALOG_EXPORT_NETLIST::DIALOG_EXPORT_NETLIST(), DIALOG_EXPORT_SVG::DIALOG_EXPORT_SVG(), DIALOG_FILTER_SELECTION::DIALOG_FILTER_SELECTION(), DIALOG_FOOTPRINT_CHECKER::DIALOG_FOOTPRINT_CHECKER(), DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(), DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST(), DIALOG_FP_PLUGIN_OPTIONS::DIALOG_FP_PLUGIN_OPTIONS(), DIALOG_GEN_FOOTPRINT_POSITION::DIALOG_GEN_FOOTPRINT_POSITION(), DIALOG_GENDRILL::DIALOG_GENDRILL(), DIALOG_GET_FOOTPRINT_BY_NAME::DIALOG_GET_FOOTPRINT_BY_NAME(), DIALOG_GLOBAL_DELETION::DIALOG_GLOBAL_DELETION(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS(), DIALOG_GLOBAL_LIB_TABLE_CONFIG::DIALOG_GLOBAL_LIB_TABLE_CONFIG(), DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES(), DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS(), DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES(), DIALOG_IBIS_PARSER_REPORTER::DIALOG_IBIS_PARSER_REPORTER(), DIALOG_IMAGE_PROPERTIES::DIALOG_IMAGE_PROPERTIES(), DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX(), DIALOG_IMPORT_NETLIST::DIALOG_IMPORT_NETLIST(), DIALOG_IMPORT_SETTINGS::DIALOG_IMPORT_SETTINGS(), DIALOG_IMPORTED_LAYERS::DIALOG_IMPORTED_LAYERS(), DIALOG_JUNCTION_PROPS::DIALOG_JUNCTION_PROPS(), DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES(), DIALOG_LIB_EDIT_PIN_TABLE::DIALOG_LIB_EDIT_PIN_TABLE(), DIALOG_LIB_NEW_SYMBOL::DIALOG_LIB_NEW_SYMBOL(), DIALOG_LIB_SHAPE_PROPERTIES::DIALOG_LIB_SHAPE_PROPERTIES(), DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES(), DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES(), DIALOG_LIB_TEXTBOX_PROPERTIES::DIALOG_LIB_TEXTBOX_PROPERTIES(), DIALOG_LINE_PROPERTIES::DIALOG_LINE_PROPERTIES(), DIALOG_LOCKED_ITEMS_QUERY::DIALOG_LOCKED_ITEMS_QUERY(), DIALOG_MIGRATE_SETTINGS::DIALOG_MIGRATE_SETTINGS(), DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT(), DIALOG_NET_INSPECTOR::DIALOG_NET_INSPECTOR(), DIALOG_NON_COPPER_ZONES_EDITOR::DIALOG_NON_COPPER_ZONES_EDITOR(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::DIALOG_PAD_PRIMITIVE_POLY_PROPS(), DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PRIMITIVES_TRANSFORM::DIALOG_PAD_PRIMITIVES_TRANSFORM(), DIALOG_PAD_PROPERTIES(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_PCM::DIALOG_PCM(), DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES(), DIALOG_PLOT::DIALOG_PLOT(), DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC(), DIALOG_PNS_DIFF_PAIR_DIMENSIONS::DIALOG_PNS_DIFF_PAIR_DIMENSIONS(), DIALOG_PNS_LENGTH_TUNING_SETTINGS::DIALOG_PNS_LENGTH_TUNING_SETTINGS(), DIALOG_PNS_SETTINGS::DIALOG_PNS_SETTINGS(), DIALOG_POSITION_RELATIVE::DIALOG_POSITION_RELATIVE(), DIALOG_PRINT_GENERIC::DIALOG_PRINT_GENERIC(), DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER(), DIALOG_PUSH_PAD_PROPERTIES::DIALOG_PUSH_PAD_PROPERTIES(), DIALOG_REGULATOR_FORM::DIALOG_REGULATOR_FORM(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_RULE_AREA_PROPERTIES::DIALOG_RULE_AREA_PROPERTIES(), DIALOG_SCH_IMPORT_SETTINGS::DIALOG_SCH_IMPORT_SETTINGS(), DIALOG_SHAPE_PROPERTIES::DIALOG_SHAPE_PROPERTIES(), DIALOG_SHEET_PIN_PROPERTIES::DIALOG_SHEET_PIN_PROPERTIES(), DIALOG_SHEET_PROPERTIES::DIALOG_SHEET_PROPERTIES(), DIALOG_SIM_COMMAND::DIALOG_SIM_COMMAND(), DIALOG_SWAP_LAYERS::DIALOG_SWAP_LAYERS(), DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE(), DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES(), DIALOG_TARGET_PROPERTIES::DIALOG_TARGET_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TEXTBOX_PROPERTIES::DIALOG_TEXTBOX_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), DIALOG_TRACK_VIA_SIZE::DIALOG_TRACK_VIA_SIZE(), DIALOG_UNUSED_PAD_LAYERS::DIALOG_UNUSED_PAD_LAYERS(), DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB(), DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB(), DIALOG_UPDATE_SYMBOL_FIELDS::DIALOG_UPDATE_SYMBOL_FIELDS(), DIALOG_WIRE_BUS_PROPERTIES::DIALOG_WIRE_BUS_PROPERTIES(), EDA_LIST_DIALOG::EDA_LIST_DIALOG(), EDA_REORDERABLE_LIST_DIALOG::EDA_REORDERABLE_LIST_DIALOG(), DIALOG_CONSTRAINTS_REPORTER::FinishInitialization(), HTML_MESSAGE_BOX::HTML_MESSAGE_BOX(), DIALOG_FIELD_PROPERTIES::init(), DIALOG_EDIT_LIBRARY_TABLES::InstallPanel(), NETLIST_DIALOG_ADD_GENERATOR::NETLIST_DIALOG_ADD_GENERATOR(), PAGED_DIALOG::PAGED_DIALOG(), DIALOG_CLEANUP_TRACKS_AND_VIAS::setupOKButtonLabel(), WX_TEXT_ENTRY_DIALOG::WX_TEXT_ENTRY_DIALOG(), and WX_UNIT_ENTRY_DIALOG::WX_UNIT_ENTRY_DIALOG().

◆ Show()

bool DIALOG_PAD_PROPERTIES::Show ( bool  aShow)
overrideprivate

Definition at line 1197 of file dialog_pad_properties.cpp.

1198{
1199 bool retVal = DIALOG_SHIM::Show( aShow );
1200
1201 if( aShow )
1202 {
1203 // It *should* work to set the stackup bitmap in the constructor, but it doesn't.
1204 // wxWidgets needs to have these set when the panel is visible for some reason.
1205 // https://gitlab.com/kicad/code/kicad/-/issues/5534
1213
1214 Layout();
1215 }
1216
1217 return retVal;
1218}
@ pads_npth_top
@ pads_reset_unused
@ pads_remove_unused
@ pads_npth_bottom
@ pads_npth_top_bottom
@ pads_remove_unused_keep_bottom

References KiBitmap(), DIALOG_PAD_PROPERTIES_BASE::m_stackupImage0, DIALOG_PAD_PROPERTIES_BASE::m_stackupImage1, DIALOG_PAD_PROPERTIES_BASE::m_stackupImage2, DIALOG_PAD_PROPERTIES_BASE::m_stackupImage4, DIALOG_PAD_PROPERTIES_BASE::m_stackupImage5, DIALOG_PAD_PROPERTIES_BASE::m_stackupImage6, DIALOG_PAD_PROPERTIES_BASE::m_stackupImage7, pads_npth, pads_npth_bottom, pads_npth_top, pads_npth_top_bottom, pads_remove_unused, pads_remove_unused_keep_bottom, pads_reset_unused, and DIALOG_SHIM::Show().

◆ ShowQuasiModal()

int DIALOG_SHIM::ShowQuasiModal ( )
inherited

Definition at line 436 of file dialog_shim.cpp.

437{
438 // This is an exception safe way to zero a pointer before returning.
439 // Yes, even though DismissModal() clears this first normally, this is
440 // here in case there's an exception before the dialog is dismissed.
441 struct NULLER
442 {
443 void*& m_what;
444 NULLER( void*& aPtr ) : m_what( aPtr ) {}
445 ~NULLER() { m_what = nullptr; } // indeed, set it to NULL on destruction
446 } clear_this( (void*&) m_qmodal_loop );
447
448 // release the mouse if it's currently captured as the window having it
449 // will be disabled when this dialog is shown -- but will still keep the
450 // capture making it impossible to do anything in the modal dialog itself
451 wxWindow* win = wxWindow::GetCapture();
452 if( win )
453 win->ReleaseMouse();
454
455 // Get the optimal parent
456 wxWindow* parent = GetParentForModalDialog( GetParent(), GetWindowStyle() );
457
458 wxASSERT_MSG( !m_qmodal_parent_disabler, wxT( "Caller using ShowQuasiModal() twice on same "
459 "window?" ) );
460
461 // quasi-modal: disable only my "optimal" parent
463
464 // Apple in its infinite wisdom will raise a disabled window before even passing
465 // us the event, so we have no way to stop it. Instead, we must set an order on
466 // the windows so that the quasi-modal will be pushed in front of the disabled
467 // window when it is raised.
469
470 Show( true );
471
472 m_qmodal_showing = true;
473
474 WX_EVENT_LOOP event_loop;
475
476 m_qmodal_loop = &event_loop;
477
478 event_loop.Run();
479
480 m_qmodal_showing = false;
481
482 return GetReturnCode();
483}
Toggle a window's "enable" status to disabled, then enabled on destruction.
Definition: dialog_shim.cpp:46
#define WX_EVENT_LOOP
Definition: kiway_player.h:41
void ReparentQuasiModal(wxNonOwnedWindow *aWindow)
Move a window's parent to be the top-level window and force the window to be on top.
Definition: gtk/ui.cpp:65

References DIALOG_SHIM::m_qmodal_loop, DIALOG_SHIM::m_qmodal_parent_disabler, DIALOG_SHIM::m_qmodal_showing, KIPLATFORM::UI::ReparentQuasiModal(), DIALOG_SHIM::Show(), and WX_EVENT_LOOP.

Referenced by SCH_EDIT_TOOL::ChangeSymbols(), S3D::Configure3DPaths(), MICROWAVE_TOOL::createFootprint(), PCB::IFACE::CreateKiWindow(), MICROWAVE_TOOL::createMicrowaveInductor(), SCH_DRAWING_TOOLS::createNewText(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_EDIT_TOOL::editFieldProperties(), SCH_EDIT_TOOL::editFieldText(), SCH_EDITOR_CONTROL::EditSymbolFields(), SYMBOL_EDITOR_EDIT_TOOL::editSymbolProperties(), GLOBAL_EDIT_TOOL::EditTracksAndVias(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), InvokeCopperZonesEditor(), InvokeDialogCreateBOM(), InvokeDialogEditSymbolsLibId(), InvokeDialogRescueEach(), InvokeNonCopperZonesEditor(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), SYMBOL_VIEWER_FRAME::OnSelectSymbol(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), SCH_EDITOR_CONTROL::RemapSymbols(), S3D::Select3DModel(), PCB_BASE_FRAME::SelectFootprintFromLibTree(), PCB_EDIT_FRAME::ShowBoardSetupDialog(), PCB_EDIT_FRAME::ShowExchangeFootprintsDialog(), PCB_BASE_EDIT_FRAME::ShowGraphicItemPropertiesDialog(), PCB_BASE_FRAME::ShowPadPropertiesDialog(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), PCB_BASE_EDIT_FRAME::ShowTextBoxPropertiesDialog(), PCB_BASE_EDIT_FRAME::ShowTextPropertiesDialog(), and PCB_EDIT_FRAME::ToPlotter().

◆ TransferDataFromWindow()

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 1551 of file dialog_pad_properties.cpp.

1552{
1553 BOARD_COMMIT commit( m_parent );
1554
1555 if( !wxDialog::TransferDataFromWindow() )
1556 return false;
1557
1558 if( !m_panelGeneral->TransferDataFromWindow() )
1559 return false;
1560
1561 if( !m_localSettingsPanel->TransferDataFromWindow() )
1562 return false;
1563
1564 if( !padValuesOK() )
1565 return false;
1566
1568 return false;
1569
1571 padTool->SetLastPadNumber( m_padMaster->GetNumber() );
1572
1573 // m_padMaster is a pattern: ensure there is no net for this pad:
1575
1576 if( !m_currentPad ) // Set current Pad parameters
1577 return true;
1578
1579 commit.Modify( m_currentPad );
1580
1581 // Update values
1586
1587 VECTOR2I size;
1588 FOOTPRINT* footprint = m_currentPad->GetParent();
1589
1591
1592 size = m_padMaster->GetDelta();
1593 m_currentPad->SetDelta( size );
1594
1597
1598 VECTOR2I offset = m_padMaster->GetOffset();
1599 m_currentPad->SetOffset( offset );
1600
1602
1605
1608
1612
1614
1615 int padNetcode = NETINFO_LIST::UNCONNECTED;
1616
1617 // For PAD_ATTRIB::NPTH, ensure there is no net name selected
1619 padNetcode = m_padNetSelector->GetSelectedNetcode();
1620
1621 m_currentPad->SetNetCode( padNetcode );
1633
1634 // rounded rect pads with radius ratio = 0 are in fact rect pads.
1635 // So set the right shape (and perhaps issues with a radius = 0)
1638 {
1640 }
1641
1642 // Set the fabrication property:
1644
1645 // define the way the clearance area is defined in zones
1647
1648 if( m_isFlipped )
1649 {
1650 // flip pad (up/down) around its position
1652 }
1653
1654 if( footprint )
1655 {
1656 // compute the pos 0 value, i.e. pad position for footprint with orientation = 0
1657 // i.e. relative to footprint origin (footprint position)
1658 VECTOR2I pt = m_currentPad->GetPosition() - footprint->GetPosition();
1659 RotatePoint( pt, -footprint->GetOrientation() );
1660 m_currentPad->SetPos0( pt );
1662 }
1663
1665
1666 // redraw the area where the pad was
1668
1669 commit.Push( _( "Modify pad" ) );
1670
1671 return true;
1672}
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
bool padValuesOK()
test if all values are acceptable for the pad
PAD_PROP getSelectedProperty()
Return the pad property currently selected.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
VECTOR2I GetPosition() const override
Definition: footprint.h:188
static const int UNCONNECTED
Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) whe...
Definition: netinfo.h:373
int GetSelectedNetcode()
void SetLastPadNumber(const wxString &aPadNumber)
Definition: pad_tool.h:66
void SetAttribute(PAD_ATTRIB aAttribute)
Definition: pad.cpp:690
void SetLayerSet(LSET aLayers) override
Definition: pad.h:396
void SetLocalSolderPasteMargin(int aMargin)
Definition: pad.h:423
void SetRemoveUnconnected(bool aSet)
Set the unconnected removal property.
Definition: pad.h:608
void SetThermalGap(int aGap)
Definition: pad.h:553
void SetThermalSpokeAngle(const EDA_ANGLE &aAngle)
The orientation of the thermal spokes.
Definition: pad.h:540
void DeletePrimitivesList()
Clear the basic shapes list.
void SetDrillShape(PAD_DRILL_SHAPE_T aShape)
Definition: pad.h:382
void SetProperty(PAD_PROP aProperty)
Definition: pad.cpp:701
void SetOffset(const VECTOR2I &aOffset)
Definition: pad.h:273
void SetLocalClearance(int aClearance)
Definition: pad.h:420
void SetKeepTopBottom(bool aSet)
Set whether we keep the top and bottom connections even if they are not connected.
Definition: pad.h:614
void SetNumber(const wxString &aNumber)
Set the pad number (note that it can be alphanumeric, such as the array reference "AA12").
Definition: pad.h:134
void SetZoneConnection(ZONE_CONNECTION aType)
Definition: pad.h:521
void SetDelta(const VECTOR2I &aSize)
Definition: pad.h:263
void SetPosition(const VECTOR2I &aPos) override
Definition: pad.h:196
void SetDrillSize(const VECTOR2I &aSize)
Definition: pad.h:266
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: pad.h:426
void SetShape(PAD_SHAPE aShape)
Set the new shape of this pad.
Definition: pad.h:185
void SetPos0(const VECTOR2I &aPos)
Definition: pad.h:250
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: pad.h:222
void SetAnchorPadShape(PAD_SHAPE aShape)
Set the shape of the anchor pad for custom shaped pads.
Definition: pad.h:233
void ReplacePrimitives(const std::vector< std::shared_ptr< PCB_SHAPE > > &aPrimitivesList)
Clear the current custom shape primitives list and import a new list.
void SetLocalSolderMaskMargin(int aMargin)
Definition: pad.h:416
void SetThermalSpokeWidth(int aWidth)
Set the width of the thermal spokes connecting the pad to a zone.
Definition: pad.h:530
void SetSize(const VECTOR2I &aSize)
Definition: pad.h:256
void SetChamferPositions(int aPositions)
Has meaning only for chamfered rectangular pads.
Definition: pad.h:593
void SetPadToDieLength(int aLength)
Definition: pad.h:412
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Definition: trigo.cpp:183

References _, CUSTOM, PAD::DeletePrimitivesList(), PAD::Flip(), PAD::GetAnchorPadShape(), PAD::GetAttribute(), PCB_BASE_FRAME::GetCanvas(), PAD::GetChamferPositions(), PAD::GetChamferRectRatio(), PAD::GetCustomShapeInZoneOpt(), PAD::GetDelta(), PAD::GetDrillShape(), PAD::GetDrillSize(), PAD::GetKeepTopBottom(), PAD::GetLayerSet(), PAD::GetLocalClearance(), PAD::GetLocalSolderMaskMargin(), PAD::GetLocalSolderPasteMargin(), PAD::GetLocalSolderPasteMarginRatio(), PAD::GetNumber(), PAD::GetOffset(), FOOTPRINT::GetOrientation(), PAD::GetOrientation(), PAD::GetPadToDieLength(), PAD::GetParent(), FOOTPRINT::GetPosition(), PAD::GetPosition(), PAD::GetPrimitives(), PAD::GetRemoveUnconnected(), PAD::GetRoundRectRadiusRatio(), NET_SELECTOR::GetSelectedNetcode(), getSelectedProperty(), PAD::GetShape(), PAD::GetSize(), PAD::GetThermalGap(), PAD::GetThermalSpokeAngle(), PAD::GetThermalSpokeWidth(), TOOL_MANAGER::GetTool(), TOOLS_HOLDER::GetToolManager(), PAD::GetZoneConnection(), m_currentPad, m_isFlipped, DIALOG_PAD_PROPERTIES_BASE::m_localSettingsPanel, m_padMaster, DIALOG_PAD_PROPERTIES_BASE::m_padNetSelector, DIALOG_PAD_PROPERTIES_BASE::m_panelGeneral, m_parent, COMMIT::Modify(), NPTH, padValuesOK(), BOARD_COMMIT::Push(), RECT, EDA_DRAW_PANEL_GAL::Refresh(), PAD::ReplacePrimitives(), RotatePoint(), ROUNDRECT, PAD::SetAnchorPadShape(), PAD::SetAttribute(), PAD::SetChamferPositions(), PAD::SetChamferRectRatio(), PAD::SetCustomShapeInZoneOpt(), PAD::SetDelta(), PAD::SetDrillShape(), PAD::SetDrillSize(), PAD::SetKeepTopBottom(), PAD_TOOL::SetLastPadNumber(), PAD::SetLayerSet(), PAD::SetLocalClearance(), PAD::SetLocalSolderMaskMargin(), PAD::SetLocalSolderPasteMargin(), PAD::SetLocalSolderPasteMarginRatio(), EDA_DRAW_FRAME::SetMsgPanel(), BOARD_CONNECTED_ITEM::SetNetCode(), PAD::SetNumber(), PAD::SetOffset(), PAD::SetOrientation(), PAD::SetPadToDieLength(), PAD::SetPos0(), PAD::SetPosition(), PAD::SetProperty(), PAD::SetRemoveUnconnected(), PAD::SetRoundRectRadiusRatio(), PAD::SetShape(), PAD::SetSize(), PAD::SetThermalGap(), PAD::SetThermalSpokeAngle(), PAD::SetThermalSpokeWidth(), PAD::SetZoneConnection(), transferDataToPad(), and NETINFO_LIST::UNCONNECTED.

◆ transferDataToPad()

bool DIALOG_PAD_PROPERTIES::transferDataToPad ( PAD aPad)
private

Copy values from dialog field to aPad's members.

Definition at line 1716 of file dialog_pad_properties.cpp.

1717{
1718 if( !Validate() )
1719 return false;
1720
1721 if( !m_panelGeneral->Validate() )
1722 return false;
1723
1724 if( !m_localSettingsPanel->Validate() )
1725 return false;
1726
1727 if( !m_spokeWidth.Validate( 0, INT_MAX ) )
1728 return false;
1729
1730 aPad->SetAttribute( code_type[m_padType->GetSelection()] );
1731 aPad->SetShape( code_shape[m_PadShapeSelector->GetSelection()] );
1732
1735 else
1737
1738 if( aPad->GetShape() == PAD_SHAPE::CUSTOM )
1740
1741 // Read pad clearances values:
1749
1750 // And rotation
1752
1753 switch( m_ZoneConnectionChoice->GetSelection() )
1754 {
1755 default:
1756 case 0: aPad->SetZoneConnection( ZONE_CONNECTION::INHERITED ); break;
1757 case 1: aPad->SetZoneConnection( ZONE_CONNECTION::FULL ); break;
1758 case 2: aPad->SetZoneConnection( ZONE_CONNECTION::THERMAL ); break;
1759 case 3: aPad->SetZoneConnection( ZONE_CONNECTION::NONE ); break;
1760 }
1761
1762 aPad->SetPosition( wxPoint( m_posX.GetValue(), m_posY.GetValue() ) );
1763
1764 if( m_holeShapeCtrl->GetSelection() == CHOICE_SHAPE_CIRCLE )
1765 {
1767 aPad->SetDrillSize( wxSize( m_holeX.GetValue(), m_holeX.GetValue() ) );
1768 }
1769 else
1770 {
1772 aPad->SetDrillSize( wxSize( m_holeX.GetValue(), m_holeY.GetValue() ) );
1773 }
1774
1775 if( aPad->GetShape() == PAD_SHAPE::CIRCLE )
1776 aPad->SetSize( wxSize( m_sizeX.GetValue(), m_sizeX.GetValue() ) );
1777 else
1778 aPad->SetSize( wxSize( m_sizeX.GetValue(), m_sizeY.GetValue() ) );
1779
1780 // For a trapezoid, test delta value (be sure delta is not too large for pad size)
1781 // remember DeltaSize.x is the Y size variation
1782 bool error = false;
1783 wxSize delta( 0, 0 );
1784
1785 if( aPad->GetShape() == PAD_SHAPE::TRAPEZOID )
1786 {
1787 // For a trapezoid, only one of delta.x or delta.y is not 0, depending on axis.
1788 if( m_trapAxisCtrl->GetSelection() == 0 )
1790 else
1792
1793 if( delta.x < 0 && delta.x < -aPad->GetSize().y )
1794 {
1795 delta.x = -aPad->GetSize().y + 2;
1796 error = true;
1797 }
1798
1799 if( delta.x > 0 && delta.x > aPad->GetSize().y )
1800 {
1801 delta.x = aPad->GetSize().y - 2;
1802 error = true;
1803 }
1804
1805 if( delta.y < 0 && delta.y < -aPad->GetSize().x )
1806 {
1807 delta.y = -aPad->GetSize().x + 2;
1808 error = true;
1809 }
1810
1811 if( delta.y > 0 && delta.y > aPad->GetSize().x )
1812 {
1813 delta.y = aPad->GetSize().x - 2;
1814 error = true;
1815 }
1816 }
1817
1818 aPad->SetDelta( delta );
1819
1820 if( m_offsetShapeOpt->GetValue() )
1821 aPad->SetOffset( wxPoint( m_offsetX.GetValue(), m_offsetY.GetValue() ) );
1822 else
1823 aPad->SetOffset( wxPoint() );
1824
1825 // Read pad length die
1826 if( m_padToDieOpt->GetValue() )
1828 else
1829 aPad->SetPadToDieLength( 0 );
1830
1831 aPad->SetNumber( m_padNumCtrl->GetValue() );
1833
1834 int chamfers = 0;
1835
1836 if( m_PadShapeSelector->GetSelection() == CHOICE_SHAPE_CHAMFERED_RECT )
1837 {
1838 if( m_cbTopLeft->GetValue() )
1839 chamfers |= RECT_CHAMFER_TOP_LEFT;
1840
1841 if( m_cbTopRight->GetValue() )
1842 chamfers |= RECT_CHAMFER_TOP_RIGHT;
1843
1844 if( m_cbBottomLeft->GetValue() )
1845 chamfers |= RECT_CHAMFER_BOTTOM_LEFT;
1846
1847 if( m_cbBottomRight->GetValue() )
1848 chamfers |= RECT_CHAMFER_BOTTOM_RIGHT;
1849 }
1850 else if( m_PadShapeSelector->GetSelection() == CHOICE_SHAPE_CHAMFERED_ROUNDED_RECT )
1851 {
1852 if( m_cbTopLeft1->GetValue() )
1853 chamfers |= RECT_CHAMFER_TOP_LEFT;
1854
1855 if( m_cbTopRight1->GetValue() )
1856 chamfers |= RECT_CHAMFER_TOP_RIGHT;
1857
1858 if( m_cbBottomLeft1->GetValue() )
1859 chamfers |= RECT_CHAMFER_BOTTOM_LEFT;
1860
1861 if( m_cbBottomRight1->GetValue() )
1862 chamfers |= RECT_CHAMFER_BOTTOM_RIGHT;
1863 }
1864 aPad->SetChamferPositions( chamfers );
1865
1866 if( aPad->GetShape() == PAD_SHAPE::CUSTOM )
1867 {
1868 // The pad custom has a "anchor pad" (a basic shape: round or rect pad)
1869 // that is the minimal area of this pad, and is useful to ensure a hole
1870 // diameter is acceptable, and is used in Gerber files as flashed area
1871 // reference
1872 if( aPad->GetAnchorPadShape() == PAD_SHAPE::CIRCLE )
1873 aPad->SetSize( wxSize( m_sizeX.GetValue(), m_sizeX.GetValue() ) );
1874 }
1875
1876 // Define the way the clearance area is defined in zones. Since all non-custom pad
1877 // shapes are convex to begin with, this really only makes any difference for custom
1878 // pad shapes.
1879 aPad->SetCustomShapeInZoneOpt( m_ZoneCustomPadShape->GetSelection() == 0 ?
1882
1883 switch( aPad->GetAttribute() )
1884 {
1885 case PAD_ATTRIB::PTH:
1886 break;
1887
1888 case PAD_ATTRIB::CONN:
1889 case PAD_ATTRIB::SMD:
1890 // SMD and PAD_ATTRIB::CONN has no hole.
1891 // basically, SMD and PAD_ATTRIB::CONN are same type of pads
1892 // PAD_ATTRIB::CONN has just a default non technical layers that differs from SMD
1893 // and are intended to be used in virtual edge board connectors
1894 // However we can accept a non null offset,
1895 // mainly to allow complex pads build from a set of basic pad shapes
1896 aPad->SetDrillSize( wxSize( 0, 0 ) );
1897 break;
1898
1899 case PAD_ATTRIB::NPTH:
1900 // Mechanical purpose only:
1901 // no net name, no pad name allowed
1902 aPad->SetNumber( wxEmptyString );
1904 break;
1905
1906 default:
1907 wxFAIL_MSG( wxT( "DIALOG_PAD_PROPERTIES::transferDataToPad: unknown pad type" ) );
1908 break;
1909 }
1910
1911 if( aPad->GetShape() == PAD_SHAPE::ROUNDRECT )
1912 {
1914 }
1915 else if( aPad->GetShape() == PAD_SHAPE::CHAMFERED_RECT )
1916 {
1918 {
1921 }
1922 else // Choice is CHOICE_SHAPE_CHAMFERED_RECT, no rounded corner
1923 {
1925 aPad->SetRoundRectRadiusRatio( 0 );
1926 }
1927 }
1928
1930
1931 LSET padLayerMask = LSET();
1932 int copperLayersChoice = m_rbCopperLayersSel->GetSelection();
1933
1934 aPad->SetRemoveUnconnected( false );
1935 aPad->SetKeepTopBottom( false );
1936
1937 switch( m_padType->GetSelection() )
1938 {
1939 case PTH_DLG_TYPE:
1940 switch( copperLayersChoice )
1941 {
1942 case 0:
1943 // All copper layers
1944 padLayerMask |= LSET::AllCuMask();
1945 break;
1946
1947 case 1:
1948 // Front, back and connected
1949 padLayerMask |= LSET::AllCuMask();
1950 aPad->SetRemoveUnconnected( true );
1951 aPad->SetKeepTopBottom( true );
1952 break;
1953
1954 case 2:
1955 // Connected only
1956 padLayerMask |= LSET::AllCuMask();
1957 aPad->SetRemoveUnconnected( true );
1958 break;
1959
1960 case 3:
1961 // No copper layers
1962 break;
1963 }
1964
1965 break;
1966
1967 case NPTH_DLG_TYPE:
1968 switch( copperLayersChoice )
1969 {
1970 case 0: padLayerMask.set( F_Cu ).set( B_Cu ); break;
1971 case 1: padLayerMask.set( F_Cu ); break;
1972 case 2: padLayerMask.set( B_Cu ); break;
1973 default: break;
1974 }
1975
1976 break;
1977
1978 case SMD_DLG_TYPE:
1979 case CONN_DLG_TYPE:
1980 switch( copperLayersChoice )
1981 {
1982 case 0: padLayerMask.set( F_Cu ); break;
1983 case 1: padLayerMask.set( B_Cu ); break;
1984 }
1985
1986 break;
1987
1988 case APERTURE_DLG_TYPE:
1989 // no copper layers
1990 break;
1991 }
1992
1993 if( m_PadLayerAdhCmp->GetValue() )
1994 padLayerMask.set( F_Adhes );
1995
1996 if( m_PadLayerAdhCu->GetValue() )
1997 padLayerMask.set( B_Adhes );
1998
1999 if( m_PadLayerPateCmp->GetValue() )
2000 padLayerMask.set( F_Paste );
2001
2002 if( m_PadLayerPateCu->GetValue() )
2003 padLayerMask.set( B_Paste );
2004
2005 if( m_PadLayerSilkCmp->GetValue() )
2006 padLayerMask.set( F_SilkS );
2007
2008 if( m_PadLayerSilkCu->GetValue() )
2009 padLayerMask.set( B_SilkS );
2010
2011 if( m_PadLayerMaskCmp->GetValue() )
2012 padLayerMask.set( F_Mask );
2013
2014 if( m_PadLayerMaskCu->GetValue() )
2015 padLayerMask.set( B_Mask );
2016
2017 if( m_PadLayerECO1->GetValue() )
2018 padLayerMask.set( Eco1_User );
2019
2020 if( m_PadLayerECO2->GetValue() )
2021 padLayerMask.set( Eco2_User );
2022
2023 if( m_PadLayerDraft->GetValue() )
2024 padLayerMask.set( Dwgs_User );
2025
2026 aPad->SetLayerSet( padLayerMask );
2027
2028 return !error;
2029}
virtual bool Validate(double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED)
Validate the control against the given range, informing the user of any errors found.
static PAD_ATTRIB code_type[]
static PAD_SHAPE code_shape[]
@ CUST_PAD_SHAPE_IN_ZONE_OUTLINE
Definition: pad.h:44
@ PAD_DRILL_SHAPE_CIRCLE
Definition: pad_shapes.h:70

References LSET::AllCuMask(), APERTURE_DLG_TYPE, B_Adhes, B_Cu, B_Mask, B_Paste, B_SilkS, CHAMFERED_RECT, CHOICE_SHAPE_CHAMFERED_RECT, CHOICE_SHAPE_CHAMFERED_ROUNDED_RECT, CHOICE_SHAPE_CIRCLE, CHOICE_SHAPE_CUSTOM_RECT_ANCHOR, CIRCLE, code_shape, code_type, CONN, CONN_DLG_TYPE, CUST_PAD_SHAPE_IN_ZONE_CONVEXHULL, CUST_PAD_SHAPE_IN_ZONE_OUTLINE, CUSTOM, delta, Dwgs_User, Eco1_User, Eco2_User, F_Adhes, F_Cu, F_Mask, F_Paste, F_SilkS, FULL, PAD::GetAnchorPadShape(), UNIT_BINDER::GetAngleValue(), PAD::GetAttribute(), UNIT_BINDER::GetDoubleValue(), NET_SELECTOR::GetSelectedNetcode(), getSelectedProperty(), PAD::GetShape(), PAD::GetSize(), UNIT_BINDER::GetValue(), INHERITED, DIALOG_PAD_PROPERTIES_BASE::m_cbBottomLeft, DIALOG_PAD_PROPERTIES_BASE::m_cbBottomLeft1, DIALOG_PAD_PROPERTIES_BASE::m_cbBottomRight, DIALOG_PAD_PROPERTIES_BASE::m_cbBottomRight1, DIALOG_PAD_PROPERTIES_BASE::m_cbTopLeft, DIALOG_PAD_PROPERTIES_BASE::m_cbTopLeft1, DIALOG_PAD_PROPERTIES_BASE::m_cbTopRight, DIALOG_PAD_PROPERTIES_BASE::m_cbTopRight1, m_chamferRatio, m_clearance, m_cornerRatio, DIALOG_PAD_PROPERTIES_BASE::m_holeShapeCtrl, m_holeX, m_holeY, DIALOG_PAD_PROPERTIES_BASE::m_localSettingsPanel, m_maskMargin, m_mixedChamferRatio, m_mixedCornerRatio, DIALOG_PAD_PROPERTIES_BASE::m_offsetShapeOpt, m_offsetX, m_offsetY, m_pad_orientation, 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_padNetSelector, DIALOG_PAD_PROPERTIES_BASE::m_padNumCtrl, DIALOG_PAD_PROPERTIES_BASE::m_PadShapeSelector, m_padToDie, DIALOG_PAD_PROPERTIES_BASE::m_padToDieOpt, DIALOG_PAD_PROPERTIES_BASE::m_padType, DIALOG_PAD_PROPERTIES_BASE::m_panelGeneral, m_pasteMargin, m_pasteMarginRatio, m_posX, m_posY, m_primitives, DIALOG_PAD_PROPERTIES_BASE::m_rbCopperLayersSel, m_sizeX, m_sizeY, m_spokeAngle, m_spokeWidth, m_thermalGap, DIALOG_PAD_PROPERTIES_BASE::m_trapAxisCtrl, m_trapDelta, DIALOG_PAD_PROPERTIES_BASE::m_ZoneConnectionChoice, DIALOG_PAD_PROPERTIES_BASE::m_ZoneCustomPadShape, NONE, NPTH, NPTH_DLG_TYPE, PAD_DRILL_SHAPE_CIRCLE, PAD_DRILL_SHAPE_OBLONG, PTH, PTH_DLG_TYPE, RECT, RECT_CHAMFER_BOTTOM_LEFT, RECT_CHAMFER_BOTTOM_RIGHT, RECT_CHAMFER_TOP_LEFT, RECT_CHAMFER_TOP_RIGHT, PAD::ReplacePrimitives(), ROUNDRECT, PAD::SetAnchorPadShape(), PAD::SetAttribute(), PAD::SetChamferPositions(), PAD::SetChamferRectRatio(), PAD::SetCustomShapeInZoneOpt(), PAD::SetDelta(), PAD::SetDrillShape(), PAD::SetDrillSize(), PAD::SetKeepTopBottom(), PAD::SetLayerSet(), PAD::SetLocalClearance(), PAD::SetLocalSolderMaskMargin(), PAD::SetLocalSolderPasteMargin(), PAD::SetLocalSolderPasteMarginRatio(), BOARD_CONNECTED_ITEM::SetNetCode(), PAD::SetNumber(), PAD::SetOffset(), PAD::SetOrientation(), PAD::SetPadToDieLength(), PAD::SetPosition(), PAD::SetProperty(), PAD::SetRemoveUnconnected(), PAD::SetRoundRectRadiusRatio(), PAD::SetShape(), PAD::SetSize(), PAD::SetThermalGap(), PAD::SetThermalSpokeAngle(), PAD::SetThermalSpokeWidth(), PAD::SetZoneConnection(), SMD, SMD_DLG_TYPE, THERMAL, TRAPEZOID, NETINFO_LIST::UNCONNECTED, UNIT_BINDER::Validate(), VECTOR2< T >::x, and VECTOR2< T >::y.

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

◆ TransferDataToWindow()

bool DIALOG_PAD_PROPERTIES::TransferDataToWindow ( )
overrideprivate

Definition at line 1536 of file dialog_pad_properties.cpp.

1537{
1538 if( !wxDialog::TransferDataToWindow() )
1539 return false;
1540
1541 if( !m_panelGeneral->TransferDataToWindow() )
1542 return false;
1543
1544 if( !m_localSettingsPanel->TransferDataToWindow() )
1545 return false;
1546
1547 return true;
1548}

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

Referenced by DIALOG_PAD_PROPERTIES().

◆ updateHoleControls()

void DIALOG_PAD_PROPERTIES::updateHoleControls ( )
private

Definition at line 1693 of file dialog_pad_properties.cpp.

1694{
1695 m_holeXLabel->SetLabel( ( m_holeShapeCtrl->GetSelection() == CHOICE_SHAPE_CIRCLE )
1696 ? _( "Diameter:" )
1697 : _( "Hole size X:" ) );
1699 && m_holeShapeCtrl->GetSelection() != CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR );
1700 m_holeXLabel->GetParent()->Layout();
1701}

References _, CHOICE_SHAPE_CIRCLE, CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR, DIALOG_PAD_PROPERTIES_BASE::m_holeShapeCtrl, DIALOG_PAD_PROPERTIES_BASE::m_holeXLabel, m_holeY, and UNIT_BINDER::Show().

Referenced by DIALOG_PAD_PROPERTIES(), and OnDrillShapeSelected().

◆ UpdateLayersDropdown()

void DIALOG_PAD_PROPERTIES::UpdateLayersDropdown ( )
private