60#include <wx/display.h>
61#include <wx/stdpaths.h>
63#include <wx/treebook.h>
79 return wxSize( 406, 354 );
82 return wxSize( 500, 400 );
92 return wxSize( 850, 540 );
95 return wxSize( 1280, 720 );
119 m_ident = aFrameType;
120 m_maximizeByDefault =
false;
122 m_settingsManager =
nullptr;
123 m_fileHistory =
nullptr;
124 m_supportsAutoSave =
false;
125 m_autoSavePending =
false;
128 m_isNonUserClose =
false;
130 m_autoSaveRequired =
false;
137 m_settingsManager = &
Pgm().GetSettingsManager();
140 SetSizeHints(
minSize( aFrameType ).x,
minSize( aFrameType ).y, -1, -1, -1, -1 );
143 GetClientSize( &m_frameSize.x, &m_frameSize.y );
157 const wxPoint& aPos,
const wxSize& aSize,
long aStyle,
158 const wxString& aFrameName,
KIWAY* aKiway,
160 wxFrame( aParent, wxID_ANY, aTitle, aPos, aSize, aStyle, aFrameName ),
171 for( wxWindow* iter : GetChildren() )
183 wxWindow* cvpcb = wxWindow::FindWindowByName( wxS(
"CvpcbFrame" ) );
205 if( event.CanVeto() )
212 if( event.GetId() == wxEVT_QUERY_END_SESSION
213 || event.GetId() == wxEVT_END_SESSION )
236 if( event.CanVeto() )
262 if( !IsEnabled() && IsActive() )
270 if( !wxFrame::ProcessEvent( aEvent ) )
273 if(
Pgm().m_Quitting )
282 wxLogTrace(
traceAutoSave, wxT(
"Starting auto save timer." ) );
288 wxLogTrace(
traceAutoSave, wxT(
"Stopping auto save timer." ) );
300 return Pgm().GetCommonSettings()->m_System.autosave_interval;
320 wxCHECK_MSG(
false,
true, wxT(
"Auto save timer function not overridden. Bad programmer!" ) );
346 std::placeholders::_1,
352 Bind( wxEVT_UPDATE_UI, evtFunc, aID );
363 Unbind( wxEVT_UPDATE_UI, it->second, aID );
370 bool checkRes =
false;
371 bool enableRes =
true;
384 catch( std::exception& )
391 if( isCut || isCopy || isPaste )
393 wxWindow* focus = wxWindow::FindFocus();
394 wxTextEntry* textEntry =
dynamic_cast<wxTextEntry*
>( focus );
396 if( textEntry && isCut && textEntry->CanCut() )
398 else if( textEntry && isCopy && textEntry->CanCopy() )
400 else if( textEntry && isPaste && textEntry->CanPaste() )
404 aEvent.Enable( enableRes );
405 aEvent.Show( showRes );
409#if wxCHECK_VERSION( 3, 1, 5 )
410 if( aEvent.IsCheckable() )
411 aEvent.Check( checkRes );
413 bool canCheck =
true;
417 if( wxMenu* menu =
dynamic_cast<wxMenu*
>( aEvent.GetEventObject() ) )
418 canCheck = menu->FindItem( aEvent.GetId() )->IsCheckable();
421 aEvent.Check( checkRes );
430 [] (
const SELECTION& aSel,
int aLangIdentifier )
432 return Pgm().GetSelectedLanguageIdentifier() == aLangIdentifier;
438 cond.
Check( std::bind( isCurrentLang, std::placeholders::_1,
474 helpMenu->AppendSeparator();
478 aMenuBar->Append( helpMenu,
_(
"&Help" ) + wxS(
" " ) );
489 GetMenuBar()->Refresh();
513 GetMenuBar()->Refresh();
523 wxAuiPaneInfoArray panes =
m_auimgr.GetAllPanes();
525 for(
size_t i = 0; i < panes.GetCount(); ++i )
528 toolbar->RefreshBitmaps();
536 int currentDisplay = wxDisplay::GetFromWindow(
this );
553 if( !
Pgm().GetCommonSettings()->m_Session.remember_open_files )
558 if( state !=
nullptr )
567 bool wasDefault =
false;
589 if( aState.
display >= wxDisplay::GetCount() )
595 const unsigned int index = 0;
596 wxDisplay display( index );
597 wxRect clientSize = display.GetGeometry();
613 wxDisplay display( aState.
display );
614 wxRect clientSize = display.GetClientArea();
616 int yLimTop = clientSize.y;
617 int yLimBottom = clientSize.y + clientSize.height;
618 int xLimLeft = clientSize.x;
619 int xLimRight = clientSize.x + clientSize.width;
621 if( upperLeft.x > xLimRight ||
622 upperRight.x < xLimLeft ||
623 upperLeft.y < yLimTop ||
624 upperLeft.y > yLimBottom )
661 wxDisplay display( wxDisplay::GetFromWindow(
this ) );
662 wxRect clientSize = display.GetClientArea();
663 wxPoint pos = GetPosition();
667 wxS(
"ensureWindowIsOnScreen: clientArea (%d, %d) w %d h %d" ), clientSize.x, clientSize.y,
668 clientSize.width, clientSize.height );
670 if( pos.y < clientSize.y )
673 wxS(
"ensureWindowIsOnScreen: y pos %d below minimum, setting to %d" ), pos.y,
675 pos.y = clientSize.y;
678 if( pos.x < clientSize.x )
681 wxS(
"ensureWindowIsOnScreen: x pos %d is off the client rect, setting to %d" ), pos.x,
683 pos.x = clientSize.x;
686 if( pos.x + size.x - clientSize.x > clientSize.width )
688 int newWidth = clientSize.width - ( pos.x - clientSize.x );
690 wxS(
"ensureWindowIsOnScreen: effective width %d above available %d, setting to %d" ),
691 pos.x + size.x, clientSize.width, newWidth );
695 if( pos.y + size.y - clientSize.y > clientSize.height )
697 int newHeight = clientSize.height - ( pos.y - clientSize.y );
699 wxS(
"ensureWindowIsOnScreen: effective height %d above available %d, setting to %d" ),
700 pos.y + size.y, clientSize.height, newHeight );
704 wxLogTrace(
traceDisplayLocation, wxS(
"Updating window position (%d, %d) with size (%d, %d)" ),
705 pos.x, pos.y, size.x, size.y );
707 SetSize( pos.x, pos.y, size.x, size.y );
747 IsMaximized() ? wxS(
"true" ) : wxS(
"false" ) );
765 int fileHistorySize =
Pgm().GetCommonSettings()->m_System.file_history_size;
784 if(
Pgm().GetCommonSettings()->m_Session.remember_open_files && !currentlyOpenedFile.IsEmpty() )
786 wxFileName rfn( currentlyOpenedFile );
787 rfn.MakeRelativeTo(
Prj().GetProjectPath() );
795 if( !currentlyOpenedFile.IsEmpty() )
830 SetStatusText(
text );
836#if defined( __WXOSX_MAC__ )
848#if defined( __WXOSX_MAC__ )
856 m_auimgr.GetPane( wxS(
"InfoBar" ) ).Hide();
867 if( aShowCloseButton )
875 std::function<
void(
void)> aCallback )
879 if( aShowCloseButton )
893 if( aShowCloseButton )
904 if( aShowCloseButton )
916 wxASSERT( aFileHistory );
924 GetMenuBar()->Refresh();
935 wxASSERT( aFileHistory );
937 int baseId = aFileHistory->GetBaseId();
939 wxASSERT( cmdId >= baseId && cmdId < baseId + (
int) aFileHistory->GetCount() );
941 unsigned i = cmdId - baseId;
943 if( i < aFileHistory->GetCount() )
945 wxString fn = aFileHistory->GetHistoryFile( i );
947 if( wxFileName::FileExists( fn ) )
954 aFileHistory->RemoveFileFromHistory( i );
962 GetMenuBar()->Refresh();
965 return wxEmptyString;
974 wxASSERT( aFileHistory );
982 GetMenuBar()->Refresh();
1002 wxBeginBusyCursor( wxHOURGLASS_CURSOR );
1006 dlg.SetEvtHandlerEnabled(
false );
1011 std::vector<int> expand;
1017 book->AddPage( hotkeysPanel,
_(
"Hotkeys" ) );
1019#ifdef KICAD_USE_SENTRY
1023#define CREATE_PANEL( key ) kiface->CreateKiWindow( book, key, &Kiway() )
1034 expand.push_back( book->GetPageCount() );
1036 book->AddPage(
new wxPanel( book ),
_(
"Symbol Editor" ) );
1042 expand.push_back( book->GetPageCount() );
1044 book->AddPage(
new wxPanel( book ),
_(
"Schematic Editor" ) );
1050 _(
"Field Name Templates" ) );
1063 expand.push_back( book->GetPageCount() );
1065 book->AddPage(
new wxPanel( book ),
_(
"Footprint Editor" ) );
1072 expand.push_back( book->GetPageCount() );
1074 book->AddPage(
new wxPanel( book ),
_(
"PCB Editor" ) );
1082 expand.push_back( book->GetPageCount() );
1084 book->AddPage(
new wxPanel( book ),
_(
"3D Viewer" ) );
1101 expand.push_back( book->GetPageCount() );
1103 book->AddPage(
new wxPanel( book ),
_(
"Gerber Viewer" ) );
1118 expand.push_back( book->GetPageCount() );
1120 book->AddPage(
new wxPanel( book ),
_(
"Drawing Sheet Editor" ) );
1134 for(
size_t i = 0; i < book->GetPageCount(); ++i )
1135 book->GetPage( i )->Layout();
1137 for(
int page : expand )
1138 book->ExpandNode( page );
1140 if( !aStartPage.IsEmpty() )
1143 dlg.SetEvtHandlerEnabled(
true );
1146 if( dlg.ShowModal() == wxID_OK )
1148 Pgm().GetSettingsManager().Save();
1158 wxString* files = aEvent.GetFiles();
1160 for(
int nb = 0; nb < aEvent.GetNumberOfFiles(); nb++ )
1162 const wxFileName fn = wxFileName( files[nb] );
1163 wxString ext = fn.GetExt();
1182 wxString fn = file.GetFullPath();
1191 wxFileName fn = aFileName;
1197 if( fn.GetPath().IsEmpty() && fn.HasName() )
1200 wxCHECK_MSG( fn.IsOk(),
false,
1201 wxT(
"File name object is invalid. Bad programmer!" ) );
1202 wxCHECK_MSG( !fn.GetPath().IsEmpty(),
false,
1203 wxT(
"File name object path <" ) + fn.GetFullPath() +
1204 wxT(
"> is not set. Bad programmer!" ) );
1206 if( fn.IsDir() && !fn.IsDirWritable() )
1208 msg.Printf(
_(
"Insufficient permissions to folder '%s'." ), fn.GetPath() );
1210 else if( !fn.FileExists() && !fn.IsDirWritable() )
1212 msg.Printf(
_(
"Insufficient permissions to save file '%s'." ), fn.GetFullPath() );
1214 else if( fn.FileExists() && !fn.IsFileWritable() )
1216 msg.Printf(
_(
"Insufficient permissions to save file '%s'." ), fn.GetFullPath() );
1219 if( !msg.IsEmpty() )
1236 wxCHECK_RET( aFileName.IsOk(), wxT(
"Invalid file name!" ) );
1238 wxFileName autoSaveFileName = aFileName;
1244 wxT(
"Checking for auto save file " ) + autoSaveFileName.GetFullPath() );
1246 if( !autoSaveFileName.FileExists() )
1250 "It appears that the last time you were editing\n"
1252 "KiCad exited before saving.\n"
1254 "Do you wish to open the auto-saved file instead?" ),
1255 aFileName.GetFullName() );
1257 int response = wxMessageBox( msg,
Pgm().App().GetAppDisplayName(), wxYES_NO | wxICON_QUESTION,
1262 if( response == wxYES )
1264 if( !wxRenameFile( autoSaveFileName.GetFullPath(), aFileName.GetFullPath() ) )
1266 wxMessageBox(
_(
"The auto save file could not be renamed to the board file name." ),
1267 Pgm().App().GetAppDisplayName(), wxOK | wxICON_EXCLAMATION,
this );
1273 wxT(
"Removing auto save file " ) + autoSaveFileName.GetFullPath() );
1276 wxRemoveFile( autoSaveFileName.GetFullPath() );
1290 wxAcceleratorEntry entries[1];
1291 entries[0].Set( wxACCEL_CTRL,
int(
'Q' ), wxID_EXIT );
1292 wxAcceleratorTable accel( 1, entries );
1293 SetAcceleratorTable( accel );
1313 if( extraitems > 0 )
1328 if( extraitems > 0 )
1357 wxCommandEvent e( UNITS_CHANGED );
1358 e.SetClientData(
this );
1359 ProcessEventLocally( e );
1371 if( !IsMaximized() )
1377 "Maximizing window - Saving position (%d, %d) with size (%d, %d)",
1390 wxSize winSize = GetSize();
1399 GTKDoGetSize( &width, &height );
1401 winSize.Set( width, height );
1404 wxSize winSize = GetSize();
1422 GetMenuBar()->Refresh();
1448WXLRESULT EDA_BASE_FRAME::MSWWindowProc( WXUINT message, WXWPARAM wParam, WXLPARAM lParam )
1452 if( message == WM_SYSCOMMAND )
1454 if( wParam == SC_KEYMENU && ( lParam >> 16 ) <= 0 )
1458 return wxFrame::MSWWindowProc( message, wParam, lParam );
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
Cursor control event types.
static TOOL_ACTION donate
static TOOL_ACTION listHotKeys
static TOOL_ACTION getInvolved
static TOOL_ACTION gettingStarted
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...
bool IsQuasiModal() const
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
Returns 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()
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)
Displays the preferences and settings of all opened editors paged dialog, starting with a particular ...
void initExitKey()
Sets the common key-pair for exiting the application (Ctrl-Q) and ties it to the wxID_EXIT event id.
void OnPreferences(wxCommandEvent &event)
Displays the preferences and settings of all opened editors paged dialog.
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.
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 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)
Removes 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 OnSize(wxSizeEvent &aEvent)
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)
Checks if aFileName can be written.
void OnMaximize(wxMaximizeEvent &aEvent)
virtual void OnDropFiles(wxDropFilesEvent &aEvent)
Handles event fired when a file is dropped to the window.
std::map< const wxString, TOOL_ACTION * > m_acceptedExts
Associates files 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)
Fetches the file name from the file history list.
static wxString GetAutoSaveFilePrefix()
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 NonUserClose() to indicate that the user did not request the current close.
void AddStandardHelpMenu(wxMenuBar *aMenuBar)
Adds the standard KiCad help menu to the menubar.
void ReCreateMenuBar()
Recreates 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
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.
void SetInitialPage(const wxString &aPage, const wxString &aParentPage=wxEmptyString)
wxTreebook * GetTreebook()
std::vector< TOOL_ACTION * > & ActionsList()
static wxString GetDefaultUserProjectsPath()
Gets the default path we point users to create projects.
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()
void SetUserUnits(EDA_UNITS aUnits)
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 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).
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
bool IsGUI()
Determine if the application is running with a GUI.
This file is part of the common library.
static const wxSize minSize(FRAME_T aFrameType)
wxDEFINE_EVENT(UNITS_CHANGED, wxCommandEvent)
static const wxSize defaultSize(FRAME_T aFrameType)
#define CREATE_PANEL(key)
#define DEFAULT_MAX_UNDO_ITEMS
std::function< void(wxUpdateUIEvent &) > UIUpdateHandler
This is the handler functor for the update UI events.
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_DISPLAY_OPTIONS
@ PANEL_PCB_ACTION_PLUGINS
@ PANEL_FP_DEFAULT_VALUES
@ PANEL_3DV_DISPLAY_OPTIONS
@ PANEL_DS_DISPLAY_OPTIONS
@ PANEL_PCB_DISPLAY_OPTIONS
@ PANEL_GBR_EXCELLON_OPTIONS
bool IsGerberFileExtension(const wxString &ext)
const std::string GerberFileExtension
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
const wxChar *const traceDisplayLocation
Flag to enable debug output of display positioning logic.
const wxChar *const kicadTraceKeyEvent
Flag to enable wxKeyEvent debug tracing.
void ReadHotKeyConfigIntoActions(const wxString &aFileName, std::vector< TOOL_ACTION * > &aActions)
Reads a hotkey config file into a list of actions.
LANGUAGE_DESCR LanguagesList[]
An array containing all the languages that KiCad supports.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
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)
struct WINDOW_STATE window
Stores the common settings that are saved and loaded for each window / frame.
Stores the window positioning/state.
wxString dump(const wxArrayString &aArray)
Debug helper for printing wxArrayString contents.
wxLogTrace helper definitions.