KiCad PCB EDA Suite
DIALOG_TRACK_VIA_PROPERTIES Class Reference

#include <dialog_track_via_properties.h>

Inheritance diagram for DIALOG_TRACK_VIA_PROPERTIES:
DIALOG_TRACK_VIA_PROPERTIES_BASE DIALOG_SHIM KIWAY_HOLDER

Public Member Functions

 DIALOG_TRACK_VIA_PROPERTIES (PCB_BASE_FRAME *aParent, const SELECTION &aItems, COMMIT &aCommit)
 
bool TransferDataFromWindow () override
 
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 ()
 
bool Show (bool show) override
 
bool Enable (bool enable) override
 
void OnPaint (wxPaintEvent &event)
 
EDA_UNITS_T GetUserUnits () const override
 
KIWAYKiway () const
 Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in. More...
 
PROJECTPrj () const
 Function Prj returns a reference to the PROJECT "associated with" this KIWAY. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 Function SetKiway. More...
 

Protected 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)
 Convert an integer number of dialog units to pixels, horizontally. More...
 
int VertPixelsFromDU (int y)
 Convert an integer number of dialog units to pixels, vertically. More...
 

Protected Attributes

wxBoxSizer * m_MainSizer
 
wxStaticBoxSizer * m_sbCommonSizer
 
wxStaticText * m_netSelectorLabel
 
NET_SELECTORm_netSelector
 
wxCheckBox * m_lockedCbox
 
wxStaticBoxSizer * m_sbTrackSizer
 
wxStaticText * m_TrackStartXLabel
 
wxTextCtrl * m_TrackStartXCtrl
 
wxStaticText * m_TrackStartXUnit
 
wxStaticText * m_TrackStartYLabel
 
wxTextCtrl * m_TrackStartYCtrl
 
wxStaticText * m_TrackStartYUnit
 
wxStaticText * m_TrackEndXLabel
 
wxTextCtrl * m_TrackEndXCtrl
 
wxStaticText * m_TrackEndXUnit
 
wxStaticText * m_TrackEndYLabel
 
wxTextCtrl * m_TrackEndYCtrl
 
wxStaticText * m_TrackEndYUnit
 
wxStaticText * m_DesignRuleWidths
 
wxChoice * m_DesignRuleWidthsCtrl
 
wxStaticText * m_DesignRuleWidthsUnits
 
wxStaticText * m_TrackWidthLabel
 
wxTextCtrl * m_TrackWidthCtrl
 
wxStaticText * m_TrackWidthUnit
 
wxCheckBox * m_trackNetclass
 
wxStaticText * m_TrackLayerLabel
 
PCB_LAYER_BOX_SELECTORm_TrackLayerCtrl
 
wxStaticBoxSizer * m_sbViaSizer
 
wxStaticText * m_ViaXLabel
 
wxTextCtrl * m_ViaXCtrl
 
wxStaticText * m_ViaXUnit
 
wxStaticText * m_ViaYLabel
 
wxTextCtrl * m_ViaYCtrl
 
wxStaticText * m_ViaYUnit
 
wxStaticText * m_DesignRuleVias
 
wxChoice * m_DesignRuleViasCtrl
 
wxStaticText * m_DesignRuleViasUnit
 
wxStaticText * m_ViaDiameterLabel
 
wxTextCtrl * m_ViaDiameterCtrl
 
wxStaticText * m_ViaDiameterUnit
 
wxStaticText * m_ViaDrillLabel
 
wxTextCtrl * m_ViaDrillCtrl
 
wxStaticText * m_ViaDrillUnit
 
wxCheckBox * m_viaNetclass
 
wxStaticText * m_ViaTypeLabel
 
wxChoice * m_ViaTypeChoice
 
wxStaticText * m_ViaStartLayerLabel
 
PCB_LAYER_BOX_SELECTORm_ViaStartLayer
 
wxStaticText * m_ViaEndLayerLabel1
 
PCB_LAYER_BOX_SELECTORm_ViaEndLayer
 
wxStdDialogButtonSizer * m_StdButtons
 
wxButton * m_StdButtonsOK
 
wxButton * m_StdButtonsCancel
 
EDA_UNITS_T m_units
 
std::string m_hash_key
 
bool m_firstPaintEvent
 
wxWindow * m_initialFocusTarget
 
WX_EVENT_LOOPm_qmodal_loop
 
bool m_qmodal_showing
 
WDO_ENABLE_DISABLEm_qmodal_parent_disabler
 

Private Member Functions

void onTrackNetclassCheck (wxCommandEvent &aEvent) override
 
void onWidthSelect (wxCommandEvent &aEvent)
 
void onWidthEdit (wxCommandEvent &aEvent)
 
void onViaNetclassCheck (wxCommandEvent &aEvent) override
 
void onViaSelect (wxCommandEvent &aEvent)
 
void onViaEdit (wxCommandEvent &aEvent)
 
bool confirmPadChange (const std::vector< D_PAD * > &connectedPads)
 

Private Attributes

PCB_BASE_FRAMEm_frame
 
const SELECTIONm_items
 
COMMITm_commit
 
UNIT_BINDER m_trackStartX
 
UNIT_BINDER m_trackStartY
 
UNIT_BINDER m_trackEndX
 
UNIT_BINDER m_trackEndY
 
UNIT_BINDER m_trackWidth
 
UNIT_BINDER m_viaX
 
UNIT_BINDER m_viaY
 
UNIT_BINDER m_viaDiameter
 
UNIT_BINDER m_viaDrill
 
bool m_tracks
 
bool m_vias
 

Detailed Description

Definition at line 36 of file dialog_track_via_properties.h.

Constructor & Destructor Documentation

DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES ( PCB_BASE_FRAME aParent,
const SELECTION aItems,
COMMIT aCommit 
)

Definition at line 39 of file dialog_track_via_properties.cpp.

References LSET::AllNonCuMask(), VIA::BottomLayer(), SELECTION::Empty(), DIALOG_SHIM::FinishDialogSettings(), GetAbbreviatedUnitsLabel(), PCB_BASE_FRAME::GetBoard(), PCB_BASE_FRAME::GetDesignSettings(), VIA::GetDrillValue(), TRACK::GetEnd(), BOARD_ITEM::GetLayer(), LAYER_BOX_SELECTOR::GetLayerSelection(), BOARD::GetNetInfo(), VIA::GetPosition(), TRACK::GetStart(), UNIT_BINDER::GetValue(), VIA::GetViaType(), TRACK::GetWidth(), INDETERMINATE, TRACK::IsLocked(), DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleViasCtrl, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleViasUnit, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleWidthsCtrl, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleWidthsUnits, VIA_DIMENSION::m_Diameter, VIA_DIMENSION::m_Drill, m_items, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_lockedCbox, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_MainSizer, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_netSelector, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_sbTrackSizer, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_sbViaSizer, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_StdButtonsOK, m_trackEndX, m_trackEndY, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackLayerCtrl, m_tracks, m_trackStartX, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackStartXCtrl, m_trackStartY, m_trackWidth, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackWidthCtrl, BOARD_DESIGN_SETTINGS::m_TrackWidthList, DIALOG_SHIM::m_units, m_viaDiameter, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaDiameterCtrl, m_viaDrill, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaDrillCtrl, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaEndLayer, m_vias, BOARD_DESIGN_SETTINGS::m_ViasDimensionsList, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaStartLayer, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaTypeChoice, m_viaX, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaXCtrl, m_viaY, onViaEdit(), onViaSelect(), onWidthEdit(), onWidthSelect(), PCB_TRACE_T, PCB_VIA_T, PCB_LAYER_BOX_SELECTOR::Resync(), PCB_LAYER_BOX_SELECTOR::SetBoardFrame(), NET_SELECTOR::SetIndeterminate(), DIALOG_SHIM::SetInitialFocus(), LAYER_BOX_SELECTOR::SetLayerSelection(), LAYER_SELECTOR::SetLayersHotkeys(), NET_SELECTOR::SetNetInfo(), PCB_LAYER_BOX_SELECTOR::SetNotAllowedLayerSet(), NET_SELECTOR::SetSelectedNetcode(), UNIT_BINDER::SetValue(), StringFromValue(), VIA::TopLayer(), UNDEFINED_LAYER, VIA_BLIND_BURIED, VIA_MICROVIA, VIA_NOT_DEFINED, VIA_THROUGH, wxPoint::x, and wxPoint::y.

41  :
43  m_frame( aParent ),
44  m_items( aItems ),
45  m_commit( aCommit ),
55  m_tracks( false ),
56  m_vias( false )
57 {
58  wxASSERT( !m_items.Empty() );
59 
60  VIATYPE_T viaType = VIA_NOT_DEFINED;
61 
62  m_netSelector->SetNetInfo( &aParent->GetBoard()->GetNetInfo() );
63 
66  m_TrackLayerCtrl->SetBoardFrame( aParent );
68 
71  m_ViaStartLayer->SetBoardFrame( aParent );
73 
76  m_ViaEndLayer->SetBoardFrame( aParent );
78 
79  bool nets = false;
80  int net = 0;
81  bool hasLocked = false;
82  bool hasUnlocked = false;
83 
84  // Look for values that are common for every item that is selected
85  for( auto& item : m_items )
86  {
87  if( !nets )
88  {
89  net = static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode();
90  nets = true;
91  }
92  else if( net != static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode() )
93  {
94  net = -1;
95  }
96 
97  switch( item->Type() )
98  {
99  case PCB_TRACE_T:
100  {
101  const TRACK* t = static_cast<const TRACK*>( item );
102 
103  if( !m_tracks ) // first track in the list
104  {
107  m_trackEndX.SetValue( t->GetEnd().x );
108  m_trackEndY.SetValue( t->GetEnd().y );
111  m_tracks = true;
112  }
113  else // check if values are the same for every selected track
114  {
115  if( m_trackStartX.GetValue() != t->GetStart().x )
117 
118  if( m_trackStartY.GetValue() != t->GetStart().y )
120 
121  if( m_trackEndX.GetValue() != t->GetEnd().x )
123 
124  if( m_trackEndY.GetValue() != t->GetEnd().y )
126 
127  if( m_trackWidth.GetValue() != t->GetWidth() )
129 
132  }
133 
134  if( t->IsLocked() )
135  hasLocked = true;
136  else
137  hasUnlocked = true;
138 
139  break;
140  }
141 
142  case PCB_VIA_T:
143  {
144  const VIA* v = static_cast<const VIA*>( item );
145 
146  if( !m_vias ) // first via in the list
147  {
148  m_viaX.SetValue( v->GetPosition().x );
149  m_viaY.SetValue( v->GetPosition().y );
152  m_vias = true;
153  viaType = v->GetViaType();
156  }
157  else // check if values are the same for every selected via
158  {
159  if( m_viaX.GetValue() != v->GetPosition().x )
161 
162  if( m_viaY.GetValue() != v->GetPosition().y )
164 
165  if( m_viaDiameter.GetValue() != v->GetWidth() )
167 
168  if( m_viaDrill.GetValue() != v->GetDrillValue() )
170 
171  if( viaType != v->GetViaType() )
172  viaType = VIA_NOT_DEFINED;
173 
176 
179  }
180 
181  if( v->IsLocked() )
182  hasLocked = true;
183  else
184  hasUnlocked = true;
185 
186  break;
187  }
188 
189  default:
190  {
191  wxASSERT( false );
192  break;
193  }
194  }
195  }
196 
197  if ( net >= 0 )
199  else
201 
202  wxASSERT( m_tracks || m_vias );
203 
204  if( m_vias )
205  {
207 
208  int viaSelection = wxNOT_FOUND;
209 
210  for( unsigned ii = 0; ii < aParent->GetDesignSettings().m_ViasDimensionsList.size(); ii++ )
211  {
212  VIA_DIMENSION* viaDimension = &aParent->GetDesignSettings().m_ViasDimensionsList[ii];
213  wxString msg = StringFromValue( m_units, viaDimension->m_Diameter, false, true )
214  + " / " + StringFromValue( m_units, viaDimension->m_Drill, false, true );
215  m_DesignRuleViasCtrl->Append( msg, viaDimension );
216 
217  if( viaSelection == wxNOT_FOUND
218  && m_viaDiameter.GetValue() == viaDimension->m_Diameter
219  && m_viaDrill.GetValue() == viaDimension->m_Drill )
220  {
221  viaSelection = ii;
222  }
223  }
224 
225  m_DesignRuleViasCtrl->SetSelection( viaSelection );
226 
227  m_DesignRuleViasCtrl->Connect( wxEVT_CHOICE, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onViaSelect ), NULL, this );
228  m_ViaDiameterCtrl->Connect( wxEVT_TEXT, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onViaEdit ), NULL, this );
229  m_ViaDrillCtrl->Connect( wxEVT_TEXT, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onViaEdit ), NULL, this );
230  m_ViaTypeChoice->Connect( wxEVT_CHOICE, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onViaEdit ), NULL, this );
231 
233 
234  m_ViaTypeChoice->Enable();
235 
236  switch( viaType )
237  {
238  case VIA_THROUGH: m_ViaTypeChoice->SetSelection( 0 ); break;
239  case VIA_MICROVIA: m_ViaTypeChoice->SetSelection( 1 ); break;
240  case VIA_BLIND_BURIED: m_ViaTypeChoice->SetSelection( 2 ); break;
241  case VIA_NOT_DEFINED: m_ViaTypeChoice->SetSelection( 3 ); break;
242  }
243 
244  m_ViaStartLayer->Enable( viaType != VIA_THROUGH );
245  m_ViaEndLayer->Enable( viaType != VIA_THROUGH );
246  }
247  else
248  {
249  m_MainSizer->Hide( m_sbViaSizer, true );
250  }
251 
252  if( m_tracks )
253  {
255 
256  int widthSelection = wxNOT_FOUND;
257 
258  for( unsigned ii = 0; ii < aParent->GetDesignSettings().m_TrackWidthList.size(); ii++ )
259  {
260  int width = aParent->GetDesignSettings().m_TrackWidthList[ii];
261  wxString msg = StringFromValue( m_units, width, false, true );
262  m_DesignRuleWidthsCtrl->Append( msg );
263 
264  if( widthSelection == wxNOT_FOUND && m_trackWidth.GetValue() == width )
265  widthSelection = ii;
266  }
267 
268  m_DesignRuleWidthsCtrl->SetSelection( widthSelection );
269 
270  m_DesignRuleWidthsCtrl->Connect( wxEVT_CHOICE, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onWidthSelect ), NULL, this );
271  m_TrackWidthCtrl->Connect( wxEVT_TEXT, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES::onWidthEdit ), NULL, this );
272 
274  }
275  else
276  {
277  m_MainSizer->Hide( m_sbTrackSizer, true );
278  }
279 
280  if( hasLocked && hasUnlocked )
281  m_lockedCbox->Set3StateValue( wxCHK_UNDETERMINED );
282  else if( hasLocked )
283  m_lockedCbox->Set3StateValue( wxCHK_CHECKED );
284  else
285  m_lockedCbox->Set3StateValue( wxCHK_UNCHECKED );
286 
288 
289  m_StdButtonsOK->SetDefault();
290 
291  // Now all widgets have the size fixed, call FinishDialogSettings
293 }
bool IsLocked() const override
Function IsLocked.
Definition: class_track.h:137
Struct VIA_DIMENSION is a small helper container to handle a stock of specific vias each with unique ...
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:116
PCB_LAYER_ID BottomLayer() const
std::vector< int > m_TrackWidthList
void SetNotAllowedLayerSet(LSET aMask)
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
static LSET AllNonCuMask()
Function AllNonCuMask returns a mask holding all layer minus CU layers.
Definition: lset.cpp:696
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
void onWidthSelect(wxCommandEvent &aEvent)
BOARD * GetBoard() const
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
VIATYPE_T
Definition: class_track.h:50
Class BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected an...
DIALOG_TRACK_VIA_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Track & Via Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU)
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:86
void onWidthEdit(wxCommandEvent &aEvent)
const wxPoint & GetEnd() const
Definition: class_track.h:119
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
virtual int GetValue()
Function GetValue Returns the current value in Internal Units.
VIATYPE_T GetViaType() const
Definition: class_track.h:454
#define INDETERMINATE
const wxPoint & GetStart() const
Definition: class_track.h:122
void SetSelectedNetcode(int aNetcode)
int SetLayerSelection(LAYER_NUM layer)
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
void SetNetInfo(NETINFO_LIST *aNetInfoList)
bool SetLayersHotkeys(bool value)
NETINFO_LIST & GetNetInfo()
Definition: class_board.h:750
const wxPoint GetPosition() const override
Definition: class_track.h:426
void onViaSelect(wxCommandEvent &aEvent)
void onViaEdit(wxCommandEvent &aEvent)
void SetIndeterminate()
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
PCB_LAYER_ID TopLayer() const
int GetWidth() const
Definition: class_track.h:116
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
LAYER_NUM GetLayerSelection() const
std::vector< VIA_DIMENSION > m_ViasDimensionsList
wxString StringFromValue(EDA_UNITS_T aUnits, int aValue, bool aAddUnitSymbol, bool aUseMils)
Function StringFromValue returns the string from aValue according to units (inch, mm ...
Definition: base_units.cpp:210
#define MIN_SIZE
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
EDA_UNITS_T m_units
Definition: dialog_shim.h:143
wxString GetAbbreviatedUnitsLabel(EDA_UNITS_T aUnit, bool aUseMils)
Get the units string for a given units type.
Definition: base_units.cpp:432

Member Function Documentation

bool DIALOG_TRACK_VIA_PROPERTIES::confirmPadChange ( const std::vector< D_PAD * > &  connectedPads)
private

Definition at line 296 of file dialog_track_via_properties.cpp.

References KIDIALOG::DoNotShowCheckbox(), D_PAD::GetName(), D_PAD::GetParent(), MODULE::GetReference(), DIALOG_TRACK_VIA_PROPERTIES_BASE::m_netSelector, and KIDIALOG::ShowModal().

Referenced by TransferDataFromWindow().

297 {
298  wxString msg;
299 
300  if( changingPads.size() == 1 )
301  {
302  D_PAD* pad = *changingPads.begin();
303  msg.Printf( _( "This will change the net assigned to %s pad %s to %s.\n"
304  "Do you wish to continue?" ),
305  pad->GetParent()->GetReference(),
306  pad->GetName(),
307  m_netSelector->GetValue() );
308  }
309  else if( changingPads.size() == 2 )
310  {
311  D_PAD* pad1 = *changingPads.begin();
312  D_PAD* pad2 = *( ++changingPads.begin() );
313  msg.Printf( _( "This will change the net assigned to %s pad %s and %s pad %s to %s.\n"
314  "Do you wish to continue?" ),
315  pad1->GetParent()->GetReference(),
316  pad1->GetName(),
317  pad2->GetParent()->GetReference(),
318  pad2->GetName(),
319  m_netSelector->GetValue() );
320  }
321  else
322  {
323  msg.Printf( _( "This will change the net assigned to %d connected pads to %s.\n"
324  "Do you wish to continue?" ),
325  changingPads.size(),
326  m_netSelector->GetValue() );
327  }
328 
329  KIDIALOG dlg( this, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
330  dlg.SetOKLabel( _( "Continue" ) );
331  dlg.DoNotShowCheckbox( __FILE__, __LINE__ );
332 
333  return dlg.ShowModal() == wxID_OK;
334 }
Helper class to create more flexible dialogs, including &#39;do not show again&#39; checkbox handling...
Definition: confirm.h:44
MODULE * GetParent() const
Definition: class_pad.h:162
const wxString & GetName() const
Definition: class_pad.h:190
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:463
bool DIALOG_SHIM::Enable ( bool  enable)
overrideinherited

Definition at line 221 of file dialog_shim.cpp.

Referenced by DIALOG_SHIM::IsQuasiModal().

222 {
223  // so we can do logging of this state change:
224 
225 #if defined(DEBUG)
226  const char* type_id = typeid( *this ).name();
227  printf( "wxDialog %s: %s\n", type_id, enable ? "enabled" : "disabled" );
228 #endif
229 
230  return wxDialog::Enable( enable );
231 }
void DIALOG_SHIM::EndQuasiModal ( int  retCode)
inherited

Definition at line 381 of file dialog_shim.cpp.

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

Referenced by DIALOG_SHIM::OnButton(), DIALOG_PRINT_GENERIC::onCloseButton(), DIALOG_CHOOSE_FOOTPRINT::OnCloseTimer(), DIALOG_CHOOSE_COMPONENT::OnCloseTimer(), DIALOG_SHIM::OnCloseWindow(), DIALOG_CHOOSE_FOOTPRINT::OnUseBrowser(), DIALOG_CHOOSE_COMPONENT::OnUseBrowser(), DIALOG_SHIM::SetInitialFocus(), and DIALOG_SHIM::~DIALOG_SHIM().

382 {
383  // Hook up validator and transfer data from controls handling so quasi-modal dialogs
384  // handle validation in the same way as other dialogs.
385  if( ( retCode == wxID_OK ) && ( !Validate() || !TransferDataFromWindow() ) )
386  return;
387 
388  SetReturnCode( retCode );
389 
390  if( !IsQuasiModal() )
391  {
392  wxFAIL_MSG( wxT( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal wasn't called" ) );
393  return;
394  }
395 
396  if( m_qmodal_loop )
397  {
398  if( m_qmodal_loop->IsRunning() )
399  m_qmodal_loop->Exit( 0 );
400  else
401  m_qmodal_loop->ScheduleExit( 0 );
402 
403  m_qmodal_loop = NULL;
404  }
405 
408 
409  Show( false );
410 }
WX_EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:153
bool IsQuasiModal()
Definition: dialog_shim.h:95
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:155
void DIALOG_SHIM::FinishDialogSettings ( )
protectedinherited

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

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

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

Definition at line 120 of file dialog_shim.cpp.

References PCAD2KICAD::Center.

Referenced by DIALOG_3D_VIEW_OPTIONS::DIALOG_3D_VIEW_OPTIONS(), DIALOG_ANNOTATE::DIALOG_ANNOTATE(), DIALOG_BOM::DIALOG_BOM(), DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE(), DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC(), DIALOG_EDIT_COMPONENTS_LIBID::DIALOG_EDIT_COMPONENTS_LIBID(), DIALOG_EDIT_LINE_STYLE::DIALOG_EDIT_LINE_STYLE(), DIALOG_ENUM_PADS::DIALOG_ENUM_PADS(), DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS(), DIALOG_EXPORT_3DFILE::DIALOG_EXPORT_3DFILE(), DIALOG_EXPORT_IDF3::DIALOG_EXPORT_IDF3(), DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP(), DIALOG_EXPORT_SVG::DIALOG_EXPORT_SVG(), DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL(), DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR(), DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST(), DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS(), DIALOG_FP_BROWSER_DISPLAY_OPTIONS::DIALOG_FP_BROWSER_DISPLAY_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_SYM_LIB_TABLE_CONFIG::DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG(), DIALOG_IMAGE_EDITOR::DIALOG_IMAGE_EDITOR(), DIALOG_KEEPOUT_AREA_PROPERTIES::DIALOG_KEEPOUT_AREA_PROPERTIES(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_LIB_EDIT_DRAW_ITEM::DIALOG_LIB_EDIT_DRAW_ITEM(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), DIALOG_LIB_EDIT_TEXT::DIALOG_LIB_EDIT_TEXT(), DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT(), DIALOG_LIST_HOTKEYS::DIALOG_LIST_HOTKEYS(), DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT(), DIALOG_NETLIST::DIALOG_NETLIST(), DIALOG_NON_COPPER_ZONES_EDITOR::DIALOG_NON_COPPER_ZONES_EDITOR(), DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC(), 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_SCH_EDIT_SHEET_PIN::DIALOG_SCH_EDIT_SHEET_PIN(), DIALOG_SCH_SHEET_PROPS::DIALOG_SCH_SHEET_PROPS(), DIALOG_SELECT_NET_FROM_LIST::DIALOG_SELECT_NET_FROM_LIST(), DIALOG_SET_GRID::DIALOG_SET_GRID(), DIALOG_SWAP_LAYERS::DIALOG_SWAP_LAYERS(), DIALOG_TARGET_PROPERTIES::DIALOG_TARGET_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES(), DIALOG_TRACK_VIA_SIZE::DIALOG_TRACK_VIA_SIZE(), DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB(), PAGED_DIALOG::finishInitialization(), DIALOG_SHIM::GetUserUnits(), DIALOG_EDIT_ONE_FIELD::init(), DIALOG_EDIT_LIBRARY_TABLES::InstallPanel(), NETLIST_DIALOG::NETLIST_DIALOG(), DIALOG_GRAPHIC_ITEM_PROPERTIES::OnInitDlg(), DIALOG_SIM_SETTINGS::onInitDlg(), DIALOG_SPICE_MODEL::onInitDlg(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnInitDlg(), DIALOG_SIGNAL_LIST::TransferDataToWindow(), DIALOG_UPDATE_FIELDS::TransferDataToWindow(), and DIALOG_COLOR_PICKER::TransferDataToWindow().

121 {
122  // must be called from the constructor of derived classes,
123  // when all widgets are initialized, and therefore their size fixed
124 
125  // SetSizeHints fixes the minimal size of sizers in the dialog
126  // (SetSizeHints calls Fit(), so no need to call it)
127  GetSizer()->SetSizeHints( this );
128 
129  // the default position, when calling the first time the dlg
130  Center();
131 }
int DIALOG_SHIM::HorizPixelsFromDU ( int  x)
protectedinherited

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

See SetSizeInDU or wxDialog documentation for more information.

Definition at line 141 of file dialog_shim.cpp.

Referenced by DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), and DIALOG_SHIM::GetUserUnits().

142 {
143  wxSize sz( x, 0 );
144  return ConvertDialogToPixels( sz ).x;
145 }
KIWAY& KIWAY_HOLDER::Kiway ( ) const
inlineinherited

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

A KIWAY_HOLDER is not necessarily a KIWAY_PLAYER.

Definition at line 60 of file kiway_player.h.

References KIWAY_HOLDER::GetUserUnits(), KIWAY_HOLDER::m_kiway, KIWAY_HOLDER::Prj(), KIWAY_HOLDER::SetKiway(), and VTBL_ENTRY.

Referenced by TREEPROJECT_ITEM::Activate(), PCB_BASE_EDIT_FRAME::AddLibrary(), SCH_EDIT_FRAME::AppendSchematic(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_CHOOSE_FOOTPRINT::ConstructRightPanel(), DIALOG_CHOOSE_COMPONENT::ConstructRightPanel(), PCB_BASE_FRAME::CreateAndShow3D_Frame(), CVPCB_MAINFRAME::CreateScreenCmp(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_SHIM::DIALOG_SHIM(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), EDIT_TOOL::editFootprintInFpEditor(), SCH_EDIT_FRAME::EditSheet(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), LIB_MANAGER::GetBufferedPart(), LIB_MANAGER::getLibraryBuffer(), FOOTPRINT_EDIT_FRAME::GetPlotSettings(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::KiwayMailIn(), KIWAY_PLAYER::language_change(), KICAD_MANAGER_FRAME::language_change(), CVPCB_MAINFRAME::LoadFootprintFiles(), KICAD_MANAGER_FRAME::LoadProject(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), TEXT_BUTTON_FP_CHOOSER::OnButtonClick(), KICAD_MANAGER_FRAME::OnCloseWindow(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), KICAD_MANAGER_FRAME::OnEditFpLibTable(), SCH_BASE_FRAME::OnEditSymbolLibTable(), KICAD_MANAGER_FRAME::OnEditSymLibTable(), KICAD_MANAGER_FRAME::OnImportEagleFiles(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), SCH_EDIT_FRAME::OnLeftClick(), SCH_BASE_FRAME::OnOpenLibraryViewer(), KICAD_MANAGER_FRAME::OnRunPcbFpEditor(), KICAD_MANAGER_FRAME::OnRunSchLibEditor(), SCH_EDIT_FRAME::OnSimulate(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), SCH_EDIT_FRAME::OpenProjectFiles(), KIWAY_HOLDER::Prj(), PCB_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Special_Functions(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), FOOTPRINT_WIZARD_FRAME::ReCreateVToolbar(), LIB_EDIT_FRAME::refreshSchematic(), KICAD_MANAGER_FRAME::RunEeschema(), KICAD_MANAGER_FRAME::RunPcbNew(), SCH_EDIT_FRAME::SaveEEFile(), CVPCB_MAINFRAME::SaveFootprintAssociation(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_BASE_FRAME::SelectComponentFromLibBrowser(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlist(), FOOTPRINT_EDIT_FRAME::SetPlotSettings(), FOOTPRINT_VIEWER_FRAME::Show3D_Frame(), FOOTPRINT_WIZARD_FRAME::Show3D_Frame(), EDA_BASE_FRAME::ShowPreferences(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::UpdatePart(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

61  {
62  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
63  return *m_kiway;
64  }
KIWAY * m_kiway
Definition: kiway_player.h:94
void DIALOG_SHIM::OnPaint ( wxPaintEvent &  event)
inherited

Definition at line 283 of file dialog_shim.cpp.

References DIALOG_SHIM::m_firstPaintEvent, and DIALOG_SHIM::m_initialFocusTarget.

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

284 {
285  if( m_firstPaintEvent )
286  {
287 #ifdef __WXMAC__
288  fixOSXCancelButtonIssue( this );
289  selectAllInTextCtrls( GetChildren() );
290 #endif
291 
293  m_initialFocusTarget->SetFocus();
294  else
295  SetFocus(); // Focus the dialog itself
296 
297  m_firstPaintEvent = false;
298  }
299 
300  event.Skip();
301 }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:150
bool m_firstPaintEvent
Definition: dialog_shim.h:149
void DIALOG_TRACK_VIA_PROPERTIES::onTrackNetclassCheck ( wxCommandEvent &  aEvent)
overrideprivatevirtual

Reimplemented from DIALOG_TRACK_VIA_PROPERTIES_BASE.

Definition at line 539 of file dialog_track_via_properties.cpp.

References UNIT_BINDER::Enable(), DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleWidths, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleWidthsCtrl, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleWidthsUnits, and m_trackWidth.

540 {
541  bool enableNC = aEvent.IsChecked();
542 
543  m_DesignRuleWidths->Enable( !enableNC );
544  m_DesignRuleWidthsCtrl->Enable( !enableNC );
545  m_DesignRuleWidthsUnits->Enable( !enableNC );
546 
547  m_trackWidth.Enable( !enableNC );
548 }
void Enable(bool aEnable)
Function Enable Enables/diasables the label, widget and units label.
void DIALOG_TRACK_VIA_PROPERTIES::onViaEdit ( wxCommandEvent &  aEvent)
private

Definition at line 585 of file dialog_track_via_properties.cpp.

References B_Cu, F_Cu, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleViasCtrl, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaEndLayer, m_vias, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaStartLayer, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaTypeChoice, and LAYER_BOX_SELECTOR::SetLayerSelection().

Referenced by DIALOG_TRACK_VIA_PROPERTIES().

586 {
587  m_DesignRuleViasCtrl->SetSelection( wxNOT_FOUND );
588 
589  if( m_vias )
590  {
591  if( m_ViaTypeChoice->GetSelection() != 0 ) // check if selected type isnt through.
592  {
593  m_ViaStartLayer->Enable();
594  m_ViaEndLayer->Enable();
595  }
596  else
597  {
600 
601  m_ViaStartLayer->Enable( false );
602  m_ViaEndLayer->Enable( false );
603  }
604  }
605 }
int SetLayerSelection(LAYER_NUM layer)
void DIALOG_TRACK_VIA_PROPERTIES::onViaNetclassCheck ( wxCommandEvent &  aEvent)
overrideprivatevirtual

Reimplemented from DIALOG_TRACK_VIA_PROPERTIES_BASE.

Definition at line 563 of file dialog_track_via_properties.cpp.

References UNIT_BINDER::Enable(), DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleVias, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleViasCtrl, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleViasUnit, m_viaDiameter, and m_viaDrill.

564 {
565  bool enableNC = aEvent.IsChecked();
566 
567  m_DesignRuleVias->Enable( !enableNC );
568  m_DesignRuleViasCtrl->Enable( !enableNC );
569  m_DesignRuleViasUnit->Enable( !enableNC );
570 
571  m_viaDiameter.Enable( !enableNC );
572  m_viaDrill.Enable( !enableNC );
573 }
void Enable(bool aEnable)
Function Enable Enables/diasables the label, widget and units label.
void DIALOG_TRACK_VIA_PROPERTIES::onViaSelect ( wxCommandEvent &  aEvent)
private

Definition at line 576 of file dialog_track_via_properties.cpp.

References UNIT_BINDER::ChangeValue(), VIA_DIMENSION::m_Diameter, VIA_DIMENSION::m_Drill, m_viaDiameter, and m_viaDrill.

Referenced by DIALOG_TRACK_VIA_PROPERTIES().

577 {
578  VIA_DIMENSION* viaDimension = static_cast<VIA_DIMENSION*> ( aEvent.GetClientData() );
579 
580  m_viaDiameter.ChangeValue( viaDimension->m_Diameter );
581  m_viaDrill.ChangeValue( viaDimension->m_Drill );
582 }
Struct VIA_DIMENSION is a small helper container to handle a stock of specific vias each with unique ...
virtual void ChangeValue(int aValue)
Function ChangeValue Changes the value (in Internal Units) for the text field, taking care of units c...
void DIALOG_TRACK_VIA_PROPERTIES::onWidthEdit ( wxCommandEvent &  aEvent)
private

Definition at line 557 of file dialog_track_via_properties.cpp.

References DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleWidthsCtrl.

Referenced by DIALOG_TRACK_VIA_PROPERTIES().

558 {
559  m_DesignRuleWidthsCtrl->SetSelection( wxNOT_FOUND );
560 }
void DIALOG_TRACK_VIA_PROPERTIES::onWidthSelect ( wxCommandEvent &  aEvent)
private
PROJECT & KIWAY_HOLDER::Prj ( ) const
inherited

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

Definition at line 34 of file kiway_holder.cpp.

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

Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), LIB_MANAGER::addLibrary(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), DIALOG_SYMBOL_REMAP::backupProject(), LIB_VIEW_FRAME::BestZoom(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_FOOTPRINT_FP_EDITOR::Cfg3DPath(), DIALOG_FOOTPRINT_BOARD_EDITOR::Cfg3DPath(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::checkAliasName(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), KICAD_MANAGER_FRAME::CreateNewProject(), DIALOG_PLOT_SCHEMATIC::createPlotFileName(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromLibrary(), DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP(), LIB_VIEW_FRAME::DisplayLibInfos(), SCH_BASE_FRAME::DisplayListComponentsInLib(), PCB_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::EditSheet(), PCB_EDIT_FRAME::Export_IDF3(), PCB_EDIT_FRAME::Files_io_from_id(), NETLIST_DIALOG::GenNetlist(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), LIB_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), SCH_BASE_FRAME::GetLibAlias(), SCH_BASE_FRAME::GetLibPart(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), DIALOG_BOM::getPluginFileName(), KICAD_MANAGER_FRAME::GetProjectFileName(), LIB_VIEW_FRAME::getSelectedAlias(), FP_THREAD_IFACE::GetTable(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), FOOTPRINT_EDIT_FRAME::initLibraryTree(), PCB_EDIT_FRAME::InstallNetlistFrame(), SCH_EDIT_FRAME::IsSearchCacheObsolete(), KIWAY_HOLDER::Kiway(), LIB_EDIT_FRAME::KiwayMailIn(), EDA_DRAW_FRAME::LibraryFileBrowser(), SCH_EDIT_FRAME::Load_Component(), SCH_EDIT_FRAME::LoadCmpToFootprintLinkFile(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), CVPCB_MAINFRAME::LoadFootprintFiles(), DIALOG_SPICE_MODEL::loadLibrary(), LIB_EDIT_FRAME::LoadOneSymbol(), KICAD_MANAGER_FRAME::LoadProject(), CVPCB_MAINFRAME::LoadProjectFile(), SCH_EDIT_FRAME::LoadProjectFile(), PCB_EDIT_FRAME::LoadProjectSettings(), DIALOG_DRC_CONTROL::makeValidFileNameReport(), DIALOG_FOOTPRINT_FP_EDITOR::On3DModelCellChanged(), DIALOG_FOOTPRINT_BOARD_EDITOR::On3DModelCellChanged(), FOOTPRINT_VIEWER_FRAME::OnActivate(), DIALOG_FOOTPRINT_FP_EDITOR::OnAdd3DModel(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnAdd3DModel(), DIALOG_GENCAD_EXPORT_OPTIONS::onBrowse(), KICAD_MANAGER_FRAME::OnBrowseInFileExplorer(), DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick(), DIALOG_EDIT_COMPONENTS_LIBID::onClickOrphansButton(), CVPCB_MAINFRAME::OnConfigurePaths(), FOOTPRINT_EDIT_FRAME::OnConfigurePaths(), KICAD_MANAGER_FRAME::OnCreateProjectFromTemplate(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), DIALOG_GENDRILL::OnGenReportFile(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), DIALOG_NETLIST::OnOpenNetlistClick(), DIALOG_EXPORT_SVG::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), LIB_EDIT_FRAME::OnPlotCurrentComponent(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), SCH_EDIT_FRAME::OnRightClick(), KICAD_MANAGER_FRAME::OnRunGerbview(), DIALOG_BOM::OnRunPlugin(), FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng(), KICAD_MANAGER_FRAME::OnSaveProject(), DIALOG_SPICE_MODEL::onSelectLibrary(), LIB_VIEW_FRAME::OnSelectSymbol(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), LIB_EDIT_FRAME::OnViewEntryDoc(), LIB_VIEW_FRAME::onViewSymbolDocument(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), PANEL_PREV_3D::PANEL_PREV_3D(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), SCH_EDIT_FRAME::Process_Config(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), LIB_VIEW_FRAME::ReCreateListCmp(), LIB_VIEW_FRAME::ReCreateListLib(), EDA_3D_VIEWER::ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), SCH_EDIT_FRAME::SaveEEFile(), FOOTPRINT_EDIT_FRAME::SaveFootprint(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), FOOTPRINT_EDIT_FRAME::saveFootprintInLibrary(), LIB_EDIT_FRAME::saveLibrary(), LIB_EDIT_FRAME::SaveOneSymbol(), LIB_EDIT_FRAME::savePartAs(), SCH_EDIT_FRAME::SaveProject(), CVPCB_MAINFRAME::SaveProjectFile(), SCH_EDIT_FRAME::SaveProjectSettings(), PCB_EDIT_FRAME::SaveProjectSettings(), SCH_BASE_FRAME::saveSymbolLibTables(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), SCH_BASE_FRAME::SelectComponentFromLibTree(), PCB_BASE_FRAME::SelectLibrary(), SCH_BASE_FRAME::SelectLibraryFromList(), LIB_EDIT_FRAME::selectSymLibTable(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), LIB_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), LIB_EDIT_FRAME::SetCurPart(), KICAD_MANAGER_FRAME::SetProjectFileName(), DIALOG_CHOOSE_COMPONENT::ShowFootprintFor(), FOOTPRINT_VIEWER_FRAME::ShowModal(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::symTable(), FOOTPRINT_EDIT_FRAME::SyncLibraryTree(), EDA_3D_VIEWER::takeScreenshot(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataToWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow(), SIM_PLOT_FRAME::updateNetlistExporter(), SCH_SCREEN::UpdateSymbolLinks(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), FOOTPRINT_EDIT_FRAME::updateTitle(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::Validate(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_FOOTPRINT_BOARD_EDITOR::~DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::~DIALOG_FOOTPRINT_FP_EDITOR(), LAUNCHER_PANEL::~LAUNCHER_PANEL(), and PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME().

35 {
36  return Kiway().Prj();
37 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:60
VTBL_ENTRY PROJECT & Prj() const
Function Prj returns the PROJECT associated with this KIWAY.
Definition: kiway.cpp:142
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 86 of file dialog_shim.h.

References DIALOG_SHIM::EndQuasiModal(), DIALOG_SHIM::m_initialFocusTarget, and DIALOG_SHIM::ShowQuasiModal().

Referenced by DIALOG_BOM::DIALOG_BOM(), DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CONFIGURE_PATHS::DIALOG_CONFIGURE_PATHS(), DIALOG_EDIT_LINE_STYLE::DIALOG_EDIT_LINE_STYLE(), DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL(), DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR(), DIALOG_FP_PLUGIN_OPTIONS::DIALOG_FP_PLUGIN_OPTIONS(), DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_LIB_EDIT_DRAW_ITEM::DIALOG_LIB_EDIT_DRAW_ITEM(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), DIALOG_LIB_EDIT_TEXT::DIALOG_LIB_EDIT_TEXT(), DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_SET_GRID::DIALOG_SET_GRID(), DIALOG_TARGET_PROPERTIES::DIALOG_TARGET_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES(), DIALOG_EDIT_ONE_FIELD::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(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), and LIB_EDIT_FRAME::savePartAs().

87  {
88  m_initialFocusTarget = aWindow;
89  }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:150
void KIWAY_HOLDER::SetKiway ( wxWindow *  aDest,
KIWAY aKiway 
)
inherited

Function SetKiway.

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

Definition at line 47 of file kiway_holder.cpp.

References KIWAY_HOLDER::m_kiway, and name.

Referenced by DIALOG_SHIM::DIALOG_SHIM(), InvokePcbLibTableEditor(), KIWAY_HOLDER::Kiway(), and SIM_PLOT_FRAME::SIM_PLOT_FRAME().

48 {
49 #if defined(DEBUG)
50  // offer a trap point for debugging most any window
51  wxASSERT( aDest );
52  if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) )
53  {
54  int breakhere=1;
55  (void) breakhere;
56  }
57 #endif
58 
59  (void) aDest;
60 
61  m_kiway = aKiway;
62 }
KIWAY * m_kiway
Definition: kiway_player.h:94
const char * name
Definition: DXF_plotter.cpp:61
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 134 of file dialog_shim.cpp.

Referenced by DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_SHIM::GetUserUnits(), HTML_MESSAGE_BOX::HTML_MESSAGE_BOX(), and HTML_MESSAGE_BOX::SetDialogSizeInDU().

135 {
136  wxSize sz( x, y );
137  SetSize( ConvertDialogToPixels( sz ) );
138 }
bool DIALOG_SHIM::Show ( bool  show)
overrideinherited

Definition at line 162 of file dialog_shim.cpp.

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

Referenced by DIALOG_SHIM::EndQuasiModal(), InvokeDialogERC(), DIALOG_SHIM::IsQuasiModal(), SCH_EDIT_FRAME::OnAnnotate(), DIALOG_SCH_FIND::OnCancel(), DIALOG_DRC_CONTROL::OnLeftDClickClearance(), DIALOG_DRC_CONTROL::OnLeftDClickUnconnected(), POSITION_RELATIVE_TOOL::PositionRelative(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), DRC::ShowDRCDialog(), DIALOG_SHIM::ShowQuasiModal(), and DIALOG_POSITION_RELATIVE::UpdateAnchor().

163 {
164  bool ret;
165  const char* hash_key;
166 
167  if( m_hash_key.size() )
168  {
169  // a special case like EDA_LIST_DIALOG, which has multiple uses.
170  hash_key = m_hash_key.c_str();
171  }
172  else
173  {
174  hash_key = typeid(*this).name();
175  }
176 
177  // Show or hide the window. If hiding, save current position and size.
178  // If showing, use previous position and size.
179  if( show )
180  {
181 #ifndef __WINDOWS__
182  wxDialog::Raise(); // Needed on OS X and some other window managers (i.e. Unity)
183 #endif
184  ret = wxDialog::Show( show );
185 
186  // classname is key, returns a zeroed out default EDA_RECT if none existed before.
187  EDA_RECT savedDialogRect = class_map[ hash_key ];
188 
189  if( savedDialogRect.GetSize().x != 0 && savedDialogRect.GetSize().y != 0 )
190  {
191  SetSize( savedDialogRect.GetPosition().x,
192  savedDialogRect.GetPosition().y,
193  std::max( wxDialog::GetSize().x, savedDialogRect.GetSize().x ),
194  std::max( wxDialog::GetSize().y, savedDialogRect.GetSize().y ),
195  0 );
196  }
197 
198  // Be sure that the dialog appears in a visible area
199  // (the dialog position might have been stored at the time when it was
200  // shown on another display)
201  if( wxDisplay::GetFromWindow( this ) == wxNOT_FOUND )
202  Centre();
203  }
204  else
205  {
206  // Save the dialog's position & size before hiding, using classname as key
207  class_map[ hash_key ] = EDA_RECT( wxDialog::GetPosition(), wxDialog::GetSize() );
208 
209 #ifdef __WXMAC__
210  if ( m_eventLoop )
211  m_eventLoop->Exit( GetReturnCode() ); // Needed for APP-MODAL dlgs on OSX
212 #endif
213 
214  ret = wxDialog::Show( show );
215  }
216 
217  return ret;
218 }
const wxSize GetSize() const
Definition: eda_rect.h:101
std::string m_hash_key
Definition: dialog_shim.h:144
static RECT_MAP class_map
const wxPoint GetPosition() const
Definition: eda_rect.h:113
#define max(a, b)
Definition: auxiliary.h:86
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
int DIALOG_SHIM::ShowQuasiModal ( )
inherited

Definition at line 327 of file dialog_shim.cpp.

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

Referenced by SCH_EDIT_FRAME::EditComponent(), SCH_EDIT_FRAME::EditComponentFieldText(), LIB_EDIT_FRAME::EditField(), EDIT_TOOL::ExchangeFootprints(), PCB_EDIT_FRAME::InstallExchangeModuleFrame(), SCH_EDIT_FRAME::InstallHierarchyFrame(), PCB_BASE_FRAME::InstallPadOptionsFrame(), InvokeDialogEditComponentsLibId(), InvokeDialogUpdateFields(), LIB_EDIT_FRAME::OnEditComponentProperties(), PCB_EDIT_FRAME::OnEditTracksAndVias(), SCH_EDIT_FRAME::OnLaunchBomManager(), SCH_EDIT_FRAME::OnRemapSymbols(), LIB_VIEW_FRAME::OnSelectSymbol(), SCH_EDIT_FRAME::OpenProjectFiles(), EDIT_TOOL::Properties(), SCH_BASE_FRAME::SelectComponentFromLibTree(), PCB_BASE_FRAME::SelectFootprintFromLibTree(), and DIALOG_SHIM::SetInitialFocus().

328 {
329  // This is an exception safe way to zero a pointer before returning.
330  // Yes, even though DismissModal() clears this first normally, this is
331  // here in case there's an exception before the dialog is dismissed.
332  struct NULLER
333  {
334  void*& m_what;
335  NULLER( void*& aPtr ) : m_what( aPtr ) {}
336  ~NULLER() { m_what = 0; } // indeed, set it to NULL on destruction
337  } clear_this( (void*&) m_qmodal_loop );
338 
339  // release the mouse if it's currently captured as the window having it
340  // will be disabled when this dialog is shown -- but will still keep the
341  // capture making it impossible to do anything in the modal dialog itself
342  wxWindow* win = wxWindow::GetCapture();
343  if( win )
344  win->ReleaseMouse();
345 
346  // Get the optimal parent
347  wxWindow* parent = GetParentForModalDialog( GetParent(), GetWindowStyle() );
348 
349  // Show the optimal parent
350  DBG( if( parent ) printf( "%s: optimal parent: %s\n", __func__, typeid(*parent).name() );)
351 
352  wxASSERT_MSG( !m_qmodal_parent_disabler,
353  wxT( "Caller using ShowQuasiModal() twice on same window?" ) );
354 
355  // quasi-modal: disable only my "optimal" parent
357 
358 #ifdef __WXMAC__
359  // Apple in its infinite wisdom will raise a disabled window before even passing
360  // us the event, so we have no way to stop it. Instead, we must set an order on
361  // the windows so that the quasi-modal will be pushed in front of the disabled
362  // window when it is raised.
363  ReparentQuasiModal();
364 #endif
365  Show( true );
366 
367  m_qmodal_showing = true;
368 
369  WX_EVENT_LOOP event_loop;
370 
371  m_qmodal_loop = &event_loop;
372 
373  event_loop.Run();
374 
375  m_qmodal_showing = false;
376 
377  return GetReturnCode();
378 }
bool m_qmodal_showing
Definition: dialog_shim.h:154
#define WX_EVENT_LOOP
Definition: kiway_player.h:100
WX_EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:153
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:155
Toggle a window&#39;s "enable" status to disabled, then enabled on destruction.
Definition: dialog_shim.cpp:33
#define DBG(x)
Definition: fctsys.h:33
bool DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow ( )
override

Definition at line 337 of file dialog_track_via_properties.cpp.

References confirmPadChange(), DisplayError(), PCB_BASE_FRAME::GetBoard(), BOARD::GetConnectivity(), TRACK::GetEnd(), LAYER_BOX_SELECTOR::GetLayerSelection(), BOARD_CONNECTED_ITEM::GetNetClass(), VIA::GetPosition(), NET_SELECTOR::GetSelectedNetcode(), TRACK::GetStart(), UNIT_BINDER::GetValue(), VIA::GetViaType(), NET_SELECTOR::IsIndeterminate(), UNIT_BINDER::IsIndeterminate(), m_commit, m_frame, m_items, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_lockedCbox, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_netSelector, m_trackEndX, m_trackEndY, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackLayerCtrl, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_trackNetclass, m_tracks, m_trackStartX, m_trackStartY, m_trackWidth, m_viaDiameter, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaDiameterCtrl, m_viaDrill, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaDrillCtrl, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaEndLayer, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_viaNetclass, m_vias, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaStartLayer, DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaTypeChoice, m_viaX, m_viaY, COMMIT::Modify(), PCB_TRACE_T, PCB_VIA_T, COMMIT::Push(), VIA::SanitizeLayers(), VIA::SetBottomLayer(), VIA::SetDrill(), TRACK::SetEnd(), BOARD_ITEM::SetLayer(), TRACK::SetLocked(), BOARD_CONNECTED_ITEM::SetNetCode(), VIA::SetPosition(), TRACK::SetStart(), VIA::SetTopLayer(), VIA::SetViaType(), TRACK::SetWidth(), UNDEFINED_LAYER, UNIT_BINDER::Validate(), VIA_BLIND_BURIED, VIA_MICROVIA, VIA_THROUGH, wxPoint::x, and wxPoint::y.

338 {
339  auto connectivity = m_frame->GetBoard()->GetConnectivity();
340  int newNetCode = m_netSelector->GetSelectedNetcode();
341  std::vector<D_PAD*> changingPads;
342 
343  if ( !m_netSelector->IsIndeterminate() )
344  {
345  std::set<D_PAD*> connectedPads;
346 
347  for( auto& item : m_items )
348  {
349  auto boardItem = static_cast<BOARD_CONNECTED_ITEM*>( item );
350  connectivity->GetConnectedPads( boardItem, &connectedPads );
351  }
352 
353  for( D_PAD* pad : connectedPads )
354  {
355  if( pad->GetNetCode() != newNetCode )
356  changingPads.push_back( pad );
357  }
358  }
359 
360  // Run validations:
361 
362  if( changingPads.size() )
363  {
364  if( !confirmPadChange( changingPads ) )
365  return false;
366  }
367 
368  if( m_vias )
369  {
370  if( !m_viaDiameter.Validate( true ) || !m_viaDrill.Validate( true ) )
371  return false;
372 
373  if( m_ViaDiameterCtrl->IsEnabled() && !m_viaDiameter.IsIndeterminate()
374  && m_ViaDrillCtrl->IsEnabled() && !m_viaDrill.IsIndeterminate()
376  {
377  DisplayError( GetParent(), _( "Via drill size must be smaller than via diameter" ) );
378  m_ViaDrillCtrl->SelectAll();
379  m_ViaDrillCtrl->SetFocus();
380  return false;
381  }
382 
385  {
386  DisplayError( GetParent(), _( "Via start layer and end layer cannot be the same" ) );
387  return false;
388  }
389  }
390 
391  if( m_tracks )
392  {
393  if( !m_trackWidth.Validate( true ) )
394  return false;
395  }
396 
397  // If we survived that, then save the changes:
398 
399  bool changeLock = m_lockedCbox->Get3StateValue() != wxCHK_UNDETERMINED;
400  bool setLock = m_lockedCbox->Get3StateValue() == wxCHK_CHECKED;
401 
402  for( auto item : m_items )
403  {
404  m_commit.Modify( item );
405 
406  switch( item->Type() )
407  {
408  case PCB_TRACE_T:
409  {
410  wxASSERT( m_tracks );
411  TRACK* t = static_cast<TRACK*>( item );
412 
414  t->SetStart( wxPoint( m_trackStartX.GetValue(), t->GetStart().y ) );
415 
417  t->SetStart( wxPoint( t->GetStart().x, m_trackStartY.GetValue() ) );
418 
420  t->SetEnd( wxPoint( m_trackEndX.GetValue(), t->GetEnd().y ) );
421 
423  t->SetEnd( wxPoint( t->GetEnd().x, m_trackEndY.GetValue() ) );
424 
425  if( m_trackNetclass->IsChecked() )
426  t->SetWidth( t->GetNetClass()->GetTrackWidth() );
427  else if( !m_trackWidth.IsIndeterminate() )
429 
431 
432  if( layer != UNDEFINED_LAYER )
433  t->SetLayer( (PCB_LAYER_ID) layer );
434 
435  if( changeLock )
436  t->SetLocked( setLock );
437 
438  if ( !m_netSelector->IsIndeterminate() )
440 
441  break;
442  }
443 
444  case PCB_VIA_T:
445  {
446  wxASSERT( m_vias );
447  VIA* v = static_cast<VIA*>( item );
448 
449  if( !m_viaX.IsIndeterminate() )
450  v->SetPosition( wxPoint( m_viaX.GetValue(), v->GetPosition().y ) );
451 
452  if( !m_viaY.IsIndeterminate() )
453  v->SetPosition( wxPoint( v->GetPosition().x, m_viaY.GetValue() ) );
454 
455  if( m_ViaTypeChoice->GetSelection() != 3)
456  {
457  switch( m_ViaTypeChoice->GetSelection() )
458  {
459  default:
460  case 0: v->SetViaType( VIA_THROUGH ); v->SanitizeLayers(); break;
461  case 1: v->SetViaType( VIA_MICROVIA ); break;
462  case 2: v->SetViaType( VIA_BLIND_BURIED ); break;
463  }
464  }
465 
466  auto startLayer = static_cast<PCB_LAYER_ID>( m_ViaStartLayer->GetLayerSelection() );
467  auto endLayer = static_cast<PCB_LAYER_ID>( m_ViaEndLayer->GetLayerSelection() );
468 
469  if (startLayer != UNDEFINED_LAYER )
470  v->SetTopLayer( startLayer );
471 
472  if (endLayer != UNDEFINED_LAYER )
473  v->SetBottomLayer( endLayer );
474 
475  v->SanitizeLayers();
476 
477  if( m_viaNetclass->IsChecked() )
478  {
479  switch( v->GetViaType() )
480  {
481  default:
482  wxFAIL_MSG("Unhandled via type");
483  // fall through
484 
485  case VIA_THROUGH:
486  case VIA_BLIND_BURIED:
487  v->SetWidth( v->GetNetClass()->GetViaDiameter() );
488  v->SetDrill( v->GetNetClass()->GetViaDrill() );
489  break;
490 
491  case VIA_MICROVIA:
492  v->SetWidth( v->GetNetClass()->GetuViaDiameter() );
493  v->SetDrill( v->GetNetClass()->GetuViaDrill() );
494  break;
495  }
496  }
497  else
498  {
501 
502  if( !m_viaDrill.IsIndeterminate() )
503  v->SetDrill( m_viaDrill.GetValue() );
504  }
505 
506  if ( !m_netSelector->IsIndeterminate() )
508 
509  if( changeLock )
510  v->SetLocked( setLock );
511 
512  break;
513  }
514 
515  default:
516  wxASSERT( false );
517  break;
518  }
519  }
520 
521  if ( !m_netSelector->IsIndeterminate() )
522  {
523  // Commit::Push() will rebuild connectivitiy propagating nets from connected pads
524  // outwards. We therefore have to update the connected pads in order for the net
525  // change to "stick".
526  for( D_PAD* pad : changingPads )
527  {
528  m_commit.Modify( pad );
529  pad->SetNetCode( m_netSelector->GetSelectedNetcode() );
530  }
531  }
532 
533  m_commit.Push( _( "Edit track/via properties" ) );
534 
535  return true;
536 }
virtual bool Validate(bool setFocusOnError=false)
Function Validate Validates the control, informing the user of any errors found.
COMMIT & Modify(EDA_ITEM *aItem)
Modifies a given item in the model.
Definition: commit.h:103
void SetViaType(VIATYPE_T aViaType)
Definition: class_track.h:455
void SetPosition(const wxPoint &aPoint) override
Definition: class_track.h:427
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
void SetEnd(const wxPoint &aEnd)
Definition: class_track.h:118
BOARD * GetBoard() const
int GetSelectedNetcode()
Class BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected an...
const wxPoint & GetEnd() const
Definition: class_track.h:119
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
void SetWidth(int aWidth)
Definition: class_track.h:115
virtual int GetValue()
Function GetValue Returns the current value in Internal Units.
void SetLocked(bool aLocked) override
Function SetLocked modifies &#39;lock&#39; status for of the item.
Definition: class_track.h:142
PCB_LAYER_ID
A quick note on layer IDs:
VIATYPE_T GetViaType() const
Definition: class_track.h:454
std::shared_ptr< NETCLASS > GetNetClass() const
Function GetNetClass returns the NETCLASS for this item.
const wxPoint & GetStart() const
Definition: class_track.h:122
bool IsIndeterminate()
bool SetNetCode(int aNetCode, bool aNoAssert=false)
Function SetNetCode sets net using a net code.
bool confirmPadChange(const std::vector< D_PAD * > &connectedPads)
const wxPoint GetPosition() const override
Definition: class_track.h:426
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true)=0
Executes the changes.
void SetTopLayer(PCB_LAYER_ID aLayer)
LAYER_NUM GetLayerSelection() const
void SetDrill(int aDrill)
Function SetDrill sets the drill value for vias.
Definition: class_track.h:462
bool IsIndeterminate() const
Function IsIndeterminate Returns true if the control holds the indeterminate value (for instance...
void SetBottomLayer(PCB_LAYER_ID aLayer)
void SetStart(const wxPoint &aStart)
Definition: class_track.h:121
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
void SanitizeLayers()
Function SanitizeLayers Check so that the layers are correct dependin on the type of via...
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:245
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:296
int DIALOG_SHIM::VertPixelsFromDU ( int  y)
protectedinherited

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

See SetSizeInDU or wxDialog documentation for more information.

Definition at line 148 of file dialog_shim.cpp.

Referenced by DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), and DIALOG_SHIM::GetUserUnits().

149 {
150  wxSize sz( 0, y );
151  return ConvertDialogToPixels( sz ).y;
152 }

Member Data Documentation

COMMIT& DIALOG_TRACK_VIA_PROPERTIES::m_commit
private

Definition at line 56 of file dialog_track_via_properties.h.

Referenced by TransferDataFromWindow().

wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleVias
protectedinherited
wxChoice* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleViasCtrl
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleViasUnit
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleWidths
protectedinherited
wxChoice* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleWidthsCtrl
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_DesignRuleWidthsUnits
protectedinherited
bool DIALOG_SHIM::m_firstPaintEvent
protectedinherited

Definition at line 149 of file dialog_shim.h.

Referenced by DIALOG_SHIM::OnPaint().

PCB_BASE_FRAME* DIALOG_TRACK_VIA_PROPERTIES::m_frame
private

Definition at line 54 of file dialog_track_via_properties.h.

Referenced by TransferDataFromWindow().

wxWindow* DIALOG_SHIM::m_initialFocusTarget
protectedinherited

Definition at line 150 of file dialog_shim.h.

Referenced by DIALOG_SHIM::OnPaint(), and DIALOG_SHIM::SetInitialFocus().

const SELECTION& DIALOG_TRACK_VIA_PROPERTIES::m_items
private
wxCheckBox* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_lockedCbox
protectedinherited
wxBoxSizer* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_MainSizer
protectedinherited
NET_SELECTOR* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_netSelector
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_netSelectorLabel
protectedinherited
WX_EVENT_LOOP* DIALOG_SHIM::m_qmodal_loop
protectedinherited

Definition at line 153 of file dialog_shim.h.

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

WDO_ENABLE_DISABLE* DIALOG_SHIM::m_qmodal_parent_disabler
protectedinherited
bool DIALOG_SHIM::m_qmodal_showing
protectedinherited

Definition at line 154 of file dialog_shim.h.

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

wxStaticBoxSizer* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_sbCommonSizer
protectedinherited
wxStaticBoxSizer* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_sbTrackSizer
protectedinherited
wxStaticBoxSizer* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_sbViaSizer
protectedinherited
wxStdDialogButtonSizer* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_StdButtons
protectedinherited
wxButton* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_StdButtonsCancel
protectedinherited
wxButton* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_StdButtonsOK
protectedinherited
UNIT_BINDER DIALOG_TRACK_VIA_PROPERTIES::m_trackEndX
private
wxTextCtrl* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackEndXCtrl
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackEndXLabel
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackEndXUnit
protectedinherited
UNIT_BINDER DIALOG_TRACK_VIA_PROPERTIES::m_trackEndY
private
wxTextCtrl* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackEndYCtrl
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackEndYLabel
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackEndYUnit
protectedinherited
PCB_LAYER_BOX_SELECTOR* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackLayerCtrl
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackLayerLabel
protectedinherited
wxCheckBox* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_trackNetclass
protectedinherited
bool DIALOG_TRACK_VIA_PROPERTIES::m_tracks
private
UNIT_BINDER DIALOG_TRACK_VIA_PROPERTIES::m_trackStartX
private
wxTextCtrl* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackStartXCtrl
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackStartXLabel
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackStartXUnit
protectedinherited
UNIT_BINDER DIALOG_TRACK_VIA_PROPERTIES::m_trackStartY
private
wxTextCtrl* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackStartYCtrl
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackStartYLabel
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackStartYUnit
protectedinherited
UNIT_BINDER DIALOG_TRACK_VIA_PROPERTIES::m_trackWidth
private
wxTextCtrl* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackWidthCtrl
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackWidthLabel
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_TrackWidthUnit
protectedinherited
UNIT_BINDER DIALOG_TRACK_VIA_PROPERTIES::m_viaDiameter
private
wxTextCtrl* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaDiameterCtrl
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaDiameterLabel
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaDiameterUnit
protectedinherited
UNIT_BINDER DIALOG_TRACK_VIA_PROPERTIES::m_viaDrill
private
wxTextCtrl* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaDrillCtrl
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaDrillLabel
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaDrillUnit
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaEndLayerLabel1
protectedinherited
wxCheckBox* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_viaNetclass
protectedinherited
bool DIALOG_TRACK_VIA_PROPERTIES::m_vias
private
PCB_LAYER_BOX_SELECTOR* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaStartLayer
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaStartLayerLabel
protectedinherited
wxChoice* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaTypeChoice
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaTypeLabel
protectedinherited
UNIT_BINDER DIALOG_TRACK_VIA_PROPERTIES::m_viaX
private
wxTextCtrl* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaXCtrl
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaXLabel
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaXUnit
protectedinherited
UNIT_BINDER DIALOG_TRACK_VIA_PROPERTIES::m_viaY
private
wxTextCtrl* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaYCtrl
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaYLabel
protectedinherited
wxStaticText* DIALOG_TRACK_VIA_PROPERTIES_BASE::m_ViaYUnit
protectedinherited

The documentation for this class was generated from the following files: