2012-02-16 21:03:33 +01:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2015-11-15 19:04:19 +01:00
|
|
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2013-01-18 11:42:23 +01:00
|
|
|
* Copyright (C) 2013 CERN (www.cern.ch)
|
2015-02-28 15:50:35 -05:00
|
|
|
* Copyright (C) 2004-2015 KiCad Developers, see change_log.txt for contributors.
|
2012-02-16 21:03:33 +01:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2016-02-24 16:36:52 -05:00
|
|
|
/**
|
|
|
|
* @file kicad/mainframe.cpp
|
|
|
|
* @brief KICAD_MANAGER_FRAME is the KiCad main frame.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <dialog_hotkeys_editor.h>
|
|
|
|
#include <gestfich.h>
|
2014-04-19 13:47:20 -05:00
|
|
|
#include <kiway.h>
|
2014-04-17 21:05:40 -05:00
|
|
|
#include <kiway_player.h>
|
2012-02-16 21:03:33 +01:00
|
|
|
#include <wildcards_and_files_ext.h>
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2016-02-24 16:36:52 -05:00
|
|
|
#include "pgm_kicad.h"
|
|
|
|
#include "tree_project_frame.h"
|
|
|
|
|
|
|
|
#include "kicad.h"
|
2015-09-25 15:38:09 -04:00
|
|
|
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2014-11-02 17:25:04 +01:00
|
|
|
#define TREE_FRAME_WIDTH_ENTRY wxT( "LeftWinWidth" )
|
2009-04-05 20:49:15 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent,
|
|
|
|
const wxString& title, const wxPoint& pos, const wxSize& size ) :
|
2014-04-19 13:47:20 -05:00
|
|
|
EDA_BASE_FRAME( parent, KICAD_MAIN_FRAME_T, title, pos, size,
|
2015-03-02 18:29:18 +01:00
|
|
|
KICAD_DEFAULT_DRAWFRAME_STYLE, KICAD_MANAGER_FRAME_NAME )
|
2007-10-31 17:47:44 +00:00
|
|
|
{
|
2015-08-03 16:56:37 -04:00
|
|
|
m_active_project = false;
|
2014-02-01 19:27:18 +01:00
|
|
|
m_leftWinWidth = 60;
|
2015-03-02 18:29:18 +01:00
|
|
|
m_manager_Hokeys_Descr = NULL;
|
2007-10-31 17:47:44 +00:00
|
|
|
|
|
|
|
// Create the status line (bottom of the frame
|
2009-08-07 04:44:42 +00:00
|
|
|
static const int dims[3] = { -1, -1, 100 };
|
|
|
|
|
2007-10-31 17:47:44 +00:00
|
|
|
CreateStatusBar( 3 );
|
|
|
|
SetStatusWidths( 3, dims );
|
|
|
|
|
|
|
|
// Give an icon
|
2011-09-09 21:30:59 +02:00
|
|
|
wxIcon icon;
|
|
|
|
icon.CopyFromBitmap( KiBitmap( icon_kicad_xpm ) );
|
|
|
|
SetIcon( icon );
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2014-02-01 19:27:18 +01:00
|
|
|
// Give the last sise and pos to main window
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
LoadSettings( config() );
|
2014-02-01 19:27:18 +01:00
|
|
|
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
2007-10-31 17:47:44 +00:00
|
|
|
|
|
|
|
// Left window: is the box which display tree project
|
2010-02-19 15:01:32 +00:00
|
|
|
m_LeftWin = new TREE_PROJECT_FRAME( this );
|
2010-01-13 21:15:54 +00:00
|
|
|
|
2014-02-01 19:27:18 +01:00
|
|
|
// Right top Window: buttons to launch applications
|
|
|
|
m_Launcher = new LAUNCHER_PANEL( this );
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
|
2014-02-01 19:27:18 +01:00
|
|
|
// Add the wxTextCtrl showing all messages from KiCad:
|
|
|
|
m_MessagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString,
|
|
|
|
wxDefaultPosition, wxDefaultSize,
|
|
|
|
wxTE_MULTILINE | wxSUNKEN_BORDER | wxTE_READONLY );
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2009-11-02 22:24:55 +00:00
|
|
|
RecreateBaseHToolbar();
|
2013-01-01 15:06:49 +01:00
|
|
|
ReCreateMenuBar();
|
2009-11-02 22:24:55 +00:00
|
|
|
|
2009-11-18 20:12:11 +00:00
|
|
|
m_auimgr.SetManagedWindow( this );
|
2009-11-04 19:08:08 +00:00
|
|
|
|
2014-02-01 19:27:18 +01:00
|
|
|
EDA_PANEINFO horiztb;
|
|
|
|
horiztb.HorizontalToolbarPane();
|
2011-09-15 14:25:44 -04:00
|
|
|
|
|
|
|
EDA_PANEINFO info;
|
|
|
|
info.InfoToolbarPane();
|
2010-01-13 21:15:54 +00:00
|
|
|
|
2014-02-01 19:27:18 +01:00
|
|
|
m_auimgr.AddPane( m_mainToolBar,
|
|
|
|
wxAuiPaneInfo( horiztb ).Name( wxT( "m_mainToolBar" ) ).Top() );
|
|
|
|
|
|
|
|
m_auimgr.AddPane( m_LeftWin,
|
|
|
|
wxAuiPaneInfo(info).Name( wxT( "m_LeftWin" ) ).Left().
|
|
|
|
BestSize( m_leftWinWidth, -1 ).
|
|
|
|
Layer( 1 ) );
|
2010-01-13 21:15:54 +00:00
|
|
|
|
2014-02-01 19:27:18 +01:00
|
|
|
m_auimgr.AddPane( m_Launcher, wxTOP );
|
|
|
|
m_auimgr.GetPane( m_Launcher).CaptionVisible( false ).Row(1)
|
|
|
|
.BestSize( -1, m_Launcher->GetPanelHeight() ).PaneBorder( false ).Resizable( false );
|
2010-01-13 21:15:54 +00:00
|
|
|
|
2014-02-01 19:27:18 +01:00
|
|
|
m_auimgr.AddPane( m_MessagesBox,
|
|
|
|
wxAuiPaneInfo().Name( wxT( "m_MessagesBox" ) ).CentrePane().Layer( 2 ) );
|
|
|
|
|
|
|
|
m_auimgr.GetPane( m_LeftWin ).MinSize( wxSize( 80, -1) );
|
|
|
|
m_auimgr.GetPane( m_LeftWin ).BestSize(wxSize(m_leftWinWidth, -1) );
|
2011-10-27 07:43:44 +02:00
|
|
|
|
2009-11-02 22:24:55 +00:00
|
|
|
m_auimgr.Update();
|
2007-10-31 17:47:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-04-17 15:54:17 +02:00
|
|
|
KICAD_MANAGER_FRAME::~KICAD_MANAGER_FRAME()
|
2007-10-31 17:47:44 +00:00
|
|
|
{
|
2009-11-18 20:12:11 +00:00
|
|
|
m_auimgr.UnInit();
|
2007-10-31 17:47:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
wxConfigBase* KICAD_MANAGER_FRAME::config()
|
|
|
|
{
|
|
|
|
wxConfigBase* ret = Pgm().PgmSettings();
|
|
|
|
wxASSERT( ret );
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2014-07-08 19:52:46 -05:00
|
|
|
|
2014-07-07 14:49:14 -05:00
|
|
|
void KICAD_MANAGER_FRAME::SetProjectFileName( const wxString& aFullProjectProFileName )
|
|
|
|
{
|
2014-07-28 09:06:08 -05:00
|
|
|
// ensure file name is absolute:
|
|
|
|
wxFileName fn( aFullProjectProFileName );
|
2014-07-07 14:49:14 -05:00
|
|
|
|
2014-07-28 09:06:08 -05:00
|
|
|
if( !fn.IsAbsolute() )
|
|
|
|
fn.MakeAbsolute();
|
|
|
|
|
|
|
|
Prj().SetProjectFullName( fn.GetFullPath() );
|
2014-07-07 14:49:14 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const wxString KICAD_MANAGER_FRAME::GetProjectFileName()
|
|
|
|
{
|
2014-07-28 09:06:08 -05:00
|
|
|
return Prj().GetProjectFullName();
|
2014-07-07 14:49:14 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const wxString KICAD_MANAGER_FRAME::SchFileName()
|
|
|
|
{
|
2014-07-08 19:52:46 -05:00
|
|
|
wxFileName fn( GetProjectFileName() );
|
|
|
|
|
|
|
|
fn.SetExt( SchematicFileExtension );
|
2014-07-07 14:49:14 -05:00
|
|
|
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 15:28:54 -05:00
|
|
|
return fn.GetFullPath();
|
2014-07-07 14:49:14 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const wxString KICAD_MANAGER_FRAME::PcbFileName()
|
|
|
|
{
|
2014-07-08 19:52:46 -05:00
|
|
|
wxFileName fn( GetProjectFileName() );
|
|
|
|
|
|
|
|
fn.SetExt( PcbFileExtension );
|
|
|
|
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 15:28:54 -05:00
|
|
|
return fn.GetFullPath();
|
2014-07-08 19:52:46 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const wxString KICAD_MANAGER_FRAME::PcbLegacyFileName()
|
|
|
|
{
|
|
|
|
wxFileName fn( GetProjectFileName() );
|
|
|
|
|
|
|
|
fn.SetExt( LegacyPcbFileExtension );
|
2014-07-07 14:49:14 -05:00
|
|
|
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 15:28:54 -05:00
|
|
|
return fn.GetFullPath();
|
2014-07-07 14:49:14 -05:00
|
|
|
}
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
|
2014-07-08 19:52:46 -05:00
|
|
|
void KICAD_MANAGER_FRAME::ReCreateTreePrj()
|
|
|
|
{
|
|
|
|
m_LeftWin->ReCreateTreePrj();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-04-14 13:49:52 -05:00
|
|
|
const SEARCH_STACK& KICAD_MANAGER_FRAME::sys_search()
|
|
|
|
{
|
|
|
|
return Pgm().SysSearch();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxString KICAD_MANAGER_FRAME::help_name()
|
|
|
|
{
|
|
|
|
return Pgm().GetHelpFileName();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-08-19 11:08:41 -04:00
|
|
|
void KICAD_MANAGER_FRAME::PrintMsg( const wxString& aText )
|
2007-10-31 17:47:44 +00:00
|
|
|
{
|
2014-02-01 19:27:18 +01:00
|
|
|
m_MessagesBox->AppendText( aText );
|
2007-10-31 17:47:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-04-17 15:54:17 +02:00
|
|
|
void KICAD_MANAGER_FRAME::OnSize( wxSizeEvent& event )
|
2007-10-31 17:47:44 +00:00
|
|
|
{
|
2009-11-18 20:12:11 +00:00
|
|
|
if( m_auimgr.GetManagedWindow() )
|
|
|
|
m_auimgr.Update();
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2008-07-21 13:44:01 +00:00
|
|
|
event.Skip();
|
2007-10-31 17:47:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-04-17 15:54:17 +02:00
|
|
|
void KICAD_MANAGER_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
2007-10-31 17:47:44 +00:00
|
|
|
{
|
2014-04-19 13:47:20 -05:00
|
|
|
if( Kiway.PlayersClose( false ) )
|
|
|
|
{
|
|
|
|
int px, py;
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2014-07-07 14:49:14 -05:00
|
|
|
UpdateFileHistory( GetProjectFileName(), &Pgm().GetFileHistory() );
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2014-04-19 13:47:20 -05:00
|
|
|
if( !IsIconized() ) // save main frame position and size
|
|
|
|
{
|
|
|
|
GetPosition( &px, &py );
|
|
|
|
m_FramePos.x = px;
|
|
|
|
m_FramePos.y = py;
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2014-04-19 13:47:20 -05:00
|
|
|
GetSize( &px, &py );
|
|
|
|
m_FrameSize.x = px;
|
|
|
|
m_FrameSize.y = py;
|
|
|
|
}
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2014-04-19 13:47:20 -05:00
|
|
|
Event.SetCanVeto( true );
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2014-04-19 13:47:20 -05:00
|
|
|
m_LeftWin->Show( false );
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2014-04-19 13:47:20 -05:00
|
|
|
Destroy();
|
|
|
|
}
|
2007-10-31 17:47:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-04-17 15:54:17 +02:00
|
|
|
void KICAD_MANAGER_FRAME::OnExit( wxCommandEvent& event )
|
2007-10-31 17:47:44 +00:00
|
|
|
{
|
2009-04-05 20:49:15 +00:00
|
|
|
Close( true );
|
|
|
|
}
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2011-08-19 11:08:41 -04:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
void KICAD_MANAGER_FRAME::TERMINATE_HANDLER::OnTerminate( int pid, int status )
|
2013-01-18 11:42:23 +01:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
wxString msg = wxString::Format( _( "%s closed [pid=%d]\n" ),
|
|
|
|
GetChars( appName ), pid );
|
2013-01-18 11:42:23 +01:00
|
|
|
|
2015-11-15 19:04:19 +01:00
|
|
|
wxWindow* window = wxWindow::FindWindowByName( KICAD_MANAGER_FRAME_NAME );
|
|
|
|
|
|
|
|
if( window ) // Should always happen.
|
|
|
|
{
|
|
|
|
// Be sure the kicad frame manager is found
|
|
|
|
// This dynamic cast is not really mandatory, but ...
|
|
|
|
KICAD_MANAGER_FRAME* frame = dynamic_cast<KICAD_MANAGER_FRAME*> (window);
|
|
|
|
|
|
|
|
if( frame )
|
|
|
|
frame->PrintMsg( msg );
|
|
|
|
}
|
2013-01-18 11:42:23 +01:00
|
|
|
|
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KICAD_MANAGER_FRAME::Execute( wxWindow* frame, const wxString& execFile,
|
2014-07-08 19:52:46 -05:00
|
|
|
wxString params )
|
2013-01-18 11:42:23 +01:00
|
|
|
{
|
2014-07-08 19:52:46 -05:00
|
|
|
if( params.size() )
|
|
|
|
AddDelimiterString( params );
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
TERMINATE_HANDLER* callback = new TERMINATE_HANDLER( execFile );
|
2013-01-18 11:42:23 +01:00
|
|
|
|
2014-07-08 19:52:46 -05:00
|
|
|
long pid = ExecuteFile( frame, execFile, params, callback );
|
2013-01-18 11:42:23 +01:00
|
|
|
|
|
|
|
if( pid > 0 )
|
|
|
|
{
|
2015-09-25 19:34:57 -04:00
|
|
|
wxString msg = wxString::Format( _( "%s %s opened [pid=%ld]\n" ),
|
|
|
|
GetChars( execFile ), GetChars( params ), pid );
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
|
2013-01-18 11:42:23 +01:00
|
|
|
PrintMsg( msg );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
delete callback;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-07-08 19:52:46 -05:00
|
|
|
void KICAD_MANAGER_FRAME::RunEeschema( const wxString& aProjectSchematicFileName )
|
2010-07-11 18:24:44 +02:00
|
|
|
{
|
2014-07-08 19:52:46 -05:00
|
|
|
KIWAY_PLAYER* frame = Kiway.Player( FRAME_SCH, false );
|
2014-09-16 10:34:51 +02:00
|
|
|
|
|
|
|
// Please: note: DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::initBuffers() calls
|
|
|
|
// Kiway.Player( FRAME_SCH, true )
|
|
|
|
// therefore, the schematic editor is sometimes running, but the schematic project
|
|
|
|
// is not loaded, if the library editor was called, and the dialog field editor was used.
|
2014-09-16 11:25:49 +02:00
|
|
|
// On linux, it happens the first time the schematic editor is launched, if
|
|
|
|
// library editor was running, and the dialog field editor was open
|
|
|
|
// On Windows, it happens always after the library editor was called,
|
|
|
|
// and the dialog field editor was used
|
2014-07-08 19:52:46 -05:00
|
|
|
if( !frame )
|
|
|
|
{
|
|
|
|
frame = Kiway.Player( FRAME_SCH, true );
|
2014-09-16 10:34:51 +02:00
|
|
|
}
|
|
|
|
|
2014-09-16 11:25:49 +02:00
|
|
|
if( !frame->IsShown() ) // the frame exists, (created by the dialog field editor)
|
|
|
|
// but no project loaded.
|
2014-09-16 10:34:51 +02:00
|
|
|
{
|
2014-07-08 19:52:46 -05:00
|
|
|
frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectSchematicFileName ) );
|
|
|
|
frame->Show( true );
|
|
|
|
}
|
2014-09-16 10:34:51 +02:00
|
|
|
|
2014-09-16 11:25:49 +02:00
|
|
|
// On Windows, Raise() does not bring the window on screen, when iconized or not shown
|
|
|
|
// On linux, Raise() brings the window on screen, but this code works fine
|
2014-09-16 10:34:51 +02:00
|
|
|
if( frame->IsIconized() )
|
|
|
|
frame->Iconize( false );
|
|
|
|
|
2014-07-08 19:52:46 -05:00
|
|
|
frame->Raise();
|
2010-07-11 18:24:44 +02:00
|
|
|
}
|
|
|
|
|
2011-08-19 11:08:41 -04:00
|
|
|
|
2014-07-08 19:52:46 -05:00
|
|
|
void KICAD_MANAGER_FRAME::OnRunEeschema( wxCommandEvent& event )
|
2011-08-05 21:53:42 +02:00
|
|
|
{
|
2014-07-28 09:06:08 -05:00
|
|
|
wxFileName fn( GetProjectFileName() );
|
2014-07-08 19:52:46 -05:00
|
|
|
|
|
|
|
fn.SetExt( SchematicFileExtension );
|
|
|
|
|
|
|
|
RunEeschema( fn.GetFullPath() );
|
2011-08-05 21:53:42 +02:00
|
|
|
}
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2014-07-08 19:52:46 -05:00
|
|
|
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 15:28:54 -05:00
|
|
|
void KICAD_MANAGER_FRAME::OnRunSchLibEditor( wxCommandEvent& event )
|
|
|
|
{
|
|
|
|
KIWAY_PLAYER* frame = Kiway.Player( FRAME_SCH_LIB_EDITOR, false );
|
2014-09-16 10:34:51 +02:00
|
|
|
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 15:28:54 -05:00
|
|
|
if( !frame )
|
|
|
|
{
|
|
|
|
frame = Kiway.Player( FRAME_SCH_LIB_EDITOR, true );
|
|
|
|
// frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectSchematicFileName ) );
|
|
|
|
frame->Show( true );
|
|
|
|
}
|
2014-09-16 10:34:51 +02:00
|
|
|
|
2014-09-16 11:25:49 +02:00
|
|
|
// On Windows, Raise() does not bring the window on screen, when iconized
|
2014-09-16 10:34:51 +02:00
|
|
|
if( frame->IsIconized() )
|
|
|
|
frame->Iconize( false );
|
|
|
|
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 15:28:54 -05:00
|
|
|
frame->Raise();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-07-08 19:52:46 -05:00
|
|
|
void KICAD_MANAGER_FRAME::RunPcbNew( const wxString& aProjectBoardFileName )
|
2013-07-19 20:27:22 +02:00
|
|
|
{
|
2014-08-17 17:58:45 -05:00
|
|
|
KIWAY_PLAYER* frame = Kiway.Player( FRAME_PCB, true );
|
|
|
|
|
2015-06-23 12:59:38 +02:00
|
|
|
// a pcb frame can be already existing, but not yet used.
|
|
|
|
// this is the case when running the footprint editor, or the footprint viewer first
|
|
|
|
// if the frame is not visible, the board is not yet loaded
|
2014-08-17 17:58:45 -05:00
|
|
|
if( !frame->IsVisible() )
|
|
|
|
{
|
|
|
|
frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectBoardFileName ) );
|
|
|
|
frame->Show( true );
|
|
|
|
}
|
|
|
|
|
2014-09-16 11:25:49 +02:00
|
|
|
// On Windows, Raise() does not bring the window on screen, when iconized
|
2014-09-16 10:34:51 +02:00
|
|
|
if( frame->IsIconized() )
|
|
|
|
frame->Iconize( false );
|
|
|
|
|
2014-07-08 19:52:46 -05:00
|
|
|
frame->Raise();
|
2013-07-19 20:27:22 +02:00
|
|
|
}
|
|
|
|
|
2011-08-19 11:08:41 -04:00
|
|
|
|
2011-04-17 15:54:17 +02:00
|
|
|
void KICAD_MANAGER_FRAME::OnRunPcbNew( wxCommandEvent& event )
|
2009-04-05 20:49:15 +00:00
|
|
|
{
|
2014-07-07 14:49:14 -05:00
|
|
|
wxFileName kicad_board( PcbFileName() );
|
2014-07-08 19:52:46 -05:00
|
|
|
wxFileName legacy_board( PcbLegacyFileName() );
|
2009-11-18 20:12:11 +00:00
|
|
|
|
2014-04-17 21:05:40 -05:00
|
|
|
wxFileName& board = ( !legacy_board.FileExists() || kicad_board.FileExists() ) ?
|
|
|
|
kicad_board : legacy_board;
|
|
|
|
|
2014-07-08 19:52:46 -05:00
|
|
|
RunPcbNew( board.GetFullPath() );
|
2007-10-31 17:47:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 15:28:54 -05:00
|
|
|
void KICAD_MANAGER_FRAME::OnRunPcbFpEditor( wxCommandEvent& event )
|
|
|
|
{
|
|
|
|
KIWAY_PLAYER* frame = Kiway.Player( FRAME_PCB_MODULE_EDITOR, false );
|
2014-09-14 17:43:18 +02:00
|
|
|
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 15:28:54 -05:00
|
|
|
if( !frame )
|
|
|
|
{
|
|
|
|
frame = Kiway.Player( FRAME_PCB_MODULE_EDITOR, true );
|
|
|
|
// frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectBoardFileName ) );
|
|
|
|
frame->Show( true );
|
|
|
|
}
|
2014-09-14 17:43:18 +02:00
|
|
|
|
2014-09-16 11:25:49 +02:00
|
|
|
// On Windows, Raise() does not bring the window on screen, when iconized
|
2014-09-16 10:34:51 +02:00
|
|
|
if( frame->IsIconized() )
|
|
|
|
frame->Iconize( false );
|
|
|
|
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 15:28:54 -05:00
|
|
|
frame->Raise();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-07-08 19:52:46 -05:00
|
|
|
void KICAD_MANAGER_FRAME::OnRunBitmapConverter( wxCommandEvent& event )
|
2007-10-31 17:47:44 +00:00
|
|
|
{
|
2014-07-08 19:52:46 -05:00
|
|
|
Execute( this, BITMAPCONVERTER_EXE );
|
|
|
|
}
|
2009-11-18 20:12:11 +00:00
|
|
|
|
2014-04-19 13:47:20 -05:00
|
|
|
|
2014-07-08 19:52:46 -05:00
|
|
|
void KICAD_MANAGER_FRAME::OnRunPcbCalculator( wxCommandEvent& event )
|
|
|
|
{
|
|
|
|
Execute( this, PCB_CALCULATOR_EXE );
|
2009-04-05 20:49:15 +00:00
|
|
|
}
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2014-09-16 11:25:49 +02:00
|
|
|
|
2014-07-08 19:52:46 -05:00
|
|
|
void KICAD_MANAGER_FRAME::OnRunPageLayoutEditor( wxCommandEvent& event )
|
|
|
|
{
|
|
|
|
Execute( this, PL_EDITOR_EXE );
|
|
|
|
}
|
2014-04-19 13:47:20 -05:00
|
|
|
|
2014-07-08 19:52:46 -05:00
|
|
|
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2011-04-17 15:54:17 +02:00
|
|
|
void KICAD_MANAGER_FRAME::OnRunGerbview( wxCommandEvent& event )
|
2009-04-05 20:49:15 +00:00
|
|
|
{
|
2014-05-19 20:24:07 +02:00
|
|
|
// Gerbview is called without any file to open, because we do not know
|
|
|
|
// the list and the name of files to open (if any...).
|
2014-10-28 20:29:44 +01:00
|
|
|
// however we run it in the path of the project
|
2015-09-25 15:38:09 -04:00
|
|
|
Execute( this, GERBVIEW_EXE, Prj().GetProjectPath() );
|
2009-04-05 20:49:15 +00:00
|
|
|
}
|
2007-10-31 17:47:44 +00:00
|
|
|
|
|
|
|
|
2011-04-17 15:54:17 +02:00
|
|
|
void KICAD_MANAGER_FRAME::OnOpenTextEditor( wxCommandEvent& event )
|
2009-04-05 20:49:15 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
wxString editorname = Pgm().GetEditorName();
|
2009-04-05 20:49:15 +00:00
|
|
|
|
|
|
|
if( !editorname.IsEmpty() )
|
2013-01-18 11:42:23 +01:00
|
|
|
Execute( this, editorname, wxEmptyString );
|
2009-04-05 20:49:15 +00:00
|
|
|
}
|
|
|
|
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2011-04-17 15:54:17 +02:00
|
|
|
void KICAD_MANAGER_FRAME::OnOpenFileInTextEditor( wxCommandEvent& event )
|
2009-04-05 20:49:15 +00:00
|
|
|
{
|
|
|
|
wxString mask( wxT( "*" ) );
|
2009-11-18 20:12:11 +00:00
|
|
|
|
2007-10-31 17:47:44 +00:00
|
|
|
#ifdef __WINDOWS__
|
2009-04-05 20:49:15 +00:00
|
|
|
mask += wxT( ".*" );
|
2007-10-31 17:47:44 +00:00
|
|
|
#endif
|
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
mask = _( "Text file (" ) + mask + wxT( ")|" ) + mask;
|
2014-11-02 17:25:04 +01:00
|
|
|
wxString default_dir = Prj().GetProjectPath();
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2012-12-31 09:12:29 +01:00
|
|
|
wxFileDialog dlg( this, _( "Load File to Edit" ), default_dir,
|
2009-11-18 20:12:11 +00:00
|
|
|
wxEmptyString, mask, wxFD_OPEN );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2009-04-09 09:00:23 +00:00
|
|
|
if( dlg.ShowModal() == wxID_CANCEL )
|
|
|
|
return;
|
|
|
|
|
2011-08-19 11:08:41 -04:00
|
|
|
wxString filename = wxT( "\"" );
|
|
|
|
filename += dlg.GetPath() + wxT( "\"" );
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
if( !dlg.GetPath().IsEmpty() && !Pgm().GetEditorName().IsEmpty() )
|
|
|
|
Execute( this, Pgm().GetEditorName(), filename );
|
2007-10-31 17:47:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-04-17 15:54:17 +02:00
|
|
|
void KICAD_MANAGER_FRAME::OnRefresh( wxCommandEvent& event )
|
2007-10-31 17:47:44 +00:00
|
|
|
{
|
|
|
|
m_LeftWin->ReCreateTreePrj();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Modular-Kicad milestone B), major portions:
*) Rework the set language support, simplify it by using KIWAY. Now any major
frame with a "change language" menu can change the language for all KIWAY_PLAYERs
in the whole KIWAY. Multiple KIWAYs are not supported yet.
*) Simplify "modal wxFrame" support, and add that support exclusively to
KIWAY_PLAYER where it is inherited by all derivatives. The function
KIWAY_PLAYER::ShowModal() is in the vtable and so is cross module capable.
*) Remove the requirements and assumptions that the wxFrame hierarchy always
had PCB_EDIT_FRAME and SCH_EDIT_FRAME as immediate parents of their viewers
and editors. This is no longer the case, nor required.
*) Use KIWAY::Player() everywhere to make KIWAY_PLAYERs, this registers the
KIWAY_PLAYER within the KIWAY and makes it very easy to find an open frame
quickly. It also gives control to the KIWAY as to frame hierarchical
relationships.
*) Change single_top to use the KIWAY for loading a KIFACE and instantiating
the single KIWAY_PLAYER, see bullet immediately above.
*) Add KIWAY::OnKiwayEnd() and call it from PGM_BASE at program termination, this
gives the KIFACEs a chance to save their final configuration dope to disk.
*) Add dedicated FRAME_T's for the modal frames, so m_Ident can be tested and
these modal frames are distinctly different than their non-modal equivalents.
KIWAY_PLAYER::IsModal() is !not! a valid test during the wxFrame's constructor,
so this is another important reason for having a dedicated FRAME_T for each
modal wxFrame.
On balance, more lines were deleted than were added to achieve all this.
2014-05-03 12:40:19 -05:00
|
|
|
void KICAD_MANAGER_FRAME::language_change( wxCommandEvent& event )
|
|
|
|
{
|
|
|
|
int id = event.GetId();
|
|
|
|
Kiway.SetLanguage( id );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-04-17 15:54:17 +02:00
|
|
|
void KICAD_MANAGER_FRAME::ClearMsg()
|
2007-10-31 17:47:44 +00:00
|
|
|
{
|
2014-02-01 19:27:18 +01:00
|
|
|
m_MessagesBox->Clear();
|
2007-10-31 17:47:44 +00:00
|
|
|
}
|
|
|
|
|
2008-11-02 14:54:53 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
void KICAD_MANAGER_FRAME::LoadSettings( wxConfigBase* aCfg )
|
2009-04-05 20:49:15 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
EDA_BASE_FRAME::LoadSettings( aCfg );
|
2014-11-02 17:25:04 +01:00
|
|
|
aCfg->Read( TREE_FRAME_WIDTH_ENTRY, &m_leftWinWidth );
|
2009-04-05 20:49:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
void KICAD_MANAGER_FRAME::SaveSettings( wxConfigBase* aCfg )
|
2009-04-05 20:49:15 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
EDA_BASE_FRAME::SaveSettings( aCfg );
|
2014-11-02 17:25:04 +01:00
|
|
|
aCfg->Write( TREE_FRAME_WIDTH_ENTRY, m_LeftWin->GetSize().x );
|
2014-02-01 19:27:18 +01:00
|
|
|
}
|
2009-04-05 20:49:15 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
|
2014-02-01 19:27:18 +01:00
|
|
|
/**
|
|
|
|
* a minor helper function:
|
2014-10-27 10:32:24 +01:00
|
|
|
* Prints the Current Project full name on the text panel.
|
2014-02-01 19:27:18 +01:00
|
|
|
*/
|
|
|
|
void KICAD_MANAGER_FRAME::PrintPrjInfo()
|
|
|
|
{
|
2014-10-27 10:32:24 +01:00
|
|
|
wxString msg = wxString::Format( _( "Project name:\n%s\n" ),
|
|
|
|
GetChars( GetProjectFileName() ) );
|
2014-02-01 19:27:18 +01:00
|
|
|
PrintMsg( msg );
|
2009-04-05 20:49:15 +00:00
|
|
|
}
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
|
2015-03-02 18:29:18 +01:00
|
|
|
void KICAD_MANAGER_FRAME::Process_Config( wxCommandEvent& event )
|
|
|
|
{
|
|
|
|
int id = event.GetId();
|
|
|
|
wxFileName fn;
|
|
|
|
|
|
|
|
switch( id )
|
|
|
|
{
|
|
|
|
// Hotkey IDs
|
|
|
|
case ID_PREFERENCES_HOTKEY_SHOW_EDITOR:
|
|
|
|
InstallHotkeyFrame( this, m_manager_Hokeys_Descr );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_PREFERENCES_HOTKEY_EXPORT_CONFIG:
|
|
|
|
ExportHotkeyConfigToFile( m_manager_Hokeys_Descr, wxT( "kicad" ) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_PREFERENCES_HOTKEY_IMPORT_CONFIG:
|
|
|
|
ImportHotkeyConfigFromFile( m_manager_Hokeys_Descr, wxT( "kicad" ) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST:
|
|
|
|
// Display current hotkey list for LibEdit.
|
|
|
|
DisplayHotkeyList( this, m_manager_Hokeys_Descr );
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
wxFAIL_MSG( wxT( "KICAD_MANAGER_FRAME::Process_Config error" ) );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2015-03-29 17:22:53 -04:00
|
|
|
|
|
|
|
|
|
|
|
void KICAD_MANAGER_FRAME::OnConfigurePaths( wxCommandEvent& aEvent )
|
|
|
|
{
|
|
|
|
Pgm().ConfigurePaths( this );
|
|
|
|
}
|