2013-01-18 10:42:23 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013 CERN (www.cern.ch)
|
2015-07-29 18:06:45 +00:00
|
|
|
* Copyright (C) 2015 KiCad Developers, see CHANGELOG.txt for contributors.
|
2013-01-18 10:42:23 +00: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-05-06 16:03:28 +00:00
|
|
|
|
2016-02-24 21:36:52 +00:00
|
|
|
/**
|
|
|
|
* @file kicad/kicad.h
|
|
|
|
* @brief KICAD_MANAGER_FRAME is the KiCad main frame.
|
|
|
|
*/
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
#ifndef KICAD_H
|
|
|
|
#define KICAD_H
|
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2013-01-18 10:42:23 +00:00
|
|
|
#include <wx/process.h>
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <id.h>
|
|
|
|
#include <wxstruct.h>
|
2009-02-04 15:25:03 +00:00
|
|
|
|
2016-02-24 21:36:52 +00:00
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
#define KICAD_MANAGER_FRAME_NAME wxT( "KicadFrame" )
|
|
|
|
|
2014-02-01 18:27:18 +00:00
|
|
|
class LAUNCHER_PANEL;
|
2010-02-19 15:01:32 +00:00
|
|
|
class TREEPROJECTFILES;
|
|
|
|
class TREE_PROJECT_FRAME;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2012-08-29 12:40:09 +00:00
|
|
|
// Enum to identify the type of files handled by Kicad manager
|
|
|
|
//
|
|
|
|
// When changing this enum please verify (and perhaps update)
|
|
|
|
// TREE_PROJECT_FRAME::GetFileExt(),
|
|
|
|
// s_AllowedExtensionsToList[]
|
|
|
|
|
|
|
|
enum TreeFileType {
|
|
|
|
TREE_PROJECT = 1,
|
2013-07-19 18:27:22 +00:00
|
|
|
TREE_SCHEMA, // Schematic file (.sch)
|
|
|
|
TREE_LEGACY_PCB, // board file (.brd) legacy format
|
|
|
|
TREE_SEXP_PCB, // board file (.kicad_brd) new s expression format
|
|
|
|
TREE_GERBER, // Gerber file (.pho, .g*)
|
2015-06-24 19:30:35 +00:00
|
|
|
TREE_HTML, // HTML file (.htm, *.html)
|
2013-07-19 18:27:22 +00:00
|
|
|
TREE_PDF, // PDF file (.pdf)
|
|
|
|
TREE_TXT, // ascii text file (.txt)
|
|
|
|
TREE_NET, // netlist file (.net)
|
2012-08-29 12:40:09 +00:00
|
|
|
TREE_UNKNOWN,
|
|
|
|
TREE_DIRECTORY,
|
2013-07-19 18:27:22 +00:00
|
|
|
TREE_CMP_LINK, // cmp/footprint link file (.cmp)
|
|
|
|
TREE_REPORT, // report file (.rpt)
|
|
|
|
TREE_FP_PLACE, // fooprints position (place) file (.pos)
|
|
|
|
TREE_DRILL, // Excellon drill file (.drl)
|
|
|
|
TREE_SVG, // SVG file (.svg)
|
|
|
|
TREE_PAGE_LAYOUT_DESCR, // Page layout and title block descr file (.kicad_wks)
|
2014-10-21 16:34:51 +00:00
|
|
|
TREE_FOOTPRINT_FILE, // footprint file (.kicad_mod)
|
|
|
|
TREE_SCHEMATIC_LIBFILE, // schematic library file (.lib)
|
2012-08-29 12:40:09 +00:00
|
|
|
TREE_MAX
|
|
|
|
};
|
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
/**
|
2011-09-30 18:15:37 +00:00
|
|
|
* Command IDs for KiCad.
|
2009-09-22 12:27:57 +00:00
|
|
|
*
|
2014-08-19 14:51:15 +00:00
|
|
|
* Please add IDs that are unique to Kicad here and not in the global id.h file.
|
|
|
|
* This will prevent the entire project from being rebuilt when adding
|
2011-09-30 18:15:37 +00:00
|
|
|
* new commands to KiCad.
|
2014-08-19 14:51:15 +00:00
|
|
|
*
|
|
|
|
* However, now the Kicad manager and other sub applications are running inside
|
|
|
|
* the same application, these IDs are kept unique inside the whole Kicad code
|
|
|
|
* See the global id.h which reserves room for the Kicad manager IDs
|
|
|
|
* and expand this room if needed
|
|
|
|
*
|
|
|
|
* We have experienced issues with duplicate menus IDs between frames
|
|
|
|
* because wxUpdateUIEvent events are sent to parent frames, when a wxUpdateUIEvent
|
|
|
|
* event function does not exists for some menuitems ID, and therefore
|
|
|
|
* with duplicate menuitems IDs in different frames, the wrong menuitem can be used
|
|
|
|
* by a function called by the wxUpdateUIEvent event loop.
|
|
|
|
*
|
|
|
|
* The number of items in this list should be less than ROOM_FOR_KICADMANAGER (see id.h)
|
2009-09-22 12:27:57 +00:00
|
|
|
*/
|
|
|
|
|
2009-11-18 20:12:11 +00:00
|
|
|
enum id_kicad_frm {
|
2014-08-19 14:51:15 +00:00
|
|
|
ID_LEFT_FRAME = ID_KICAD_MANAGER_START,
|
2009-09-22 12:27:57 +00:00
|
|
|
ID_PROJECT_TREE,
|
|
|
|
ID_PROJECT_TXTEDIT,
|
|
|
|
ID_PROJECT_TREE_REFRESH,
|
|
|
|
ID_PROJECT_NEWDIR,
|
|
|
|
ID_PROJECT_DELETE,
|
|
|
|
ID_PROJECT_RENAME,
|
|
|
|
ID_PROJECT_OPEN_FILE_WITH_TEXT_EDITOR,
|
|
|
|
|
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 20:28:54 +00:00
|
|
|
ID_TO_SCH,
|
|
|
|
ID_TO_SCH_LIB_EDITOR,
|
|
|
|
ID_TO_PCB,
|
|
|
|
ID_TO_PCB_FP_EDITOR,
|
2015-08-03 20:56:37 +00:00
|
|
|
ID_TO_CVPCB,
|
2009-09-22 12:27:57 +00:00
|
|
|
ID_TO_GERBVIEW,
|
2010-07-11 16:24:44 +00:00
|
|
|
ID_TO_BITMAP_CONVERTER,
|
2011-08-05 19:53:42 +00:00
|
|
|
ID_TO_PCB_CALCULATOR,
|
2013-07-19 18:27:22 +00:00
|
|
|
ID_TO_PL_EDITOR,
|
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 20:28:54 +00:00
|
|
|
|
|
|
|
ID_TO_TEXT_EDITOR,
|
2009-09-22 12:27:57 +00:00
|
|
|
ID_BROWSE_AN_SELECT_FILE,
|
|
|
|
ID_SELECT_PREFERED_EDITOR,
|
|
|
|
ID_SELECT_PREFERED_PDF_BROWSER_NAME,
|
|
|
|
ID_SELECT_PREFERED_PDF_BROWSER,
|
|
|
|
ID_SELECT_DEFAULT_PDF_BROWSER,
|
|
|
|
ID_SAVE_AND_ZIP_FILES,
|
2013-01-01 14:06:49 +00:00
|
|
|
ID_READ_ZIP_ARCHIVE,
|
2014-08-19 14:51:15 +00:00
|
|
|
ID_INIT_WATCHED_PATHS,
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2014-08-19 14:51:15 +00:00
|
|
|
// Please, verify: the number of items in this list should be
|
|
|
|
// less than ROOM_FOR_KICADMANAGER (see id.h)
|
|
|
|
ID_KICADMANAGER_END_LIST
|
|
|
|
};
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2015-08-03 20:56:37 +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-20 00:42:08 +00:00
|
|
|
/**
|
|
|
|
* Class KICAD_MANAGER_FRAME
|
|
|
|
* is the main KiCad project manager frame. It is not a KIWAY_PLAYER.
|
2007-10-31 17:47:44 +00:00
|
|
|
*/
|
2011-04-17 13:54:17 +00:00
|
|
|
class KICAD_MANAGER_FRAME : public EDA_BASE_FRAME
|
2007-05-06 16:03:28 +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-20 00:42:08 +00:00
|
|
|
public:
|
|
|
|
KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& title,
|
2011-09-09 19:30:59 +00:00
|
|
|
const wxPoint& pos, const wxSize& size );
|
2007-09-13 11:55:46 +00:00
|
|
|
|
2011-04-17 13:54:17 +00:00
|
|
|
~KICAD_MANAGER_FRAME();
|
2007-09-13 11:55:46 +00:00
|
|
|
|
2010-07-11 16:24:44 +00:00
|
|
|
void OnCloseWindow( wxCloseEvent& Event );
|
|
|
|
void OnSize( wxSizeEvent& event );
|
2011-08-19 15:08:41 +00:00
|
|
|
|
2017-03-02 13:46:18 +00:00
|
|
|
/**
|
|
|
|
* Function OnChangeIconsOptions
|
|
|
|
* Selects the current icons options in menus (or toolbars) in Kicad
|
|
|
|
* (the default for toolbars/menus is 26x26 pixels, and shows icons in menus).
|
|
|
|
*/
|
|
|
|
void OnChangeIconsOptions( wxCommandEvent& event );
|
|
|
|
|
2011-08-19 15:08:41 +00:00
|
|
|
/**
|
|
|
|
* Function OnLoadProject
|
|
|
|
* loads an exiting or creates a new project (.pro) file.
|
|
|
|
*/
|
2010-07-11 16:24:44 +00:00
|
|
|
void OnLoadProject( wxCommandEvent& event );
|
2011-08-19 15:08:41 +00:00
|
|
|
|
2014-09-06 19:55:20 +00:00
|
|
|
/**
|
|
|
|
* Function OnCreateProjectFromTemplate
|
|
|
|
* Creates a new project folder, copy a template into this new folder.
|
|
|
|
* and open this new projrct as working project
|
|
|
|
*/
|
|
|
|
void OnCreateProjectFromTemplate( wxCommandEvent& event );
|
|
|
|
|
2011-08-19 15:08:41 +00:00
|
|
|
/**
|
|
|
|
* Function OnSaveProject
|
|
|
|
* is the command event hendler to Save the project (.pro) file containing the top level
|
|
|
|
* configuration parameters.
|
|
|
|
*/
|
2010-07-11 16:24:44 +00:00
|
|
|
void OnSaveProject( wxCommandEvent& event );
|
2011-08-19 15:08:41 +00:00
|
|
|
|
2010-07-11 16:24:44 +00:00
|
|
|
void OnArchiveFiles( wxCommandEvent& event );
|
|
|
|
void OnUnarchiveFiles( wxCommandEvent& event );
|
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 20:28:54 +00:00
|
|
|
|
|
|
|
void OnRunEeschema( wxCommandEvent& event );
|
|
|
|
void OnRunSchLibEditor( wxCommandEvent& event );
|
2010-07-11 16:24:44 +00:00
|
|
|
void OnRunPcbNew( wxCommandEvent& event );
|
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 20:28:54 +00:00
|
|
|
void OnRunPcbFpEditor( wxCommandEvent& event );
|
2010-07-11 16:24:44 +00:00
|
|
|
void OnRunGerbview( wxCommandEvent& event );
|
|
|
|
void OnRunBitmapConverter( wxCommandEvent& event );
|
2011-08-05 19:53:42 +00:00
|
|
|
void OnRunPcbCalculator( wxCommandEvent& event );
|
2013-07-19 18:27:22 +00:00
|
|
|
void OnRunPageLayoutEditor( wxCommandEvent& event );
|
2010-07-11 16:24:44 +00:00
|
|
|
|
2015-03-29 21:22:53 +00:00
|
|
|
void OnConfigurePaths( wxCommandEvent& aEvent );
|
2010-07-11 16:24:44 +00:00
|
|
|
void OnOpenTextEditor( wxCommandEvent& event );
|
|
|
|
void OnOpenFileInTextEditor( wxCommandEvent& event );
|
|
|
|
void OnOpenFileInEditor( wxCommandEvent& event );
|
|
|
|
|
|
|
|
void OnFileHistory( wxCommandEvent& event );
|
|
|
|
void OnExit( wxCommandEvent& event );
|
|
|
|
void Process_Preferences( wxCommandEvent& event );
|
2015-03-02 17:29:18 +00:00
|
|
|
|
|
|
|
void Process_Config( wxCommandEvent& event );
|
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
void ReCreateMenuBar() override;
|
2010-07-11 16:24:44 +00:00
|
|
|
void RecreateBaseHToolbar();
|
2011-08-19 15:08:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function PrintMsg
|
|
|
|
* displays \a aText in the text panel.
|
|
|
|
*
|
|
|
|
* @param aText The text to display.
|
|
|
|
*/
|
|
|
|
void PrintMsg( const wxString& aText );
|
|
|
|
|
2014-02-01 18:27:18 +00:00
|
|
|
/**
|
|
|
|
* a minor helper function:
|
|
|
|
* Prints the Current Working Dir name and the projet name on the text panel.
|
|
|
|
*/
|
|
|
|
void PrintPrjInfo();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* a minor helper function:
|
|
|
|
* Erase the text panel.
|
|
|
|
*/
|
2010-07-11 16:24:44 +00:00
|
|
|
void ClearMsg();
|
2014-02-01 18:27:18 +00:00
|
|
|
|
2010-07-11 16:24:44 +00:00
|
|
|
void OnRefresh( wxCommandEvent& event );
|
|
|
|
void OnSelectDefaultPdfBrowser( wxCommandEvent& event );
|
|
|
|
void OnSelectPreferredPdfBrowser( wxCommandEvent& event );
|
|
|
|
|
|
|
|
void OnUpdateDefaultPdfBrowser( wxUpdateUIEvent& event );
|
|
|
|
void OnUpdatePreferredPdfBrowser( wxUpdateUIEvent& event );
|
2015-08-03 20:56:37 +00:00
|
|
|
void OnUpdateRequiresProject( wxUpdateUIEvent& event );
|
2010-07-11 16:24:44 +00:00
|
|
|
|
2014-07-07 19:49:14 +00:00
|
|
|
void CreateNewProject( const wxString& aPrjFullFileName, bool aTemplateSelector );
|
2010-07-11 16:24:44 +00:00
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
void LoadSettings( wxConfigBase* aCfg ) override;
|
2011-08-19 15:08:41 +00:00
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
void SaveSettings( wxConfigBase* aCfg ) override;
|
2007-09-13 11:55:46 +00:00
|
|
|
|
2013-01-18 10:42:23 +00:00
|
|
|
/**
|
|
|
|
* Function Execute
|
|
|
|
* opens another KiCad application and logs a message.
|
|
|
|
* @param frame = owner frame.
|
|
|
|
* @param execFile = name of the executable file.
|
|
|
|
* @param param = parameters to be passed to the executable.
|
|
|
|
*/
|
|
|
|
void Execute( wxWindow* frame, const wxString& execFile,
|
2014-07-09 00:52:46 +00:00
|
|
|
wxString param = wxEmptyString );
|
2013-01-18 10:42:23 +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-20 00:42:08 +00:00
|
|
|
class TERMINATE_HANDLER : public wxProcess
|
2013-01-18 10:42:23 +00:00
|
|
|
{
|
|
|
|
private:
|
2016-04-12 15:50:42 +00:00
|
|
|
wxString m_appName;
|
2013-01-18 10:42:23 +00:00
|
|
|
|
|
|
|
public:
|
* 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-20 00:42:08 +00:00
|
|
|
TERMINATE_HANDLER( const wxString& appName ) :
|
2016-04-12 15:50:42 +00:00
|
|
|
m_appName(appName)
|
2013-01-18 10:42:23 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnTerminate( int pid, int status ) override;
|
2013-01-18 10:42:23 +00:00
|
|
|
};
|
|
|
|
|
2013-01-01 14:06:49 +00:00
|
|
|
/**
|
|
|
|
* Called by sending a event with id = ID_INIT_WATCHED_PATHS
|
|
|
|
* rebuild the list of wahtched paths
|
|
|
|
*/
|
|
|
|
void OnChangeWatchedPaths(wxCommandEvent& aEvent );
|
2015-07-29 18:06:45 +00:00
|
|
|
|
2013-01-01 14:06:49 +00:00
|
|
|
|
2014-07-07 19:49:14 +00:00
|
|
|
void SetProjectFileName( const wxString& aFullProjectProFileName );
|
|
|
|
const wxString GetProjectFileName();
|
|
|
|
|
|
|
|
// read only accessors
|
|
|
|
const wxString SchFileName();
|
|
|
|
const wxString PcbFileName();
|
2014-07-09 00:52:46 +00:00
|
|
|
const wxString PcbLegacyFileName();
|
|
|
|
|
|
|
|
void ReCreateTreePrj();
|
|
|
|
|
|
|
|
/// Call this only for a PCB associated with the current project. That is,
|
|
|
|
/// it must have the same path and name as the project *.pro file.
|
|
|
|
void RunPcbNew( const wxString& aProjectBoardFileName );
|
|
|
|
|
|
|
|
/// Call this only for a SCH associated with the current project. That is,
|
|
|
|
/// it must have the same path and name as the project *.pro file.
|
|
|
|
void RunEeschema( const wxString& aProjectSchematicFileName );
|
2014-07-07 19:49:14 +00:00
|
|
|
|
2007-09-13 11:55:46 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
2014-07-07 19:49:14 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2016-09-25 17:06:49 +00:00
|
|
|
wxConfigBase* config() override;
|
2014-07-07 19:49:14 +00:00
|
|
|
|
2016-09-25 17:06:49 +00:00
|
|
|
const SEARCH_STACK& sys_search() override;
|
2014-07-07 19:49:14 +00:00
|
|
|
|
2016-09-25 17:06:49 +00:00
|
|
|
wxString help_name() override;
|
2014-07-07 19:49:14 +00:00
|
|
|
|
|
|
|
TREE_PROJECT_FRAME* m_LeftWin;
|
|
|
|
LAUNCHER_PANEL* m_Launcher;
|
|
|
|
wxTextCtrl* m_MessagesBox;
|
|
|
|
wxAuiToolBar* m_VToolBar; // Vertical toolbar (not used)
|
|
|
|
|
|
|
|
int m_leftWinWidth;
|
2015-03-02 17:29:18 +00:00
|
|
|
EDA_HOTKEY_CONFIG* m_manager_Hokeys_Descr;
|
2014-07-07 19:49:14 +00:00
|
|
|
|
|
|
|
void language_change( wxCommandEvent& event );
|
2015-08-03 20:56:37 +00:00
|
|
|
|
|
|
|
bool m_active_project;
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
2007-05-28 18:09:49 +00:00
|
|
|
|
2014-02-01 18:27:18 +00:00
|
|
|
/** class LAUNCHER_PANEL
|
2007-10-31 17:47:44 +00:00
|
|
|
*/
|
2014-02-01 18:27:18 +00:00
|
|
|
class LAUNCHER_PANEL : public wxPanel
|
2007-10-31 17:47:44 +00:00
|
|
|
{
|
2009-11-18 20:12:11 +00:00
|
|
|
private:
|
2014-02-01 18:27:18 +00:00
|
|
|
int m_buttonSeparation; // button distance in pixels
|
|
|
|
wxPoint m_buttonsListPosition; /* position of the left bottom corner
|
2011-09-09 19:30:59 +00:00
|
|
|
* of the first bitmap button
|
|
|
|
*/
|
2014-02-01 18:27:18 +00:00
|
|
|
wxPoint m_buttonLastPosition; // position of the last button in the window
|
2016-03-08 19:03:16 +00:00
|
|
|
int m_bitmapButtons_maxHeight; // height of bigger bitmap buttons
|
2011-09-09 19:30:59 +00:00
|
|
|
// Used to calculate the height of the panel.
|
|
|
|
|
2014-02-01 18:27:18 +00:00
|
|
|
public: LAUNCHER_PANEL( wxWindow* parent );
|
|
|
|
~LAUNCHER_PANEL() { };
|
|
|
|
|
|
|
|
int GetPanelHeight() const;
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2007-10-31 17:47:44 +00:00
|
|
|
private:
|
2011-09-09 19:30:59 +00:00
|
|
|
|
2011-08-19 15:08:41 +00:00
|
|
|
/**
|
|
|
|
* Function CreateCommandToolbar
|
|
|
|
* creates the main tool bar buttons (fast launch buttons)
|
|
|
|
*/
|
2011-09-09 19:30:59 +00:00
|
|
|
void CreateCommandToolbar( void );
|
2011-08-19 15:08:41 +00:00
|
|
|
|
2011-09-09 19:30:59 +00:00
|
|
|
wxBitmapButton* AddBitmapButton( wxWindowID aId, const wxBitmap& aBitmap );
|
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-20 00:42:08 +00:00
|
|
|
// The C++ project manager includes a single PROJECT in its link image.
|
|
|
|
class PROJECT;
|
|
|
|
extern PROJECT& Prj();
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
#endif
|