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-2018 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 <panel_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 #include <dialog_configure_paths.h>
43 #include "pgm_kicad.h"
44 #include "tree_project_frame.h"
45 
46 #ifdef __WXMAC__
47 #include <MacTypes.h>
48 #include <ApplicationServices/ApplicationServices.h>
49 #endif
50 
51 #include "kicad.h"
52 
53 
54 #define TREE_FRAME_WIDTH_ENTRY wxT( "LeftWinWidth" )
55 
57  const wxString& title, const wxPoint& pos, const wxSize& size ) :
58  EDA_BASE_FRAME( parent, KICAD_MAIN_FRAME_T, title, pos, size,
60  KIWAY_HOLDER( &::Kiway )
61 {
62  m_active_project = false;
63  m_leftWinWidth = 60;
65 
66  // Create the status line (bottom of the frame)
67  static const int dims[3] = { -1, -1, 100 };
68 
69  CreateStatusBar( 3 );
70  SetStatusWidths( 3, dims );
71 
72  // Give an icon
73  wxIcon icon;
74  icon.CopyFromBitmap( KiBitmap( icon_kicad_xpm ) );
75  SetIcon( icon );
76 
77  // Give the last size and pos to main window
78  LoadSettings( config() );
79  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
80 
81  // Left window: is the box which display tree project
82  m_LeftWin = new TREE_PROJECT_FRAME( this );
83 
84  // Right top Window: buttons to launch applications
85  m_Launcher = new LAUNCHER_PANEL( this );
86 
87  // Add the wxTextCtrl showing all messages from KiCad:
88  m_MessagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString,
89  wxDefaultPosition, wxDefaultSize,
90  wxTE_MULTILINE | wxTE_READONLY | wxBORDER_NONE );
91 
94 
95  m_auimgr.SetManagedWindow( this );
96 
97  m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
98 
99  m_auimgr.AddPane( m_LeftWin, EDA_PANE().Palette().Name( "ProjectTree" ).Left().Layer(3)
100  .CaptionVisible( false ).PaneBorder( false )
101  .MinSize( 150, -1 ).BestSize( m_leftWinWidth, -1 ) );
102 
103  m_auimgr.AddPane( m_Launcher, EDA_PANE().HToolbar().Name( "Launcher" ).Top().Layer(1)
104  .MinSize( m_Launcher->GetPanelWidth(), m_Launcher->GetPanelHeight() ) );
105 
106  m_auimgr.AddPane( m_MessagesBox, EDA_PANE().Messages().Name( "MsgPanel" ).Center() );
107 
108  m_auimgr.Update();
109 
110  SetTitle( wxString( "KiCad " ) + GetBuildVersion() );
111 }
112 
113 
115 {
116  m_auimgr.UnInit();
117 }
118 
119 
121 {
122  wxConfigBase* ret = PgmTop().PgmSettings();
123  wxASSERT( ret );
124  return ret;
125 }
126 
127 
128 void KICAD_MANAGER_FRAME::SetProjectFileName( const wxString& aFullProjectProFileName )
129 {
130  // ensure file name is absolute:
131  wxFileName fn( aFullProjectProFileName );
132 
133  if( !fn.IsAbsolute() )
134  fn.MakeAbsolute();
135 
136  Prj().SetProjectFullName( fn.GetFullPath() );
137 }
138 
139 
141 {
142  return Prj().GetProjectFullName();
143 }
144 
145 
147 {
148  wxFileName fn( GetProjectFileName() );
149 
150  fn.SetExt( SchematicFileExtension );
151 
152  return fn.GetFullPath();
153 }
154 
155 
157 {
158  wxFileName fn( GetProjectFileName() );
159 
160  fn.SetExt( PcbFileExtension );
161 
162  return fn.GetFullPath();
163 }
164 
165 
167 {
168  wxFileName fn( GetProjectFileName() );
169 
170  fn.SetExt( LegacyPcbFileExtension );
171 
172  return fn.GetFullPath();
173 }
174 
175 
177 {
179 }
180 
181 
183 {
184  return PgmTop().SysSearch();
185 }
186 
187 
189 {
190  return PgmTop().GetHelpFileName();
191 }
192 
193 
194 void KICAD_MANAGER_FRAME::PrintMsg( const wxString& aText )
195 {
196  m_MessagesBox->AppendText( aText );
197 }
198 
199 
200 void KICAD_MANAGER_FRAME::OnSize( wxSizeEvent& event )
201 {
202  if( m_auimgr.GetManagedWindow() )
203  m_auimgr.Update();
204 
205  event.Skip();
206 }
207 
208 
209 void KICAD_MANAGER_FRAME::OnCloseWindow( wxCloseEvent& Event )
210 {
211  if( Kiway().PlayersClose( false ) )
212  {
213  int px, py;
214 
215  if( !GetProjectFileName().empty() )
216  UpdateFileHistory( GetProjectFileName(), &PgmTop().GetFileHistory() );
217 
218  if( !IsIconized() ) // save main frame position and size
219  {
220  GetPosition( &px, &py );
221  m_FramePos.x = px;
222  m_FramePos.y = py;
223 
224  GetSize( &px, &py );
225  m_FrameSize.x = px;
226  m_FrameSize.y = py;
227  }
228 
229  Event.SetCanVeto( true );
230 
231  m_LeftWin->Show( false );
232 
233  Destroy();
234  }
235 }
236 
237 
238 void KICAD_MANAGER_FRAME::OnExit( wxCommandEvent& event )
239 {
240  Close( true );
241 }
242 
243 
245 {
246  wxString msg = wxString::Format( _( "%s closed [pid=%d]\n" ),
247  GetChars( m_appName ), pid );
248 
249  wxWindow* window = wxWindow::FindWindowByName( KICAD_MANAGER_FRAME_NAME );
250 
251  if( window ) // Should always happen.
252  {
253  // Be sure the kicad frame manager is found
254  // This dynamic cast is not really mandatory, but ...
255  KICAD_MANAGER_FRAME* frame = dynamic_cast<KICAD_MANAGER_FRAME*> (window);
256 
257  if( frame )
258  frame->PrintMsg( msg );
259  }
260 
261  delete this;
262 }
263 
264 
265 void KICAD_MANAGER_FRAME::Execute( wxWindow* frame, const wxString& execFile,
266  wxString params )
267 {
268  if( params.size() )
269  AddDelimiterString( params );
270 
271  TERMINATE_HANDLER* callback = new TERMINATE_HANDLER( execFile );
272 
273  long pid = ExecuteFile( frame, execFile, params, callback );
274 
275  if( pid > 0 )
276  {
277  wxString msg = wxString::Format( _( "%s %s opened [pid=%ld]\n" ),
278  GetChars( execFile ), GetChars( params ), pid );
279 
280  PrintMsg( msg );
281 
282 #ifdef __WXMAC__
283  msg.Printf( "osascript -e 'activate application \"%s\"' ", execFile );
284  system( msg.c_str() );
285 #endif
286  }
287  else
288  {
289  delete callback;
290  }
291 }
292 
293 
294 void KICAD_MANAGER_FRAME::RunEeschema( const wxString& aProjectSchematicFileName )
295 {
296  KIWAY_PLAYER* frame;
297 
298  try
299  {
300  frame = Kiway().Player( FRAME_SCH, true );
301  }
302  catch( const IO_ERROR& err )
303  {
304  wxMessageBox( _( "Eeschema failed to load:\n" ) + err.What(),
305  _( "KiCad Error" ), wxOK | wxICON_ERROR, this );
306  return;
307  }
308 
309  if( !frame->IsShown() ) // A hidden frame might not have the project loaded.
310  {
311  frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectSchematicFileName ) );
312  frame->Show( true );
313  }
314 
315  // On Windows, Raise() does not bring the window on screen, when iconized or not shown
316  // On linux, Raise() brings the window on screen, but this code works fine
317  if( frame->IsIconized() )
318  {
319  frame->Iconize( false );
320  // If an iconized frame was created by Pcbnew, Iconize( false ) is not enough
321  // to show the frame at its normal size: Maximize should be called.
322  frame->Maximize( false );
323  }
324 
325  frame->Raise();
326 }
327 
328 
329 void KICAD_MANAGER_FRAME::OnRunEeschema( wxCommandEvent& event )
330 {
331  wxFileName fn( GetProjectFileName() );
332  fn.SetExt( SchematicFileExtension );
333  RunEeschema( fn.GetFullPath() );
334 }
335 
336 
337 void KICAD_MANAGER_FRAME::OnRunSchLibEditor( wxCommandEvent& event )
338 {
339  KIWAY_PLAYER* frame;
340 
341  try
342  {
343  frame = Kiway().Player( FRAME_SCH_LIB_EDITOR, true );
344  }
345  catch( const IO_ERROR& err )
346  {
347  wxMessageBox( _( "Component library editor failed to load:\n" ) + err.What(),
348  _( "KiCad Error" ), wxOK | wxICON_ERROR, this );
349  return;
350  }
351 
352  if( !frame->IsShown() )
353  frame->Show( true );
354 
355  // On Windows, Raise() does not bring the window on screen, when iconized
356  if( frame->IsIconized() )
357  frame->Iconize( false );
358 
359  frame->Raise();
360 }
361 
362 
363 void KICAD_MANAGER_FRAME::RunPcbNew( const wxString& aProjectBoardFileName )
364 {
365  KIWAY_PLAYER* frame;
366 
367  try
368  {
369  frame = Kiway().Player( FRAME_PCB, true );
370  }
371  catch( const IO_ERROR& err )
372  {
373  wxMessageBox( _( "Pcbnew failed to load:\n" ) + err.What(), _( "KiCad Error" ),
374  wxOK | wxICON_ERROR, this );
375  return;
376  }
377 
378  if( !frame->IsVisible() ) // A hidden frame might not have the board loaded.
379  {
380  frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectBoardFileName ) );
381  frame->Show( true );
382  }
383 
384  // On Windows, Raise() does not bring the window on screen, when iconized
385  if( frame->IsIconized() )
386  frame->Iconize( false );
387 
388  frame->Raise();
389 }
390 
391 
392 void KICAD_MANAGER_FRAME::OnRunPcbNew( wxCommandEvent& event )
393 {
394  wxFileName kicad_board( PcbFileName() );
395  wxFileName legacy_board( PcbLegacyFileName() );
396 
397  wxFileName& board = ( !legacy_board.FileExists() || kicad_board.FileExists() ) ?
398  kicad_board : legacy_board;
399 
400  RunPcbNew( board.GetFullPath() );
401 }
402 
403 
404 void KICAD_MANAGER_FRAME::OnRunPcbFpEditor( wxCommandEvent& event )
405 {
406  KIWAY_PLAYER* frame;
407 
408  try
409  {
410  frame = Kiway().Player( FRAME_PCB_MODULE_EDITOR, true );
411  }
412  catch( const IO_ERROR& err )
413  {
414  wxMessageBox( _( "Footprint library editor failed to load:\n" ) + err.What(),
415  _( "KiCad Error" ), wxOK | wxICON_ERROR, this );
416  return;
417  }
418 
419  if( !frame->IsShown() )
420  frame->Show( true );
421 
422  // On Windows, Raise() does not bring the window on screen, when iconized
423  if( frame->IsIconized() )
424  frame->Iconize( false );
425 
426  frame->Raise();
427 }
428 
429 
430 void KICAD_MANAGER_FRAME::OnRunBitmapConverter( wxCommandEvent& event )
431 {
432  Execute( this, BITMAPCONVERTER_EXE );
433 }
434 
435 
436 void KICAD_MANAGER_FRAME::OnRunPcbCalculator( wxCommandEvent& event )
437 {
438  Execute( this, PCB_CALCULATOR_EXE );
439 }
440 
441 
442 void KICAD_MANAGER_FRAME::OnRunPageLayoutEditor( wxCommandEvent& event )
443 {
444  Execute( this, PL_EDITOR_EXE );
445 }
446 
447 
448 
449 void KICAD_MANAGER_FRAME::OnRunGerbview( wxCommandEvent& event )
450 {
451  // Gerbview is called without any file to open, because we do not know
452  // the list and the name of files to open (if any...).
453  // however we run it in the path of the project
454  Execute( this, GERBVIEW_EXE, Prj().GetProjectPath() );
455 }
456 
457 
458 void KICAD_MANAGER_FRAME::OnOpenTextEditor( wxCommandEvent& event )
459 {
460  wxString editorname = Pgm().GetEditorName();
461 
462  if( !editorname.IsEmpty() )
463  Execute( this, editorname, wxEmptyString );
464 }
465 
466 
467 void KICAD_MANAGER_FRAME::OnOpenFileInTextEditor( wxCommandEvent& event )
468 {
469  // show all files in file dialog (in Kicad all files are editable texts):
470  wxString wildcard = AllFilesWildcard;
471 
472  wxString default_dir = Prj().GetProjectPath();
473 
474  wxFileDialog dlg( this, _( "Load File to Edit" ), default_dir,
475  wxEmptyString, wildcard, wxFD_OPEN );
476 
477  if( dlg.ShowModal() == wxID_CANCEL )
478  return;
479 
480  wxString filename = wxT( "\"" );
481  filename += dlg.GetPath() + wxT( "\"" );
482 
483  if( !dlg.GetPath().IsEmpty() && !Pgm().GetEditorName().IsEmpty() )
484  Execute( this, Pgm().GetEditorName(), filename );
485 }
486 
487 void KICAD_MANAGER_FRAME::OnBrowseInFileExplorer( wxCommandEvent& event )
488 {
489  // open project directory in host OS's file explorer
490  wxString project_dir = Prj().GetProjectPath();
491 
492  // Quote in case there are spaces in the path.
493  AddDelimiterString( project_dir );
494 
495  wxLaunchDefaultApplication( project_dir );
496 }
497 
498 
499 void KICAD_MANAGER_FRAME::OnRefresh( wxCommandEvent& event )
500 {
502 }
503 
504 
505 void KICAD_MANAGER_FRAME::language_change( wxCommandEvent& event )
506 {
507  int id = event.GetId();
508  Kiway().SetLanguage( id );
509 }
510 
511 
513 {
514  int historySize;
516  PgmTop().GetFileHistory().SetMaxFiles( (unsigned) std::max( 0, historySize ) );
517 }
518 
519 
521 {
522  m_MessagesBox->Clear();
523 }
524 
525 
526 void KICAD_MANAGER_FRAME::LoadSettings( wxConfigBase* aCfg )
527 {
529  aCfg->Read( TREE_FRAME_WIDTH_ENTRY, &m_leftWinWidth );
530 }
531 
532 
533 void KICAD_MANAGER_FRAME::SaveSettings( wxConfigBase* aCfg )
534 {
536  aCfg->Write( TREE_FRAME_WIDTH_ENTRY, m_LeftWin->GetSize().x );
537 }
538 
539 
541 {
542  wxString msg = wxString::Format( _( "Project name:\n%s\n" ),
544  PrintMsg( msg );
545 }
546 
547 
548 void KICAD_MANAGER_FRAME::OnShowHotkeys( wxCommandEvent& event )
549 {
551 }
552 
553 
554 void KICAD_MANAGER_FRAME::OnConfigurePaths( wxCommandEvent& aEvent )
555 {
556  DIALOG_CONFIGURE_PATHS dlg( this, nullptr );
557  dlg.ShowModal();
558 }
559 
560 
561 void KICAD_MANAGER_FRAME::OnEditSymLibTable( wxCommandEvent& aEvent )
562 {
564  kiface->CreateWindow( this, DIALOG_SCH_LIBRARY_TABLE, &Kiway() );
565 }
566 
567 
568 void KICAD_MANAGER_FRAME::OnEditFpLibTable( wxCommandEvent& aEvent )
569 {
571  kiface->CreateWindow( this, DIALOG_PCB_LIBRARY_TABLE, &Kiway() );
572 }
573 
574 
575 void KICAD_MANAGER_FRAME::OnPreferences( wxCommandEvent& aEvent )
576 {
578 }
void OnRunPcbCalculator(wxCommandEvent &event)
Definition: mainframe.cpp:436
void OnBrowseInFileExplorer(wxCommandEvent &event)
Definition: mainframe.cpp:487
Class KIWAY_HOLDER is a mix in class which holds the location of a wxWindow&#39;s KIWAY.
Definition: kiway_player.h:48
void OnEditFpLibTable(wxCommandEvent &aEvent)
Definition: mainframe.cpp:568
KiCad executable names.
Class KIWAY_PLAYER is a wxFrame capable of the OpenProjectFiles function, meaning it can load a porti...
Definition: kiway_player.h:120
FILE_HISTORY & GetFileHistory()
Definition: pgm_kicad.h:57
void OnRunPageLayoutEditor(wxCommandEvent &event)
Definition: mainframe.cpp:442
void language_change(wxCommandEvent &event)
Definition: mainframe.cpp:505
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:60
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:526
This file is part of the common library TODO brief description.
void OnRefresh(wxCommandEvent &event)
Definition: mainframe.cpp:499
void OnRunPcbFpEditor(wxCommandEvent &event)
Definition: mainframe.cpp:404
void OnRunEeschema(wxCommandEvent &event)
Definition: mainframe.cpp:329
const std::string LegacyPcbFileExtension
virtual void SaveSettings(wxConfigBase *aCfg)
Function SaveSettings saves common frame parameters to a configuration data file. ...
void OnOpenFileInTextEditor(wxCommandEvent &event)
Definition: mainframe.cpp:467
#define TREE_FRAME_WIDTH_ENTRY
Definition: mainframe.cpp:54
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:337
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
Class SEARCH_STACK looks for files in a number of places.
Definition: search_stack.h:41
void OnEditSymLibTable(wxCommandEvent &aEvent)
Definition: mainframe.cpp:561
wxAuiManager m_auimgr
void OnConfigurePaths(wxCommandEvent &aEvent)
Definition: mainframe.cpp:554
VTBL_ENTRY void SetLanguage(int aLanguage)
Function SetLanguage changes the language and then calls ShowChangedLanguage() on all KIWAY_PLAYERs...
Definition: kiway.cpp:395
void OnRunBitmapConverter(wxCommandEvent &event)
Definition: mainframe.cpp:430
int GetPanelHeight() const
void UpdateFileHistory(const wxString &FullFileName, wxFileHistory *aFileHistory=NULL)
Function UpdateFileHistory Updates the list of recently opened files.
void OnOpenTextEditor(wxCommandEvent &event)
Definition: mainframe.cpp:458
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:179
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:294
wxConfigBase * PgmSettings()
Definition: pgm_kicad.h:59
const wxString AllFilesWildcard
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
VTBL_ENTRY wxWindow * CreateWindow(wxWindow *aParent, int aClassId, KIWAY *aKIWAY, int aCtlBits=0)=0
Function CreateWindow creates a wxWindow for the current project.
const wxString SchFileName()
Definition: mainframe.cpp:146
void DisplayHotkeyList(EDA_BASE_FRAME *aFrame, struct EDA_HOTKEY_CONFIG *aDescList)
Function DisplayHotkeyList Displays the current hotkey list.
#define DEFAULT_FILE_HISTORY_SIZE
The default file history size is 9.
Definition: pgm_base.h:58
void Execute(wxWindow *frame, const wxString &execFile, wxString param=wxEmptyString)
Open another KiCad application and logs a message.
Definition: mainframe.cpp:265
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:300
void PrintMsg(const wxString &aText)
Displays aText in the text panel.
Definition: mainframe.cpp:194
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:300
const std::string SchematicFileExtension
virtual void LoadSettings(wxConfigBase *aCfg)
Function LoadSettings loads common frame parameters from a configuration file.
wxString help_name() override
Definition: mainframe.cpp:188
The common library.
const wxString PCB_CALCULATOR_EXE
#define FILE_HISTORY_SIZE_KEY
Definition: pgm_base.h:51
pcbnew DSO
Definition: kiway.h:267
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
#define KICAD_DEFAULT_DRAWFRAME_STYLE
#define PcbFileExtension
void RecreateBaseHToolbar()
(Re)Create the horizontal toolbar
VTBL_ENTRY KIFACE * KiFACE(FACE_T aFaceId, bool doLoad=true)
Function KiFACE returns the KIFACE* given a FACE_T.
Definition: kiway.cpp:148
void OnShowHotkeys(wxCommandEvent &event)
Definition: mainframe.cpp:548
void OnRunGerbview(wxCommandEvent &event)
Definition: mainframe.cpp:449
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:64
string & err
Definition: json11.cpp:598
Specialization of the wxAuiPaneInfo class for KiCad panels.
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
PGM_KICAD & PgmTop()
Definition: kicad.cpp:72
void CommonSettingsChanged() override
Function CommonSettingsChanged Notification event that some of the common (suite-wide) settings have ...
Definition: mainframe.cpp:512
eeschema DSO
Definition: kiway.h:266
const wxString GetProjectFileName()
Definition: mainframe.cpp:140
void SetProjectFileName(const wxString &aFullProjectProFileName)
Definition: mainframe.cpp:128
KICAD_MANAGER_FRAME(wxWindow *parent, const wxString &title, const wxPoint &pos, const wxSize &size)
Definition: mainframe.cpp:56
void OnCloseWindow(wxCloseEvent &Event)
Definition: mainframe.cpp:209
void SetMaxFiles(size_t aMaxFiles)
Definition: pgm_base.cpp:79
void OnRunPcbNew(wxCommandEvent &event)
Definition: mainframe.cpp:392
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:166
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
#define max(a, b)
Definition: auxiliary.h:86
int GetPanelWidth() const
void OnSize(wxSizeEvent &event)
Definition: mainframe.cpp:200
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:533
void OnPreferences(wxCommandEvent &aEvent)
Definition: mainframe.cpp:575
TREE_PROJECT_FRAME * m_LeftWin
Definition: kicad.h:294
Class EDA_BASE_FRAME is the base frame for deriving all KiCad main window classes.
VTBL_ENTRY wxConfigBase * CommonSettings() const
Definition: pgm_base.h:187
const wxString PcbFileName()
Definition: mainframe.cpp:156
Class KIFACE is used by a participant in the KIWAY alchemy.
Definition: kiway.h:151
static bool empty(const wxTextEntryBase *aCtrl)
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
wxString GetHelpFileName()
Definition: pgm_kicad.h:63
VTBL_ENTRY const wxString & GetEditorName(bool aCanShowFileChooser=true)
Return the preferred editor name.
Definition: pgm_base.cpp:203
return & kiface
Definition: pcbnew.cpp:219
wxConfigBase * config() override
Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_F...
Definition: mainframe.cpp:120
bool m_active_project
Definition: kicad.h:304
const wxString BITMAPCONVERTER_EXE
bool ShowPreferences(EDA_HOTKEY_CONFIG *aHotkeys, EDA_HOTKEY_CONFIG *aShowHotkeys, const wxString &aHotkeysNickname)
void OnExit(wxCommandEvent &event)
Definition: mainframe.cpp:238
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:182
void ClearMsg()
Erase the text panel.
Definition: mainframe.cpp:520
void PrintPrjInfo()
Prints the current working directory name and the projet name on the text panel.
Definition: mainframe.cpp:540
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
void OnTerminate(int pid, int status) override
Definition: mainframe.cpp:244
The main KiCad project manager frame.
Definition: kicad.h:135
void RunPcbNew(const wxString &aProjectBoardFileName)
Call this only for a PCB associated with the current project.
Definition: mainframe.cpp:363
#define KICAD_MANAGER_FRAME_NAME
Definition: kicad.h:40
KIWAY Kiway