KiCad PCB EDA Suite
KICAD_MANAGER_FRAME Class Reference

The main KiCad project manager frame. More...

#include <kicad.h>

Inheritance diagram for KICAD_MANAGER_FRAME:
EDA_BASE_FRAME

Classes

class  TERMINATE_HANDLER
 

Public Member Functions

 KICAD_MANAGER_FRAME (wxWindow *parent, const wxString &title, const wxPoint &pos, const wxSize &size)
 
 ~KICAD_MANAGER_FRAME ()
 
void OnCloseWindow (wxCloseEvent &Event)
 
void OnSize (wxSizeEvent &event)
 
void OnChangeIconsOptions (wxCommandEvent &event) override
 Select the current icons options in menus (or toolbars) in Kicad (the default for toolbars/menus is 26x26 pixels, and shows icons in menus). More...
 
void OnLoadProject (wxCommandEvent &event)
 Load an exiting project (.pro) file. More...
 
void OnCreateProjectFromTemplate (wxCommandEvent &event)
 Creates a new project folder, copy a template into this new folder. More...
 
void OnNewProject (wxCommandEvent &aEvent)
 
void OnSaveProject (wxCommandEvent &event)
 Save the project (.pro) file containing the top level configuration parameters. More...
 
void OnArchiveFiles (wxCommandEvent &event)
 
void OnUnarchiveFiles (wxCommandEvent &event)
 
void OnRunEeschema (wxCommandEvent &event)
 
void OnRunSchLibEditor (wxCommandEvent &event)
 
void OnRunPcbNew (wxCommandEvent &event)
 
void OnRunPcbFpEditor (wxCommandEvent &event)
 
void OnRunGerbview (wxCommandEvent &event)
 
void OnRunBitmapConverter (wxCommandEvent &event)
 
void OnRunPcbCalculator (wxCommandEvent &event)
 
void OnRunPageLayoutEditor (wxCommandEvent &event)
 
void OnConfigurePaths (wxCommandEvent &aEvent)
 
void OnOpenTextEditor (wxCommandEvent &event)
 
void OnOpenFileInTextEditor (wxCommandEvent &event)
 
void OnOpenFileInEditor (wxCommandEvent &event)
 
void OnFileHistory (wxCommandEvent &event)
 
void OnExit (wxCommandEvent &event)
 
void Process_Preferences (wxCommandEvent &event)
 
void Process_Config (wxCommandEvent &event)
 
void ReCreateMenuBar () override
 (Re)Create the menubar More...
 
void RecreateBaseHToolbar ()
 (Re)Create the horizontal toolbar More...
 
void PrintMsg (const wxString &aText)
 Displays aText in the text panel. More...
 
void PrintPrjInfo ()
 Prints the current working directory name and the projet name on the text panel. More...
 
void ClearMsg ()
 Erase the text panel. More...
 
void OnRefresh (wxCommandEvent &event)
 
void OnSelectDefaultPdfBrowser (wxCommandEvent &event)
 
void OnSelectPreferredPdfBrowser (wxCommandEvent &event)
 
void OnUpdateDefaultPdfBrowser (wxUpdateUIEvent &event)
 
void OnUpdatePreferredPdfBrowser (wxUpdateUIEvent &event)
 
void OnUpdateRequiresProject (wxUpdateUIEvent &event)
 
void CreateNewProject (const wxFileName &aProjectFileName)
 Creates a new project by setting up and initial project, schematic, and board files. More...
 
void LoadProject (const wxFileName &aProjectFileName)
 
void LoadSettings (wxConfigBase *aCfg) override
 Function LoadSettings loads common frame parameters from a configuration file. More...
 
void SaveSettings (wxConfigBase *aCfg) override
 Function SaveSettings saves common frame parameters to a configuration data file. More...
 
void Execute (wxWindow *frame, const wxString &execFile, wxString param=wxEmptyString)
 Open another KiCad application and logs a message. More...
 
void OnChangeWatchedPaths (wxCommandEvent &aEvent)
 Called by sending a event with id = ID_INIT_WATCHED_PATHS rebuild the list of wahtched paths. More...
 
void SetProjectFileName (const wxString &aFullProjectProFileName)
 
const wxString GetProjectFileName ()
 
const wxString SchFileName ()
 
const wxString PcbFileName ()
 
const wxString PcbLegacyFileName ()
 
void ReCreateTreePrj ()
 
void RunPcbNew (const wxString &aProjectBoardFileName)
 Call this only for a PCB associated with the current project. More...
 
void RunEeschema (const wxString &aProjectSchematicFileName)
 Call this only for a SCH associated with the current project. More...
 
bool ProcessEvent (wxEvent &aEvent) override
 Function ProcessEvent overrides the default process event handler to implement the auto save feature. More...
 
bool Enable (bool enable) override
 
void SetAutoSaveInterval (int aInterval)
 
int GetAutoSaveInterval () const
 
bool IsType (FRAME_T aType) const
 
void GetKicadHelp (wxCommandEvent &event)
 
void GetKicadContribute (wxCommandEvent &event)
 
void GetKicadAbout (wxCommandEvent &event)
 
wxString ConfigBaseName ()
 Function ConfigBaseName. More...
 
virtual void SaveProjectSettings (bool aAskForSave)
 Function SaveProjectSettings saves changes to the project settings to the project (.pro) file. More...
 
virtual void OnSelectPreferredEditor (wxCommandEvent &event)
 Function OnSelectPreferredEditor Open a dialog to select the editor that will used in KiCad to edit or display files (reports ... More...
 
int ReadHotkeyConfig (struct EDA_HOTKEY_CONFIG *aDescList)
 Function ReadHotkeyConfig Read configuration data and fill the current hotkey list with hotkeys. More...
 
virtual int WriteHotkeyConfig (struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL)
 Function WriteHotkeyConfig Store the current hotkey list It is stored using the standard wxConfig mechanism or a file. More...
 
int ReadHotkeyConfigFile (const wxString &aFilename, struct EDA_HOTKEY_CONFIG *aDescList)
 Function ReadHotkeyConfigFile Read an old configuration file (&ltfile&gt.key) and fill the current hotkey list with hotkeys. More...
 
void ImportHotkeyConfigFromFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
 Function ImportHotkeyConfigFromFile Prompt the user for an old hotkey file to read, and read it. More...
 
void ExportHotkeyConfigToFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
 Function ExportHotkeyConfigToFile Prompt the user for an old hotkey file to read, and read it. More...
 
wxString GetFileFromHistory (int cmdId, const wxString &type, wxFileHistory *aFileHistory=NULL)
 Function GetFileFromHistory fetches the file name from the file history list. More...
 
void UpdateFileHistory (const wxString &FullFileName, wxFileHistory *aFileHistory=NULL)
 Function UpdateFileHistory Updates the list of recently opened files. More...
 
void SetMruPath (const wxString &aPath)
 
wxString GetMruPath () const
 
bool IsWritable (const wxFileName &aFileName)
 Function IsWritable checks if aFileName can be written. More...
 
void CheckForAutoSaveFile (const wxFileName &aFileName, const wxString &aBackupFileExtension)
 Function CheckForAutoSaveFile checks if an auto save file exists for aFileName and takes the appropriate action depending on the user input. More...
 
virtual void ShowChangedLanguage ()
 Function ShowChangedLanguage redraws the menus and what not in current language. More...
 
virtual void ShowChangedIcons ()
 Function ShowChangedIcons redraws items menus after a icon was changed option. More...
 
void AddMenuIconsOptions (wxMenu *MasterMenu)
 Function AddMenuIconsOptions creates a menu list for icons in menu and icon sizes choice, and add it as submenu to MasterMenu. More...
 
bool PostCommandMenuEvent (int evt_type)
 Function PostCommandMenuEvent. More...
 

Protected Member Functions

void onAutoSaveTimer (wxTimerEvent &aEvent)
 Function onAutoSaveTimer handles the auto save timer event. More...
 
virtual bool isAutoSaveRequired () const
 Function autoSaveRequired returns the auto save status of the application. More...
 
virtual bool doAutoSave ()
 Function doAutoSave should be overridden by the derived class to handle the auto save feature. More...
 

Protected Attributes

FRAME_T m_Ident
 Id Type (pcb, schematic, library..) More...
 
wxPoint m_FramePos
 
wxSize m_FrameSize
 
wxString m_configFrameName
 prefix used in config to identify some params (frame size...) if empty, the frame name defined in CTOR is used More...
 
wxAuiToolBar * m_mainToolBar
 Standard horizontal Toolbar. More...
 
wxString m_AboutTitle
 Name of program displayed in About. More...
 
wxAuiManager m_auimgr
 
bool m_hasAutoSave
 Flag to indicate if this frame supports auto save. More...
 
bool m_autoSaveState
 Flag to indicate the last auto save state. More...
 
int m_autoSaveInterval
 The auto save interval time in seconds. More...
 
wxTimer * m_autoSaveTimer
 The timer used to implement the auto save feature;. More...
 
wxString m_perspective
 wxAuiManager perspective. More...
 
wxString m_mruPath
 Most recently used path. More...
 

Private Member Functions

wxConfigBase * config () override
 Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME. More...
 
const SEARCH_STACKsys_search () override
 Function sys_search returns a SEARCH_STACK pertaining to entire program, and is overloaded in KICAD_MANAGER_FRAME. More...
 
wxString help_name () override
 
void language_change (wxCommandEvent &event)
 

Private Attributes

TREE_PROJECT_FRAMEm_LeftWin
 
LAUNCHER_PANELm_Launcher
 
wxTextCtrl * m_MessagesBox
 
wxAuiToolBar * m_VToolBar
 
int m_leftWinWidth
 
EDA_HOTKEY_CONFIGm_manager_Hokeys_Descr
 
bool m_active_project
 

Detailed Description

The main KiCad project manager frame.

It is not a KIWAY_PLAYER.

Definition at line 136 of file kicad.h.

Constructor & Destructor Documentation

KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME ( wxWindow *  parent,
const wxString &  title,
const wxPoint pos,
const wxSize &  size 
)

Definition at line 50 of file mainframe.cpp.

References config(), GetBuildVersion(), LAUNCHER_PANEL::GetPanelHeight(), LAUNCHER_PANEL::GetPanelWidth(), EDA_PANEINFO::HorizontalToolbarPane(), EDA_PANEINFO::InfoToolbarPane(), KiBitmap(), PCAD2KICAD::Left, LoadSettings(), m_active_project, EDA_BASE_FRAME::m_auimgr, EDA_BASE_FRAME::m_FramePos, EDA_BASE_FRAME::m_FrameSize, m_Launcher, m_LeftWin, m_leftWinWidth, EDA_BASE_FRAME::m_mainToolBar, m_manager_Hokeys_Descr, m_MessagesBox, RecreateBaseHToolbar(), ReCreateMenuBar(), wxPoint::x, and wxPoint::y.

51  :
52  EDA_BASE_FRAME( parent, KICAD_MAIN_FRAME_T, title, pos, size,
54 {
55  m_active_project = false;
56  m_leftWinWidth = 60;
58 
59  // Create the status line (bottom of the frame)
60  static const int dims[3] = { -1, -1, 100 };
61 
62  CreateStatusBar( 3 );
63  SetStatusWidths( 3, dims );
64 
65  // Give an icon
66  wxIcon icon;
67  icon.CopyFromBitmap( KiBitmap( icon_kicad_xpm ) );
68  SetIcon( icon );
69 
70  // Give the last sise and pos to main window
71  LoadSettings( config() );
72  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
73 
74  // Left window: is the box which display tree project
75  m_LeftWin = new TREE_PROJECT_FRAME( this );
76 
77  // Right top Window: buttons to launch applications
78  m_Launcher = new LAUNCHER_PANEL( this );
79 
80  // Add the wxTextCtrl showing all messages from KiCad:
81  m_MessagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString,
82  wxDefaultPosition, wxDefaultSize,
83  wxTE_MULTILINE | wxSUNKEN_BORDER | wxTE_READONLY );
84 
87 
88  m_auimgr.SetManagedWindow( this );
89 
90  EDA_PANEINFO horiztb;
91  horiztb.HorizontalToolbarPane();
92 
93  EDA_PANEINFO info;
94  info.InfoToolbarPane();
95 
96  m_auimgr.AddPane( m_mainToolBar,
97  wxAuiPaneInfo( horiztb ).Name( wxT( "m_mainToolBar" ) ).Top() );
98 
99  m_auimgr.AddPane( m_LeftWin,
100  wxAuiPaneInfo(info).Name( wxT( "m_LeftWin" ) ).Left().
101  BestSize( m_leftWinWidth, -1 ).
102  Layer( 1 ) );
103 
104  m_auimgr.AddPane( m_Launcher, wxTOP );
105  m_auimgr.GetPane( m_Launcher).CaptionVisible( false ).PaneBorder(false)
106  .MinSize( wxSize( m_Launcher->GetPanelWidth(), m_Launcher->GetPanelHeight() ) )
107  .Resizable( false );
108 
109  m_auimgr.AddPane( m_MessagesBox,
110  wxAuiPaneInfo().Name( wxT( "m_MessagesBox" ) ).CentrePane().Layer( 2 ) );
111 
112  m_auimgr.GetPane( m_LeftWin ).MinSize( wxSize( 150, -1) );
113  m_auimgr.GetPane( m_LeftWin ).BestSize(wxSize(m_leftWinWidth, -1) );
114 
115  m_auimgr.Update();
116 
117  SetTitle( wxString( "KiCad " ) + GetBuildVersion() );
118 }
EDA_PANEINFO & HorizontalToolbarPane()
Function HorizontalToolbarPane Change *this to a horizontal toolbar for KiCad.
Definition: wxstruct.h:479
#define KICAD_DEFAULT_DRAWFRAME_STYLE
Definition: wxstruct.h:55
class LAUNCHER_PANEL
Definition: kicad.h:314
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
Definition: mainframe.cpp:534
wxAuiManager m_auimgr
Definition: wxstruct.h:144
int GetPanelHeight() const
Specialization of the wxAuiPaneInfo class for KiCad panels.
Definition: wxstruct.h:470
LAUNCHER_PANEL * m_Launcher
Definition: kicad.h:299
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
wxString GetBuildVersion()
Function GetBuildVersion Return the build version string.
class TREE_PROJECT_FRAME Window to display the tree files
EDA_HOTKEY_CONFIG * m_manager_Hokeys_Descr
Definition: kicad.h:304
wxPoint m_FramePos
Definition: wxstruct.h:134
void RecreateBaseHToolbar()
(Re)Create the horizontal toolbar
EDA_PANEINFO & InfoToolbarPane()
Function InfoToolbarPane Change *this to a information panel for for KiCad.
Definition: wxstruct.h:544
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
Definition: wxstruct.h:140
void ReCreateMenuBar() override
(Re)Create the menubar
int GetPanelWidth() const
wxTextCtrl * m_MessagesBox
Definition: kicad.h:300
TREE_PROJECT_FRAME * m_LeftWin
Definition: kicad.h:298
wxConfigBase * config() override
Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_F...
Definition: mainframe.cpp:127
bool m_active_project
Definition: kicad.h:308
wxSize m_FrameSize
Definition: wxstruct.h:135
#define KICAD_MANAGER_FRAME_NAME
Definition: kicad.h:40
EDA_BASE_FRAME(wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName)
Definition: basicframe.cpp:74
KICAD_MANAGER_FRAME::~KICAD_MANAGER_FRAME ( )

Definition at line 121 of file mainframe.cpp.

References EDA_BASE_FRAME::m_auimgr.

122 {
123  m_auimgr.UnInit();
124 }
wxAuiManager m_auimgr
Definition: wxstruct.h:144

Member Function Documentation

void EDA_BASE_FRAME::AddMenuIconsOptions ( wxMenu *  MasterMenu)
inherited

Function AddMenuIconsOptions creates a menu list for icons in menu and icon sizes choice, and add it as submenu to MasterMenu.

Parameters
MasterMenuThe main menu. The sub menu list will be accessible from the menu item with id ID_KICAD_SELECT_ICONS_OPTIONS

Definition at line 673 of file basicframe.cpp.

References AddMenuItem(), ID_KICAD_SELECT_ICONS_IN_MENUS, ID_KICAD_SELECT_ICONS_OPTIONS, KiBitmap(), and Pgm().

Referenced by preparePreferencesMenu(), PL_EDITOR_FRAME::ReCreateMenuBar(), ReCreateMenuBar(), and GERBVIEW_FRAME::ReCreateMenuBar().

674 {
675  wxMenu* menu = NULL;
676  wxMenuItem* item = MasterMenu->FindItem( ID_KICAD_SELECT_ICONS_OPTIONS );
677 
678  if( item ) // This menu exists, do nothing
679  return;
680 
681  menu = new wxMenu;
682 
683  menu->Append( new wxMenuItem( menu, ID_KICAD_SELECT_ICONS_IN_MENUS,
684  _( "Icons in Menus" ), wxEmptyString,
685  wxITEM_CHECK ) );
686  menu->Check( ID_KICAD_SELECT_ICONS_IN_MENUS, Pgm().GetUseIconsInMenus() );
687 
688  AddMenuItem( MasterMenu, menu,
690  _( "Icons Options" ),
691  _( "Select show icons in menus and icons sizes" ),
692  KiBitmap( icon_xpm ) );
693 }
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Function AddMenuItem is an inline helper function to create and insert a menu item with an icon into ...
Definition: bitmap.cpp:55
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
void EDA_BASE_FRAME::CheckForAutoSaveFile ( const wxFileName &  aFileName,
const wxString &  aBackupFileExtension 
)
inherited

Function CheckForAutoSaveFile checks if an auto save file exists for aFileName and takes the appropriate action depending on the user input.

If an auto save file exists for aFileName, the user is prompted if they wish to replace file aFileName with the auto saved file. If the user chooses to replace the file, the backup file of aFileName is removed, aFileName is renamed to the backup file name, and the auto save file is renamed to aFileName. If user chooses to keep the existing version of aFileName, the auto save file is removed.

Parameters
aFileNameA wxFileName object containing the file name to check.
aBackupFileExtensionA wxString object containing the backup file extension used to create the backup file name.

Definition at line 578 of file basicframe.cpp.

References AUTOSAVE_PREFIX_FILENAME, Format(), GetChars(), Pgm(), and traceAutoSave.

Referenced by SCH_EDIT_FRAME::LoadOneEEFile(), and PCB_EDIT_FRAME::OpenProjectFiles().

580 {
581  wxCHECK_RET( aFileName.IsOk(), wxT( "Invalid file name!" ) );
582  wxCHECK_RET( !aBackupFileExtension.IsEmpty(), wxT( "Invalid backup file extension!" ) );
583 
584  wxFileName autoSaveFileName = aFileName;
585 
586  // Check for auto save file.
587  autoSaveFileName.SetName( AUTOSAVE_PREFIX_FILENAME + aFileName.GetName() );
588 
589  wxLogTrace( traceAutoSave,
590  wxT( "Checking for auto save file " ) + autoSaveFileName.GetFullPath() );
591 
592  if( !autoSaveFileName.FileExists() )
593  return;
594 
595  wxString msg = wxString::Format( _(
596  "Well this is potentially embarrassing!\n"
597  "It appears that the last time you were editing the file\n"
598  "'%s'\n"
599  "it was not saved properly. Do you wish to restore the last saved edits you made?" ),
600  GetChars( aFileName.GetFullName() )
601  );
602 
603  int response = wxMessageBox( msg, Pgm().App().GetAppName(), wxYES_NO | wxICON_QUESTION, this );
604 
605  // Make a backup of the current file, delete the file, and rename the auto save file to
606  // the file name.
607  if( response == wxYES )
608  {
609  // Get the backup file name.
610  wxFileName backupFileName = aFileName;
611  backupFileName.SetExt( aBackupFileExtension );
612 
613  // If an old backup file exists, delete it. If an old copy of the file exists, rename
614  // it to the backup file name
615  if( aFileName.FileExists() )
616  {
617  // Remove the old file backup file.
618  if( backupFileName.FileExists() )
619  wxRemoveFile( backupFileName.GetFullPath() );
620 
621  // Rename the old file to the backup file name.
622  if( !wxRenameFile( aFileName.GetFullPath(), backupFileName.GetFullPath() ) )
623  {
624  msg.Printf( _( "Could not create backup file <%s>" ),
625  GetChars( backupFileName.GetFullPath() ) );
626  wxMessageBox( msg );
627  }
628  }
629 
630  if( !wxRenameFile( autoSaveFileName.GetFullPath(), aFileName.GetFullPath() ) )
631  {
632  wxMessageBox( _( "The auto save file could not be renamed to the board file name." ),
633  Pgm().App().GetAppName(), wxOK | wxICON_EXCLAMATION, this );
634  }
635  }
636  else
637  {
638  wxLogTrace( traceAutoSave,
639  wxT( "Removing auto save file " ) + autoSaveFileName.GetFullPath() );
640 
641  // Remove the auto save file when using the previous file as is.
642  wxRemoveFile( autoSaveFileName.GetFullPath() );
643  }
644 }
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
#define AUTOSAVE_PREFIX_FILENAME
Prefix to create filenames for schematic files or other difile when auto-saved to retrieve a crash...
Definition: wxstruct.h:71
const wxChar traceAutoSave[]
Flag to enable auto save feature debug tracing.
Definition: basicframe.cpp:53
void KICAD_MANAGER_FRAME::ClearMsg ( )

Erase the text panel.

Definition at line 528 of file mainframe.cpp.

References m_MessagesBox.

Referenced by LoadProject(), and OnCreateProjectFromTemplate().

529 {
530  m_MessagesBox->Clear();
531 }
wxTextCtrl * m_MessagesBox
Definition: kicad.h:300
wxConfigBase * KICAD_MANAGER_FRAME::config ( )
overrideprivatevirtual

Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.

Reimplemented from EDA_BASE_FRAME.

Definition at line 127 of file mainframe.cpp.

References PGM_KICAD::PgmSettings(), and PgmTop().

Referenced by KICAD_MANAGER_FRAME().

128 {
129  wxConfigBase* ret = PgmTop().PgmSettings();
130  wxASSERT( ret );
131  return ret;
132 }
wxConfigBase * PgmSettings()
Definition: pgm_kicad.h:59
PGM_KICAD & PgmTop()
Definition: kicad.cpp:71
wxString EDA_BASE_FRAME::ConfigBaseName ( )
inlineinherited

Function ConfigBaseName.

Returns
a base name prefix used in Load/Save settings to build the full name of keys used in config. This is usually the name of the frame set by CTOR, unless m_configFrameName contains a base name. this is the case of frames which can be shown in normal or modal mode. This is needed because we want only one base name prefix, regardless the mode used.

Definition at line 260 of file wxstruct.h.

References EDA_BASE_FRAME::m_configFrameName.

Referenced by EDA_BASE_FRAME::LoadSettings(), EDA_DRAW_FRAME::LoadSettings(), EDA_BASE_FRAME::SaveSettings(), and EDA_DRAW_FRAME::SaveSettings().

261  {
262  wxString baseCfgName = m_configFrameName.IsEmpty() ? GetName() : m_configFrameName;
263  return baseCfgName;
264  }
wxString m_configFrameName
prefix used in config to identify some params (frame size...) if empty, the frame name defined in CTO...
Definition: wxstruct.h:137
void KICAD_MANAGER_FRAME::CreateNewProject ( const wxFileName &  aProjectFileName)

Creates a new project by setting up and initial project, schematic, and board files.

The project file is copied from the kicad.pro template file if possible. Otherwise, a minimal project file is created from an empty project. A minimal schematic and board file are created to prevent the schematic and board editors from complaining. If any of these files already exist, they are not overwritten.

Parameters
aProjectFileNameis the absolute path of the project file name.

Definition at line 108 of file prjconfig.cpp.

References PROJECT::ConfigSave(), SEARCH_STACK::FindValidPath(), GeneralGroupName, KiCadPcbFileExtension, LegacyPcbFileExtension, PgmTop(), Prj(), SchematicFileExtension, SetProjectFileName(), and sys_search().

Referenced by OnCreateProjectFromTemplate(), and OnNewProject().

109 {
110  wxCHECK_RET( aProjectFileName.DirExists() && aProjectFileName.IsDirWritable(),
111  "Project folder must exist and be writable to create a new project." );
112 
113  // Init project filename. This clears all elements from the project object.
114  SetProjectFileName( aProjectFileName.GetFullPath() );
115 
116  // Copy kicad.pro file from template folder.
117  if( !aProjectFileName.FileExists() )
118  {
119  wxString srcFileName = sys_search().FindValidPath( "kicad.pro" );
120 
121  // Create a minimal project (.pro) file if the template project file could not be copied.
122  if( !wxFileName::FileExists( srcFileName )
123  || !wxCopyFile( srcFileName, aProjectFileName.GetFullPath() ) )
124  {
126  }
127  }
128 
129  // Ensure a "stub" for a schematic root sheet and a board exist.
130  // It will avoid messages from the schematic editor or the board editor to create a new file
131  // And forces the user to create main files under the right name for the project manager
132  wxFileName fn( aProjectFileName.GetFullPath() );
133  fn.SetExt( SchematicFileExtension );
134 
135  // If a <project>.sch file does not exist, create a "stub" file ( minimal schematic file )
136  if( !fn.FileExists() )
137  {
138  wxFile file( fn.GetFullPath(), wxFile::write );
139 
140  if( file.IsOpened() )
141  file.Write( wxT( "EESchema Schematic File Version 2\n"
142  "EELAYER 25 0\nEELAYER END\n$EndSCHEMATC\n" ) );
143 
144  // wxFile dtor will close the file
145  }
146 
147  // If a <project>.kicad_pcb or <project>.brd file does not exist,
148  // create a .kicad_pcb "stub" file
149  fn.SetExt( KiCadPcbFileExtension );
150  wxFileName leg_fn( fn );
151  leg_fn.SetExt( LegacyPcbFileExtension );
152 
153  if( !fn.FileExists() && !leg_fn.FileExists() )
154  {
155  wxFile file( fn.GetFullPath(), wxFile::write );
156 
157  if( file.IsOpened() )
158  file.Write( wxT( "(kicad_pcb (version 4) (host kicad \"dummy file\") )\n" ) );
159 
160  // wxFile dtor will close the file
161  }
162 }
VTBL_ENTRY void ConfigSave(const SEARCH_STACK &aSList, const wxString &aGroupName, const PARAM_CFG_ARRAY &aParams, const wxString &aFileName=wxEmptyString)
Function ConfigSave saves the current "project" parameters into the wxConfigBase* derivative...
Definition: project.cpp:307
PARAM_CFG_ARRAY s_KicadManagerParams
Definition: prjconfig.cpp:58
PROJECT & Prj()
Definition: kicad.cpp:270
PGM_KICAD & PgmTop()
Definition: kicad.cpp:71
#define GeneralGroupName
Definition: prjconfig.cpp:56
const wxString SchematicFileExtension
void SetProjectFileName(const wxString &aFullProjectProFileName)
Definition: mainframe.cpp:135
const wxString LegacyPcbFileExtension
const wxString KiCadPcbFileExtension
wxString FindValidPath(const wxString &aFileName) const
Definition: search_stack.h:71
const SEARCH_STACK & sys_search() override
Function sys_search returns a SEARCH_STACK pertaining to entire program, and is overloaded in KICAD_M...
Definition: mainframe.cpp:189
bool EDA_BASE_FRAME::doAutoSave ( )
protectedvirtualinherited

Function doAutoSave should be overridden by the derived class to handle the auto save feature.

Returns
true if the auto save was successful otherwise false.

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 231 of file basicframe.cpp.

Referenced by EDA_BASE_FRAME::onAutoSaveTimer().

232 {
233  wxCHECK_MSG( false, true, wxT( "Auto save timer function not overridden. Bad programmer!" ) );
234 }
bool EDA_BASE_FRAME::Enable ( bool  enable)
overrideinherited

Definition at line 192 of file basicframe.cpp.

Referenced by FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), and KIWAY_PLAYER::ShowModal().

193 {
194  // so we can do logging of this state change:
195 
196 #if defined(DEBUG)
197  const char* type_id = typeid( *this ).name();
198  printf( "wxFrame %-28s: %s\n", type_id, enable ? "enabled" : "disabled" );
199 #endif
200 
201  return wxFrame::Enable( enable );
202 }
void KICAD_MANAGER_FRAME::Execute ( wxWindow *  frame,
const wxString &  execFile,
wxString  param = wxEmptyString 
)

Open another KiCad application and logs a message.

Parameters
frame= owner frame.
execFile= name of the executable file.
param= parameters to be passed to the executable.

Definition at line 272 of file mainframe.cpp.

References AddDelimiterString(), ExecuteFile(), Format(), GetChars(), and PrintMsg().

Referenced by TREEPROJECT_ITEM::Activate(), OnOpenFileInTextEditor(), OnOpenTextEditor(), OnRunBitmapConverter(), OnRunGerbview(), OnRunPageLayoutEditor(), and OnRunPcbCalculator().

274 {
275  if( params.size() )
276  AddDelimiterString( params );
277 
278  TERMINATE_HANDLER* callback = new TERMINATE_HANDLER( execFile );
279 
280  long pid = ExecuteFile( frame, execFile, params, callback );
281 
282  if( pid > 0 )
283  {
284  wxString msg = wxString::Format( _( "%s %s opened [pid=%ld]\n" ),
285  GetChars( execFile ), GetChars( params ), pid );
286 
287  PrintMsg( msg );
288  }
289  else
290  {
291  delete callback;
292  }
293 }
void PrintMsg(const wxString &aText)
Displays aText in the text panel.
Definition: mainframe.cpp:201
void AddDelimiterString(wxString &string)
Function AddDelimiterString Add un " to the start and the end of string (if not already done)...
Definition: gestfich.cpp:44
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
int ExecuteFile(wxWindow *frame, const wxString &ExecFile, const wxString &param, wxProcess *callback)
Function ExecuteFile calls the executable file ExecFile with the command line parameters param...
Definition: gestfich.cpp:208
void EDA_BASE_FRAME::ExportHotkeyConfigToFile ( EDA_HOTKEY_CONFIG aDescList,
const wxString &  aDefaultShortname 
)
inherited

Function ExportHotkeyConfigToFile Prompt the user for an old hotkey file to read, and read it.

Parameters
aDescList= current hotkey list descr. to initialize.
aDefaultShortname= a default short name (extention not needed) like eechema, kicad...

Definition at line 768 of file hotkeys_basic.cpp.

References DEFAULT_HOTKEY_FILENAME_EXT, EDA_FILE_SELECTOR(), EDA_BASE_FRAME::GetMruPath(), Prj(), EDA_BASE_FRAME::SetMruPath(), and EDA_BASE_FRAME::WriteHotkeyConfig().

Referenced by Process_Config(), LIB_EDIT_FRAME::Process_Config(), SCH_EDIT_FRAME::Process_Config(), PL_EDITOR_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Config(), GERBVIEW_FRAME::Process_Config(), and FOOTPRINT_EDIT_FRAME::ProcessPreferences().

770 {
771  wxString ext = DEFAULT_HOTKEY_FILENAME_EXT;
772  wxString mask = wxT( "*." ) + ext;
773 
774 #if 0
775  wxString path = wxPathOnly( Prj().GetProjectFullName() );
776 #else
777  wxString path = GetMruPath();
778 #endif
779  wxFileName fn( aDefaultShortname );
780  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
781 
782  wxString filename = EDA_FILE_SELECTOR( _( "Write Hotkey Configuration File:" ),
783  path,
784  fn.GetFullPath(),
785  ext,
786  mask,
787  this,
788  wxFD_SAVE,
789  true );
790 
791  if( filename.IsEmpty() )
792  return;
793 
794  WriteHotkeyConfig( aDescList, &filename );
795  SetMruPath( wxFileName( filename ).GetPath() );
796 }
void SetMruPath(const wxString &aPath)
Definition: wxstruct.h:361
PROJECT & Prj()
Definition: kicad.cpp:270
wxString EDA_FILE_SELECTOR(const wxString &aTitle, const wxString &aPath, const wxString &aFileName, const wxString &aExtension, const wxString &aWildcard, wxWindow *aParent, int aStyle, const bool aKeepWorkingDirectory, const wxPoint &aPosition, wxString *aMruPath)
Function EDA_FILE_SELECTOR.
Definition: gestfich.cpp:82
virtual int WriteHotkeyConfig(struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL)
Function WriteHotkeyConfig Store the current hotkey list It is stored using the standard wxConfig mec...
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34
wxString GetMruPath() const
Definition: wxstruct.h:363
int EDA_BASE_FRAME::GetAutoSaveInterval ( ) const
inlineinherited

Definition at line 219 of file wxstruct.h.

References EDA_BASE_FRAME::m_autoSaveInterval.

Referenced by DIALOG_GENERALOPTIONS::init(), and SCH_EDIT_FRAME::OnPreferencesOptions().

219 { return m_autoSaveInterval; }
int m_autoSaveInterval
The auto save interval time in seconds.
Definition: wxstruct.h:153
wxString EDA_BASE_FRAME::GetFileFromHistory ( int  cmdId,
const wxString &  type,
wxFileHistory *  aFileHistory = NULL 
)
inherited

Function GetFileFromHistory fetches the file name from the file history list.

and removes the selected file, if this file does not exists Note also the menu is updated, if wxFileHistory::UseMenu was called at init time

Parameters
cmdIdThe command ID associated with the aFileHistory object.
typePlease document me!
aFileHistoryThe wxFileHistory in use. If null, the main application file history is used
Returns
a wxString containing the selected filename

Definition at line 400 of file basicframe.cpp.

References Format(), GetChars(), KIFACE_I::GetFileHistory(), and Kiface().

Referenced by GERBVIEW_FRAME::OnDrlFileHistory(), OnFileHistory(), PL_EDITOR_FRAME::OnFileHistory(), PCB_EDIT_FRAME::OnFileHistory(), GERBVIEW_FRAME::OnGbrFileHistory(), GERBVIEW_FRAME::OnJobFileHistory(), and GERBVIEW_FRAME::OnZipFileHistory().

402 {
403  wxFileHistory* fileHistory = aFileHistory;
404 
405  if( !fileHistory )
406  fileHistory = &Kiface().GetFileHistory();
407 
408  int baseId = fileHistory->GetBaseId();
409 
410  wxASSERT( cmdId >= baseId && cmdId < baseId + (int) fileHistory->GetCount() );
411 
412  unsigned i = cmdId - baseId;
413 
414  if( i < fileHistory->GetCount() )
415  {
416  wxString fn = fileHistory->GetHistoryFile( i );
417 
418  if( wxFileName::FileExists( fn ) )
419  return fn;
420  else
421  {
422  wxString msg = wxString::Format(
423  wxT( "file '%s' was not found." ),
424  GetChars( fn ) );
425 
426  wxMessageBox( msg );
427 
428  fileHistory->RemoveFileFromHistory( i );
429  }
430  }
431 
432  return wxEmptyString;
433 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
wxFileHistory & GetFileHistory()
Definition: kiface_i.h:123
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
void EDA_BASE_FRAME::GetKicadAbout ( wxCommandEvent &  event)
inherited

Definition at line 527 of file basicframe.cpp.

References ShowAboutDialog().

528 {
529  void ShowAboutDialog(EDA_BASE_FRAME * aParent); // See AboutDialog_main.cpp
530  ShowAboutDialog( this );
531 }
void ShowAboutDialog(EDA_BASE_FRAME *aParent)
Class EDA_BASE_FRAME is the base frame for deriving all KiCad main window classes.
Definition: wxstruct.h:117
void EDA_BASE_FRAME::GetKicadContribute ( wxCommandEvent &  event)
inherited

Definition at line 514 of file basicframe.cpp.

References URL_GET_INVOLVED.

515 {
516  if( !wxLaunchDefaultBrowser( URL_GET_INVOLVED ) )
517  {
518  wxString msg;
519  msg.Printf( _( "Could not launch the default browser.\n"
520  "For information on how to help the KiCad project, visit %s" ),
522  wxMessageBox( msg, _( "Get involved with KiCad" ), wxOK, this );
523  }
524 }
#define URL_GET_INVOLVED
Definition: basicframe.cpp:51
void EDA_BASE_FRAME::GetKicadHelp ( wxCommandEvent &  event)
inherited

Definition at line 436 of file basicframe.cpp.

References DIM, Format(), GetAssociatedDocument(), GetChars(), EDA_BASE_FRAME::help_name(), SearchHelpFileFullPath(), and EDA_BASE_FRAME::sys_search().

437 {
438  const SEARCH_STACK& search = sys_search();
439 
440  /* We have to get document for beginners,
441  * or the full specific doc
442  * if event id is wxID_INDEX, we want the document for beginners.
443  * else the specific doc file (its name is in Kiface().GetHelpFileName())
444  * The document for beginners is the same for all KiCad utilities
445  */
446  if( event.GetId() == wxID_INDEX )
447  {
448  // List of possible names for Getting Started in KiCad
449  const wxChar* names[2] = {
450  wxT( "getting_started_in_kicad" ),
451  wxT( "Getting_Started_in_KiCad" )
452  };
453 
454  wxString helpFile;
455  // Search for "getting_started_in_kicad.html" or "getting_started_in_kicad.pdf"
456  // or "Getting_Started_in_KiCad.html" or "Getting_Started_in_KiCad.pdf"
457  for( unsigned ii = 0; ii < DIM( names ); ii++ )
458  {
459  helpFile = SearchHelpFileFullPath( search, names[ii] );
460 
461  if( !helpFile.IsEmpty() )
462  break;
463  }
464 
465  if( !helpFile )
466  {
467  wxString msg = wxString::Format( _(
468  "Html or pdf help file \n'%s'\n or\n'%s' could not be found." ), names[0], names[1] );
469  wxMessageBox( msg );
470  }
471  else
472  {
473  GetAssociatedDocument( this, helpFile );
474  }
475 
476  return;
477  }
478 
479  wxString base_name = help_name();
480  wxString helpFile = SearchHelpFileFullPath( search, base_name );
481 
482  if( !helpFile )
483  {
484  wxString msg = wxString::Format( _(
485  "Help file '%s' could not be found." ),
486  GetChars( base_name )
487  );
488  wxMessageBox( msg );
489  }
490  else
491  {
492  GetAssociatedDocument( this, helpFile );
493  }
494 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
bool GetAssociatedDocument(wxWindow *aParent, const wxString &aDocName, const wxPathList *aPaths)
Function GetAssociatedDocument open a document (file) with the suitable browser.
Definition: eda_doc.cpp:86
Class SEARCH_STACK looks for files in a number of places.
Definition: search_stack.h:41
virtual const SEARCH_STACK & sys_search()
Function sys_search returns a SEARCH_STACK pertaining to entire program, and is overloaded in KICAD_M...
Definition: basicframe.cpp:370
wxString SearchHelpFileFullPath(const SEARCH_STACK &aSStack, const wxString &aBaseName)
Function SearchHelpFileFullPath returns the help file's full path.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
virtual wxString help_name()
Definition: basicframe.cpp:376
wxString EDA_BASE_FRAME::GetMruPath ( ) const
inlineinherited

Definition at line 363 of file wxstruct.h.

References EDA_BASE_FRAME::m_mruPath.

Referenced by EDA_BASE_FRAME::ExportHotkeyConfigToFile(), EDA_BASE_FRAME::ImportHotkeyConfigFromFile(), OnLoadProject(), and OnNewProject().

363 { return m_mruPath; }
wxString m_mruPath
Most recently used path.
Definition: wxstruct.h:160
const wxString KICAD_MANAGER_FRAME::GetProjectFileName ( )
wxString KICAD_MANAGER_FRAME::help_name ( )
overrideprivatevirtual

Reimplemented from EDA_BASE_FRAME.

Definition at line 195 of file mainframe.cpp.

References PGM_KICAD::GetHelpFileName(), and PgmTop().

196 {
197  return PgmTop().GetHelpFileName();
198 }
PGM_KICAD & PgmTop()
Definition: kicad.cpp:71
wxString GetHelpFileName()
Definition: pgm_kicad.h:63
void EDA_BASE_FRAME::ImportHotkeyConfigFromFile ( EDA_HOTKEY_CONFIG aDescList,
const wxString &  aDefaultShortname 
)
inherited

Function ImportHotkeyConfigFromFile Prompt the user for an old hotkey file to read, and read it.

Parameters
aDescList= current hotkey list descr. to initialize.
aDefaultShortname= a default short name (extention not needed) like eechema, kicad...

Definition at line 737 of file hotkeys_basic.cpp.

References DEFAULT_HOTKEY_FILENAME_EXT, EDA_FILE_SELECTOR(), EDA_BASE_FRAME::GetMruPath(), Prj(), EDA_BASE_FRAME::ReadHotkeyConfigFile(), and EDA_BASE_FRAME::SetMruPath().

Referenced by Process_Config(), LIB_EDIT_FRAME::Process_Config(), SCH_EDIT_FRAME::Process_Config(), PL_EDITOR_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Config(), GERBVIEW_FRAME::Process_Config(), and FOOTPRINT_EDIT_FRAME::ProcessPreferences().

739 {
740  wxString ext = DEFAULT_HOTKEY_FILENAME_EXT;
741  wxString mask = wxT( "*." ) + ext;
742 
743 #if 0 // pass in the project dir as an argument
744  wxString path = wxPathOnly( Prj().GetProjectFullName() );
745 #else
746  wxString path = GetMruPath();
747 #endif
748  wxFileName fn( aDefaultShortname );
749  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
750 
751  wxString filename = EDA_FILE_SELECTOR( _( "Read Hotkey Configuration File:" ),
752  path,
753  fn.GetFullPath(),
754  ext,
755  mask,
756  this,
757  wxFD_OPEN,
758  true );
759 
760  if( filename.IsEmpty() )
761  return;
762 
763  ReadHotkeyConfigFile( filename, aDescList );
764  SetMruPath( wxFileName( filename ).GetPath() );
765 }
void SetMruPath(const wxString &aPath)
Definition: wxstruct.h:361
int ReadHotkeyConfigFile(const wxString &aFilename, struct EDA_HOTKEY_CONFIG *aDescList)
Function ReadHotkeyConfigFile Read an old configuration file (<file>.key) and fill the current ho...
PROJECT & Prj()
Definition: kicad.cpp:270
wxString EDA_FILE_SELECTOR(const wxString &aTitle, const wxString &aPath, const wxString &aFileName, const wxString &aExtension, const wxString &aWildcard, wxWindow *aParent, int aStyle, const bool aKeepWorkingDirectory, const wxPoint &aPosition, wxString *aMruPath)
Function EDA_FILE_SELECTOR.
Definition: gestfich.cpp:82
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34
wxString GetMruPath() const
Definition: wxstruct.h:363
virtual bool EDA_BASE_FRAME::isAutoSaveRequired ( ) const
inlineprotectedvirtualinherited

Function autoSaveRequired returns the auto save status of the application.

Override this function if your derived frame supports automatic file saving.

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 173 of file wxstruct.h.

Referenced by EDA_BASE_FRAME::ProcessEvent().

173 { return false; }
bool EDA_BASE_FRAME::IsType ( FRAME_T  aType) const
inlineinherited
bool EDA_BASE_FRAME::IsWritable ( const wxFileName &  aFileName)
inherited

Function IsWritable checks if aFileName can be written.

The function performs a number of tests on aFileName to verify that it can be saved. If aFileName defines a path with no file name, them the path is tested for user write permission. If aFileName defines a file name that does not exist in the path, the path is tested for user write permission. If aFileName defines a file that already exits, the file name is tested for user write permissions.

Note
The file name path must be set or an assertion will be raised on debug builds and return false on release builds.
Parameters
aFileNameThe full path and/or file name of the file to test.
Returns
False if aFileName cannot be written.

Definition at line 534 of file basicframe.cpp.

References GetChars().

Referenced by SCH_EDIT_FRAME::doAutoSave(), LIB_EDIT_FRAME::SaveActiveLibrary(), SCH_EDIT_FRAME::SaveEEFile(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), CVPCB_MAINFRAME::SaveProjectFile(), and SCH_EDIT_FRAME::SaveProjectSettings().

535 {
536  wxString msg;
537  wxFileName fn = aFileName;
538 
539  // Check for absence of a file path with a file name. Unfortunately KiCad
540  // uses paths relative to the current project path without the ./ part which
541  // confuses wxFileName. Making the file name path absolute may be less than
542  // elegant but it solves the problem.
543  if( fn.GetPath().IsEmpty() && fn.HasName() )
544  fn.MakeAbsolute();
545 
546  wxCHECK_MSG( fn.IsOk(), false,
547  wxT( "File name object is invalid. Bad programmer!" ) );
548  wxCHECK_MSG( !fn.GetPath().IsEmpty(), false,
549  wxT( "File name object path <" ) + fn.GetFullPath() +
550  wxT( "> is not set. Bad programmer!" ) );
551 
552  if( fn.IsDir() && !fn.IsDirWritable() )
553  {
554  msg.Printf( _( "You do not have write permissions to folder <%s>." ),
555  GetChars( fn.GetPath() ) );
556  }
557  else if( !fn.FileExists() && !fn.IsDirWritable() )
558  {
559  msg.Printf( _( "You do not have write permissions to save file <%s> to folder <%s>." ),
560  GetChars( fn.GetFullName() ), GetChars( fn.GetPath() ) );
561  }
562  else if( fn.FileExists() && !fn.IsFileWritable() )
563  {
564  msg.Printf( _( "You do not have write permissions to save file <%s>." ),
565  GetChars( fn.GetFullPath() ) );
566  }
567 
568  if( !msg.IsEmpty() )
569  {
570  wxMessageBox( msg );
571  return false;
572  }
573 
574  return true;
575 }
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void KICAD_MANAGER_FRAME::language_change ( wxCommandEvent &  event)
private

Definition at line 521 of file mainframe.cpp.

References Kiway, and KIWAY::SetLanguage().

522 {
523  int id = event.GetId();
524  Kiway.SetLanguage( id );
525 }
VTBL_ENTRY void SetLanguage(int aLanguage)
Function SetLanguage changes the language and then calls ShowChangedLanguage() on all KIWAY_PLAYERs...
Definition: kiway.cpp:396
KIWAY Kiway
void KICAD_MANAGER_FRAME::LoadProject ( const wxFileName &  aProjectFileName)

Definition at line 61 of file prjconfig.cpp.

References ClearMsg(), PROJECT::ConfigLoad(), GeneralGroupName, GetBuildVersion(), PGM_KICAD::GetFileHistory(), ID_INIT_WATCHED_PATHS, Kiway, m_active_project, m_LeftWin, PgmTop(), KIWAY::PlayersClose(), PrintPrjInfo(), Prj(), TREE_PROJECT_FRAME::ReCreateTreePrj(), EDA_BASE_FRAME::SetMruPath(), SetProjectFileName(), and EDA_BASE_FRAME::UpdateFileHistory().

Referenced by PGM_KICAD::MacOpenFile(), OnCreateProjectFromTemplate(), OnFileHistory(), OnLoadProject(), OnNewProject(), and PGM_KICAD::OnPgmInit().

62 {
63  // The project file should be valid by the time we get here or something has gone wrong.
64  if( !aProjectFileName.Exists() )
65  return;
66 
67  // Any open KIFACE's must be closed if they are not part of the new project.
68  // (We never want a KIWAY_PLAYER open on a KIWAY that isn't in the same project.)
69  // User is prompted here to close those KIWAY_PLAYERs:
70  if( !Kiway.PlayersClose( false ) )
71  return;
72 
73  SetTitle( wxString( "KiCad " ) + GetBuildVersion() );
74 
75  // Save the project file for the currently loaded project.
76  if( m_active_project )
78 
79  m_active_project = true;
80  ClearMsg();
81  SetProjectFileName( aProjectFileName.GetFullPath() );
83 
84  wxString title = GetTitle() + " " + aProjectFileName.GetFullPath();
85 
86  if( !aProjectFileName.IsDirWritable() )
87  title += _( " [Read Only]" );
88  else
89  SetMruPath( Prj().GetProjectPath() ); // Only set MRU path if we have write access. Why?
90 
91  SetTitle( title );
92 
93  UpdateFileHistory( aProjectFileName.GetFullPath(), &PgmTop().GetFileHistory() );
94 
96 
97  // Rebuild the list of watched paths.
98  // however this is possible only when the main loop event handler is running,
99  // so we use it to run the rebuild function.
100  wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED, ID_INIT_WATCHED_PATHS );
101 
102  wxPostEvent( this, cmd );
103 
104  PrintPrjInfo();
105 }
VTBL_ENTRY bool PlayersClose(bool doForce)
Function PlayersClose calls the KIWAY_PLAYER::Close( bool force ) function on all the windows and if ...
Definition: kiway.cpp:374
void SetMruPath(const wxString &aPath)
Definition: wxstruct.h:361
PARAM_CFG_ARRAY s_KicadManagerParams
Definition: prjconfig.cpp:58
PROJECT & Prj()
Definition: kicad.cpp:270
void UpdateFileHistory(const wxString &FullFileName, wxFileHistory *aFileHistory=NULL)
Function UpdateFileHistory Updates the list of recently opened files.
Definition: basicframe.cpp:388
wxString GetBuildVersion()
Function GetBuildVersion Return the build version string.
void ReCreateTreePrj()
Create or modify the tree showing project file names.
PGM_KICAD & PgmTop()
Definition: kicad.cpp:71
#define GeneralGroupName
Definition: prjconfig.cpp:56
void SetProjectFileName(const wxString &aFullProjectProFileName)
Definition: mainframe.cpp:135
TREE_PROJECT_FRAME * m_LeftWin
Definition: kicad.h:298
VTBL_ENTRY bool ConfigLoad(const SEARCH_STACK &aSearchS, const wxString &aGroupName, const PARAM_CFG_ARRAY &aParams, const wxString &aForeignConfigFileName=wxEmptyString)
Function ConfigLoad reads a subset of parameters from the "project" file.
Definition: project.cpp:342
bool m_active_project
Definition: kicad.h:308
wxFileHistory & GetFileHistory()
Definition: pgm_kicad.h:57
void ClearMsg()
Erase the text panel.
Definition: mainframe.cpp:528
void PrintPrjInfo()
Prints the current working directory name and the projet name on the text panel.
Definition: mainframe.cpp:548
KIWAY Kiway
void KICAD_MANAGER_FRAME::LoadSettings ( wxConfigBase *  aCfg)
overridevirtual

Function LoadSettings loads common frame parameters from a configuration file.

Don't forget to call the base method or your frames won't remember their positions and sizes.

Reimplemented from EDA_BASE_FRAME.

Definition at line 534 of file mainframe.cpp.

References EDA_BASE_FRAME::LoadSettings(), m_leftWinWidth, and TREE_FRAME_WIDTH_ENTRY.

Referenced by KICAD_MANAGER_FRAME().

535 {
537  aCfg->Read( TREE_FRAME_WIDTH_ENTRY, &m_leftWinWidth );
538 }
#define TREE_FRAME_WIDTH_ENTRY
Definition: mainframe.cpp:48
virtual void LoadSettings(wxConfigBase *aCfg)
Function LoadSettings loads common frame parameters from a configuration file.
Definition: basicframe.cpp:256
void KICAD_MANAGER_FRAME::OnArchiveFiles ( wxCommandEvent &  event)

Definition at line 129 of file kicad/files-io.cpp.

References DIM, Format(), GetChars(), GetProjectFileName(), PrintMsg(), and ZipFileWildcard.

130 {
131  // List of file extensions to save.
132  static const wxChar* extentionList[] = {
133  wxT( "*.sch" ), wxT( "*.lib" ), wxT( "*.mod" ), wxT( "*.cmp" ),
134  wxT( "*.brd" ), wxT( "*.kicad_pcb" ), wxT( "*.gbr" ), wxT( "*.pos" ),
135  wxT( "*.net" ), wxT( "*.pro" ), wxT( "*.drl" ), wxT( "*.py" ),
136  wxT( "*.pdf" ), wxT( "*.txt" ), wxT( "*.dcm" ), wxT( "*.kicad_wks" ),
137  };
138 
139  wxString msg;
140  wxFileName fileName = GetProjectFileName();
141  wxString oldCwd = wxGetCwd();
142 
143  fileName.SetExt( wxT( "zip" ) );
144 
145  wxFileDialog dlg( this, _( "Archive Project Files" ),
146  fileName.GetPath(), fileName.GetFullName(),
147  ZipFileWildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
148 
149  if( dlg.ShowModal() == wxID_CANCEL )
150  return;
151 
152  wxFileName zip = dlg.GetPath();
153 
154  wxString currdirname = fileName.GetPathWithSep();
155  wxDir dir( currdirname );
156 
157  if( !dir.IsOpened() ) // wxWidgets display a error message on issue.
158  return;
159 
160  wxSetWorkingDirectory( currdirname );
161 
162  // Prepare the zip file
163  wxString zipfilename = zip.GetFullPath();
164 
165  wxFFileOutputStream ostream( zipfilename );
166 
167  if( !ostream.IsOk() ) // issue to create the file. Perhaps not writable dir
168  {
169  wxMessageBox( wxString::Format( _( "Unable to create zip archive file '%s'" ),
170  zipfilename ) );
171  return;
172  }
173 
174  wxZipOutputStream zipstream( ostream );
175 
176  // Build list of filenames to put in zip archive
177  wxString currFilename;
178 
179  wxArrayString files;
180 
181  for( unsigned ii = 0; ii < DIM( extentionList ); ii++ )
182  wxDir::GetAllFiles( currdirname, &files, extentionList[ii] );
183 
184  files.Sort();
185 
186  int zipBytesCnt = 0;
187 
188  for( unsigned ii = 0; ii < files.GetCount(); ii++ )
189  {
190  wxFileSystem fsfile;
191 
192  wxFileName curr_fn( files[ii] );
193  curr_fn.MakeRelativeTo( currdirname );
194  currFilename = curr_fn.GetFullPath();
195 
196  msg.Printf( _( "Archive file <%s>" ), GetChars( currFilename ) );
197  PrintMsg( msg );
198 
199  // Read input file and add it to the zip file:
200  wxFSFile* infile = fsfile.OpenFile( currFilename );
201 
202  if( infile )
203  {
204  zipstream.PutNextEntry( currFilename, infile->GetModificationTime() );
205  infile->GetStream()->Read( zipstream );
206  zipstream.CloseEntry();
207  int zippedsize = zipstream.GetSize() - zipBytesCnt;
208  zipBytesCnt = zipstream.GetSize();
209  PrintMsg( wxT(" ") );
210  msg.Printf( _( "(%lu bytes, compressed %d bytes)\n" ),
211  (unsigned long)infile->GetStream()->GetSize(), zippedsize );
212  PrintMsg( msg );
213  delete infile;
214  }
215  else
216  PrintMsg( _( " >>Error\n" ) );
217  }
218 
219  zipBytesCnt = ostream.GetSize();
220 
221  if( zipstream.Close() )
222  {
223  msg.Printf( _( "\nZip archive <%s> created (%d bytes)" ),
224  GetChars( zipfilename ), zipBytesCnt );
225  PrintMsg( msg );
226  PrintMsg( wxT( "\n** end **\n" ) );
227  }
228  else
229  {
230  msg.Printf( wxT( "Unable to create archive <%s>, abort\n" ),
231  GetChars( zipfilename ) );
232  PrintMsg( msg );
233  }
234 
235  wxSetWorkingDirectory( oldCwd );
236 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
void PrintMsg(const wxString &aText)
Displays aText in the text panel.
Definition: mainframe.cpp:201
const wxString GetProjectFileName()
Definition: mainframe.cpp:147
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
#define ZipFileWildcard
void EDA_BASE_FRAME::onAutoSaveTimer ( wxTimerEvent &  aEvent)
protectedinherited

Function onAutoSaveTimer handles the auto save timer event.

Definition at line 224 of file basicframe.cpp.

References EDA_BASE_FRAME::doAutoSave(), EDA_BASE_FRAME::m_autoSaveInterval, and EDA_BASE_FRAME::m_autoSaveTimer.

Referenced by EDA_BASE_FRAME::EDA_BASE_FRAME().

225 {
226  if( !doAutoSave() )
227  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
228 }
virtual bool doAutoSave()
Function doAutoSave should be overridden by the derived class to handle the auto save feature...
Definition: basicframe.cpp:231
wxTimer * m_autoSaveTimer
The timer used to implement the auto save feature;.
Definition: wxstruct.h:156
int m_autoSaveInterval
The auto save interval time in seconds.
Definition: wxstruct.h:153
void KICAD_MANAGER_FRAME::OnChangeIconsOptions ( wxCommandEvent &  event)
overridevirtual

Select the current icons options in menus (or toolbars) in Kicad (the default for toolbars/menus is 26x26 pixels, and shows icons in menus).

Reimplemented from EDA_BASE_FRAME.

Definition at line 446 of file mainframe.cpp.

References Kiway, EDA_BASE_FRAME::OnChangeIconsOptions(), and KIWAY::ShowChangedIcons().

447 {
450 }
virtual void OnChangeIconsOptions(wxCommandEvent &event)
Function OnChangeIconsOptions Selects the current icons options in menus (or toolbars) in Kicad (the ...
Definition: basicframe.cpp:662
VTBL_ENTRY void ShowChangedIcons()
Function ShowChangedIcons Calls ShowChangedIcons() on all KIWAY_PLAYERs.
Definition: kiway.cpp:432
KIWAY Kiway
void KICAD_MANAGER_FRAME::OnChangeWatchedPaths ( wxCommandEvent &  aEvent)

Called by sending a event with id = ID_INIT_WATCHED_PATHS rebuild the list of wahtched paths.

Definition at line 1093 of file tree_project_frame.cpp.

References TREE_PROJECT_FRAME::FileWatcherReset(), and m_LeftWin.

1094 {
1096 }
void FileWatcherReset()
Reinit the watched paths Should be called after opening a new project to rebuild the list of watched ...
TREE_PROJECT_FRAME * m_LeftWin
Definition: kicad.h:298
void KICAD_MANAGER_FRAME::OnCloseWindow ( wxCloseEvent &  Event)

Definition at line 216 of file mainframe.cpp.

References PGM_KICAD::GetFileHistory(), GetProjectFileName(), Kiway, EDA_BASE_FRAME::m_FramePos, EDA_BASE_FRAME::m_FrameSize, m_LeftWin, PgmTop(), KIWAY::PlayersClose(), EDA_BASE_FRAME::UpdateFileHistory(), wxPoint::x, and wxPoint::y.

217 {
218  if( Kiway.PlayersClose( false ) )
219  {
220  int px, py;
221 
222  if( !GetProjectFileName().empty() )
224 
225  if( !IsIconized() ) // save main frame position and size
226  {
227  GetPosition( &px, &py );
228  m_FramePos.x = px;
229  m_FramePos.y = py;
230 
231  GetSize( &px, &py );
232  m_FrameSize.x = px;
233  m_FrameSize.y = py;
234  }
235 
236  Event.SetCanVeto( true );
237 
238  m_LeftWin->Show( false );
239 
240  Destroy();
241  }
242 }
VTBL_ENTRY bool PlayersClose(bool doForce)
Function PlayersClose calls the KIWAY_PLAYER::Close( bool force ) function on all the windows and if ...
Definition: kiway.cpp:374
void UpdateFileHistory(const wxString &FullFileName, wxFileHistory *aFileHistory=NULL)
Function UpdateFileHistory Updates the list of recently opened files.
Definition: basicframe.cpp:388
wxPoint m_FramePos
Definition: wxstruct.h:134
PGM_KICAD & PgmTop()
Definition: kicad.cpp:71
const wxString GetProjectFileName()
Definition: mainframe.cpp:147
TREE_PROJECT_FRAME * m_LeftWin
Definition: kicad.h:298
wxSize m_FrameSize
Definition: wxstruct.h:135
wxFileHistory & GetFileHistory()
Definition: pgm_kicad.h:57
KIWAY Kiway
void KICAD_MANAGER_FRAME::OnConfigurePaths ( wxCommandEvent &  aEvent)

Definition at line 588 of file mainframe.cpp.

References PGM_BASE::ConfigurePaths(), and Pgm().

589 {
590  Pgm().ConfigurePaths( this );
591 }
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
VTBL_ENTRY void ConfigurePaths(wxWindow *aParent=NULL)
Function ConfigurePaths.
Definition: pgm_base.cpp:905
void KICAD_MANAGER_FRAME::OnCreateProjectFromTemplate ( wxCommandEvent &  event)

Creates a new project folder, copy a template into this new folder.

and open this new projrct as working project

Definition at line 235 of file prjconfig.cpp.

References DIALOG_TEMPLATE_SELECTOR::AddTemplatesPage(), ClearMsg(), CreateNewProject(), PROJECT_TEMPLATE::CreateProject(), PROJECT_TEMPLATE::GetDestinationFiles(), DIALOG_TEMPLATE_SELECTOR::GetSelectedTemplate(), LoadProject(), Prj(), and SEP.

236 {
237  wxString default_dir = wxFileName( Prj().GetProjectFullName() ).GetPathWithSep();
238  wxString title = _( "New Project Folder" );
239  wxDirDialog dlg( this, title, default_dir );
240 
241  if( dlg.ShowModal() == wxID_CANCEL )
242  return;
243 
244  // Builds the project .pro filename, from the new project folder name
245  wxFileName fn;
246  fn.AssignDir( dlg.GetPath() );
247  fn.SetName( dlg.GetPath().AfterLast( SEP() ) );
248  fn.SetExt( wxT( "pro" ) );
249 
250  wxChar sep[2] = { SEP(), 0 }; // nul terminated separator wxChar string.
251 
252  ClearMsg();
253 
255 
256  wxFileName templatePath;
257  wxString envStr;
258 
259 #ifndef __WXMAC__
260  wxGetEnv( wxT( "KICAD" ), &envStr );
261 
262  // Add a new tab for system templates
263  if( !envStr.empty() )
264  {
265  // user may or may not have including terminating separator.
266  if( !envStr.EndsWith( sep ) )
267  envStr += sep;
268 
269  templatePath = envStr + wxT( "template" ) + sep;
270  }
271  else
272  {
273  // The standard path should be in the share directory for kicad. As
274  // it is normal on Windows to only have the share directory and not
275  // the kicad sub-directory we fall back to that if the directory
276  // doesn't exist
277  templatePath = wxPathOnly( wxStandardPaths::Get().GetExecutablePath() ) +
278  sep + wxT( ".." ) + sep + wxT( "share" ) + sep + wxT( "kicad" ) +
279  sep + wxT( "template" ) + sep;
280 
281  if( !wxDirExists( templatePath.GetFullPath() ) )
282  {
283  templatePath = wxPathOnly( wxStandardPaths::Get().GetExecutablePath() ) + sep +
284  wxT( ".." ) + sep + wxT( "share" ) + sep + wxT( "template" ) + sep;
285  }
286  }
287 #else
288  // Use what is provided in the bundle data dir
289  templatePath = GetOSXKicadDataDir() + sep + wxT( "template" );
290 #endif
291 
292  ps->AddTemplatesPage( _( "System Templates" ), templatePath );
293 
294  // Add a new tab for user templates
295  wxFileName userPath = wxStandardPaths::Get().GetDocumentsDir() + sep + wxT( "kicad" ) +
296  sep + wxT( "template" ) + sep;
297 
298  ps->AddTemplatesPage( _( "User Templates" ), userPath );
299 
300  // Check to see if a custom template location is available and setup a
301  // new selection tab if there is.
302  envStr.clear();
303  wxGetEnv( wxT( "KICAD_PTEMPLATES" ), &envStr );
304 
305  if( !envStr.empty() )
306  {
307  if( !envStr.EndsWith( sep ) )
308  envStr += sep;
309 
310  wxFileName envPath = envStr;
311 
312  ps->AddTemplatesPage( _( "Portable Templates" ), envPath );
313  }
314 
315  // Show the project template selector dialog
316  if( ps->ShowModal() != wxID_OK )
317  return;
318 
319  if( ps->GetSelectedTemplate() == NULL )
320  {
321  wxMessageBox( _( "No project template was selected. Cannot generate new project." ),
322  _( "Error" ),
323  wxOK | wxICON_ERROR,
324  this );
325 
326  return;
327  }
328 
329  // Make sure the user has write permissions to the base path.
330  wxFileName prjPath = fn;
331 
332  while( !prjPath.DirExists() )
333  prjPath.RemoveLastDir();
334 
335  if( !prjPath.IsDirWritable() )
336  {
337  wxString msg;
338 
339  msg.Printf( _( "Cannot write to folder '%s'." ), prjPath.GetPath() );
340  wxMessageDialog msgDlg( this, msg, _( "Error!" ), wxICON_ERROR | wxOK | wxCENTER );
341  msgDlg.SetExtendedMessage( _( "Plese check your access permissions to this folder "
342  "and try again." ) );
343  msgDlg.ShowModal();
344  return;
345  }
346 
347  // Make sure we are not overwriting anything in the destination folder.
348  std::vector< wxFileName > destFiles;
349 
350  if( ps->GetSelectedTemplate()->GetDestinationFiles( fn, destFiles ) )
351  {
352  std::vector< wxFileName > overwrittenFiles;
353 
354  for( auto file : destFiles )
355  {
356  if( file.FileExists() )
357  overwrittenFiles.push_back( file );
358  }
359 
360  if( !overwrittenFiles.empty() )
361  {
362  wxString extendedMsg = _( "Overwriting files:" ) + "\n";
363 
364  for( auto file : overwrittenFiles )
365  {
366  extendedMsg += "\n" + file.GetFullName();
367  }
368 
369  wxMessageDialog owDlg( this,
370  _( "Are you sure you want to overwrite files in "
371  "the destination folder?" ),
372  _( "Warning!" ),
373  wxYES_NO | wxICON_QUESTION | wxCENTER );
374  owDlg.SetExtendedMessage( extendedMsg );
375  owDlg.SetYesNoLabels( _( "Overwrite" ), _( "Do Not Overwrite" ) );
376 
377  if( owDlg.ShowModal() == wxID_NO )
378  return;
379  }
380  }
381 
382  wxString errorMsg;
383 
384  // The selected template widget contains the template we're attempting to use to
385  // create a project
386  if( !ps->GetSelectedTemplate()->CreateProject( fn, &errorMsg ) )
387  {
388  wxMessageDialog createDlg( this,
389  _( "A problem occurred creating new project from template!" ),
390  _( "Template Error" ),
391  wxOK | wxICON_ERROR );
392 
393  if( !errorMsg.empty() )
394  createDlg.SetExtendedMessage( errorMsg );
395 
396  createDlg.ShowModal();
397  return;
398  }
399 
400  CreateNewProject( fn.GetFullPath() );
401  LoadProject( fn );
402 }
PROJECT_TEMPLATE * GetSelectedTemplate()
PROJECT & Prj()
Definition: kicad.cpp:270
#define SEP()
Definition: prjconfig.cpp:50
size_t GetDestinationFiles(const wxFileName &aNewProjectPath, std::vector< wxFileName > &aDestFiles)
Fetch the list of destination files to be copied when the new project is created. ...
bool CreateProject(wxFileName &aNewProjectPath, wxString *aErrorMsg=nullptr)
Copies and renames all template files to create a new project.
void AddTemplatesPage(const wxString &aTitle, wxFileName &aPath)
Add a new page with aTitle, populated with templates from aPath.
void LoadProject(const wxFileName &aProjectFileName)
Definition: prjconfig.cpp:61
void CreateNewProject(const wxFileName &aProjectFileName)
Creates a new project by setting up and initial project, schematic, and board files.
Definition: prjconfig.cpp:108
void ClearMsg()
Erase the text panel.
Definition: mainframe.cpp:528
void KICAD_MANAGER_FRAME::OnExit ( wxCommandEvent &  event)

Definition at line 245 of file mainframe.cpp.

246 {
247  Close( true );
248 }
void KICAD_MANAGER_FRAME::OnFileHistory ( wxCommandEvent &  event)

Definition at line 47 of file kicad/files-io.cpp.

References EDA_BASE_FRAME::GetFileFromHistory(), PGM_KICAD::GetFileHistory(), LoadProject(), and PgmTop().

48 {
49  wxFileName projFileName = GetFileFromHistory( event.GetId(), _( "KiCad project file" ),
50  &PgmTop().GetFileHistory() );
51  if( !projFileName.FileExists() )
52  return;
53 
54  LoadProject( projFileName );
55 }
PGM_KICAD & PgmTop()
Definition: kicad.cpp:71
wxString GetFileFromHistory(int cmdId, const wxString &type, wxFileHistory *aFileHistory=NULL)
Function GetFileFromHistory fetches the file name from the file history list.
Definition: basicframe.cpp:400
void LoadProject(const wxFileName &aProjectFileName)
Definition: prjconfig.cpp:61
wxFileHistory & GetFileHistory()
Definition: pgm_kicad.h:57
void KICAD_MANAGER_FRAME::OnLoadProject ( wxCommandEvent &  event)

Load an exiting project (.pro) file.

Definition at line 165 of file prjconfig.cpp.

References EDA_BASE_FRAME::GetMruPath(), LoadProject(), ProjectFileExtension, and ProjectFileWildcard.

166 {
167  wxString default_dir = GetMruPath();
168  wxFileDialog dlg( this, _( "Open Existing Project" ), default_dir, wxEmptyString,
169  ProjectFileWildcard, wxFD_OPEN | wxFD_FILE_MUST_EXIST );
170 
171  if( dlg.ShowModal() == wxID_CANCEL )
172  return;
173 
174  wxFileName pro( dlg.GetPath() );
175  pro.SetExt( ProjectFileExtension ); // enforce extension
176 
177  if( !pro.IsAbsolute() )
178  pro.MakeAbsolute();
179 
180  if( !pro.FileExists() )
181  return;
182 
183  LoadProject( pro );
184 }
const wxString ProjectFileExtension
const wxString ProjectFileWildcard
void LoadProject(const wxFileName &aProjectFileName)
Definition: prjconfig.cpp:61
wxString GetMruPath() const
Definition: wxstruct.h:363
void KICAD_MANAGER_FRAME::OnNewProject ( wxCommandEvent &  aEvent)

Definition at line 187 of file prjconfig.cpp.

References CreateNewProject(), DisplayErrorMessage(), EDA_BASE_FRAME::GetMruPath(), IsOK(), LoadProject(), ProjectFileExtension, and ProjectFileWildcard.

188 {
189  wxString default_dir = GetMruPath();
190  wxFileDialog dlg( this, _( "Create New Project" ), default_dir, wxEmptyString,
191  ProjectFileWildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
192 
193  if( dlg.ShowModal() == wxID_CANCEL )
194  return;
195 
196  wxFileName pro( dlg.GetPath() );
197  pro.SetExt( ProjectFileExtension ); // enforce extension
198 
199  if( !pro.IsAbsolute() )
200  pro.MakeAbsolute();
201 
202  // Append a new directory with the same name of the project file.
203  pro.AppendDir( pro.GetName() );
204 
205  // Check if the project directory is empty if it already exists.
206  wxDir directory( pro.GetPath() );
207 
208  if( !pro.DirExists() )
209  {
210  if( !pro.Mkdir() )
211  {
212  wxString msg;
213  msg.Printf( _( "Directory '%s' could not be created.\n\n"
214  "Please make sure you have write permissions and try again." ),
215  pro.GetPath() );
216  DisplayErrorMessage( this, msg );
217  return;
218  }
219  }
220  else if( directory.HasFiles() )
221  {
222  wxString msg = _( "The selected directory is not empty. It is recommended that you "
223  "create projects in their own empty directory.\n\nDo you "
224  "want to continue?" );
225 
226  if( !IsOK( this, msg ) )
227  return;
228  }
229 
230  CreateNewProject( pro );
231  LoadProject( pro );
232 }
const wxString ProjectFileExtension
const wxString ProjectFileWildcard
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString aExtraInfo)
Function DisplayErrorMessage displays an error message with aMessage.
Definition: confirm.cpp:85
void LoadProject(const wxFileName &aProjectFileName)
Definition: prjconfig.cpp:61
void CreateNewProject(const wxFileName &aProjectFileName)
Creates a new project by setting up and initial project, schematic, and board files.
Definition: prjconfig.cpp:108
wxString GetMruPath() const
Definition: wxstruct.h:363
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:129
void KICAD_MANAGER_FRAME::OnOpenFileInEditor ( wxCommandEvent &  event)
void KICAD_MANAGER_FRAME::OnOpenFileInTextEditor ( wxCommandEvent &  event)

Definition at line 490 of file mainframe.cpp.

References Execute(), PGM_BASE::GetEditorName(), PROJECT::GetProjectPath(), Pgm(), and Prj().

491 {
492  wxString mask( wxT( "*" ) );
493 
494 #ifdef __WINDOWS__
495  mask += wxT( ".*" );
496 #endif
497 
498  mask = _( "Text file (" ) + mask + wxT( ")|" ) + mask;
499  wxString default_dir = Prj().GetProjectPath();
500 
501  wxFileDialog dlg( this, _( "Load File to Edit" ), default_dir,
502  wxEmptyString, mask, wxFD_OPEN );
503 
504  if( dlg.ShowModal() == wxID_CANCEL )
505  return;
506 
507  wxString filename = wxT( "\"" );
508  filename += dlg.GetPath() + wxT( "\"" );
509 
510  if( !dlg.GetPath().IsEmpty() && !Pgm().GetEditorName().IsEmpty() )
511  Execute( this, Pgm().GetEditorName(), filename );
512 }
PROJECT & Prj()
Definition: kicad.cpp:270
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
void Execute(wxWindow *frame, const wxString &execFile, wxString param=wxEmptyString)
Open another KiCad application and logs a message.
Definition: mainframe.cpp:272
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
VTBL_ENTRY const wxString & GetEditorName(bool aCanShowFileChooser=true)
Return the preferred editor name.
Definition: pgm_base.cpp:338
void KICAD_MANAGER_FRAME::OnOpenTextEditor ( wxCommandEvent &  event)

Definition at line 481 of file mainframe.cpp.

References Execute(), PGM_BASE::GetEditorName(), and Pgm().

482 {
483  wxString editorname = Pgm().GetEditorName();
484 
485  if( !editorname.IsEmpty() )
486  Execute( this, editorname, wxEmptyString );
487 }
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
void Execute(wxWindow *frame, const wxString &execFile, wxString param=wxEmptyString)
Open another KiCad application and logs a message.
Definition: mainframe.cpp:272
VTBL_ENTRY const wxString & GetEditorName(bool aCanShowFileChooser=true)
Return the preferred editor name.
Definition: pgm_base.cpp:338
void KICAD_MANAGER_FRAME::OnRefresh ( wxCommandEvent &  event)

Definition at line 515 of file mainframe.cpp.

References m_LeftWin, and TREE_PROJECT_FRAME::ReCreateTreePrj().

516 {
518 }
void ReCreateTreePrj()
Create or modify the tree showing project file names.
TREE_PROJECT_FRAME * m_LeftWin
Definition: kicad.h:298
void KICAD_MANAGER_FRAME::OnRunBitmapConverter ( wxCommandEvent &  event)

Definition at line 453 of file mainframe.cpp.

References BITMAPCONVERTER_EXE, and Execute().

454 {
455  Execute( this, BITMAPCONVERTER_EXE );
456 }
void Execute(wxWindow *frame, const wxString &execFile, wxString param=wxEmptyString)
Open another KiCad application and logs a message.
Definition: mainframe.cpp:272
const wxString BITMAPCONVERTER_EXE
void KICAD_MANAGER_FRAME::OnRunEeschema ( wxCommandEvent &  event)

Definition at line 338 of file mainframe.cpp.

References GetProjectFileName(), RunEeschema(), and SchematicFileExtension.

339 {
340  wxFileName fn( GetProjectFileName() );
341  fn.SetExt( SchematicFileExtension );
342  RunEeschema( fn.GetFullPath() );
343 }
void RunEeschema(const wxString &aProjectSchematicFileName)
Call this only for a SCH associated with the current project.
Definition: mainframe.cpp:296
const wxString SchematicFileExtension
const wxString GetProjectFileName()
Definition: mainframe.cpp:147
void KICAD_MANAGER_FRAME::OnRunGerbview ( wxCommandEvent &  event)

Definition at line 472 of file mainframe.cpp.

References Execute(), GERBVIEW_EXE, and Prj().

473 {
474  // Gerbview is called without any file to open, because we do not know
475  // the list and the name of files to open (if any...).
476  // however we run it in the path of the project
477  Execute( this, GERBVIEW_EXE, Prj().GetProjectPath() );
478 }
PROJECT & Prj()
Definition: kicad.cpp:270
const wxString GERBVIEW_EXE
void Execute(wxWindow *frame, const wxString &execFile, wxString param=wxEmptyString)
Open another KiCad application and logs a message.
Definition: mainframe.cpp:272
void KICAD_MANAGER_FRAME::OnRunPageLayoutEditor ( wxCommandEvent &  event)

Definition at line 465 of file mainframe.cpp.

References Execute(), and PL_EDITOR_EXE.

466 {
467  Execute( this, PL_EDITOR_EXE );
468 }
const wxString PL_EDITOR_EXE
void Execute(wxWindow *frame, const wxString &execFile, wxString param=wxEmptyString)
Open another KiCad application and logs a message.
Definition: mainframe.cpp:272
void KICAD_MANAGER_FRAME::OnRunPcbCalculator ( wxCommandEvent &  event)

Definition at line 459 of file mainframe.cpp.

References Execute(), and PCB_CALCULATOR_EXE.

460 {
461  Execute( this, PCB_CALCULATOR_EXE );
462 }
void Execute(wxWindow *frame, const wxString &execFile, wxString param=wxEmptyString)
Open another KiCad application and logs a message.
Definition: mainframe.cpp:272
const wxString PCB_CALCULATOR_EXE
void KICAD_MANAGER_FRAME::OnRunPcbFpEditor ( wxCommandEvent &  event)

Definition at line 418 of file mainframe.cpp.

References FRAME_PCB_MODULE_EDITOR, Kiway, KIWAY::Player(), and IO_ERROR::What().

419 {
421 
422  if( !frame )
423  {
424  try
425  {
426  frame = Kiway.Player( FRAME_PCB_MODULE_EDITOR, true );
427  }
428  catch( IO_ERROR err )
429  {
430  wxMessageBox( _( "Footprint library editor failed to load:\n" ) + err.What(),
431  _( "KiCad Error" ), wxOK | wxICON_ERROR, this );
432  return;
433  }
434 
435  frame->Show( true );
436  }
437 
438  // On Windows, Raise() does not bring the window on screen, when iconized
439  if( frame->IsIconized() )
440  frame->Iconize( false );
441 
442  frame->Raise();
443 }
Class KIWAY_PLAYER is a wxFrame capable of the OpenProjectFiles function, meaning it can load a porti...
Definition: kiway_player.h:111
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, KIWAY_PLAYER *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:302
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:47
KIWAY Kiway
void KICAD_MANAGER_FRAME::OnRunPcbNew ( wxCommandEvent &  event)

Definition at line 406 of file mainframe.cpp.

References PcbFileName(), PcbLegacyFileName(), and RunPcbNew().

407 {
408  wxFileName kicad_board( PcbFileName() );
409  wxFileName legacy_board( PcbLegacyFileName() );
410 
411  wxFileName& board = ( !legacy_board.FileExists() || kicad_board.FileExists() ) ?
412  kicad_board : legacy_board;
413 
414  RunPcbNew( board.GetFullPath() );
415 }
const wxString PcbLegacyFileName()
Definition: mainframe.cpp:173
const wxString PcbFileName()
Definition: mainframe.cpp:163
void RunPcbNew(const wxString &aProjectBoardFileName)
Call this only for a PCB associated with the current project.
Definition: mainframe.cpp:374
void KICAD_MANAGER_FRAME::OnRunSchLibEditor ( wxCommandEvent &  event)

Definition at line 346 of file mainframe.cpp.

References FRAME_SCH_LIB_EDITOR, Kiway, KIWAY::Player(), and IO_ERROR::What().

347 {
348  KIWAY_PLAYER* frame = Kiway.Player( FRAME_SCH_LIB_EDITOR, false );
349 
350  if( !frame )
351  {
352  try
353  {
354  frame = Kiway.Player( FRAME_SCH_LIB_EDITOR, true );
355  }
356  catch( IO_ERROR err )
357  {
358  wxMessageBox( _( "Component library editor failed to load:\n" ) + err.What(),
359  _( "KiCad Error" ), wxOK | wxICON_ERROR, this );
360  return;
361  }
362 
363  frame->Show( true );
364  }
365 
366  // On Windows, Raise() does not bring the window on screen, when iconized
367  if( frame->IsIconized() )
368  frame->Iconize( false );
369 
370  frame->Raise();
371 }
Class KIWAY_PLAYER is a wxFrame capable of the OpenProjectFiles function, meaning it can load a porti...
Definition: kiway_player.h:111
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, KIWAY_PLAYER *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:302
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:47
KIWAY Kiway
void KICAD_MANAGER_FRAME::OnSaveProject ( wxCommandEvent &  event)

Save the project (.pro) file containing the top level configuration parameters.

Definition at line 405 of file prjconfig.cpp.

References PROJECT::ConfigSave(), GeneralGroupName, GetProjectFileName(), PgmTop(), and Prj().

406 {
407  if( !wxIsWritable( GetProjectFileName() ) )
408  return;
409 
411 }
VTBL_ENTRY void ConfigSave(const SEARCH_STACK &aSList, const wxString &aGroupName, const PARAM_CFG_ARRAY &aParams, const wxString &aFileName=wxEmptyString)
Function ConfigSave saves the current "project" parameters into the wxConfigBase* derivative...
Definition: project.cpp:307
PARAM_CFG_ARRAY s_KicadManagerParams
Definition: prjconfig.cpp:58
PROJECT & Prj()
Definition: kicad.cpp:270
PGM_KICAD & PgmTop()
Definition: kicad.cpp:71
#define GeneralGroupName
Definition: prjconfig.cpp:56
const wxString GetProjectFileName()
Definition: mainframe.cpp:147
void KICAD_MANAGER_FRAME::OnSelectDefaultPdfBrowser ( wxCommandEvent &  event)

Definition at line 43 of file preferences.cpp.

References PGM_BASE::ForceSystemPdfBrowser(), Pgm(), and PGM_BASE::WritePdfBrowserInfos().

44 {
45  Pgm().ForceSystemPdfBrowser( true );
47 }
VTBL_ENTRY void ForceSystemPdfBrowser(bool aFlg)
Function ForceSystemPdfBrowser forces the use of system PDF browser, even if a preferred PDF browser ...
Definition: pgm_base.h:196
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
VTBL_ENTRY void WritePdfBrowserInfos()
Function WritePdfBrowserInfos saves the PDF browser choice to the common configuration.
Definition: eda_doc.cpp:54
void EDA_BASE_FRAME::OnSelectPreferredEditor ( wxCommandEvent &  event)
virtualinherited

Function OnSelectPreferredEditor Open a dialog to select the editor that will used in KiCad to edit or display files (reports ...

) The full filename editor is saved in configuration (global params)

Definition at line 497 of file basicframe.cpp.

References PGM_BASE::AskUserForPreferredEditor(), PGM_BASE::GetEditorName(), Pgm(), and PGM_BASE::SetEditorName().

498 {
499  // Ask for the current editor and instruct GetEditorName() to not show
500  // unless we pass false as argument.
501  wxString editorname = Pgm().GetEditorName( false );
502 
503  // Ask the user to select a new editor, but suggest the current one as the default.
504  editorname = Pgm().AskUserForPreferredEditor( editorname );
505 
506  // If we have a new editor name request it to be copied to m_editor_name and saved
507  // to the preferences file. If the user cancelled the dialog then the previous
508  // value will be retained.
509  if( !editorname.IsEmpty() )
510  Pgm().SetEditorName( editorname );
511 }
VTBL_ENTRY void SetEditorName(const wxString &aFileName)
Definition: pgm_base.cpp:330
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
VTBL_ENTRY const wxString AskUserForPreferredEditor(const wxString &aDefaultEditor=wxEmptyString)
Shows a dialog that instructs the user to select a new preferred editor.
Definition: pgm_base.cpp:375
VTBL_ENTRY const wxString & GetEditorName(bool aCanShowFileChooser=true)
Return the preferred editor name.
Definition: pgm_base.cpp:338
void KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser ( wxCommandEvent &  event)

Definition at line 56 of file preferences.cpp.

References DisplayError(), PGM_BASE::ForceSystemPdfBrowser(), PGM_BASE::GetPdfBrowserName(), ID_SELECT_PREFERED_PDF_BROWSER_NAME, Pgm(), PGM_BASE::ReadPdfBrowserInfos(), PGM_BASE::SetPdfBrowserName(), and PGM_BASE::WritePdfBrowserInfos().

57 {
58  bool setPdfBrowserName = event.GetId() == ID_SELECT_PREFERED_PDF_BROWSER_NAME;
59 
60  if( !Pgm().GetPdfBrowserName() && !setPdfBrowserName )
61  {
62  DisplayError( this,
63  _( "You must choose a PDF viewer before using this option." ) );
64  setPdfBrowserName = true;
65  }
66 
67  if( setPdfBrowserName )
68  {
69  wxString mask( wxT( "*" ) );
70 
71  #ifdef __WINDOWS__
72  mask += wxT( ".exe" );
73  #endif
74 
75  wxString wildcard = _( "Executable files (" ) + mask + wxT( ")|" ) + mask;
76 
78  wxFileName fn = Pgm().GetPdfBrowserName();
79 
80  wxFileDialog dlg( this, _( "Select Preferred PDF Browser" ), fn.GetPath(),
81  fn.GetFullPath(), wildcard,
82  wxFD_OPEN | wxFD_FILE_MUST_EXIST );
83 
84  if( dlg.ShowModal() == wxID_CANCEL )
85  return;
86 
87  Pgm().SetPdfBrowserName( dlg.GetPath() );
88  }
89 
90  Pgm().ForceSystemPdfBrowser( false );
92 }
VTBL_ENTRY void ForceSystemPdfBrowser(bool aFlg)
Function ForceSystemPdfBrowser forces the use of system PDF browser, even if a preferred PDF browser ...
Definition: pgm_base.h:196
VTBL_ENTRY const wxString & GetPdfBrowserName() const
Definition: pgm_base.h:177
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
VTBL_ENTRY void WritePdfBrowserInfos()
Function WritePdfBrowserInfos saves the PDF browser choice to the common configuration.
Definition: eda_doc.cpp:54
VTBL_ENTRY void SetPdfBrowserName(const wxString &aFileName)
Definition: pgm_base.h:179
VTBL_ENTRY void ReadPdfBrowserInfos()
Function ReadPdfBrowserInfos reads the PDF browser choice from the common configuration.
Definition: eda_doc.cpp:41
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:71
void KICAD_MANAGER_FRAME::OnSize ( wxSizeEvent &  event)

Definition at line 207 of file mainframe.cpp.

References EDA_BASE_FRAME::m_auimgr.

208 {
209  if( m_auimgr.GetManagedWindow() )
210  m_auimgr.Update();
211 
212  event.Skip();
213 }
wxAuiManager m_auimgr
Definition: wxstruct.h:144
void KICAD_MANAGER_FRAME::OnUnarchiveFiles ( wxCommandEvent &  event)

Definition at line 58 of file kicad/files-io.cpp.

References DisplayError(), Format(), GetChars(), GetProjectFileName(), PrintMsg(), ZipFileExtension, and ZipFileWildcard.

59 {
60  wxFileName fn = GetProjectFileName();
61 
62  fn.SetExt( ZipFileExtension );
63 
64  wxFileDialog zipfiledlg( this, _( "Unzip Project" ), fn.GetPath(),
65  fn.GetFullName(), ZipFileWildcard,
66  wxFD_OPEN | wxFD_FILE_MUST_EXIST );
67 
68  if( zipfiledlg.ShowModal() == wxID_CANCEL )
69  return;
70 
71  wxString msg = wxString::Format( _( "\nOpen '%s'\n" ), GetChars( zipfiledlg.GetPath() ) );
72  PrintMsg( msg );
73 
74  wxDirDialog dirDlg( this, _( "Target Directory" ), fn.GetPath(),
75  wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
76 
77  if( dirDlg.ShowModal() == wxID_CANCEL )
78  return;
79 
80  wxString unzipDir = dirDlg.GetPath() + wxT( "/" );
81  msg.Printf( _( "Unzipping project in '%s'\n" ), GetChars( unzipDir ) );
82  PrintMsg( msg );
83 
84  wxFileSystem zipfilesys;
85 
86  zipfilesys.AddHandler( new wxZipFSHandler );
87  zipfilesys.ChangePathTo( zipfiledlg.GetPath() + wxT( "#zip:" ), true );
88 
89  wxFSFile* zipfile = NULL;
90  wxString localfilename = zipfilesys.FindFirst( wxT( "*.*" ) );
91 
92  while( !localfilename.IsEmpty() )
93  {
94  zipfile = zipfilesys.OpenFile( localfilename );
95  if( !zipfile )
96  {
97  DisplayError( this, wxT( "Zip file read error" ) );
98  break;
99  }
100 
101  wxFileName uzfn = localfilename.AfterLast( ':' );
102  uzfn.MakeAbsolute( unzipDir );
103  wxString unzipfilename = uzfn.GetFullPath();
104 
105  msg.Printf( _( "Extract file '%s'" ), GetChars( unzipfilename ) );
106  PrintMsg( msg );
107 
108  wxInputStream* stream = zipfile->GetStream();
109  wxFFileOutputStream* ofile = new wxFFileOutputStream( unzipfilename );
110 
111  if( ofile->Ok() )
112  {
113  ofile->Write( *stream );
114  PrintMsg( _( " OK\n" ) );
115  }
116  else
117  PrintMsg( _( " *ERROR*\n" ) );
118 
119  delete ofile;
120  delete zipfile;
121 
122  localfilename = zipfilesys.FindNext();
123  }
124 
125  PrintMsg( wxT( "** end **\n" ) );
126 }
void PrintMsg(const wxString &aText)
Displays aText in the text panel.
Definition: mainframe.cpp:201
#define ZipFileExtension
const wxString GetProjectFileName()
Definition: mainframe.cpp:147
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
#define ZipFileWildcard
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:71
void KICAD_MANAGER_FRAME::OnUpdateDefaultPdfBrowser ( wxUpdateUIEvent &  event)

Definition at line 37 of file preferences.cpp.

References Pgm().

38 {
39  event.Check( Pgm().UseSystemPdfBrowser() );
40 }
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
void KICAD_MANAGER_FRAME::OnUpdatePreferredPdfBrowser ( wxUpdateUIEvent &  event)

Definition at line 50 of file preferences.cpp.

References Pgm().

51 {
52  event.Check( !Pgm().UseSystemPdfBrowser() );
53 }
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
void KICAD_MANAGER_FRAME::OnUpdateRequiresProject ( wxUpdateUIEvent &  event)

Definition at line 414 of file prjconfig.cpp.

References m_active_project.

415 {
416  event.Enable( m_active_project );
417 }
bool m_active_project
Definition: kicad.h:308
const wxString KICAD_MANAGER_FRAME::PcbFileName ( )

Definition at line 163 of file mainframe.cpp.

References GetProjectFileName(), and PcbFileExtension.

Referenced by TREEPROJECT_ITEM::Activate(), and OnRunPcbNew().

164 {
165  wxFileName fn( GetProjectFileName() );
166 
167  fn.SetExt( PcbFileExtension );
168 
169  return fn.GetFullPath();
170 }
#define PcbFileExtension
const wxString GetProjectFileName()
Definition: mainframe.cpp:147
const wxString KICAD_MANAGER_FRAME::PcbLegacyFileName ( )

Definition at line 173 of file mainframe.cpp.

References GetProjectFileName(), and LegacyPcbFileExtension.

Referenced by TREEPROJECT_ITEM::Activate(), and OnRunPcbNew().

174 {
175  wxFileName fn( GetProjectFileName() );
176 
177  fn.SetExt( LegacyPcbFileExtension );
178 
179  return fn.GetFullPath();
180 }
const wxString GetProjectFileName()
Definition: mainframe.cpp:147
const wxString LegacyPcbFileExtension
bool EDA_BASE_FRAME::PostCommandMenuEvent ( int  evt_type)
inherited

Function PostCommandMenuEvent.

Post a menu event to the frame, which can be used to trigger actions bound to menu items.

Definition at line 647 of file basicframe.cpp.

Referenced by FOOTPRINT_EDIT_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnHotkeyDeleteItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyDuplicateItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyEditItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItemExact(), and FOOTPRINT_EDIT_FRAME::OnHotkeyRotateItem().

648 {
649  if( evt_type != 0 )
650  {
651  wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED );
652  evt.SetEventObject( this );
653  evt.SetId( evt_type );
654  wxPostEvent( this, evt );
655  return true;
656  }
657 
658  return false;
659 }
void KICAD_MANAGER_FRAME::PrintMsg ( const wxString &  aText)

Displays aText in the text panel.

Parameters
aTextThe text to display.

Definition at line 201 of file mainframe.cpp.

References m_MessagesBox.

Referenced by Execute(), OnArchiveFiles(), KICAD_MANAGER_FRAME::TERMINATE_HANDLER::OnTerminate(), OnUnarchiveFiles(), and PrintPrjInfo().

202 {
203  m_MessagesBox->AppendText( aText );
204 }
wxTextCtrl * m_MessagesBox
Definition: kicad.h:300
void KICAD_MANAGER_FRAME::PrintPrjInfo ( )

Prints the current working directory name and the projet name on the text panel.

Definition at line 548 of file mainframe.cpp.

References Format(), GetChars(), GetProjectFileName(), and PrintMsg().

Referenced by LoadProject().

549 {
550  wxString msg = wxString::Format( _( "Project name:\n%s\n" ),
552  PrintMsg( msg );
553 }
void PrintMsg(const wxString &aText)
Displays aText in the text panel.
Definition: mainframe.cpp:201
const wxString GetProjectFileName()
Definition: mainframe.cpp:147
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
void KICAD_MANAGER_FRAME::Process_Config ( wxCommandEvent &  event)

Definition at line 556 of file mainframe.cpp.

References DisplayHotkeyList(), EDA_BASE_FRAME::ExportHotkeyConfigToFile(), ID_PREFERENCES_HOTKEY_EXPORT_CONFIG, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, ID_PREFERENCES_HOTKEY_SHOW_EDITOR, EDA_BASE_FRAME::ImportHotkeyConfigFromFile(), InstallHotkeyFrame(), and m_manager_Hokeys_Descr.

557 {
558  int id = event.GetId();
559  wxFileName fn;
560 
561  switch( id )
562  {
563  // Hotkey IDs
566  break;
567 
570  break;
571 
574  break;
575 
577  // Display current hotkey list for LibEdit.
579  break;
580 
581  default:
582  wxFAIL_MSG( wxT( "KICAD_MANAGER_FRAME::Process_Config error" ) );
583  break;
584  }
585 }
void ExportHotkeyConfigToFile(EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
Function ExportHotkeyConfigToFile Prompt the user for an old hotkey file to read, and read it...
void DisplayHotkeyList(EDA_BASE_FRAME *aFrame, struct EDA_HOTKEY_CONFIG *aDescList)
Function DisplayHotkeyList Displays the current hotkey list.
EDA_HOTKEY_CONFIG * m_manager_Hokeys_Descr
Definition: kicad.h:304
void InstallHotkeyFrame(EDA_BASE_FRAME *aParent, EDA_HOTKEY_CONFIG *aHotkeys)
Function InstallHotkeyFrame Create a hotkey editor dialog window with the provided hotkey configurati...
void ImportHotkeyConfigFromFile(EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
Function ImportHotkeyConfigFromFile Prompt the user for an old hotkey file to read, and read it.
void KICAD_MANAGER_FRAME::Process_Preferences ( wxCommandEvent &  event)
bool EDA_BASE_FRAME::ProcessEvent ( wxEvent &  aEvent)
overrideinherited

Function ProcessEvent overrides the default process event handler to implement the auto save feature.

Warning
If you override this function in a derived class, make sure you call down to this or the auto save feature will be disabled.

Definition at line 166 of file basicframe.cpp.

References EDA_BASE_FRAME::isAutoSaveRequired(), EDA_BASE_FRAME::m_autoSaveInterval, EDA_BASE_FRAME::m_autoSaveState, EDA_BASE_FRAME::m_autoSaveTimer, EDA_BASE_FRAME::m_hasAutoSave, and traceAutoSave.

Referenced by LIB_VIEW_FRAME::onSelectNextSymbol(), LIB_VIEW_FRAME::onSelectPreviousSymbol(), KIWAY::ProcessEvent(), LIB_VIEW_FRAME::ReCreateListCmp(), and PCBNEW_CONTROL::SwitchUnits().

167 {
168  if( !wxFrame::ProcessEvent( aEvent ) )
169  return false;
170 
171  if( IsShown() && m_hasAutoSave && IsActive() &&
173  {
174  if( !m_autoSaveState )
175  {
176  wxLogTrace( traceAutoSave, wxT( "Starting auto save timer." ) );
177  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
178  m_autoSaveState = true;
179  }
180  else if( m_autoSaveTimer->IsRunning() )
181  {
182  wxLogTrace( traceAutoSave, wxT( "Stopping auto save timer." ) );
183  m_autoSaveTimer->Stop();
184  m_autoSaveState = false;
185  }
186  }
187 
188  return true;
189 }
bool m_autoSaveState
Flag to indicate the last auto save state.
Definition: wxstruct.h:150
wxTimer * m_autoSaveTimer
The timer used to implement the auto save feature;.
Definition: wxstruct.h:156
virtual bool isAutoSaveRequired() const
Function autoSaveRequired returns the auto save status of the application.
Definition: wxstruct.h:173
bool m_hasAutoSave
Flag to indicate if this frame supports auto save.
Definition: wxstruct.h:147
int m_autoSaveInterval
The auto save interval time in seconds.
Definition: wxstruct.h:153
const wxChar traceAutoSave[]
Flag to enable auto save feature debug tracing.
Definition: basicframe.cpp:53
int EDA_BASE_FRAME::ReadHotkeyConfig ( struct EDA_HOTKEY_CONFIG aDescList)
inherited

Function ReadHotkeyConfig Read configuration data and fill the current hotkey list with hotkeys.

Parameters
aDescList= current hotkey list descr. to initialize.

Definition at line 658 of file hotkeys_basic.cpp.

659 {
660  ::ReadHotkeyConfig( GetName(), aDescList );
661  return 1;
662 }
int ReadHotkeyConfig(struct EDA_HOTKEY_CONFIG *aDescList)
Function ReadHotkeyConfig Read configuration data and fill the current hotkey list with hotkeys...
int EDA_BASE_FRAME::ReadHotkeyConfigFile ( const wxString &  aFilename,
struct EDA_HOTKEY_CONFIG aDescList 
)
inherited

Function ReadHotkeyConfigFile Read an old configuration file (&ltfile&gt.key) and fill the current hotkey list with hotkeys.

Parameters
aFilename= file name to read.
aDescList= current hotkey list descr. to initialize.

Definition at line 601 of file hotkeys_basic.cpp.

References DEFAULT_HOTKEY_FILENAME_EXT, and ParseHotkeyConfig().

Referenced by EDA_BASE_FRAME::ImportHotkeyConfigFromFile().

603 {
604  wxFileName fn( aFilename );
605  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
606 
607  wxFile cfgfile( fn.GetFullPath() );
608 
609  if( !cfgfile.IsOpened() ) // There is a problem to open file
610  return 0;
611 
612  // get length
613  cfgfile.SeekEnd();
614  wxFileOffset size = cfgfile.Tell();
615  cfgfile.Seek( 0 );
616 
617  // read data
618  char* buffer = new char[size];
619  cfgfile.Read( buffer, size );
620 
621  wxString data( buffer, wxConvUTF8 );
622 
623  // parse
624  ParseHotkeyConfig( data, aDescList );
625 
626  // cleanup
627  delete[] buffer;
628  cfgfile.Close();
629  return 1;
630 }
void ParseHotkeyConfig(const wxString &data, struct EDA_HOTKEY_CONFIG *aDescList)
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34
void KICAD_MANAGER_FRAME::RecreateBaseHToolbar ( )

(Re)Create the horizontal toolbar

Definition at line 491 of file kicad/menubar.cpp.

References ID_H_TOOLBAR, ID_LOAD_PROJECT, ID_NEW_PROJECT, ID_NEW_PROJECT_FROM_TEMPLATE, ID_PROJECT_TREE_REFRESH, ID_READ_ZIP_ARCHIVE, ID_SAVE_AND_ZIP_FILES, ID_SAVE_PROJECT, KiBitmap(), and EDA_BASE_FRAME::m_mainToolBar.

Referenced by KICAD_MANAGER_FRAME().

492 {
493  // Check if toolbar is not already created
494  if( m_mainToolBar != NULL )
495  return;
496 
497  // Allocate memory for m_mainToolBar
498  m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
499  wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
500 
501  // New
502  m_mainToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
503  KiBitmap( new_project_xpm ),
504  _( "Create new project" ) );
505 
506  m_mainToolBar->AddTool( ID_NEW_PROJECT_FROM_TEMPLATE, wxEmptyString,
507  KiBitmap( new_project_with_template_xpm ),
508  _( "Create new project from template" ) );
509 
510  // Load
511  m_mainToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString,
512  KiBitmap( open_project_xpm ),
513  _( "Open existing project" ) );
514 
515  // Currently there is nothing to save
516  // (Kicad manager does not save any info in .pro file)
517 #if 0
518  // Save
519  m_mainToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString,
520  KiBitmap( save_project_xpm ),
521  _( "Save current project" ) );
522 #endif
523 
524  // Separator
525  m_mainToolBar->AddSeparator();
526 
527  // Archive
528  m_mainToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxEmptyString,
529  KiBitmap( zip_xpm ),
530  _( "Archive all project files" ) );
531 
532  // Unarchive
533  m_mainToolBar->AddTool( ID_READ_ZIP_ARCHIVE, wxEmptyString,
534  KiBitmap( unzip_xpm ),
535  _( "Unarchive project files from zip archive" ) );
536 
537  // Separator
538  m_mainToolBar->AddSeparator();
539 
540  // Refresh project tree
541  m_mainToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxEmptyString,
542  KiBitmap( reload_xpm ),
543  _( "Refresh project tree" ) );
544 
545  // Create m_mainToolBar
546  m_mainToolBar->Realize();
547 }
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
Definition: wxstruct.h:140
void KICAD_MANAGER_FRAME::ReCreateMenuBar ( void  )
overridevirtual

(Re)Create the menubar

Reimplemented from EDA_BASE_FRAME.

Definition at line 193 of file kicad/menubar.cpp.

References AddHotkeyConfigMenu(), AddHotkeyName(), EDA_BASE_FRAME::AddMenuIconsOptions(), AddMenuItem(), PGM_BASE::AddMenuLanguageList(), PGM_KICAD::GetFileHistory(), HK_HELP, HK_NEW, HK_NEW_PRJ_TEMPLATE, HK_OPEN, HK_REFRESH, HK_RUN_BM2COMPONENT, HK_RUN_EESCHEMA, HK_RUN_FPEDITOR, HK_RUN_GERBVIEW, HK_RUN_LIBEDIT, HK_RUN_PCBCALCULATOR, HK_RUN_PCBNEW, HK_RUN_PLEDITOR, HK_SAVE, ID_BROWSE_AN_SELECT_FILE, ID_HELP_GET_INVOLVED, ID_LOAD_PROJECT, ID_NEW_PROJECT, ID_NEW_PROJECT_FROM_TEMPLATE, ID_PREFERENCES_CONFIGURE_PATHS, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, ID_PROJECT_TREE_REFRESH, ID_READ_ZIP_ARCHIVE, ID_SAVE_AND_ZIP_FILES, ID_SAVE_PROJECT, ID_SELECT_DEFAULT_PDF_BROWSER, ID_SELECT_PREFERED_EDITOR, ID_SELECT_PREFERED_PDF_BROWSER, ID_SELECT_PREFERED_PDF_BROWSER_NAME, ID_TO_BITMAP_CONVERTER, ID_TO_GERBVIEW, ID_TO_PCB, ID_TO_PCB_CALCULATOR, ID_TO_PCB_FP_EDITOR, ID_TO_PL_EDITOR, ID_TO_SCH, ID_TO_SCH_LIB_EDITOR, ID_TO_TEXT_EDITOR, KiBitmap(), kicad_Manager_Hokeys_Descr, m_manager_Hokeys_Descr, Pgm(), and PgmTop().

Referenced by KICAD_MANAGER_FRAME().

194 {
195  wxString msg;
196  static wxMenu* openRecentMenu; // Open Recent submenu,
197  // static to remember this menu
198 
200 
201  // Create and try to get the current menubar
202  wxMenuBar* menuBar = GetMenuBar();
203 
204  if( !menuBar )
205  menuBar = new wxMenuBar();
206 
207  // Delete all existing menus so they can be rebuilt.
208  // This allows language changes of the menu text on the fly.
209  menuBar->Freeze();
210 
211  // Before deleting, remove the menus managed by m_fileHistory
212  // (the file history will be updated when adding/removing files in history)
213  if( openRecentMenu )
214  PgmTop().GetFileHistory().RemoveMenu( openRecentMenu );
215 
216  // Delete all existing menus
217  while( menuBar->GetMenuCount() )
218  delete menuBar->Remove( 0 );
219 
220  // Recreate all menus:
221 
222  // Menu File:
223  wxMenu* fileMenu = new wxMenu;
224 
225  // New project creation
226  wxMenu* newprjSubMenu = new wxMenu();
227  msg = AddHotkeyName( _( "&Project..." ), kicad_Manager_Hokeys_Descr, HK_NEW );
228  AddMenuItem( newprjSubMenu, ID_NEW_PROJECT, msg,
229  _( "Create new blank project" ),
230  KiBitmap( new_project_xpm ) );
231  msg = AddHotkeyName( _( "Project from &Template..." ),
233  AddMenuItem( newprjSubMenu, ID_NEW_PROJECT_FROM_TEMPLATE, msg,
234  _( "Create new project from template" ),
235  KiBitmap( new_project_with_template_xpm ) );
236  AddMenuItem( fileMenu, newprjSubMenu,
237  wxID_ANY,
238  _( "&New" ),
239  _( "Create new project" ),
240  KiBitmap( new_project_xpm ) );
241 
242  // Open
243  msg = AddHotkeyName( _( "&Open Project..." ), kicad_Manager_Hokeys_Descr, HK_OPEN );
244  AddMenuItem( fileMenu, ID_LOAD_PROJECT, msg,
245  _( "Open an existing project" ),
246  KiBitmap( open_project_xpm ) );
247 
248  // File history
249  openRecentMenu = new wxMenu();
250  PgmTop().GetFileHistory().UseMenu( openRecentMenu );
251  PgmTop().GetFileHistory().AddFilesToMenu( );
252  AddMenuItem( fileMenu, openRecentMenu,
253  wxID_ANY,
254  _( "Open &Recent" ),
255  _( "Open a recent project" ),
256  KiBitmap( recent_xpm ) );
257 
258  // Currently there is nothing to save
259  // (Kicad manager does not save any info in .pro file)
260 #if 0
261  // Save
262  msg = AddHotkeyName( _( "&Save" ), kicad_Manager_Hokeys_Descr, HK_SAVE );
263  AddMenuItem( fileMenu, ID_SAVE_PROJECT, msg,
264  _( "Save current project" ),
265  KiBitmap( save_project_xpm ) );
266 #endif
267 
268  // Separator
269  fileMenu->AppendSeparator();
270 
271  // Archive
272  AddMenuItem( fileMenu,
274  _( "&Archive Project..." ),
275  _( "Archive all needed project files into zip archive" ),
276  KiBitmap( zip_xpm ) );
277 
278  // Unarchive
279  AddMenuItem( fileMenu,
281  _( "&Unarchive Project..." ),
282  _( "Unarchive project files from zip archive" ),
283  KiBitmap( unzip_xpm ) );
284 
285  // Separator
286  fileMenu->AppendSeparator();
287 
288  // Quit
289  AddMenuItem( fileMenu,
290  wxID_EXIT,
291  _( "&Close" ),
292  _( "Close KiCad" ),
293  KiBitmap( exit_xpm ) );
294 
295  // View Menu:
296  wxMenu* viewMenu = new wxMenu();
297 
298  // Refresh project tree
299  msg = AddHotkeyName( _( "&Refresh" ), kicad_Manager_Hokeys_Descr, HK_REFRESH );
300  AddMenuItem( viewMenu, ID_PROJECT_TREE_REFRESH, msg,
301  _( "Refresh project tree" ),
302  KiBitmap( reload_xpm ) );
303 
304  // Menu Browse:
305  wxMenu* browseMenu = new wxMenu();
306 
307  // Text editor
308  AddMenuItem( browseMenu,
310  _( "Open Text E&ditor" ),
311  _( "Launch preferred text editor" ),
312  KiBitmap( editor_xpm ) );
313 
314  // View file
315  AddMenuItem( browseMenu,
317  _( "&Open Local File" ),
318  _( "Edit local file" ),
319  KiBitmap( browse_files_xpm ) );
320 
321  // Menu Preferences:
322  wxMenu* preferencesMenu = new wxMenu;
323 
324  // Path configuration edit dialog.
325  AddMenuItem( preferencesMenu,
327  _( "Configure Pa&ths" ),
328  _( "Edit path configuration environment variables" ),
329  KiBitmap( path_xpm ) );
330 
331  // Text editor
332  AddMenuItem( preferencesMenu,
334  _( "&Set Text Editor" ),
335  _( "Set your preferred text editor" ),
336  KiBitmap( editor_xpm ) );
337 
338  // PDF Viewer submenu:System browser or user defined checkbox
339  wxMenu* SubMenuPdfBrowserChoice = new wxMenu;
340 
341  // Default
342  AddMenuItem( SubMenuPdfBrowserChoice, ID_SELECT_DEFAULT_PDF_BROWSER,
343  _( "System &Default PDF Viewer" ),
344  _( "Use system default PDF viewer" ),
345  KiBitmap( datasheet_xpm ),
346  wxITEM_CHECK );
347  SubMenuPdfBrowserChoice->Check( ID_SELECT_DEFAULT_PDF_BROWSER,
348  Pgm().UseSystemPdfBrowser() );
349 
350  // Favourite
351  AddMenuItem( SubMenuPdfBrowserChoice, ID_SELECT_PREFERED_PDF_BROWSER,
352  _( "&Favourite PDF Viewer" ),
353  _( "Use favourite PDF viewer" ),
354  KiBitmap( datasheet_xpm ),
355  wxITEM_CHECK );
356  SubMenuPdfBrowserChoice->Check( ID_SELECT_PREFERED_PDF_BROWSER,
357  !Pgm().UseSystemPdfBrowser() );
358 
359  SubMenuPdfBrowserChoice->AppendSeparator();
360  // Append PDF Viewer submenu to preferences
361  AddMenuItem( SubMenuPdfBrowserChoice,
363  _( "Set &PDF Viewer" ),
364  _( "Set favourite PDF viewer" ),
365  KiBitmap( datasheet_xpm ) );
366 
367  // PDF viewer submenu
368  AddMenuItem( preferencesMenu, SubMenuPdfBrowserChoice, -1,
369  _( "&PDF Viewer" ),
370  _( "PDF viewer preferences" ),
371  KiBitmap( datasheet_xpm ) );
372 
373  // Hotkey submenu
374  preferencesMenu->AppendSeparator();
375  AddHotkeyConfigMenu( preferencesMenu );
376 
377  // Language submenu
378  preferencesMenu->AppendSeparator();
379  Pgm().AddMenuLanguageList( preferencesMenu );
380 
381  // Icons options submenu
382  preferencesMenu->AppendSeparator();
383  AddMenuIconsOptions( preferencesMenu );
384 
385  // Menu Tools:
386  wxMenu* toolsMenu = new wxMenu;
387 
388  msg = AddHotkeyName( _( "Edit Schematic" ), kicad_Manager_Hokeys_Descr, HK_RUN_EESCHEMA );
389  AddMenuItem( toolsMenu, ID_TO_SCH, msg, KiBitmap( eeschema_xpm ) );
390 
391  msg = AddHotkeyName( _( "Manage Symbol Libraries" ),
393  AddMenuItem( toolsMenu, ID_TO_SCH_LIB_EDITOR, msg, KiBitmap( libedit_xpm ) );
394 
395  msg = AddHotkeyName( _( "Edit PCB Layout" ),
397  AddMenuItem( toolsMenu, ID_TO_PCB, msg, KiBitmap( pcbnew_xpm ) );
398 
399  msg = AddHotkeyName( _( "Edit PCB Footprint" ),
401  AddMenuItem( toolsMenu, ID_TO_PCB_FP_EDITOR, msg, KiBitmap( module_editor_xpm ) );
402 
403  msg = AddHotkeyName( _( "View Gerber Files" ),
405  AddMenuItem( toolsMenu, ID_TO_GERBVIEW, msg, KiBitmap( icon_gerbview_small_xpm ) );
406 
407  msg = AddHotkeyName( _( "Convert Image" ),
409  AddMenuItem( toolsMenu, ID_TO_BITMAP_CONVERTER, msg,
410  _( "Bitmap2Component - Convert bitmap images to Eeschema\n"
411  "or Pcbnew elements" ),
412  KiBitmap( image_xpm ) );
413 
414  msg = AddHotkeyName( _( "Run PCB Calculator" ), kicad_Manager_Hokeys_Descr, HK_RUN_PCBCALCULATOR );
415  AddMenuItem( toolsMenu, ID_TO_PCB_CALCULATOR, msg,
416  _( "Pcb calculator - Calculator for components, track width, etc." ),
417  KiBitmap( pcbcalculator_xpm ) );
418 
419  msg = AddHotkeyName( _( "Edit Page Layout" ), kicad_Manager_Hokeys_Descr, HK_RUN_PLEDITOR );
420  AddMenuItem( toolsMenu, ID_TO_PL_EDITOR, msg,
421  _( "Pl editor - Worksheet layout editor" ),
422  KiBitmap( pagelayout_load_xpm ) );
423 
424  // Menu Help:
425  wxMenu* helpMenu = new wxMenu;
426 
427  // Contents
428  AddMenuItem( helpMenu, wxID_HELP,
429  _( "KiCad &Manual" ),
430  _( "Open KiCad user manual" ),
431  KiBitmap( online_help_xpm ) );
432 
433  AddMenuItem( helpMenu, wxID_INDEX,
434  _( "&Getting Started in KiCad" ),
435  _( "Open \"Getting Started in KiCad\" guide for beginners" ),
436  KiBitmap( help_xpm ) );
437 
438  AddMenuItem( helpMenu,
440  _( "&List Hotkeys" ),
441  _( "Displays the current hotkeys list and corresponding commands" ),
442  KiBitmap( hotkeys_xpm ) );
443 
444  // Separator
445  helpMenu->AppendSeparator();
446 
447  // Get involved with KiCad
449  _( "Get &Involved" ),
450  _( "Contribute to KiCad (opens a web browser)" ),
451  KiBitmap( info_xpm ) );
452 
453  helpMenu->AppendSeparator();
454 
455  // About
456  AddMenuItem( helpMenu, wxID_ABOUT,
457  _( "&About KiCad" ),
458  _( "About KiCad" ),
459  KiBitmap( about_xpm ) );
460 
461  // Create the menubar and append all submenus
462  menuBar->Append( fileMenu, _( "&File" ) );
463  menuBar->Append( viewMenu, _( "&View" ) );
464  menuBar->Append( toolsMenu, _( "&Tools" ) );
465  menuBar->Append( browseMenu, _( "&Browse" ) );
466  menuBar->Append( preferencesMenu, _( "&Preferences" ) );
467  menuBar->Append( helpMenu, _( "&Help" ) );
468 
469  menuBar->Thaw();
470 
471  // Associate the menu bar with the frame, if no previous menubar
472  if( GetMenuBar() == NULL )
473  SetMenuBar( menuBar );
474  else
475  menuBar->Refresh();
476 
477  // Add the hotkey to the "show hotkey list" menu, because we do not have
478  // a management of the keyboard keys in Kicad.
479  // So all hotheys should be added to the menubar
480  // Note Use wxMenuBar::SetLabel only after the menubar
481  // has been associated with a frame. (see wxWidgets doc)
482  msg = AddHotkeyName( menuBar->GetLabel( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST ),
484  menuBar->SetLabel( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, msg );
485 }
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Function AddMenuItem is an inline helper function to create and insert a menu item with an icon into ...
Definition: bitmap.cpp:55
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
struct EDA_HOTKEY_CONFIG kicad_Manager_Hokeys_Descr[]
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
EDA_HOTKEY_CONFIG * m_manager_Hokeys_Descr
Definition: kicad.h:304
PGM_KICAD & PgmTop()
Definition: kicad.cpp:71
void AddHotkeyConfigMenu(wxMenu *aMenu)
void AddMenuIconsOptions(wxMenu *MasterMenu)
Function AddMenuIconsOptions creates a menu list for icons in menu and icon sizes choice...
Definition: basicframe.cpp:673
wxString AddHotkeyName(const wxString &aText, EDA_HOTKEY **aList, int aCommandId, HOTKEY_ACTION_TYPE aShortCutType)
Function AddHotkeyName Add the key name from the Command id value ( m_Idcommand member value) ...
VTBL_ENTRY void AddMenuLanguageList(wxMenu *MasterMenu)
Function AddMenuLanguageList creates a menu list for language choice, and add it as submenu to Master...
Definition: pgm_base.cpp:824
wxFileHistory & GetFileHistory()
Definition: pgm_kicad.h:57
KICAD_MANAGER_FRAME::language_change KICAD_MANAGER_FRAME::OnChangeIconsOptions ID_TO_PCB_FP_EDITOR
void KICAD_MANAGER_FRAME::ReCreateTreePrj ( )

Definition at line 183 of file mainframe.cpp.

References m_LeftWin, and TREE_PROJECT_FRAME::ReCreateTreePrj().

184 {
186 }
void ReCreateTreePrj()
Create or modify the tree showing project file names.
TREE_PROJECT_FRAME * m_LeftWin
Definition: kicad.h:298
void KICAD_MANAGER_FRAME::RunEeschema ( const wxString &  aProjectSchematicFileName)

Call this only for a SCH associated with the current project.

That is, it must have the same path and name as the project *.pro file.

Definition at line 296 of file mainframe.cpp.

References FRAME_SCH, Kiway, KIWAY_PLAYER::OpenProjectFiles(), KIWAY::Player(), and IO_ERROR::What().

Referenced by OnRunEeschema().

297 {
298  KIWAY_PLAYER* frame = Kiway.Player( FRAME_SCH, false );
299 
300  // Please: note: DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::initBuffers() calls
301  // Kiway.Player( FRAME_SCH, true )
302  // therefore, the schematic editor is sometimes running, but the schematic project
303  // is not loaded, if the library editor was called, and the dialog field editor was used.
304  // On linux, it happens the first time the schematic editor is launched, if
305  // library editor was running, and the dialog field editor was open
306  // On Windows, it happens always after the library editor was called,
307  // and the dialog field editor was used
308  if( !frame )
309  {
310  try
311  {
312  frame = Kiway.Player( FRAME_SCH, true );
313  }
314  catch( IO_ERROR err )
315  {
316  wxMessageBox( _( "Eeschema failed to load:\n" ) + err.What(),
317  _( "KiCad Error" ), wxOK | wxICON_ERROR, this );
318  return;
319  }
320  }
321 
322  if( !frame->IsShown() ) // the frame exists, (created by the dialog field editor)
323  // but no project loaded.
324  {
325  frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectSchematicFileName ) );
326  frame->Show( true );
327  }
328 
329  // On Windows, Raise() does not bring the window on screen, when iconized or not shown
330  // On linux, Raise() brings the window on screen, but this code works fine
331  if( frame->IsIconized() )
332  frame->Iconize( false );
333 
334  frame->Raise();
335 }
Class KIWAY_PLAYER is a wxFrame capable of the OpenProjectFiles function, meaning it can load a porti...
Definition: kiway_player.h:111
VTBL_ENTRY bool OpenProjectFiles(const std::vector< wxString > &aFileList, int aCtl=0)
Function OpenProjectFiles is abstract, and opens a project or set of files given by aFileList...
Definition: kiway_player.h:170
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, KIWAY_PLAYER *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:302
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:47
KIWAY Kiway
void KICAD_MANAGER_FRAME::RunPcbNew ( const wxString &  aProjectBoardFileName)

Call this only for a PCB associated with the current project.

That is, it must have the same path and name as the project *.pro file.

Definition at line 374 of file mainframe.cpp.

References FRAME_PCB, Kiway, KIWAY_PLAYER::OpenProjectFiles(), KIWAY::Player(), and IO_ERROR::What().

Referenced by OnRunPcbNew().

375 {
376  KIWAY_PLAYER* frame;
377 
378  try
379  {
380  frame = Kiway.Player( FRAME_PCB, true );
381  }
382  catch( IO_ERROR err )
383  {
384  wxMessageBox( _( "Pcbnew failed to load:\n" ) + err.What(), _( "KiCad Error" ),
385  wxOK | wxICON_ERROR, this );
386  return;
387  }
388 
389  // a pcb frame can be already existing, but not yet used.
390  // this is the case when running the footprint editor, or the footprint viewer first
391  // if the frame is not visible, the board is not yet loaded
392  if( !frame->IsVisible() )
393  {
394  frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectBoardFileName ) );
395  frame->Show( true );
396  }
397 
398  // On Windows, Raise() does not bring the window on screen, when iconized
399  if( frame->IsIconized() )
400  frame->Iconize( false );
401 
402  frame->Raise();
403 }
Class KIWAY_PLAYER is a wxFrame capable of the OpenProjectFiles function, meaning it can load a porti...
Definition: kiway_player.h:111
VTBL_ENTRY bool OpenProjectFiles(const std::vector< wxString > &aFileList, int aCtl=0)
Function OpenProjectFiles is abstract, and opens a project or set of files given by aFileList...
Definition: kiway_player.h:170
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, KIWAY_PLAYER *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:302
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:47
KIWAY Kiway
virtual void EDA_BASE_FRAME::SaveProjectSettings ( bool  aAskForSave)
inlinevirtualinherited

Function SaveProjectSettings saves changes to the project settings to the project (.pro) file.

The method is virtual so you can override it to call the suitable save method. The base method do nothing

Parameters
aAskForSave= true to open a dialog before saving the settings

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 274 of file wxstruct.h.

Referenced by DIALOG_PAGES_SETTINGS::OnOkClick().

274 {};
void KICAD_MANAGER_FRAME::SaveSettings ( wxConfigBase *  aCfg)
overridevirtual

Function SaveSettings saves common frame parameters to a configuration data file.

Don't forget to call the base class's SaveSettings() from your derived SaveSettings() otherwise the frames won't remember their positions and sizes.

Reimplemented from EDA_BASE_FRAME.

Definition at line 541 of file mainframe.cpp.

References m_LeftWin, EDA_BASE_FRAME::SaveSettings(), and TREE_FRAME_WIDTH_ENTRY.

542 {
544  aCfg->Write( TREE_FRAME_WIDTH_ENTRY, m_LeftWin->GetSize().x );
545 }
virtual void SaveSettings(wxConfigBase *aCfg)
Function SaveSettings saves common frame parameters to a configuration data file. ...
Definition: basicframe.cpp:316
#define TREE_FRAME_WIDTH_ENTRY
Definition: mainframe.cpp:48
TREE_PROJECT_FRAME * m_LeftWin
Definition: kicad.h:298
const wxString KICAD_MANAGER_FRAME::SchFileName ( )

Definition at line 153 of file mainframe.cpp.

References GetProjectFileName(), and SchematicFileExtension.

Referenced by TREEPROJECT_ITEM::Activate().

154 {
155  wxFileName fn( GetProjectFileName() );
156 
157  fn.SetExt( SchematicFileExtension );
158 
159  return fn.GetFullPath();
160 }
const wxString SchematicFileExtension
const wxString GetProjectFileName()
Definition: mainframe.cpp:147
void EDA_BASE_FRAME::SetAutoSaveInterval ( int  aInterval)
inherited

Definition at line 205 of file basicframe.cpp.

References EDA_BASE_FRAME::m_autoSaveInterval, EDA_BASE_FRAME::m_autoSaveState, and EDA_BASE_FRAME::m_autoSaveTimer.

Referenced by DIALOG_GENERALOPTIONS::OnOkClick(), and SCH_EDIT_FRAME::OnPreferencesOptions().

206 {
207  m_autoSaveInterval = aInterval;
208 
209  if( m_autoSaveTimer->IsRunning() )
210  {
211  if( m_autoSaveInterval > 0 )
212  {
213  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
214  }
215  else
216  {
217  m_autoSaveTimer->Stop();
218  m_autoSaveState = false;
219  }
220  }
221 }
bool m_autoSaveState
Flag to indicate the last auto save state.
Definition: wxstruct.h:150
wxTimer * m_autoSaveTimer
The timer used to implement the auto save feature;.
Definition: wxstruct.h:156
int m_autoSaveInterval
The auto save interval time in seconds.
Definition: wxstruct.h:153
void EDA_BASE_FRAME::SetMruPath ( const wxString &  aPath)
inlineinherited

Definition at line 361 of file wxstruct.h.

Referenced by EDA_BASE_FRAME::ExportHotkeyConfigToFile(), EDA_BASE_FRAME::ImportHotkeyConfigFromFile(), and LoadProject().

361 { m_mruPath = aPath; }
wxString m_mruPath
Most recently used path.
Definition: wxstruct.h:160
void KICAD_MANAGER_FRAME::SetProjectFileName ( const wxString &  aFullProjectProFileName)

Definition at line 135 of file mainframe.cpp.

References Prj(), and PROJECT::SetProjectFullName().

Referenced by CreateNewProject(), and LoadProject().

136 {
137  // ensure file name is absolute:
138  wxFileName fn( aFullProjectProFileName );
139 
140  if( !fn.IsAbsolute() )
141  fn.MakeAbsolute();
142 
143  Prj().SetProjectFullName( fn.GetFullPath() );
144 }
PROJECT & Prj()
Definition: kicad.cpp:270
VTBL_ENTRY void SetProjectFullName(const wxString &aFullPathAndName)
Function SetProjectFullName sets the: 1) full directory, 2) basename, and 3) extension of the project...
Definition: project.cpp:65
void EDA_BASE_FRAME::ShowChangedIcons ( )
virtualinherited

Function ShowChangedIcons redraws items menus after a icon was changed option.

Definition at line 249 of file basicframe.cpp.

References EDA_BASE_FRAME::ReCreateMenuBar().

Referenced by KIWAY::ShowChangedIcons().

250 {
251  ReCreateMenuBar();
252  GetMenuBar()->Refresh();
253 }
virtual void ReCreateMenuBar()
Function ReCreateMenuBar Creates recreates the menu bar.
Definition: basicframe.cpp:237
void EDA_BASE_FRAME::ShowChangedLanguage ( )
virtualinherited

Function ShowChangedLanguage redraws the menus and what not in current language.

Reimplemented in PCB_EDIT_FRAME, and GERBVIEW_FRAME.

Definition at line 242 of file basicframe.cpp.

References EDA_BASE_FRAME::ReCreateMenuBar().

Referenced by KIWAY::SetLanguage(), GERBVIEW_FRAME::ShowChangedLanguage(), and PCB_EDIT_FRAME::ShowChangedLanguage().

243 {
244  ReCreateMenuBar();
245  GetMenuBar()->Refresh();
246 }
virtual void ReCreateMenuBar()
Function ReCreateMenuBar Creates recreates the menu bar.
Definition: basicframe.cpp:237
const SEARCH_STACK & KICAD_MANAGER_FRAME::sys_search ( )
overrideprivatevirtual

Function sys_search returns a SEARCH_STACK pertaining to entire program, and is overloaded in KICAD_MANAGER_FRAME.

Reimplemented from EDA_BASE_FRAME.

Definition at line 189 of file mainframe.cpp.

References PgmTop(), and PGM_KICAD::SysSearch().

Referenced by CreateNewProject().

190 {
191  return PgmTop().SysSearch();
192 }
SEARCH_STACK & SysSearch()
Definition: pgm_kicad.h:61
PGM_KICAD & PgmTop()
Definition: kicad.cpp:71
void EDA_BASE_FRAME::UpdateFileHistory ( const wxString &  FullFileName,
wxFileHistory *  aFileHistory = NULL 
)
inherited

Function UpdateFileHistory Updates the list of recently opened files.

Note also the menu is updated, if wxFileHistory::UseMenu was called at init time

Parameters
FullFileNameThe full file name including the path.
aFileHistoryThe wxFileHistory in use. If NULL, the main application file history is used.

Definition at line 388 of file basicframe.cpp.

References KIFACE_I::GetFileHistory(), and Kiface().

Referenced by GERBVIEW_FRAME::LoadExcellonFiles(), GERBVIEW_FRAME::LoadGerberFiles(), GERBVIEW_FRAME::LoadGerberJobFile(), PL_EDITOR_FRAME::LoadPageLayoutDescrFile(), LoadProject(), OnCloseWindow(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::SavePcbFile(), and GERBVIEW_FRAME::unarchiveFiles().

390 {
391  wxFileHistory* fileHistory = aFileHistory;
392 
393  if( !fileHistory )
394  fileHistory = &Kiface().GetFileHistory();
395 
396  fileHistory->AddFileToHistory( FullFileName );
397 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
wxFileHistory & GetFileHistory()
Definition: kiface_i.h:123
int EDA_BASE_FRAME::WriteHotkeyConfig ( struct EDA_HOTKEY_CONFIG aDescList,
wxString *  aFullFileName = NULL 
)
virtualinherited

Function WriteHotkeyConfig Store the current hotkey list It is stored using the standard wxConfig mechanism or a file.

Parameters
aDescList= pointer to the current hotkey list.
aFullFileName= a wxString pointer to a full file name. if NULL, use the standard wxConfig mechanism (default) the output format is: shortcut "key" "function" lines starting with # are comments

Reimplemented in EDA_DRAW_FRAME.

Definition at line 534 of file hotkeys_basic.cpp.

References AddDelimiterString(), EDA_BASE_FRAME::config(), DEFAULT_HOTKEY_FILENAME_EXT, GetChars(), GetNewConfig(), HOTKEYS_CONFIG_KEY, KeyNameFromKeyCode(), EDA_HOTKEY_CONFIG::m_HK_InfoList, EDA_HOTKEY::m_InfoMsg, EDA_HOTKEY::m_KeyCode, EDA_HOTKEY_CONFIG::m_SectionTag, EDA_HOTKEY_CONFIG::m_Title, and TO_UTF8.

Referenced by EDA_BASE_FRAME::ExportHotkeyConfigToFile(), HOTKEYS_EDITOR_DIALOG::TransferDataFromWindow(), and EDA_DRAW_FRAME::WriteHotkeyConfig().

536 {
537  wxString msg;
538  wxString keyname, infokey;
539 
540  msg = wxT( "$hotkey list\n" );
541 
542  // Print the current hotkey list
543  EDA_HOTKEY** list;
544 
545  for( ; aDescList->m_HK_InfoList != NULL; aDescList++ )
546  {
547  if( aDescList->m_Title )
548  {
549  msg += wxT( "# " );
550  msg += *aDescList->m_Title;
551  msg += wxT( "\n" );
552  }
553 
554  msg += *aDescList->m_SectionTag;
555  msg += wxT( "\n" );
556 
557  list = aDescList->m_HK_InfoList;
558 
559  for( ; *list != NULL; list++ )
560  {
561  EDA_HOTKEY* hk_decr = *list;
562  msg += wxT( "shortcut " );
563  keyname = KeyNameFromKeyCode( hk_decr->m_KeyCode );
564  AddDelimiterString( keyname );
565  infokey = hk_decr->m_InfoMsg;
566  AddDelimiterString( infokey );
567  msg += keyname + wxT( ": " ) + infokey + wxT( "\n" );
568  }
569  }
570 
571  msg += wxT( "$Endlist\n" );
572 
573  if( aFullFileName )
574  {
575  FILE* file = wxFopen( *aFullFileName, wxT( "wt" ) );
576 
577  if( file )
578  {
579  fputs( TO_UTF8( msg ), file );
580  fclose( file );
581  }
582  else
583  {
584  msg.Printf( wxT( "Unable to write file %s" ), GetChars( *aFullFileName ) );
585  return 0;
586  }
587  }
588  else
589  {
590  wxFileName fn( GetName() );
591  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
592  wxConfigBase* config = GetNewConfig( fn.GetFullPath() );
593  config->Write( HOTKEYS_CONFIG_KEY, msg );
594  delete config;
595  }
596 
597  return 1;
598 }
EDA_HOTKEY ** m_HK_InfoList
Definition: hotkeys_basic.h:91
wxConfigBase * GetNewConfig(const wxString &aProgName)
Function GetNewConfig.
Definition: common.cpp:205
virtual wxConfigBase * config()
Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_F...
Definition: basicframe.cpp:361
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes...
Definition: macros.h:47
#define HOTKEYS_CONFIG_KEY
void AddDelimiterString(wxString &string)
Function AddDelimiterString Add un " to the start and the end of string (if not already done)...
Definition: gestfich.cpp:44
wxString * m_SectionTag
Definition: hotkeys_basic.h:90
wxString m_InfoMsg
Definition: hotkeys_basic.h:64
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
class EDA_HOTKEY is a class to handle hot key commands.
Definition: hotkeys_basic.h:57
wxString * m_Title
Definition: hotkeys_basic.h:92
wxString KeyNameFromKeyCode(int aKeycode, bool *aIsFound)
Function KeyNameFromKeyCode return the key name from the key code Only some wxWidgets key values are ...
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34

Member Data Documentation

wxString EDA_BASE_FRAME::m_AboutTitle
protectedinherited

Name of program displayed in About.

Definition at line 142 of file wxstruct.h.

bool KICAD_MANAGER_FRAME::m_active_project
private

Definition at line 308 of file kicad.h.

Referenced by KICAD_MANAGER_FRAME(), LoadProject(), and OnUpdateRequiresProject().

bool EDA_BASE_FRAME::m_autoSaveState
protectedinherited
wxTimer* EDA_BASE_FRAME::m_autoSaveTimer
protectedinherited
wxString EDA_BASE_FRAME::m_configFrameName
protectedinherited

prefix used in config to identify some params (frame size...) if empty, the frame name defined in CTOR is used

Definition at line 137 of file wxstruct.h.

Referenced by EDA_BASE_FRAME::ConfigBaseName().

bool EDA_BASE_FRAME::m_hasAutoSave
protectedinherited

Flag to indicate if this frame supports auto save.

Definition at line 147 of file wxstruct.h.

Referenced by EDA_BASE_FRAME::EDA_BASE_FRAME(), EDA_BASE_FRAME::LoadSettings(), EDA_BASE_FRAME::ProcessEvent(), and EDA_BASE_FRAME::SaveSettings().

FRAME_T EDA_BASE_FRAME::m_Ident
protectedinherited

Id Type (pcb, schematic, library..)

Definition at line 133 of file wxstruct.h.

Referenced by EDA_BASE_FRAME::EDA_BASE_FRAME().

LAUNCHER_PANEL* KICAD_MANAGER_FRAME::m_Launcher
private

Definition at line 299 of file kicad.h.

Referenced by KICAD_MANAGER_FRAME().

TREE_PROJECT_FRAME* KICAD_MANAGER_FRAME::m_LeftWin
private
int KICAD_MANAGER_FRAME::m_leftWinWidth
private

Definition at line 303 of file kicad.h.

Referenced by KICAD_MANAGER_FRAME(), and LoadSettings().

EDA_HOTKEY_CONFIG* KICAD_MANAGER_FRAME::m_manager_Hokeys_Descr
private

Definition at line 304 of file kicad.h.

Referenced by KICAD_MANAGER_FRAME(), Process_Config(), and ReCreateMenuBar().

wxTextCtrl* KICAD_MANAGER_FRAME::m_MessagesBox
private

Definition at line 300 of file kicad.h.

Referenced by ClearMsg(), KICAD_MANAGER_FRAME(), and PrintMsg().

wxString EDA_BASE_FRAME::m_perspective
protectedinherited

wxAuiManager perspective.

Definition at line 158 of file wxstruct.h.

Referenced by EDA_BASE_FRAME::LoadSettings().

wxAuiToolBar* KICAD_MANAGER_FRAME::m_VToolBar
private

Definition at line 301 of file kicad.h.


The documentation for this class was generated from the following files: