KiCad PCB EDA Suite
Loading...
Searching...
No Matches
grid_text_button_helpers.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) 2021 CERN
5 * Copyright The 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 <wx/checkbox.h>
26#include <wx/combo.h>
27#include <wx/filedlg.h>
28#include <wx/dirdlg.h>
29#include <wx/textctrl.h>
30
31#include <bitmaps.h>
32#include <embedded_files.h>
33#include <kiway.h>
34#include <kiway_player.h>
35#include <kiway_express.h>
36#include <string_utils.h>
37#include <dialog_shim.h>
38#include <common.h>
39#include <env_paths.h>
40#include <pgm_base.h>
41#include <widgets/wx_grid.h>
44#include <eda_doc.h>
45
46
47//-------- Renderer ---------------------------------------------------------------------
48// None required; just render as normal text.
49
50
51
52//-------- Editor Base Class ------------------------------------------------------------
53//
54// Note: this implementation is an adaptation of wxGridCellChoiceEditor
55
56
58{
59 return Combo()->GetValue();
60}
61
62
63void GRID_CELL_TEXT_BUTTON::SetSize( const wxRect& aRect )
64{
65 wxRect rect( aRect );
67
68 wxGridCellEditor::SetSize( rect );
69}
70
71
72void GRID_CELL_TEXT_BUTTON::StartingKey( wxKeyEvent& event )
73{
74 // Note: this is a copy of wxGridCellTextEditor's StartingKey()
75
76 // Since this is now happening in the EVT_CHAR event EmulateKeyPress is no
77 // longer an appropriate way to get the character into the text control.
78 // Do it ourselves instead. We know that if we get this far that we have
79 // a valid character, so not a whole lot of testing needs to be done.
80
81 // wxComboCtrl inherits from wxTextEntry, so can statically cast
82 wxTextEntry* textEntry = static_cast<wxTextEntry*>( Combo() );
83 int ch;
84
85 bool isPrintable;
86
87#if wxUSE_UNICODE
88 ch = event.GetUnicodeKey();
89
90 if( ch != WXK_NONE )
91 isPrintable = true;
92 else
93#endif // wxUSE_UNICODE
94 {
95 ch = event.GetKeyCode();
96 isPrintable = ch >= WXK_SPACE && ch < WXK_START;
97 }
98
99 switch( ch )
100 {
101 case WXK_DELETE:
102 // Delete the initial character when starting to edit with DELETE.
103 textEntry->Remove( 0, 1 );
104 break;
105
106 case WXK_BACK:
107 // Delete the last character when starting to edit with BACKSPACE.
108 {
109 const long pos = textEntry->GetLastPosition();
110 textEntry->Remove( pos - 1, pos );
111 }
112 break;
113
114 default:
115 if( isPrintable )
116 textEntry->WriteText( static_cast<wxChar>( ch ) );
117
118 break;
119 }
120}
121
122
123void GRID_CELL_TEXT_BUTTON::BeginEdit( int aRow, int aCol, wxGrid* aGrid )
124{
125 auto evtHandler = static_cast< wxGridCellEditorEvtHandler* >( m_control->GetEventHandler() );
126
127 // Don't immediately end if we get a kill focus event within BeginEdit
128 evtHandler->SetInSetFocus( true );
129
130 m_value = aGrid->GetTable()->GetValue( aRow, aCol );
131
132 Combo()->SetValue( m_value );
133 Combo()->SetFocus();
134}
135
136
137bool GRID_CELL_TEXT_BUTTON::EndEdit( int, int, const wxGrid*, const wxString&, wxString *aNewVal )
138{
139 const wxString value = Combo()->GetValue();
140
141 if( value == m_value )
142 return false;
143
144 m_value = value;
145
146 if( aNewVal )
147 *aNewVal = value;
148
149 return true;
150}
151
152
153void GRID_CELL_TEXT_BUTTON::ApplyEdit( int aRow, int aCol, wxGrid* aGrid )
154{
155 aGrid->GetTable()->SetValue( aRow, aCol, m_value );
156}
157
158
160{
161 Combo()->SetValue( m_value );
162}
163
164
165#if wxUSE_VALIDATORS
166void GRID_CELL_TEXT_BUTTON::SetValidator( const wxValidator& validator )
167{
168 m_validator.reset( static_cast< wxValidator* >( validator.Clone() ) );
169}
170#endif
171
172
173class TEXT_BUTTON_SYMBOL_CHOOSER : public wxComboCtrl
174{
175public:
176 TEXT_BUTTON_SYMBOL_CHOOSER( wxWindow* aParent, DIALOG_SHIM* aParentDlg,
177 const wxString& aPreselect ) :
178 wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 0, 0 ) ),
179 m_dlg( aParentDlg ),
180 m_preselect( aPreselect )
181 {
182 SetButtonBitmaps( KiBitmapBundle( BITMAPS::small_library ) );
183
184 // win32 fix, avoids drawing the "native dropdown caret"
185 Customize( wxCC_IFLAG_HAS_NONSTANDARD_BUTTON );
186 }
187
188protected:
189 void DoSetPopupControl( wxComboPopup* popup ) override
190 {
191 m_popup = nullptr;
192 }
193
194 wxString escapeLibId( const wxString& aRawValue )
195 {
196 wxString itemName;
197 wxString libName = aRawValue.BeforeFirst( ':', &itemName );
198 return EscapeString( libName, CTX_LIBID ) + ':' + EscapeString( itemName, CTX_LIBID );
199 }
200
201 void OnButtonClick() override
202 {
203 // pick a symbol using the symbol picker.
204 wxString rawValue = GetValue();
205
206 if( rawValue.IsEmpty() )
207 rawValue = m_preselect;
208
209 wxString symbolId = escapeLibId( rawValue );
210
211 if( KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_SYMBOL_CHOOSER, true, m_dlg ) )
212 {
213 if( frame->ShowModal( &symbolId, m_dlg ) )
214 SetValue( UnescapeString( symbolId ) );
215
216 frame->Destroy();
217 }
218 }
219
221 wxString m_preselect;
222};
223
224
225void GRID_CELL_SYMBOL_ID_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
226 wxEvtHandler* aEventHandler )
227{
228 m_control = new TEXT_BUTTON_SYMBOL_CHOOSER( aParent, m_dlg, m_preselect );
230
231 wxGridCellEditor::Create( aParent, aId, aEventHandler );
232}
233
234
235class TEXT_BUTTON_FP_CHOOSER : public wxComboCtrl
236{
237public:
238 TEXT_BUTTON_FP_CHOOSER( wxWindow* aParent, DIALOG_SHIM* aParentDlg,
239 const wxString& aSymbolNetlist, const wxString& aPreselect ) :
240 wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 0, 0 ),
241 wxTE_PROCESS_ENTER | wxBORDER_NONE ),
242 m_dlg( aParentDlg ),
243 m_preselect( aPreselect ),
244 m_symbolNetlist( aSymbolNetlist.ToStdString() )
245 {
246 m_buttonFpChooserLock = false;
247 SetButtonBitmaps( KiBitmapBundle( BITMAPS::small_library ) );
248
249 // win32 fix, avoids drawing the "native dropdown caret"
250 Customize( wxCC_IFLAG_HAS_NONSTANDARD_BUTTON );
251 }
252
253protected:
254 void DoSetPopupControl( wxComboPopup* popup ) override
255 {
256 m_popup = nullptr;
257 }
258
259 void OnButtonClick() override
260 {
261 if( m_buttonFpChooserLock ) // The button to show the FP chooser is clicked, but
262 // a previous click is currently in progress.
263 return;
264
265 // Disable the button until we have finished processing it. Normally this is not an issue
266 // but if the footprint chooser is loading for the first time, it can be slow enough that
267 // multiple clicks will cause multiple instances of the footprint loader process to start
269
270 // pick a footprint using the footprint picker.
271 wxString fpid = GetValue();
272
273 if( fpid.IsEmpty() )
274 fpid = m_preselect;
275
276 if( KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_FOOTPRINT_CHOOSER, true, m_dlg ) )
277 {
278 if( !m_symbolNetlist.empty() )
279 {
282 frame->KiwayMailIn( event );
283 }
284
285 if( frame->ShowModal( &fpid, m_dlg ) )
286 SetValue( fpid );
287
288 frame->Destroy();
289 }
290
291 m_buttonFpChooserLock = false;
292 }
293
294protected:
296 wxString m_preselect;
297
298 // Lock flag to lock the button to show the FP chooser
299 // true when the button is busy, waiting all footprints loaded to
300 // avoid running more than once the FP chooser
302
303 /*
304 * Symbol netlist format:
305 * pinNumber pinName <tab> pinNumber pinName...
306 * fpFilter fpFilter...
307 */
308 std::string m_symbolNetlist;
309};
310
311
312void GRID_CELL_FPID_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
313 wxEvtHandler* aEventHandler )
314{
315 m_control = new TEXT_BUTTON_FP_CHOOSER( aParent, m_dlg, m_symbolNetlist, m_preselect );
317
318#if wxUSE_VALIDATORS
319 // validate text in textctrl, if validator is set
320 if ( m_validator )
321 {
322 Combo()->SetValidator( *m_validator );
323 }
324#endif
325
326 wxGridCellEditor::Create( aParent, aId, aEventHandler );
327}
328
329
330class TEXT_BUTTON_URL : public wxComboCtrl
331{
332public:
333 TEXT_BUTTON_URL( wxWindow* aParent, DIALOG_SHIM* aParentDlg, SEARCH_STACK* aSearchStack,
334 std::vector<EMBEDDED_FILES*> aFilesStack ) :
335 wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 0, 0 ),
336 wxTE_PROCESS_ENTER | wxBORDER_NONE ),
337 m_dlg( aParentDlg ),
338 m_searchStack( aSearchStack ),
339 m_filesStack( aFilesStack )
340 {
342
343 // win32 fix, avoids drawing the "native dropdown caret"
344 Customize( wxCC_IFLAG_HAS_NONSTANDARD_BUTTON );
345
346 // Bind event to handle text changes
347 Bind( wxEVT_TEXT, &TEXT_BUTTON_URL::OnTextChange, this );
348 }
349
351 {
352 Unbind( wxEVT_TEXT, &TEXT_BUTTON_URL::OnTextChange, this );
353
354 m_filesStack.clear(); // we don't own pointers
355 }
356
357 // We don't own any of our raw pointers, so compiler's copy c'tor an operator= are OK.
358
359protected:
360 void DoSetPopupControl( wxComboPopup* popup ) override
361 {
362 m_popup = nullptr;
363 }
364
365 void OnButtonClick() override
366 {
367 m_dlg->PrepareForModalSubDialog();
368
369 wxString filename = GetValue();
370
371 if( filename.IsEmpty() || filename == wxT( "~" ) )
372 {
373 FILEDLG_HOOK_EMBED_FILE customize;
374
375 wxFileDialog openFileDialog( this, _( "Open file" ), "", "", _( "All Files" ) + wxT( " (*.*)|*.*" ),
376 wxFD_OPEN | wxFD_FILE_MUST_EXIST );
377
378 openFileDialog.SetCustomizeHook( customize );
379
380 if( openFileDialog.ShowModal() == wxID_OK )
381 {
382 filename = openFileDialog.GetPath();
383 wxFileName fn( filename );
384
385 if( customize.GetEmbed() )
386 {
387 EMBEDDED_FILES::EMBEDDED_FILE* result = m_filesStack[0]->AddFile( fn, false );
388 SetValue( result->GetLink() );
389 }
390 else
391 {
392 SetValue( "file://" + filename );
393 }
394 }
395 }
396 else
397 {
399 }
400
401 m_dlg->CleanupAfterModalSubDialog();
402 }
403
404 void OnTextChange(wxCommandEvent& event)
405 {
407 event.Skip(); // Ensure that other handlers can process this event too
408 }
409
411 {
412 if( GetValue().IsEmpty() )
413 SetButtonBitmaps( KiBitmapBundle( BITMAPS::small_folder ) );
414 else
415 SetButtonBitmaps( KiBitmapBundle( BITMAPS::www ) );
416 }
417
418protected:
420 SEARCH_STACK* m_searchStack; // No ownership of pointer
421 std::vector<EMBEDDED_FILES*> m_filesStack; // No ownership of pointers
422};
423
424
425void GRID_CELL_URL_EDITOR::Create( wxWindow* aParent, wxWindowID aId, wxEvtHandler* aEventHandler )
426{
427 m_control = new TEXT_BUTTON_URL( aParent, m_dlg, m_searchStack, m_filesStack );
429
430#if wxUSE_VALIDATORS
431 // validate text in textctrl, if validator is set
432 if ( m_validator )
433 Combo()->SetValidator( *m_validator );
434#endif
435
436 wxGridCellEditor::Create( aParent, aId, aEventHandler );
437}
438
439
440class TEXT_BUTTON_FILE_BROWSER : public wxComboCtrl
441{
442public:
443 TEXT_BUTTON_FILE_BROWSER( wxWindow* aParent, DIALOG_SHIM* aParentDlg, WX_GRID* aGrid,
444 wxString* aCurrentDir, const wxString& aFileFilter = wxEmptyString,
445 bool aNormalize = false,
446 const wxString& aNormalizeBasePath = wxEmptyString,
447 std::function<wxString( const wxString& )> aEmbedCallback = nullptr ) :
448 wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 0, 0 ),
449 wxTE_PROCESS_ENTER | wxBORDER_NONE ),
450 m_dlg( aParentDlg ),
451 m_grid( aGrid ),
452 m_currentDir( aCurrentDir ),
453 m_normalize( aNormalize ),
454 m_normalizeBasePath( aNormalizeBasePath ),
455 m_fileFilter( aFileFilter ),
456 m_embedCallback( std::move( aEmbedCallback ) )
457 {
458 SetButtonBitmaps( KiBitmapBundle( BITMAPS::small_folder ) );
459
460 // win32 fix, avoids drawing the "native dropdown caret"
461 Customize( wxCC_IFLAG_HAS_NONSTANDARD_BUTTON );
462 }
463
464 TEXT_BUTTON_FILE_BROWSER( wxWindow* aParent, DIALOG_SHIM* aParentDlg, WX_GRID* aGrid,
465 wxString* aCurrentDir,
466 std::function<wxString( WX_GRID* grid, int row )> aFileFilterFn,
467 bool aNormalize = false,
468 const wxString& aNormalizeBasePath = wxEmptyString,
469 std::function<wxString( const wxString& )> aEmbedCallback = nullptr ) :
470 wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 0, 0 ),
471 wxTE_PROCESS_ENTER | wxBORDER_NONE ),
472 m_dlg( aParentDlg ),
473 m_grid( aGrid ),
474 m_currentDir( aCurrentDir ),
475 m_normalize( aNormalize ),
476 m_normalizeBasePath( aNormalizeBasePath ),
477 m_fileFilterFn( std::move( aFileFilterFn ) ),
478 m_embedCallback( std::move( aEmbedCallback ) )
479 {
480 SetButtonBitmaps( KiBitmapBundle( BITMAPS::small_folder ) );
481
482 // win32 fix, avoids drawing the "native dropdown caret"
483 Customize( wxCC_IFLAG_HAS_NONSTANDARD_BUTTON );
484 }
485
486
487protected:
488 void DoSetPopupControl( wxComboPopup* popup ) override
489 {
490 m_popup = nullptr;
491 }
492
493 void OnButtonClick() override
494 {
495 m_dlg->PrepareForModalSubDialog();
496
497 if( m_fileFilterFn )
498 m_fileFilter = m_fileFilterFn( m_grid, m_grid->GetGridCursorRow() );
499
500 wxFileName fn = GetValue();
501
502 if( fn.GetPath().IsEmpty() && m_currentDir )
503 fn.SetPath( *m_currentDir );
504 else
505 fn.SetPath( ExpandEnvVarSubstitutions( fn.GetPath(), &m_dlg->Prj() ) );
506
507 if( !m_fileFilter.IsEmpty() )
508 {
509 FILEDLG_HOOK_EMBED_FILE customize( false );
510 wxFileDialog dlg( m_dlg, _( "Select a File" ), fn.GetPath(), fn.GetFullName(),
511 m_fileFilter, wxFD_FILE_MUST_EXIST | wxFD_OPEN );
512
513 if( m_embedCallback )
514 dlg.SetCustomizeHook( customize );
515
516 if( dlg.ShowModal() == wxID_OK )
517 {
518 wxString filePath = dlg.GetPath();
519 wxString lastPath = dlg.GetDirectory();
520 wxString relPath = wxEmptyString;
521
522 if( m_embedCallback && customize.GetEmbed() )
523 {
524 relPath = m_embedCallback( filePath );
525
526 if( relPath.IsEmpty() )
527 {
528 m_dlg->CleanupAfterModalSubDialog();
529 return;
530 }
531 }
532 else if( m_normalize )
533 {
534 relPath = NormalizePath( filePath, &Pgm().GetLocalEnvVariables(),
536 lastPath = NormalizePath( dlg.GetDirectory(), &Pgm().GetLocalEnvVariables(),
538 }
539 else
540 {
541 relPath = filePath;
542 }
543
544 SetValue( relPath );
545
546 if( !m_grid->CommitPendingChanges() )
547 {;} // shouldn't happen, but Coverity doesn't know that
548
549 if( m_currentDir )
550 *m_currentDir = lastPath;
551 }
552 }
553 else
554 {
555 wxDirDialog dlg( m_dlg, _( "Select Path" ), fn.GetPath(),
556 wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
557
558 if( dlg.ShowModal() == wxID_OK )
559 {
560 wxString filePath = dlg.GetPath();
561 wxString relPath = wxEmptyString;
562
563 if ( m_normalize )
564 {
565 relPath = NormalizePath( filePath, &Pgm().GetLocalEnvVariables(),
567 }
568 else
569 {
570 relPath = filePath;
571 }
572
573 SetValue( relPath );
574
575 if( !m_grid->CommitPendingChanges() )
576 {;} // shouldn't happen, but Coverity doesn't know that
577
578 *m_currentDir = relPath;
579 }
580 }
581
582 m_dlg->CleanupAfterModalSubDialog();
583 }
584
585protected:
588 wxString* m_currentDir;
591
592 wxString m_fileFilter;
593 std::function<wxString( WX_GRID* aGrid, int aRow )> m_fileFilterFn;
594 std::function<wxString( const wxString& )> m_embedCallback;
595};
596
597
598void GRID_CELL_PATH_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
599 wxEvtHandler* aEventHandler )
600{
601 if( m_fileFilterFn )
602 {
603 m_control = new TEXT_BUTTON_FILE_BROWSER( aParent, m_dlg, m_grid, m_currentDir,
606 }
607 else
608 {
609 m_control = new TEXT_BUTTON_FILE_BROWSER( aParent, m_dlg, m_grid, m_currentDir,
612 }
613
615
616#if wxUSE_VALIDATORS
617 // validate text in textctrl, if validator is set
618 if ( m_validator )
619 Combo()->SetValidator( *m_validator );
620#endif
621
622 wxGridCellEditor::Create( aParent, aId, aEventHandler );
623}
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition bitmap.cpp:110
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition dialog_shim.h:68
void Create(wxWindow *aParent, wxWindowID aId, wxEvtHandler *aEventHandler) override
void Create(wxWindow *aParent, wxWindowID aId, wxEvtHandler *aEventHandler) override
std::function< wxString(WX_GRID *aGrid, int aRow)> m_fileFilterFn
std::function< wxString(const wxString &)> m_embedCallback
void Create(wxWindow *aParent, wxWindowID aId, wxEvtHandler *aEventHandler) override
wxString GetValue() const override
wxComboCtrl * Combo() const
void StartingKey(wxKeyEvent &event) override
void BeginEdit(int aRow, int aCol, wxGrid *aGrid) override
bool EndEdit(int, int, const wxGrid *, const wxString &, wxString *aNewVal) override
void ApplyEdit(int aRow, int aCol, wxGrid *aGrid) override
void SetSize(const wxRect &aRect) override
void Create(wxWindow *aParent, wxWindowID aId, wxEvtHandler *aEventHandler) override
std::vector< EMBEDDED_FILES * > m_filesStack
Carry a payload from one KIWAY_PLAYER to another within a PROJECT.
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
Look for files in a number of paths.
void DoSetPopupControl(wxComboPopup *popup) override
std::function< wxString(const wxString &)> m_embedCallback
TEXT_BUTTON_FILE_BROWSER(wxWindow *aParent, DIALOG_SHIM *aParentDlg, WX_GRID *aGrid, wxString *aCurrentDir, const wxString &aFileFilter=wxEmptyString, bool aNormalize=false, const wxString &aNormalizeBasePath=wxEmptyString, std::function< wxString(const wxString &)> aEmbedCallback=nullptr)
TEXT_BUTTON_FILE_BROWSER(wxWindow *aParent, DIALOG_SHIM *aParentDlg, WX_GRID *aGrid, wxString *aCurrentDir, std::function< wxString(WX_GRID *grid, int row)> aFileFilterFn, bool aNormalize=false, const wxString &aNormalizeBasePath=wxEmptyString, std::function< wxString(const wxString &)> aEmbedCallback=nullptr)
std::function< wxString(WX_GRID *aGrid, int aRow)> m_fileFilterFn
void DoSetPopupControl(wxComboPopup *popup) override
TEXT_BUTTON_FP_CHOOSER(wxWindow *aParent, DIALOG_SHIM *aParentDlg, const wxString &aSymbolNetlist, const wxString &aPreselect)
void DoSetPopupControl(wxComboPopup *popup) override
wxString escapeLibId(const wxString &aRawValue)
TEXT_BUTTON_SYMBOL_CHOOSER(wxWindow *aParent, DIALOG_SHIM *aParentDlg, const wxString &aPreselect)
std::vector< EMBEDDED_FILES * > m_filesStack
TEXT_BUTTON_URL(wxWindow *aParent, DIALOG_SHIM *aParentDlg, SEARCH_STACK *aSearchStack, std::vector< EMBEDDED_FILES * > aFilesStack)
void DoSetPopupControl(wxComboPopup *popup) override
void OnTextChange(wxCommandEvent &event)
static void CellEditorSetMargins(wxTextEntryBase *aEntry)
A helper function to set OS-specific margins for text-based cell editors.
Definition wx_grid.cpp:77
static void CellEditorTransformSizeRect(wxRect &aRect)
A helper function to tweak sizes of text-based cell editors depending on OS.
Definition wx_grid.cpp:84
const wxString ExpandEnvVarSubstitutions(const wxString &aString, const PROJECT *aProject)
Replace any environment variable & text variable references with their values.
Definition common.cpp:355
The common library.
#define _(s)
bool GetAssociatedDocument(wxWindow *aParent, const wxString &aDocName, PROJECT *aProject, SEARCH_STACK *aPaths, std::vector< EMBEDDED_FILES * > aFilesStack)
Open a document (file) with the suitable browser.
Definition eda_doc.cpp:62
This file is part of the common library.
wxString NormalizePath(const wxFileName &aFilePath, const ENV_VAR_MAP *aEnvVars, const wxString &aProjectPath)
Normalize a file path to an environmental variable, if possible.
Definition env_paths.cpp:73
Helper functions to substitute paths with environmental variables.
@ FRAME_FOOTPRINT_CHOOSER
Definition frame_type.h:44
@ FRAME_SYMBOL_CHOOSER
Definition frame_type.h:37
@ MAIL_SYMBOL_NETLIST
Definition mail_type.h:45
STL namespace.
PGM_BASE & Pgm()
The global program "get" accessor.
Definition pgm_base.cpp:913
see class PGM_BASE
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_LIBID
wxString result
Test unit parsing edge cases and error handling.