68#include <wx/display.h>
69#include <wx/stdpaths.h>
90 return wxWindow::FromDIP( wxSize( 406, 354 ), aWindow );
93 return wxWindow::FromDIP( wxSize( 500, 400 ), aWindow );
103 return wxWindow::FromDIP( wxSize( 850, 540 ), aWindow );
106 return wxWindow::FromDIP( wxSize( 1280, 720 ), aWindow );
131 m_ident = aFrameType;
132 m_maximizeByDefault =
false;
134 m_settingsManager =
nullptr;
135 m_fileHistory =
nullptr;
136 m_supportsAutoSave =
false;
137 m_autoSavePending =
false;
140 m_isNonUserClose =
false;
142 m_autoSaveRequired =
false;
156 GetClientSize( &m_frameSize.x, &m_frameSize.y );
170 const wxPoint& aPos,
const wxSize& aSize,
long aStyle,
171 const wxString& aFrameName,
KIWAY* aKiway,
173 wxFrame( aParent, wxID_ANY, aTitle, aPos, aSize, aStyle, aFrameName ),
184 for( wxWindow* child : aParent->GetChildren() )
188 if( dlg->IsQuasiModal() )
209 wxWindow* cvpcb = wxWindow::FindWindowByName( wxS(
"CvpcbFrame" ) );
231 if( event.CanVeto() )
238 if( event.GetId() == wxEVT_QUERY_END_SESSION
239 || event.GetId() == wxEVT_END_SESSION )
266 if( event.CanVeto() )
296 if( !IsEnabled() && IsActive() )
305 if( !wxFrame::ProcessEvent( aEvent ) )
308 if(
Pgm().m_Quitting )
317 wxLogTrace(
traceAutoSave, wxT(
"Starting auto save timer." ) );
323 wxLogTrace(
traceAutoSave, wxT(
"Stopping auto save timer." ) );
355 wxCHECK_MSG(
false,
true, wxT(
"Auto save timer function not overridden. Bad programmer!" ) );
381 std::placeholders::_1,
387 Bind( wxEVT_UPDATE_UI, evtFunc, aID );
398 Unbind( wxEVT_UPDATE_UI, it->second, aID );
405 bool checkRes =
false;
406 bool enableRes =
true;
419 catch( std::exception& )
428 wxString msg =
_(
"Undo" );
433 aEvent.SetText( msg );
437 wxString msg =
_(
"Redo" );
442 aEvent.SetText( msg );
445 if( isCut || isCopy || isPaste )
447 wxWindow* focus = wxWindow::FindFocus();
448 wxTextEntry* textEntry =
dynamic_cast<wxTextEntry*
>( focus );
450 if( textEntry && isCut && textEntry->CanCut() )
452 else if( textEntry && isCopy && textEntry->CanCopy() )
454 else if( textEntry && isPaste && textEntry->CanPaste() )
456 else if(
dynamic_cast<WX_GRID*
>( focus ) )
460 aEvent.Enable( enableRes );
461 aEvent.Show( showRes );
463 if( aEvent.IsCheckable() )
464 aEvent.Check( checkRes );
472 [] (
const SELECTION& aSel,
int aLangIdentifier )
480 cond.
Check( std::bind( isCurrentLang, std::placeholders::_1,
507 wxFrame::SetMenuBar( menu_bar );
511 int pos = GetMenuBar()->FindMenu(
_(
"&Help" ) + wxS(
" " ) );
513 if( pos != wxNOT_FOUND )
515 wxMenu* helpMenu = GetMenuBar()->Remove( pos );
516 GetMenuBar()->Append( helpMenu,
_(
"&Help" ) + wxS(
" " ) );
533 helpMenu->AppendSeparator();
537 aMenuBar->Append( helpMenu,
_(
"&Help" ) + wxS(
" " ) );
541 helpMenu->wxMenu::SetTitle(
_(
"&Help" ) + wxS(
" " ) );
553 GetMenuBar()->Refresh();
565 bool running =
Pgm().GetApiServer().Running();
568 Pgm().GetApiServer().Stop();
570 Pgm().GetApiServer().Start();
586 GetMenuBar()->Refresh();
596 wxAuiPaneInfoArray panes =
m_auimgr.GetAllPanes();
598 for(
size_t i = 0; i < panes.GetCount(); ++i )
601 toolbar->RefreshBitmaps();
609 int currentDisplay = wxDisplay::GetFromWindow(
this );
626 if( !
Pgm().GetCommonSettings()->m_Session.remember_open_files )
631 if( state !=
nullptr )
640 bool wasDefault =
false;
664 if( aState.
display >= wxDisplay::GetCount() )
670 const unsigned int index = 0;
671 wxDisplay display( index );
672 wxRect clientSize = display.GetGeometry();
688 wxDisplay display( aState.
display );
689 wxRect clientSize = display.GetClientArea();
691 int yLimTop = clientSize.y;
692 int yLimBottom = clientSize.y + clientSize.height;
693 int xLimLeft = clientSize.x;
694 int xLimRight = clientSize.x + clientSize.width;
696 if( upperLeft.x > xLimRight ||
697 upperRight.x < xLimLeft ||
698 upperLeft.y < yLimTop ||
699 upperLeft.y > yLimBottom )
736 wxDisplay display( wxDisplay::GetFromWindow(
this ) );
737 wxRect clientSize = display.GetClientArea();
738 wxPoint pos = GetPosition();
742 wxS(
"ensureWindowIsOnScreen: clientArea (%d, %d) w %d h %d" ),
743 clientSize.x, clientSize.y,
744 clientSize.width, clientSize.height );
746 if( pos.y < clientSize.y )
749 wxS(
"ensureWindowIsOnScreen: y pos %d below minimum, setting to %d" ), pos.y,
751 pos.y = clientSize.y;
754 if( pos.x < clientSize.x )
757 wxS(
"ensureWindowIsOnScreen: x pos %d is off the client rect, setting to %d" ),
758 pos.x, clientSize.x );
759 pos.x = clientSize.x;
762 if( pos.x + size.x - clientSize.x > clientSize.width )
764 int newWidth = clientSize.width - ( pos.x - clientSize.x );
766 wxS(
"ensureWindowIsOnScreen: effective width %d above available %d, setting "
767 "to %d" ), pos.x + size.x, clientSize.width, newWidth );
771 if( pos.y + size.y - clientSize.y > clientSize.height )
773 int newHeight = clientSize.height - ( pos.y - clientSize.y );
775 wxS(
"ensureWindowIsOnScreen: effective height %d above available %d, setting "
776 "to %d" ), pos.y + size.y, clientSize.height, newHeight );
780 wxLogTrace(
traceDisplayLocation, wxS(
"Updating window position (%d, %d) with size (%d, %d)" ),
781 pos.x, pos.y, size.x, size.y );
783 SetSize( pos.x, pos.y, size.x, size.y );
823 IsMaximized() ? wxS(
"true" ) : wxS(
"false" ) );
860 if(
Pgm().GetCommonSettings()->m_Session.remember_open_files && !currentlyOpenedFile.IsEmpty() )
862 wxFileName rfn( currentlyOpenedFile );
863 rfn.MakeRelativeTo(
Prj().GetProjectPath() );
871 if( !currentlyOpenedFile.IsEmpty() )
906 SetStatusText(
text );
912#if defined( __WXOSX_MAC__ )
924#if defined( __WXOSX_MAC__ )
932 m_auimgr.GetPane( wxS(
"InfoBar" ) ).Hide();
943 if( aShowCloseButton )
951 std::function<
void(
void)> aCallback )
955 if( aShowCloseButton )
969 if( aShowCloseButton )
980 if( aShowCloseButton )
992 wxASSERT( aFileHistory );
1000 GetMenuBar()->Refresh();
1011 wxASSERT( aFileHistory );
1013 int baseId = aFileHistory->GetBaseId();
1015 wxASSERT( cmdId >= baseId && cmdId < baseId + (
int) aFileHistory->GetCount() );
1017 unsigned i = cmdId - baseId;
1019 if( i < aFileHistory->GetCount() )
1021 wxString fn = aFileHistory->GetHistoryFile( i );
1023 if( wxFileName::FileExists( fn ) )
1030 aFileHistory->RemoveFileFromHistory( i );
1038 GetMenuBar()->Refresh();
1041 return wxEmptyString;
1050 wxASSERT( aFileHistory );
1058 GetMenuBar()->Refresh();
1078 PAGED_DIALOG dlg(
this,
_(
"Preferences" ),
true,
true, wxEmptyString,
1079 wxWindow::FromDIP( wxSize( 980, 560 ), NULL ) );
1081 dlg.SetEvtHandlerEnabled(
false );
1089 std::vector<int> expand;
1094 []( wxWindow* aParent ) -> wxWindow*
1101 []( wxWindow* aParent ) -> wxWindow*
1104 },
_(
"Mouse and Touchpad" ) );
1106 book->AddPage( hotkeysPanel,
_(
"Hotkeys" ) );
1113 []( wxWindow* aParent ) -> wxWindow*
1116 },
_(
"Version Control" ) );
1119#ifdef KICAD_USE_SENTRY
1121 []( wxWindow* aParent ) -> wxWindow*
1124 },
_(
"Data Collection" ) );
1127#define LAZY_CTOR( key ) \
1128 [this, kiface]( wxWindow* aParent ) \
1130 return kiface->CreateKiWindow( aParent, key, &Kiway() ); \
1145 expand.push_back( (
int) book->GetPageCount() );
1147 book->AddPage(
new wxPanel( book ),
_(
"Symbol Editor" ) );
1154 expand.push_back( (
int) book->GetPageCount() );
1156 book->AddPage(
new wxPanel( book ),
_(
"Schematic Editor" ) );
1163 _(
"Field Name Templates" ) );
1180 expand.push_back( (
int) book->GetPageCount() );
1182 book->AddPage(
new wxPanel( book ),
_(
"Footprint Editor" ) );
1190 _(
"Graphics Defaults" ) );
1193 expand.push_back( (
int) book->GetPageCount() );
1195 book->AddPage(
new wxPanel( book ),
_(
"PCB Editor" ) );
1204 expand.push_back( (
int) book->GetPageCount() );
1206 book->AddPage(
new wxPanel( book ),
_(
"3D Viewer" ) );
1225 expand.push_back( (
int) book->GetPageCount() );
1227 book->AddPage(
new wxPanel( book ),
_(
"Gerber Viewer" ) );
1232 _(
"Excellon Options" ) );
1248 expand.push_back( (
int) book->GetPageCount() );
1250 book->AddPage(
new wxPanel( book ),
_(
"Drawing Sheet Editor" ) );
1256 []( wxWindow* aParent ) -> wxWindow*
1259 },
_(
"Packages and Updates" ) );
1273 for(
size_t i = 0; i < book->GetPageCount(); ++i )
1274 book->GetPage( i )->Layout();
1276 for(
int page : expand )
1277 book->ExpandNode( page );
1279 if( !aStartPage.IsEmpty() )
1282 dlg.SetEvtHandlerEnabled(
true );
1299 wxString* files = aEvent.GetFiles();
1301 for(
int nb = 0; nb < aEvent.GetNumberOfFiles(); nb++ )
1303 const wxFileName fn = wxFileName( files[nb] );
1304 wxString ext = fn.GetExt();
1323 wxString fn = file.GetFullPath();
1332 wxFileName fn = aFileName;
1338 if( fn.GetPath().IsEmpty() && fn.HasName() )
1341 wxCHECK_MSG( fn.IsOk(),
false,
1342 wxT(
"File name object is invalid. Bad programmer!" ) );
1343 wxCHECK_MSG( !fn.GetPath().IsEmpty(),
false,
1344 wxT(
"File name object path <" ) + fn.GetFullPath() +
1345 wxT(
"> is not set. Bad programmer!" ) );
1347 if( fn.IsDir() && !fn.IsDirWritable() )
1349 msg.Printf(
_(
"Insufficient permissions to folder '%s'." ), fn.GetPath() );
1351 else if( !fn.FileExists() && !fn.IsDirWritable() )
1353 msg.Printf(
_(
"Insufficient permissions to save file '%s'." ), fn.GetFullPath() );
1355 else if( fn.FileExists() && !fn.IsFileWritable() )
1357 msg.Printf(
_(
"Insufficient permissions to save file '%s'." ), fn.GetFullPath() );
1360 if( !msg.IsEmpty() )
1374 if( !
Pgm().IsGUI() )
1377 wxCHECK_RET( aFileName.IsOk(), wxT(
"Invalid file name!" ) );
1379 wxFileName autoSaveFileName = aFileName;
1385 wxT(
"Checking for auto save file " ) + autoSaveFileName.GetFullPath() );
1387 if( !autoSaveFileName.FileExists() )
1390 wxString msg = wxString::Format(
_(
"Well this is potentially embarrassing!\n"
1391 "It appears that the last time you were editing\n"
1393 "KiCad exited before saving.\n"
1395 "Do you wish to open the auto-saved file instead?" ),
1396 aFileName.GetFullName() );
1398 int response = wxMessageBox( msg,
Pgm().App().GetAppDisplayName(), wxYES_NO | wxICON_QUESTION,
1403 if( response == wxYES )
1407 autoSaveFileName.GetFullPath() );
1409 if( !wxRenameFile( autoSaveFileName.GetFullPath(), aFileName.GetFullPath() ) )
1411 wxMessageBox(
_(
"The auto save file could not be renamed to the board file name." ),
1412 Pgm().App().GetAppDisplayName(), wxOK | wxICON_EXCLAMATION,
this );
1424 if( !
Pgm().IsGUI() )
1427 wxCHECK_RET( aFileName.IsOk(), wxT(
"Invalid file name!" ) );
1429 wxFileName autoSaveFn = aFileName;
1432 if( autoSaveFn.FileExists() )
1434 wxLogTrace(
traceAutoSave, wxT(
"Removing auto save file " ) + autoSaveFn.GetFullPath() );
1435 wxRemoveFile( autoSaveFn.GetFullPath() );
1449 wxAcceleratorEntry entries[1];
1450 entries[0].Set( wxACCEL_CTRL,
int(
'Q' ), wxID_EXIT );
1451 wxAcceleratorTable accel( 1, entries );
1452 SetAcceleratorTable( accel );
1472 if( extraitems > 0 )
1487 if( extraitems > 0 )
1510 return wxEmptyString;
1519 return wxEmptyString;
1534 wxCommandEvent e( EDA_EVT_UNITS_CHANGED );
1535 e.SetInt(
static_cast<int>( aUnits ) );
1536 e.SetClientData(
this );
1537 ProcessEventLocally( e );
1549 if( !IsMaximized() )
1555 "Maximizing window - Saving position (%d, %d) with size (%d, %d)",
1568 wxSize winSize = GetSize();
1577 GTKDoGetSize( &width, &height );
1579 winSize.Set( width, height );
1582 wxSize winSize = GetSize();
1600 GetMenuBar()->Refresh();
1626WXLRESULT EDA_BASE_FRAME::MSWWindowProc( WXUINT message, WXWPARAM wParam, WXLPARAM lParam )
1630 if( message == WM_SYSCOMMAND )
1632 if( wParam == SC_KEYMENU && ( lParam >> 16 ) <= 0 )
1636 return wxFrame::MSWWindowProc( message, wParam, lParam );
1644 langsMenu->
SetTitle(
_(
"Set Language" ) );
1645 langsMenu->
SetIcon( BITMAPS::language );
1659 new wxMenuItem( langsMenu,
1661 label, tooltip, wxITEM_CHECK );
1663 langsMenu->Append( item );
1667 aMasterMenu->
Add( langsMenu );
void ShowAboutDialog(EDA_BASE_FRAME *aParent)
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
void ClearScaledBitmapCache()
Wipes out the scaled bitmap cache so that the icon theme can be changed.
BITMAP_STORE * GetBitmapStore()
static TOOL_ACTION reportBug
static TOOL_ACTION donate
static TOOL_ACTION listHotKeys
static TOOL_ACTION getInvolved
static TOOL_ACTION gettingStarted
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
void ThemeChanged()
Notifies the store that the icon theme has been changed by the user, so caches must be invalidated.
Handle actions that are shared between different applications.
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
The base frame for deriving all KiCad main window classes.
virtual wxString help_name()
virtual bool doAutoSave()
This should be overridden by the derived class to handle the auto save feature.
void LoadWindowState(const wxString &aFileName)
FRAME_T GetFrameType() const
virtual void UnregisterUIUpdateHandler(int aID) override
Unregister a UI handler for a given ID that was registered using RegisterUIUpdateHandler.
virtual bool isAutoSaveRequired() const
Return the auto save status of the application.
virtual APP_SETTINGS_BASE * config() const
Return the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
virtual void handleIconizeEvent(wxIconizeEvent &aEvent)
Handle a window iconize event.
virtual void PushCommandToUndoList(PICKED_ITEMS_LIST *aItem)
Add a command to undo in the undo list.
void windowClosing(wxCloseEvent &event)
(with its unexpected name so it does not collide with the real OnWindowClose() function provided in d...
virtual void OnCharHook(wxKeyEvent &aKeyEvent)
Capture the key event before it is sent to the GUI.
virtual int GetRedoCommandCount() const
UNDO_REDO_CONTAINER m_undoList
virtual void OnMove(wxMoveEvent &aEvent)
virtual WINDOW_SETTINGS * GetWindowSettings(APP_SETTINGS_BASE *aCfg)
Return a pointer to the window settings for this frame.
virtual void doCloseWindow()
void OnMenuEvent(wxMenuEvent &event)
The TOOL_DISPATCHER needs these to work around some issues in wxWidgets where the menu events aren't ...
virtual bool IsModal() const
Return true if the frame is shown in our modal mode and false if the frame is shown as an usual frame...
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
virtual void HandleSystemColorChange()
Update the UI in response to a change in the system colors.
virtual void setupUIConditions()
Setup the UI conditions for the various actions and their controls in this frame.
void ensureWindowIsOnScreen()
bool m_isNonUserClose
Set by NonUserClose() to indicate that the user did not request the current close.
void LoadWindowSettings(const WINDOW_SETTINGS *aCfg)
Load window settings from the given settings object.
std::vector< wxFileName > m_AcceptedFiles
virtual void CheckForAutoSaveFile(const wxFileName &aFileName)
Check if an auto save file exists for aFileName and takes the appropriate action depending on the use...
void OnKicadAbout(wxCommandEvent &event)
virtual void ClearUndoRedoList()
Clear the undo and redo list using ClearUndoORRedoList()
virtual void DoWithAcceptedFiles()
Execute action on accepted dropped file.
virtual void OnModify()
Must be called after a model change in order to set the "modify" flag and do other frame-specific pro...
wxWindow * findQuasiModalDialog()
static void HandleUpdateUIEvent(wxUpdateUIEvent &aEvent, EDA_BASE_FRAME *aFrame, ACTION_CONDITIONS aCond)
Handle events generated when the UI is trying to figure out the current state of the UI controls rela...
virtual void ClearUndoORRedoList(UNDO_REDO_LIST aList, int aItemCount=-1)
Remove the aItemCount of old commands from aList and delete commands, pickers and picked items if nee...
virtual void ThemeChanged()
Process light/dark theme change.
EDA_BASE_FRAME(wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName, KIWAY *aKiway, const EDA_IU_SCALE &aIuScale)
void ShowPreferences(wxString aStartPage, wxString aStartParentPage)
Display the preferences and settings of all opened editors paged dialog, starting with a particular p...
void initExitKey()
Set the common key-pair for exiting the application (Ctrl-Q) and ties it to the wxID_EXIT event id.
void OnPreferences(wxCommandEvent &event)
virtual const SEARCH_STACK & sys_search()
Return a SEARCH_STACK pertaining to entire program.
void onAutoSaveTimer(wxTimerEvent &aEvent)
Handle the auto save timer event.
void SaveWindowSettings(WINDOW_SETTINGS *aCfg)
Save window settings to the given settings object.
virtual wxString GetRedoActionDescription() const
void FinishAUIInitialization()
virtual wxString GetCurrentFileName() const
Get the full filename + path of the currently opened file in the frame.
void ChangeUserUnits(EDA_UNITS aUnits)
void AddMenuLanguageList(ACTION_MENU *aMasterMenu, TOOL_INTERACTIVE *aControlTool)
Create a menu list for language choice, and add it as submenu to MasterMenu.
void SetMenuBar(wxMenuBar *menu_bar) override
void ShowInfoBarMsg(const wxString &aMsg, bool aShowCloseButton=false)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an info icon on the left of...
wxTimer * m_autoSaveTimer
void UpdateFileHistory(const wxString &FullFileName, FILE_HISTORY *aFileHistory=nullptr)
Update the list of recently opened files.
void PrintMsg(const wxString &text)
void commonInit(FRAME_T aFrameType)
Collect common initialization functions used in all CTORs.
virtual bool IsContentModified() const
Get if the contents of the frame have been modified since the last save.
void ShowInfoBarWarning(const wxString &aWarningMsg, bool aShowCloseButton=false)
Show the WX_INFOBAR displayed on the top of the canvas with a message and a warning icon on the left ...
virtual PICKED_ITEMS_LIST * PopCommandFromRedoList()
Return the last command to undo and remove it from list, nothing is deleted.
void ClearFileHistory(FILE_HISTORY *aFileHistory=nullptr)
Remove all files from the file history.
std::map< int, UIUpdateHandler > m_uiUpdateMap
Map containing the UI update handlers registered with wx for each action.
UNDO_REDO_CONTAINER m_redoList
virtual void LoadSettings(APP_SETTINGS_BASE *aCfg)
Load common frame parameters from a configuration file.
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
FILE_HISTORY * m_fileHistory
virtual void DeleteAutoSaveFile(const wxFileName &aFileName)
virtual void OnSize(wxSizeEvent &aEvent)
virtual wxString GetUndoActionDescription() const
virtual PICKED_ITEMS_LIST * PopCommandFromUndoList()
Return the last command to undo and remove it from list, nothing is deleted.
virtual bool canCloseWindow(wxCloseEvent &aCloseEvent)
bool ProcessEvent(wxEvent &aEvent) override
Override the default process event handler to implement the auto save feature.
bool IsWritable(const wxFileName &aFileName, bool aVerbose=true)
Check if aFileName can be written.
void OnMaximize(wxMaximizeEvent &aEvent)
virtual void OnDropFiles(wxDropFilesEvent &aEvent)
Handle event fired when a file is dropped to the window.
std::map< const wxString, TOOL_ACTION * > m_acceptedExts
Associate file extensions with action to execute.
void onIconize(wxIconizeEvent &aEvent)
virtual void unitsChangeRefresh()
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
wxString GetFileFromHistory(int cmdId, const wxString &type, FILE_HISTORY *aFileHistory=nullptr)
Fetch the file name from the file history list.
wxSize GetWindowSize()
Get the undecorated window size that can be used for restoring the window size.
int GetAutoSaveInterval() const
virtual void SaveSettings(APP_SETTINGS_BASE *aCfg)
Save common frame parameters to a configuration data file.
void onSystemColorChange(wxSysColourChangedEvent &aEvent)
virtual int GetUndoCommandCount() const
virtual void RegisterUIUpdateHandler(int aID, const ACTION_CONDITIONS &aConditions) override
Register a UI update handler for the control with ID aID.
virtual void PushCommandToRedoList(PICKED_ITEMS_LIST *aItem)
Add a command to redo in the redo list.
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false, WX_INFOBAR::MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left o...
bool m_isClosing
Set by the close window event handler after frames are asked if they can close.
void AddStandardHelpMenu(wxMenuBar *aMenuBar)
Add the standard KiCad help menu to the menubar.
void ReCreateMenuBar()
Recreate the menu bar.
virtual void doReCreateMenuBar()
WX_INFOBAR * GetInfoBar()
Specialization of the wxAuiPaneInfo class for KiCad panels.
This class implements a file history object to store a list of files, that can then be added to a men...
void AddFileToHistory(const wxString &aFile) override
Adds a file to the history.
void ClearFileHistory()
Clear all entries from the file history.
void Save(APP_SETTINGS_BASE &aSettings)
Saves history into a JSON settings object.
void SetMaxFiles(size_t aMaxFiles)
Update the number of files that will be contained inside the file history.
void Load(const APP_SETTINGS_BASE &aSettings)
Loads history from a JSON settings object.
SEARCH_STACK & KifaceSearch()
Only for DSO specific 'non-library' files.
APP_SETTINGS_BASE * KifaceSettings() const
void GetActions(std::vector< TOOL_ACTION * > &aActions) const override
Append this Kiface's registered actions to the given list.
const wxString & GetHelpFileName() const
Return just the basename portion of the current help file.
A mix in class which holds the location of a wxWindow's KIWAY.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
virtual void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged)
Call CommonSettingsChanged() on all KIWAY_PLAYERs.
virtual KIFACE * KiFACE(FACE_T aFaceId, bool doLoad=true)
Return the KIFACE* given a FACE_T.
virtual void GetActions(std::vector< TOOL_ACTION * > &aActions) const
Append all registered actions to the given list.
WX_TREEBOOK * GetTreebook()
void SetInitialPage(const wxString &aPage, const wxString &aParentPage=wxEmptyString)
std::vector< TOOL_ACTION * > & ActionsList()
static wxString GetDefaultUserProjectsPath()
Gets the default path we point users to create projects.
virtual COMMON_SETTINGS * GetCommonSettings() const
virtual int GetSelectedLanguageIdentifier() const
virtual SETTINGS_MANAGER & GetSettingsManager() const
A holder to handle information on schematic or board items.
void SaveFileState(const wxString &aFileName, const WINDOW_SETTINGS *aWindowCfg, bool aOpen)
const PROJECT_FILE_STATE * GetFileState(const wxString &aFileName)
virtual PROJECT_LOCAL_SETTINGS & GetLocalSettings() const
Look for files in a number of paths.
void PushCommand(PICKED_ITEMS_LIST *aCommand)
PICKED_ITEMS_LIST * PopCommand()
std::vector< PICKED_ITEMS_LIST * > m_CommandsList
void SetUserUnits(EDA_UNITS aUnits)
Simple wrapper around wxBusyCursor for used with the generic BUSY_INDICATOR interface.
A modified version of the wxInfoBar class that allows us to:
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
void ShowMessageFor(const wxString &aMessage, int aTime, int aFlags=wxICON_INFORMATION, MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the infobar with the provided message and icon for a specific period of time.
MESSAGE_TYPE
Sets the type of message for special handling if needed.
void Dismiss() override
Dismisses the infobar and updates the containing layout and AUI manager (if one is provided).
void AddCloseButton(const wxString &aTooltip=_("Hide this message."))
Add the default close button to the infobar on the right side.
void SetCallback(std::function< void(void)> aCallback)
Provide a callback to be called when the infobar is dismissed (either by user action or timer).
bool AddLazyPage(std::function< wxWindow *(wxWindow *aParent)> aLazyCtor, const wxString &text, bool bSelect=false, int imageId=NO_IMAGE)
bool AddLazySubPage(std::function< wxWindow *(wxWindow *aParent)> aLazyCtor, const wxString &text, bool bSelect=false, int imageId=NO_IMAGE)
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
const int minSize
Push and Shove router track width and via size dialog.
static const wxSize minSizeLookup(FRAME_T aFrameType, wxWindow *aWindow)
static const wxSize defaultSize(FRAME_T aFrameType, wxWindow *aWindow)
wxWindow * findQuasiModalDialog(wxWindow *aParent)
Base window classes and related definitions.
#define DEFAULT_MAX_UNDO_ITEMS
std::function< void(wxUpdateUIEvent &) > UIUpdateHandler
This is the handler functor for the update UI events.
void SocketCleanup()
Must be called to clean up the socket thread used by SendCommand.
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
@ FRAME_SCH_SYMBOL_EDITOR
@ PANEL_SCH_FIELD_NAME_TEMPLATES
@ PANEL_GBR_DISPLAY_OPTIONS
@ PANEL_FP_DEFAULT_GRAPHICS_VALUES
@ PANEL_FP_DISPLAY_OPTIONS
@ PANEL_FP_DEFAULT_FIELDS
@ PANEL_PCB_ACTION_PLUGINS
@ PANEL_3DV_DISPLAY_OPTIONS
@ PANEL_DS_DISPLAY_OPTIONS
@ PANEL_GBR_EXCELLON_OPTIONS
bool m_EnableGit
Enable git integration.
static const std::string GerberFileExtension
static const std::string AutoSaveFilePrefix
static bool IsGerberFileExtension(const wxString &ext)
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
const wxChar *const kicadTraceKeyEvent
Flag to enable wxKeyEvent debug tracing.
const wxChar *const traceDisplayLocation
Flag to enable debug output of display positioning logic.
void ReadHotKeyConfigIntoActions(const wxString &aFileName, std::vector< TOOL_ACTION * > &aActions)
Read a hotkey config file into a list of actions.
Common command IDs shared by more than one of the KiCad applications.
PGM_BASE & Pgm()
The global program "get" accessor.
LANGUAGE_DESCR LanguagesList[]
An array containing all the languages that KiCad supports.
Functors that can be used to figure out how the action controls should be displayed in the UI and if ...
SELECTION_CONDITION enableCondition
Returns true if the UI control should be enabled.
SELECTION_CONDITION checkCondition
Returns true if the UI control should be checked.
SELECTION_CONDITION showCondition
Returns true if the UI control should be shown.
ACTION_CONDITIONS & Check(const SELECTION_CONDITION &aCondition)
Implement a participant in the KIWAY alchemy.
int m_KI_Lang_Identifier
KiCad identifier used in menu selection (See id.h)
wxString m_Lang_Label
Labels used in menus.
struct WINDOW_STATE window
Store the common settings that are saved and loaded for each window / frame.
Store the window positioning/state.
IFACE KIFACE_BASE kiface("pcb_test_frame", KIWAY::FACE_PCB)
wxString dump(const wxArrayString &aArray)
Debug helper for printing wxArrayString contents.
wxLogTrace helper definitions.