KiCad PCB EDA Suite
Loading...
Searching...
No Matches
paged_dialog.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
20#include <confirm.h>
22#include <widgets/wx_infobar.h>
23#include <widgets/wx_panel.h>
25#include <widgets/wx_treebook.h>
26#include <widgets/ui_common.h>
27
28#include <wx/button.h>
29#include <wx/display.h>
30#include <wx/grid.h>
31#include <wx/sizer.h>
32#include <wx/treebook.h>
33#include <wx/treectrl.h>
34#include <wx/listctrl.h>
35#include <wx/stc/stc.h>
36
37#include <paths.h>
38
39#include <launch_ext.h>
40
41#include <algorithm>
42
43// Maps from dialogTitle <-> pageTitle for keeping track of last-selected pages.
44// This is not a simple page index because some dialogs have dynamic page sets.
45std::map<wxString, wxString> g_lastPage;
46std::map<wxString, wxString> g_lastParentPage;
47
48
49PAGED_DIALOG::PAGED_DIALOG( wxWindow* aParent, const wxString& aTitle, bool aShowReset,
50 bool aShowOpenFolder, const wxString& aAuxiliaryAction,
51 const wxSize& aInitialSize ) :
52 DIALOG_SHIM( aParent, wxID_ANY, aTitle, wxDefaultPosition, aInitialSize,
53 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ),
54 m_auxiliaryButton( nullptr ),
55 m_resetButton( nullptr ),
56 m_openPrefsDirButton( nullptr ),
57 m_title( aTitle )
58{
59 wxBoxSizer* mainSizer = new wxBoxSizer( wxVERTICAL );
60 SetSizer( mainSizer );
61
62 m_infoBar = new WX_INFOBAR( this );
63 mainSizer->Add( m_infoBar, 0, wxEXPAND, 0 );
64
65 WX_PANEL* treebookPanel = new WX_PANEL( this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
66 wxBORDER_NONE | wxTAB_TRAVERSAL );
67 treebookPanel->SetBorders( false, false, false, true );
68 wxBoxSizer* treebookSizer = new wxBoxSizer( wxVERTICAL );
69 treebookPanel->SetSizer( treebookSizer );
70
71 m_treebook = new WX_TREEBOOK( treebookPanel, wxID_ANY );
72 m_treebook->SetFont( KIUI::GetControlFont( this ) );
73 m_treebook->SetFitToCurrentPage( true );
74
75 long treeCtrlFlags = m_treebook->GetTreeCtrl()->GetWindowStyleFlag();
76 treeCtrlFlags = ( treeCtrlFlags & ~wxBORDER_MASK ) | wxBORDER_NONE;
77 m_treebook->GetTreeCtrl()->SetWindowStyleFlag( treeCtrlFlags );
78
79 treebookSizer->Add( m_treebook, 1, wxEXPAND|wxBOTTOM, 2 );
80 mainSizer->Add( treebookPanel, 1, wxEXPAND, 0 );
81
82 m_buttonsSizer = new wxBoxSizer( wxHORIZONTAL );
83
84 if( aShowReset )
85 {
86 m_resetButton = new wxButton( this, wxID_ANY, _( "Reset to Defaults" ) );
87 m_buttonsSizer->Add( m_resetButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
88 }
89
90 if( aShowOpenFolder )
91 {
92#ifdef __WXMAC__
93 m_openPrefsDirButton = new wxButton( this, wxID_ANY, _( "Reveal Preferences in Finder" ) );
94#else
95 m_openPrefsDirButton = new wxButton( this, wxID_ANY, _( "Open Preferences Directory" ) );
96#endif
98 wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
99 }
100
101 if( !aAuxiliaryAction.IsEmpty() )
102 {
103 m_auxiliaryButton = new wxButton( this, wxID_ANY, aAuxiliaryAction );
104 m_buttonsSizer->Add( m_auxiliaryButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
105 }
106
107 m_buttonsSizer->AddStretchSpacer();
108
109 wxStdDialogButtonSizer* sdbSizer = new wxStdDialogButtonSizer();
110 wxButton* sdbSizerOK = new wxButton( this, wxID_OK );
111 sdbSizer->AddButton( sdbSizerOK );
112 wxButton* sdbSizerCancel = new wxButton( this, wxID_CANCEL );
113 sdbSizer->AddButton( sdbSizerCancel );
114 sdbSizer->Realize();
115
116 m_buttonsSizer->Add( sdbSizer, 1, 0, 5 );
117 mainSizer->Add( m_buttonsSizer, 0, wxALL|wxEXPAND, 5 );
118
120
121 // We normally save the dialog size and position based on its class-name. This class
122 // substitutes the title so that each distinctly-titled dialog can have its own saved
123 // size and position.
124 m_hash_key = aTitle;
125
127 m_auxiliaryButton->Bind( wxEVT_COMMAND_BUTTON_CLICKED, &PAGED_DIALOG::onAuxiliaryAction, this );
128
129 if( m_resetButton )
130 m_resetButton->Bind( wxEVT_COMMAND_BUTTON_CLICKED, &PAGED_DIALOG::onResetButton, this );
131
133 m_openPrefsDirButton->Bind( wxEVT_COMMAND_BUTTON_CLICKED, &PAGED_DIALOG::onOpenPrefsDir, this );
134
135 m_treebook->Bind( wxEVT_CHAR_HOOK, &PAGED_DIALOG::onCharHook, this );
136 m_treebook->Bind( wxEVT_TREEBOOK_PAGE_CHANGED, &PAGED_DIALOG::onPageChanged, this );
137 m_treebook->Bind( wxEVT_TREEBOOK_PAGE_CHANGING, &PAGED_DIALOG::onPageChanging, this );
138 m_treebook->GetTreeCtrl()->Bind( wxEVT_LEFT_DOWN, &PAGED_DIALOG::onTreeLeftDown, this );
139 m_treebook->GetTreeCtrl()->Bind( wxEVT_TREE_ITEM_ACTIVATED, &PAGED_DIALOG::onTreeItemActivated, this );
140}
141
142
144{
145 for( size_t i = 1; i < m_treebook->GetPageCount(); ++i )
146 m_macHack.push_back( true );
147
148 // For some reason adding page labels to the treeCtrl doesn't invalidate its bestSize
149 // cache so we have to do it by hand
150 m_treebook->GetTreeCtrl()->InvalidateBestSize();
151
152 for( size_t i = 0; i < m_treebook->GetPageCount(); ++i )
153 m_treebook->GetPage( i )->Layout();
154
155 m_treebook->Layout();
156 m_treebook->Fit();
157
158 // Add a bit of width to the treeCtrl for scrollbars
159 wxSize ctrlSize = m_treebook->GetTreeCtrl()->GetSize();
160 ctrlSize.x += 20;
161 m_treebook->GetTreeCtrl()->SetMinSize( ctrlSize );
162 m_treebook->Layout();
163
164 // Note: do NOT call finishDialogSettings() here. At this point the lazy pages have not
165 // yet been resolved, so the sizer minimum is computed from empty placeholder pages.
166 // On GTK+X11, finishDialogSettings() stores a "resize to sizer minimum" operation that
167 // is deferred until the window is realized by the window manager. If that deferred
168 // operation fires after onPageChanged() has already grown the dialog to fit the real
169 // page content, it shrinks the dialog back to the placeholder minimum, cutting off the
170 // bottom of the page. The dialog minimum and size are correctly established by
171 // onPageChanged() once the selected page is resolved.
172}
173
174
175void PAGED_DIALOG::SetInitialPage( const wxString& aPage, const wxString& aParentPage )
176{
177 g_lastPage[ m_title ] = aPage;
178 g_lastParentPage[ m_title ] = aParentPage;
179}
180
181
183{
184 // Store the current parentPageTitle/pageTitle hierarchy so we can re-select it
185 // next time.
186 wxString lastPage = wxEmptyString;
187 wxString lastParentPage = wxEmptyString;
188
189 int selected = m_treebook->GetSelection();
190
191 if( selected != wxNOT_FOUND )
192 {
193 lastPage = m_treebook->GetPageText( (unsigned) selected );
194
195 int parent = m_treebook->GetPageParent( (unsigned) selected );
196
197 if( parent != wxNOT_FOUND )
198 lastParentPage = m_treebook->GetPageText( (unsigned) parent );
199 }
200
201 g_lastPage[ m_title ] = lastPage;
202 g_lastParentPage[ m_title ] = lastParentPage;
203
205 m_auxiliaryButton->Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &PAGED_DIALOG::onAuxiliaryAction, this );
206
207 if( m_resetButton )
208 m_resetButton->Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &PAGED_DIALOG::onResetButton, this );
209
211 m_openPrefsDirButton->Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &PAGED_DIALOG::onOpenPrefsDir, this );
212
213 m_treebook->Unbind( wxEVT_CHAR_HOOK, &PAGED_DIALOG::onCharHook, this );
214 m_treebook->Unbind( wxEVT_TREEBOOK_PAGE_CHANGED, &PAGED_DIALOG::onPageChanged, this );
215 m_treebook->Unbind( wxEVT_TREEBOOK_PAGE_CHANGING, &PAGED_DIALOG::onPageChanging, this );
216 m_treebook->GetTreeCtrl()->Unbind( wxEVT_LEFT_DOWN, &PAGED_DIALOG::onTreeLeftDown, this );
217 m_treebook->GetTreeCtrl()->Unbind( wxEVT_TREE_ITEM_ACTIVATED, &PAGED_DIALOG::onTreeItemActivated, this );
218}
219
220
222{
224
225 // Call TransferDataToWindow() only once:
226 // this is enough on wxWidgets 3.1
227 if( !DIALOG_SHIM::TransferDataToWindow() )
228 return false;
229
230 // Search for a page matching the lastParentPageTitle/lastPageTitle hierarchy
231 wxString lastPage = g_lastPage[ m_title ];
232 wxString lastParentPage = g_lastParentPage[ m_title ];
233 int lastPageIndex = wxNOT_FOUND;
234
235 for( size_t i = 0; i < m_treebook->GetPageCount(); ++i )
236 {
237 if( m_treebook->GetPageText( i ) == lastPage )
238 {
239 if( lastParentPage.IsEmpty() )
240 {
241 lastPageIndex = i;
242 break;
243 }
244
245 if( m_treebook->GetPageParent( i ) >= 0
246 && m_treebook->GetPageText( (unsigned) m_treebook->GetPageParent( i ) ) == lastParentPage )
247 {
248 lastPageIndex = i;
249 break;
250 }
251 }
252 }
253
254 lastPageIndex = std::max( 0, lastPageIndex );
255 m_treebook->SetSelection( lastPageIndex );
256 UpdateResetButton( lastPageIndex );
257
258 return true;
259}
260
261
263{
264 bool ret = true;
265
266 // Call TransferDataFromWindow() only once:
267 // this is enough on wxWidgets 3.1
268 if( !DIALOG_SHIM::TransferDataFromWindow() )
269 ret = false;
270
271 return ret;
272}
273
274
275wxWindow* PAGED_DIALOG::ShowPage( const wxString& aTitle )
276{
277 for( size_t i = 0; i < m_treebook->GetPageCount(); ++i )
278 {
279 if( m_treebook->GetPageText( i ) == aTitle )
280 {
281 m_treebook->SetSelection( i );
282
283 // The change can be vetoed by the page being left, or redirected away from a branch
284 if( m_treebook->GetSelection() != static_cast<int>( i ) )
285 return nullptr;
286
287 return m_treebook->GetResolvedPage( i );
288 }
289 }
290
291 return nullptr;
292}
293
294
296{
297 while( aParent )
298 {
299 if( PAGED_DIALOG* parentDialog = dynamic_cast<PAGED_DIALOG*>( aParent ) )
300 return parentDialog;
301
302 aParent = aParent->GetParent();
303 }
304
305 return nullptr;
306}
307
308
309void PAGED_DIALOG::SetError( const wxString& aMessage, const wxString& aPageName, int aCtrlId,
310 int aRow, int aCol )
311{
312 SetError( aMessage, FindWindow( aPageName ), FindWindow( aCtrlId ), aRow, aCol );
313}
314
315
316void PAGED_DIALOG::SetError( const wxString& aMessage, wxWindow* aPage, wxWindow* aCtrl,
317 int aRow, int aCol )
318{
319 m_infoBar->ShowMessageFor( aMessage, 10000, wxICON_WARNING );
320
321 if( wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( aCtrl ) )
322 {
323 textCtrl->SetSelection( -1, -1 );
324 textCtrl->SetFocus();
325 return;
326 }
327
328 if( wxStyledTextCtrl* scintilla = dynamic_cast<wxStyledTextCtrl*>( aCtrl ) )
329 {
330 if( aRow > 0 )
331 {
332 int pos = scintilla->PositionFromLine( aRow - 1 ) + ( aCol - 1 );
333 scintilla->GotoPos( pos );
334 }
335
336 scintilla->SetFocus();
337 return;
338 }
339
340 if( wxGrid* grid = dynamic_cast<wxGrid*>( aCtrl ) )
341 {
342 grid->SetFocus();
343 grid->MakeCellVisible( aRow, aCol );
344 grid->SetGridCursor( aRow, aCol );
345
346 grid->EnableCellEditControl( true );
347 grid->ShowCellEditControl();
348 return;
349 }
350}
351
352
354{
355 wxWindow* panel = m_treebook->ResolvePage( aPage );
356
357 // Enable the reset button only if the page is re-settable
358 if( m_resetButton )
359 {
360 if( panel && ( panel->GetWindowStyle() & wxRESETTABLE ) )
361 {
362 wxString name = m_treebook->GetPageText( aPage );
363 name.Replace( wxT( "&" ), wxT( "&&" ) );
364
365 m_resetButton->SetLabel( wxString::Format( _( "Reset %s to Defaults" ), name ) );
366 m_resetButton->SetToolTip( panel->GetHelpTextAtPoint( wxPoint( -INT_MAX, INT_MAX ),
367 wxHelpEvent::Origin_Unknown ) );
368 m_resetButton->Enable( true );
369 }
370 else
371 {
372 m_resetButton->SetLabel( _( "Reset to Defaults" ) );
373 m_resetButton->SetToolTip( wxString() );
374 m_resetButton->Enable( false );
375 }
376
377 m_resetButton->GetParent()->Layout();
378 }
379}
380
381
382void PAGED_DIALOG::onCharHook( wxKeyEvent& aEvent )
383{
384 if( dynamic_cast<wxTextEntry*>( aEvent.GetEventObject() )
385 || dynamic_cast<wxStyledTextCtrl*>( aEvent.GetEventObject() )
386 || dynamic_cast<wxListView*>( aEvent.GetEventObject() )
387 || dynamic_cast<wxTreeCtrl*>( aEvent.GetEventObject() )
388 || dynamic_cast<wxGrid*>( FindFocus() ) )
389 {
390 aEvent.Skip();
391 return;
392 }
393
394 if( aEvent.GetKeyCode() == WXK_UP )
395 {
396 int page = m_treebook->GetSelection();
397
398 if( page >= 1 )
399 {
400 wxWindow* prevPage = m_treebook->GetPage( page - 1 );
401
402 if( !prevPage || prevPage->GetChildren().IsEmpty() )
403 m_treebook->SetSelection( std::max( page - 2, 0 ) );
404 else
405 m_treebook->SetSelection( page - 1 );
406 }
407
408 m_treebook->GetTreeCtrl()->SetFocus(); // Don't allow preview canvas to steal gridFocus
409 }
410 else if( aEvent.GetKeyCode() == WXK_DOWN )
411 {
412 int page = m_treebook->GetSelection();
413
414 m_treebook->SetSelection( std::min<int>( page + 1, m_treebook->GetPageCount() - 1 ) );
415
416 m_treebook->GetTreeCtrl()->SetFocus(); // Don't allow preview canvas to steal gridFocus
417 }
418 else
419 {
420 aEvent.Skip();
421 }
422}
423
424
425void PAGED_DIALOG::onTreeLeftDown( wxMouseEvent& aEvent )
426{
427 aEvent.Skip();
428
429 wxTreeCtrl* tree = m_treebook->GetTreeCtrl();
430 int flags = 0;
431 wxTreeItemId item = tree->HitTest( aEvent.GetPosition(), flags );
432
433 m_clickExpandedItem = wxTreeItemId();
434
435 // A label click opens the branch so onPageChanged() moves on to its first sub-page
436 // The expander is left alone so the branch can still be closed
437 if( item.IsOk() && ( flags & wxTREE_HITTEST_ONITEMLABEL ) && !tree->IsExpanded( item )
438 && tree->ItemHasChildren( item ) )
439 {
440 tree->Expand( item );
441 m_clickExpandedItem = item;
442
443 // The selection does not change, so onPageChanged() will not move on to the first sub-page.
444 // Deferred so the tree finishes handling the click first.
445 if( tree->GetSelection() == item )
446 {
447 int page = m_treebook->GetSelection();
448
449 CallAfter(
450 [this, page]()
451 {
452 wxWindow* current = m_treebook->GetCurrentPage();
453
454 if( m_treebook->GetSelection() == page && current && current->GetChildren().IsEmpty()
455 && page + 1 < (int) m_treebook->GetPageCount() && m_treebook->IsNodeExpanded( page ) )
456 {
457 m_treebook->SetSelection( page + 1 );
458 }
459 } );
460 }
461 }
462}
463
464
465void PAGED_DIALOG::onTreeItemActivated( wxTreeEvent& aEvent )
466{
467 // A double-click would otherwise toggle shut the branch its first click just opened
468 if( aEvent.GetItem() == m_clickExpandedItem )
469 {
470 m_clickExpandedItem = wxTreeItemId();
471 return;
472 }
473
474 aEvent.Skip();
475}
476
477
478void PAGED_DIALOG::onPageChanged( wxBookCtrlEvent& event )
479{
480 int sel = event.GetSelection();
481
482 if( sel == wxNOT_FOUND )
483 return;
484
485 size_t page = static_cast<size_t>( sel );
486
487 // Use the first sub-page when a tree level node is selected, but only if the node is
488 // expanded. When the user collapses a branch, wxTreebook auto-selects the parent node.
489 // Redirecting to the first child here would undo the collapse.
490 wxWindow* currentPage = m_treebook->GetCurrentPage();
491
492 if( currentPage && currentPage->GetChildren().IsEmpty()
493 && page + 1 < m_treebook->GetPageCount()
494 && m_treebook->IsNodeExpanded( page ) )
495 {
496 m_treebook->ChangeSelection( page + 1 );
497 }
498
499 page = m_treebook->GetSelection();
500
501 UpdateResetButton( page );
502
503 // Make sure the dialog size is enough to fit the page content.
504 m_treebook->InvalidateBestSize();
505
506 SetMinSize( wxDefaultSize );
507 wxSize minSize = GetBestSize();
508 minSize.IncTo( FromDIP( wxSize( 600, 500 ) ) );
509 minSize.DecTo( FromDIP( wxSize( 1500, 900 ) ) ); // Failsafe
510
511 // Clamp to the current display so the resize border stays reachable (#24408).
512 int displayIdx = wxDisplay::GetFromWindow( this );
513
514 if( displayIdx == wxNOT_FOUND )
515 displayIdx = 0;
516
517 wxRect displayArea = wxDisplay( (unsigned int) displayIdx ).GetClientArea();
518 wxSize maxSize( std::max( 0, displayArea.width - FromDIP( 40 ) ),
519 std::max( 0, displayArea.height - FromDIP( 80 ) ) );
520 minSize.DecTo( maxSize );
521
522 SetMinSize( minSize );
523
524 wxSize currentSize = GetSize();
525 wxSize newSize = currentSize;
526 newSize.IncTo( minSize );
527
528 if( newSize != currentSize )
529 SetSize( newSize );
530
531#ifdef __WXMAC__
532 // Work around an OSX wxWidgets issue where the wxGrid children don't get placed correctly
533 // until the first resize event
534 if( page < m_macHack.size() && m_macHack[ page ] )
535 {
536 wxSize pageSize = m_treebook->GetPage( page )->GetSize();
537 pageSize.x += 1;
538 pageSize.y += 2;
539
540 m_treebook->GetPage( page )->SetSize( pageSize );
541 m_macHack[ page ] = false;
542 }
543#else
544 wxSizeEvent evt( wxDefaultSize );
545 wxQueueEvent( m_treebook, evt.Clone() );
546#endif
547}
548
549
550void PAGED_DIALOG::onPageChanging( wxBookCtrlEvent& aEvent )
551{
552 int currentPage = aEvent.GetOldSelection();
553
554 if( currentPage == wxNOT_FOUND )
555 return;
556
557 wxWindow* page = m_treebook->GetPage( currentPage );
558
559 wxCHECK( page, /* void */ );
560
561 // If there is a validation error on the current page, don't allow the page change.
562 if( !page->Validate() || !page->TransferDataFromWindow() )
563 {
564 aEvent.Veto();
565 return;
566 }
567}
568
569
570void PAGED_DIALOG::onResetButton( wxCommandEvent& aEvent )
571{
572 int sel = m_treebook->GetSelection();
573
574 if( sel == wxNOT_FOUND )
575 return;
576
577 // NB: dynamic_cast doesn't work over Kiway
578 wxWindow* panel = m_treebook->ResolvePage( sel );
579
580 if( panel )
581 {
582 wxCommandEvent resetCommand( wxEVT_COMMAND_BUTTON_CLICKED, ID_RESET_PANEL );
583 panel->ProcessWindowEvent( resetCommand );
584 }
585}
586
587void PAGED_DIALOG::onOpenPrefsDir( wxCommandEvent& aEvent )
588{
589 wxString dir( PATHS::GetUserSettingsPath() );
590 LaunchExternal( dir );
591}
const char * name
void SetupStandardButtons(std::map< int, wxString > aLabels={})
std::string m_hash_key
DIALOG_SHIM(wxWindow *aParent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER, const wxString &name=wxDialogNameStr)
virtual void onOpenPrefsDir(wxCommandEvent &aEvent)
wxTreeItemId m_clickExpandedItem
WX_INFOBAR * m_infoBar
void onTreeItemActivated(wxTreeEvent &aEvent)
bool TransferDataToWindow() override
~PAGED_DIALOG() override
PAGED_DIALOG(wxWindow *aParent, const wxString &aTitle, bool aShowReset, bool aShowOpenFolder, const wxString &aAuxiliaryAction=wxEmptyString, const wxSize &aInitialSize=wxDefaultSize)
wxButton * m_auxiliaryButton
std::vector< bool > m_macHack
wxButton * m_openPrefsDirButton
void onTreeLeftDown(wxMouseEvent &aEvent)
bool TransferDataFromWindow() override
void finishInitialization()
void UpdateResetButton(int aPage)
void SetInitialPage(const wxString &aPage, const wxString &aParentPage=wxEmptyString)
virtual void onPageChanging(wxBookCtrlEvent &aEvent)
virtual void onCharHook(wxKeyEvent &aEvent)
virtual void onAuxiliaryAction(wxCommandEvent &aEvent)
wxString m_title
static PAGED_DIALOG * GetDialog(wxWindow *aWindow)
virtual void onResetButton(wxCommandEvent &aEvent)
WX_TREEBOOK * m_treebook
virtual void onPageChanged(wxBookCtrlEvent &aEvent)
wxBoxSizer * m_buttonsSizer
void SetError(const wxString &aMessage, const wxString &aPageName, int aCtrlId, int aRow=-1, int aCol=-1)
wxButton * m_resetButton
wxWindow * ShowPage(const wxString &aTitle)
Select the page with the given title.
static wxString GetUserSettingsPath()
Return the user configuration path used to store KiCad's configuration files.
Definition paths.cpp:586
A modified version of the wxInfoBar class that allows us to:
Definition wx_infobar.h:77
void SetBorders(bool aLeft, bool aRight, bool aTop, bool aBottom)
Definition wx_panel.h:35
This file is part of the common library.
const int minSize
Push and Shove router track width and via size dialog.
#define _(s)
bool LaunchExternal(const wxString &aPath)
Launches the given file or folder in the host OS.
KICOMMON_API wxFont GetControlFont(wxWindow *aWindow)
std::map< wxString, wxString > g_lastPage
std::map< wxString, wxString > g_lastParentPage
#define wxRESETTABLE
#define ID_RESET_PANEL
Functions to provide common constants and other functions to assist in making a consistent UI.