KiCad PCB EDA Suite
dialog_configure_paths.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) 2015 Wayne Stambaugh <stambaughw@gmail.com>
5  * Copyright (C) 2015-2018 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include <dialog_configure_paths.h>
26 
27 #include <confirm.h>
28 #include <menus_helpers.h>
29 #include <validators.h>
30 #include <html_messagebox.h>
31 #include <filename_resolver.h>
32 #include <env_vars.h>
33 #include <widgets/wx_grid.h>
35 
37 {
41 };
42 
44 {
48 };
49 
50 
52  DIALOG_CONFIGURE_PATHS_BASE( aParent ),
53  m_errorGrid( nullptr ),
54  m_resolver( aResolver ),
55  m_gridWidthsDirty( true )
56 {
57  m_btnAddEnvVar->SetBitmap( KiBitmap( small_plus_xpm ) );
58  m_btnDeleteEnvVar->SetBitmap( KiBitmap( trash_xpm ) );
59  m_btnAddSearchPath->SetBitmap( KiBitmap( small_plus_xpm ) );
60  m_btnDeleteSearchPath->SetBitmap( KiBitmap( trash_xpm ) );
61  m_btnMoveUp->SetBitmap( KiBitmap( small_up_xpm ) );
62  m_btnMoveDown->SetBitmap( KiBitmap( small_down_xpm ) );
63 
64  m_EnvVars->DeleteRows( 0, m_EnvVars->GetNumberRows() );
65  m_EnvVars->AppendCols( 1 ); // for the isExternal flags
66  m_EnvVars->HideCol( EV_FLAG_COL );
67  m_EnvVars->UseNativeColHeader( true );
68 
69  wxGridCellAttr* attr = new wxGridCellAttr;
70  attr->SetEditor( new GRID_CELL_PATH_EDITOR( this, &m_curdir ) );
71  m_EnvVars->SetColAttr( EV_PATH_COL, attr );
72 
73  attr = new wxGridCellAttr;
74  attr->SetEditor( new GRID_CELL_PATH_EDITOR( this, &m_curdir ) );
75  m_SearchPaths->SetColAttr( EV_PATH_COL, attr );
76 
77  // Give a bit more room for combobox editors
78  m_EnvVars->SetDefaultRowSize( m_EnvVars->GetDefaultRowSize() + 4 );
79  m_SearchPaths->SetDefaultRowSize( m_SearchPaths->GetDefaultRowSize() + 4 );
80 
81  m_EnvVars->PushEventHandler( new GRID_TRICKS( m_EnvVars ) );
82  m_SearchPaths->PushEventHandler( new GRID_TRICKS( m_SearchPaths ) );
83 
84  m_EnvVars->SetSelectionMode( wxGrid::wxGridSelectionModes::wxGridSelectRows );
85  m_SearchPaths->SetSelectionMode( wxGrid::wxGridSelectionModes::wxGridSelectRows );
86 
87  if( m_resolver )
88  {
89  m_SearchPaths->DeleteRows( 0, m_SearchPaths->GetNumberRows() );
90  m_SearchPaths->UseNativeColHeader( true );
91 
92  // prohibit these characters in the alias names: []{}()%~<>"='`;:.,&?/\|$
93  m_aliasValidator.SetStyle( wxFILTER_EXCLUDE_CHAR_LIST );
94  m_aliasValidator.SetCharExcludes( wxT( "{}[]()%~<>\"='`;:.,&?/\\|$" ) );
95  }
96  else
97  m_sb3DSearchPaths->Show( false );
98 
100  m_sdbSizerOK->SetDefault();
101 
102  // wxFormBuilder doesn't include this event...
103  m_EnvVars->Connect( wxEVT_GRID_CELL_CHANGING, wxGridEventHandler( DIALOG_CONFIGURE_PATHS::OnGridCellChanging ), NULL, this );
104  m_SearchPaths->Connect( wxEVT_GRID_CELL_CHANGING, wxGridEventHandler( DIALOG_CONFIGURE_PATHS::OnGridCellChanging ), NULL, this );
105 
106  GetSizer()->SetSizeHints( this );
107  Centre();
108 }
109 
110 
112 {
113  // Delete the GRID_TRICKS.
114  m_SearchPaths->PopEventHandler( true );
115  m_EnvVars->PopEventHandler( true );
116 
117  m_EnvVars->Disconnect( wxEVT_GRID_CELL_CHANGING, wxGridEventHandler( DIALOG_CONFIGURE_PATHS::OnGridCellChanging ), NULL, this );
118  m_SearchPaths->Disconnect( wxEVT_GRID_CELL_CHANGING, wxGridEventHandler( DIALOG_CONFIGURE_PATHS::OnGridCellChanging ), NULL, this );
119 }
120 
121 
123 {
124  if( !wxDialog::TransferDataToWindow() )
125  return false;
126 
127  // Do 3D search paths first so they get first crack at setting m_curdir
128 
129  if( m_resolver )
130  {
131  const std::list<SEARCH_PATH>* paths = m_resolver->GetPaths();
132 
133  for( auto it = paths->begin(); it != paths->end(); ++it )
134  {
135  if ( !( *it ).m_alias.StartsWith( "${" ) && !( *it ).m_alias.StartsWith( "$(" ) )
136  {
137  AppendSearchPath( it->m_alias, it->m_pathvar, it->m_description );
138 
139  if( m_curdir.IsEmpty() )
140  m_curdir = it->m_pathexp;
141  }
142  }
143  }
144 
145  // Environment variables
146 
147  const ENV_VAR_MAP& envVars = Pgm().GetLocalEnvVariables();
148 
149  for( auto it = envVars.begin(); it != envVars.end(); ++it )
150  {
151  const wxString& path = it->second.GetValue();
152  AppendEnvVar( it->first, path, it->second.GetDefinedExternally() );
153 
154  if( m_curdir.IsEmpty() && !path.StartsWith( "${" ) && !path.StartsWith( "$(" ) )
155  m_curdir = path;
156  }
157 
158  return true;
159 }
160 
161 
162 void DIALOG_CONFIGURE_PATHS::AppendEnvVar( const wxString& aName, const wxString& aPath,
163  bool isExternal )
164 {
165  int i = m_EnvVars->GetNumberRows();
166 
167  m_EnvVars->AppendRows( 1 );
168 
169  m_EnvVars->SetCellValue( i, EV_NAME_COL, aName );
170 
171  wxGridCellAttr* nameCellAttr = m_EnvVars->GetOrCreateCellAttr( i, EV_NAME_COL );
172  wxGridCellTextEditor* nameTextEditor = new GRID_CELL_TEXT_EDITOR();
173  nameTextEditor->SetValidator( ENV_VAR_NAME_VALIDATOR() );
174  nameCellAttr->SetEditor( nameTextEditor );
175  nameCellAttr->SetReadOnly( IsEnvVarImmutable( aName ) );
176  nameCellAttr->DecRef();
177 
178  m_EnvVars->SetCellValue( i, EV_PATH_COL, aPath );
179 
180  wxGridCellAttr* pathCellAttr = m_EnvVars->GetOrCreateCellAttr( i, EV_PATH_COL );
181  wxSystemColour c = isExternal ? wxSYS_COLOUR_MENU : wxSYS_COLOUR_LISTBOX;
182  pathCellAttr->SetBackgroundColour( wxSystemSettings::GetColour( c ) );
183  pathCellAttr->DecRef();
184 
185  m_EnvVars->SetCellValue( i, EV_FLAG_COL, isExternal ? wxT( "external" ) : wxEmptyString );
186 }
187 
188 
189 void DIALOG_CONFIGURE_PATHS::AppendSearchPath( const wxString& aName, const wxString& aPath,
190  const wxString& aDescription )
191 {
192  int i = m_SearchPaths->GetNumberRows();
193 
194  m_SearchPaths->AppendRows( 1 );
195 
196  m_SearchPaths->SetCellValue( i, SP_ALIAS_COL, aName );
197 
198  wxGridCellAttr* nameCellAttr = m_SearchPaths->GetOrCreateCellAttr( i, SP_ALIAS_COL );
199  wxGridCellTextEditor* nameTextEditor = new GRID_CELL_TEXT_EDITOR();
200  nameTextEditor->SetValidator( m_aliasValidator );
201  nameCellAttr->SetEditor( nameTextEditor );
202  nameCellAttr->DecRef();
203 
204  m_SearchPaths->SetCellValue( i, SP_PATH_COL, aPath );
205  m_SearchPaths->SetCellValue( i, SP_DESC_COL, aDescription );
206 }
207 
208 
210 {
212  return false;
213 
214  if( !wxDialog::TransferDataFromWindow() )
215  return false;
216 
217  // Environment variables
218 
219  ENV_VAR_MAP envVarMap;
220 
221  for( int row = 0; row < m_EnvVars->GetNumberRows(); ++row )
222  {
223  wxString name = m_EnvVars->GetCellValue( row, EV_NAME_COL );
224  wxString path = m_EnvVars->GetCellValue( row, EV_PATH_COL );
225 
226  if( name.IsEmpty() )
227  {
229  m_errorRow = row;
231  m_errorMsg = _( "Environment variable name cannot be empty." );
232  return false;
233  }
234  else if( path.IsEmpty() )
235  {
237  m_errorRow = row;
239  m_errorMsg = _( "Environment variable path cannot be empty." );
240  return false;
241  }
242 
243  envVarMap[ name ] = ENV_VAR_ITEM( path );
244  }
245 
246  Pgm().SetLocalEnvVariables( envVarMap );
247 
248  // 3D search paths
249 
250  if( m_resolver )
251  {
252  std::vector<SEARCH_PATH> alist;
253  SEARCH_PATH alias;
254 
255  for( int row = 0; row < m_SearchPaths->GetNumberRows(); ++row )
256  {
257  alias.m_alias = m_SearchPaths->GetCellValue( row, SP_ALIAS_COL );
258  alias.m_pathvar = m_SearchPaths->GetCellValue( row, SP_PATH_COL );
259  alias.m_description = m_SearchPaths->GetCellValue( row, SP_DESC_COL );
260 
261  if( alias.m_alias.IsEmpty() )
262  {
264  m_errorRow = row;
266  m_errorMsg = _( "3D search path alias cannot be empty." );
267  return false;
268  }
269  else if( alias.m_pathvar.IsEmpty() )
270  {
272  m_errorRow = row;
274  m_errorMsg = _( "3D search path cannot be empty." );
275  return false;
276  }
277 
278  alist.push_back( alias );
279  }
280 
281  if( !m_resolver->UpdatePathList( alist ) )
282  return false;
283  }
284 
285  return true;
286 }
287 
288 
290 {
291  wxGrid* grid = dynamic_cast<wxGrid*>( event.GetEventObject() );
292  int row = event.GetRow();
293  int col = event.GetCol();
294  wxString text = event.GetString();
295 
296  if( text.IsEmpty() )
297  {
298  if( grid == m_EnvVars )
299  {
300  if( col == EV_NAME_COL )
301  m_errorMsg = _( "Environment variable name cannot be empty." );
302  else
303  m_errorMsg = _( "Environment variable path cannot be empty." );
304  }
305  else
306  {
307  if( col == SP_ALIAS_COL )
308  m_errorMsg = _( "3D search path alias cannot be empty." );
309  else
310  m_errorMsg = _( "3D search path cannot be empty." );
311  }
312  m_errorGrid = dynamic_cast<wxGrid*>( event.GetEventObject() );
313  m_errorRow = row;
314  m_errorCol = col;
315 
316  event.Veto();
317  }
318 
319  if( grid == m_EnvVars )
320  {
321  if( col == EV_PATH_COL && m_EnvVars->GetCellValue( row, EV_FLAG_COL ).Length() )
322  {
323  wxString msg1 = _( "This path was defined externally to the running process and\n"
324  "will only be temporarily overwritten." );
325  wxString msg2 = _( "The next time KiCad is launched, any paths that have already\n"
326  "been defined are honored and any settings defined in the path\n"
327  "configuration dialog are ignored. If you did not intend for\n"
328  "this behavior, either rename any conflicting entries or remove\n"
329  "the external environment variable(s) from your system." );
330  KIDIALOG dlg( this, msg1, KIDIALOG::KD_WARNING );
331  dlg.ShowDetailedText( msg2 );
332  dlg.DoNotShowCheckbox( __FILE__, __LINE__ );
333  dlg.ShowModal();
334  }
335  else if( col == EV_NAME_COL && m_EnvVars->GetCellValue( row, EV_NAME_COL ) != text )
336  {
337  // Changing name; clear external flag
338  m_EnvVars->SetCellValue( row, EV_FLAG_COL, wxEmptyString );
339  }
340  }
341 }
342 
343 
344 void DIALOG_CONFIGURE_PATHS::OnAddEnvVar( wxCommandEvent& event )
345 {
347  return;
348 
349  AppendEnvVar( wxEmptyString, wxEmptyString, false );
350 
351  m_EnvVars->MakeCellVisible( m_EnvVars->GetNumberRows() - 1, EV_NAME_COL );
352  m_EnvVars->SetGridCursor( m_EnvVars->GetNumberRows() - 1, EV_NAME_COL );
353 
354  m_EnvVars->EnableCellEditControl( true );
355  m_EnvVars->ShowCellEditControl();
356 }
357 
358 
359 void DIALOG_CONFIGURE_PATHS::OnAddSearchPath( wxCommandEvent& event )
360 {
362  return;
363 
364  AppendSearchPath( wxEmptyString, wxEmptyString, wxEmptyString);
365 
366  m_SearchPaths->MakeCellVisible( m_SearchPaths->GetNumberRows() - 1, SP_ALIAS_COL );
367  m_SearchPaths->SetGridCursor( m_SearchPaths->GetNumberRows() - 1, SP_ALIAS_COL );
368 
369  m_SearchPaths->EnableCellEditControl( true );
370  m_SearchPaths->ShowCellEditControl();
371 }
372 
373 
374 void DIALOG_CONFIGURE_PATHS::OnRemoveEnvVar( wxCommandEvent& event )
375 {
376  int curRow = m_EnvVars->GetGridCursorRow();
377 
378  if( curRow < 0 || m_EnvVars->GetNumberRows() <= curRow )
379  return;
380  else if( IsEnvVarImmutable( m_EnvVars->GetCellValue( curRow, EV_NAME_COL ) ) )
381  {
382  wxBell();
383  return;
384  }
385 
386  m_EnvVars->CommitPendingChanges( true /* silent mode; we don't care if it's valid */ );
387  m_EnvVars->DeleteRows( curRow, 1 );
388 
389  m_EnvVars->MakeCellVisible( std::max( 0, curRow-1 ), m_EnvVars->GetGridCursorCol() );
390  m_EnvVars->SetGridCursor( std::max( 0, curRow-1 ), m_EnvVars->GetGridCursorCol() );
391 }
392 
393 
394 void DIALOG_CONFIGURE_PATHS::OnDeleteSearchPath( wxCommandEvent& event )
395 {
396  int curRow = m_SearchPaths->GetGridCursorRow();
397 
398  if( curRow < 0 || m_SearchPaths->GetNumberRows() <= curRow )
399  return;
400 
401  m_SearchPaths->CommitPendingChanges( true /* silent mode; we don't care if it's valid */ );
402  m_SearchPaths->DeleteRows( curRow, 1 );
403 
404  m_SearchPaths->MakeCellVisible( std::max( 0, curRow-1 ), m_SearchPaths->GetGridCursorCol() );
405  m_SearchPaths->SetGridCursor( std::max( 0, curRow-1 ), m_SearchPaths->GetGridCursorCol() );
406 }
407 
408 
409 void DIALOG_CONFIGURE_PATHS::OnSearchPathMoveUp( wxCommandEvent& event )
410 {
412  return;
413 
414  int curRow = m_SearchPaths->GetGridCursorRow();
415  int prevRow = curRow - 1;
416 
417  if( curRow > 0 )
418  {
419  for( int i = 0; i < m_SearchPaths->GetNumberCols(); ++i )
420  {
421  wxString tmp = m_SearchPaths->GetCellValue( curRow, i );
422  m_SearchPaths->SetCellValue( curRow, i, m_SearchPaths->GetCellValue( prevRow, i ) );
423  m_SearchPaths->SetCellValue( prevRow, i, tmp );
424  }
425 
426  m_SearchPaths->SetGridCursor( prevRow, m_SearchPaths->GetGridCursorCol() );
427  }
428  else
429  wxBell();
430 }
431 
432 
433 void DIALOG_CONFIGURE_PATHS::OnSearchPathMoveDown( wxCommandEvent& event )
434 {
436  return;
437 
438  int curRow = m_SearchPaths->GetGridCursorRow();
439  int nextRow = curRow + 1;
440 
441  if( curRow < m_SearchPaths->GetNumberRows() - 1 )
442  {
443  for( int i = 0; i < m_SearchPaths->GetNumberCols(); ++i )
444  {
445  wxString tmp = m_SearchPaths->GetCellValue( curRow, i );
446  m_SearchPaths->SetCellValue( curRow, i, m_SearchPaths->GetCellValue( nextRow, i ) );
447  m_SearchPaths->SetCellValue( nextRow, i, tmp );
448  }
449 
450  m_SearchPaths->SetGridCursor( nextRow, m_SearchPaths->GetGridCursorCol() );
451  }
452  else
453  wxBell();
454 }
455 
456 
458 {
459  wxASSERT( (int) EV_PATH_COL == (int) SP_PATH_COL );
460 
461  if( aEvent.GetCol() == EV_PATH_COL )
462  {
463  wxMenu menu;
464 
465  AddMenuItem( &menu, 1, _( "File Browser..." ), KiBitmap( folder_xpm ) );
466  if( GetPopupMenuSelectionFromUser( menu ) == 1 )
467  {
468  wxDirDialog dlg( nullptr, _( "Select Path" ), m_curdir,
469  wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
470 
471  if( dlg.ShowModal() == wxID_OK )
472  {
473  wxGrid* grid = dynamic_cast<wxGrid*>( aEvent.GetEventObject() );
474  grid->SetCellValue( aEvent.GetRow(), EV_PATH_COL, dlg.GetPath() );
475  m_curdir = dlg.GetPath();
476  }
477  }
478  }
479 }
480 
481 
482 void DIALOG_CONFIGURE_PATHS::OnGridCellChange( wxGridEvent& aEvent )
483 {
484  m_gridWidthsDirty = true;
485 
486  aEvent.Skip();
487 }
488 
489 
490 void DIALOG_CONFIGURE_PATHS::OnUpdateUI( wxUpdateUIEvent& event )
491 {
492  if( m_gridWidthsDirty && ( !m_EnvVars->IsCellEditControlShown()
493  && !m_SearchPaths->IsCellEditControlShown() ) )
494  {
495  int width = m_EnvVars->GetClientRect().GetWidth();
496 
497  m_EnvVars->AutoSizeColumn( EV_NAME_COL );
498  m_EnvVars->SetColSize( EV_NAME_COL, std::max( m_EnvVars->GetColSize( EV_NAME_COL ), 120 ) );
499 
500  m_EnvVars->SetColSize( EV_PATH_COL, width - m_EnvVars->GetColSize( EV_NAME_COL ) );
501 
502  width = m_SearchPaths->GetClientRect().GetWidth();
503 
504  m_SearchPaths->AutoSizeColumn( SP_ALIAS_COL );
505  m_SearchPaths->SetColSize( SP_ALIAS_COL, std::max( m_SearchPaths->GetColSize( SP_ALIAS_COL ), 120 ) );
506 
507  m_SearchPaths->AutoSizeColumn( SP_PATH_COL );
508  m_SearchPaths->SetColSize( SP_PATH_COL, std::max( m_SearchPaths->GetColSize( SP_PATH_COL ), 300 ) );
509 
510  m_SearchPaths->SetColSize( SP_DESC_COL, width - ( m_SearchPaths->GetColSize( SP_ALIAS_COL )
511  + m_SearchPaths->GetColSize( SP_PATH_COL ) ) );
512  m_gridWidthsDirty = false;
513  }
514 
515  // Handle a grid error. This is delayed to OnUpdateUI so that we can change focus
516  // even when the original validation was triggered from a killFocus event (and for
517  // dialog with notebooks, so that the corresponding notebook page can be shown in
518  // the background when triggered from an OK).
519  if( m_errorGrid )
520  {
521  // We will re-enter this routine when the error dialog is displayed, so make
522  // sure we don't keep putting up more dialogs.
523  wxGrid* grid = m_errorGrid;
524  m_errorGrid = nullptr;
525 
527 
528  grid->SetFocus();
529  grid->MakeCellVisible( m_errorRow, m_errorCol );
530  grid->SetGridCursor( m_errorRow, m_errorCol );
531 
532  grid->EnableCellEditControl( true );
533  grid->ShowCellEditControl();
534  }
535 }
536 
537 
538 void DIALOG_CONFIGURE_PATHS::OnGridSize( wxSizeEvent& event )
539 {
540  m_gridWidthsDirty = true;
541 
542  event.Skip();
543 }
544 
545 
546 void DIALOG_CONFIGURE_PATHS::OnHelp( wxCommandEvent& event )
547 {
548  wxString msg = _( "Enter the name and value for each environment variable. Grey entries "
549  "are names that have been defined externally at the system or user "
550  "level. Environment variables defined at the system or user level "
551  "take precedence over the ones defined in this table. This means the "
552  "values in this table are ignored." );
553  msg << "<br><br><b>";
554  msg << _( "To ensure environment variable names are valid on all platforms, the name field "
555  "will only accept upper case letters, digits, and the underscore characters." );
556  msg << "</b>";
557 
558  for( const auto& var: GetPredefinedEnvVars() )
559  {
560  msg << "<br><br><b>" << var << "</b>";
561 
562  const auto desc = LookUpEnvVarHelp( var );
563 
564  if( desc.size() > 0 )
565  msg << ": " << desc;
566 
567  }
568 
569  HTML_MESSAGE_BOX dlg( GetParent(), _( "Environment Variable Help" ) );
570  dlg.SetDialogSizeInDU( 400, 250 );
571 
572  dlg.AddHTML_Text( msg );
573  dlg.ShowModal();
574 }
void OnSearchPathMoveDown(wxCommandEvent &event) override
void DoNotShowCheckbox(wxString file, int line)
Shows the &#39;do not show again&#39; checkbox
Definition: confirm.cpp:60
bool IsEnvVarImmutable(const wxString &aEnvVar)
Determine if an environment variable is "predefined", i.e.
Definition: env_vars.cpp:47
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Function DisplayErrorMessage displays an error message with aMessage.
Definition: confirm.cpp:259
const ENV_VAR_LIST & GetPredefinedEnvVars()
Get the list of pre-defined environment variables.
Definition: env_vars.cpp:59
Helper class to create more flexible dialogs, including &#39;do not show again&#39; checkbox handling...
Definition: confirm.h:44
This file is part of the common library.
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Function AddMenuItem is an inline helper function to create and insert a menu item with an icon into ...
Definition: bitmap.cpp:223
void OnGridSize(wxSizeEvent &event) override
SEARCH_PATH_GRID_COLUMNS
Class ENV_VAR_ITEM.
Definition: pgm_base.h:100
wxString m_alias
Class GRID_TRICKS is used to add cut, copy, and paste to an otherwise unmodied wxGrid instance...
Definition: grid_tricks.h:51
provides an extensible class to resolve 3D model paths.
const std::list< SEARCH_PATH > * GetPaths(void)
Function GetPaths returns a pointer to the internal path list; the items in:load. ...
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
void OnGridCellChanging(wxGridEvent &event)
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:86
Class GRID_CELL_TEXT_EDITOR.
Definition: validators.h:42
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
Class DIALOG_CONFIGURE_PATHS_BASE.
bool UpdatePathList(std::vector< SEARCH_PATH > &aPathList)
Function UpdatePathList clears the current path list and substitutes the given path list...
void AppendEnvVar(const wxString &aName, const wxString &aPath, bool isExternal)
VTBL_ENTRY const ENV_VAR_MAP & GetLocalEnvVariables() const
Definition: pgm_base.h:312
std::map< wxString, ENV_VAR_ITEM > ENV_VAR_MAP
Definition: pgm_base.h:129
FILENAME_RESOLVER * m_resolver
void OnUpdateUI(wxUpdateUIEvent &event) override
Subclass of DIALOG_DISPLAY_HTML_TEXT_BASE, which is generated by wxFormBuilder.
wxString m_description
DIALOG_CONFIGURE_PATHS(wxWindow *aParent, FILENAME_RESOLVER *aResolver)
wxString LookUpEnvVarHelp(const wxString &aEnvVar)
Look up long-form help text for a given environment variable.
Definition: env_vars.cpp:97
void OnAddSearchPath(wxCommandEvent &event) override
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:156
Class HTML_MESSAGE_BOX.
void OnSearchPathMoveUp(wxCommandEvent &event) override
VTBL_ENTRY void SetLocalEnvVariables(const ENV_VAR_MAP &aEnvVarMap)
Function SetLocalEnvVariables.
Definition: pgm_base.cpp:860
void SetDialogSizeInDU(int aWidth, int aHeight)
set the dialog size, using a "logical value.
Class ENV_VAR_NAME_VALIDATOR.
Definition: validators.h:95
void OnGridCellChange(wxGridEvent &event) override
wxString m_pathvar
const char * name
Definition: DXF_plotter.cpp:61
void OnHelp(wxCommandEvent &event) override
#define max(a, b)
Definition: auxiliary.h:86
void AddHTML_Text(const wxString &message)
Function AddHTML_Text adds html text (without any change) to message list.
void OnGridCellRightClick(wxGridEvent &event) override
size_t i
Definition: json11.cpp:597
void OnRemoveEnvVar(wxCommandEvent &event) override
int ShowModal() override
Definition: confirm.cpp:102
void OnDeleteSearchPath(wxCommandEvent &event) override
Functions to provide helpful hints about what environment vars do.
void OnAddEnvVar(wxCommandEvent &event) override
void AppendSearchPath(const wxString &aName, const wxString &aPath, const wxString &aDesc)
Custom text control validator definitions.