KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_board_setup.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * 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, see <https://www.gnu.org/licenses/>.
18 */
19#include <jobs/scratch_doc.h>
20#include <pcb_edit_frame.h>
21#include <panel_setup_layers.h>
30#include <confirm.h>
32#include <widgets/wx_infobar.h>
33#include <kiface_base.h>
34#include <drc/drc_item.h>
36#include <pcb_io/pcb_io.h>
37#include <pcb_io/pcb_io_mgr.h>
48#include <project.h>
55
56#include "dialog_board_setup.h"
57
58#include <advanced_config.h>
59#include <dialog_board_setup.h>
60#include <footprint.h>
61
62
63#define RESOLVE_PAGE( T, pageIndex ) static_cast<T*>( m_treebook->ResolvePage( pageIndex ) )
64
65DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame, wxWindow* aParentWindow ) :
66 PAGED_DIALOG( aParentWindow ? aParentWindow : aFrame, _( "Board Setup" ), false, false,
67 _( "Import Settings from Another Board..." ), wxSize( 980, 600 ) ),
68 m_frame( aFrame ),
69 m_layers( nullptr ),
70 m_boardFinish( nullptr ),
71 m_physicalStackup( nullptr ),
72 m_zones( nullptr ),
73 m_tuningProfiles( nullptr ),
74 m_netClasses( nullptr ),
75 m_currentPage( 0 ),
76 m_layersPage( 0 ),
79 m_defaultsPage( 0 ),
84 m_viaStacksPage( 0 ),
85 m_teardropsPage( 0 ),
91 m_initComplete( false )
92{
93 SetEvtHandlerEnabled( false );
94
95 /*
96 * WARNING: If you change page names you MUST update calls to ShowBoardSetupDialog().
97 */
98
99 m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Board Stackup" ) );
100
101 /*
102 * WARNING: Code currently relies on the layers setup coming before the physical stackup panel,
103 * and thus transferring data to the board first. See comment in
104 * PANEL_SETUP_BOARD_STACKUP::TransferDataFromWindow and rework this logic if it is determined
105 * that the order of these pages should be changed.
106 */
107 m_layersPage = m_treebook->GetPageCount();
108 m_treebook->AddLazySubPage(
109 [this]( wxWindow* aParent ) -> wxWindow*
110 {
111 return new PANEL_SETUP_LAYERS( aParent, m_frame );
112 }, _( "Board Editor Layers" ) );
113
114 m_physicalStackupPage = m_treebook->GetPageCount();
115 m_treebook->AddLazySubPage(
116 [this]( wxWindow* aParent ) -> wxWindow*
117 {
121 }, _( "Physical Stackup" ) );
122
123 m_boardFinishPage = m_treebook->GetPageCount();
124 m_treebook->AddLazySubPage(
125 [this]( wxWindow* aParent ) -> wxWindow*
126 {
127 return new PANEL_SETUP_BOARD_FINISH( aParent, m_frame );
128 }, _( "Board Finish" ) );
129
130 m_maskAndPastePage = m_treebook->GetPageCount();
131 m_treebook->AddLazySubPage(
132 [this]( wxWindow* aParent ) -> wxWindow*
133 {
134 return new PANEL_SETUP_MASK_AND_PASTE( aParent, m_frame );
135 }, _( "Solder Mask/Paste" ) );
136
137 m_drillChartPage = m_treebook->GetPageCount();
138 m_treebook->AddLazySubPage(
139 [this]( wxWindow* aParent ) -> wxWindow*
140 {
141 return new PANEL_SETUP_DRILL_CHART( aParent, m_frame );
142 }, _( "Drill Chart" ) );
143
144 m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Text & Graphics" ) );
145
146 m_defaultsPage = m_treebook->GetPageCount();
147 m_treebook->AddLazySubPage(
148 [this]( wxWindow* aParent ) -> wxWindow*
149 {
150 return new PANEL_SETUP_DEFAULTS( aParent, m_frame );
151 }, _( "Defaults" ) );
152
153 m_formattingPage = m_treebook->GetPageCount();
154 m_treebook->AddLazySubPage(
155 [this]( wxWindow* aParent ) -> wxWindow*
156 {
157 return new PANEL_SETUP_FORMATTING( aParent, m_frame );
158 }, _( "Formatting" ) );
159
160 m_treebook->AddLazySubPage(
161 [this]( wxWindow* aParent ) -> wxWindow*
162 {
163 return new PANEL_TEXT_VARIABLES( aParent, &Prj() );
164 }, _( "Text Variables" ) );
165
166 m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Design Rules" ) );
167
168 m_constraintsPage = m_treebook->GetPageCount();
169 m_treebook->AddLazySubPage(
170 [this]( wxWindow* aParent ) -> wxWindow*
171 {
172 return new PANEL_SETUP_CONSTRAINTS( aParent, m_frame );
173 }, _( "Constraints" ) );
174
175 m_tracksAndViasPage = m_treebook->GetPageCount();
176 m_treebook->AddLazySubPage(
177 [this]( wxWindow* aParent ) -> wxWindow*
178 {
179 return new PANEL_SETUP_TRACKS_AND_VIAS( aParent, m_frame );
180 }, _( "Pre-defined Sizes" ) );
181
182 m_viaStacksPage = m_treebook->GetPageCount();
183 m_treebook->AddLazySubPage(
184 [this]( wxWindow* aParent ) -> wxWindow*
185 {
186 return new PANEL_SETUP_VIA_STACKS( aParent, m_frame );
187 },
188 _( "Microvia Stacks" ) );
189
190 m_zonesPage = m_treebook->GetPageCount();
191 m_treebook->AddLazySubPage(
192 [this]( wxWindow* aParent ) -> wxWindow*
193 {
194 return new PANEL_SETUP_ZONES( aParent, m_frame, m_frame->GetBoard()->GetDesignSettings() );
195 },
196 _( "Zones" ) );
197
198 m_teardropsPage = m_treebook->GetPageCount();
199 m_treebook->AddLazySubPage(
200 [this]( wxWindow* aParent ) -> wxWindow*
201 {
202 return new PANEL_SETUP_TEARDROPS( aParent, m_frame );
203 }, _( "Teardrops" ) );
204
205 m_tuningPatternsPage = m_treebook->GetPageCount();
206 m_treebook->AddLazySubPage(
207 [this]( wxWindow* aParent ) -> wxWindow*
208 {
209 BOARD_DESIGN_SETTINGS& bds = m_frame->GetBoard()->GetDesignSettings();
210
211 return new PANEL_SETUP_TUNING_PATTERNS( aParent, m_frame,
215 }, _( "Length-tuning Patterns" ) );
216
217 m_tuningProfilesPage = m_treebook->GetPageCount();
218 m_treebook->AddLazySubPage(
219 [this]( wxWindow* aParent ) -> wxWindow*
220 {
221 BOARD* board = m_frame->GetBoard();
222 return new PANEL_SETUP_TUNING_PROFILES( aParent, m_frame, board,
223 m_frame->Prj().GetProjectFile().TuningProfileParameters() );
224 },
225 _( "Tuning Profiles" ) );
226
227 m_netclassesPage = m_treebook->GetPageCount();
228 m_treebook->AddLazySubPage(
229 [this]( wxWindow* aParent ) -> wxWindow*
230 {
231 BOARD* board = m_frame->GetBoard();
232 return new PANEL_SETUP_NETCLASSES( aParent, m_frame,
233 m_frame->Prj().GetProjectFile().NetSettings(),
235 false );
236 }, _( "Net Classes" ) );
237
238 m_componentClassesPage = m_treebook->GetPageCount();
239 m_treebook->AddLazySubPage(
240 [this]( wxWindow* aParent ) -> wxWindow*
241 {
242 // Construct the panel
244 aParent, m_frame, m_frame->Prj().GetProjectFile().ComponentClassSettings(),
245 this );
246 },
247 _( "Component Classes" ) );
248
249 m_customRulesPage = m_treebook->GetPageCount();
250 m_treebook->AddLazySubPage(
251 [this]( wxWindow* aParent ) -> wxWindow*
252 {
253 return new PANEL_SETUP_RULES( aParent, m_frame );
254 },
255 _( "Custom Rules" ) );
256
257 m_severitiesPage = m_treebook->GetPageCount();
258 m_treebook->AddLazySubPage(
259 [this]( wxWindow* aParent ) -> wxWindow*
260 {
261 BOARD* board = m_frame->GetBoard();
264 },
265 _( "Violation Severity" ) );
266
267 m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Board Data" ) );
268 m_embeddedFilesPage = m_treebook->GetPageCount();
269 m_treebook->AddLazySubPage(
270 [this]( wxWindow* aParent ) -> wxWindow*
271 {
272 BOARD* board = m_frame->GetBoard();
273
274 std::vector<EMBEDDED_FILES*> inheritedFiles;
275
276 for( FOOTPRINT* fp : board->Footprints() )
277 inheritedFiles.push_back( fp->GetEmbeddedFiles() );
278
279 return new PANEL_EMBEDDED_FILES( aParent, board->GetEmbeddedFiles(), NO_MARGINS, inheritedFiles );
280 },
281 _( "Embedded Files" ) );
282
283 m_initComplete = true;
284
285 for( size_t i = 0; i < m_treebook->GetPageCount(); ++i )
286 m_treebook->ExpandNode( i );
287
288 SetEvtHandlerEnabled( true );
289
290 // Bound after DIALOG_SHIM's handlers so these run first
291 Bind( wxEVT_BUTTON, &DIALOG_BOARD_SETUP::onCancelButton, this, wxID_CANCEL );
292 Bind( wxEVT_CLOSE_WINDOW, &DIALOG_BOARD_SETUP::onCloseWindow, this );
293
295
296 if( Prj().IsReadOnly() )
297 {
298 m_infoBar->ShowMessage( _( "Project is missing or read-only. Some settings will not be editable." ),
299 wxICON_WARNING );
300 }
301
302 wxBookCtrlEvent evt( wxEVT_TREEBOOK_PAGE_CHANGED, wxID_ANY, 0 );
303
304 wxQueueEvent( m_treebook, evt.Clone() );
305}
306
307
309{
310 Unbind( wxEVT_BUTTON, &DIALOG_BOARD_SETUP::onCancelButton, this, wxID_CANCEL );
311 Unbind( wxEVT_CLOSE_WINDOW, &DIALOG_BOARD_SETUP::onCloseWindow, this );
312}
313
314
316{
317 auto* rules = static_cast<PANEL_SETUP_RULES*>( m_treebook->GetResolvedPage( m_customRulesPage ) );
318
319 if( !rules || !rules->IsModified() )
320 return true;
321
322 return OKOrCancelDialog( this, _( "Confirmation" ), _( "Discard changes to custom rules?" ), wxEmptyString,
323 _( "Discard Changes" ) ) == wxID_OK;
324}
325
326
327void DIALOG_BOARD_SETUP::onCancelButton( wxCommandEvent& aEvent )
328{
329 if( canDiscardChanges() )
330 aEvent.Skip();
331}
332
333
334void DIALOG_BOARD_SETUP::onCloseWindow( wxCloseEvent& aEvent )
335{
336 if( aEvent.CanVeto() && !canDiscardChanges() )
337 {
338 aEvent.Veto();
339 return;
340 }
341
342 aEvent.Skip();
343}
344
345
346void DIALOG_BOARD_SETUP::onPageChanging( wxBookCtrlEvent& aEvent )
347{
348 // Rules are written to disk only on OK so Cancel can still discard them
349 if( aEvent.GetOldSelection() == (int) m_customRulesPage )
350 return;
351
353}
354
355
357{
359 return false;
360
361 // References to renamed profiles can only be fixed up after all pages have saved
362 auto* tuningProfiles =
363 static_cast<PANEL_SETUP_TUNING_PROFILES*>( m_treebook->GetResolvedPage( m_tuningProfilesPage ) );
364
365 if( tuningProfiles )
366 {
367 const std::map<wxString, wxString> renames = tuningProfiles->TakeProfileRenames();
368
369 if( !renames.empty() )
370 {
371 std::shared_ptr<NET_SETTINGS>& netSettings = m_frame->Prj().GetProjectFile().NetSettings();
372
373 auto remapProfile = [&renames]( const std::shared_ptr<NETCLASS>& aNetclass )
374 {
375 auto it = renames.find( aNetclass->GetTuningProfile() );
376
377 if( it != renames.end() )
378 aNetclass->SetTuningProfile( it->second );
379 };
380
381 remapProfile( netSettings->GetDefaultNetclass() );
382
383 for( const auto& [name, netclass] : netSettings->GetNetclasses() )
384 remapProfile( netclass );
385
386 netSettings->ClearAllCaches();
387 }
388 }
389
390 return true;
391}
392
393
394void DIALOG_BOARD_SETUP::onPageChanged( wxBookCtrlEvent& aEvent )
395{
397
398 size_t page = aEvent.GetSelection();
399
400 if( m_initComplete )
401 {
403 || page == m_tuningProfilesPage || page == m_zonesPage )
404 {
410 }
411
412 // Ensure layer page always gets updated even if we aren't moving towards it
414 {
415 m_layers->SyncCopperLayers( m_physicalStackup->GetCopperLayerCount() );
416
417 // Avoid calling SyncCopperLayers twice if moving from stackup to tuning profiles directly
418 m_tuningProfiles->SyncCopperLayers( m_physicalStackup->GetCopperLayerCount() );
419 }
420
421 if( page == m_physicalStackupPage )
422 {
423 m_physicalStackup->OnLayersOptionsChanged( m_layers->GetUILayerMask() );
424 }
426 {
427 m_netClasses->RemapDelayProfileNames( m_tuningProfiles->TakeProfileRenames() );
428 m_netClasses->UpdateDelayProfileNames( m_tuningProfiles->GetDelayProfileNames() );
429 }
430 else if( page == m_tuningProfilesPage )
431 {
432 m_tuningProfiles->SyncCopperLayers( m_physicalStackup->GetCopperLayerCount() );
433 }
434 else if( page == m_zonesPage )
435 {
436 m_zones->SyncCopperLayers( m_physicalStackup->GetCopperLayerCount() );
437 }
438
439 if( Prj().IsReadOnly() )
440 {
441 KIUI::Disable( m_treebook->GetPage( page ) );
442 }
443 }
444
445 m_currentPage = page;
446}
447
448
449void DIALOG_BOARD_SETUP::onAuxiliaryAction( wxCommandEvent& aEvent )
450{
451 DIALOG_IMPORT_SETTINGS importDlg( this, m_frame );
452
453 if( importDlg.ShowModal() == wxID_CANCEL )
454 return;
455
456 wxFileName boardFn( importDlg.GetFilePath() );
457
458 SCRATCH_PROJECT scratch( *m_frame->GetSettingsManager(), boardFn.GetFullPath(),
459 /*aRequireProjectFile=*/true );
460
461 if( !scratch.IsValid() )
462 {
463 wxFileName projectFn( boardFn );
464 projectFn.SetExt( FILEEXT::ProjectFileExtension );
465
466 wxString msg = wxString::Format( _( "Error importing settings from board:\n"
467 "Associated project file %s could not be loaded" ),
468 projectFn.GetFullPath() );
469 DisplayErrorMessage( this, msg );
470
471 return;
472 }
473
474 PROJECT* otherPrj = scratch.GetProject();
475
479
480 // Flag so user can stop work if it will result in deleted inner copper layers
481 // and still clean up this function properly.
482 bool okToProceed = true;
483
485 std::unique_ptr<BOARD> otherBoard;
486
487 try
488 {
489 WX_PROGRESS_REPORTER progressReporter( this, _( "Load PCB" ), 1, PR_CAN_ABORT );
490
491 pi->SetProgressReporter( &progressReporter );
492
493 otherBoard = pi->LoadBoard( boardFn.GetFullPath() );
494
495 if( importDlg.m_LayersOpt->GetValue() )
496 {
497 BOARD* loadedBoard = m_frame->GetBoard();
498
499 // Check if "Import Settings" board has more layers than the current board.
500 okToProceed = m_layers->CheckCopperLayerCount( loadedBoard, otherBoard.get() );
501 }
502 }
503 catch( const IO_CANCELLED& )
504 {
505 // A user-cancelled load is not an error.
506 return;
507 }
508 catch( const IO_ERROR& ioe )
509 {
510 // You wouldn't think boardFn.GetFullPath() would throw, but we get a stack buffer
511 // underflow from ASAN. While it's probably an ASAN error, a second try/catch doesn't
512 // cost us much.
513 try
514 {
515 wxString msg = wxString::Format( _( "Error loading board file:\n%s" ), boardFn.GetFullPath() );
516 DisplayErrorMessage( this, msg, ioe.What() );
517 }
518 catch(...)
519 {
520 // That was already our best-efforts
521 }
522
523 return;
524 }
525
526 if( okToProceed )
527 {
528 BOARD* other = otherBoard.get();
529
530 other->SetProject( otherPrj );
531
532 // Always ClearProject before destruction, even if a later
533 // ImportSettingsFrom throws. Skipping clear when otherPrj is the
534 // active project preserves the live editor's BoardSettings.
535 const bool activeProject = ( otherPrj == &m_frame->Prj() );
536
537 struct BOARD_DETACH_GUARD
538 {
539 BOARD* board;
540 bool skip;
541 ~BOARD_DETACH_GUARD() { if( board && !skip ) board->ClearProject(); }
542 } detachGuard{ other, activeProject };
543
544 // If layers options are imported, import also the stackup
545 // layers options and stackup are linked, so they cannot be imported
546 // separately, and stackup can be imported only after layers options
547 if( importDlg.m_LayersOpt->GetValue() )
548 {
549 m_physicalStackup->ImportSettingsFrom( other );
550 m_layers->ImportSettingsFrom( other );
551 m_boardFinish->ImportSettingsFrom( other );
552 }
553
554 if( importDlg.m_TextAndGraphicsOpt->GetValue() )
555 RESOLVE_PAGE( PANEL_SETUP_DEFAULTS, m_defaultsPage )->ImportSettingsFrom( other );
556
557 if( importDlg.m_FormattingOpt->GetValue() )
558 RESOLVE_PAGE( PANEL_SETUP_FORMATTING, m_formattingPage )->ImportSettingsFrom( other );
559
560 if( importDlg.m_ConstraintsOpt->GetValue() )
561 RESOLVE_PAGE( PANEL_SETUP_CONSTRAINTS, m_constraintsPage )->ImportSettingsFrom( other );
562
563 if( importDlg.m_NetclassesOpt->GetValue() )
564 {
565 PROJECT_FILE& otherProjectFile = otherPrj->GetProjectFile();
566
568 m_netclassesPage )->ImportSettingsFrom( otherProjectFile.m_NetSettings );
569 }
570
571 if( importDlg.m_ComponentClassesOpt->GetValue() )
572 {
573 PROJECT_FILE& otherProjectFile = otherPrj->GetProjectFile();
574
576 m_componentClassesPage )->ImportSettingsFrom( otherProjectFile.m_ComponentClassSettings );
577 }
578
579 if( importDlg.m_TracksAndViasOpt->GetValue() )
580 {
581 RESOLVE_PAGE( PANEL_SETUP_TRACKS_AND_VIAS, m_tracksAndViasPage )->ImportSettingsFrom( other );
582 RESOLVE_PAGE( PANEL_SETUP_VIA_STACKS, m_viaStacksPage )->ImportSettingsFrom( other );
583 }
584
585 if( importDlg.m_ZonesOpt->GetValue() )
586 RESOLVE_PAGE( PANEL_SETUP_ZONES, m_zonesPage )->ImportSettingsFrom( other );
587
588 if( importDlg.m_TeardropsOpt->GetValue() )
589 RESOLVE_PAGE( PANEL_SETUP_TEARDROPS, m_teardropsPage )->ImportSettingsFrom( other );
590
591 if( importDlg.m_TuningPatternsOpt->GetValue() )
592 RESOLVE_PAGE( PANEL_SETUP_TUNING_PATTERNS, m_tuningPatternsPage )->ImportSettingsFrom( other );
593
594 if( importDlg.m_MaskAndPasteOpt->GetValue() )
595 RESOLVE_PAGE( PANEL_SETUP_MASK_AND_PASTE, m_maskAndPastePage )->ImportSettingsFrom( other );
596
597 if( importDlg.m_ZoneHatchingOffsetsOpt->GetValue() )
598 RESOLVE_PAGE( PANEL_SETUP_ZONES, m_zonesPage )->ImportHatchOffsetsFrom( other );
599
600 if( importDlg.m_CustomRulesOpt->GetValue() )
601 RESOLVE_PAGE( PANEL_SETUP_RULES, m_customRulesPage )->ImportSettingsFrom( other );
602
603 if( importDlg.m_SeveritiesOpt->GetValue() )
604 {
605 BOARD_DESIGN_SETTINGS& otherSettings = other->GetDesignSettings();
606
608 m_severitiesPage )->ImportSettingsFrom( otherSettings.m_DRCSeverities );
609 }
610
611 if( importDlg.m_TuningProfilesOpt->GetValue() )
612 {
613 PROJECT_FILE& otherProjectFile = otherPrj->GetProjectFile();
614
616 m_tuningProfilesPage )->ImportSettingsFrom( otherProjectFile.TuningProfileParameters() );
617 }
618
619 }
620}
const char * name
Container for design settings for a BOARD object.
std::map< int, SEVERITY > m_DRCSeverities
PNS::MEANDER_SETTINGS m_DiffPairMeanderSettings
PNS::MEANDER_SETTINGS m_SingleTrackMeanderSettings
PNS::MEANDER_SETTINGS m_SkewMeanderSettings
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:411
EMBEDDED_FILES * GetEmbeddedFiles() override
Definition board.cpp:3662
std::set< wxString > GetNetClassAssignmentCandidates() const
Return the set of netname candidates for netclass assignment.
Definition board.cpp:2935
const FOOTPRINTS & Footprints() const
Definition board.h:465
void SetProject(PROJECT *aProject, bool aReferenceOnly=false)
Link a board to a given project.
Definition board.cpp:379
void ClearProject()
Definition board.cpp:420
BOARD_DESIGN_SETTINGS & GetDesignSettings()
Definition board.cpp:1290
DIALOG_BOARD_SETUP(PCB_EDIT_FRAME *aFrame, wxWindow *aWindow=nullptr)
PCB_EDIT_FRAME * m_frame
void onCancelButton(wxCommandEvent &aEvent)
void onPageChanging(wxBookCtrlEvent &aEvent) override
PANEL_SETUP_TUNING_PROFILES * m_tuningProfiles
void onAuxiliaryAction(wxCommandEvent &aEvent) override
PANEL_SETUP_BOARD_STACKUP * m_physicalStackup
PANEL_SETUP_ZONES * m_zones
PANEL_SETUP_BOARD_FINISH * m_boardFinish
PANEL_SETUP_LAYERS * m_layers
bool TransferDataFromWindow() override
void onPageChanged(wxBookCtrlEvent &aEvent) override
PANEL_SETUP_NETCLASSES * m_netClasses
void onCloseWindow(wxCloseEvent &aEvent)
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
int ShowModal() override
static std::vector< std::reference_wrapper< RC_ITEM > > GetItemsWithSeverities()
Definition drc_item.h:172
An exception saying that the user cancelled an interactive part of a load, import,...
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
WX_TREEBOOK * GetTreebook()
WX_INFOBAR * m_infoBar
PAGED_DIALOG(wxWindow *aParent, const wxString &aTitle, bool aShowReset, bool aShowOpenFolder, const wxString &aAuxiliaryAction=wxEmptyString, const wxSize &aInitialSize=wxDefaultSize)
bool TransferDataFromWindow() override
virtual void onPageChanging(wxBookCtrlEvent &aEvent)
WX_TREEBOOK * m_treebook
virtual void onPageChanged(wxBookCtrlEvent &aEvent)
Board-wide drill chart and map setup.
The main frame for Pcbnew.
@ KICAD_SEXP
S-expression Pcbnew file format.
Definition pcb_io_mgr.h:54
static PCB_IO * FindPlugin(PCB_FILE_T aFileType)
Return a PCB_IO which the caller can use to import, export, save, or load design documents.
The backing store for a PROJECT, in JSON format.
std::shared_ptr< NET_SETTINGS > m_NetSettings
Net settings for this project (owned here)
std::shared_ptr< TUNING_PROFILES > & TuningProfileParameters()
std::shared_ptr< COMPONENT_CLASS_SETTINGS > m_ComponentClassSettings
Component class settings for the project (owned here)
Container for project specific data.
Definition project.h:63
virtual PROJECT_FILE & GetProjectFile() const
Definition project.h:201
Move-only RAII wrapper for "load a foreign PROJECT non-active and unload it on scope exit.
Definition scratch_doc.h:56
bool IsValid() const
True iff the project loaded (or was already loaded).
PROJECT * GetProject() const
Multi-thread safe progress reporter dialog, intended for use of tasks that parallel reporting back of...
int OKOrCancelDialog(wxWindow *aParent, const wxString &aWarning, const wxString &aMessage, const wxString &aDetailedMessage, const wxString &aOKLabel, const wxString &aCancelLabel, bool *aApplyToAll)
Display a warning dialog with aMessage and returns the user response.
Definition confirm.cpp:165
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition confirm.cpp:217
This file is part of the common library.
#define RESOLVE_PAGE(T, pageIndex)
#define _(s)
static const std::string ProjectFileExtension
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
Definition io_mgr.h:33
KICOMMON_API void Disable(wxWindow *aWindow)
Makes a window read-only.
#define NO_MARGINS
Definition of file extensions used in Kicad.
#define PR_CAN_ABORT