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 
41 #include "pgm_kicad.h"
42 #include "tree_project_frame.h"
43 
44 #include "kicad.h"
45 
46 
47 #define TREE_FRAME_WIDTH_ENTRY wxT( "LeftWinWidth" )
48 
50  const wxString& title, const wxPoint& pos, const wxSize& size ) :
51  EDA_BASE_FRAME( parent, KICAD_MAIN_FRAME_T, title, pos, size,
53 {
54  m_active_project = false;
55  m_leftWinWidth = 60;
57 
58  // Create the status line (bottom of the frame)
59  static const int dims[3] = { -1, -1, 100 };
60 
61  CreateStatusBar( 3 );
62  SetStatusWidths( 3, dims );
63 
64  // Give an icon
65  wxIcon icon;
66  icon.CopyFromBitmap( KiBitmap( icon_kicad_xpm ) );
67  SetIcon( icon );
68 
69  // Give the last sise and pos to main window
70  LoadSettings( config() );
71  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
72 
73  // Left window: is the box which display tree project
74  m_LeftWin = new TREE_PROJECT_FRAME( this );
75 
76  // Right top Window: buttons to launch applications
77  m_Launcher = new LAUNCHER_PANEL( this );
78 
79  // Add the wxTextCtrl showing all messages from KiCad:
80  m_MessagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString,
81  wxDefaultPosition, wxDefaultSize,
82  wxTE_MULTILINE | wxSUNKEN_BORDER | wxTE_READONLY );
83 
86 
87  m_auimgr.SetManagedWindow( this );
88 
89  EDA_PANEINFO horiztb;
90  horiztb.HorizontalToolbarPane();
91 
92  EDA_PANEINFO info;
93  info.InfoToolbarPane();
94 
95  m_auimgr.AddPane( m_mainToolBar,
96  wxAuiPaneInfo( horiztb ).Name( wxT( "m_mainToolBar" ) ).Top() );
97 
98  m_auimgr.AddPane( m_LeftWin,
99  wxAuiPaneInfo(info).Name( wxT( "m_LeftWin" ) ).Left().
100  BestSize( m_leftWinWidth, -1 ).
101  Layer( 1 ) );
102 
103  m_auimgr.AddPane( m_Launcher, wxTOP );
104  m_auimgr.GetPane( m_Launcher).CaptionVisible( false ).PaneBorder(false)
105  .MinSize( wxSize( m_Launcher->GetPanelWidth(), m_Launcher->GetPanelHeight() ) )
106  .Resizable( false );
107 
108  m_auimgr.AddPane( m_MessagesBox,
109  wxAuiPaneInfo().Name( wxT( "m_MessagesBox" ) ).CentrePane().Layer( 2 ) );
110 
111  m_auimgr.GetPane( m_LeftWin ).MinSize( wxSize( 150, -1) );
112  m_auimgr.GetPane( m_LeftWin ).BestSize(wxSize(m_leftWinWidth, -1) );
113 
114  m_auimgr.Update();
115 }
116 
117 
119 {
120  m_auimgr.UnInit();
121 }
122 
123 
125 {
126  wxConfigBase* ret = PgmTop().PgmSettings();
127  wxASSERT( ret );
128  return ret;
129 }
130 
131 
132 void KICAD_MANAGER_FRAME::SetProjectFileName( const wxString& aFullProjectProFileName )
133 {
134  // ensure file name is absolute:
135  wxFileName fn( aFullProjectProFileName );
136 
137  if( !fn.IsAbsolute() )
138  fn.MakeAbsolute();
139 
140  Prj().SetProjectFullName( fn.GetFullPath() );
141 }
142 
143 
145 {
146  return Prj().GetProjectFullName();
147 }
148 
149 
151 {
152  wxFileName fn( GetProjectFileName() );
153 
154  fn.SetExt( SchematicFileExtension );
155 
156  return fn.GetFullPath();
157 }
158 
159 
161 {
162  wxFileName fn( GetProjectFileName() );
163 
164  fn.SetExt( PcbFileExtension );
165 
166  return fn.GetFullPath();
167 }
168 
169 
171 {
172  wxFileName fn( GetProjectFileName() );
173 
174  fn.SetExt( LegacyPcbFileExtension );
175 
176  return fn.GetFullPath();
177 }
178 
179 
181 {
183 }
184 
185 
187 {
188  return PgmTop().SysSearch();
189 }
190 
191 
193 {
194  return PgmTop().GetHelpFileName();
195 }
196 
197 
198 void KICAD_MANAGER_FRAME::PrintMsg( const wxString& aText )
199 {
200  m_MessagesBox->AppendText( aText );
201 }
202 
203 
204 void KICAD_MANAGER_FRAME::OnSize( wxSizeEvent& event )
205 {
206  if( m_auimgr.GetManagedWindow() )
207  m_auimgr.Update();
208 
209  event.Skip();
210 }
211 
212 
213 void KICAD_MANAGER_FRAME::OnCloseWindow( wxCloseEvent& Event )
214 {
215  if( Kiway.PlayersClose( false ) )
216  {
217  int px, py;
218 
219  UpdateFileHistory( GetProjectFileName(), &PgmTop().GetFileHistory() );
220 
221  if( !IsIconized() ) // save main frame position and size
222  {
223  GetPosition( &px, &py );
224  m_FramePos.x = px;
225  m_FramePos.y = py;
226 
227  GetSize( &px, &py );
228  m_FrameSize.x = px;
229  m_FrameSize.y = py;
230  }
231 
232  Event.SetCanVeto( true );
233 
234  m_LeftWin->Show( false );
235 
236  Destroy();
237  }
238 }
239 
240 
241 void KICAD_MANAGER_FRAME::OnExit( wxCommandEvent& event )
242 {
243  Close( true );
244 }
245 
246 
248 {
249  wxString msg = wxString::Format( _( "%s closed [pid=%d]\n" ),
250  GetChars( m_appName ), pid );
251 
252  wxWindow* window = wxWindow::FindWindowByName( KICAD_MANAGER_FRAME_NAME );
253 
254  if( window ) // Should always happen.
255  {
256  // Be sure the kicad frame manager is found
257  // This dynamic cast is not really mandatory, but ...
258  KICAD_MANAGER_FRAME* frame = dynamic_cast<KICAD_MANAGER_FRAME*> (window);
259 
260  if( frame )
261  frame->PrintMsg( msg );
262  }
263 
264  delete this;
265 }
266 
267 
268 void KICAD_MANAGER_FRAME::Execute( wxWindow* frame, const wxString& execFile,
269  wxString params )
270 {
271  if( params.size() )
272  AddDelimiterString( params );
273 
274  TERMINATE_HANDLER* callback = new TERMINATE_HANDLER( execFile );
275 
276  long pid = ExecuteFile( frame, execFile, params, callback );
277 
278  if( pid > 0 )
279  {
280  wxString msg = wxString::Format( _( "%s %s opened [pid=%ld]\n" ),
281  GetChars( execFile ), GetChars( params ), pid );
282 
283  PrintMsg( msg );
284  }
285  else
286  {
287  delete callback;
288  }
289 }
290 
291 
292 void KICAD_MANAGER_FRAME::RunEeschema( const wxString& aProjectSchematicFileName )
293 {
294  KIWAY_PLAYER* frame = Kiway.Player( FRAME_SCH, false );
295 
296  // Please: note: DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::initBuffers() calls
297  // Kiway.Player( FRAME_SCH, true )
298  // therefore, the schematic editor is sometimes running, but the schematic project
299  // is not loaded, if the library editor was called, and the dialog field editor was used.
300  // On linux, it happens the first time the schematic editor is launched, if
301  // library editor was running, and the dialog field editor was open
302  // On Windows, it happens always after the library editor was called,
303  // and the dialog field editor was used
304  if( !frame )
305  {
306  try
307  {
308  frame = Kiway.Player( FRAME_SCH, true );
309  }
310  catch( IO_ERROR err )
311  {
312  wxMessageBox( _( "Eeschema failed to load:\n" ) + err.What(),
313  _( "KiCad Error" ), wxOK | wxICON_ERROR, this );
314  return;
315  }
316  }
317 
318  if( !frame->IsShown() ) // the frame exists, (created by the dialog field editor)
319  // but no project loaded.
320  {
321  frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectSchematicFileName ) );
322  frame->Show( true );
323  }
324 
325  // On Windows, Raise() does not bring the window on screen, when iconized or not shown
326  // On linux, Raise() brings the window on screen, but this code works fine
327  if( frame->IsIconized() )
328  frame->Iconize( false );
329 
330  frame->Raise();
331 }
332 
333 
334 void KICAD_MANAGER_FRAME::OnRunEeschema( wxCommandEvent& event )
335 {
336  wxFileName fn( GetProjectFileName() );
337  fn.SetExt( SchematicFileExtension );
338  RunEeschema( fn.GetFullPath() );
339 }
340 
341 
342 void KICAD_MANAGER_FRAME::OnRunSchLibEditor( wxCommandEvent& event )
343 {
344  KIWAY_PLAYER* frame = Kiway.Player( FRAME_SCH_LIB_EDITOR, false );
345 
346  if( !frame )
347  {
348  try
349  {
350  frame = Kiway.Player( FRAME_SCH_LIB_EDITOR, true );
351  }
352  catch( IO_ERROR err )
353  {
354  wxMessageBox( _( "Component library editor failed to load:\n" ) + err.What(),
355  _( "KiCad Error" ), wxOK | wxICON_ERROR, this );
356  return;
357  }
358 
359  // frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectSchematicFileName ) );
360  frame->Show( true );
361  }
362 
363  // On Windows, Raise() does not bring the window on screen, when iconized
364  if( frame->IsIconized() )
365  frame->Iconize( false );
366 
367  frame->Raise();
368 }
369 
370 
371 void KICAD_MANAGER_FRAME::RunPcbNew( const wxString& aProjectBoardFileName )
372 {
373  KIWAY_PLAYER* frame;
374 
375  try
376  {
377  frame = Kiway.Player( FRAME_PCB, true );
378  }
379  catch( IO_ERROR err )
380  {
381  wxMessageBox( _( "Pcbnew failed to load:\n" ) + err.What(), _( "KiCad Error" ),
382  wxOK | wxICON_ERROR, this );
383  return;
384  }
385 
386  // a pcb frame can be already existing, but not yet used.
387  // this is the case when running the footprint editor, or the footprint viewer first
388  // if the frame is not visible, the board is not yet loaded
389  if( !frame->IsVisible() )
390  {
391  frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectBoardFileName ) );
392  frame->Show( true );
393  }
394 
395  // On Windows, Raise() does not bring the window on screen, when iconized
396  if( frame->IsIconized() )
397  frame->Iconize( false );
398 
399  frame->Raise();
400 }
401 
402 
403 void KICAD_MANAGER_FRAME::OnRunPcbNew( wxCommandEvent& event )
404 {
405  wxFileName kicad_board( PcbFileName() );
406  wxFileName legacy_board( PcbLegacyFileName() );
407 
408  wxFileName& board = ( !legacy_board.FileExists() || kicad_board.FileExists() ) ?
409  kicad_board : legacy_board;
410 
411  RunPcbNew( board.GetFullPath() );
412 }
413 
414 
415 void KICAD_MANAGER_FRAME::OnRunPcbFpEditor( wxCommandEvent& event )
416 {
418 
419  if( !frame )
420  {
421  try
422  {
423  frame = Kiway.Player( FRAME_PCB_MODULE_EDITOR, true );
424  }
425  catch( IO_ERROR err )
426  {
427  wxMessageBox( _( "Footprint library editor failed to load:\n" ) + err.What(),
428  _( "KiCad Error" ), wxOK | wxICON_ERROR, this );
429  return;
430  }
431 
432 // frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectBoardFileName ) );
433  frame->Show( true );
434  }
435 
436  // On Windows, Raise() does not bring the window on screen, when iconized
437  if( frame->IsIconized() )
438  frame->Iconize( false );
439 
440  frame->Raise();
441 }
442 
443 
444 void KICAD_MANAGER_FRAME::OnChangeIconsOptions( wxCommandEvent& event )
445 {
448 }
449 
450 
451 void KICAD_MANAGER_FRAME::OnRunBitmapConverter( wxCommandEvent& event )
452 {
453  Execute( this, BITMAPCONVERTER_EXE );
454 }
455 
456 
457 void KICAD_MANAGER_FRAME::OnRunPcbCalculator( wxCommandEvent& event )
458 {
459  Execute( this, PCB_CALCULATOR_EXE );
460 }
461 
462 
463 void KICAD_MANAGER_FRAME::OnRunPageLayoutEditor( wxCommandEvent& event )
464 {
465  Execute( this, PL_EDITOR_EXE );
466 }
467 
468 
469 
470 void KICAD_MANAGER_FRAME::OnRunGerbview( wxCommandEvent& event )
471 {
472  // Gerbview is called without any file to open, because we do not know
473  // the list and the name of files to open (if any...).
474  // however we run it in the path of the project
475  Execute( this, GERBVIEW_EXE, Prj().GetProjectPath() );
476 }
477 
478 
479 void KICAD_MANAGER_FRAME::OnOpenTextEditor( wxCommandEvent& event )
480 {
481  wxString editorname = Pgm().GetEditorName();
482 
483  if( !editorname.IsEmpty() )
484  Execute( this, editorname, wxEmptyString );
485 }
486 
487 
488 void KICAD_MANAGER_FRAME::OnOpenFileInTextEditor( wxCommandEvent& event )
489 {
490  wxString mask( wxT( "*" ) );
491 
492 #ifdef __WINDOWS__
493  mask += wxT( ".*" );
494 #endif
495 
496  mask = _( "Text file (" ) + mask + wxT( ")|" ) + mask;
497  wxString default_dir = Prj().GetProjectPath();
498 
499  wxFileDialog dlg( this, _( "Load File to Edit" ), default_dir,
500  wxEmptyString, mask, wxFD_OPEN );
501 
502  if( dlg.ShowModal() == wxID_CANCEL )
503  return;
504 
505  wxString filename = wxT( "\"" );
506  filename += dlg.GetPath() + wxT( "\"" );
507 
508  if( !dlg.GetPath().IsEmpty() && !Pgm().GetEditorName().IsEmpty() )
509  Execute( this, Pgm().GetEditorName(), filename );
510 }
511 
512 
513 void KICAD_MANAGER_FRAME::OnRefresh( wxCommandEvent& event )
514 {
516 }
517 
518 
519 void KICAD_MANAGER_FRAME::language_change( wxCommandEvent& event )
520 {
521  int id = event.GetId();
522  Kiway.SetLanguage( id );
523 }
524 
525 
527 {
528  m_MessagesBox->Clear();
529 }
530 
531 
532 void KICAD_MANAGER_FRAME::LoadSettings( wxConfigBase* aCfg )
533 {
535  aCfg->Read( TREE_FRAME_WIDTH_ENTRY, &m_leftWinWidth );
536 }
537 
538 
539 void KICAD_MANAGER_FRAME::SaveSettings( wxConfigBase* aCfg )
540 {
542  aCfg->Write( TREE_FRAME_WIDTH_ENTRY, m_LeftWin->GetSize().x );
543 }
544 
545 
551 {
552  wxString msg = wxString::Format( _( "Project name:\n%s\n" ),
554  PrintMsg( msg );
555 }
556 
557 
558 void KICAD_MANAGER_FRAME::Process_Config( wxCommandEvent& event )
559 {
560  int id = event.GetId();
561  wxFileName fn;
562 
563  switch( id )
564  {
565  // Hotkey IDs
568  break;
569 
572  break;
573 
576  break;
577 
579  // Display current hotkey list for LibEdit.
581  break;
582 
583  default:
584  wxFAIL_MSG( wxT( "KICAD_MANAGER_FRAME::Process_Config error" ) );
585  break;
586  }
587 }
588 
589 
590 void KICAD_MANAGER_FRAME::OnConfigurePaths( wxCommandEvent& aEvent )
591 {
592  Pgm().ConfigurePaths( this );
593 }
EDA_PANEINFO & HorizontalToolbarPane()
Function HorizontalToolbarPane Change *this to a horizontal toolbar for KiCad.
Definition: wxstruct.h:475
void OnRunPcbCalculator(wxCommandEvent &event)
Definition: mainframe.cpp:457
#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:463
void language_change(wxCommandEvent &event)
Definition: mainframe.cpp:519
const wxString PL_EDITOR_EXE
class LAUNCHER_PANEL
Definition: kicad.h:310
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:532
This file is part of the common library TODO brief description.
void OnRefresh(wxCommandEvent &event)
Definition: mainframe.cpp:513
void OnRunPcbFpEditor(wxCommandEvent &event)
Definition: mainframe.cpp:415
void OnRunEeschema(wxCommandEvent &event)
Definition: mainframe.cpp:334
PROJECT & Prj()
Definition: kicad.cpp:293
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:488
#define TREE_FRAME_WIDTH_ENTRY
Definition: mainframe.cpp:47
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:342
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:660
Class SEARCH_STACK looks for files in a number of places.
Definition: search_stack.h:41
wxAuiManager m_auimgr
Definition: wxstruct.h:140
void OnConfigurePaths(wxCommandEvent &aEvent)
Definition: mainframe.cpp:590
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:451
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:479
Specialization of the wxAuiPaneInfo class for KiCad panels.
Definition: wxstruct.h:466
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:295
void RunEeschema(const wxString &aProjectSchematicFileName)
Call this only for a SCH associated with the current project.
Definition: mainframe.cpp:292
VTBL_ENTRY void ConfigurePaths(wxWindow *aParent=NULL)
Function ConfigurePaths.
Definition: pgm_base.cpp:897
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:150
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)
Function Execute opens another KiCad application and logs a message.
Definition: mainframe.cpp:268
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)
Function PrintMsg displays aText in the text panel.
Definition: mainframe.cpp:198
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:300
#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:192
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:130
void RecreateBaseHToolbar()
(Re)Create the horizontal toolbar
EDA_PANEINFO & InfoToolbarPane()
Function InfoToolbarPane Change *this to a information panel for for KiCad.
Definition: wxstruct.h:540
void OnRunGerbview(wxCommandEvent &event)
Definition: mainframe.cpp:470
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:136
PGM_KICAD & PgmTop()
Definition: kicad.cpp:71
const wxString SchematicFileExtension
const wxString GetProjectFileName()
Definition: mainframe.cpp:144
void SetProjectFileName(const wxString &aFullProjectProFileName)
Definition: mainframe.cpp:132
KICAD_MANAGER_FRAME(wxWindow *parent, const wxString &title, const wxPoint &pos, const wxSize &size)
Definition: mainframe.cpp:49
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:213
void OnRunPcbNew(wxCommandEvent &event)
Definition: mainframe.cpp:403
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:170
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:204
wxTextCtrl * m_MessagesBox
Definition: kicad.h:296
void SaveSettings(wxConfigBase *aCfg) override
Function SaveSettings saves common frame parameters to a configuration data file. ...
Definition: mainframe.cpp:539
const wxString LegacyPcbFileExtension
TREE_PROJECT_FRAME * m_LeftWin
Definition: kicad.h:294
Class EDA_BASE_FRAME is the base frame for deriving all KiCad main window classes.
Definition: wxstruct.h:113
const wxString PcbFileName()
Definition: mainframe.cpp:160
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:558
wxString GetHelpFileName()
Definition: pgm_kicad.h:63
void OnChangeIconsOptions(wxCommandEvent &event) override
Function OnChangeIconsOptions Selects the current icons options in menus (or toolbars) in Kicad (the ...
Definition: mainframe.cpp:444
VTBL_ENTRY const wxString & GetEditorName(bool aCanShowFileChooser=true)
Return the preferred editor name.
Definition: pgm_base.cpp:336
wxConfigBase * config() override
Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_F...
Definition: mainframe.cpp:124
bool m_active_project
Definition: kicad.h:304
const wxString BITMAPCONVERTER_EXE
wxSize m_FrameSize
Definition: wxstruct.h:131
void OnExit(wxCommandEvent &event)
Definition: mainframe.cpp:241
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:186
void ClearMsg()
a minor helper function: Erase the text panel.
Definition: mainframe.cpp:526
void PrintPrjInfo()
a minor helper function: Prints the Current Working Dir name and the projet name on the text panel...
Definition: mainframe.cpp:550
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:247
Class KICAD_MANAGER_FRAME is the main KiCad project manager frame.
Definition: kicad.h:137
void RunPcbNew(const wxString &aProjectBoardFileName)
Call this only for a PCB associated with the current project.
Definition: mainframe.cpp:371
#define KICAD_MANAGER_FRAME_NAME
Definition: kicad.h:40
KIWAY Kiway