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