KiCad PCB EDA Suite
panel_setup_netclasses.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2004-2009 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2009 Dick Hollenbeck, dick@softplc.com
6  * Copyright (C) 2009-2019 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 
27 #include <fctsys.h>
28 #include <class_drawpanel.h>
29 #include <base_units.h>
30 #include <confirm.h>
31 #include <pcb_edit_frame.h>
32 #include <board_design_settings.h>
33 #include <bitmaps.h>
34 #include <widgets/wx_grid.h>
35 #include <grid_tricks.h>
36 
37 #include <panel_setup_netclasses.h>
38 
39 
40 // Columns of netclasses grid
41 enum {
42  GRID_NAME = 0,
52 };
53 
54 
56  PANEL_SETUP_FEATURE_CONSTRAINTS* aConstraintsPanel ) :
57  PANEL_SETUP_NETCLASSES_BASE( aParent->GetTreebook() )
58 {
59  m_Parent = aParent;
60  m_Frame = aFrame;
61  m_Pcb = m_Frame->GetBoard();
63  m_ConstraintsPanel = aConstraintsPanel;
64 
65  m_netclassesDirty = true;
66 
67  // Prevent Size events from firing before we are ready
68  Freeze();
69  m_originalColWidths = new int[ m_netclassGrid->GetNumberCols() ];
70  // Calculate a min best size to handle longest usual numeric values:
71  // (The 'M' large char is used to give a margin)
72  int min_best_width = m_netclassGrid->GetTextExtent( "555,555555 milsM" ).x;
73 
74  for( int i = 0; i < m_netclassGrid->GetNumberCols(); ++i )
75  {
76  // We calculate the column min size only from texts sizes, not using the initial col width
77  // as this initial width is sometimes strange depending on the language (wxGrid bug?)
78  int min_width = m_netclassGrid->GetVisibleWidth( i, true, true, false );
79  m_netclassGrid->SetColMinimalWidth( i, min_width );
80  // We use a "best size" >= min_best_width
81  m_originalColWidths[ i ] = std::max( min_width, min_best_width );
82  m_netclassGrid->SetColSize( i, m_originalColWidths[ i ] );
83  }
84 
85  // Be sure the column labels are readable
87 
88  // Membership combobox editors require a bit more room, so increase the row size of
89  // all our grids for consistency
90  m_netclassGrid->SetDefaultRowSize( m_netclassGrid->GetDefaultRowSize() + 4 );
91  m_membershipGrid->SetDefaultRowSize( m_membershipGrid->GetDefaultRowSize() + 4 );
92 
93  m_netclassGrid->PushEventHandler( new GRID_TRICKS( m_netclassGrid ) );
94  m_membershipGrid->PushEventHandler( new GRID_TRICKS( m_membershipGrid ) );
95 
96  m_netclassGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
97  m_membershipGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
98 
99  // Set up the net name column of the netclass membership grid to read-only
100  wxGridCellAttr* attr = new wxGridCellAttr;
101  attr->SetReadOnly( true );
102  m_membershipGrid->SetColAttr( 0, attr );
103 
104  m_addButton->SetBitmap( KiBitmap( small_plus_xpm ) );
105  m_removeButton->SetBitmap( KiBitmap( trash_xpm ) );
106 
107  // wxFormBuilder doesn't include this event...
108  m_netclassGrid->Connect( wxEVT_GRID_CELL_CHANGING, wxGridEventHandler( PANEL_SETUP_NETCLASSES::OnNetclassGridCellChanging ), NULL, this );
109 
110  Thaw();
111 }
112 
113 
115 {
116  delete [] m_originalColWidths;
117 
118  // Delete the GRID_TRICKS.
119  m_netclassGrid->PopEventHandler( true );
120  m_membershipGrid->PopEventHandler( true );
121 
122  m_netclassGrid->Disconnect( wxEVT_GRID_CELL_CHANGING, wxGridEventHandler( PANEL_SETUP_NETCLASSES::OnNetclassGridCellChanging ), NULL, this );
123 }
124 
125 
126 static void netclassToGridRow( EDA_UNITS_T aUnits, wxGrid* aGrid, int aRow, const NETCLASSPTR& nc )
127 {
128  aGrid->SetCellValue( aRow, GRID_NAME, nc->GetName() );
129 
130 #define SET_MILS_CELL( col, val ) \
131  aGrid->SetCellValue( aRow, col, StringFromValue( aUnits, val, true, true ) )
132 
133  SET_MILS_CELL( GRID_CLEARANCE, nc->GetClearance() );
134  SET_MILS_CELL( GRID_TRACKSIZE, nc->GetTrackWidth() );
135  SET_MILS_CELL( GRID_VIASIZE, nc->GetViaDiameter() );
136  SET_MILS_CELL( GRID_VIADRILL, nc->GetViaDrill() );
137  SET_MILS_CELL( GRID_uVIASIZE, nc->GetuViaDiameter() );
138  SET_MILS_CELL( GRID_uVIADRILL, nc->GetuViaDrill() );
139  SET_MILS_CELL( GRID_DIFF_PAIR_WIDTH, nc->GetDiffPairWidth() );
140  SET_MILS_CELL( GRID_DIFF_PAIR_GAP, nc->GetDiffPairGap() );
141  // 6.0 TODO: SET_MILS_CELL( GRID_DIFF_PAIR_VIA_GAP, nc->GetDiffPairViaGap() );
142 }
143 
144 
146 {
147  NETCLASSES& netclasses = m_BrdSettings->m_NetClasses;
148  NETCLASSPTR netclass = netclasses.GetDefault();
149 
150  if( m_netclassGrid->GetNumberRows() )
151  m_netclassGrid->DeleteRows( 0, m_netclassGrid->GetNumberRows() );
152  m_netclassGrid->AppendRows( netclasses.GetCount() + 1 ); // + 1 for default netclass
153 
154  // enter the Default NETCLASS.
156 
157  // make the Default NETCLASS name read-only
158  wxGridCellAttr* cellAttr = m_netclassGrid->GetOrCreateCellAttr( 0, GRID_NAME );
159  cellAttr->SetReadOnly();
160  cellAttr->DecRef();
161 
162  // enter other netclasses
163  int row = 1;
164 
165  for( NETCLASSES::iterator i = netclasses.begin(); i != netclasses.end(); ++i, ++row )
167 
168  // ensure that all nets have net classes assigned
170 
171  if( m_membershipGrid->GetNumberRows() )
172  m_membershipGrid->DeleteRows( 0, m_membershipGrid->GetNumberRows() );
173 
174  for( NETINFO_ITEM* net : m_Pcb->GetNetInfo() )
175  {
176  if( net->GetNet() > 0 && net->IsCurrent() )
177  addNet( UnescapeString( net->GetNetname() ), net->GetNetClass()->GetName() );
178  }
179 
180  return true;
181 }
182 
183 
184 void PANEL_SETUP_NETCLASSES::addNet( wxString netName, const wxString& netclass )
185 {
186  int i = m_membershipGrid->GetNumberRows();
187 
188  m_membershipGrid->AppendRows( 1 );
189 
190  m_membershipGrid->SetCellValue( i, 0, netName );
191  m_membershipGrid->SetCellValue( i, 1, netclass );
192 }
193 
194 
195 /* Populates drop-downs with the list of net classes
196  */
198 {
200 
201  wxArrayString netclassNames;
202 
203  for( int ii = 0; ii < m_netclassGrid->GetNumberRows(); ii++ )
204  {
205  wxString netclassName = m_netclassGrid->GetCellValue( ii, GRID_NAME );
206  if( !netclassName.IsEmpty() )
207  netclassNames.push_back( netclassName );
208  }
209 
210  wxGridCellAttr* attr = new wxGridCellAttr;
211  attr->SetEditor( new wxGridCellChoiceEditor( netclassNames ) );
212  m_membershipGrid->SetColAttr( 1, attr );
213 
214  m_assignNetClass->Set( netclassNames );
215 
216  netclassNames.Insert( wxEmptyString, 0 );
217  m_netClassFilter->Set( netclassNames );
218 }
219 
220 
221 static void gridRowToNetclass( EDA_UNITS_T aUnits, wxGrid* grid, int row, const NETCLASSPTR& nc )
222 {
223  nc->SetName( grid->GetCellValue( row, GRID_NAME ) );
224 
225 #define MYCELL( col ) \
226  ValueFromString( aUnits, grid->GetCellValue( row, col ), true )
227 
228  nc->SetClearance( MYCELL( GRID_CLEARANCE ) );
229  nc->SetTrackWidth( MYCELL( GRID_TRACKSIZE ) );
230  nc->SetViaDiameter( MYCELL( GRID_VIASIZE ) );
231  nc->SetViaDrill( MYCELL( GRID_VIADRILL ) );
232  nc->SetuViaDiameter( MYCELL( GRID_uVIASIZE ) );
233  nc->SetuViaDrill( MYCELL( GRID_uVIADRILL ) );
234  nc->SetDiffPairWidth( MYCELL( GRID_DIFF_PAIR_WIDTH ) );
235  nc->SetDiffPairGap( MYCELL( GRID_DIFF_PAIR_GAP ) );
236  // 6.0 TODO: nc->SetDiffPairViaGap( MYCELL( GRID_DIFF_PAIR_VIA_GAP ) );
237 }
238 
239 
241 {
242  if( !validateData() )
243  return false;
244 
245  NETCLASSES& netclasses = m_BrdSettings->m_NetClasses;
246 
247  // Remove all netclasses from board. We'll copy new list after
248  netclasses.Clear();
249 
250  // Copy the default NetClass:
252 
253  // Copy other NetClasses :
254  for( int row = 1; row < m_netclassGrid->GetNumberRows(); ++row )
255  {
256  NETCLASSPTR nc = std::make_shared<NETCLASS>( m_netclassGrid->GetCellValue( row, GRID_NAME ) );
257 
258  if( m_BrdSettings->m_NetClasses.Add( nc ) )
260  }
261 
262  // Now read all nets and push them in the corresponding netclass net buffer
263  for( int row = 0; row < m_membershipGrid->GetNumberRows(); ++row )
264  {
265  NETCLASSPTR nc = netclasses.Find( m_membershipGrid->GetCellValue( row, 1 ) );
266 
267  if( nc )
268  nc->Add( m_membershipGrid->GetCellValue( row, 0 ) );
269  }
270 
273 
274  return true;
275 }
276 
277 
278 bool PANEL_SETUP_NETCLASSES::validateNetclassName( int aRow, wxString aName, bool focusFirst )
279 {
280  aName.Trim( true );
281  aName.Trim( false );
282 
283  if( aName.IsEmpty() )
284  {
285  wxString msg = _( "Netclass must have a name." );
286  m_Parent->SetError( msg, this, m_netclassGrid, aRow, GRID_NAME );
287  return false;
288  }
289 
290  for( int ii = 0; ii < m_netclassGrid->GetNumberRows(); ii++ )
291  {
292  if( ii != aRow && m_netclassGrid->GetRowLabelValue( ii ).CmpNoCase( aName ) == 0 )
293  {
294  wxString msg = _( "Netclass name already in use." );
295  m_Parent->SetError( msg, this, m_netclassGrid, focusFirst ? aRow : ii, GRID_NAME );
296  return false;
297  }
298  }
299 
300  return true;
301 }
302 
303 
305 {
306  if( event.GetCol() == GRID_NAME )
307  {
308  if( validateNetclassName( event.GetRow(), event.GetString() ) )
309  m_netclassesDirty = true;
310  else
311  event.Veto();
312  }
313 }
314 
315 
316 void PANEL_SETUP_NETCLASSES::OnAddNetclassClick( wxCommandEvent& event )
317 {
319  return;
320 
321  int row = m_netclassGrid->GetNumberRows();
322  m_netclassGrid->AppendRows();
323 
324  // Copy values of the default class:
325  for( int col = 1; col < m_netclassGrid->GetNumberCols(); col++ )
326  m_netclassGrid->SetCellValue( row, col, m_netclassGrid->GetCellValue( 0, col ) );
327 
328  m_netclassGrid->MakeCellVisible( row, 0 );
329  m_netclassGrid->SetGridCursor( row, 0 );
330 
331  m_netclassGrid->EnableCellEditControl( true );
332  m_netclassGrid->ShowCellEditControl();
333 
334  m_netclassesDirty = true;
335 }
336 
337 
339 {
341  return;
342 
343  int curRow = m_netclassGrid->GetGridCursorRow();
344 
345  if( curRow < 0 )
346  return;
347  else if( curRow == 0 )
348  {
349  DisplayErrorMessage( this, _( "The default net class is required." ) );
350  return;
351  }
352 
353  // reset the net class to default for members of the removed class
354  wxString classname = m_netclassGrid->GetCellValue( curRow, GRID_NAME );
355 
356  for( int row = 0; row < m_membershipGrid->GetNumberRows(); ++row )
357  {
358  if( m_membershipGrid->GetCellValue( row, 1 ) == classname )
359  m_membershipGrid->SetCellValue( row, 1, NETCLASS::Default );
360  }
361 
362  m_netclassGrid->DeleteRows( curRow, 1 );
363 
364  m_netclassGrid->MakeCellVisible( std::max( 0, curRow-1 ), m_netclassGrid->GetGridCursorCol() );
365  m_netclassGrid->SetGridCursor( std::max( 0, curRow-1 ), m_netclassGrid->GetGridCursorCol() );
366 
367  m_netclassesDirty = true;
368 }
369 
370 
372 {
373  // Account for scroll bars
374  aWidth -= ( m_netclassGrid->GetSize().x - m_netclassGrid->GetClientSize().x );
375 
376  for( int i = 1; i < m_netclassGrid->GetNumberCols(); i++ )
377  {
378  m_netclassGrid->SetColSize( i, m_originalColWidths[ i ] );
379  aWidth -= m_originalColWidths[ i ];
380  }
381 
382  m_netclassGrid->SetColSize( 0, std::max( aWidth, m_originalColWidths[ 0 ] ) );
383 }
384 
385 
387 {
388  AdjustNetclassGridColumns( event.GetSize().GetX() );
389 
390  event.Skip();
391 }
392 
393 
395 {
396  // Account for scroll bars
397  aWidth -= ( m_membershipGrid->GetSize().x - m_membershipGrid->GetClientSize().x );
398 
399  // Set className column width to original className width from netclasses grid
400  int classNameWidth = m_originalColWidths[ 0 ];
401  m_membershipGrid->SetColSize( 1, m_originalColWidths[ 0 ] );
402  m_membershipGrid->SetColSize( 0, std::max( aWidth - classNameWidth, classNameWidth ) );
403 }
404 
405 
407 {
408  AdjustMembershipGridColumns( event.GetSize().GetX() );
409 
410  event.Skip();
411 }
412 
413 
415 {
417  return;
418 
419  wxString netClassFilter = m_netClassFilter->GetStringSelection();
420  wxString netFilter = m_netNameFilter->GetValue().MakeLower();
421 
422  if( !netFilter.IsEmpty() )
423  netFilter = wxT( "*" ) + netFilter + wxT( "*" );
424 
425  for( int row = 0; row < m_membershipGrid->GetNumberRows(); ++row )
426  {
427  wxString net = m_membershipGrid->GetCellValue( row, 0 );
428  wxString netClass = m_membershipGrid->GetCellValue( row, 1 );
429  bool show = true;
430 
431  if( !aShowAll )
432  {
433  if( !netFilter.IsEmpty() && !net.MakeLower().Matches( netFilter ) )
434  show = false;
435 
436  if( !netClassFilter.IsEmpty() && netClass != netClassFilter )
437  show = false;
438  }
439 
440  if( show )
441  m_membershipGrid->ShowRow( row );
442  else
443  m_membershipGrid->HideRow( row );
444  }
445 }
446 
447 
449 {
451  return;
452 
453  wxArrayInt selectedRows = m_membershipGrid->GetSelectedRows();
454 
455  for( int row = 0; row < m_membershipGrid->GetNumberRows(); ++row )
456  {
457  if( !m_membershipGrid->IsRowShown( row ) )
458  continue;
459 
460  if( !aAssignAll && selectedRows.Index( row ) == wxNOT_FOUND )
461  continue;
462 
463  m_membershipGrid->SetCellValue( row, 1, m_assignNetClass->GetStringSelection() );
464  }
465 }
466 
467 
468 void PANEL_SETUP_NETCLASSES::OnUpdateUI( wxUpdateUIEvent& event )
469 {
470  if( m_netclassesDirty )
471  {
473  m_netclassesDirty = false;
474  }
475 }
476 
477 
479 {
480  return ValueFromString( m_Frame->GetUserUnits(), m_netclassGrid->GetCellValue( aRow, aCol ), true );
481 }
482 
483 
485 {
487  return false;
488 
489  wxString msg;
490  int minViaDia = m_ConstraintsPanel->m_viaMinSize.GetValue();
491  int minViaDrill = m_ConstraintsPanel->m_viaMinDrill.GetValue();
492  int minUViaDia = m_ConstraintsPanel->m_uviaMinSize.GetValue();
493  int minUViaDrill = m_ConstraintsPanel->m_uviaMinDrill.GetValue();
494  int minTrackWidth = m_ConstraintsPanel->m_trackMinWidth.GetValue();
495 
496  // Test net class parameters.
497  for( int row = 0; row < m_netclassGrid->GetNumberRows(); row++ )
498  {
499  wxString netclassName = m_netclassGrid->GetCellValue( row, GRID_NAME );
500  netclassName.Trim( true );
501  netclassName.Trim( false );
502 
503  if( !validateNetclassName( row, netclassName, false ) )
504  return false;
505 
506  if( getNetclassValue( row, GRID_TRACKSIZE ) < minTrackWidth )
507  {
508  msg.Printf( _( "Track width less than minimum track width (%s)." ),
509  StringFromValue( m_Frame->GetUserUnits(), minTrackWidth, true, true ) );
510  m_Parent->SetError( msg, this, m_netclassGrid, row, GRID_TRACKSIZE );
511  return false;
512  }
513 
514  if( getNetclassValue( row, GRID_DIFF_PAIR_WIDTH ) < minTrackWidth )
515  {
516  msg.Printf( _( "Differential pair width less than minimum track width (%s)." ),
517  StringFromValue( m_Frame->GetUserUnits(), minTrackWidth, true, true ) );
519  return false;
520  }
521 
522  // Test vias
523  if( getNetclassValue( row, GRID_VIASIZE ) < minViaDia )
524  {
525  msg.Printf( _( "Via diameter less than minimum via diameter (%s)." ),
526  StringFromValue( m_Frame->GetUserUnits(), minViaDia, true, true ) );
527  m_Parent->SetError( msg, this, m_netclassGrid, row, GRID_VIASIZE );
528  return false;
529  }
530 
532  {
533  msg = _( "Via drill larger than via diameter." );
534  m_Parent->SetError( msg, this, m_netclassGrid, row, GRID_VIADRILL );
535  return false;
536  }
537 
538  if( getNetclassValue( row, GRID_VIADRILL ) < minViaDrill )
539  {
540  msg.Printf( _( "Via drill less than minimum via drill (%s)." ),
541  StringFromValue( m_Frame->GetUserUnits(), minViaDrill, true, true ) );
542  m_Parent->SetError( msg, this, m_netclassGrid, row, GRID_VIADRILL );
543  return false;
544  }
545 
546  // Test Micro vias
547  if( getNetclassValue( row, GRID_uVIASIZE ) < minUViaDia )
548  {
549  msg.Printf( _( "Microvia diameter less than minimum microvia diameter (%s)." ),
550  StringFromValue( m_Frame->GetUserUnits(), minUViaDia, true, true ) );
551  m_Parent->SetError( msg, this, m_netclassGrid, row, GRID_uVIASIZE );
552  return false;
553  }
554 
556  {
557  msg = _( "Microvia drill larger than microvia diameter." );
558  m_Parent->SetError( msg, this, m_netclassGrid, row, GRID_uVIADRILL );
559  return false;
560  }
561 
562  if( getNetclassValue( row, GRID_uVIADRILL ) < minUViaDrill )
563  {
564  msg.Printf( _( "Microvia drill less than minimum microvia drill (%s)." ),
565  StringFromValue( m_Frame->GetUserUnits(), minUViaDrill, true, true ) );
566  m_Parent->SetError( msg, this, m_netclassGrid, row, GRID_uVIADRILL );
567  return false;
568  }
569  }
570 
571  return true;
572 }
573 
574 
576 {
577  // Note: do not change the board, as we need to get the current nets from it for
578  // netclass memberships. All the netclass definitions and dimension lists are in
579  // the BOARD_DESIGN_SETTINGS.
580 
581  BOARD_DESIGN_SETTINGS* savedSettings = m_BrdSettings;
582 
583  m_BrdSettings = &aBoard->GetDesignSettings();
585 
586  m_netclassGrid->ForceRefresh();
587  m_membershipGrid->ForceRefresh();
588 
589  m_BrdSettings = savedSettings;
590 }
591 
592 
void BuildListOfNets()
Definition: class_board.h:727
NETCLASSPTR Find(const wxString &aName) const
Function Find searches this container for a NETCLASS given by aName.
Definition: netclass.cpp:141
void OnSizeNetclassGrid(wxSizeEvent &event) override
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Function DisplayErrorMessage displays an error message with aMessage.
Definition: confirm.cpp:258
Implementation of conversion functions that require both schematic and board internal units.
This file is part of the common library.
#define SET_MILS_CELL(col, val)
Class GRID_TRICKS is used to add mouse and command handling (such as cut, copy, and paste) to a WX_GR...
Definition: grid_tricks.h:51
PANEL_SETUP_NETCLASSES(PAGED_DIALOG *aParent, PCB_EDIT_FRAME *aFrame, PANEL_SETUP_FEATURE_CONSTRAINTS *aConstraintsPanel)
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:534
iterator end()
Definition: netclass.h:249
int ValueFromString(EDA_UNITS_T aUnits, const wxString &aTextValue, bool aUseMils)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application.
Definition: base_units.cpp:409
int getNetclassValue(int aRow, int aCol)
static void netclassToGridRow(EDA_UNITS_T aUnits, wxGrid *aGrid, int aRow, const NETCLASSPTR &nc)
void doAssignments(bool aAssignAll)
int GetVisibleWidth(int aCol, bool aHeader=true, bool aContents=false, bool aKeep=true)
Calculates the specified column based on the actual size of the text on screen.
Definition: wx_grid.cpp:223
virtual int GetValue()
Function GetValue Returns the current value in Internal Units.
void SynchronizeNetsAndNetClasses()
Function SynchronizeNetsAndNetClasses copies NETCLASS info to each NET, based on NET membership in a ...
Definition: netclass.cpp:155
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
NETCLASS_MAP::iterator iterator
Definition: netclass.h:247
iterator begin()
Definition: netclass.h:248
Class NETCLASSES is a container for NETCLASS instances.
Definition: netclass.h:224
static const char Default[]
the name of the default NETCLASS
Definition: netclass.h:80
void ImportSettingsFrom(BOARD *aBoard)
void addNet(wxString netName, const wxString &netclass)
EDA_UNITS_T GetUserUnits() const override
Return the user units currently in use.
Definition: draw_frame.h:289
void EnsureColLabelsVisible()
Ensure the height of the row displaying the column labels is enough, even if labels are multiline tex...
Definition: wx_grid.cpp:265
static void gridRowToNetclass(EDA_UNITS_T aUnits, wxGrid *grid, int row, const NETCLASSPTR &nc)
void OnNetclassGridCellChanging(wxGridEvent &event)
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:167
BOARD_DESIGN_SETTINGS * m_BrdSettings
NETINFO_LIST & GetNetInfo()
Definition: class_board.h:748
void SetError(const wxString &aMessage, wxWindow *aPage, wxObject *aCtrl, int aRow=-1, int aCol=-1)
Class PANEL_SETUP_NETCLASSES_BASE.
bool Add(const NETCLASSPTR &aNetclass)
Function Add takes aNetclass and puts it into this NETCLASSES container.
Definition: netclass.cpp:99
Class NETINFO_ITEM handles the data for a net.
Definition: netinfo.h:65
bool SetCurrentNetClass(const wxString &aNetClassName)
Function SetCurrentNetClass Must be called after a netclass selection (or after a netclass parameter ...
void Clear()
Function Clear destroys any contained NETCLASS instances except the Default one.
Definition: netclass.h:242
PANEL_SETUP_FEATURE_CONSTRAINTS * m_ConstraintsPanel
#define max(a, b)
Definition: auxiliary.h:86
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:170
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:123
size_t i
Definition: json11.cpp:597
Class PCB_EDIT_FRAME is the main frame for Pcbnew.
unsigned GetCount() const
Function GetCount.
Definition: netclass.h:259
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
NETCLASSPTR GetDefault() const
Function GetDefault.
Definition: netclass.h:268
BOARD * GetBoard() const
void OnUpdateUI(wxUpdateUIEvent &event) override
bool validateNetclassName(int aRow, wxString aName, bool focusFirst=true)
#define MYCELL(col)
void OnSizeMembershipGrid(wxSizeEvent &event) override
EDA_UNITS_T
Definition: common.h:157
void OnRemoveNetclassClick(wxCommandEvent &event) override
void AdjustNetclassGridColumns(int aWidth)
void AdjustMembershipGridColumns(int aWidth)
void OnAddNetclassClick(wxCommandEvent &event) override
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.
void doApplyFilters(bool aShowAll)