KiCad PCB EDA Suite
mainframe.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2013 CERN (www.cern.ch)
6  * Copyright (C) 2004-2017 KiCad Developers, see change_log.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
32 #include <draw_frame.h>
33 #include <dialog_hotkeys_editor.h>
34 #include <gestfich.h>
35 #include <kiway.h>
36 #include <kiway_player.h>
38 #include <bitmaps.h>
39 #include <executable_names.h>
40 #include <build_version.h>
41 
42 #include "pgm_kicad.h"
43 #include "tree_project_frame.h"
44 
45 #include "kicad.h"
46 
47 
48 #define TREE_FRAME_WIDTH_ENTRY wxT( "LeftWinWidth" )
49 
51  const wxString& title, const wxPoint& pos, const wxSize& size ) :
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 }
119 
120 
122 {
123  m_auimgr.UnInit();
124 }
125 
126 
128 {
129  wxConfigBase* ret = PgmTop().PgmSettings();
130  wxASSERT( ret );
131  return ret;
132 }
133 
134 
135 void KICAD_MANAGER_FRAME::SetProjectFileName( const wxString& aFullProjectProFileName )
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 }
145 
146 
148 {
149  return Prj().GetProjectFullName();
150 }
151 
152 
154 {
155  wxFileName fn( GetProjectFileName() );
156 
157  fn.SetExt( SchematicFileExtension );
158 
159  return fn.GetFullPath();
160 }
161 
162 
164 {
165  wxFileName fn( GetProjectFileName() );
166 
167  fn.SetExt( PcbFileExtension );
168 
169  return fn.GetFullPath();
170 }
171 
172 
174 {
175  wxFileName fn( GetProjectFileName() );
176 
177  fn.SetExt( LegacyPcbFileExtension );
178 
179  return fn.GetFullPath();
180 }
181 
182 
184 {
186 }
187 
188 
190 {
191  return PgmTop().SysSearch();
192 }
193 
194 
196 {
197  return PgmTop().GetHelpFileName();
198 }
199 
200 
201 void KICAD_MANAGER_FRAME::PrintMsg( const wxString& aText )
202 {
203  m_MessagesBox->AppendText( aText );
204 }
205 
206 
207 void KICAD_MANAGER_FRAME::OnSize( wxSizeEvent& event )
208 {
209  if( m_auimgr.GetManagedWindow() )
210  m_auimgr.Update();
211 
212  event.Skip();
213 }
214 
215 
216 void KICAD_MANAGER_FRAME::OnCloseWindow( wxCloseEvent& Event )
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 }
243 
244 
245 void KICAD_MANAGER_FRAME::OnExit( wxCommandEvent& event )
246 {
247  Close( true );
248 }
249 
250 
252 {
253  wxString msg = wxString::Format( _( "%s closed [pid=%d]\n" ),
254  GetChars( m_appName ), pid );
255 
256  wxWindow* window = wxWindow::FindWindowByName( KICAD_MANAGER_FRAME_NAME );
257 
258  if( window ) // Should always happen.
259  {
260  // Be sure the kicad frame manager is found
261  // This dynamic cast is not really mandatory, but ...
262  KICAD_MANAGER_FRAME* frame = dynamic_cast<KICAD_MANAGER_FRAME*> (window);
263 
264  if( frame )
265  frame->PrintMsg( msg );
266  }
267 
268  delete this;
269 }
270 
271 
272 void KICAD_MANAGER_FRAME::Execute( wxWindow* frame, const wxString& execFile,
273  wxString params )
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 }
294 
295 
296 void KICAD_MANAGER_FRAME::RunEeschema( const wxString& aProjectSchematicFileName )
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 }
336 
337 
338 void KICAD_MANAGER_FRAME::OnRunEeschema( wxCommandEvent& event )
339 {
340  wxFileName fn( GetProjectFileName() );
341  fn.SetExt( SchematicFileExtension );
342  RunEeschema( fn.GetFullPath() );
343 }
344 
345 
346 void KICAD_MANAGER_FRAME::OnRunSchLibEditor( wxCommandEvent& event )
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 }
372 
373 
374 void KICAD_MANAGER_FRAME::RunPcbNew( const wxString& aProjectBoardFileName )
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 }
404 
405 
406 void KICAD_MANAGER_FRAME::OnRunPcbNew( wxCommandEvent& event )
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 }
416 
417 
418 void KICAD_MANAGER_FRAME::OnRunPcbFpEditor( wxCommandEvent& event )
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 }
444 
445 
446 void KICAD_MANAGER_FRAME::OnChangeIconsOptions( wxCommandEvent& event )
447 {
450 }
451 
452 
453 void KICAD_MANAGER_FRAME::OnRunBitmapConverter( wxCommandEvent& event )
454 {
455  Execute( this, BITMAPCONVERTER_EXE );
456 }
457 
458 
459 void KICAD_MANAGER_FRAME::OnRunPcbCalculator( wxCommandEvent& event )
460 {
461  Execute( this, PCB_CALCULATOR_EXE );
462 }
463 
464 
465 void KICAD_MANAGER_FRAME::OnRunPageLayoutEditor( wxCommandEvent& event )
466 {
467  Execute( this, PL_EDITOR_EXE );
468 }
469 
470 
471 
472 void KICAD_MANAGER_FRAME::OnRunGerbview( wxCommandEvent& event )
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 }
479 
480 
481 void KICAD_MANAGER_FRAME::OnOpenTextEditor( wxCommandEvent& event )
482 {
483  wxString editorname = Pgm().GetEditorName();
484 
485  if( !editorname.IsEmpty() )
486  Execute( this, editorname, wxEmptyString );
487 }
488 
489 
490 void KICAD_MANAGER_FRAME::OnOpenFileInTextEditor( wxCommandEvent& event )
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 }
513 
514 
515 void KICAD_MANAGER_FRAME::OnRefresh( wxCommandEvent& event )
516 {
518 }
519 
520 
521 void KICAD_MANAGER_FRAME::language_change( wxCommandEvent& event )
522 {
523  int id = event.GetId();
524  Kiway.SetLanguage( id );
525 }
526 
527 
529 {
530  m_MessagesBox->Clear();
531 }
532 
533 
534 void KICAD_MANAGER_FRAME::LoadSettings( wxConfigBase* aCfg )
535 {
537  aCfg->Read( TREE_FRAME_WIDTH_ENTRY, &m_leftWinWidth );
538 }
539 
540 
541 void KICAD_MANAGER_FRAME::SaveSettings( wxConfigBase* aCfg )
542 {
544  aCfg->Write( TREE_FRAME_WIDTH_ENTRY, m_LeftWin->GetSize().x );
545 }
546 
547 
549 {
550  wxString msg = wxString::Format( _( "Project name:\n%s\n" ),
552  PrintMsg( msg );
553 }
554 
555 
556 void KICAD_MANAGER_FRAME::Process_Config( wxCommandEvent& event )
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 }
586 
587 
588 void KICAD_MANAGER_FRAME::OnConfigurePaths( wxCommandEvent& aEvent )
589 {
590  Pgm().ConfigurePaths( this );
591 }
EDA_PANEINFO & HorizontalToolbarPane()
Function HorizontalToolbarPane Change *this to a horizontal toolbar for KiCad.
Definition: wxstruct.h:479
void OnRunPcbCalculator(wxCommandEvent &event)
Definition: mainframe.cpp:459
#define KICAD_DEFAULT_DRAWFRAME_STYLE
Definition: wxstruct.h:55
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
KiCad executable names.
Class KIWAY_PLAYER is a wxFrame capable of the OpenProjectFiles function, meaning it can load a porti...
Definition: kiway_player.h:111
void OnRunPageLayoutEditor(wxCommandEvent &event)
Definition: mainframe.cpp:465
void language_change(wxCommandEvent &event)
Definition: mainframe.cpp:521
const wxString PL_EDITOR_EXE
class LAUNCHER_PANEL
Definition: kicad.h:314
SEARCH_STACK & SysSearch()
Definition: pgm_kicad.h:61
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
Definition: mainframe.cpp:534
This file is part of the common library TODO brief description.
void OnRefresh(wxCommandEvent &event)
Definition: mainframe.cpp:515
void OnRunPcbFpEditor(wxCommandEvent &event)
Definition: mainframe.cpp:418
void OnRunEeschema(wxCommandEvent &event)
Definition: mainframe.cpp:338
PROJECT & Prj()
Definition: kicad.cpp:270
virtual void SaveSettings(wxConfigBase *aCfg)
Function SaveSettings saves common frame parameters to a configuration data file. ...
Definition: basicframe.cpp:316
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 OnOpenFileInTextEditor(wxCommandEvent &event)
Definition: mainframe.cpp:490
#define TREE_FRAME_WIDTH_ENTRY
Definition: mainframe.cpp:48
VTBL_ENTRY const wxString GetProjectFullName() const
Function GetProjectFullName returns the full path and name of the project.
Definition: project.cpp:96
void OnRunSchLibEditor(wxCommandEvent &event)
Definition: mainframe.cpp:346
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
virtual void OnChangeIconsOptions(wxCommandEvent &event)
Function OnChangeIconsOptions Selects the current icons options in menus (or toolbars) in Kicad (the ...
Definition: basicframe.cpp:662
Class SEARCH_STACK looks for files in a number of places.
Definition: search_stack.h:41
wxAuiManager m_auimgr
Definition: wxstruct.h:144
void OnConfigurePaths(wxCommandEvent &aEvent)
Definition: mainframe.cpp:588
VTBL_ENTRY void SetLanguage(int aLanguage)
Function SetLanguage changes the language and then calls ShowChangedLanguage() on all KIWAY_PLAYERs...
Definition: kiway.cpp:396
void OnRunBitmapConverter(wxCommandEvent &event)
Definition: mainframe.cpp:453
int GetPanelHeight() const
VTBL_ENTRY void ShowChangedIcons()
Function ShowChangedIcons Calls ShowChangedIcons() on all KIWAY_PLAYERs.
Definition: kiway.cpp:432
void UpdateFileHistory(const wxString &FullFileName, wxFileHistory *aFileHistory=NULL)
Function UpdateFileHistory Updates the list of recently opened files.
Definition: basicframe.cpp:388
void OnOpenTextEditor(wxCommandEvent &event)
Definition: mainframe.cpp:481
Specialization of the wxAuiPaneInfo class for KiCad panels.
Definition: wxstruct.h:470
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
const wxString GERBVIEW_EXE
LAUNCHER_PANEL * m_Launcher
Definition: kicad.h:299
void RunEeschema(const wxString &aProjectSchematicFileName)
Call this only for a SCH associated with the current project.
Definition: mainframe.cpp:296
VTBL_ENTRY void ConfigurePaths(wxWindow *aParent=NULL)
Function ConfigurePaths.
Definition: pgm_base.cpp:905
wxConfigBase * PgmSettings()
Definition: pgm_kicad.h:59
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
const wxString SchFileName()
Definition: mainframe.cpp:153
void DisplayHotkeyList(EDA_BASE_FRAME *aFrame, struct EDA_HOTKEY_CONFIG *aDescList)
Function DisplayHotkeyList Displays the current hotkey list.
void Execute(wxWindow *frame, const wxString &execFile, wxString param=wxEmptyString)
Open another KiCad application and logs a message.
Definition: mainframe.cpp:272
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
void PrintMsg(const wxString &aText)
Displays aText in the text panel.
Definition: mainframe.cpp:201
wxString GetBuildVersion()
Function GetBuildVersion Return the build version string.
KICAD_MANAGER_FRAME is the KiCad main frame.
class TREE_PROJECT_FRAME Window to display the tree files
EDA_HOTKEY_CONFIG * m_manager_Hokeys_Descr
Definition: kicad.h:304
#define PcbFileExtension
virtual void LoadSettings(wxConfigBase *aCfg)
Function LoadSettings loads common frame parameters from a configuration file.
Definition: basicframe.cpp:256
wxString help_name() override
Definition: mainframe.cpp:195
The common library.
const wxString PCB_CALCULATOR_EXE
void ReCreateTreePrj()
Create or modify the tree showing project file names.
void AddDelimiterString(wxString &string)
Function AddDelimiterString Add un " to the start and the end of string (if not already done)...
Definition: gestfich.cpp:44
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
void OnRunGerbview(wxCommandEvent &event)
Definition: mainframe.cpp:472
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
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
Definition: wxstruct.h:140
PGM_KICAD & PgmTop()
Definition: kicad.cpp:71
const wxString SchematicFileExtension
const wxString GetProjectFileName()
Definition: mainframe.cpp:147
void SetProjectFileName(const wxString &aFullProjectProFileName)
Definition: mainframe.cpp:135
KICAD_MANAGER_FRAME(wxWindow *parent, const wxString &title, const wxPoint &pos, const wxSize &size)
Definition: mainframe.cpp:50
void InstallHotkeyFrame(EDA_BASE_FRAME *aParent, EDA_HOTKEY_CONFIG *aHotkeys)
Function InstallHotkeyFrame Create a hotkey editor dialog window with the provided hotkey configurati...
void OnCloseWindow(wxCloseEvent &Event)
Definition: mainframe.cpp:216
void OnRunPcbNew(wxCommandEvent &event)
Definition: mainframe.cpp:406
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
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
const wxString PcbLegacyFileName()
Definition: mainframe.cpp:173
void ReCreateMenuBar() override
(Re)Create the menubar
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 GetPanelWidth() const
void OnSize(wxSizeEvent &event)
Definition: mainframe.cpp:207
wxTextCtrl * m_MessagesBox
Definition: kicad.h:300
void SaveSettings(wxConfigBase *aCfg) override
Function SaveSettings saves common frame parameters to a configuration data file. ...
Definition: mainframe.cpp:541
const wxString LegacyPcbFileExtension
TREE_PROJECT_FRAME * m_LeftWin
Definition: kicad.h:298
Class EDA_BASE_FRAME is the base frame for deriving all KiCad main window classes.
Definition: wxstruct.h:117
const wxString PcbFileName()
Definition: mainframe.cpp:163
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
void Process_Config(wxCommandEvent &event)
Definition: mainframe.cpp:556
wxString GetHelpFileName()
Definition: pgm_kicad.h:63
void OnChangeIconsOptions(wxCommandEvent &event) override
Select the current icons options in menus (or toolbars) in Kicad (the default for toolbars/menus is 2...
Definition: mainframe.cpp:446
VTBL_ENTRY const wxString & GetEditorName(bool aCanShowFileChooser=true)
Return the preferred editor name.
Definition: pgm_base.cpp:338
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
const wxString BITMAPCONVERTER_EXE
wxSize m_FrameSize
Definition: wxstruct.h:135
wxFileHistory & GetFileHistory()
Definition: pgm_kicad.h:57
void OnExit(wxCommandEvent &event)
Definition: mainframe.cpp:245
void ImportHotkeyConfigFromFile(EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
Function ImportHotkeyConfigFromFile Prompt the user for an old hotkey file to read, and read it.
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
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
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
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
void OnTerminate(int pid, int status) override
Definition: mainframe.cpp:251
The main KiCad project manager frame.
Definition: kicad.h:136
void RunPcbNew(const wxString &aProjectBoardFileName)
Call this only for a PCB associated with the current project.
Definition: mainframe.cpp:374
#define KICAD_MANAGER_FRAME_NAME
Definition: kicad.h:40
KIWAY Kiway