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  if( !frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectSchematicFileName ) ) )
312  return;
313 
314  frame->Show( true );
315  }
316 
317  // On Windows, Raise() does not bring the window on screen, when iconized or not shown
318  // On linux, Raise() brings the window on screen, but this code works fine
319  if( frame->IsIconized() )
320  {
321  frame->Iconize( false );
322  // If an iconized frame was created by Pcbnew, Iconize( false ) is not enough
323  // to show the frame at its normal size: Maximize should be called.
324  frame->Maximize( false );
325  }
326 
327  frame->Raise();
328 }
329 
330 
331 void KICAD_MANAGER_FRAME::OnRunEeschema( wxCommandEvent& event )
332 {
333  wxFileName fn( GetProjectFileName() );
334  fn.SetExt( SchematicFileExtension );
335  RunEeschema( fn.GetFullPath() );
336 }
337 
338 
339 void KICAD_MANAGER_FRAME::OnRunSchLibEditor( wxCommandEvent& event )
340 {
341  KIWAY_PLAYER* frame;
342 
343  try
344  {
345  frame = Kiway().Player( FRAME_SCH_LIB_EDITOR, true );
346  }
347  catch( const IO_ERROR& err )
348  {
349  wxMessageBox( _( "Component library editor failed to load:\n" ) + err.What(),
350  _( "KiCad Error" ), wxOK | wxICON_ERROR, this );
351  return;
352  }
353 
354  if( !frame->IsShown() )
355  frame->Show( true );
356 
357  // On Windows, Raise() does not bring the window on screen, when iconized
358  if( frame->IsIconized() )
359  frame->Iconize( false );
360 
361  frame->Raise();
362 }
363 
364 
365 void KICAD_MANAGER_FRAME::RunPcbNew( const wxString& aProjectBoardFileName )
366 {
367  KIWAY_PLAYER* frame;
368 
369  try
370  {
371  frame = Kiway().Player( FRAME_PCB, true );
372  }
373  catch( const IO_ERROR& err )
374  {
375  wxMessageBox( _( "Pcbnew failed to load:\n" ) + err.What(), _( "KiCad Error" ),
376  wxOK | wxICON_ERROR, this );
377  return;
378  }
379 
380  if( !frame->IsVisible() ) // A hidden frame might not have the board loaded.
381  {
382  if( !frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectBoardFileName ) ) )
383  return;
384 
385  frame->Show( true );
386  }
387 
388  // On Windows, Raise() does not bring the window on screen, when iconized
389  if( frame->IsIconized() )
390  frame->Iconize( false );
391 
392  frame->Raise();
393 }
394 
395 
396 void KICAD_MANAGER_FRAME::OnRunPcbNew( wxCommandEvent& event )
397 {
398  wxFileName kicad_board( PcbFileName() );
399  wxFileName legacy_board( PcbLegacyFileName() );
400 
401  wxFileName& board = ( !legacy_board.FileExists() || kicad_board.FileExists() ) ?
402  kicad_board : legacy_board;
403 
404  RunPcbNew( board.GetFullPath() );
405 }
406 
407 
408 void KICAD_MANAGER_FRAME::OnRunPcbFpEditor( wxCommandEvent& event )
409 {
410  KIWAY_PLAYER* frame;
411 
412  try
413  {
414  frame = Kiway().Player( FRAME_PCB_MODULE_EDITOR, true );
415  }
416  catch( const IO_ERROR& err )
417  {
418  wxMessageBox( _( "Footprint library editor failed to load:\n" ) + err.What(),
419  _( "KiCad Error" ), wxOK | wxICON_ERROR, this );
420  return;
421  }
422 
423  if( !frame->IsShown() )
424  frame->Show( true );
425 
426  // On Windows, Raise() does not bring the window on screen, when iconized
427  if( frame->IsIconized() )
428  frame->Iconize( false );
429 
430  frame->Raise();
431 }
432 
433 
434 void KICAD_MANAGER_FRAME::OnRunBitmapConverter( wxCommandEvent& event )
435 {
436  Execute( this, BITMAPCONVERTER_EXE );
437 }
438 
439 
440 void KICAD_MANAGER_FRAME::OnRunPcbCalculator( wxCommandEvent& event )
441 {
442  Execute( this, PCB_CALCULATOR_EXE );
443 }
444 
445 
446 void KICAD_MANAGER_FRAME::OnRunPageLayoutEditor( wxCommandEvent& event )
447 {
448  Execute( this, PL_EDITOR_EXE );
449 }
450 
451 
452 
453 void KICAD_MANAGER_FRAME::OnRunGerbview( wxCommandEvent& event )
454 {
455  // Gerbview is called without any file to open, because we do not know
456  // the list and the name of files to open (if any...).
457  // however we run it in the path of the project
458  Execute( this, GERBVIEW_EXE, Prj().GetProjectPath() );
459 }
460 
461 
462 void KICAD_MANAGER_FRAME::OnOpenTextEditor( wxCommandEvent& event )
463 {
464  wxString editorname = Pgm().GetEditorName();
465 
466  if( !editorname.IsEmpty() )
467  Execute( this, editorname, wxEmptyString );
468 }
469 
470 
471 void KICAD_MANAGER_FRAME::OnOpenFileInTextEditor( wxCommandEvent& event )
472 {
473  // show all files in file dialog (in Kicad all files are editable texts):
474  wxString wildcard = AllFilesWildcard();
475 
476  wxString default_dir = Prj().GetProjectPath();
477 
478  wxFileDialog dlg( this, _( "Load File to Edit" ), default_dir,
479  wxEmptyString, wildcard, wxFD_OPEN );
480 
481  if( dlg.ShowModal() == wxID_CANCEL )
482  return;
483 
484  wxString filename = wxT( "\"" );
485  filename += dlg.GetPath() + wxT( "\"" );
486 
487  if( !dlg.GetPath().IsEmpty() && !Pgm().GetEditorName().IsEmpty() )
488  Execute( this, Pgm().GetEditorName(), filename );
489 }
490 
491 void KICAD_MANAGER_FRAME::OnBrowseInFileExplorer( wxCommandEvent& event )
492 {
493  // open project directory in host OS's file explorer
494  wxString project_dir = Prj().GetProjectPath();
495 
496 #ifdef __WXMAC__
497  wxString msg;
498 
499  // Quote in case there are spaces in the path.
500  msg.Printf( "open \"%s\"", project_dir );
501 
502  system( msg.c_str() );
503 #else
504  // Quote in case there are spaces in the path.
505  AddDelimiterString( project_dir );
506 
507  wxLaunchDefaultApplication( project_dir );
508 #endif
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  int historySize;
529  PgmTop().GetFileHistory().SetMaxFiles( (unsigned) std::max( 0, historySize ) );
530 }
531 
532 
534 {
535  m_MessagesBox->Clear();
536 }
537 
538 
539 void KICAD_MANAGER_FRAME::LoadSettings( wxConfigBase* aCfg )
540 {
542  aCfg->Read( TREE_FRAME_WIDTH_ENTRY, &m_leftWinWidth );
543 }
544 
545 
546 void KICAD_MANAGER_FRAME::SaveSettings( wxConfigBase* aCfg )
547 {
549  aCfg->Write( TREE_FRAME_WIDTH_ENTRY, m_LeftWin->GetSize().x );
550 }
551 
552 
554 {
555  wxString msg = wxString::Format( _( "Project name:\n%s\n" ),
557  PrintMsg( msg );
558 }
559 
560 
561 void KICAD_MANAGER_FRAME::OnShowHotkeys( wxCommandEvent& event )
562 {
564 }
565 
566 
567 void KICAD_MANAGER_FRAME::OnConfigurePaths( wxCommandEvent& aEvent )
568 {
569  DIALOG_CONFIGURE_PATHS dlg( this, nullptr );
570  dlg.ShowModal();
571 }
572 
573 
574 void KICAD_MANAGER_FRAME::OnEditSymLibTable( wxCommandEvent& aEvent )
575 {
577  kiface->CreateWindow( this, DIALOG_SCH_LIBRARY_TABLE, &Kiway() );
578 }
579 
580 
581 void KICAD_MANAGER_FRAME::OnEditFpLibTable( wxCommandEvent& aEvent )
582 {
584  kiface->CreateWindow( this, DIALOG_PCB_LIBRARY_TABLE, &Kiway() );
585 }
586 
587 
588 void KICAD_MANAGER_FRAME::OnPreferences( wxCommandEvent& aEvent )
589 {
591 }
void OnRunPcbCalculator(wxCommandEvent &event)
Definition: mainframe.cpp:440
void OnBrowseInFileExplorer(wxCommandEvent &event)
Definition: mainframe.cpp:491
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:581
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:446
void language_change(wxCommandEvent &event)
Definition: mainframe.cpp:518
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:539
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:408
void OnRunEeschema(wxCommandEvent &event)
Definition: mainframe.cpp:331
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:471
#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:339
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:574
wxAuiManager m_auimgr
void OnConfigurePaths(wxCommandEvent &aEvent)
Definition: mainframe.cpp:567
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:434
int GetPanelHeight() const
wxString AllFilesWildcard()
void UpdateFileHistory(const wxString &FullFileName, wxFileHistory *aFileHistory=NULL)
Function UpdateFileHistory Updates the list of recently opened files.
void OnOpenTextEditor(wxCommandEvent &event)
Definition: mainframe.cpp:462
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
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:60
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
Definition of file extensions used in Kicad.
const wxString PCB_CALCULATOR_EXE
#define FILE_HISTORY_SIZE_KEY
Definition: pgm_base.h:52
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:561
void OnRunGerbview(wxCommandEvent &event)
Definition: mainframe.cpp:453
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:525
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:396
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:546
void OnPreferences(wxCommandEvent &aEvent)
Definition: mainframe.cpp:588
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:189
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:200
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:533
void PrintPrjInfo()
Prints the current working directory name and the projet name on the text panel.
Definition: mainframe.cpp:553
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:365
#define KICAD_MANAGER_FRAME_NAME
Definition: kicad.h:40
KIWAY Kiway