KiCad PCB EDA Suite
Loading...
Searching...
No Matches
fields_grid_table.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) 2018-2024 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include <embedded_files.h>
25#include <kiway.h>
26#include <kiway_player.h>
27#include <dialog_shim.h>
28#include <fields_grid_table.h>
29#include <sch_base_frame.h>
30#include <sch_field.h>
31#include <sch_label.h>
32#include <sch_validators.h>
33#include <validators.h>
34#include <sch_edit_frame.h>
35#include <symbol_library.h>
36#include <schematic.h>
37#include <template_fieldnames.h>
42#include "eda_doc.h"
44#include "font/fontconfig.h"
47#include <wx/settings.h>
48#include <string_utils.h>
50#include <pgm_base.h>
51#include <project_sch.h>
52
53
54enum
55{
58};
59
60
61#define DEFAULT_FONT_NAME _( "Default Font" )
62
63
64static wxString netList( SCH_SYMBOL* aSymbol, SCH_SHEET_PATH& aSheetPath )
65{
66 wxCHECK( aSymbol && aSymbol->GetLibSymbolRef(), wxEmptyString );
67
68 /*
69 * Symbol netlist format:
70 * pinNumber pinName <tab> pinNumber pinName...
71 * fpFilter fpFilter...
72 */
73 wxString netlist;
74
75 wxArrayString pins;
76
77 for( SCH_PIN* pin : aSymbol->GetPins( &aSheetPath ) )
78 pins.push_back( pin->GetNumber() + ' ' + pin->GetShownName() );
79
80 if( !pins.IsEmpty() )
81 netlist << EscapeString( wxJoin( pins, '\t' ), CTX_LINE );
82
83 netlist << wxS( "\r" );
84
85 wxArrayString fpFilters = aSymbol->GetLibSymbolRef()->GetFPFilters();
86
87 if( !fpFilters.IsEmpty() )
88 netlist << EscapeString( wxJoin( fpFilters, ' ' ), CTX_LINE );
89
90 netlist << wxS( "\r" );
91
92 return netlist;
93}
94
95
96static wxString netList( LIB_SYMBOL* aSymbol )
97{
98 /*
99 * Symbol netlist format:
100 * pinNumber pinName <tab> pinNumber pinName...
101 * fpFilter fpFilter...
102 */
103 wxString netlist;
104 wxArrayString pins;
105
106 for( SCH_PIN* pin : aSymbol->GetPins( 0 /* all units */, 1 /* single bodyStyle */ ) )
107 pins.push_back( pin->GetNumber() + ' ' + pin->GetShownName() );
108
109 if( !pins.IsEmpty() )
110 netlist << EscapeString( wxJoin( pins, '\t' ), CTX_LINE );
111
112 netlist << wxS( "\r" );
113
114 wxArrayString fpFilters = aSymbol->GetFPFilters();
115
116 if( !fpFilters.IsEmpty() )
117 netlist << EscapeString( wxJoin( fpFilters, ' ' ), CTX_LINE );
118
119 netlist << wxS( "\r" );
120
121 return netlist;
122}
123
124
126 LIB_SYMBOL* aSymbol ) :
127 m_frame( aFrame ),
128 m_dialog( aDialog ),
129 m_parentType( SCH_SYMBOL_T ),
130 m_mandatoryFieldCount( MANDATORY_FIELDS ),
131 m_part( aSymbol ),
132 m_symbolNetlist( netList( aSymbol ) ),
133 m_fieldNameValidator( FIELD_NAME ),
134 m_referenceValidator( REFERENCE_FIELD ),
135 m_valueValidator( VALUE_FIELD ),
136 m_urlValidator( FIELD_VALUE ),
137 m_nonUrlValidator( FIELD_VALUE ),
138 m_filepathValidator( SHEETFILENAME )
139{
140 initGrid( aGrid );
141}
142
143
145 SCH_SYMBOL* aSymbol ) :
146 m_frame( aFrame ),
147 m_dialog( aDialog ),
148 m_parentType( SCH_SYMBOL_T ),
149 m_mandatoryFieldCount( MANDATORY_FIELDS ),
150 m_part( aSymbol->GetLibSymbolRef().get() ),
151 m_symbolNetlist( netList( aSymbol, aFrame->GetCurrentSheet() ) ),
152 m_fieldNameValidator( FIELD_NAME ),
153 m_referenceValidator( REFERENCE_FIELD ),
154 m_valueValidator( VALUE_FIELD ),
155 m_urlValidator( FIELD_VALUE ),
156 m_nonUrlValidator( FIELD_VALUE ),
157 m_filepathValidator( SHEETFILENAME )
158{
159 initGrid( aGrid );
160}
161
162
164SCH_SHEET* aSheet ) :
165 m_frame( aFrame ),
166 m_dialog( aDialog ),
167 m_parentType( SCH_SHEET_T ),
168 m_mandatoryFieldCount( SHEET_MANDATORY_FIELDS ),
169 m_part( nullptr ),
170 m_fieldNameValidator( FIELD_NAME ),
171 m_referenceValidator( SHEETNAME_V ),
172 m_valueValidator( VALUE_FIELD ),
173 m_urlValidator( FIELD_VALUE ),
174 m_nonUrlValidator( FIELD_VALUE ),
175 m_filepathValidator( SHEETFILENAME_V )
176{
177 initGrid( aGrid );
178}
179
180
182 SCH_LABEL_BASE* aLabel ) :
183 m_frame( aFrame ),
184 m_dialog( aDialog ),
185 m_parentType( SCH_LABEL_LOCATE_ANY_T ),
186 m_mandatoryFieldCount( aLabel->GetMandatoryFieldCount() ),
187 m_part( nullptr ),
188 m_fieldNameValidator( FIELD_NAME ),
189 m_referenceValidator( 0 ),
190 m_valueValidator( 0 ),
191 m_urlValidator( FIELD_VALUE ),
192 m_nonUrlValidator( FIELD_VALUE ),
193 m_filepathValidator( 0 )
194{
195 initGrid( aGrid );
196}
197
198
200{
201 // Build the various grid cell attributes.
202 // NOTE: validators and cellAttrs are member variables to get the destruction order
203 // right. wxGrid is VERY cranky about this.
204
205 m_readOnlyAttr = new wxGridCellAttr;
206 m_readOnlyAttr->SetReadOnly( true );
207
208 m_fieldNameAttr = new wxGridCellAttr;
210 nameEditor->SetValidator( m_fieldNameValidator );
211 m_fieldNameAttr->SetEditor( nameEditor );
212
213 m_referenceAttr = new wxGridCellAttr;
214 GRID_CELL_TEXT_EDITOR* referenceEditor = new GRID_CELL_TEXT_EDITOR();
215 referenceEditor->SetValidator( m_referenceValidator );
216 m_referenceAttr->SetEditor( referenceEditor );
217
218 m_valueAttr = new wxGridCellAttr;
219
221 {
222 GRID_CELL_TEXT_EDITOR* valueEditor = new GRID_CELL_TEXT_EDITOR();
223 valueEditor->SetValidator( m_valueValidator );
224 m_valueAttr->SetEditor( valueEditor );
225 }
226 else
227 {
228 GRID_CELL_STC_EDITOR* valueEditor = new GRID_CELL_STC_EDITOR( true,
229 [this]( wxStyledTextEvent& aEvent, SCINTILLA_TRICKS* aScintillaTricks )
230 {
231 SCH_FIELD& valueField = static_cast<SCH_FIELD&>( this->at( VALUE_FIELD ) );
232 valueField.OnScintillaCharAdded( aScintillaTricks, aEvent );
233 } );
234 m_valueAttr->SetEditor( valueEditor );
235 }
236
237 m_footprintAttr = new wxGridCellAttr;
239 fpIdEditor->SetValidator( m_nonUrlValidator );
240 m_footprintAttr->SetEditor( fpIdEditor );
241
242 EMBEDDED_FILES* files = nullptr;
243
244 if( m_frame->GetFrameType() == FRAME_SCH )
245 files = m_frame->GetScreen()->Schematic();
247 files = m_part;
248
249 m_urlAttr = new wxGridCellAttr;
250 GRID_CELL_URL_EDITOR* urlEditor =
252 urlEditor->SetValidator( m_urlValidator );
253 m_urlAttr->SetEditor( urlEditor );
254
255 m_nonUrlAttr = new wxGridCellAttr;
256 GRID_CELL_TEXT_EDITOR* nonUrlEditor = new GRID_CELL_TEXT_EDITOR();
257 nonUrlEditor->SetValidator( m_nonUrlValidator );
258 m_nonUrlAttr->SetEditor( nonUrlEditor );
259
261 m_filepathAttr = new wxGridCellAttr;
262
263 // Create a wild card using wxFileDialog syntax.
264 wxString wildCard( _( "Schematic Files" ) );
265 std::vector<std::string> exts;
266 exts.push_back( FILEEXT::KiCadSchematicFileExtension );
267 wildCard += AddFileExtListToFilter( exts );
268
269 auto filepathEditor = new GRID_CELL_PATH_EDITOR( m_dialog, aGrid, &m_curdir, wildCard );
270 filepathEditor->SetValidator( m_filepathValidator );
271 m_filepathAttr->SetEditor( filepathEditor );
272
273 m_boolAttr = new wxGridCellAttr;
274 m_boolAttr->SetRenderer( new wxGridCellBoolRenderer() );
275 m_boolAttr->SetEditor( new wxGridCellBoolEditor() );
276 m_boolAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
277
278 wxArrayString vAlignNames;
279 vAlignNames.Add( _( "Top" ) );
280 vAlignNames.Add( _( "Center" ) );
281 vAlignNames.Add( _( "Bottom" ) );
282 m_vAlignAttr = new wxGridCellAttr;
283 m_vAlignAttr->SetEditor( new wxGridCellChoiceEditor( vAlignNames ) );
284 m_vAlignAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
285
286 wxArrayString hAlignNames;
287 hAlignNames.Add( _( "Left" ) );
288 hAlignNames.Add(_( "Center" ) );
289 hAlignNames.Add(_( "Right" ) );
290 m_hAlignAttr = new wxGridCellAttr;
291 m_hAlignAttr->SetEditor( new wxGridCellChoiceEditor( hAlignNames ) );
292 m_hAlignAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
293
294 wxArrayString orientationNames;
295 orientationNames.Add( _( "Horizontal" ) );
296 orientationNames.Add(_( "Vertical" ) );
297 m_orientationAttr = new wxGridCellAttr;
298 m_orientationAttr->SetEditor( new wxGridCellChoiceEditor( orientationNames ) );
299 m_orientationAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
300
301 SCH_EDIT_FRAME* editFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
302 wxArrayString existingNetclasses;
303
304 wxArrayString fonts;
305 std::vector<std::string> fontNames;
306
307 if( editFrame )
308 {
309 // Load the combobox with existing existingNetclassNames
310 PROJECT_FILE& projectFile = editFrame->Prj().GetProjectFile();
311 const std::shared_ptr<NET_SETTINGS>& settings = projectFile.NetSettings();
312
313 existingNetclasses.push_back( settings->m_DefaultNetClass->GetName() );
314
315 for( const auto& [ name, netclass ] : settings->m_NetClasses )
316 existingNetclasses.push_back( name );
317
318 // We don't need to re-cache the embedded fonts when looking at symbols in the schematic editor
319 // because the fonts are all available in the schematic.
320 const std::vector<wxString>* fontFiles = nullptr;
321
324
325 Fontconfig()->ListFonts( fontNames, std::string( Pgm().GetLanguageTag().utf8_str() ),
326 fontFiles, false );
327 }
328 else
329 {
330 const std::vector<wxString>* fontFiles = m_part->GetEmbeddedFiles()->UpdateFontFiles();
331
332 // If there are font files embedded, we want to re-cache our fonts for each symbol that we
333 // are looking at in the symbol editor.
334 Fontconfig()->ListFonts( fontNames, std::string( Pgm().GetLanguageTag().utf8_str() ),
335 fontFiles, !fontFiles->empty() );
336 }
337
338 m_netclassAttr = new wxGridCellAttr;
339 m_netclassAttr->SetEditor( new GRID_CELL_COMBOBOX( existingNetclasses ) );
340
341 for( const std::string& name : fontNames )
342 fonts.Add( wxString( name ) );
343
344 fonts.Sort();
345 fonts.Insert( KICAD_FONT_NAME, 0 );
346 fonts.Insert( DEFAULT_FONT_NAME, 0 );
347
348 m_fontAttr = new wxGridCellAttr;
349 m_fontAttr->SetEditor( new GRID_CELL_COMBOBOX( fonts ) );
350
351 m_colorAttr = new wxGridCellAttr;
352 m_colorAttr->SetRenderer( new GRID_CELL_COLOR_RENDERER( m_dialog ) );
353 m_colorAttr->SetEditor( new GRID_CELL_COLOR_SELECTOR( m_dialog, aGrid ) );
354
355 m_eval = std::make_unique<NUMERIC_EVALUATOR>( m_frame->GetUserUnits() );
356
357 m_frame->Bind( EDA_EVT_UNITS_CHANGED, &FIELDS_GRID_TABLE::onUnitsChanged, this );
358}
359
360
362{
363 m_readOnlyAttr->DecRef();
364 m_fieldNameAttr->DecRef();
365 m_boolAttr->DecRef();
366 m_referenceAttr->DecRef();
367 m_valueAttr->DecRef();
368 m_footprintAttr->DecRef();
369 m_urlAttr->DecRef();
370 m_nonUrlAttr->DecRef();
371 m_filepathAttr->DecRef();
372 m_vAlignAttr->DecRef();
373 m_hAlignAttr->DecRef();
374 m_orientationAttr->DecRef();
375 m_netclassAttr->DecRef();
376 m_fontAttr->DecRef();
377 m_colorAttr->DecRef();
378
379 m_frame->Unbind( EDA_EVT_UNITS_CHANGED, &FIELDS_GRID_TABLE::onUnitsChanged, this );
380}
381
382
383void FIELDS_GRID_TABLE::onUnitsChanged( wxCommandEvent& aEvent )
384{
385 if( GetView() )
386 GetView()->ForceRefresh();
387
388 aEvent.Skip();
389}
390
391
393{
394 switch( aCol )
395 {
396 case FDC_NAME: return _( "Name" );
397 case FDC_VALUE: return _( "Value" );
398 case FDC_SHOWN: return _( "Show" );
399 case FDC_SHOW_NAME: return _( "Show Name" );
400 case FDC_H_ALIGN: return _( "H Align" );
401 case FDC_V_ALIGN: return _( "V Align" );
402 case FDC_ITALIC: return _( "Italic" );
403 case FDC_BOLD: return _( "Bold" );
404 case FDC_TEXT_SIZE: return _( "Text Size" );
405 case FDC_ORIENTATION: return _( "Orientation" );
406 case FDC_POSX: return _( "X Position" );
407 case FDC_POSY: return _( "Y Position" );
408 case FDC_FONT: return _( "Font" );
409 case FDC_COLOR: return _( "Color" );
410 case FDC_ALLOW_AUTOPLACE: return _( "Allow Autoplacement" );
411 default: wxFAIL; return wxEmptyString;
412 }
413}
414
415
416bool FIELDS_GRID_TABLE::CanGetValueAs( int aRow, int aCol, const wxString& aTypeName )
417{
418 switch( aCol )
419 {
420 case FDC_NAME:
421 case FDC_VALUE:
422 case FDC_H_ALIGN:
423 case FDC_V_ALIGN:
424 case FDC_TEXT_SIZE:
425 case FDC_ORIENTATION:
426 case FDC_POSX:
427 case FDC_POSY:
428 case FDC_FONT:
429 case FDC_COLOR:
430 return aTypeName == wxGRID_VALUE_STRING;
431
432 case FDC_SHOWN:
433 case FDC_SHOW_NAME:
434 case FDC_ITALIC:
435 case FDC_BOLD:
437 return aTypeName == wxGRID_VALUE_BOOL;
438
439 default:
440 wxFAIL;
441 return false;
442 }
443}
444
445
446bool FIELDS_GRID_TABLE::CanSetValueAs( int aRow, int aCol, const wxString& aTypeName )
447{
448 return CanGetValueAs( aRow, aCol, aTypeName );
449}
450
451
452wxGridCellAttr* FIELDS_GRID_TABLE::GetAttr( int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind )
453{
454 wxGridCellAttr* tmp;
455
456 switch( aCol )
457 {
458 case FDC_NAME:
459 if( aRow < m_mandatoryFieldCount )
460 {
461 tmp = m_fieldNameAttr->Clone();
462 tmp->SetReadOnly( true );
463 return enhanceAttr( tmp, aRow, aCol, aKind );
464 }
465 else
466 {
467 m_fieldNameAttr->IncRef();
468 return enhanceAttr( m_fieldNameAttr, aRow, aCol, aKind );
469 }
470
471 case FDC_VALUE:
472 if( m_parentType == SCH_SYMBOL_T && aRow == REFERENCE_FIELD )
473 {
474 m_referenceAttr->IncRef();
475 return enhanceAttr( m_referenceAttr, aRow, aCol, aKind );
476 }
477 else if( m_parentType == SCH_SYMBOL_T && aRow == VALUE_FIELD )
478 {
479 m_valueAttr->IncRef();
480 return enhanceAttr( m_valueAttr, aRow, aCol, aKind );
481 }
482 else if( m_parentType == SCH_SYMBOL_T && aRow == FOOTPRINT_FIELD )
483 {
484 // Power symbols have do not appear in the board, so don't allow
485 // a footprint (m_part can be nullptr when loading a old schematic
486 // (for instance Kicad 4) with libraries missing)
487 if( m_part && m_part->IsPower() )
488 {
489 m_readOnlyAttr->IncRef();
490 return enhanceAttr( m_readOnlyAttr, aRow, aCol, aKind );
491 }
492 else
493 {
494 m_footprintAttr->IncRef();
495 return enhanceAttr( m_footprintAttr, aRow, aCol, aKind );
496 }
497 }
498 else if( m_parentType == SCH_SYMBOL_T && aRow == DATASHEET_FIELD )
499 {
500 m_urlAttr->IncRef();
501 return enhanceAttr( m_urlAttr, aRow, aCol, aKind );
502 }
503 else if( m_parentType == SCH_SHEET_T && aRow == SHEETNAME )
504 {
505 m_referenceAttr->IncRef();
506 return enhanceAttr( m_referenceAttr, aRow, aCol, aKind );
507 }
508 else if( m_parentType == SCH_SHEET_T && aRow == SHEETFILENAME )
509 {
510 m_filepathAttr->IncRef();
511 return enhanceAttr( m_filepathAttr, aRow, aCol, aKind );
512 }
514 && this->at( (size_t) aRow ).GetCanonicalName() == wxT( "Netclass" ) )
515 {
516 m_netclassAttr->IncRef();
517 return enhanceAttr( m_netclassAttr, aRow, aCol, aKind );
518 }
519 else
520 {
521 wxString fn = GetValue( aRow, FDC_NAME );
522
524
525 const TEMPLATE_FIELDNAME* templateFn =
526 settings ? settings->m_TemplateFieldNames.GetFieldName( fn ) : nullptr;
527
528 if( templateFn && templateFn->m_URL )
529 {
530 m_urlAttr->IncRef();
531 return enhanceAttr( m_urlAttr, aRow, aCol, aKind );
532 }
533 else
534 {
535 m_nonUrlAttr->IncRef();
536 return enhanceAttr( m_nonUrlAttr, aRow, aCol, aKind );
537 }
538 }
539
540 case FDC_TEXT_SIZE:
541 case FDC_POSX:
542 case FDC_POSY:
543 return enhanceAttr( nullptr, aRow, aCol, aKind );
544
545 case FDC_H_ALIGN:
546 m_hAlignAttr->IncRef();
547 return enhanceAttr( m_hAlignAttr, aRow, aCol, aKind );
548
549 case FDC_V_ALIGN:
550 m_vAlignAttr->IncRef();
551 return enhanceAttr( m_vAlignAttr, aRow, aCol, aKind );
552
553 case FDC_ORIENTATION:
554 m_orientationAttr->IncRef();
555 return enhanceAttr( m_orientationAttr, aRow, aCol, aKind );
556
557 case FDC_SHOWN:
558 case FDC_SHOW_NAME:
559 case FDC_ITALIC:
560 case FDC_BOLD:
562 m_boolAttr->IncRef();
563 return enhanceAttr( m_boolAttr, aRow, aCol, aKind );
564
565 case FDC_FONT:
566 m_fontAttr->IncRef();
567 return enhanceAttr( m_fontAttr, aRow, aCol, aKind );
568
569 case FDC_COLOR:
570 m_colorAttr->IncRef();
571 return enhanceAttr( m_colorAttr, aRow, aCol, aKind );
572
573 default:
574 wxFAIL;
575 return enhanceAttr( nullptr, aRow, aCol, aKind );
576 }
577}
578
579
580wxString FIELDS_GRID_TABLE::GetValue( int aRow, int aCol )
581{
582 wxCHECK( aRow < GetNumberRows(), wxEmptyString );
583
584 wxGrid* grid = GetView();
585 const SCH_FIELD& field = this->at( (size_t) aRow );
586
587 if( grid->GetGridCursorRow() == aRow && grid->GetGridCursorCol() == aCol
588 && grid->IsCellEditControlShown() )
589 {
590 auto it = m_evalOriginal.find( { aRow, aCol } );
591
592 if( it != m_evalOriginal.end() )
593 return it->second;
594 }
595
596 switch( aCol )
597 {
598 case FDC_NAME:
599 // Use default field names for mandatory and system fields because they are translated
600 // according to the current locale
602 {
603 if( aRow < m_mandatoryFieldCount )
605 else
606 return field.GetName( false );
607 }
608 else if( m_parentType == SCH_SHEET_T )
609 {
610 if( aRow < m_mandatoryFieldCount )
611 return SCH_SHEET::GetDefaultFieldName( aRow );
612 else
613 return field.GetName( false );
614 }
616 {
618 }
619 else
620 {
621 wxFAIL_MSG( wxS( "Unhandled field owner type." ) );
622 return field.GetName( false );
623 }
624
625 case FDC_VALUE:
626 return EscapeString( UnescapeString( field.GetText() ), CTX_LINE );
627
628 case FDC_SHOWN:
629 return StringFromBool( field.IsVisible() );
630
631 case FDC_SHOW_NAME:
632 return StringFromBool( field.IsNameShown() );
633
634 case FDC_H_ALIGN:
635 switch ( field.GetEffectiveHorizJustify() )
636 {
637 case GR_TEXT_H_ALIGN_LEFT: return _( "Left" );
638 case GR_TEXT_H_ALIGN_CENTER: return _( "Center" );
639 case GR_TEXT_H_ALIGN_RIGHT: return _( "Right" );
641 }
642
643 break;
644
645 case FDC_V_ALIGN:
646 switch ( field.GetEffectiveVertJustify() )
647 {
648 case GR_TEXT_V_ALIGN_TOP: return _( "Top" );
649 case GR_TEXT_V_ALIGN_CENTER: return _( "Center" );
650 case GR_TEXT_V_ALIGN_BOTTOM: return _( "Bottom" );
652 }
653
654 break;
655
656 case FDC_ITALIC:
657 return StringFromBool( field.IsItalic() );
658
659 case FDC_BOLD:
660 return StringFromBool( field.IsBold() );
661
662 case FDC_TEXT_SIZE:
663 return m_frame->StringFromValue( field.GetTextHeight(), true );
664
665 case FDC_ORIENTATION:
666 if( field.GetTextAngle().IsHorizontal() )
667 return _( "Horizontal" );
668 else
669 return _( "Vertical" );
670
671 case FDC_POSX:
672 return m_frame->StringFromValue( field.GetTextPos().x, true );
673
674 case FDC_POSY:
675 return m_frame->StringFromValue( field.GetTextPos().y, true );
676
677 case FDC_FONT:
678 if( field.GetFont() )
679 return field.GetFont()->GetName();
680 else
681 return DEFAULT_FONT_NAME;
682
683 case FDC_COLOR:
684 return field.GetTextColor().ToCSSString();
685
687 return StringFromBool( field.CanAutoplace() );
688
689 default:
690 // we can't assert here because wxWidgets sometimes calls this without checking
691 // the column type when trying to see if there's an overflow
692 break;
693 }
694
695 return wxT( "bad wxWidgets!" );
696}
697
698
699bool FIELDS_GRID_TABLE::GetValueAsBool( int aRow, int aCol )
700{
701 wxCHECK( aRow < GetNumberRows(), false );
702 const SCH_FIELD& field = this->at( (size_t) aRow );
703
704 switch( aCol )
705 {
706 case FDC_SHOWN: return field.IsVisible();
707 case FDC_SHOW_NAME: return field.IsNameShown();
708 case FDC_ITALIC: return field.IsItalic();
709 case FDC_BOLD: return field.IsBold();
710 case FDC_ALLOW_AUTOPLACE: return field.CanAutoplace();
711 default:
712 wxFAIL_MSG( wxString::Format( wxT( "column %d doesn't hold a bool value" ), aCol ) );
713 return false;
714 }
715}
716
717
718void FIELDS_GRID_TABLE::SetValue( int aRow, int aCol, const wxString &aValue )
719{
720 wxCHECK( aRow < GetNumberRows(), /*void*/ );
721 SCH_FIELD& field = this->at( (size_t) aRow );
722 VECTOR2I pos;
723 wxString value = aValue;
724
725 switch( aCol )
726 {
727 case FDC_TEXT_SIZE:
728 case FDC_POSX:
729 case FDC_POSY:
730 m_eval->SetDefaultUnits( m_frame->GetUserUnits() );
731
732 if( m_eval->Process( value ) )
733 {
734 m_evalOriginal[ { aRow, aCol } ] = value;
735 value = m_eval->Result();
736 }
737
738 break;
739
740 default:
741 break;
742 }
743
744 switch( aCol )
745 {
746 case FDC_NAME:
747 field.SetName( value );
748 break;
749
750 case FDC_VALUE:
751 {
752 if( m_parentType == SCH_SHEET_T && aRow == SHEETFILENAME )
753 {
755 }
756 else if( m_parentType == LIB_SYMBOL_T && aRow == VALUE_FIELD )
757 {
758 value = EscapeString( value, CTX_LIBID );
759 }
760
761 field.SetText( UnescapeString( value ) );
762 break;
763 }
764
765 case FDC_SHOWN:
766 field.SetVisible( BoolFromString( value ) );
767 break;
768
769 case FDC_SHOW_NAME:
770 field.SetNameShown( BoolFromString( value ) );
771 break;
772
773 case FDC_H_ALIGN:
774 {
775 GR_TEXT_H_ALIGN_T horizontalJustification = GR_TEXT_H_ALIGN_CENTER;
776
777 if( value == _( "Left" ) )
778 horizontalJustification = GR_TEXT_H_ALIGN_LEFT;
779 else if( value == _( "Center" ) )
780 horizontalJustification = GR_TEXT_H_ALIGN_CENTER;
781 else if( value == _( "Right" ) )
782 horizontalJustification = GR_TEXT_H_ALIGN_RIGHT;
783 else
784 wxFAIL_MSG( wxT( "unknown horizontal alignment: " ) + value );
785
786 // Note that we must set justifications before we can ask if they're flipped. If the old
787 // justification is center then it won't know (whereas if the new justification is center
788 // the we don't care).
789 field.SetHorizJustify( horizontalJustification );
790
791 if( field.IsHorizJustifyFlipped() )
792 field.SetHorizJustify( EDA_TEXT::MapHorizJustify( - horizontalJustification ) );
793
794 break;
795 }
796
797 case FDC_V_ALIGN:
798 {
799 GR_TEXT_V_ALIGN_T verticalJustification = GR_TEXT_V_ALIGN_BOTTOM;
800
801 if( value == _( "Top" ) )
802 verticalJustification = GR_TEXT_V_ALIGN_TOP;
803 else if( value == _( "Center" ) )
804 verticalJustification = GR_TEXT_V_ALIGN_CENTER;
805 else if( value == _( "Bottom" ) )
806 verticalJustification = GR_TEXT_V_ALIGN_BOTTOM;
807 else
808 wxFAIL_MSG( wxT( "unknown vertical alignment: " ) + value);
809
810 // Note that we must set justifications before we can ask if they're flipped. If the old
811 // justification is center then it won't know (whereas if the new justification is center
812 // the we don't care).
813 field.SetVertJustify( verticalJustification );
814
815 if( field.IsVertJustifyFlipped() )
816 field.SetVertJustify( EDA_TEXT::MapVertJustify( -verticalJustification ) );
817
818 break;
819 }
820
821 case FDC_ITALIC:
822 field.SetItalic( BoolFromString( value ) );
823 break;
824
825 case FDC_BOLD:
826 field.SetBold( BoolFromString( value ) );
827 break;
828
829 case FDC_TEXT_SIZE:
831 m_frame->ValueFromString( value ) ) );
832 break;
833
834 case FDC_ORIENTATION:
835 if( value == _( "Horizontal" ) )
837 else if( value == _( "Vertical" ) )
839 else
840 wxFAIL_MSG( wxT( "unknown orientation: " ) + value );
841
842 break;
843
844 case FDC_POSX:
845 case FDC_POSY:
846 pos = field.GetTextPos();
847
848 if( aCol == FDC_POSX )
849 pos.x = m_frame->ValueFromString( value );
850 else
851 pos.y = m_frame->ValueFromString( value );
852
853 field.SetTextPos( pos );
854 break;
855
856 case FDC_FONT:
857 if( value == DEFAULT_FONT_NAME )
858 field.SetFont( nullptr );
859 else if( value == KICAD_FONT_NAME )
860 field.SetFont( KIFONT::FONT::GetFont( wxEmptyString, field.IsBold(),
861 field.IsItalic() ) );
862 else
863 field.SetFont( KIFONT::FONT::GetFont( aValue, field.IsBold(), field.IsItalic() ) );
864
865 break;
866
867 case FDC_COLOR:
868 field.SetTextColor( wxColor( value ) );
869 break;
870
872 field.SetCanAutoplace( BoolFromString( value ) );
873 break;
874
875 default:
876 wxFAIL_MSG( wxString::Format( wxT( "column %d doesn't hold a string value" ), aCol ) );
877 break;
878 }
879
881
882 GetView()->Refresh();
883}
884
885
886void FIELDS_GRID_TABLE::SetValueAsBool( int aRow, int aCol, bool aValue )
887{
888 wxCHECK( aRow < GetNumberRows(), /*void*/ );
889 SCH_FIELD& field = this->at( (size_t) aRow );
890
891 switch( aCol )
892 {
893 case FDC_SHOWN:
894 field.SetVisible( aValue );
895 break;
896
897 case FDC_SHOW_NAME:
898 field.SetNameShown( aValue );
899 break;
900
901 case FDC_ITALIC:
902 field.SetItalic( aValue );
903 break;
904
905 case FDC_BOLD:
906 field.SetBold( aValue );
907 break;
908
910 field.SetCanAutoplace( aValue );
911 break;
912
913 default:
914 wxFAIL_MSG( wxString::Format( wxT( "column %d doesn't hold a bool value" ), aCol ) );
915 break;
916 }
917
919}
920
921
922void FIELDS_GRID_TRICKS::showPopupMenu( wxMenu& menu, wxGridEvent& aEvent )
923{
924 if( m_grid->GetGridCursorRow() == FOOTPRINT_FIELD && m_grid->GetGridCursorCol() == FDC_VALUE
925 && !m_grid->IsReadOnly( FOOTPRINT_FIELD, FDC_VALUE ) )
926 {
927 menu.Append( MYID_SELECT_FOOTPRINT, _( "Select Footprint..." ),
928 _( "Browse for footprint" ) );
929 menu.AppendSeparator();
930 }
931 else if( m_grid->GetGridCursorRow() == DATASHEET_FIELD
932 && m_grid->GetGridCursorCol() == FDC_VALUE )
933 {
934 menu.Append( MYID_SHOW_DATASHEET, _( "Show Datasheet" ),
935 _( "Show datasheet in browser" ) );
936 menu.AppendSeparator();
937 }
938
939 GRID_TRICKS::showPopupMenu( menu, aEvent );
940}
941
942
943void FIELDS_GRID_TRICKS::doPopupSelection( wxCommandEvent& event )
944{
945 if( event.GetId() == MYID_SELECT_FOOTPRINT )
946 {
947 // pick a footprint using the footprint picker.
948 wxString fpid = m_grid->GetCellValue( FOOTPRINT_FIELD, FDC_VALUE );
949
950 if( KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_FOOTPRINT_CHOOSER, true, m_dlg ) )
951 {
952 if( frame->ShowModal( &fpid, m_dlg ) )
953 m_grid->SetCellValue( FOOTPRINT_FIELD, FDC_VALUE, fpid );
954
955 frame->Destroy();
956 }
957 }
958 else if (event.GetId() == MYID_SHOW_DATASHEET )
959 {
960 wxString datasheet_uri = m_grid->GetCellValue( DATASHEET_FIELD, FDC_VALUE );
961
962 GetAssociatedDocument( m_dlg, datasheet_uri, &m_dlg->Prj(),
964 }
965 else
966 {
968 }
969}
970
971
972wxString FIELDS_GRID_TABLE::StringFromBool( bool aValue ) const
973{
974 if( aValue )
975 return wxT( "1" );
976 else
977 return wxT( "0" );
978}
979
980
981bool FIELDS_GRID_TABLE::BoolFromString( wxString aValue ) const
982{
983 if( aValue == wxS( "1" ) )
984 {
985 return true;
986 }
987 else if( aValue == wxS( "0" ) )
988 {
989 return false;
990 }
991 else
992 {
993 wxFAIL_MSG( wxString::Format( "string '%s' can't be converted to boolean correctly and "
994 "will be perceived as FALSE", aValue ) );
995 return false;
996 }
997}
const char * name
Definition: DXF_plotter.cpp:57
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:88
void OnModify()
bool IsHorizontal() const
Definition: eda_angle.h:138
FRAME_T GetFrameType() const
int GetTextHeight() const
Definition: eda_text.h:224
void SetTextColor(const COLOR4D &aColor)
Definition: eda_text.h:226
const VECTOR2I & GetTextPos() const
Definition: eda_text.h:230
COLOR4D GetTextColor() const
Definition: eda_text.h:227
bool IsItalic() const
Definition: eda_text.h:140
const EDA_ANGLE & GetTextAngle() const
Definition: eda_text.h:130
void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
Definition: eda_text.cpp:373
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:94
virtual bool IsVisible() const
Definition: eda_text.h:147
void SetTextPos(const VECTOR2I &aPoint)
Definition: eda_text.cpp:418
KIFONT::FONT * GetFont() const
Definition: eda_text.h:207
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
Definition: eda_text.cpp:275
virtual void SetVisible(bool aVisible)
Definition: eda_text.cpp:244
static GR_TEXT_H_ALIGN_T MapHorizJustify(int aHorizJustify)
Definition: eda_text.cpp:64
void SetBold(bool aBold)
Definition: eda_text.cpp:220
bool IsBold() const
Definition: eda_text.h:144
static GR_TEXT_V_ALIGN_T MapVertJustify(int aVertJustify)
Definition: eda_text.cpp:78
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
Definition: eda_text.cpp:204
void SetItalic(bool aItalic)
Definition: eda_text.cpp:212
void SetFont(KIFONT::FONT *aFont)
Definition: eda_text.cpp:357
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
Definition: eda_text.cpp:267
const std::vector< wxString > * UpdateFontFiles()
Helper function to get a list of fonts for fontconfig to add to the library.
const std::vector< wxString > * GetFontFiles() const
If we just need the cached version of the font files, we can use this function which is const and wil...
wxGridCellAttr * GetAttr(int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind) override
wxString StringFromBool(bool aValue) const
bool GetValueAsBool(int aRow, int aCol) override
FIELD_VALIDATOR m_fieldNameValidator
bool CanSetValueAs(int aRow, int aCol, const wxString &aTypeName) override
void initGrid(WX_GRID *aGrid)
wxGridCellAttr * m_fieldNameAttr
int GetNumberRows() override
wxGridCellAttr * m_readOnlyAttr
FIELD_VALIDATOR m_urlValidator
SCH_BASE_FRAME * m_frame
bool CanGetValueAs(int aRow, int aCol, const wxString &aTypeName) override
wxGridCellAttr * m_colorAttr
wxGridCellAttr * m_nonUrlAttr
wxGridCellAttr * m_referenceAttr
FIELD_VALIDATOR m_referenceValidator
FIELD_VALIDATOR m_valueValidator
std::map< std::pair< int, int >, wxString > m_evalOriginal
DIALOG_SHIM * m_dialog
wxGridCellAttr * m_footprintAttr
wxGridCellAttr * m_boolAttr
wxGridCellAttr * m_fontAttr
wxGridCellAttr * m_urlAttr
wxGridCellAttr * m_valueAttr
wxGridCellAttr * m_hAlignAttr
wxGridCellAttr * m_orientationAttr
void SetValue(int aRow, int aCol, const wxString &aValue) override
wxGridCellAttr * m_vAlignAttr
FIELDS_GRID_TABLE(DIALOG_SHIM *aDialog, SCH_BASE_FRAME *aFrame, WX_GRID *aGrid, LIB_SYMBOL *aSymbol)
wxGridCellAttr * m_filepathAttr
wxGridCellAttr * m_netclassAttr
void SetValueAsBool(int aRow, int aCol, bool aValue) override
wxString GetValue(int aRow, int aCol) override
void onUnitsChanged(wxCommandEvent &aEvent)
std::unique_ptr< NUMERIC_EVALUATOR > m_eval
FIELD_VALIDATOR m_nonUrlValidator
FIELD_VALIDATOR m_filepathValidator
wxString GetColLabelValue(int aCol) override
bool BoolFromString(wxString aValue) const
void showPopupMenu(wxMenu &menu, wxGridEvent &aEvent) override
void doPopupSelection(wxCommandEvent &event) override
EMBEDDED_FILES * m_files
Editor for wxGrid cells that adds a file/folder browser to the grid input field.
This class works around a bug in wxGrid where the first keystroke doesn't get sent through the valida...
virtual void SetValidator(const wxValidator &validator) override
virtual void doPopupSelection(wxCommandEvent &event)
virtual void showPopupMenu(wxMenu &menu, wxGridEvent &aEvent)
WX_GRID * m_grid
I don't own the grid, but he owns me.
Definition: grid_tricks.h:125
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false, const std::vector< wxString > *aEmbeddedFiles=nullptr)
Definition: font.cpp:146
const wxString & GetName() const
Definition: font.h:147
wxString ToCSSString() const
Definition: color4d.cpp:147
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:55
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
Definition: kiway_player.h:65
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:406
Define a library symbol object.
Definition: lib_symbol.h:78
bool IsPower() const override
Definition: lib_symbol.cpp:389
std::vector< SCH_PIN * > GetPins(int aUnit=0, int aBodyStyle=0) const
Return a list of pin object pointers from the draw item list.
Definition: lib_symbol.cpp:809
wxArrayString GetFPFilters() const
Definition: lib_symbol.h:206
EMBEDDED_FILES * GetEmbeddedFiles() override
The backing store for a PROJECT, in JSON format.
Definition: project_file.h:70
SCHEMATIC_SETTINGS * m_SchematicSettings
Definition: project_file.h:135
std::shared_ptr< NET_SETTINGS > & NetSettings()
Definition: project_file.h:101
static SEARCH_STACK * SchSearchS(PROJECT *aProject)
Accessor for Eeschema search stack.
Definition: project_sch.cpp:41
virtual const wxString GetProjectPath() const
Return the full path of the project.
Definition: project.cpp:135
virtual PROJECT_FILE & GetProjectFile() const
Definition: project.h:166
These are loaded from Eeschema settings but then overwritten by the project settings.
EMBEDDED_FILES * GetEmbeddedFiles() override
Definition: schematic.cpp:854
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
Schematic editor (Eeschema) main window.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:51
GR_TEXT_V_ALIGN_T GetEffectiveVertJustify() const
Definition: sch_field.cpp:737
bool IsNameShown() const
Definition: sch_field.h:208
bool IsHorizJustifyFlipped() const
Return whether the field will be rendered with the horizontal justification inverted due to rotation ...
Definition: sch_field.cpp:637
bool IsVertJustifyFlipped() const
Definition: sch_field.cpp:694
void SetCanAutoplace(bool aCanPlace)
Definition: sch_field.h:220
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
Definition: sch_field.cpp:1229
GR_TEXT_H_ALIGN_T GetEffectiveHorizJustify() const
Definition: sch_field.cpp:680
wxString GetName(bool aUseDefaultName=true) const
Return the field name (not translated).
Definition: sch_field.cpp:1204
void SetName(const wxString &aName)
Definition: sch_field.cpp:1179
bool CanAutoplace() const
Definition: sch_field.h:219
void SetText(const wxString &aText) override
Definition: sch_field.cpp:1189
void OnScintillaCharAdded(SCINTILLA_TRICKS *aScintillaTricks, wxStyledTextEvent &aEvent) const
Definition: sch_field.cpp:800
void SetNameShown(bool aShown=true)
Definition: sch_field.h:209
static const wxString GetDefaultFieldName(const wxString &aName, bool aUseDefaultName)
Definition: sch_label.cpp:254
SCHEMATIC * Schematic() const
Definition: sch_screen.cpp:99
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:57
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslated=true)
Definition: sch_sheet.cpp:56
Schematic symbol object.
Definition: sch_symbol.h:105
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve a list of the SCH_PINs for the given sheet path.
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
Definition: sch_symbol.h:213
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
const TEMPLATE_FIELDNAME * GetFieldName(const wxString &aName)
Search for aName in the template field name list.
EDA_UNITS GetUserUnits() const
wxString StringFromValue(double aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts aValue in internal units into a united string.
int ValueFromString(const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts aTextValue in aUnits to internal units used by the frame.
wxGridCellAttr * enhanceAttr(wxGridCellAttr *aInputAttr, int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind)
Definition: wx_grid.cpp:42
wxString EnsureFileExtension(const wxString &aFilename, const wxString &aExtension)
It's annoying to throw up nag dialogs when the extension isn't right.
Definition: common.cpp:424
#define _(s)
static constexpr EDA_ANGLE ANGLE_VERTICAL
Definition: eda_angle.h:398
static constexpr EDA_ANGLE ANGLE_HORIZONTAL
Definition: eda_angle.h:397
bool GetAssociatedDocument(wxWindow *aParent, const wxString &aDocName, PROJECT *aProject, SEARCH_STACK *aPaths, EMBEDDED_FILES *aFiles)
Open a document (file) with the suitable browser.
Definition: eda_doc.cpp:62
This file is part of the common library.
#define DEFAULT_FONT_NAME
static wxString netList(SCH_SYMBOL *aSymbol, SCH_SHEET_PATH &aSheetPath)
@ MYID_SHOW_DATASHEET
@ MYID_SELECT_FOOTPRINT
@ FDC_TEXT_SIZE
@ FDC_BOLD
@ FDC_POSY
@ FDC_ITALIC
@ FDC_SHOW_NAME
@ FDC_NAME
@ FDC_H_ALIGN
@ FDC_COLOR
@ FDC_SHOWN
@ FDC_ALLOW_AUTOPLACE
@ FDC_VALUE
@ FDC_POSX
@ FDC_ORIENTATION
@ FDC_V_ALIGN
@ FDC_FONT
FONTCONFIG * Fontconfig()
Definition: fontconfig.cpp:100
@ FRAME_SCH_SYMBOL_EDITOR
Definition: frame_type.h:35
@ FRAME_SCH_VIEWER
Definition: frame_type.h:36
@ FRAME_SCH
Definition: frame_type.h:34
@ FRAME_FOOTPRINT_CHOOSER
Definition: frame_type.h:44
@ GRIDTRICKS_FIRST_CLIENT_ID
Definition: grid_tricks.h:48
static const std::string KiCadSchematicFileExtension
#define KICAD_FONT_NAME
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: pgm_base.cpp:1059
see class PGM_BASE
@ SHEET_MANDATORY_FIELDS
The first 2 are mandatory, and must be instantiated in SCH_SHEET.
Definition: sch_sheet.h:49
@ SHEETNAME
Definition: sch_sheet.h:45
@ SHEETFILENAME
Definition: sch_sheet.h:46
Definitions of control validators for schematic dialogs.
wxString UnescapeString(const wxString &aSource)
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
@ CTX_LINE
Definition: string_utils.h:59
@ CTX_LIBID
Definition: string_utils.h:54
Hold a name of a symbol's field, field value, and default visibility.
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslateForHI=false)
Return a default symbol field name for field aFieldNdx for all components.
Definition for symbol library class.
#define DO_TRANSLATE
@ DATASHEET_FIELD
name of datasheet
@ FOOTPRINT_FIELD
Field Name Module PCB, i.e. "16DIP300".
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ MANDATORY_FIELDS
The first 5 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".
GR_TEXT_H_ALIGN_T
@ GR_TEXT_H_ALIGN_CENTER
@ GR_TEXT_H_ALIGN_RIGHT
@ GR_TEXT_H_ALIGN_LEFT
@ GR_TEXT_H_ALIGN_INDETERMINATE
GR_TEXT_V_ALIGN_T
@ GR_TEXT_V_ALIGN_BOTTOM
@ GR_TEXT_V_ALIGN_INDETERMINATE
@ GR_TEXT_V_ALIGN_CENTER
@ GR_TEXT_V_ALIGN_TOP
@ LIB_SYMBOL_T
Definition: typeinfo.h:148
@ SCH_SYMBOL_T
Definition: typeinfo.h:172
@ SCH_SHEET_T
Definition: typeinfo.h:174
@ SCH_LABEL_LOCATE_ANY_T
Definition: typeinfo.h:190
#define INDETERMINATE_STATE
Used for holding indeterminate values, such as with multiple selections holding different values or c...
Definition: ui_common.h:46
Custom text control validator definitions.
#define SHEETFILENAME_V
Definition: validators.h:47
#define FIELD_NAME
Definition: validators.h:43
#define SHEETNAME_V
Definition: validators.h:46
#define FIELD_VALUE
Definition: validators.h:44
VECTOR2< int32_t > VECTOR2I
Definition: vector2d.h:673
wxString AddFileExtListToFilter(const std::vector< std::string > &aExts)
Build the wildcard extension file dialog wildcard filter to add to the base message dialog.
Definition of file extensions used in Kicad.