KiCad PCB EDA Suite
FIELDS_GRID_TABLE< T > Class Template Reference

#include <fields_grid_table.h>

Inheritance diagram for FIELDS_GRID_TABLE< T >:

Public Member Functions

 FIELDS_GRID_TABLE (DIALOG_SHIM *aDialog, SCH_BASE_FRAME *aFrame, LIB_PART *aPart)
 
 ~FIELDS_GRID_TABLE ()
 
int GetNumberRows () override
 
int GetNumberCols () override
 
wxString GetColLabelValue (int aCol) override
 
bool IsEmptyCell (int row, int col) override
 
bool CanGetValueAs (int aRow, int aCol, const wxString &aTypeName) override
 
bool CanSetValueAs (int aRow, int aCol, const wxString &aTypeName) override
 
wxGridCellAttr * GetAttr (int row, int col, wxGridCellAttr::wxAttrKind kind) override
 
wxString GetValue (int aRow, int aCol) override
 
bool GetValueAsBool (int aRow, int aCol) override
 
void SetValue (int aRow, int aCol, const wxString &aValue) override
 
void SetValueAsBool (int aRow, int aCol, bool aValue) override
 
wxString StringFromBool (bool aValue)
 
bool BoolFromString (wxString aValue)
 

Private Attributes

SCH_BASE_FRAMEm_frame
 
EDA_UNITS_T m_userUnits
 
LIB_PARTm_part
 
SCH_FIELD_VALIDATOR m_fieldNameValidator
 
SCH_FIELD_VALIDATOR m_referenceValidator
 
SCH_FIELD_VALIDATOR m_valueValidator
 
LIB_ID_VALIDATOR m_libIdValidator
 
SCH_FIELD_VALIDATOR m_urlValidator
 
SCH_FIELD_VALIDATOR m_nonUrlValidator
 
wxGridCellAttr * m_readOnlyAttr
 
wxGridCellAttr * m_fieldNameAttr
 
wxGridCellAttr * m_referenceAttr
 
wxGridCellAttr * m_valueAttr
 
wxGridCellAttr * m_footprintAttr
 
wxGridCellAttr * m_urlAttr
 
wxGridCellAttr * m_nonUrlAttr
 
wxGridCellAttr * m_boolAttr
 
wxGridCellAttr * m_vAlignAttr
 
wxGridCellAttr * m_hAlignAttr
 
wxGridCellAttr * m_orientationAttr
 

Detailed Description

template<class T>
class FIELDS_GRID_TABLE< T >

Definition at line 72 of file fields_grid_table.h.

Constructor & Destructor Documentation

◆ FIELDS_GRID_TABLE()

template<class T >
FIELDS_GRID_TABLE< T >::FIELDS_GRID_TABLE ( DIALOG_SHIM aDialog,
SCH_BASE_FRAME aFrame,
LIB_PART aPart 
)

Definition at line 48 of file fields_grid_table.cpp.

49  :
50  m_frame( aFrame ),
51  m_userUnits( aDialog->GetUserUnits() ),
52  m_part( aPart ),
59 {
60  // Build the various grid cell attributes.
61  // NOTE: validators and cellAttrs are member variables to get the destruction order
62  // right. wxGrid is VERY cranky about this.
63 
64  m_readOnlyAttr = new wxGridCellAttr;
65  m_readOnlyAttr->SetReadOnly( true );
66 
67  m_fieldNameAttr = new wxGridCellAttr;
68  GRID_CELL_TEXT_EDITOR* nameEditor = new GRID_CELL_TEXT_EDITOR();
69  nameEditor->SetValidator( m_fieldNameValidator );
70  m_fieldNameAttr->SetEditor( nameEditor );
71 
72  m_referenceAttr = new wxGridCellAttr;
73  GRID_CELL_TEXT_EDITOR* referenceEditor = new GRID_CELL_TEXT_EDITOR();
74  referenceEditor->SetValidator( m_referenceValidator );
75  m_referenceAttr->SetEditor( referenceEditor );
76 
77  m_valueAttr = new wxGridCellAttr;
78  GRID_CELL_TEXT_EDITOR* valueEditor = new GRID_CELL_TEXT_EDITOR();
79  valueEditor->SetValidator( m_valueValidator );
80  m_valueAttr->SetEditor( valueEditor );
81 
82  m_footprintAttr = new wxGridCellAttr;
84  fpIdEditor->SetValidator( m_libIdValidator );
85  m_footprintAttr->SetEditor( fpIdEditor );
86 
87  m_urlAttr = new wxGridCellAttr;
88  GRID_CELL_URL_EDITOR* urlEditor = new GRID_CELL_URL_EDITOR( aDialog );
89  urlEditor->SetValidator( m_urlValidator );
90  m_urlAttr->SetEditor( urlEditor );
91 
92  m_nonUrlAttr = new wxGridCellAttr;
93  GRID_CELL_TEXT_EDITOR* nonUrlEditor = new GRID_CELL_TEXT_EDITOR();
94  nonUrlEditor->SetValidator( m_nonUrlValidator );
95  m_nonUrlAttr->SetEditor( nonUrlEditor );
96 
97  m_boolAttr = new wxGridCellAttr;
98  m_boolAttr->SetRenderer( new wxGridCellBoolRenderer() );
99  m_boolAttr->SetEditor( new wxGridCellBoolEditor() );
100  m_boolAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM );
101 
102  wxArrayString vAlignNames;
103  vAlignNames.Add( _( "Top" ) );
104  vAlignNames.Add( _( "Center" ) );
105  vAlignNames.Add( _( "Bottom" ) );
106  m_vAlignAttr = new wxGridCellAttr;
107  m_vAlignAttr->SetEditor( new wxGridCellChoiceEditor( vAlignNames ) );
108  m_vAlignAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM );
109 
110  wxArrayString hAlignNames;
111  hAlignNames.Add( _( "Left" ) );
112  hAlignNames.Add(_( "Center" ) );
113  hAlignNames.Add(_( "Right" ) );
114  m_hAlignAttr = new wxGridCellAttr;
115  m_hAlignAttr->SetEditor( new wxGridCellChoiceEditor( hAlignNames ) );
116  m_hAlignAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM );
117 
118  wxArrayString orientationNames;
119  orientationNames.Add( _( "Horizontal" ) );
120  orientationNames.Add(_( "Vertical" ) );
121  m_orientationAttr = new wxGridCellAttr;
122  m_orientationAttr->SetEditor( new wxGridCellChoiceEditor( orientationNames ) );
123  m_orientationAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM );
124 }
#define FIELD_VALUE
wxGridCellAttr * m_referenceAttr
SCH_BASE_FRAME * m_frame
Field Reference of part, i.e. "IC21".
This class works around a bug in wxGrid where the first keystroke doesn't get sent through the valida...
Definition: validators.h:44
wxGridCellAttr * m_readOnlyAttr
#define VALUE
wxGridCellAttr * m_hAlignAttr
SCH_FIELD_VALIDATOR m_referenceValidator
SCH_FIELD_VALIDATOR m_fieldNameValidator
wxGridCellAttr * m_boolAttr
#define FIELD_NAME
#define _(s)
virtual void SetValidator(const wxValidator &validator) override
Definition: validators.cpp:46
wxGridCellAttr * m_fieldNameAttr
wxGridCellAttr * m_urlAttr
SCH_FIELD_VALIDATOR m_valueValidator
EDA_UNITS_T GetUserUnits() const
Definition: dialog_shim.h:135
bool IsType(FRAME_T aType) const
wxGridCellAttr * m_vAlignAttr
wxGridCellAttr * m_orientationAttr
wxGridCellAttr * m_valueAttr
LIB_ID_VALIDATOR m_libIdValidator
SCH_FIELD_VALIDATOR m_urlValidator
wxGridCellAttr * m_nonUrlAttr
wxGridCellAttr * m_footprintAttr
SCH_FIELD_VALIDATOR m_nonUrlValidator

◆ ~FIELDS_GRID_TABLE()

template<class T >
FIELDS_GRID_TABLE< T >::~FIELDS_GRID_TABLE ( )

Definition at line 128 of file fields_grid_table.cpp.

129 {
130  m_readOnlyAttr->DecRef();
131  m_fieldNameAttr->DecRef();
132  m_boolAttr->DecRef();
133  m_referenceAttr->DecRef();
134  m_valueAttr->DecRef();
135  m_footprintAttr->DecRef();
136  m_urlAttr->DecRef();
137  m_nonUrlAttr->DecRef();
138  m_vAlignAttr->DecRef();
139  m_hAlignAttr->DecRef();
140  m_orientationAttr->DecRef();
141 }
wxGridCellAttr * m_referenceAttr
wxGridCellAttr * m_readOnlyAttr
wxGridCellAttr * m_hAlignAttr
wxGridCellAttr * m_boolAttr
wxGridCellAttr * m_fieldNameAttr
wxGridCellAttr * m_urlAttr
wxGridCellAttr * m_vAlignAttr
wxGridCellAttr * m_orientationAttr
wxGridCellAttr * m_valueAttr
wxGridCellAttr * m_nonUrlAttr
wxGridCellAttr * m_footprintAttr

Member Function Documentation

◆ BoolFromString()

template<class T >
bool FIELDS_GRID_TABLE< T >::BoolFromString ( wxString  aValue)

Definition at line 558 of file fields_grid_table.cpp.

559 {
560  if( aValue == "1" )
561  {
562  return true;
563  }
564  else if( aValue == "0" )
565  {
566  return false;
567  }
568  else
569  {
570  wxFAIL_MSG( wxString::Format( "string \"%s\" can't be converted to boolean "
571  "correctly, it will have been perceived as FALSE", aValue ) );
572  return false;
573  }
574 }
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205

◆ CanGetValueAs()

template<class T >
bool FIELDS_GRID_TABLE< T >::CanGetValueAs ( int  aRow,
int  aCol,
const wxString &  aTypeName 
)
override

Definition at line 166 of file fields_grid_table.cpp.

167 {
168  switch( aCol )
169  {
170  case FDC_NAME:
171  case FDC_VALUE:
172  case FDC_H_ALIGN:
173  case FDC_V_ALIGN:
174  case FDC_TEXT_SIZE:
175  case FDC_ORIENTATION:
176  case FDC_POSX:
177  case FDC_POSY:
178  return aTypeName == wxGRID_VALUE_STRING;
179 
180  case FDC_SHOWN:
181  case FDC_ITALIC:
182  case FDC_BOLD:
183  return aTypeName == wxGRID_VALUE_BOOL;
184 
185  default:
186  wxFAIL;
187  return false;
188  }
189 }

◆ CanSetValueAs()

template<class T >
bool FIELDS_GRID_TABLE< T >::CanSetValueAs ( int  aRow,
int  aCol,
const wxString &  aTypeName 
)
override

Definition at line 193 of file fields_grid_table.cpp.

194 {
195  return CanGetValueAs( aRow, aCol, aTypeName );
196 }
bool CanGetValueAs(int aRow, int aCol, const wxString &aTypeName) override

◆ GetAttr()

template<class T >
wxGridCellAttr * FIELDS_GRID_TABLE< T >::GetAttr ( int  row,
int  col,
wxGridCellAttr::wxAttrKind  kind 
)
override

Definition at line 200 of file fields_grid_table.cpp.

201 {
202  switch( aCol )
203  {
204  case FDC_NAME:
205  if( aRow < MANDATORY_FIELDS )
206  {
207  m_readOnlyAttr->IncRef();
208  return m_readOnlyAttr;
209  }
210  else
211  {
212  m_fieldNameAttr->IncRef();
213  return m_fieldNameAttr;
214  }
215 
216  case FDC_VALUE:
217  if( aRow == REFERENCE )
218  {
219  m_referenceAttr->IncRef();
220  return m_referenceAttr;
221  }
222  else if( aRow == VALUE )
223  {
224  // For power symbols, the value is not editable, because value and pin name must
225  // be the same and can be edited only in library editor.
227  {
228  m_readOnlyAttr->IncRef();
229  return m_readOnlyAttr;
230  }
231  else
232  {
233  m_valueAttr->IncRef();
234  return m_valueAttr;
235  }
236  }
237  else if( aRow == FOOTPRINT )
238  {
239  m_footprintAttr->IncRef();
240  return m_footprintAttr;
241  }
242  else if( aRow == DATASHEET )
243  {
244  m_urlAttr->IncRef();
245  return m_urlAttr;
246  }
247  else
248  {
249  wxString fieldname = GetValue( aRow, FDC_NAME );
250  const TEMPLATE_FIELDNAME* templateFn = m_frame->GetTemplateFieldName( fieldname );
251 
252  if( templateFn && templateFn->m_URL )
253  {
254  m_urlAttr->IncRef();
255  return m_urlAttr;
256  }
257  else
258  {
259  m_nonUrlAttr->IncRef();
260  return m_nonUrlAttr;
261  }
262  }
263  return nullptr;
264 
265  case FDC_TEXT_SIZE:
266  case FDC_POSX:
267  case FDC_POSY:
268  return nullptr;
269 
270  case FDC_H_ALIGN:
271  m_hAlignAttr->IncRef();
272  return m_hAlignAttr;
273 
274  case FDC_V_ALIGN:
275  m_vAlignAttr->IncRef();
276  return m_vAlignAttr;
277 
278  case FDC_ORIENTATION:
279  m_orientationAttr->IncRef();
280  return m_orientationAttr;
281 
282  case FDC_SHOWN:
283  case FDC_ITALIC:
284  case FDC_BOLD:
285  m_boolAttr->IncRef();
286  return m_boolAttr;
287 
288  default:
289  wxFAIL;
290  return nullptr;
291  }
292 }
name of datasheet
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
wxGridCellAttr * m_referenceAttr
bool m_URL
If field should have a browse button.
SCH_BASE_FRAME * m_frame
Field Name Module PCB, i.e. "16DIP300".
Field Reference of part, i.e. "IC21".
wxGridCellAttr * m_readOnlyAttr
#define VALUE
wxGridCellAttr * m_hAlignAttr
wxString GetValue(int aRow, int aCol) override
wxGridCellAttr * m_boolAttr
wxGridCellAttr * m_fieldNameAttr
wxGridCellAttr * m_urlAttr
bool IsPower() const
bool IsType(FRAME_T aType) const
wxGridCellAttr * m_vAlignAttr
const TEMPLATE_FIELDNAME * GetTemplateFieldName(const wxString &aName) const
Search for aName in the the template field name list.
wxGridCellAttr * m_orientationAttr
wxGridCellAttr * m_valueAttr
Struct TEMPLATE_FIELDNAME holds a name of a component's field, field value, and default visibility.
wxGridCellAttr * m_nonUrlAttr
wxGridCellAttr * m_footprintAttr

◆ GetColLabelValue()

template<class T >
wxString FIELDS_GRID_TABLE< T >::GetColLabelValue ( int  aCol)
override

Definition at line 145 of file fields_grid_table.cpp.

146 {
147  switch( aCol )
148  {
149  case FDC_NAME: return _( "Name" );
150  case FDC_VALUE: return _( "Value" );
151  case FDC_SHOWN: return _( "Show" );
152  case FDC_H_ALIGN: return _( "H Align" );
153  case FDC_V_ALIGN: return _( "V Align" );
154  case FDC_ITALIC: return _( "Italic" );
155  case FDC_BOLD: return _( "Bold" );
156  case FDC_TEXT_SIZE: return _( "Text Size" );
157  case FDC_ORIENTATION: return _( "Orientation" );
158  case FDC_POSX: return _( "X Position" );
159  case FDC_POSY: return _( "Y Position" );
160  default: wxFAIL; return wxEmptyString;
161  }
162 }
#define _(s)

◆ GetNumberCols()

template<class T>
int FIELDS_GRID_TABLE< T >::GetNumberCols ( )
inlineoverride

Definition at line 79 of file fields_grid_table.h.

79 { return FDC_COUNT; }

◆ GetNumberRows()

template<class T>
int FIELDS_GRID_TABLE< T >::GetNumberRows ( )
inlineoverride

Definition at line 78 of file fields_grid_table.h.

78 { return (int) this->size(); }

Referenced by DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnMoveDown(), and DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow().

◆ GetValue()

template<class T >
wxString FIELDS_GRID_TABLE< T >::GetValue ( int  aRow,
int  aCol 
)
override

Definition at line 296 of file fields_grid_table.cpp.

297 {
298  wxCHECK( aRow < GetNumberRows(), wxEmptyString );
299  const T& field = this->at( (size_t) aRow );
300 
301  switch( aCol )
302  {
303  case FDC_NAME:
304  // Use default field name for mandatory fields, because they are translated
305  // according to the current locale
306  if( aRow < MANDATORY_FIELDS )
308  else
309  return field.GetName( false );
310 
311  case FDC_VALUE:
312  return field.GetText();
313 
314  case FDC_SHOWN:
315  return StringFromBool( field.IsVisible() );
316 
317  case FDC_H_ALIGN:
318  switch ( field.GetHorizJustify() )
319  {
320  case GR_TEXT_HJUSTIFY_LEFT: return _( "Left" );
321  case GR_TEXT_HJUSTIFY_CENTER: return _( "Center" );
322  case GR_TEXT_HJUSTIFY_RIGHT: return _( "Right" );
323  }
324 
325  break;
326 
327  case FDC_V_ALIGN:
328  switch ( field.GetVertJustify() )
329  {
330  case GR_TEXT_VJUSTIFY_TOP: return _( "Top" );
331  case GR_TEXT_VJUSTIFY_CENTER: return _( "Center" );
332  case GR_TEXT_VJUSTIFY_BOTTOM: return _( "Bottom" );
333  }
334 
335  break;
336 
337  case FDC_ITALIC:
338  return StringFromBool( field.IsItalic() );
339 
340  case FDC_BOLD:
341  return StringFromBool( field.IsBold() );
342 
343  case FDC_TEXT_SIZE:
344  return StringFromValue( m_userUnits, field.GetTextSize().GetHeight(), true, true );
345 
346  case FDC_ORIENTATION:
347  switch ( (int) field.GetTextAngle() )
348  {
349  case TEXT_ANGLE_HORIZ: return _( "Horizontal" );
350  case TEXT_ANGLE_VERT: return _( "Vertical" );
351  }
352 
353  break;
354 
355  case FDC_POSX:
356  return StringFromValue( m_userUnits, field.GetTextPos().x, true );
357 
358  case FDC_POSY:
359  return StringFromValue( m_userUnits, field.GetTextPos().y, true );
360 
361  default:
362  // we can't assert here because wxWidgets sometimes calls this without checking
363  // the column type when trying to see if there's an overflow
364  break;
365  }
366 
367  return wxT( "bad wxWidgets!" );
368 }
#define TEXT_ANGLE_HORIZ
int GetNumberRows() override
#define TEXT_ANGLE_VERT
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
static const wxString GetDefaultFieldName(int aFieldNdx)
Function GetDefaultFieldName returns a default symbol field name for field aFieldNdx for all componen...
#define _(s)
wxString StringFromValue(EDA_UNITS_T aUnits, double aValue, bool aAddUnitSymbol, bool aUseMils)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:217
wxString StringFromBool(bool aValue)

◆ GetValueAsBool()

template<class T >
bool FIELDS_GRID_TABLE< T >::GetValueAsBool ( int  aRow,
int  aCol 
)
override

Definition at line 372 of file fields_grid_table.cpp.

373 {
374  wxCHECK( aRow < GetNumberRows(), false );
375  const T& field = this->at( (size_t) aRow );
376 
377  switch( aCol )
378  {
379  case FDC_SHOWN: return field.IsVisible();
380  case FDC_ITALIC: return field.IsItalic();
381  case FDC_BOLD: return field.IsBold();
382  default:
383  wxFAIL_MSG( wxString::Format( wxT( "column %d doesn't hold a bool value" ), aCol ) );
384  return false;
385  }
386 }
int GetNumberRows() override
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205

◆ IsEmptyCell()

template<class T>
bool FIELDS_GRID_TABLE< T >::IsEmptyCell ( int  row,
int  col 
)
inlineoverride

Definition at line 83 of file fields_grid_table.h.

84  {
85  return false; // don't allow adjacent cell overflow, even if we are actually empty
86  }

◆ SetValue()

template<class T >
void FIELDS_GRID_TABLE< T >::SetValue ( int  aRow,
int  aCol,
const wxString &  aValue 
)
override

Definition at line 390 of file fields_grid_table.cpp.

391 {
392  wxCHECK( aRow < GetNumberRows(), /*void*/ );
393  T& field = this->at( (size_t) aRow );
394  wxPoint pos;
395 
396  switch( aCol )
397  {
398  case FDC_NAME:
399  field.SetName( aValue );
400  break;
401 
402  case FDC_VALUE:
403  field.SetText( aValue );
404  break;
405 
406  case FDC_SHOWN:
407  field.SetVisible( BoolFromString( aValue ) );
408  break;
409 
410  case FDC_H_ALIGN:
411  if( aValue == _( "Left" ) )
412  field.SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT );
413  else if( aValue == _( "Center" ) )
414  field.SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER );
415  else if( aValue == _( "Right" ) )
416  field.SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT );
417  else
418  wxFAIL_MSG( wxT( "unknown horizontal alignment: " ) + aValue );
419  break;
420 
421  case FDC_V_ALIGN:
422  if( aValue == _( "Top" ) )
423  field.SetVertJustify( GR_TEXT_VJUSTIFY_TOP );
424  else if( aValue == _( "Center" ) )
425  field.SetVertJustify( GR_TEXT_VJUSTIFY_CENTER );
426  else if( aValue == _( "Bottom" ) )
427  field.SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM );
428  else
429  wxFAIL_MSG( wxT( "unknown vertical alignment: " ) + aValue);
430  break;
431 
432  case FDC_ITALIC:
433  field.SetItalic( BoolFromString( aValue ) );
434  break;
435 
436  case FDC_BOLD:
437  field.SetBold( BoolFromString( aValue ) );
438  break;
439 
440  case FDC_TEXT_SIZE:
441  field.SetTextSize( wxSize( ValueFromString( m_userUnits, aValue ),
442  ValueFromString( m_userUnits, aValue ) ) );
443  break;
444 
445  case FDC_ORIENTATION:
446  if( aValue == _( "Horizontal" ) )
447  field.SetTextAngle( TEXT_ANGLE_HORIZ );
448  else if( aValue == _( "Vertical" ) )
449  field.SetTextAngle( TEXT_ANGLE_VERT );
450  else
451  wxFAIL_MSG( wxT( "unknown orientation: " ) + aValue );
452  break;
453 
454  case FDC_POSX:
455  case FDC_POSY:
456  pos = field.GetTextPos();
457  if( aCol == FDC_POSX )
458  pos.x = ValueFromString( m_userUnits, aValue );
459  else
460  pos.y = ValueFromString( m_userUnits, aValue );
461  field.SetTextPos( pos );
462  break;
463 
464  default:
465  wxFAIL_MSG( wxString::Format( wxT( "column %d doesn't hold a string value" ), aCol ) );
466  break;
467  }
468 
469  GetView()->Refresh();
470 }
#define TEXT_ANGLE_HORIZ
int GetNumberRows() override
#define TEXT_ANGLE_VERT
bool BoolFromString(wxString aValue)
#define _(s)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
long long 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:427

◆ SetValueAsBool()

template<class T >
void FIELDS_GRID_TABLE< T >::SetValueAsBool ( int  aRow,
int  aCol,
bool  aValue 
)
override

Definition at line 474 of file fields_grid_table.cpp.

475 {
476  wxCHECK( aRow < GetNumberRows(), /*void*/ );
477  T& field = this->at( (size_t) aRow );
478 
479  switch( aCol )
480  {
481  case FDC_SHOWN:
482  field.SetVisible( aValue );
483  break;
484  case FDC_ITALIC:
485  field.SetItalic( aValue );
486  break;
487  case FDC_BOLD:
488  field.SetBold( aValue );
489  break;
490  default:
491  wxFAIL_MSG( wxString::Format( wxT( "column %d doesn't hold a bool value" ), aCol ) );
492  break;
493  }
494 }
int GetNumberRows() override
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205

◆ StringFromBool()

template<class T >
wxString FIELDS_GRID_TABLE< T >::StringFromBool ( bool  aValue)

Definition at line 548 of file fields_grid_table.cpp.

549 {
550  if( aValue )
551  return wxT( "1" );
552  else
553  return wxT( "0" );
554 }

Member Data Documentation

◆ m_boolAttr

template<class T>
wxGridCellAttr* FIELDS_GRID_TABLE< T >::m_boolAttr
private

◆ m_fieldNameAttr

template<class T>
wxGridCellAttr* FIELDS_GRID_TABLE< T >::m_fieldNameAttr
private

◆ m_fieldNameValidator

template<class T>
SCH_FIELD_VALIDATOR FIELDS_GRID_TABLE< T >::m_fieldNameValidator
private

◆ m_footprintAttr

template<class T>
wxGridCellAttr* FIELDS_GRID_TABLE< T >::m_footprintAttr
private

◆ m_frame

template<class T>
SCH_BASE_FRAME* FIELDS_GRID_TABLE< T >::m_frame
private

Definition at line 102 of file fields_grid_table.h.

◆ m_hAlignAttr

template<class T>
wxGridCellAttr* FIELDS_GRID_TABLE< T >::m_hAlignAttr
private

◆ m_libIdValidator

template<class T>
LIB_ID_VALIDATOR FIELDS_GRID_TABLE< T >::m_libIdValidator
private

◆ m_nonUrlAttr

template<class T>
wxGridCellAttr* FIELDS_GRID_TABLE< T >::m_nonUrlAttr
private

◆ m_nonUrlValidator

template<class T>
SCH_FIELD_VALIDATOR FIELDS_GRID_TABLE< T >::m_nonUrlValidator
private

◆ m_orientationAttr

template<class T>
wxGridCellAttr* FIELDS_GRID_TABLE< T >::m_orientationAttr
private

◆ m_part

template<class T>
LIB_PART* FIELDS_GRID_TABLE< T >::m_part
private

Definition at line 104 of file fields_grid_table.h.

◆ m_readOnlyAttr

template<class T>
wxGridCellAttr* FIELDS_GRID_TABLE< T >::m_readOnlyAttr
private

◆ m_referenceAttr

template<class T>
wxGridCellAttr* FIELDS_GRID_TABLE< T >::m_referenceAttr
private

◆ m_referenceValidator

template<class T>
SCH_FIELD_VALIDATOR FIELDS_GRID_TABLE< T >::m_referenceValidator
private

◆ m_urlAttr

template<class T>
wxGridCellAttr* FIELDS_GRID_TABLE< T >::m_urlAttr
private

◆ m_urlValidator

template<class T>
SCH_FIELD_VALIDATOR FIELDS_GRID_TABLE< T >::m_urlValidator
private

◆ m_userUnits

template<class T>
EDA_UNITS_T FIELDS_GRID_TABLE< T >::m_userUnits
private

Definition at line 103 of file fields_grid_table.h.

◆ m_vAlignAttr

template<class T>
wxGridCellAttr* FIELDS_GRID_TABLE< T >::m_vAlignAttr
private

◆ m_valueAttr

template<class T>
wxGridCellAttr* FIELDS_GRID_TABLE< T >::m_valueAttr
private

◆ m_valueValidator

template<class T>
SCH_FIELD_VALIDATOR FIELDS_GRID_TABLE< T >::m_valueValidator
private

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