KiCad PCB EDA Suite
eeschema_config.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) 2014-2016 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 
28 #include <fctsys.h>
29 #include <pgm_base.h>
30 #include <kiface_i.h>
31 #include <class_drawpanel.h>
32 #include <confirm.h>
33 #include <gestfich.h>
34 #include <schframe.h>
35 #include <invoke_sch_dialog.h>
36 #include <common.h>
37 
38 #include <eeschema_id.h>
39 #include <general.h>
40 #include <libeditframe.h>
41 #include <eeschema_config.h>
42 #include <hotkeys.h>
43 #include <sch_sheet.h>
44 #include <class_libentry.h>
46 #include <class_library.h>
47 #include <symbol_lib_table.h>
48 
49 #include <dialog_hotkeys_editor.h>
50 
54 #include <dialog_erc.h>
55 
57 
58 #define FR_HISTORY_LIST_CNT 10
59 
60 
62 
64 {
65  return s_defaultBusThickness;
66 }
67 
68 
69 void SetDefaultBusThickness( int aThickness)
70 {
71  if( aThickness >= 1 )
72  s_defaultBusThickness = aThickness;
73  else
75 }
76 
77 
80 
82 {
83  return s_defaultTextSize;
84 }
85 
86 
87 void SetDefaultTextSize( int aTextSize )
88 {
89  s_defaultTextSize = aTextSize;
90 }
91 
92 
93 /*
94  * Default line (in Eeschema units) thickness used to draw/plot items having a
95  * default thickness line value (i.e. = 0 ).
96  */
98 
99 
101 {
103 }
104 
105 
106 void SetDefaultLineThickness( int aThickness )
107 {
108  if( aThickness >=1 )
109  s_drawDefaultLineThickness = aThickness;
110  else
112 }
113 
114 
115 // Color to draw selected items
117 {
118  return COLOR4D( BROWN );
119 }
120 
121 
122 // Color to draw items flagged invisible, in libedit (they are invisible
123 // in Eeschema
125 {
126  return COLOR4D( DARKGRAY );
127 }
128 
129 
130 void LIB_EDIT_FRAME::InstallConfigFrame( wxCommandEvent& event )
131 {
132  // Identical to SCH_EDIT_FRAME::InstallConfigFrame()
133 
134  PROJECT* prj = &Prj();
135  wxArrayString lib_names;
136  wxString lib_paths;
137 
138  try
139  {
140  PART_LIBS::LibNamesAndPaths( prj, false, &lib_paths, &lib_names );
141  }
142  catch( const IO_ERROR& DBG( ioe ) )
143  {
144  DBG(printf( "%s: %s\n", __func__, TO_UTF8( ioe.What() ) );)
145  return;
146  }
147 
148  if( InvokeEeschemaConfig( this, &lib_paths, &lib_names ) )
149  {
150  // save the [changed] settings.
151  PART_LIBS::LibNamesAndPaths( prj, true, &lib_paths, &lib_names );
152 
153  // Force a reload of the PART_LIBS
154  prj->SetElem( PROJECT::ELEM_SCH_PART_LIBS, NULL );
156 
157  // Update the schematic symbol library links.
158  SCH_SCREENS schematic;
159 
160  schematic.UpdateSymbolLinks();
161 
162  // There may be no parent window so use KIWAY message to refresh the schematic editor
163  // in case any symbols have changed.
164  Kiway().ExpressMail( FRAME_SCH, MAIL_SCH_REFRESH, std::string( "" ), this );
165  }
166 }
167 
168 
169 void LIB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
170 {
171  int id = event.GetId();
172 
173  switch( id )
174  {
175  // Hotkey IDs
178  break;
179 
182  break;
183 
186  break;
187 
189  // Display current hotkey list for LibEdit.
191  break;
192 
193  default:
194  DisplayError( this, wxT( "LIB_EDIT_FRAME::Process_Config error" ) );
195  }
196 }
197 
198 
199 void SCH_EDIT_FRAME::InstallConfigFrame( wxCommandEvent& event )
200 {
201  // Identical to LIB_EDIT_FRAME::InstallConfigFrame()
202 
203  PROJECT* prj = &Prj();
204  wxArrayString lib_names;
205  wxString lib_paths;
206 
207  try
208  {
209  PART_LIBS::LibNamesAndPaths( prj, false, &lib_paths, &lib_names );
210  }
211  catch( const IO_ERROR& DBG( ioe ) )
212  {
213  DBG(printf( "%s: %s\n", __func__, TO_UTF8( ioe.What() ) );)
214  return;
215  }
216 
217  if( InvokeEeschemaConfig( this, &lib_paths, &lib_names ) )
218  {
219  // save the [changed] settings.
220  PART_LIBS::LibNamesAndPaths( prj, true, &lib_paths, &lib_names );
221 
222 #if defined(DEBUG)
223  printf( "%s: lib_names:\n", __func__ );
224  for( unsigned i=0; i<lib_names.size(); ++i )
225  {
226  printf( " %s\n", TO_UTF8( lib_names[i] ) );
227  }
228 
229  printf( "%s: lib_paths:'%s'\n", __func__, TO_UTF8( lib_paths ) );
230 #endif
231 
232  // Force a reload of the PART_LIBS
233  prj->SetElem( PROJECT::ELEM_SCH_PART_LIBS, NULL );
235 
236  // Update the schematic symbol library links.
237  SCH_SCREENS schematic;
238 
239  schematic.UpdateSymbolLinks();
240  GetCanvas()->Refresh();
241  }
242 }
243 
244 
245 void SCH_EDIT_FRAME::Process_Config( wxCommandEvent& event )
246 {
247  int id = event.GetId();
248  wxFileName fn;
249 
250  switch( id )
251  {
252  case ID_CONFIG_SAVE:
253  SaveProjectSettings( true );
254  break;
255 
256  case ID_CONFIG_READ:
257  {
258  fn = g_RootSheet->GetScreen()->GetFileName();
259  fn.SetExt( ProjectFileExtension );
260 
261  wxFileDialog dlg( this, _( "Read Project File" ), fn.GetPath(),
262  fn.GetFullName(), ProjectFileWildcard,
263  wxFD_OPEN | wxFD_FILE_MUST_EXIST );
264 
265  if( dlg.ShowModal() == wxID_CANCEL )
266  break;
267 
268  wxString chosen = dlg.GetPath();
269 
270  if( chosen == Prj().GetProjectFullName() )
271  LoadProjectFile();
272  else
273  {
274  // Read library list and library path list
275  Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH, GetProjectFileParametersList() );
276  // Read schematic editor setup
278  }
279  }
280  break;
281 
282  // Hotkey IDs
285  break;
286 
289  break;
290 
293  break;
294 
296  // Display current hotkey list for eeschema.
298  break;
299 
300  default:
301  DisplayError( this, wxT( "SCH_EDIT_FRAME::Process_Config error" ) );
302  }
303 }
304 
305 
306 void SCH_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event )
307 {
308  wxArrayString units;
309  GRIDS grid_list = GetScreen()->GetGrids();
310  bool saveProjectConfig = false;
311 
312  DIALOG_EESCHEMA_OPTIONS dlg( this );
313 
314  units.Add( GetUnitsLabel( INCHES ) );
315  units.Add( GetUnitsLabel( MILLIMETRES ) );
316 
317  dlg.SetUnits( units, g_UserUnit );
318  dlg.SetGridSizes( grid_list, GetScreen()->GetGridCmdId() );
323  dlg.SetRepeatVertical( GetRepeatStep().y );
328 
329  dlg.SetShowGrid( IsGridVisible() );
339  dlg.Layout();
340  dlg.Fit();
341  dlg.SetMinSize( dlg.GetSize() );
343 
344  if( dlg.ShowModal() == wxID_CANCEL )
345  return;
346 
348 
349  wxRealPoint gridsize = grid_list[ (size_t) dlg.GetGridSelection() ].m_Size;
350  m_LastGridSizeId = GetScreen()->SetGrid( gridsize );
351 
352  int sep, firstId;
353  dlg.GetRefIdSeparator( sep, firstId);
354 
355  if( sep != (int)LIB_PART::GetSubpartIdSeparator() ||
356  firstId != (int)LIB_PART::GetSubpartFirstId() )
357  {
358  LIB_PART::SetSubpartIdNotation( sep, firstId );
359  saveProjectConfig = true;
360  }
361 
364 
365  if( dlg.GetTextSize() != GetDefaultTextSize() )
366  {
368  saveProjectConfig = true;
369  }
370 
371  wxPoint step;
372  step.x = dlg.GetRepeatHorizontal();
373  step.y = dlg.GetRepeatVertical();
374  SetRepeatStep( step );
376 
388 
389  // Delete all template fieldnames and then restore them using the template field data from
390  // the options dialog
392  TEMPLATE_FIELDNAMES newFieldNames = dlg.GetTemplateFields();
393 
394  for( TEMPLATE_FIELDNAMES::iterator dlgfld = newFieldNames.begin();
395  dlgfld != newFieldNames.end(); ++dlgfld )
396  {
397  TEMPLATE_FIELDNAME fld = *dlgfld;
398  AddTemplateFieldName( fld );
399  }
400 
401  SaveSettings( config() ); // save values shared by eeschema applications.
402 
403  if( saveProjectConfig )
404  SaveProjectSettings( true );
405 
406  m_canvas->Refresh( true );
407 }
408 
409 
411 {
412  if( !m_projectFileParams.empty() )
413  return m_projectFileParams;
414 
415  m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "PageLayoutDescrFile" ),
417 
418  m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "PlotDirectoryName" ),
419  &m_plotDirectoryName ) );
420 
421  m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "SubpartIdSeparator" ),
423  0, 0, 126 ) );
424  m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "SubpartFirstId" ),
426  'A', '1', 'z' ) );
427 
428  /* moved to library load/save specific code, in a specific section in .pro file
429  m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "LibDir" ),
430  &m_userLibraryPath ) );
431  m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ),
432  &m_componentLibFiles,
433  GROUP_SCH_LIBS ) );
434  */
435 
436  m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "NetFmtName" ),
437  &m_netListFormat) );
438  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "SpiceAjustPassiveValues" ),
439  &m_spiceAjustPassiveValues, false ) );
440 
441  m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "LabSize" ),
443  DEFAULT_SIZE_TEXT, 5, 1000 ) );
444 
445  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_TestSimilarLabels" ),
447 
448  return m_projectFileParams;
449 }
450 
451 
453 {
454  // Read library list and library path list
455  bool isRead = Prj().ConfigLoad( Kiface().KifaceSearch(),
457 
458  // Read schematic editor setup
459  isRead = isRead && Prj().ConfigLoad( Kiface().KifaceSearch(),
461 
462  // Verify some values, because the config file can be edited by hand,
463  // and have bad values:
467 
468  // Load the page layout decr file, from the filename stored in
469  // BASE_SCREEN::m_PageLayoutDescrFileName, read in config project file
470  // If empty, or not existing, the default descr is loaded
472  wxString pg_fullfilename = WORKSHEET_LAYOUT::MakeFullFileName(
474  Prj().GetProjectPath() );
475 
476  pglayout.SetPageLayout( pg_fullfilename );
477 
478  return isRead;
479 }
480 
481 
482 void SCH_EDIT_FRAME::SaveProjectSettings( bool aAskForSave )
483 {
484  PROJECT& prj = Prj();
485  wxFileName fn = g_RootSheet->GetScreen()->GetFileName(); //ConfigFileName
486 
487  fn.SetExt( ProjectFileExtension );
488 
489  if( !IsWritable( fn ) )
490  return;
491 
492  if( aAskForSave )
493  {
494  wxFileDialog dlg( this, _( "Save Project File" ),
495  fn.GetPath(), fn.GetFullName(),
496  ProjectFileWildcard, wxFD_SAVE );
497 
498  if( dlg.ShowModal() == wxID_CANCEL )
499  return;
500 
501  fn = dlg.GetPath();
502  }
503 
505 }
506 
509 
510 const wxChar RescueNeverShowEntry[] = wxT( "RescueNeverShow" );
511 const wxChar AutoplaceFieldsEntry[] = wxT( "AutoplaceFields" );
512 const wxChar AutoplaceJustifyEntry[] = wxT( "AutoplaceJustify" );
513 const wxChar AutoplaceAlignEntry[] = wxT( "AutoplaceAlign" );
514 static const wxChar DefaultBusWidthEntry[] = wxT( "DefaultBusWidth" );
515 static const wxChar DefaultDrawLineWidthEntry[] = wxT( "DefaultDrawLineWidth" );
516 static const wxChar ShowHiddenPinsEntry[] = wxT( "ShowHiddenPins" );
517 static const wxChar HorzVertLinesOnlyEntry[] = wxT( "HorizVertLinesOnly" );
518 static const wxChar PreviewFramePositionXEntry[] = wxT( "PreviewFramePositionX" );
519 static const wxChar PreviewFramePositionYEntry[] = wxT( "PreviewFramePositionY" );
520 static const wxChar PreviewFrameWidthEntry[] = wxT( "PreviewFrameWidth" );
521 static const wxChar PreviewFrameHeightEntry[] = wxT( "PreviewFrameHeight" );
522 static const wxChar PrintDialogPositionXEntry[] = wxT( "PrintDialogPositionX" );
523 static const wxChar PrintDialogPositionYEntry[] = wxT( "PrintDialogPositionY" );
524 static const wxChar PrintDialogWidthEntry[] = wxT( "PrintDialogWidth" );
525 static const wxChar PrintDialogHeightEntry[] = wxT( "PrintDialogHeight" );
526 static const wxChar FindDialogPositionXEntry[] = wxT( "FindDialogPositionX" );
527 static const wxChar FindDialogPositionYEntry[] = wxT( "FindDialogPositionY" );
528 static const wxChar FindDialogWidthEntry[] = wxT( "FindDialogWidth" );
529 static const wxChar FindDialogHeightEntry[] = wxT( "FindDialogHeight" );
530 static const wxChar FindReplaceFlagsEntry[] = wxT( "LastFindReplaceFlags" );
531 static const wxChar FindStringEntry[] = wxT( "LastFindString" );
532 static const wxChar ReplaceStringEntry[] = wxT( "LastReplaceString" );
533 static const wxChar FindStringHistoryEntry[] = wxT( "FindStringHistoryList%d" );
534 static const wxChar ReplaceStringHistoryEntry[] = wxT( "ReplaceStringHistoryList%d" );
535 static const wxChar FieldNamesEntry[] = wxT( "FieldNames" );
536 static const wxChar SimulatorCommandEntry[] = wxT( "SimCmdLine" );
537 static const wxString ShowPageLimitsEntry = "ShowPageLimits";
538 static const wxString UnitsEntry = "Units";
539 static const wxString PrintMonochromeEntry = "PrintMonochrome";
540 static const wxString PrintSheetRefEntry = "PrintSheetReferenceAndTitleBlock";
541 static const wxString RepeatStepXEntry = "RepeatStepX";
542 static const wxString RepeatStepYEntry = "RepeatStepY";
543 static const wxString RepeatLabelIncrementEntry = "RepeatLabelIncrement";
544 
545 // Library editor wxConfig entry names.
546 static const wxChar lastLibExportPathEntry[] = wxT( "LastLibraryExportPath" );
547 static const wxChar lastLibImportPathEntry[] = wxT( "LastLibraryImportPath" );
548 static const wxChar defaultPinNumSizeEntry[] = wxT( "LibeditPinNumSize" );
549 static const wxChar defaultPinNameSizeEntry[] = wxT( "LibeditPinNameSize" );
550 static const wxChar DefaultPinLengthEntry[] = wxT( "DefaultPinLength" );
551 static const wxChar repeatLibLabelIncEntry[] = wxT( "LibeditRepeatLabelInc" );
552 static const wxChar pinRepeatStepEntry[] = wxT( "LibeditPinRepeatStep" );
553 static const wxChar repeatLibStepXEntry[] = wxT( "LibeditRepeatStepX" );
554 static const wxChar repeatLibStepYEntry[] = wxT( "LibeditRepeatStepY" );
555 static const wxChar showPinElectricalType[] = wxT( "LibeditShowPinElectricalType" );
556 
558 
560 {
561  if( !m_configSettings.empty() )
562  return m_configSettings;
563 
565  &m_showPageLimits, true ) );
566  m_configSettings.push_back( new PARAM_CFG_INT( true, UnitsEntry,
567  (int*)&g_UserUnit, MILLIMETRES ) );
568 
570  &m_printMonochrome, true ) );
571  m_configSettings.push_back( new PARAM_CFG_BOOL( true, PrintSheetRefEntry,
572  &m_printSheetReference, true ) );
573 
574  m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatStepXEntry,
575  &m_repeatStep.x,
578  REPEAT_OFFSET_MAX ) );
579  m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatStepYEntry,
580  &m_repeatStep.y,
583  REPEAT_OFFSET_MAX ) );
586  DEFAULT_REPEAT_LABEL_INC, -10, +10 ) );
587  return m_configSettings;
588 }
589 
590 
591 void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
592 {
594 
595  long tmp;
596 
598 
601 
604  aCfg->Read( ShowHiddenPinsEntry, &m_showAllPins, false );
605  aCfg->Read( HorzVertLinesOnlyEntry, &m_forceHVLines, true );
606  aCfg->Read( AutoplaceFieldsEntry, &m_autoplaceFields, true );
607  aCfg->Read( AutoplaceJustifyEntry, &m_autoplaceJustify, true );
608  aCfg->Read( AutoplaceAlignEntry, &m_autoplaceAlign, false );
609 
610  // Load print preview window session settings.
611  aCfg->Read( PreviewFramePositionXEntry, &tmp, -1 );
612  m_previewPosition.x = (int) tmp;
613  aCfg->Read( PreviewFramePositionYEntry, &tmp, -1 );
614  m_previewPosition.y = (int) tmp;
615  aCfg->Read( PreviewFrameWidthEntry, &tmp, -1 );
616  m_previewSize.SetWidth( (int) tmp );
617  aCfg->Read( PreviewFrameHeightEntry, &tmp, -1 );
618  m_previewSize.SetHeight( (int) tmp );
619 
620  // Load print dialog session settings.
621  aCfg->Read( PrintDialogPositionXEntry, &tmp, -1 );
622  m_printDialogPosition.x = (int) tmp;
623  aCfg->Read( PrintDialogPositionYEntry, &tmp, -1 );
624  m_printDialogPosition.y = (int) tmp;
625  aCfg->Read( PrintDialogWidthEntry, &tmp, -1 );
626  m_printDialogSize.SetWidth( (int) tmp );
627  aCfg->Read( PrintDialogHeightEntry, &tmp, -1 );
628  m_printDialogSize.SetHeight( (int) tmp );
629 
630  // Load netlists options:
632 
633  // Load find dialog session setting.
634  aCfg->Read( FindDialogPositionXEntry, &tmp, -1 );
635  m_findDialogPosition.x = (int) tmp;
636  aCfg->Read( FindDialogPositionYEntry, &tmp, -1 );
637  m_findDialogPosition.y = (int) tmp;
638  aCfg->Read( FindDialogWidthEntry, &tmp, -1 );
639  m_findDialogSize.SetWidth( (int) tmp );
640  aCfg->Read( FindDialogHeightEntry, &tmp, -1 );
641  m_findDialogSize.SetHeight( (int) tmp );
642 
643  wxASSERT_MSG( m_findReplaceData,
644  wxT( "Find dialog data settings object not created. Bad programmer!" ) );
645 
646  aCfg->Read( FindReplaceFlagsEntry, &tmp, (long) wxFR_DOWN );
647  m_findReplaceData->SetFlags( (wxUint32) tmp & ~FR_REPLACE_ITEM_FOUND );
648  m_findReplaceData->SetFindString( aCfg->Read( FindStringEntry, wxEmptyString ) );
649  m_findReplaceData->SetReplaceString( aCfg->Read( ReplaceStringEntry, wxEmptyString ) );
650 
651  // Load the find and replace string history list.
652  for( int i = 0; i < FR_HISTORY_LIST_CNT; ++i )
653  {
654  wxString tmpHistory;
655  wxString entry;
656  entry.Printf( FindStringHistoryEntry, i );
657  tmpHistory = aCfg->Read( entry, wxEmptyString );
658 
659  if( !tmpHistory.IsEmpty() )
660  m_findStringHistoryList.Add( tmpHistory );
661 
662  entry.Printf( ReplaceStringHistoryEntry, i );
663  tmpHistory = aCfg->Read( entry, wxEmptyString );
664 
665  if( !tmpHistory.IsEmpty() )
666  m_replaceStringHistoryList.Add( tmpHistory );
667  }
668 
669  wxString templateFieldNames = aCfg->Read( FieldNamesEntry, wxEmptyString );
670 
671  if( !templateFieldNames.IsEmpty() )
672  {
673  TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) );
674 
675  try
676  {
677  m_TemplateFieldNames.Parse( &lexer );
678  }
679  catch( const IO_ERROR& DBG( e ) )
680  {
681  // @todo show error msg
682  DBG( printf( "templatefieldnames parsing error: '%s'\n",
683  TO_UTF8( e.What() ) ); )
684  }
685  }
686 }
687 
688 
689 void SCH_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
690 {
692 
694 
695  aCfg->Write( DefaultBusWidthEntry, (long) GetDefaultBusThickness() );
696  aCfg->Write( DefaultDrawLineWidthEntry, (long) GetDefaultLineThickness() );
697  aCfg->Write( ShowHiddenPinsEntry, m_showAllPins );
698  aCfg->Write( HorzVertLinesOnlyEntry, GetForceHVLines() );
699  aCfg->Write( AutoplaceFieldsEntry, m_autoplaceFields );
701  aCfg->Write( AutoplaceAlignEntry, m_autoplaceAlign );
702 
703  // Save print preview window session settings.
706  aCfg->Write( PreviewFrameWidthEntry, m_previewSize.GetWidth() );
707  aCfg->Write( PreviewFrameHeightEntry, m_previewSize.GetHeight() );
708 
709  // Save print dialog session settings.
712  aCfg->Write( PrintDialogWidthEntry, m_printDialogSize.GetWidth() );
713  aCfg->Write( PrintDialogHeightEntry, m_printDialogSize.GetHeight() );
714 
715  // Save netlists options:
717 
718  // Save find dialog session setting.
721  aCfg->Write( FindDialogWidthEntry, m_findDialogSize.GetWidth() );
722  aCfg->Write( FindDialogHeightEntry, m_findDialogSize.GetHeight() );
723  wxASSERT_MSG( m_findReplaceData,
724  wxT( "Find dialog data settings object not created. Bad programmer!" ) );
725  aCfg->Write( FindReplaceFlagsEntry,
726  (long) m_findReplaceData->GetFlags() & ~FR_REPLACE_ITEM_FOUND );
727  aCfg->Write( FindStringEntry, m_findReplaceData->GetFindString() );
728  aCfg->Write( ReplaceStringEntry, m_findReplaceData->GetReplaceString() );
729 
730  // Save the find and replace string history list.
731  unsigned i;
732  wxString tmpHistory;
733  wxString entry; // invoke constructor outside of any loops
734 
735  for( i = 0; i < m_findStringHistoryList.GetCount() && i < FR_HISTORY_LIST_CNT; i++ )
736  {
737  entry.Printf( FindStringHistoryEntry, i );
738  aCfg->Write( entry, m_findStringHistoryList[ i ] );
739  }
740 
741  for( i = 0; i < m_replaceStringHistoryList.GetCount() && i < FR_HISTORY_LIST_CNT; i++ )
742  {
743  entry.Printf( ReplaceStringHistoryEntry, i );
744  aCfg->Write( entry, m_replaceStringHistoryList[ i ] );
745  }
746 
747  // Save template fieldnames
748  STRING_FORMATTER sf;
749  m_TemplateFieldNames.Format( &sf, 0 );
750 
751  wxString record = FROM_UTF8( sf.GetString().c_str() );
752  record.Replace( wxT("\n"), wxT(""), true ); // strip all newlines
753  record.Replace( wxT(" "), wxT(" "), true ); // double space to single
754 
755  aCfg->Write( FieldNamesEntry, record );
756 }
757 
758 
759 void LIB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
760 {
762 
765 
767  SetDefaultPinLength( aCfg->Read( DefaultPinLengthEntry, DEFAULTPINLENGTH ) );
768  m_textPinNumDefaultSize = aCfg->Read( defaultPinNumSizeEntry, DEFAULTPINNUMSIZE );
769  m_textPinNameDefaultSize = aCfg->Read( defaultPinNameSizeEntry, DEFAULTPINNAMESIZE );
771  SetRepeatPinStep( aCfg->Read( pinRepeatStepEntry, DEFAULT_REPEAT_OFFSET_PIN ) );
772  wxPoint step;
773  step.x = aCfg->Read( repeatLibStepXEntry, (long)DEFAULT_REPEAT_OFFSET_X );
774  step.y = aCfg->Read( repeatLibStepYEntry, (long)DEFAULT_REPEAT_OFFSET_Y );
775  SetRepeatStep( step );
776  m_showPinElectricalTypeName = aCfg->Read( showPinElectricalType, true );
777 }
778 
779 
780 void LIB_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
781 {
783 
784  aCfg->Write( DefaultPinLengthEntry, (long) GetDefaultPinLength() );
785  aCfg->Write( defaultPinNumSizeEntry, (long) GetPinNumDefaultSize() );
786  aCfg->Write( defaultPinNameSizeEntry, (long) GetPinNameDefaultSize() );
787  aCfg->Write( repeatLibLabelIncEntry, (long) GetRepeatDeltaLabel() );
788  aCfg->Write( pinRepeatStepEntry, (long) GetRepeatPinStep() );
789  aCfg->Write( repeatLibStepXEntry, (long) GetRepeatStep().x );
790  aCfg->Write( repeatLibStepYEntry, (long) GetRepeatStep().y );
791  aCfg->Write( showPinElectricalType, GetShowElectricalType() );
792 }
793 
794 
795 void LIB_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event )
796 {
797  wxArrayString units;
798  GRIDS grid_list = GetScreen()->GetGrids();
799 
800  DIALOG_LIBEDIT_OPTIONS dlg( this );
801 
802  dlg.SetGridSizes( grid_list, GetScreen()->GetGridCmdId() );
804  dlg.SetPinLength( GetDefaultPinLength() );
805  dlg.SetPinNumSize( m_textPinNumDefaultSize );
806  dlg.SetPinNameSize( m_textPinNameDefaultSize );
807 
808  dlg.SetShowGrid( IsGridVisible() );
809  dlg.SetShowElectricalType( GetShowElectricalType() );
810  dlg.Layout();
811  dlg.Fit();
812 
813  if( dlg.ShowModal() == wxID_CANCEL )
814  return;
815 
816  wxRealPoint gridsize = grid_list[ (size_t) dlg.GetGridSelection() ].m_Size;
817  m_LastGridSizeId = GetScreen()->SetGrid( gridsize );
818 
820  SetDefaultPinLength( dlg.GetPinLength() );
821  m_textPinNumDefaultSize = dlg.GetPinNumSize();
822  m_textPinNameDefaultSize = dlg.GetPinNameSize();
824  SetRepeatPinStep( dlg.GetPinRepeatStep() );
827  SetShowElectricalType( dlg.GetShowElectricalType() );
828 
829  SaveSettings( config() ); // save values shared by eeschema applications.
830 
831  m_canvas->Refresh( true );
832 }
833 
834 
835 SYMBOL_LIB_TABLE* PROJECT::SchSymbolLibTable()
836 {
837  // This is a lazy loading function, it loads the project specific table when
838  // that table is asked for, not before.
839  SYMBOL_LIB_TABLE* tbl = (SYMBOL_LIB_TABLE*) GetElem( ELEM_SYMBOL_LIB_TABLE );
840 
841  // its gotta be NULL or a SYMBOL_LIB_TABLE, or a bug.
842  wxASSERT( !tbl || dynamic_cast<SYMBOL_LIB_TABLE*>( tbl ) );
843 
844  if( !tbl )
845  {
846  // Stack the project specific SYMBOL_LIB_TABLE overlay on top of the global table.
847  // ~SYMBOL_LIB_TABLE() will not touch the fallback table, so multiple projects may
848  // stack this way, all using the same global fallback table.
850 
851  SetElem( ELEM_SYMBOL_LIB_TABLE, tbl );
852 
853  wxString prjPath;
854 
855  wxASSERT( wxGetEnv( PROJECT_VAR_NAME, &prjPath ) );
856 
857  wxFileName fn( prjPath, SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
858 
859  try
860  {
861  tbl->Load( fn.GetFullPath() );
862  }
863  catch( const IO_ERROR& ioe )
864  {
865  wxString msg;
866  msg.Printf( _( "An error occurred loading the symbol library table.\n\n%s" ),
867  ioe.What() );
868  DisplayError( NULL, msg );
869  }
870  }
871 
872  return tbl;
873 }
Definition of the SCH_SHEET class for Eeschema.
static int s_defaultTextSize
Default size for text (not only labels)
static const wxString & GetSymbolLibTableFileName()
static const wxChar PrintDialogWidthEntry[]
int m_repeatDeltaLabel
the increment value of labels like bus members when they are repeated
static SYMBOL_LIB_TABLE & GetGlobalLibTable()
A list of parameters type.
void SetEnableMousewheelPan(bool enable)
Function SetEnableMousewheelPan Sets the MousewheelPan setting in the dialog.
#define DEFAULTPINLENGTH
The default pin number size when creating pins(can be changed in preference menu) ...
Definition: general.h:62
int GetRepeatVertical(void)
Function GetRepeatVertical Returns the current RepeatVertical displacement value from the dialog...
VTBL_ENTRY void ConfigSave(const SEARCH_STACK &aSList, const wxString &aGroupName, const PARAM_CFG_ARRAY &aParams, const wxString &aFileName=wxEmptyString)
Function ConfigSave saves the current "project" parameters into the wxConfigBase* derivative...
Definition: project.cpp:307
static const wxString RepeatLabelIncrementEntry
static bool m_TestSimilarLabels
Definition: dialog_erc.h:51
void InstallConfigFrame(wxCommandEvent &event)
void Process_Config(wxCommandEvent &event)
static const wxChar ReplaceStringHistoryEntry[]
#define DEFAULT_SIZE_TEXT
This is the "default-of-the-default" hardcoded text size; individual application define their own def...
Definition: eda_text.h:74
static const wxChar HorzVertLinesOnlyEntry[]
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
static int * SubpartFirstIdPtr()
return a reference to m_subpartFirstId, only for read/save setting functions
static const wxChar PrintDialogPositionXEntry[]
int GetRepeatHorizontal(void)
Function GetRepeatHorizontal Returns the current RepeatHorizontal displacement value from the dialog...
static void LibNamesAndPaths(PROJECT *aProject, bool doSave, wxString *aPaths, wxArrayString *aNames=NULL)
Function LibNamesAndPaths either saves or loads the names of the currently configured part libraries ...
bool GetEnableMousewheelPan(void)
Function GetEnableMousewheelPan Return the MousewheelPan setting from the dialog. ...
Class PROJECT holds project specific data.
Definition: project.h:56
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes...
Definition: macros.h:53
static const wxChar ReplaceStringEntry[]
const wxChar AutoplaceFieldsEntry[]
Class TEMPLATE_FIELDNAMES_LEXER is an automatically generated class using the TokenList2DnsLexer.cmake technology, based on keywords provided by file: /home/kicad/workspace/kicad-doxygen/eeschema/template_fieldnames.keywords.
This file is part of the common library TODO brief description.
int AddTemplateFieldName(const TEMPLATE_FIELDNAME &aFieldName)
Function AddTemplateFieldName inserts or appends a wanted symbol field name into the field names temp...
Definition: schframe.h:316
PARAM_CFG_ARRAY m_projectFileParams
Definition: schframe.h:124
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Update the board display after modifying it bu a python script (note: it is automatically called by a...
Definition: draw_panel.cpp:325
void OnPreferencesOptions(wxCommandEvent &event)
void SetDefaultBusThickness(int aThickness)
bool GetEnableAutoPan() const
wxArrayString m_findStringHistoryList
Definition: schframe.h:137
This file is part of the common library.
void SetForceHVLines(bool aForceHVdirection)
Definition: schframe.h:240
bool GetForceHVLines() const
Definition: schframe.h:239
void SetEnableZoomNoCenter(bool aEnable)
Definition: draw_panel.cpp:656
static const wxChar repeatLibStepYEntry[]
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:337
const wxString ProjectFileExtension
#define DEFAULT_REPEAT_LABEL_INC
the default value (overwritten by the eeschema config)
Definition: general.h:49
void SetRepeatDeltaLabel(int aDelta)
Sets the repeat delta label value for repeat command.
static const wxString ShowPageLimitsEntry
void SetTemplateFields(const TEMPLATE_FIELDNAMES &aFields)
Function SetTemplateFields Set the template field data in the dialog.
void SetEnableHVBusOrientation(bool enable)
Function SetEnableHVBusOrientation Set the HVBusOrientation setting in the dialog.
wxPoint m_printDialogPosition
Definition: schframe.h:130
static const wxString RepeatStepYEntry
const wxPoint GetRepeatStep() const
wxString GetUnitsLabel(EDA_UNITS_T aUnit)
Get a human readable units string.
Definition: base_units.cpp:452
const wxString ProjectFileWildcard
#define PROJECT_VAR_NAME
A variable name whose value holds the current project directory.
Definition: project.h:36
int GetDefaultLineThickness()
Default line thickness used to draw/plot items having a default thickness line value (i...
void ExportHotkeyConfigToFile(EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
Function ExportHotkeyConfigToFile Prompt the user for an old hotkey file to read, and read it...
const wxString & GetFileName() const
struct EDA_HOTKEY_CONFIG g_Libedit_Hokeys_Descr[]
static const wxChar defaultPinNumSizeEntry[]
wxPoint m_repeatStep
the increment value of the position of an item when it is repeated
PARAM_CFG_ARRAY & GetConfigurationSettings()
Function GetConfigurationSettings returns the Eeschema applications settings.
void SetPinLength(int aLength)
void SaveSettings(wxConfigBase *aCfg) override
Function SaveSettings saves common frame parameters to a configuration data file. ...
static const wxString PrintSheetRefEntry
const GRIDS & GetGrids() const
Function GetGrids().
const wxChar RescueNeverShowEntry[]
static int s_defaultBusThickness
wxFindReplaceData * m_findReplaceData
Definition: schframe.h:127
void Process_Config(wxCommandEvent &event)
static const wxChar PreviewFrameWidthEntry[]
void SetUnits(const wxArrayString &aUnits, int aSelect=0)
Function SetUnits Set the unit options.
Used by the search event handler to let the dialog know that a replaceable item has been found...
virtual wxConfigBase * config()
Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_F...
Definition: basicframe.cpp:380
void SetRepeatLabel(int increment)
Function SetRepeatLabel Sets the current RepeatLabel increment value in the dialog.
int GetUnitsSelection(void)
Function GetUnitsSelection Returns the currently selected grid size in the dialog.
#define DEFAULT_REPEAT_OFFSET_PIN
the default value (overwritten by the eeschema config)
Definition: general.h:50
int GetRepeatDeltaLabel() const
static const wxChar PreviewFramePositionYEntry[]
virtual void SetGridColor(COLOR4D aColor)
Function SetGridColor() , virtual.
Definition: draw_frame.h:509
bool IsWritable(const wxFileName &aFileName)
Function IsWritable checks if aFileName can be written.
Definition: basicframe.cpp:553
static const wxString UnitsEntry
bool m_autoplaceAlign
align autoplaced fields to the grid
Definition: schframe.h:156
TEMPLATES m_TemplateFieldNames
Definition: schframe.h:183
static const wxChar PreviewFramePositionXEntry[]
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
Definition: eeschema.cpp:167
bool GetShowHiddenPins(void)
Function GetShowHiddenPins Returns the current ShowHiddenPins value from the dialog.
void SetPinNumSize(int text_size)
SCH_SCREEN * GetScreen()
Definition: sch_sheet.h:286
static const wxChar FindDialogHeightEntry[]
static const wxChar repeatLibLabelIncEntry[]
COLOR4D GetInvisibleItemColor()
std::vector< GRID_TYPE > GRIDS
void SaveSettings(wxConfigBase *aCfg) override
Function SaveSettings saves common frame parameters to a configuration data file. ...
Definition: draw_frame.cpp:746
void GetRefIdSeparator(int &aSep, int &aFirstId)
Function GetRefIdSeparator Returns the current RefIdSeparator value from the dialog.
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
Configuration parameter - PARAM_CFG_FILENAME Class Same as PARAM_CFG_WXSTRING, but stores "\" as "/"...
virtual bool IsGridVisible() const
Function IsGridVisible() , virtual.
Definition: draw_frame.h:481
static WORKSHEET_LAYOUT & GetTheInstance()
static function: returns the instance of WORKSHEET_LAYOUT used in the application ...
void SetEnableAutoPan(bool enable)
Function SetEnableAutoPan Sets the AutoPan setting in the dialog.
void SaveProjectSettings(bool aAskForSave) override
Function SaveProjectSettings saves changes to the project settings to the project (...
static const wxChar FindDialogPositionYEntry[]
int GetLineWidth(void)
Function GetLineWidth Returns the current LineWidth value from the dialog.
void SetDefaultLineThickness(int aThickness)
void SetEnableZoomNoCenter(bool enable)
Function SetEnableZoomNoCenter Sets the current ZoomNoCenter value in the dialog. ...
void SetGridSizes(const GRIDS &grid_sizes, int grid_id)
VTBL_ENTRY void SetElem(ELEM_T aIndex, _ELEM *aElem)
Definition: project.cpp:208
static const wxChar FindReplaceFlagsEntry[]
PARAM_CFG_ARRAY & GetProjectFileParametersList()
Function GetProjectFileParametersList returns the project file parameter list for Eeschema...
static wxString m_PageLayoutDescrFileName
the name of the page layout descr file, or emty to used the default pagelayout
void SetAutoSaveInterval(int aInterval)
Function SetAutoSaveInterval Sets the current AutoSaveInterval value in the dialog.
void OnPreferencesOptions(wxCommandEvent &event)
SCH_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: schframe.cpp:529
static const wxChar DefaultDrawLineWidthEntry[]
#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
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
int GetRepeatLabel(void)
Function GetRepeatLabel Returns the current RepeatLabel increment value from the dialog.
void SetDefaultTextSize(int aTextSize)
void DisplayHotkeyList(EDA_BASE_FRAME *aFrame, struct EDA_HOTKEY_CONFIG *aDescList)
Function DisplayHotkeyList Displays the current hotkey list.
static int GetSubpartIdSeparator()
void DeleteAllTemplateFieldNames()
Function DeleteAllTemplateFieldNames removes all template field names.
Definition: schframe.h:345
bool m_forceHVLines
force H or V directions for wires, bus, line
Definition: schframe.h:152
static const wxString PrintMonochromeEntry
bool GetAutoplaceAlign()
Function Return the current AutoplaceAlign setting from the dialog.
std::vector< TEMPLATE_FIELDNAME > TEMPLATE_FIELDNAMES
static int s_drawDefaultLineThickness
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:55
static const wxString RepeatStepXEntry
static const wxChar FindStringHistoryEntry[]
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
int GetGridSelection(void)
Function GetGridSelection Returns the curent grid size selected in the dialog.
const wxChar AutoplaceAlignEntry[]
static int GetSubpartFirstId()
bool GetShowGrid(void)
Function GetShowGrid Returns the current ShowGrid value from the dialog.
Subclass of DIALOG_SCH_FIND_BASE, which is generated by wxFormBuilder.
Class LIB_ITEM definition.
void UpdateSymbolLinks()
initializes or reinitializes the weak reference to the LIB_PART for each SCH_COMPONENT found in the f...
Definition: common.h:145
bool GetEnableHVBusOrientation(void)
Function GetEnableHVBusOrientation Get the HVBusOrientation setting from the dialog.
Configuration parameter - Integer Class.
struct EDA_HOTKEY_CONFIG g_Eeschema_Hokeys_Descr[]
bool GetEnableZoomNoCenter() const
static const wxChar DefaultBusWidthEntry[]
The common library.
#define GROUP_SCH
Definition: config_params.h:44
wxSize m_printDialogSize
Definition: schframe.h:131
static const wxChar lastLibImportPathEntry[]
wxPoint m_findDialogPosition
Definition: schframe.h:135
void SetShowGrid(bool show)
Function SetShowGrid Sets the current ShowGrid value in the dialog.
Subclass of DIALOG_LIBEDIT_OPTIONS_BASE, which is generated by wxFormBuilder.
Configuration parameter - Boolean Class.
const TEMPLATE_FIELDNAMES & GetTemplateFieldNames()
Function GetTemplateFieldName returns a template fieldnames list for read only access.
bool LoadProjectFile()
Function LoadProjectFile loads the KiCad project file (*.pro) settings specific to Eeschema...
wxArrayString m_replaceStringHistoryList
Definition: schframe.h:138
bool GetAutoplaceFields()
Function Return the current AutoplaceFields setting from the dialog.
void Format(OUTPUTFORMATTER *out, int nestLevel) const
Function Format serializes this object out as text into the given OUTPUTFORMATTER.
#define DEFAULT_REPEAT_OFFSET_Y
the default Y value (overwritten by the eeschema config)
Definition: general.h:47
const std::string & GetString()
Definition: richio.h:475
bool m_printMonochrome
Print monochrome instead of grey scale.
Definition: schframe.h:132
#define DEFAULTDRAWLINETHICKNESS
The default pin len value when creating pins(can be changed in preference menu)
Definition: general.h:59
int m_LastGridSizeId
Definition: draw_frame.h:78
void Load(const wxString &aFileName)
Function Load.
#define DEFAULTBUSTHICKNESS
The thickness to draw lines that thickness is set to 0 (default thickness) (can be changed in prefere...
Definition: general.h:55
The the schematic editor to refresh the display.
Definition: mail_type.h:47
Configuration parameter - wxString Class.
void SaveSettings(wxConfigBase *aCfg) override
Function SaveSettings saves common frame parameters to a configuration data file. ...
void Parse(TEMPLATE_FIELDNAMES_LEXER *in)
Function Parse fills this object from information in the input stream handled by TEMPLATE_FIELDNAMES_...
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
Definition: draw_frame.cpp:716
static const wxChar lastLibExportPathEntry[]
PARAM_CFG_ARRAY m_configSettings
Definition: schframe.h:125
void SetAutoplaceFields(bool enable)
Function Set the AutoplaceFields setting in the dialog.
bool m_autoplaceFields
automatically place component fields
Definition: schframe.h:154
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
WORKSHEET_LAYOUT handles the graphic items list to draw/plot the title block and other items (page re...
void SetShowElectricalType(bool show)
#define DEFAULT_REPEAT_OFFSET_X
the default X value (overwritten by the eeschema config)
Definition: general.h:46
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
static const wxChar pinRepeatStepEntry[]
static const wxChar DefaultPinLengthEntry[]
bool m_showAllPins
Flag to indicate show hidden pins.
Definition: schframe.h:162
#define FR_HISTORY_LIST_CNT
Maximum number of find and replace strings.
void InstallHotkeyFrame(EDA_BASE_FRAME *aParent, EDA_HOTKEY_CONFIG *aHotkeys)
Function InstallHotkeyFrame Create a hotkey editor dialog window with the provided hotkey configurati...
bool m_printSheetReference
Definition: schframe.h:133
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:93
static const wxChar ShowHiddenPinsEntry[]
int GetBusWidth(void)
Function GetBusWidth Get the current bus width setting from the dialog.
Subclass of DIALOG_EESCHEMA_OPTIONS_BASE, which is generated by wxFormBuilder.
bool GetShowPageLimits(void)
Function Return the current ShowPageLimits setting from the dialog.
wxPoint m_previewPosition
Definition: schframe.h:128
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
void SetAutoSaveInterval(int aInterval)
Definition: basicframe.cpp:224
void SetShowHiddenPins(bool show)
Function SetShowHiddenPins Sets the current ShowHiddenPins value in the dialog.
void SetShowPageLimits(bool show)
Function Set the ShowPageLimits setting in the dialog.
void wxConfigSaveSetups(wxConfigBase *aCfg, const PARAM_CFG_ARRAY &aList)
Function wxConfigSaveSetups writes aList of PARAM_CFG_ARRAY elements to save configuration values to ...
wxSize m_previewSize
Definition: schframe.h:129
#define REPEAT_OFFSET_MAX
the max value of repeat offset value
Definition: general.h:48
wxSize m_findDialogSize
Definition: schframe.h:136
see class PGM_BASE
void SetBusWidth(int aWidth)
Function SetBusWidth Sets the bus width setting in the dialog.
wxString m_plotDirectoryName
The name of the destination directory to use when generating plot files.
Definition: schframe.h:165
bool GetEnableMousewheelPan() const
VTBL_ENTRY void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, const std::string &aPayload, wxWindow *aSource=NULL)
Function ExpressMail send aPayload to aDestination from aSource.
Definition: kiway.cpp:387
static void SetSubpartIdNotation(int aSep, int aFirstId)
Set the separator char between the subpart id and the reference 0 (no separator) or '...
static const wxChar PrintDialogHeightEntry[]
bool m_autoplaceJustify
allow autoplace to change justification
Definition: schframe.h:155
static const wxString MakeFullFileName(const wxString &aShortFileName, const wxString &aProjectPath)
Static function.
bool InvokeEeschemaConfig(wxWindow *aParent, wxString *aCallersProjectSpecificLibPaths, wxArrayString *aCallersLibNames)
#define GROUP_SCH_EDITOR
Definition: config_params.h:45
static const wxChar repeatLibStepXEntry[]
void SetEnableMousewheelPan(bool aEnable)
Definition: draw_panel.cpp:647
static int * SubpartIdSeparatorPtr()
return a reference to m_subpartIdSeparator, only for read/save setting functions
static const wxChar defaultPinNameSizeEntry[]
The common library.
static const wxChar showPinElectricalType[]
bool m_showPageLimits
true to display the page limits
Definition: draw_frame.h:82
TEMPLATE_FIELDNAMES GetTemplateFields(void)
Function GetTemplateFields Get the dialog's template field data.
#define DEFAULTPINNAMESIZE
Definition: general.h:68
void SetRepeatHorizontal(int displacement)
Function SetRepeatHorizontal Sets the current RepeatHorizontal displacement value in the dialog...
wxString m_simulatorCommand
Command line used to call the circuit simulator (gnucap, spice, ...)
Definition: schframe.h:145
Struct TEMPLATE_FIELDNAME holds a name of a component's field, field value, and default visibility...
void SetDrawBgColor(COLOR4D aColor) override
void SetRepeatStep(const wxPoint &aStep)
Sets the repeat step value for repeat command.
wxString m_netListFormat
The name of the format to use when generating a net list.
Definition: schframe.h:168
bool GetEnableZoomNoCenter(void)
Function GetEnableZoomNoCenter Returns the current ZoomNoCenter value from the dialog.
COLOR4D GetItemSelectedColor()
classes and function to generate graphics to plt or draw titles blocks and frame references ...
virtual void SetGridVisibility(bool aVisible)
Function SetGridVisibility() , virtual It may be overloaded by derived classes.
Definition: draw_frame.h:491
#define DBG(x)
Definition: fctsys.h:33
void SetAutoplaceJustify(bool enable)
Function Set the AutoplaceJustify setting in the dialog.
VTBL_ENTRY bool ConfigLoad(const SEARCH_STACK &aSearchS, const wxString &aGroupName, const PARAM_CFG_ARRAY &aParams, const wxString &aForeignConfigFileName=wxEmptyString)
Function ConfigLoad reads a subset of parameters from the "project" file.
Definition: project.cpp:342
int GetTextSize(void)
Function GetTextSize Returns the current default TextSize value from the dialog.
static const wxChar FindDialogWidthEntry[]
void SetAutoplaceAlign(bool enable)
Function Set the AutoplaceAlign setting in the dialog.
void SetRefIdSeparator(wxChar aSep, wxChar aFirstId)
Function SetRefIdSeparator Sets the current RefIdSeparator value in the dialog.
Definition for part library class.
void SetTextSize(int text_size)
Function SetTextSize Sets the current default TextSize value in the dialog.
int GetAutoSaveInterval() const
Function GetAutoSaveInterval Returns the current AutoSaveInterval value from the dialog.
#define DEFAULTPINNUMSIZE
The default pin name size when creating pins(can be changed in preference menu)
Definition: general.h:65
static const wxChar FindDialogPositionXEntry[]
static const wxChar PreviewFrameHeightEntry[]
int SetGrid(const wxRealPoint &size)
set the current grid size m_Grid.
void ImportHotkeyConfigFromFile(EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
Function ImportHotkeyConfigFromFile Prompt the user for an old hotkey file to read, and read it.
void SetLineWidth(int aWidth)
Function SetLineWidth Sets the current LineWidth value in the dialog.
void SetGridSizes(const GRIDS &aGridSizes, int aGridId)
Function SetGridSizes Sets the available grid size choices aGridSizes and selectd the current option ...
Class STRING_FORMATTER implements OUTPUTFORMATTER to a memory buffer.
Definition: richio.h:445
bool GetAutoplaceJustify()
Function Return the current AutoplaceJustify setting from the dialog.
static const wxChar PrintDialogPositionYEntry[]
void SetRepeatVertical(int displacement)
Function SetRepeatVertical Sets the current RepeatVertical displacement value in the dialog...
void wxConfigLoadSetups(wxConfigBase *aCfg, const PARAM_CFG_ARRAY &aList)
Function wxConfigLoadSetups uses aList of PARAM_CFG_ARRAY elements to load configuration values from ...
void SetEnableAutoPan(bool aEnable)
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:71
bool m_spiceAjustPassiveValues
Use netcodes (net number) as net names when generating spice net lists.
Definition: schframe.h:171
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:47
int GetDefaultBusThickness()
Default line thickness used to draw/plot busses.
void InstallConfigFrame(wxCommandEvent &event)
const wxChar AutoplaceJustifyEntry[]
void SetPinNameSize(int text_size)
static const wxChar FieldNamesEntry[]
bool GetEnableAutoPan(void)
Function GetEnableAutoPan Return the AutoPan setting from the dialog.
EDA_UNITS_T
Definition: common.h:144
Definition of class LIB_EDIT_FRAME.
int GetAutoSaveInterval() const
Definition: wxstruct.h:227
Class SCH_SCREENS is a container class that holds multiple SCH_SCREENs in a hierarchy.
static const wxChar FindStringEntry[]
void SetPageLayout(const wxString &aFullFileName=wxEmptyString, bool Append=false)
Populates the list with a custom layout, or the default layout, if no custom layout available...
int GetDefaultTextSize()
Default size for text in general.
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
static const wxChar SimulatorCommandEntry[]
Definition: colors.h:62
struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[]