KiCad PCB EDA Suite
DIALOG_DESIGN_RULES Class Reference

#include <dialog_design_rules.h>

Inheritance diagram for DIALOG_DESIGN_RULES:
DIALOG_DESIGN_RULES_BASE DIALOG_SHIM KIWAY_HOLDER

Public Member Functions

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

Protected Types

enum  { wxID_ADD_NETCLASS = 1000, wxID_REMOVE_NETCLASS, ID_LEFT_TO_RIGHT_COPY, ID_RIGHT_TO_LEFT_COPY }
 

Protected Member Functions

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

Protected Attributes

wxNotebook * m_DRnotebook
 
wxPanel * m_panelNetClassesEditor
 
wxGrid * m_grid
 
wxButton * m_addButton
 
wxButton * m_removeButton
 
wxButton * m_moveUpButton
 
wxComboBox * m_leftClassChoice
 
wxStaticLine * m_staticline21
 
wxButton * m_buttonLeftSelAll
 
NETS_LIST_CTRLm_leftListCtrl
 
wxButton * m_buttonRightToLeft
 
wxButton * m_buttonLeftToRight
 
wxComboBox * m_rightClassChoice
 
wxStaticLine * m_staticline3
 
wxButton * m_buttonRightSelAll
 
NETS_LIST_CTRLm_rightListCtrl
 
wxPanel * m_panelGolbalDesignRules
 
wxStaticText * m_TrackMinWidthTitle
 
wxTextCtrl * m_SetTrackMinWidthCtrl
 
wxStaticText * m_TrackMinWidthUnits
 
wxStaticText * m_ViaMinTitle
 
wxTextCtrl * m_SetViasMinSizeCtrl
 
wxStaticText * m_ViaMinUnits
 
wxStaticText * m_ViaMinDrillTitle
 
wxTextCtrl * m_SetViasMinDrillCtrl
 
wxStaticText * m_ViaMinDrillUnits
 
wxCheckBox * m_OptAllowBlindBuriedVias
 
wxCheckBox * m_OptAllowMicroVias
 
wxStaticText * m_MicroViaMinSizeTitle
 
wxTextCtrl * m_SetMicroViasMinSizeCtrl
 
wxStaticText * m_MicroViaMinSizeUnits
 
wxStaticText * m_MicroViaMinDrillTitle
 
wxTextCtrl * m_SetMicroViasMinDrillCtrl
 
wxStaticText * m_MicroViaMinDrillUnits
 
wxStaticText * m_staticTextInfo
 
wxStaticText * m_staticText7
 
wxGrid * m_gridViaSizeList
 
wxStaticText * m_staticText8
 
wxGrid * m_gridTrackWidthList
 
wxStaticLine * m_staticline2
 
wxStdDialogButtonSizer * m_sdbSizer1
 
wxButton * m_sdbSizer1OK
 
wxButton * m_sdbSizer1Cancel
 
std::string m_hash_key
 
EVENT_LOOPm_qmodal_loop
 
bool m_qmodal_showing
 
WDO_ENABLE_DISABLEm_qmodal_parent_disabler
 

Private Member Functions

void OnNetClassesNameLeftClick (wxGridEvent &event) override
 
void OnNetClassesNameRightClick (wxGridEvent &event) override
 
void OnAddNetclassClick (wxCommandEvent &event) override
 
void OnRemoveNetclassClick (wxCommandEvent &event) override
 
void CheckAllowMicroVias ()
 
void OnAllowMicroVias (wxCommandEvent &event) override
 Function OnAllowMicroVias is called whenever the AllowMicroVias checkbox is toggled. More...
 
void OnMoveUpSelectedNetClass (wxCommandEvent &event) override
 
void OnLeftCBSelection (wxCommandEvent &event) override
 
void OnRightCBSelection (wxCommandEvent &event) override
 
void OnRightToLeftCopyButton (wxCommandEvent &event) override
 
void OnLeftToRightCopyButton (wxCommandEvent &event) override
 
void OnNotebookPageChanged (wxNotebookEvent &event) override
 
void OnLeftSelectAllButton (wxCommandEvent &event) override
 
void OnRightSelectAllButton (wxCommandEvent &event) override
 
void SetDataValidators (void)
 
bool TestDataValidity (wxString *aErrorMsg=NULL)
 
void InitDialogRules ()
 
void InitGlobalRules ()
 
void InitRulesList ()
 Function InitRulesList Fill the grid showing current rules with values. More...
 
void InitDimensionsLists ()
 
void InitializeRulesSelectionBoxes ()
 
void CopyRulesListToBoard ()
 
void CopyGlobalRulesToBoard ()
 
void CopyDimensionsListsToBoard ()
 
void SetRoutableLayerStatus ()
 
void FillListBoxWithNetNames (NETS_LIST_CTRL *aListCtrl, const wxString &aNetClass)
 Function FillListBoxWithNetNames populates aListCtrl with net names and class names from m_AllNets in a two column display. More...
 
void swapNetClass (const wxString &oldClass, const wxString &newClass)
 Function swapNetClass replaces one net class name with another in the master list, m_AllNets. More...
 
void makePointers (PNETCUPS *aList, const wxString &aNetClassName)
 
void setNetClass (const wxString &aNetName, const wxString &aClassName)
 
void moveSelectedItems (NETS_LIST_CTRL *src, const wxString &newClassName)
 

Private Attributes

PCB_EDIT_FRAMEm_Parent
 
BOARDm_Pcb
 
BOARD_DESIGN_SETTINGSm_BrdSettings
 
NETCLASSPTR m_SelectedNetClass
 
int m_initialRowLabelsSize
 the initial width given by wxFormBuilder More...
 
wxFloatingPointValidator< double > m_validator
 
NETCUPS m_AllNets
 A two column table which gets filled once and never loses any elements, so it is basically constant, except that the NETCUP::clazz member can change for any given row a NET is moved in and out of a class. More...
 
std::vector< VIA_DIMENSIONm_ViasDimensionsList
 
std::vector< int > m_TracksWidthList
 

Static Private Attributes

static const wxString wildCard = _( "* (Any)" )
 the name of a fictitious netclass which includes all NETs More...
 
static int s_LastTabSelection = -1
 which tab user had open last More...
 

Detailed Description

Definition at line 63 of file dialog_design_rules.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES ( PCB_EDIT_FRAME parent)

Definition at line 163 of file dialog_design_rules.cpp.

References CLASS_TITLE, EnsureGridColumnWidths(), EnsureGridRowTitleWidth(), DIALOG_SHIM::FinishDialogSettings(), InitDialogRules(), DIALOG_DESIGN_RULES_BASE::m_DRnotebook, DIALOG_DESIGN_RULES_BASE::m_grid, DIALOG_DESIGN_RULES_BASE::m_gridTrackWidthList, DIALOG_DESIGN_RULES_BASE::m_gridViaSizeList, m_initialRowLabelsSize, DIALOG_DESIGN_RULES_BASE::m_leftListCtrl, m_Parent, DIALOG_DESIGN_RULES_BASE::m_rightListCtrl, DIALOG_DESIGN_RULES_BASE::m_sdbSizer1OK, NET_TITLE, s_LastTabSelection, and SetDataValidators().

163  :
164  DIALOG_DESIGN_RULES_BASE( parent )
165 {
166  m_Parent = parent;
167  SetAutoLayout( true );
168 
169  m_initialRowLabelsSize = m_grid->GetRowLabelSize();
170  EnsureGridColumnWidths( this, m_grid ); // override any column widths set by wxformbuilder.
171 
172  wxListItem column0;
173  wxListItem column1;
174 
175  column0.Clear();
176  column1.Clear();
177 
178  column0.SetMask( wxLIST_MASK_TEXT );
179  column1.SetMask( wxLIST_MASK_TEXT );
180 
181  column0.SetText( NET_TITLE );
182  column1.SetText( CLASS_TITLE );
183 
185 
186  m_leftListCtrl->InsertColumn( 0, column0 );
187  m_leftListCtrl->InsertColumn( 1, column1 );
188  m_leftListCtrl->SetColumnWidth( 0, wxLIST_AUTOSIZE );
189  m_leftListCtrl->SetColumnWidth( 1, wxLIST_AUTOSIZE );
190 
191  m_rightListCtrl->InsertColumn( 0, column0 );
192  m_rightListCtrl->InsertColumn( 1, column1 );
193  m_rightListCtrl->SetColumnWidth( 0, wxLIST_AUTOSIZE );
194  m_rightListCtrl->SetColumnWidth( 1, wxLIST_AUTOSIZE );
195 
196  // if user has been into the dialog before, go back to same tab
197  if( s_LastTabSelection != -1 )
198  {
199  m_DRnotebook->SetSelection( s_LastTabSelection );
200  }
201 
202  InitDialogRules();
204 
205  m_sdbSizer1OK->SetDefault();
206 
207  // Allow tabbing out of grid controls.
208  m_grid->SetTabBehaviour( wxGrid::Tab_Leave );
209  m_gridViaSizeList->SetTabBehaviour( wxGrid::Tab_Leave );
210  m_gridTrackWidthList->SetTabBehaviour( wxGrid::Tab_Leave );
211 
212  Layout();
213 
214  // Now all widgets have the size fixed, call FinishDialogSettings
216 }
static void EnsureGridRowTitleWidth(wxWindow *aShower, wxGrid *aGrid, int aMinWidth)
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
#define NET_TITLE
PCB_EDIT_FRAME * m_Parent
DIALOG_DESIGN_RULES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Design Rules Editor"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(798, 611), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
int m_initialRowLabelsSize
the initial width given by wxFormBuilder
#define CLASS_TITLE
static void EnsureGridColumnWidths(wxWindow *aShower, wxGrid *aGrid)
Function EnsureGridColumnWidths resizes all the columns in a wxGrid based only on the requirements of...
static int s_LastTabSelection
which tab user had open last
DIALOG_DESIGN_RULES::~DIALOG_DESIGN_RULES ( )
inline

Definition at line 201 of file dialog_design_rules.h.

201 { }

Member Function Documentation

void DIALOG_DESIGN_RULES::CheckAllowMicroVias ( )
private
void DIALOG_DESIGN_RULES::CopyDimensionsListsToBoard ( )
private

Definition at line 613 of file dialog_design_rules.cpp.

References g_UserUnit, m_BrdSettings, VIA_DIMENSION::m_Diameter, VIA_DIMENSION::m_Drill, DIALOG_DESIGN_RULES_BASE::m_gridTrackWidthList, DIALOG_DESIGN_RULES_BASE::m_gridViaSizeList, m_TracksWidthList, BOARD_DESIGN_SETTINGS::m_TrackWidthList, m_ViasDimensionsList, BOARD_DESIGN_SETTINGS::m_ViasDimensionsList, and ValueFromString().

Referenced by TransferDataFromWindow().

614 {
615  wxString msg;
616 
617  // Reinitialize m_TrackWidthList
618  m_TracksWidthList.clear();
619 
620  for( int row = 0; row < m_gridTrackWidthList->GetNumberRows(); ++row )
621  {
622  msg = m_gridTrackWidthList->GetCellValue( row, 0 );
623 
624  if( msg.IsEmpty() )
625  continue;
626 
627  int value = ValueFromString( g_UserUnit, msg );
628  m_TracksWidthList.push_back( value );
629  }
630 
631  // Sort new list by by increasing value
632  sort( m_TracksWidthList.begin(), m_TracksWidthList.end() );
633 
634  // Reinitialize m_TrackWidthList
635  m_ViasDimensionsList.clear();
636 
637  for( int row = 0; row < m_gridViaSizeList->GetNumberRows(); ++row )
638  {
639  msg = m_gridViaSizeList->GetCellValue( row, 0 );
640 
641  if( msg.IsEmpty() )
642  continue;
643 
644  int value = ValueFromString( g_UserUnit, msg );
645  VIA_DIMENSION via_dim;
646  via_dim.m_Diameter = value;
647  msg = m_gridViaSizeList->GetCellValue( row, 1 );
648 
649  if( !msg.IsEmpty() )
650  {
651  value = ValueFromString( g_UserUnit, msg );
652  via_dim.m_Drill = value;
653  }
654 
655  m_ViasDimensionsList.push_back( via_dim );
656  }
657 
658  // Sort new list by by increasing value
659  sort( m_ViasDimensionsList.begin(), m_ViasDimensionsList.end() );
660 
661  std::vector<int>* tlist = &m_BrdSettings->m_TrackWidthList;
662 
663  // Remove old "custom" sizes
664  tlist->erase( tlist->begin() + 1, tlist->end() );
665 
666  // Add new "custom" sizes
667  tlist->insert( tlist->end(), m_TracksWidthList.begin(), m_TracksWidthList.end() );
668 
669  // Reinitialize m_ViaSizeList
670  std::vector<VIA_DIMENSION>* vialist = &m_BrdSettings->m_ViasDimensionsList;
671  vialist->erase( vialist->begin() + 1, vialist->end() );
672  vialist->insert( vialist->end(), m_ViasDimensionsList.begin(), m_ViasDimensionsList.end() );
673 }
std::vector< int > m_TracksWidthList
Struct VIA_DIMENSION is a small helper container to handle a stock of specific vias each with unique ...
std::vector< int > m_TrackWidthList
Track width list.
std::vector< VIA_DIMENSION > m_ViasDimensionsList
int ValueFromString(EDA_UNITS_T aUnits, const wxString &aTextValue)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application...
Definition: base_units.cpp:368
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
BOARD_DESIGN_SETTINGS * m_BrdSettings
std::vector< VIA_DIMENSION > m_ViasDimensionsList
Vias size and drill list.
void DIALOG_DESIGN_RULES::CopyGlobalRulesToBoard ( )
private

Definition at line 594 of file dialog_design_rules.cpp.

References BOARD_DESIGN_SETTINGS::m_BlindBuriedViaAllowed, m_BrdSettings, BOARD_DESIGN_SETTINGS::m_MicroViasAllowed, BOARD_DESIGN_SETTINGS::m_MicroViasMinDrill, BOARD_DESIGN_SETTINGS::m_MicroViasMinSize, DIALOG_DESIGN_RULES_BASE::m_OptAllowBlindBuriedVias, DIALOG_DESIGN_RULES_BASE::m_OptAllowMicroVias, DIALOG_DESIGN_RULES_BASE::m_SetMicroViasMinDrillCtrl, DIALOG_DESIGN_RULES_BASE::m_SetMicroViasMinSizeCtrl, DIALOG_DESIGN_RULES_BASE::m_SetTrackMinWidthCtrl, DIALOG_DESIGN_RULES_BASE::m_SetViasMinDrillCtrl, DIALOG_DESIGN_RULES_BASE::m_SetViasMinSizeCtrl, BOARD_DESIGN_SETTINGS::m_TrackMinWidth, BOARD_DESIGN_SETTINGS::m_ViasMinDrill, BOARD_DESIGN_SETTINGS::m_ViasMinSize, and ValueFromTextCtrl().

Referenced by TransferDataFromWindow().

595 {
597 
598  // Update vias minimum values for DRC
601 
603 
604  // Update microvias minimum values for DRC
607 
608  // Update tracks minimum values for DRC
610 }
int m_TrackMinWidth
track min value for width ((min copper size value
int m_ViasMinSize
vias (not micro vias) min diameter
int m_ViasMinDrill
vias (not micro vias) min drill diameter
bool m_BlindBuriedViaAllowed
true to allow blind/buried vias
int m_MicroViasMinSize
micro vias (not vias) min diameter
int ValueFromTextCtrl(const wxTextCtrl &aTextCtr)
Convert the number Value in a string according to the internal units and the selected unit (g_UserUni...
Definition: base_units.cpp:384
BOARD_DESIGN_SETTINGS * m_BrdSettings
bool m_MicroViasAllowed
true to allow micro vias
int m_MicroViasMinDrill
micro vias (not vias) min drill diameter
void DIALOG_DESIGN_RULES::CopyRulesListToBoard ( )
private

Definition at line 552 of file dialog_design_rules.cpp.

References NETCLASSES::Add(), NETCLASSES::Clear(), NETCLASSES::Find(), GetChars(), NETCLASSES::GetDefault(), gridRow2class(), m_AllNets, m_BrdSettings, DIALOG_DESIGN_RULES_BASE::m_grid, BOARD_DESIGN_SETTINGS::m_NetClasses, m_Pcb, and BOARD::SynchronizeNetsAndNetClasses().

Referenced by TransferDataFromWindow().

553 {
554  NETCLASSES& netclasses = m_BrdSettings->m_NetClasses;
555 
556  // Remove all netclasses from board. We'll copy new list after
557  netclasses.Clear();
558 
559  // Copy the default NetClass:
560  gridRow2class( m_grid, 0, netclasses.GetDefault() );
561 
562  // Copy other NetClasses :
563  for( int row = 1; row < m_grid->GetNumberRows(); ++row )
564  {
565  NETCLASSPTR nc = std::make_shared<NETCLASS>( m_grid->GetRowLabelValue( row ) );
566 
567  if( !m_BrdSettings->m_NetClasses.Add( nc ) )
568  {
569  // this netclass cannot be added because an other netclass with the same name exists
570  // Should not occur because OnAddNetclassClick() tests for existing NetClass names
571  wxString msg;
572  msg.Printf( wxT( "CopyRulesListToBoard(): The NetClass \"%s\" already exists. Skip" ),
573  GetChars( m_grid->GetRowLabelValue( row ) ) );
574  wxMessageBox( msg );
575 
576  continue;
577  }
578 
579  gridRow2class( m_grid, row, nc );
580  }
581 
582  // Now read all nets and push them in the corresponding netclass net buffer
583  for( NETCUPS::const_iterator netcup = m_AllNets.begin(); netcup != m_AllNets.end(); ++netcup )
584  {
585  NETCLASSPTR nc = netclasses.Find( netcup->clazz );
586  wxASSERT( nc );
587  nc->Add( netcup->net );
588  }
589 
591 }
NETCLASSPTR Find(const wxString &aName) const
Function Find searches this container for a NETCLASS given by aName.
void SynchronizeNetsAndNetClasses()
Function SynchronizeNetsAndNetClasses copies NETCLASS info to each NET, based on NET membership in a ...
Class NETCLASSES is a container for NETCLASS instances.
bool Add(NETCLASSPTR aNetclass)
Function Add takes aNetclass and puts it into this NETCLASSES container.
static void gridRow2class(wxGrid *grid, int row, NETCLASSPTR nc)
BOARD_DESIGN_SETTINGS * m_BrdSettings
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void Clear()
Function Clear destroys any contained NETCLASS instances except the Default one.
NETCLASSPTR GetDefault() const
Function GetDefault.
NETCUPS m_AllNets
A two column table which gets filled once and never loses any elements, so it is basically constant...
NETCLASSES m_NetClasses
List of current netclasses. There is always the default netclass.
bool DIALOG_SHIM::Enable ( bool  enable)
overrideinherited

Definition at line 182 of file dialog_shim.cpp.

Referenced by DIALOG_PRINT_USING_PRINTER::InitValues().

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

Definition at line 540 of file dialog_shim.cpp.

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

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

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

Function FillListBoxWithNetNames populates aListCtrl with net names and class names from m_AllNets in a two column display.

Definition at line 403 of file dialog_design_rules.cpp.

References CLASS_TITLE, NETS_LIST_CTRL::ClearList(), makePointers(), max, NET_TITLE, NETS_LIST_CTRL::SetRowItems(), and TO_UTF8.

Referenced by InitializeRulesSelectionBoxes(), OnLeftCBSelection(), OnLeftToRightCopyButton(), OnRightCBSelection(), and OnRightToLeftCopyButton().

405 {
406  aListCtrl->ClearList();
407 
408  PNETCUPS ptrList;
409 
410  // get a subset of m_AllNets in pointer form, sorted as desired.
411  makePointers( &ptrList, aNetClass );
412 
413 #if 0 && defined(DEBUG)
414  int r = 0;
415  for( PNETCUPS::iterator i = ptrList.begin(); i!=ptrList.end(); ++i, ++r )
416  {
417  printf( "[%d]: %s %s\n", r, TO_UTF8( (*i)->net ), TO_UTF8( (*i)->clazz ) );
418  }
419 
420 #endif
421 
422  // Add netclass info to m_Netnames and m_Classnames wxArrayString buffers
423  // aListCtrl uses wxLC_VIRTUAL option, so this is fast
424  wxClientDC sDC( aListCtrl );
425  int row = 0;
426  // recompute the column widths here, after setting texts
427  int net_colsize = sDC.GetTextExtent( NET_TITLE ).x;
428  int class_colsize = sDC.GetTextExtent( CLASS_TITLE ).x;
429 
430  for( PNETCUPS::iterator i = ptrList.begin(); i!=ptrList.end(); ++i, ++row )
431  {
432  wxSize net_needed = sDC.GetTextExtent( (*i)->net );
433  wxSize class_needed = sDC.GetTextExtent( (*i)->clazz );
434  net_colsize = std::max( net_colsize, net_needed.x );
435  class_colsize = std::max( class_colsize, class_needed.x );
436  aListCtrl->SetRowItems( row, (*i)->net, (*i)->clazz );
437  }
438 
439  int margin = sDC.GetTextExtent( wxT( "XX" ) ).x;
440  aListCtrl->SetColumnWidth( 0, net_colsize + margin );
441  aListCtrl->SetColumnWidth( 1, class_colsize + margin );
442  aListCtrl->Refresh();
443 }
std::vector< NETCUP * > PNETCUPS
#define NET_TITLE
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes...
Definition: macros.h:47
void makePointers(PNETCUPS *aList, const wxString &aNetClassName)
#define CLASS_TITLE
void SetRowItems(unsigned aRow, const wxString &aNetname, const wxString &aNetclassName)
Function SetRowItems sets the net name and the net class name at aRow.
#define max(a, b)
Definition: auxiliary.h:86
void DIALOG_SHIM::FinishDialogSettings ( )
protectedinherited

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

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

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

Definition at line 104 of file dialog_shim.cpp.

References PCAD2KICAD::Center.

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

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

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

Definition at line 117 of file dialog_shim.cpp.

Referenced by DIALOG_SHIM::Show().

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

Definition at line 236 of file dialog_design_rules.cpp.

References NETCLASSES::begin(), NETCLASSES::end(), PCB_BASE_FRAME::GetBoard(), NETCLASSES::GetDefault(), BOARD::GetDesignSettings(), InitGlobalRules(), InitializeRulesSelectionBoxes(), InitRulesList(), m_AllNets, m_BrdSettings, BOARD_DESIGN_SETTINGS::m_NetClasses, m_Parent, m_Pcb, and name.

Referenced by DIALOG_DESIGN_RULES().

237 {
238  // @todo: Move the initialization code into TransferDataToWindow() to follow wxWidgets
239  // dialog data transfer convention.
240  SetFocus();
241  SetReturnCode( 0 );
242 
243  m_Pcb = m_Parent->GetBoard();
245 
246  // Initialize the Rules List
247  InitRulesList();
248 
249  // copy all NETs into m_AllNets by adding them as NETCUPs.
250 
251  // @todo go fix m_Pcb->SynchronizeNetsAndNetClasses() so that the netcode==0 is not
252  // present in the BOARD::m_NetClasses
253  NETCLASSES& netclasses = m_BrdSettings->m_NetClasses;
254  NETCLASSPTR netclass = netclasses.GetDefault();
255 
256  // Initialize list of nets for Default Net Class
257  for( NETCLASS::iterator name = netclass->begin(); name != netclass->end(); ++name )
258  {
259  m_AllNets.push_back( NETCUP( *name, netclass->GetName() ) );
260  }
261 
262  // Initialize list of nets for others (custom) Net Classes
263  for( NETCLASSES::const_iterator nc = netclasses.begin(); nc != netclasses.end(); ++nc )
264  {
265  netclass = nc->second;
266 
267  for( NETCLASS::const_iterator name = netclass->begin(); name != netclass->end(); ++name )
268  {
269  m_AllNets.push_back( NETCUP( *name, netclass->GetName() ) );
270  }
271  }
272 
274  InitGlobalRules();
275 }
void InitRulesList()
Function InitRulesList Fill the grid showing current rules with values.
BOARD * GetBoard() const
iterator end()
NETCLASS_MAP::const_iterator const_iterator
PCB_EDIT_FRAME * m_Parent
STRINGSET::iterator iterator
iterator begin()
Class NETCLASSES is a container for NETCLASS instances.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:532
BOARD_DESIGN_SETTINGS * m_BrdSettings
NETCLASSPTR GetDefault() const
Function GetDefault.
const char * name
STRINGSET::const_iterator const_iterator
NETCUPS m_AllNets
A two column table which gets filled once and never loses any elements, so it is basically constant...
NETCLASSES m_NetClasses
List of current netclasses. There is always the default netclass.
void DIALOG_DESIGN_RULES::InitDimensionsLists ( )
private

Definition at line 311 of file dialog_design_rules.cpp.

References g_UserUnit, DIALOG_DESIGN_RULES_BASE::m_gridTrackWidthList, DIALOG_DESIGN_RULES_BASE::m_gridViaSizeList, m_TracksWidthList, m_ViasDimensionsList, and StringFromValue().

Referenced by InitGlobalRules().

312 {
313  wxString msg;
314 
315  // Compute the column widths here, after setting texts
316  msg = wxT("000000.000000"); // This is a very long text to display values.
317  // Actual values are shorter.
318  m_gridViaSizeList->SetCellValue( 0, 0, msg );
319  m_gridViaSizeList->SetCellValue( 0, 1, msg );
320  m_gridTrackWidthList->SetCellValue( 0, 0, msg );
321  m_gridViaSizeList->SetColMinimalWidth( 0, 150 );
322  m_gridViaSizeList->SetColMinimalWidth( 1, 150 );
323  m_gridViaSizeList->AutoSizeColumns( true );
324  m_gridTrackWidthList->SetColMinimalWidth( 0, 150 );
325  m_gridTrackWidthList->AutoSizeColumns( true );
326  m_gridViaSizeList->SetColMinimalWidth( 1, 150 );
327 
328  // Fill cells with actual values:
329  m_gridViaSizeList->SetCellValue( 0, 0, wxEmptyString );
330  m_gridViaSizeList->SetCellValue( 0, 1, wxEmptyString );
331  m_gridTrackWidthList->SetCellValue( 0, 0, wxEmptyString );
332 
333  // Give a correct size to row labels column
334  m_gridViaSizeList->SetRowLabelSize( wxGRID_AUTOSIZE );
335  m_gridTrackWidthList->SetRowLabelSize( wxGRID_AUTOSIZE );
336 
337  for( unsigned ii = 0; ii < m_TracksWidthList.size(); ii++ )
338  {
339  msg = StringFromValue( g_UserUnit, m_TracksWidthList[ii], false );
340  m_gridTrackWidthList->SetCellValue( ii, 0, msg );
341  }
342 
343  for( unsigned ii = 0; ii < m_ViasDimensionsList.size(); ii++ )
344  {
345  msg = StringFromValue( g_UserUnit, m_ViasDimensionsList[ii].m_Diameter, false );
346  m_gridViaSizeList->SetCellValue( ii, 0, msg );
347 
348  if( m_ViasDimensionsList[ii].m_Drill > 0 )
349  {
350  msg = StringFromValue( g_UserUnit, m_ViasDimensionsList[ii].m_Drill, false );
351  m_gridViaSizeList->SetCellValue( ii, 1, msg );
352  }
353  }
354 }
std::vector< int > m_TracksWidthList
wxString StringFromValue(EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymbol)
Function StringFromValue returns the string from aValue according to units (inch, mm ...
Definition: base_units.cpp:203
std::vector< VIA_DIMENSION > m_ViasDimensionsList
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
void DIALOG_DESIGN_RULES::InitGlobalRules ( )
private

Definition at line 278 of file dialog_design_rules.cpp.

References CheckAllowMicroVias(), g_UserUnit, GetAbbreviatedUnitsLabel(), InitDimensionsLists(), BOARD_DESIGN_SETTINGS::m_BlindBuriedViaAllowed, m_BrdSettings, DIALOG_DESIGN_RULES_BASE::m_MicroViaMinDrillUnits, DIALOG_DESIGN_RULES_BASE::m_MicroViaMinSizeUnits, BOARD_DESIGN_SETTINGS::m_MicroViasAllowed, BOARD_DESIGN_SETTINGS::m_MicroViasMinDrill, BOARD_DESIGN_SETTINGS::m_MicroViasMinSize, DIALOG_DESIGN_RULES_BASE::m_OptAllowBlindBuriedVias, DIALOG_DESIGN_RULES_BASE::m_OptAllowMicroVias, DIALOG_DESIGN_RULES_BASE::m_SetMicroViasMinDrillCtrl, DIALOG_DESIGN_RULES_BASE::m_SetMicroViasMinSizeCtrl, DIALOG_DESIGN_RULES_BASE::m_SetTrackMinWidthCtrl, DIALOG_DESIGN_RULES_BASE::m_SetViasMinDrillCtrl, DIALOG_DESIGN_RULES_BASE::m_SetViasMinSizeCtrl, BOARD_DESIGN_SETTINGS::m_TrackMinWidth, DIALOG_DESIGN_RULES_BASE::m_TrackMinWidthUnits, m_TracksWidthList, BOARD_DESIGN_SETTINGS::m_TrackWidthList, DIALOG_DESIGN_RULES_BASE::m_ViaMinDrillUnits, DIALOG_DESIGN_RULES_BASE::m_ViaMinUnits, m_ViasDimensionsList, BOARD_DESIGN_SETTINGS::m_ViasDimensionsList, BOARD_DESIGN_SETTINGS::m_ViasMinDrill, BOARD_DESIGN_SETTINGS::m_ViasMinSize, and PutValueInLocalUnits().

Referenced by InitDialogRules().

279 {
280  // Set unit labels
281  const wxString units = GetAbbreviatedUnitsLabel( g_UserUnit );
282 
283  m_ViaMinUnits->SetLabel( units );
284  m_ViaMinDrillUnits->SetLabel( units );
285  m_MicroViaMinSizeUnits->SetLabel( units );
286  m_MicroViaMinDrillUnits->SetLabel( units );
287  m_TrackMinWidthUnits->SetLabel( units );
288 
291 
295 
299 
300  // Initialize Vias and Tracks sizes lists.
301  // note we display only extra values, never the current netclass value.
302  // (the first value in history list)
304  m_TracksWidthList.erase( m_TracksWidthList.begin() ); // remove the netclass value
306  m_ViasDimensionsList.erase( m_ViasDimensionsList.begin() ); // remove the netclass value
308 }
std::vector< int > m_TracksWidthList
std::vector< int > m_TrackWidthList
Track width list.
std::vector< VIA_DIMENSION > m_ViasDimensionsList
int m_TrackMinWidth
track min value for width ((min copper size value
int m_ViasMinSize
vias (not micro vias) min diameter
wxString GetAbbreviatedUnitsLabel(EDA_UNITS_T aUnit)
Definition: base_units.cpp:479
int m_ViasMinDrill
vias (not micro vias) min drill diameter
bool m_BlindBuriedViaAllowed
true to allow blind/buried vias
int m_MicroViasMinSize
micro vias (not vias) min diameter
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
void PutValueInLocalUnits(wxTextCtrl &aTextCtr, int aValue)
Function PutValueInLocalUnits converts aValue from internal units to user units and append the units ...
Definition: base_units.cpp:265
BOARD_DESIGN_SETTINGS * m_BrdSettings
std::vector< VIA_DIMENSION > m_ViasDimensionsList
Vias size and drill list.
bool m_MicroViasAllowed
true to allow micro vias
int m_MicroViasMinDrill
micro vias (not vias) min drill diameter
void DIALOG_DESIGN_RULES::InitializeRulesSelectionBoxes ( )
private

Definition at line 448 of file dialog_design_rules.cpp.

References FillListBoxWithNetNames(), DIALOG_DESIGN_RULES_BASE::m_buttonLeftToRight, DIALOG_DESIGN_RULES_BASE::m_buttonRightToLeft, DIALOG_DESIGN_RULES_BASE::m_grid, DIALOG_DESIGN_RULES_BASE::m_leftClassChoice, DIALOG_DESIGN_RULES_BASE::m_leftListCtrl, DIALOG_DESIGN_RULES_BASE::m_rightClassChoice, DIALOG_DESIGN_RULES_BASE::m_rightListCtrl, and wildCard.

Referenced by InitDialogRules(), OnAddNetclassClick(), OnMoveUpSelectedNetClass(), and OnRemoveNetclassClick().

449 {
450  m_rightClassChoice->Clear();
451  m_leftClassChoice->Clear();
452 
453  m_rightClassChoice->Append( wildCard );
454  m_leftClassChoice->Append( wildCard );
455 
456  for( int ii = 0; ii < m_grid->GetNumberRows(); ii++ )
457  {
458  m_rightClassChoice->Append( m_grid->GetRowLabelValue( ii ) );
459  m_leftClassChoice->Append( m_grid->GetRowLabelValue( ii ) );
460  }
461 
462  m_rightClassChoice->Select( 0 );
463  m_leftClassChoice->Select( 0 );
464 
465  m_buttonRightToLeft->Enable( false );
466  m_buttonLeftToRight->Enable( false );
467 
468  FillListBoxWithNetNames( m_leftListCtrl, m_leftClassChoice->GetStringSelection() );
470 }
static const wxString wildCard
the name of a fictitious netclass which includes all NETs
void FillListBoxWithNetNames(NETS_LIST_CTRL *aListCtrl, const wxString &aNetClass)
Function FillListBoxWithNetNames populates aListCtrl with net names and class names from m_AllNets in...
void DIALOG_DESIGN_RULES::InitRulesList ( )
private

Function InitRulesList Fill the grid showing current rules with values.

Definition at line 510 of file dialog_design_rules.cpp.

References NETCLASSES::begin(), class2gridRow(), NETCLASSES::end(), NETCLASSES::GetCount(), NETCLASSES::GetDefault(), m_BrdSettings, DIALOG_DESIGN_RULES_BASE::m_grid, and BOARD_DESIGN_SETTINGS::m_NetClasses.

Referenced by InitDialogRules().

511 {
512  NETCLASSES& netclasses = m_BrdSettings->m_NetClasses;
513 
514  // the +1 is for the Default NETCLASS.
515  if( netclasses.GetCount() + 1 > (unsigned) m_grid->GetNumberRows() )
516  {
517  m_grid->AppendRows( netclasses.GetCount() + 1 - m_grid->GetNumberRows() );
518  }
519 
520  // enter the Default NETCLASS.
521  class2gridRow( m_grid, 0, netclasses.GetDefault() );
522 
523  // enter others netclasses
524  int row = 1;
525 
526  for( NETCLASSES::iterator i = netclasses.begin(); i!=netclasses.end(); ++i, ++row )
527  {
528  NETCLASSPTR netclass = i->second;
529 
530  class2gridRow( m_grid, row, netclass );
531  }
532 }
iterator end()
NETCLASS_MAP::iterator iterator
iterator begin()
Class NETCLASSES is a container for NETCLASS instances.
static void class2gridRow(wxGrid *grid, int row, NETCLASSPTR nc)
unsigned GetCount() const
Function GetCount.
BOARD_DESIGN_SETTINGS * m_BrdSettings
NETCLASSPTR GetDefault() const
Function GetDefault.
NETCLASSES m_NetClasses
List of current netclasses. There is always the default netclass.
KIWAY& KIWAY_HOLDER::Kiway ( ) const
inlineinherited

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

A KIWAY_HOLDER is not necessarily a KIWAY_PLAYER.

Definition at line 60 of file kiway_player.h.

References KIWAY_HOLDER::m_kiway.

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

61  {
62  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
63  return *m_kiway;
64  }
KIWAY * m_kiway
Definition: kiway_player.h:85
void DIALOG_DESIGN_RULES::makePointers ( PNETCUPS aList,
const wxString &  aNetClassName 
)
private

Definition at line 375 of file dialog_design_rules.cpp.

References m_AllNets, sortByClassThenName(), and wildCard.

Referenced by FillListBoxWithNetNames().

376 {
377  aList->clear();
378 
379  if( wildCard == aNetClassName )
380  {
381  for( NETCUPS::iterator n = m_AllNets.begin(); n != m_AllNets.end(); ++n )
382  {
383  aList->push_back( &*n );
384  }
385 
386  sort( aList->begin(), aList->end(), sortByClassThenName );
387 
388  // could use a different sort order for wildCard case.
389  }
390  else
391  {
392  for( NETCUPS::iterator n = m_AllNets.begin(); n != m_AllNets.end(); ++n )
393  {
394  if( n->clazz == aNetClassName )
395  aList->push_back( &*n );
396  }
397 
398  sort( aList->begin(), aList->end(), sortByClassThenName );
399  }
400 }
static bool sortByClassThenName(NETCUP *a, NETCUP *b)
static const wxString wildCard
the name of a fictitious netclass which includes all NETs
NETCUPS m_AllNets
A two column table which gets filled once and never loses any elements, so it is basically constant...
void DIALOG_DESIGN_RULES::moveSelectedItems ( NETS_LIST_CTRL src,
const wxString &  newClassName 
)
private

Definition at line 900 of file dialog_design_rules.cpp.

References NETCLASS::Default, setNetClass(), and wildCard.

Referenced by OnLeftToRightCopyButton(), and OnRightToLeftCopyButton().

901 {
902  wxListItem item;
903  wxString netName;
904 
905  item.m_mask |= wxLIST_MASK_TEXT; // Validate the member m_text of the wxListItem item
906 
907  for( int row = 0; row < src->GetItemCount(); ++row )
908  {
909  if( !src->GetItemState( row, wxLIST_STATE_SELECTED ) )
910  continue;
911 
912  item.SetColumn( 0 );
913  item.SetId( row );
914 
915  src->GetItem( item );
916  netName = item.GetText();
917 
918  setNetClass( netName, newClassName == wildCard ? NETCLASS::Default : newClassName );
919  }
920 }
static const char Default[]
the name of the default NETCLASS
static const wxString wildCard
the name of a fictitious netclass which includes all NETs
void setNetClass(const wxString &aNetName, const wxString &aClassName)
void DIALOG_DESIGN_RULES::OnAddNetclassClick ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_DESIGN_RULES_BASE.

Definition at line 708 of file dialog_design_rules.cpp.

References DisplayError(), EnsureGridRowTitleWidth(), InitializeRulesSelectionBoxes(), DIALOG_DESIGN_RULES_BASE::m_grid, and m_initialRowLabelsSize.

709 {
710  wxString class_name;
711 
712  // @todo set validator to ensure net class name is valid rather than all of the checks
713  // after the OK button has been selected.
714  wxTextEntryDialog dlg( this, _( "New Net Class Name:" ), wxEmptyString, class_name );
715 
716  if( dlg.ShowModal() != wxID_OK )
717  return; // canceled by user
718 
719  class_name = dlg.GetValue();
720  class_name.Trim( true );
721  class_name.Trim( false );
722 
723  if( class_name.IsEmpty() )
724  return; // empty name not allowed
725 
726  // The name must dot exists:
727  for( int ii = 0; ii < m_grid->GetNumberRows(); ii++ )
728  {
729  wxString value;
730  value = m_grid->GetRowLabelValue( ii );
731 
732  if( class_name.CmpNoCase( value ) == 0 ) // Already exists!
733  {
734  DisplayError( this, _( "Duplicate net class names are not allowed." ) );
735  return;
736  }
737  }
738 
739  m_grid->AppendRows();
740  m_grid->SetRowLabelValue( m_grid->GetNumberRows() - 1, class_name );
741 
742  // Copy values of the default class:
743  int irow = m_grid->GetNumberRows() - 1;
744 
745  for( int icol = 0; icol < m_grid->GetNumberCols(); icol++ )
746  {
747  wxString value;
748  value = m_grid->GetCellValue( 0, icol );
749  m_grid->SetCellValue( irow, icol, value );
750  }
751 
753 
755 }
static void EnsureGridRowTitleWidth(wxWindow *aShower, wxGrid *aGrid, int aMinWidth)
int m_initialRowLabelsSize
the initial width given by wxFormBuilder
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:71
void DIALOG_DESIGN_RULES::OnAllowMicroVias ( wxCommandEvent &  event)
overrideprivatevirtual

Function OnAllowMicroVias is called whenever the AllowMicroVias checkbox is toggled.

Reimplemented from DIALOG_DESIGN_RULES_BASE.

Definition at line 823 of file dialog_design_rules.cpp.

References CheckAllowMicroVias().

824 {
826 }
void DIALOG_DESIGN_RULES::OnLeftCBSelection ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_DESIGN_RULES_BASE.

Definition at line 866 of file dialog_design_rules.cpp.

References FillListBoxWithNetNames(), DIALOG_DESIGN_RULES_BASE::m_buttonLeftToRight, DIALOG_DESIGN_RULES_BASE::m_buttonRightToLeft, DIALOG_DESIGN_RULES_BASE::m_leftClassChoice, DIALOG_DESIGN_RULES_BASE::m_leftListCtrl, and DIALOG_DESIGN_RULES_BASE::m_rightClassChoice.

867 {
868  FillListBoxWithNetNames( m_leftListCtrl, m_leftClassChoice->GetStringSelection() );
869 
870  if( m_leftClassChoice->GetStringSelection() == m_rightClassChoice->GetStringSelection() )
871  {
872  m_buttonRightToLeft->Enable( false );
873  m_buttonLeftToRight->Enable( false );
874  }
875  else
876  {
877  m_buttonRightToLeft->Enable( true );
878  m_buttonLeftToRight->Enable( true );
879  }
880 }
void FillListBoxWithNetNames(NETS_LIST_CTRL *aListCtrl, const wxString &aNetClass)
Function FillListBoxWithNetNames populates aListCtrl with net names and class names from m_AllNets in...
void DIALOG_DESIGN_RULES::OnLeftSelectAllButton ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_DESIGN_RULES_BASE.

Definition at line 945 of file dialog_design_rules.cpp.

References DIALOG_DESIGN_RULES_BASE::m_leftListCtrl.

946 {
947  for( int ii = 0; ii < m_leftListCtrl->GetItemCount(); ii++ )
948  m_leftListCtrl->SetItemState( ii, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
949 }
void DIALOG_DESIGN_RULES::OnLeftToRightCopyButton ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_DESIGN_RULES_BASE.

Definition at line 934 of file dialog_design_rules.cpp.

References FillListBoxWithNetNames(), DIALOG_DESIGN_RULES_BASE::m_leftClassChoice, DIALOG_DESIGN_RULES_BASE::m_leftListCtrl, DIALOG_DESIGN_RULES_BASE::m_rightClassChoice, DIALOG_DESIGN_RULES_BASE::m_rightListCtrl, and moveSelectedItems().

935 {
936  wxString newClassName = m_rightClassChoice->GetStringSelection();
937 
938  moveSelectedItems( m_leftListCtrl, newClassName );
939 
940  FillListBoxWithNetNames( m_leftListCtrl, m_leftClassChoice->GetStringSelection() );
942 }
void moveSelectedItems(NETS_LIST_CTRL *src, const wxString &newClassName)
void FillListBoxWithNetNames(NETS_LIST_CTRL *aListCtrl, const wxString &aNetClass)
Function FillListBoxWithNetNames populates aListCtrl with net names and class names from m_AllNets in...
void DIALOG_DESIGN_RULES::OnMoveUpSelectedNetClass ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_DESIGN_RULES_BASE.

Definition at line 828 of file dialog_design_rules.cpp.

References InitializeRulesSelectionBoxes(), and DIALOG_DESIGN_RULES_BASE::m_grid.

829 {
830  // Cannot move up rules if we have 1 or 2 rules only
831  if( m_grid->GetNumberRows() < 3 )
832  return;
833 
834  wxArrayInt select = m_grid->GetSelectedRows();
835  bool reinit = false;
836 
837  for( unsigned irow = 0; irow < select.GetCount(); irow++ )
838  {
839  int ii = select[irow];
840  if( ii < 2 ) // The default netclass *must* be the first netclass
841  continue; // so we cannot move up line 0 and 1
842 
843  // Swap the rule and the previous rule
844  wxString curr_value, previous_value;
845 
846  for( int icol = 0; icol < m_grid->GetNumberCols(); icol++ )
847  {
848  reinit = true;
849  curr_value = m_grid->GetCellValue( ii, icol );
850  previous_value = m_grid->GetCellValue( ii - 1, icol );
851  m_grid->SetCellValue( ii, icol, previous_value );
852  m_grid->SetCellValue( ii - 1, icol, curr_value );
853  }
854 
855  curr_value = m_grid->GetRowLabelValue( ii );
856  previous_value = m_grid->GetRowLabelValue( ii - 1 );
857  m_grid->SetRowLabelValue( ii, previous_value );
858  m_grid->SetRowLabelValue( ii - 1, curr_value );
859  }
860 
861  if( reinit )
863 }
void DIALOG_DESIGN_RULES::OnNetClassesNameLeftClick ( wxGridEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from DIALOG_DESIGN_RULES_BASE.

Definition at line 94 of file dialog_design_rules.h.

94 { event.Skip(); }
void DIALOG_DESIGN_RULES::OnNetClassesNameRightClick ( wxGridEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from DIALOG_DESIGN_RULES_BASE.

Definition at line 95 of file dialog_design_rules.h.

95 { event.Skip(); }
void DIALOG_DESIGN_RULES::OnNotebookPageChanged ( wxNotebookEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_DESIGN_RULES_BASE.

Definition at line 676 of file dialog_design_rules.cpp.

References s_LastTabSelection.

677 {
678  s_LastTabSelection = event.GetSelection();
679 
680  // Skip() allows OSX to properly refresh controls.
681  event.Skip();
682 }
static int s_LastTabSelection
which tab user had open last
void DIALOG_DESIGN_RULES::OnRemoveNetclassClick ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_DESIGN_RULES_BASE.

Definition at line 766 of file dialog_design_rules.cpp.

References NETCLASS::Default, EnsureGridRowTitleWidth(), InitializeRulesSelectionBoxes(), DIALOG_DESIGN_RULES_BASE::m_grid, m_initialRowLabelsSize, sort_int(), and swapNetClass().

767 {
768  wxArrayInt select = m_grid->GetSelectedRows();
769 
770  // Sort selection by decreasing index order:
771  select.Sort( sort_int );
772  bool reinit = false;
773 
774  // rows labels are not removed when deleting rows: they are not deleted.
775  // So we must store them, remove corresponding labels and reinit them
776  wxArrayString labels;
777 
778  for( int ii = 0; ii < m_grid->GetNumberRows(); ii++ )
779  labels.Add( m_grid->GetRowLabelValue( ii ) );
780 
781  // Delete rows from last to first (this is the order wxArrayInt select after sorting) )
782  // This order is Ok when removing rows
783  for( unsigned ii = 0; ii < select.GetCount(); ii++ )
784  {
785  int grid_row = select[ii];
786 
787  if( grid_row != 0 ) // Do not remove the default class
788  {
789  wxString classname = m_grid->GetRowLabelValue( grid_row );
790  m_grid->DeleteRows( grid_row );
791  labels.RemoveAt( grid_row ); // Remove corresponding row label
792  reinit = true;
793 
794  // reset the net class to default for members of the removed class
795  swapNetClass( classname, NETCLASS::Default );
796  }
797  else
798  wxMessageBox( _( "The default net class cannot be removed" ) );
799  }
800 
801  if( reinit )
802  {
803  // Reinit labels :
804  for( unsigned ii = 1; ii < labels.GetCount(); ii++ )
805  m_grid->SetRowLabelValue( ii, labels[ii] );
806 
809  }
810 }
static void EnsureGridRowTitleWidth(wxWindow *aShower, wxGrid *aGrid, int aMinWidth)
void swapNetClass(const wxString &oldClass, const wxString &newClass)
Function swapNetClass replaces one net class name with another in the master list, m_AllNets.
int sort_int(int *first, int *second)
static const char Default[]
the name of the default NETCLASS
int m_initialRowLabelsSize
the initial width given by wxFormBuilder
void DIALOG_DESIGN_RULES::OnRightCBSelection ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_DESIGN_RULES_BASE.

Definition at line 883 of file dialog_design_rules.cpp.

References FillListBoxWithNetNames(), DIALOG_DESIGN_RULES_BASE::m_buttonLeftToRight, DIALOG_DESIGN_RULES_BASE::m_buttonRightToLeft, DIALOG_DESIGN_RULES_BASE::m_leftClassChoice, DIALOG_DESIGN_RULES_BASE::m_rightClassChoice, and DIALOG_DESIGN_RULES_BASE::m_rightListCtrl.

884 {
886 
887  if( m_leftClassChoice->GetStringSelection() == m_rightClassChoice->GetStringSelection() )
888  {
889  m_buttonRightToLeft->Enable( false );
890  m_buttonLeftToRight->Enable( false );
891  }
892  else
893  {
894  m_buttonRightToLeft->Enable( true );
895  m_buttonLeftToRight->Enable( true );
896  }
897 }
void FillListBoxWithNetNames(NETS_LIST_CTRL *aListCtrl, const wxString &aNetClass)
Function FillListBoxWithNetNames populates aListCtrl with net names and class names from m_AllNets in...
void DIALOG_DESIGN_RULES::OnRightSelectAllButton ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_DESIGN_RULES_BASE.

Definition at line 952 of file dialog_design_rules.cpp.

References DIALOG_DESIGN_RULES_BASE::m_rightListCtrl.

953 {
954  for( int ii = 0; ii < m_rightListCtrl->GetItemCount(); ii++ )
955  m_rightListCtrl->SetItemState( ii, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
956 }
void DIALOG_DESIGN_RULES::OnRightToLeftCopyButton ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_DESIGN_RULES_BASE.

Definition at line 923 of file dialog_design_rules.cpp.

References FillListBoxWithNetNames(), DIALOG_DESIGN_RULES_BASE::m_leftClassChoice, DIALOG_DESIGN_RULES_BASE::m_leftListCtrl, DIALOG_DESIGN_RULES_BASE::m_rightClassChoice, DIALOG_DESIGN_RULES_BASE::m_rightListCtrl, and moveSelectedItems().

924 {
925  wxString newClassName = m_leftClassChoice->GetStringSelection();
926 
927  moveSelectedItems( m_rightListCtrl, newClassName );
928 
929  FillListBoxWithNetNames( m_leftListCtrl, m_leftClassChoice->GetStringSelection() );
931 }
void moveSelectedItems(NETS_LIST_CTRL *src, const wxString &newClassName)
void FillListBoxWithNetNames(NETS_LIST_CTRL *aListCtrl, const wxString &aNetClass)
Function FillListBoxWithNetNames populates aListCtrl with net names and class names from m_AllNets in...
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 DIALOG_EDIT_COMPONENT_IN_LIBRARY::AddAliasOfPart(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), LIB_VIEW_FRAME::BestZoom(), DIALOG_MODULE_MODULE_EDITOR::BrowseAndAdd3DShapeFile(), DIALOG_MODULE_BOARD_EDITOR::BrowseAndAdd3DShapeFile(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::BrowseAndSelectDocFile(), DIALOG_EXCHANGE_MODULE::BrowseAndSelectFootprint(), DIALOG_SYMBOL_LIB_TABLE::browseLibrariesHandler(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_MODULE_MODULE_EDITOR::Cfg3DPath(), DIALOG_MODULE_BOARD_EDITOR::Cfg3DPath(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), LIB_EDIT_FRAME::CreateNewLibraryPart(), DIALOG_PLOT_SCHEMATIC::createPlotFileName(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromCurrentLibrary(), LIB_EDIT_FRAME::DeleteOnePart(), DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_FP_LIB_TABLE::DIALOG_FP_LIB_TABLE(), DIALOG_MODULE_BOARD_EDITOR::DIALOG_MODULE_BOARD_EDITOR(), DIALOG_MODULE_MODULE_EDITOR::DIALOG_MODULE_MODULE_EDITOR(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_SYMBOL_LIB_TABLE::DIALOG_SYMBOL_LIB_TABLE(), LIB_VIEW_FRAME::DisplayLibInfos(), LIB_EDIT_FRAME::DisplayLibInfos(), SCH_BASE_FRAME::DisplayListComponentsInLib(), PCB_EDIT_FRAME::doAutoSave(), DIALOG_MODULE_MODULE_EDITOR::Edit3DShapeFileName(), DIALOG_MODULE_BOARD_EDITOR::Edit3DShapeFileName(), SCH_EDIT_FRAME::EditComponentFieldText(), LIB_EDIT_FRAME::EditField(), SCH_EDIT_FRAME::EditSheet(), PCB_EDIT_FRAME::Export_IDF3(), PCB_EDIT_FRAME::ExportVRML_File(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::GenD356File(), NETLIST_DIALOG::GenNetlist(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), LIB_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), FOOTPRINT_EDIT_FRAME::GetCurrentLib(), SCH_BASE_FRAME::GetLibAlias(), SCH_BASE_FRAME::GetLibPart(), FOOTPRINT_EDIT_FRAME::getLibPath(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), DIALOG_BOM::getPluginFileName(), LIB_VIEW_FRAME::getSelectedAlias(), FP_THREAD_IFACE::GetTable(), SCH_EDIT_FRAME::ImportFile(), PCB_EDIT_FRAME::ImportFile(), DIALOG_MODULE_MODULE_EDITOR::initModeditProperties(), DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties(), PCB_EDIT_FRAME::InstallNetlistFrame(), SCH_EDIT_FRAME::IsSearchCacheObsolete(), SCH_EDIT_FRAME::Load_Component(), SCH_EDIT_FRAME::LoadCmpToFootprintLinkFile(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), CVPCB_MAINFRAME::LoadFootprintFiles(), DIALOG_SPICE_MODEL::loadLibrary(), LIB_EDIT_FRAME::LoadOneSymbol(), CVPCB_MAINFRAME::LoadProjectFile(), SCH_EDIT_FRAME::LoadProjectFile(), PCB_EDIT_FRAME::LoadProjectSettings(), DIALOG_DRC_CONTROL::makeValidFileNameReport(), FOOTPRINT_VIEWER_FRAME::OnActivate(), DIALOG_GENCAD_EXPORT_OPTIONS::onBrowse(), DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), SCH_BASE_FRAME::OnEditSymbolLibTable(), DIALOG_GENDRILL::OnGenReportFile(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), PCB_EDIT_FRAME::OnLeftClick(), DIALOG_NETLIST::OnOpenNetlistClick(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_SVG_PRINT::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), DIALOG_GEN_MODULE_POSITION::OnOutputDirectoryBrowseClicked(), LIB_EDIT_FRAME::OnPlotCurrentComponent(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), SCH_EDIT_FRAME::OnRightClick(), DIALOG_BOM::OnRunPlugin(), LIB_EDIT_FRAME::OnSaveCurrentPart(), DIALOG_NETLIST::OnSaveMessagesToFile(), SCH_EDIT_FRAME::OnSaveProject(), DIALOG_CHOOSE_COMPONENT::OnSchViewPaint(), DIALOG_SPICE_MODEL::onSelectLibrary(), LIB_VIEW_FRAME::OnSelectSymbol(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnTestChipName(), LIB_EDIT_FRAME::OnUpdateSaveCurrentLib(), LIB_EDIT_FRAME::OnUpdateSaveCurrentLibAs(), FOOTPRINT_EDIT_FRAME::OnUpdateSelectCurrentLib(), LIB_EDIT_FRAME::OnViewEntryDoc(), LIB_VIEW_FRAME::onViewSymbolDocument(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_EDITOR_CONTROL::PlaceModule(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), SCH_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Config(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), LIB_VIEW_FRAME::ReCreateHToolbar(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), LIB_VIEW_FRAME::ReCreateListCmp(), LIB_VIEW_FRAME::ReCreateListLib(), LIB_VIEW_FRAME::RedrawActiveWindow(), EDA_3D_VIEWER::ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), SCH_EDIT_FRAME::RescueLegacyProject(), SCH_EDIT_FRAME::RescueSymbolLibTableProject(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), LIB_EDIT_FRAME::SaveActiveLibrary(), SCH_EDIT_FRAME::SaveEEFile(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), LIB_EDIT_FRAME::SaveOneSymbol(), CVPCB_MAINFRAME::SaveProjectFile(), SCH_EDIT_FRAME::SaveProjectSettings(), PCB_EDIT_FRAME::SaveProjectSettings(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), SCH_BASE_FRAME::SelectComponentFromLibrary(), FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint(), PCB_BASE_FRAME::SelectLibrary(), SCH_BASE_FRAME::SelectLibraryFromList(), SCH_EDIT_FRAME::sendNetlist(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), LIB_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), LIB_EDIT_FRAME::SetCurPart(), DIALOG_CHOOSE_COMPONENT::ShowFootprintFor(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), EDA_3D_VIEWER::takeScreenshot(), SIM_PLOT_FRAME::updateNetlistExporter(), SCH_SCREEN::UpdateSymbolLinks(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), CVPCB_MAINFRAME::UpdateTitle(), FOOTPRINT_EDIT_FRAME::updateTitle(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_MODULE_BOARD_EDITOR::~DIALOG_MODULE_BOARD_EDITOR(), and DIALOG_MODULE_MODULE_EDITOR::~DIALOG_MODULE_MODULE_EDITOR().

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

Definition at line 218 of file dialog_design_rules.cpp.

References g_UserUnit, DIALOG_DESIGN_RULES_BASE::m_SetMicroViasMinDrillCtrl, DIALOG_DESIGN_RULES_BASE::m_SetMicroViasMinSizeCtrl, DIALOG_DESIGN_RULES_BASE::m_SetTrackMinWidthCtrl, DIALOG_DESIGN_RULES_BASE::m_SetViasMinDrillCtrl, DIALOG_DESIGN_RULES_BASE::m_SetViasMinSizeCtrl, and To_User_Unit().

Referenced by DIALOG_DESIGN_RULES().

219 {
220  // Set floating-point validators for numerical inputs
221  wxFloatingPointValidator< double > fpValidator( NULL, wxNUM_VAL_ZERO_AS_BLANK | wxNUM_VAL_NO_TRAILING_ZEROES );
222 
223  int maxDimension = 1000 * IU_PER_MILS; // One-inch
224 
225  fpValidator.SetRange( 0, To_User_Unit( g_UserUnit, maxDimension ) );
226  fpValidator.SetPrecision( 10 );
227 
228  m_SetViasMinSizeCtrl->SetValidator( fpValidator );
229  m_SetViasMinDrillCtrl->SetValidator( fpValidator );
230  m_SetMicroViasMinSizeCtrl->SetValidator( fpValidator );
231  m_SetMicroViasMinDrillCtrl->SetValidator( fpValidator );
232  m_SetTrackMinWidthCtrl->SetValidator( fpValidator );
233 }
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
double To_User_Unit(EDA_UNITS_T aUnit, double aValue)
Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit...
Definition: base_units.cpp:90
void KIWAY_HOLDER::SetKiway ( wxWindow *  aDest,
KIWAY aKiway 
)
inherited

Function SetKiway.

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

Definition at line 41 of file kiway_holder.cpp.

References KIWAY_HOLDER::m_kiway, and name.

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

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

Definition at line 959 of file dialog_design_rules.cpp.

References m_AllNets.

Referenced by moveSelectedItems().

960 {
961  for( NETCUPS::iterator i = m_AllNets.begin(); i != m_AllNets.end(); ++i )
962  {
963  if( i->net == aNetName )
964  {
965  i->clazz = aClassName;
966  break;
967  }
968  }
969 }
NETCUPS m_AllNets
A two column table which gets filled once and never loses any elements, so it is basically constant...
void DIALOG_DESIGN_RULES::SetRoutableLayerStatus ( )
private
bool DIALOG_SHIM::Show ( bool  show)
overrideinherited

Definition at line 139 of file dialog_shim.cpp.

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

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

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

Definition at line 495 of file dialog_shim.cpp.

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

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

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

Function swapNetClass replaces one net class name with another in the master list, m_AllNets.

Definition at line 183 of file dialog_design_rules.h.

Referenced by OnRemoveNetclassClick().

184  {
185  for( NETCUPS::iterator i = m_AllNets.begin(); i!=m_AllNets.end(); ++i )
186  {
187  if( i->clazz == oldClass )
188  i->clazz = newClass;
189  }
190  }
NETCUPS m_AllNets
A two column table which gets filled once and never loses any elements, so it is basically constant...
bool DIALOG_DESIGN_RULES::TestDataValidity ( wxString *  aErrorMsg = NULL)
private

Definition at line 972 of file dialog_design_rules.cpp.

References g_UserUnit, GetChars(), GRID_DIFF_PAIR_WIDTH, GRID_TRACKSIZE, GRID_uVIADRILL, GRID_uVIASIZE, GRID_VIADRILL, GRID_VIASIZE, DIALOG_DESIGN_RULES_BASE::m_grid, DIALOG_DESIGN_RULES_BASE::m_gridTrackWidthList, DIALOG_DESIGN_RULES_BASE::m_gridViaSizeList, DIALOG_DESIGN_RULES_BASE::m_SetMicroViasMinDrillCtrl, DIALOG_DESIGN_RULES_BASE::m_SetMicroViasMinSizeCtrl, DIALOG_DESIGN_RULES_BASE::m_SetTrackMinWidthCtrl, DIALOG_DESIGN_RULES_BASE::m_SetViasMinDrillCtrl, DIALOG_DESIGN_RULES_BASE::m_SetViasMinSizeCtrl, ReturnUnitSymbol(), To_User_Unit(), ValueFromString(), and ValueFromTextCtrl().

Referenced by TransferDataFromWindow().

973 {
974  bool result = true;
975 
976  wxString msg;
977  wxString errorMsg;
978 
979  wxString netclassLabel; // Name of a given netclass
980  wxString netclassError; // Error message particular to a given netclass
981 
982  wxString units = ReturnUnitSymbol( g_UserUnit, "%s" );
983 
984  int minViaDia = ValueFromTextCtrl( *m_SetViasMinSizeCtrl );
985  int minViaDrill = ValueFromTextCtrl( *m_SetViasMinDrillCtrl );
986  int minUViaDia = ValueFromTextCtrl( *m_SetMicroViasMinSizeCtrl );
987  int minUViaDrill = ValueFromTextCtrl( *m_SetMicroViasMinDrillCtrl );
988  int minTrackWidth = ValueFromTextCtrl( *m_SetTrackMinWidthCtrl );
989  int maxval = 1000 * IU_PER_MILS; // a max value for tracks and vias sizes (1 inch)
990 
991  // @todo Change this code to set the focus to the control where the first error occurs
992  // so the user doesn't have to figure out where the issue is.
993 
994  // Test net class parameters.
995  for( int row = 0; row < m_grid->GetNumberRows(); row++ )
996  {
997  netclassLabel = GetChars( m_grid->GetRowLabelValue( row ) );
998  netclassError.Clear(); // Clear the error for this netclass
999 
1000  int tracksize = ValueFromString( g_UserUnit,
1001  m_grid->GetCellValue( row, GRID_TRACKSIZE ) );
1002  if( tracksize < minTrackWidth )
1003  {
1004  result = false;
1005  msg.Printf( _( " - <b>Track Size</b> (%f %s) &lt; <b>Min Track Size</b> (%f %s)<br>" ),
1006  To_User_Unit( g_UserUnit, tracksize ), units,
1007  To_User_Unit( g_UserUnit, minTrackWidth ), units );
1008 
1009  netclassError += msg;
1010  }
1011 
1012  int dpsize = ValueFromString( g_UserUnit,
1013  m_grid->GetCellValue( row, GRID_DIFF_PAIR_WIDTH ) );
1014 
1015  if( dpsize < minTrackWidth )
1016  {
1017  result = false;
1018  msg.Printf( _( " - <b>Differential Pair Size</b> (%f %s) &lt; <b>Min Track Size</b> (%f %s)<br>" ),
1019  To_User_Unit( g_UserUnit, dpsize ), units,
1020  To_User_Unit( g_UserUnit, minTrackWidth ), units );
1021  netclassError += msg;
1022  }
1023 
1024 
1025  // Test vias
1026  int viadia = ValueFromString( g_UserUnit,
1027  m_grid->GetCellValue( row, GRID_VIASIZE ) );
1028 
1029  if( viadia < minViaDia )
1030  {
1031  result = false;
1032  msg.Printf( _( " - <b>Via Diameter</b> (%f %s) &lt; <b>Minimum Via Diameter</b> (%f %s)<br>" ),
1033  To_User_Unit( g_UserUnit, viadia ), units,
1034  To_User_Unit( g_UserUnit, minViaDia ), units );
1035  netclassError += msg;
1036  }
1037 
1038  int viadrill = ValueFromString( g_UserUnit,
1039  m_grid->GetCellValue( row, GRID_VIADRILL ) );
1040 
1041  if( viadrill >= viadia )
1042  {
1043  result = false;
1044  msg.Printf( _( " - <b>Via Drill</b> (%f %s) &ge; <b>Via Dia</b> (%f %s)<br>" ),
1045  To_User_Unit( g_UserUnit, viadrill ), units,
1046  To_User_Unit( g_UserUnit, viadia ), units );
1047  netclassError += msg;
1048  }
1049 
1050  if( viadrill < minViaDrill )
1051  {
1052  result = false;
1053  msg.Printf( _( " - <b>Via Drill</b> (%f %s) &lt; <b>Min Via Drill</b> (%f %s)<br>" ),
1054  To_User_Unit( g_UserUnit, viadrill ), units,
1055  To_User_Unit( g_UserUnit, minViaDrill ), units );
1056  netclassError += msg;
1057  }
1058 
1059  // Test Micro vias
1060  int muviadia = ValueFromString( g_UserUnit,
1061  m_grid->GetCellValue( row, GRID_uVIASIZE ) );
1062 
1063  if( muviadia < minUViaDia )
1064  {
1065  result = false;
1066  msg.Printf( _( " - <b>MicroVia Diameter</b> (%f %s) &lt; <b>MicroVia Min Diameter</b> (%f %s)<br>" ),
1067  To_User_Unit( g_UserUnit, muviadia ), units,
1068  To_User_Unit( g_UserUnit, minUViaDia ), units );
1069  netclassError += msg;
1070  }
1071 
1072  int muviadrill = ValueFromString( g_UserUnit,
1073  m_grid->GetCellValue( row, GRID_uVIADRILL ) );
1074 
1075  if( muviadrill >= muviadia )
1076  {
1077  result = false;
1078  msg.Printf( _( " - <b>MicroVia Drill</b> (%f %s) &ge; <b>MicroVia Dia</b> (%f %s)<br>" ),
1079  To_User_Unit( g_UserUnit, muviadrill ), units,
1080  To_User_Unit( g_UserUnit, muviadia ), units );
1081  netclassError += msg;
1082  }
1083 
1084  if( muviadrill < minUViaDrill )
1085  {
1086  result = false;
1087  msg.Printf( _( " - <b>MicroVia Drill</b> (%f %s) &lt; <b>MicroVia Min Drill</b> (%f %s)<br>" ),
1088  To_User_Unit( g_UserUnit, muviadrill ), units,
1089  To_User_Unit( g_UserUnit, minUViaDrill ), units );
1090  netclassError += msg;
1091  }
1092 
1093  // If this netclass contains errors, add it to the error message
1094  if ( !netclassError.IsEmpty() )
1095  {
1096  msg.Printf( _( "Netclass: <b>%s</b><br>" ), netclassLabel );
1097  errorMsg += msg;
1098  errorMsg += netclassError;
1099  errorMsg += "<br>";
1100  }
1101  }
1102 
1103  // Test custom tracks
1104  for( int row = 0; row < m_gridTrackWidthList->GetNumberRows(); ++row )
1105  {
1106  wxString tvalue = m_gridTrackWidthList->GetCellValue( row, 0 );
1107 
1108  if( tvalue.IsEmpty() )
1109  continue;
1110 
1111  int tracksize = ValueFromString( g_UserUnit, tvalue );
1112 
1113  if( tracksize < minTrackWidth )
1114  {
1115  result = false;
1116  msg.Printf( _( "<b>Extra Track %d Size</b> %s &lt; <b>Min Track Size</b><br>" ),
1117  row + 1, GetChars( tvalue ) );
1118 
1119  errorMsg += msg;
1120  }
1121 
1122  if( tracksize > maxval )
1123  {
1124  result = false;
1125  msg.Printf( _( "<b>Extra Track %d Size</b> %s &gt; <b>1 inch!</b><br>" ),
1126  row + 1, GetChars( tvalue ) );
1127 
1128  errorMsg += msg;
1129  }
1130  }
1131 
1132  // Test custom vias
1133  for( int row = 0; row < m_gridViaSizeList->GetNumberRows(); ++row )
1134  {
1135  wxString tvalue = m_gridViaSizeList->GetCellValue( row, 0 );
1136 
1137  if( tvalue.IsEmpty() )
1138  continue;
1139 
1140  int viadia = ValueFromString( g_UserUnit, tvalue );
1141 
1142  if( viadia < minViaDia )
1143  {
1144  result = false;
1145  msg.Printf( _( "<b>Extra Via %d Size</b> %s &lt; <b>Min Via Size</b><br>" ),
1146  row + 1, GetChars( tvalue ) );
1147  errorMsg += msg;
1148  }
1149 
1150  wxString drlvalue = m_gridViaSizeList->GetCellValue( row, 1 );
1151 
1152  if( drlvalue.IsEmpty() )
1153  {
1154  result = false;
1155  msg.Printf( _( "<b>No via drill size define in row %d</b><br>" ), row + 1 );
1156  errorMsg += msg;
1157  continue;
1158  }
1159 
1160  int viadrill = ValueFromString( g_UserUnit, drlvalue );
1161 
1162  if( viadrill < minViaDrill )
1163  {
1164  result = false;
1165  msg.Printf( _( "<b>Extra Via %d Drill</b> %s &lt; <b>Min Via Drill %s</b><br>" ),
1166  row + 1, GetChars( drlvalue ),
1167  GetChars( m_SetViasMinDrillCtrl->GetValue() ) );
1168  errorMsg += msg;
1169  }
1170 
1171  if( viadia <= viadrill )
1172  {
1173  result = false;
1174  msg.Printf( _( "<b>Extra Via %d Size</b> %s &le; <b> Drill Size</b> %s<br>" ),
1175  row + 1, GetChars( tvalue ), GetChars( drlvalue ) );
1176  errorMsg += msg;
1177  }
1178 
1179  // Test for a reasonable via size:
1180  if( viadia > maxval ) // 1 inch!
1181  {
1182  result = false;
1183  msg.Printf( _( "<b>Extra Via %d Size</b>%s &gt; <b>1 inch!</b><br>" ),
1184  row + 1, GetChars( tvalue ) );
1185  errorMsg += msg;
1186  }
1187  }
1188 
1189  if( !result && aErrorMsg )
1190  *aErrorMsg = errorMsg;
1191 
1192  return result;
1193 }
wxString ReturnUnitSymbol(EDA_UNITS_T aUnit, const wxString &formatString)
Returns the units symbol.
Definition: base_units.cpp:420
int ValueFromString(EDA_UNITS_T aUnits, const wxString &aTextValue)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application...
Definition: base_units.cpp:368
int ValueFromTextCtrl(const wxTextCtrl &aTextCtr)
Convert the number Value in a string according to the internal units and the selected unit (g_UserUni...
Definition: base_units.cpp:384
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
double To_User_Unit(EDA_UNITS_T aUnit, double aValue)
Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit...
Definition: base_units.cpp:90
bool DIALOG_DESIGN_RULES::TransferDataFromWindow ( )
overridevirtual

Definition at line 685 of file dialog_design_rules.cpp.

References CopyDimensionsListsToBoard(), CopyGlobalRulesToBoard(), CopyRulesListToBoard(), NETCLASS::Default, m_BrdSettings, HTML_MESSAGE_BOX::MessageSet(), BOARD_DESIGN_SETTINGS::SetCurrentNetClass(), and TestDataValidity().

686 {
687  if( !wxDialog::TransferDataFromWindow() )
688  return false;
689 
690  wxString errorMsg;
691 
692  if( !TestDataValidity( &errorMsg ) )
693  {
694  HTML_MESSAGE_BOX dlg( this, _( "Design Rule Setting Error" ) );
695  dlg.MessageSet( errorMsg );
696  dlg.ShowModal();
697  return false;
698  }
699 
704  return true;
705 }
bool TestDataValidity(wxString *aErrorMsg=NULL)
static const char Default[]
the name of the default NETCLASS
Class HTML_MESSAGE_BOX.
BOARD_DESIGN_SETTINGS * m_BrdSettings
bool SetCurrentNetClass(const wxString &aNetClassName)
Function SetCurrentNetClass Must be called after a netclass selection (or after a netclass parameter ...

Member Data Documentation

wxButton* DIALOG_DESIGN_RULES_BASE::m_addButton
protectedinherited
NETCUPS DIALOG_DESIGN_RULES::m_AllNets
private

A two column table which gets filled once and never loses any elements, so it is basically constant, except that the NETCUP::clazz member can change for any given row a NET is moved in and out of a class.

class reflects the respective NET's current net class.

Definition at line 87 of file dialog_design_rules.h.

Referenced by CopyRulesListToBoard(), InitDialogRules(), makePointers(), and setNetClass().

wxButton* DIALOG_DESIGN_RULES_BASE::m_buttonLeftSelAll
protectedinherited
wxButton* DIALOG_DESIGN_RULES_BASE::m_buttonRightSelAll
protectedinherited
wxNotebook* DIALOG_DESIGN_RULES_BASE::m_DRnotebook
protectedinherited
wxGrid* DIALOG_DESIGN_RULES_BASE::m_gridTrackWidthList
protectedinherited
wxGrid* DIALOG_DESIGN_RULES_BASE::m_gridViaSizeList
protectedinherited
std::string DIALOG_SHIM::m_hash_key
protectedinherited
int DIALOG_DESIGN_RULES::m_initialRowLabelsSize
private

the initial width given by wxFormBuilder

Definition at line 77 of file dialog_design_rules.h.

Referenced by DIALOG_DESIGN_RULES(), OnAddNetclassClick(), and OnRemoveNetclassClick().

wxStaticText* DIALOG_DESIGN_RULES_BASE::m_MicroViaMinDrillTitle
protectedinherited
wxStaticText* DIALOG_DESIGN_RULES_BASE::m_MicroViaMinDrillUnits
protectedinherited
wxStaticText* DIALOG_DESIGN_RULES_BASE::m_MicroViaMinSizeTitle
protectedinherited
wxStaticText* DIALOG_DESIGN_RULES_BASE::m_MicroViaMinSizeUnits
protectedinherited
wxButton* DIALOG_DESIGN_RULES_BASE::m_moveUpButton
protectedinherited
wxCheckBox* DIALOG_DESIGN_RULES_BASE::m_OptAllowBlindBuriedVias
protectedinherited
wxCheckBox* DIALOG_DESIGN_RULES_BASE::m_OptAllowMicroVias
protectedinherited
wxPanel* DIALOG_DESIGN_RULES_BASE::m_panelGolbalDesignRules
protectedinherited
wxPanel* DIALOG_DESIGN_RULES_BASE::m_panelNetClassesEditor
protectedinherited
PCB_EDIT_FRAME* DIALOG_DESIGN_RULES::m_Parent
private

Definition at line 70 of file dialog_design_rules.h.

Referenced by DIALOG_DESIGN_RULES(), and InitDialogRules().

BOARD* DIALOG_DESIGN_RULES::m_Pcb
private

Definition at line 71 of file dialog_design_rules.h.

Referenced by CopyRulesListToBoard(), and InitDialogRules().

EVENT_LOOP* DIALOG_SHIM::m_qmodal_loop
protectedinherited

Definition at line 131 of file dialog_shim.h.

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

WDO_ENABLE_DISABLE* DIALOG_SHIM::m_qmodal_parent_disabler
protectedinherited
bool DIALOG_SHIM::m_qmodal_showing
protectedinherited
wxButton* DIALOG_DESIGN_RULES_BASE::m_removeButton
protectedinherited
wxStdDialogButtonSizer* DIALOG_DESIGN_RULES_BASE::m_sdbSizer1
protectedinherited
wxButton* DIALOG_DESIGN_RULES_BASE::m_sdbSizer1Cancel
protectedinherited
wxButton* DIALOG_DESIGN_RULES_BASE::m_sdbSizer1OK
protectedinherited
NETCLASSPTR DIALOG_DESIGN_RULES::m_SelectedNetClass
private

Definition at line 74 of file dialog_design_rules.h.

wxTextCtrl* DIALOG_DESIGN_RULES_BASE::m_SetMicroViasMinDrillCtrl
protectedinherited
wxTextCtrl* DIALOG_DESIGN_RULES_BASE::m_SetMicroViasMinSizeCtrl
protectedinherited
wxTextCtrl* DIALOG_DESIGN_RULES_BASE::m_SetTrackMinWidthCtrl
protectedinherited
wxTextCtrl* DIALOG_DESIGN_RULES_BASE::m_SetViasMinDrillCtrl
protectedinherited
wxTextCtrl* DIALOG_DESIGN_RULES_BASE::m_SetViasMinSizeCtrl
protectedinherited
wxStaticLine* DIALOG_DESIGN_RULES_BASE::m_staticline2
protectedinherited
wxStaticLine* DIALOG_DESIGN_RULES_BASE::m_staticline21
protectedinherited
wxStaticLine* DIALOG_DESIGN_RULES_BASE::m_staticline3
protectedinherited
wxStaticText* DIALOG_DESIGN_RULES_BASE::m_staticText7
protectedinherited
wxStaticText* DIALOG_DESIGN_RULES_BASE::m_staticText8
protectedinherited
wxStaticText* DIALOG_DESIGN_RULES_BASE::m_staticTextInfo
protectedinherited
wxStaticText* DIALOG_DESIGN_RULES_BASE::m_TrackMinWidthTitle
protectedinherited
wxStaticText* DIALOG_DESIGN_RULES_BASE::m_TrackMinWidthUnits
protectedinherited
std::vector<int> DIALOG_DESIGN_RULES::m_TracksWidthList
private
wxFloatingPointValidator< double > DIALOG_DESIGN_RULES::m_validator
private

Definition at line 79 of file dialog_design_rules.h.

wxStaticText* DIALOG_DESIGN_RULES_BASE::m_ViaMinDrillTitle
protectedinherited
wxStaticText* DIALOG_DESIGN_RULES_BASE::m_ViaMinDrillUnits
protectedinherited
wxStaticText* DIALOG_DESIGN_RULES_BASE::m_ViaMinTitle
protectedinherited
wxStaticText* DIALOG_DESIGN_RULES_BASE::m_ViaMinUnits
protectedinherited
std::vector<VIA_DIMENSION> DIALOG_DESIGN_RULES::m_ViasDimensionsList
private
int DIALOG_DESIGN_RULES::s_LastTabSelection = -1
staticprivate

which tab user had open last

Definition at line 76 of file dialog_design_rules.h.

Referenced by DIALOG_DESIGN_RULES(), and OnNotebookPageChanged().

const wxString DIALOG_DESIGN_RULES::wildCard = _( "* (Any)" )
staticprivate

the name of a fictitious netclass which includes all NETs

Definition at line 68 of file dialog_design_rules.h.

Referenced by InitializeRulesSelectionBoxes(), makePointers(), and moveSelectedItems().


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