2013-07-19 18:27:22 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013 CERN
|
2023-02-07 16:34:46 +00:00
|
|
|
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
2013-08-13 17:51:22 +00:00
|
|
|
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2013-07-19 18:27:22 +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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PL_EDITOR_FRAME_H
|
|
|
|
#define _PL_EDITOR_FRAME_H
|
|
|
|
|
|
|
|
|
* 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
|
|
|
#include <config_params.h>
|
2019-06-08 22:14:57 +00:00
|
|
|
#include <eda_draw_frame.h>
|
2020-07-13 11:21:40 +00:00
|
|
|
#include <base_screen.h>
|
2020-10-13 05:04:31 +00:00
|
|
|
#include "pl_editor_layout.h"
|
|
|
|
#include "pl_draw_panel_gal.h"
|
2013-07-19 18:27:22 +00:00
|
|
|
|
2020-10-13 05:04:31 +00:00
|
|
|
class PL_DRAW_PANEL_GAL;
|
2013-07-19 18:27:22 +00:00
|
|
|
class PROPERTIES_FRAME;
|
2021-02-22 23:47:17 +00:00
|
|
|
class DS_DATA_ITEM;
|
2021-06-03 11:49:49 +00:00
|
|
|
class wxChoice;
|
2013-07-19 18:27:22 +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
|
|
|
|
2013-07-19 18:27:22 +00:00
|
|
|
/**
|
2021-06-08 19:39:47 +00:00
|
|
|
* The main window used in the drawing sheet editor.
|
2013-07-19 18:27:22 +00:00
|
|
|
*/
|
|
|
|
class PL_EDITOR_FRAME : public EDA_DRAW_FRAME
|
|
|
|
{
|
|
|
|
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
|
|
|
PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent );
|
2019-11-23 16:54:48 +00:00
|
|
|
~PL_EDITOR_FRAME();
|
2019-05-20 10:23:32 +00:00
|
|
|
|
|
|
|
PROPERTIES_FRAME* GetPropertiesFrame() { return m_propertiesPagelayout; }
|
2013-07-19 18:27:22 +00:00
|
|
|
|
2019-06-14 18:14:41 +00:00
|
|
|
/**
|
2021-02-22 23:47:17 +00:00
|
|
|
* Show the dialog displaying the list of DS_DATA_ITEM items in the page layout
|
2019-06-14 18:14:41 +00:00
|
|
|
*/
|
|
|
|
void ShowDesignInspector();
|
|
|
|
|
2016-09-25 17:06:49 +00:00
|
|
|
bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl ) override;
|
* 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
|
|
|
|
|
|
|
/**
|
2021-06-08 19:39:47 +00:00
|
|
|
* Load a .kicad_wks drawing sheet file.
|
|
|
|
*
|
|
|
|
* @param aFullFileName is the filename.
|
* 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
|
|
|
*/
|
2021-05-30 22:56:24 +00:00
|
|
|
bool LoadDrawingSheetFile( const wxString& aFullFileName );
|
* 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
|
|
|
|
|
|
|
/**
|
2021-06-08 19:39:47 +00:00
|
|
|
* Save the current layout in a .kicad_wks drawing sheet file.
|
|
|
|
*
|
|
|
|
* @param aFullFileName is the filename.
|
* 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
|
|
|
*/
|
2021-05-30 22:56:24 +00:00
|
|
|
bool SaveDrawingSheetFile( const wxString& aFullFileName );
|
* 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
|
|
|
|
|
|
|
/**
|
2021-06-08 19:39:47 +00:00
|
|
|
* Load a .kicad_wks drawing sheet file, and add items to the current layout list.
|
|
|
|
*
|
|
|
|
* @param aFullFileName is the filename.
|
* 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
|
|
|
*/
|
2021-05-30 22:56:24 +00:00
|
|
|
bool InsertDrawingSheetFile( const wxString& aFullFileName );
|
* 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
|
|
|
|
2019-12-19 15:34:01 +00:00
|
|
|
/**
|
2021-05-30 22:56:24 +00:00
|
|
|
* Get if the drawing sheet has been modified but not saved.
|
2019-12-19 15:34:01 +00:00
|
|
|
*
|
|
|
|
* @return true if the any changes have not been saved
|
|
|
|
*/
|
2021-05-27 23:07:48 +00:00
|
|
|
bool IsContentModified() const override;
|
2019-08-02 08:35:26 +00:00
|
|
|
|
2021-06-08 19:39:47 +00:00
|
|
|
/**
|
|
|
|
* Event handler for the wxID_EXIT and wxID_CLOSE events.
|
2019-08-02 08:35:26 +00:00
|
|
|
*/
|
|
|
|
void OnExit( wxCommandEvent& aEvent );
|
|
|
|
|
2020-08-24 02:01:14 +00:00
|
|
|
bool canCloseWindow( wxCloseEvent& aCloseEvent ) override;
|
|
|
|
void doCloseWindow() override;
|
2013-07-19 18:27:22 +00:00
|
|
|
|
2021-06-08 19:39:47 +00:00
|
|
|
// The Tool Framework initialization
|
2019-05-20 10:23:32 +00:00
|
|
|
void setupTools();
|
|
|
|
|
2013-07-19 18:27:22 +00:00
|
|
|
// Virtual basic functions:
|
2021-03-27 21:49:38 +00:00
|
|
|
void ReCreateHToolbar() override;
|
|
|
|
void UpdateToolbarControlSizes() override;
|
2013-07-19 18:27:22 +00:00
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
void SetPageSettings(const PAGE_INFO&) override;
|
2016-09-25 17:06:49 +00:00
|
|
|
const PAGE_INFO& GetPageSettings () const override;
|
|
|
|
const wxSize GetPageSizeIU() const override;
|
2013-07-19 18:27:22 +00:00
|
|
|
|
2019-06-13 17:28:55 +00:00
|
|
|
PL_DRAW_PANEL_GAL* GetCanvas() const override;
|
2020-07-29 23:50:25 +00:00
|
|
|
SELECTION& GetCurrentSelection() override;
|
2019-06-13 17:28:55 +00:00
|
|
|
|
2021-12-29 21:30:11 +00:00
|
|
|
const VECTOR2I& GetGridOrigin() const override { return m_grid_origin; }
|
2023-04-29 17:14:24 +00:00
|
|
|
void SetGridOrigin( const VECTOR2I& aPoint ) override { m_grid_origin = aPoint; }
|
2013-07-19 18:27:22 +00:00
|
|
|
|
2019-06-07 10:42:28 +00:00
|
|
|
/**
|
2021-06-08 19:39:47 +00:00
|
|
|
* Calculate the position (in page, in iu) of the corner used as coordinate origin
|
|
|
|
* of items.
|
2019-06-07 10:42:28 +00:00
|
|
|
*/
|
2022-01-01 06:04:08 +00:00
|
|
|
VECTOR2I ReturnCoordOriginCorner() const;
|
2019-06-07 10:42:28 +00:00
|
|
|
|
2016-09-25 17:06:49 +00:00
|
|
|
const TITLE_BLOCK& GetTitleBlock() const override;
|
|
|
|
void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) override;
|
2013-07-19 18:27:22 +00:00
|
|
|
|
2020-08-02 17:42:35 +00:00
|
|
|
void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override;
|
|
|
|
|
2020-06-12 10:58:56 +00:00
|
|
|
void DisplayGridMsg() override;
|
2019-05-24 13:55:33 +00:00
|
|
|
|
2016-09-25 17:06:49 +00:00
|
|
|
void UpdateStatusBar() override;
|
2013-07-19 18:27:22 +00:00
|
|
|
|
2013-07-20 19:36:19 +00:00
|
|
|
/**
|
2021-05-30 22:56:24 +00:00
|
|
|
* Must be called to initialize parameters when a new drawing sheet is loaded
|
2013-07-20 19:36:19 +00:00
|
|
|
*/
|
2021-05-30 22:56:24 +00:00
|
|
|
void OnNewDrawingSheet();
|
2013-07-20 19:36:19 +00:00
|
|
|
|
2013-07-19 18:27:22 +00:00
|
|
|
/**
|
2021-06-08 19:39:47 +00:00
|
|
|
* Create or update the right vertical toolbar.
|
2013-07-19 18:27:22 +00:00
|
|
|
*/
|
2023-04-29 17:14:24 +00:00
|
|
|
void ReCreateVToolbar() override;
|
2013-07-19 18:27:22 +00:00
|
|
|
|
|
|
|
/**
|
2021-06-08 19:39:47 +00:00
|
|
|
* Create or update the left vertical toolbar.
|
|
|
|
*
|
2013-07-19 18:27:22 +00:00
|
|
|
* @note This is currently not used.
|
|
|
|
*/
|
2023-04-29 17:14:24 +00:00
|
|
|
void ReCreateOptToolbar() override;
|
2013-07-19 18:27:22 +00:00
|
|
|
|
|
|
|
const PL_EDITOR_LAYOUT& GetPageLayout() const { return m_pageLayout; }
|
2019-05-20 10:23:32 +00:00
|
|
|
PL_EDITOR_LAYOUT& GetPageLayout() { return m_pageLayout; }
|
|
|
|
|
2020-09-25 07:31:56 +00:00
|
|
|
const BOX2I GetDocumentExtents( bool aIncludeAllVisible = true ) const override;
|
2013-07-19 18:27:22 +00:00
|
|
|
|
|
|
|
/**
|
2021-02-22 16:37:43 +00:00
|
|
|
* Drawing sheet editor can show the title block using a page number 1 or another number.
|
2021-06-08 19:39:47 +00:00
|
|
|
*
|
2019-05-26 15:36:40 +00:00
|
|
|
* This is because some items can be shown (or not) only on page 1 (a feature which
|
|
|
|
* looks like word processing option "page 1 differs from other pages").
|
2021-06-08 19:39:47 +00:00
|
|
|
*
|
|
|
|
* @return true if the page 1 is selected, and false if not.
|
2013-07-19 18:27:22 +00:00
|
|
|
*/
|
2021-06-03 11:49:49 +00:00
|
|
|
bool GetPageNumberOption() const;
|
2013-07-19 18:27:22 +00:00
|
|
|
|
|
|
|
/**
|
2021-06-08 19:39:47 +00:00
|
|
|
* Display the short filename (if exists) loaded file on the caption of the main window.
|
2013-07-19 18:27:22 +00:00
|
|
|
*/
|
2019-05-20 10:23:32 +00:00
|
|
|
void UpdateTitleAndInfo();
|
2013-07-19 18:27:22 +00:00
|
|
|
|
2022-03-02 09:01:54 +00:00
|
|
|
/**
|
|
|
|
* Display the size of the sheet to the message panel.
|
|
|
|
*/
|
|
|
|
void UpdateMsgPanelInfo();
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
|
2013-07-19 18:27:22 +00:00
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
|
2013-07-19 18:27:22 +00:00
|
|
|
|
2019-06-09 21:57:23 +00:00
|
|
|
void OnSelectPage( wxCommandEvent& event );
|
2013-07-19 18:27:22 +00:00
|
|
|
|
|
|
|
/**
|
2021-06-08 19:39:47 +00:00
|
|
|
* Called when the user select one of the 4 page corner as corner reference (or the
|
|
|
|
* left top paper corner).
|
2013-07-19 18:27:22 +00:00
|
|
|
*/
|
2019-05-20 10:23:32 +00:00
|
|
|
void OnSelectCoordOriginCorner( wxCommandEvent& event );
|
2013-07-19 18:27:22 +00:00
|
|
|
|
|
|
|
/**
|
2021-06-08 19:39:47 +00:00
|
|
|
* Open a dialog frame to print layers.
|
2013-07-19 18:27:22 +00:00
|
|
|
*/
|
2019-05-25 00:34:44 +00:00
|
|
|
void ToPrinter( bool doPreview );
|
2013-07-19 18:27:22 +00:00
|
|
|
|
2019-05-20 10:23:32 +00:00
|
|
|
void Files_io( wxCommandEvent& event );
|
2013-07-19 18:27:22 +00:00
|
|
|
|
2021-06-08 19:39:47 +00:00
|
|
|
/**
|
|
|
|
* Print a page.
|
|
|
|
*
|
|
|
|
* @param aDC is the device context used by the print function.
|
2013-07-19 18:27:22 +00:00
|
|
|
*/
|
2020-12-20 18:18:54 +00:00
|
|
|
virtual void PrintPage( const RENDER_SETTINGS* aSettings ) override;
|
2013-07-19 18:27:22 +00:00
|
|
|
|
|
|
|
void OnFileHistory( wxCommandEvent& event );
|
2020-02-25 15:46:56 +00:00
|
|
|
void OnClearFileHistory( wxCommandEvent& aEvent );
|
2013-07-19 18:27:22 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the filename of the current layout descr file
|
2021-06-08 19:39:47 +00:00
|
|
|
* If this is the default (no loaded file) returns a empty name
|
2013-07-19 18:27:22 +00:00
|
|
|
* or a new design.
|
|
|
|
*/
|
2020-05-16 23:08:01 +00:00
|
|
|
wxString GetCurrentFileName() const override;
|
2013-07-19 18:27:22 +00:00
|
|
|
|
|
|
|
/**
|
2021-06-08 19:39:47 +00:00
|
|
|
* Store the current layout description file filename.
|
2013-07-19 18:27:22 +00:00
|
|
|
*/
|
2020-05-16 23:08:01 +00:00
|
|
|
void SetCurrentFileName( const wxString& aName );
|
2013-07-19 18:27:22 +00:00
|
|
|
|
|
|
|
/**
|
2021-06-08 19:39:47 +00:00
|
|
|
* Refresh the library tree and redraw the window.
|
2013-07-19 18:27:22 +00:00
|
|
|
*/
|
2019-05-20 10:23:32 +00:00
|
|
|
void HardRedraw() override;
|
2013-07-19 18:27:22 +00:00
|
|
|
|
|
|
|
/**
|
2021-05-30 22:56:24 +00:00
|
|
|
* Add a new item to the drawing sheet item list.
|
2021-06-08 19:39:47 +00:00
|
|
|
*
|
|
|
|
* @param aType is the type of item:
|
2021-02-22 23:47:17 +00:00
|
|
|
* DS_TEXT, DS_SEGMENT, DS_RECT, DS_POLYPOLYGON
|
2021-06-08 19:39:47 +00:00
|
|
|
* @param aIdx is the position in list to insert the new item.
|
|
|
|
* @return a reference to the new item.
|
2013-07-19 18:27:22 +00:00
|
|
|
*/
|
2021-05-30 22:56:24 +00:00
|
|
|
DS_DATA_ITEM* AddDrawingSheetItem( int aType );
|
2013-07-26 12:50:29 +00:00
|
|
|
|
2013-07-19 18:27:22 +00:00
|
|
|
/**
|
2021-06-08 19:39:47 +00:00
|
|
|
* Must be called after a change in order to set the "modify" flag.
|
2013-07-19 18:27:22 +00:00
|
|
|
*/
|
2023-02-07 16:34:46 +00:00
|
|
|
void OnModify() override;
|
2013-07-19 18:27:22 +00:00
|
|
|
|
2013-07-26 12:50:29 +00:00
|
|
|
/**
|
2019-05-26 15:36:40 +00:00
|
|
|
* Save a copy of the description (in a S expr string) for Undo/redo commands.
|
2013-07-26 12:50:29 +00:00
|
|
|
*/
|
2020-07-13 11:21:40 +00:00
|
|
|
void SaveCopyInUndoList();
|
2013-07-26 12:50:29 +00:00
|
|
|
|
2021-06-08 19:39:47 +00:00
|
|
|
/**
|
|
|
|
* Redo the last edit:
|
|
|
|
* - Place the current edited layout in undo list.
|
|
|
|
* - Get the previous version of the current edited layout.
|
2013-07-26 12:50:29 +00:00
|
|
|
*/
|
2019-05-20 10:23:32 +00:00
|
|
|
void GetLayoutFromRedoList();
|
2013-07-26 12:50:29 +00:00
|
|
|
|
2021-06-08 19:39:47 +00:00
|
|
|
/**
|
|
|
|
* Undo the last edit:
|
|
|
|
* - Place the current layout in Redo list.
|
|
|
|
* - Get the previous version of the current edited layout.
|
2013-07-26 12:50:29 +00:00
|
|
|
*/
|
2019-05-20 10:23:32 +00:00
|
|
|
void GetLayoutFromUndoList();
|
2013-07-26 12:50:29 +00:00
|
|
|
|
|
|
|
/**
|
2019-05-26 15:36:40 +00:00
|
|
|
* Apply the last command in Undo List without stacking a Redo. Used to clean the
|
2021-06-08 19:39:47 +00:00
|
|
|
* Undo stack after canceling a command.
|
2013-07-26 12:50:29 +00:00
|
|
|
*/
|
2019-05-20 10:23:32 +00:00
|
|
|
void RollbackFromUndo();
|
2013-07-19 18:27:22 +00:00
|
|
|
|
2020-07-13 13:50:35 +00:00
|
|
|
void ClearUndoORRedoList( UNDO_REDO_LIST whichList, int aItemCount = -1 ) override;
|
2020-07-13 11:21:40 +00:00
|
|
|
|
2018-08-11 20:46:03 +00:00
|
|
|
protected:
|
|
|
|
bool saveCurrentPageLayout();
|
|
|
|
|
2021-06-08 19:39:47 +00:00
|
|
|
void setupUIConditions() override;
|
|
|
|
|
2022-12-16 21:37:32 +00:00
|
|
|
void doReCreateMenuBar() override;
|
|
|
|
|
2023-04-29 17:14:24 +00:00
|
|
|
void DoWithAcceptedFiles() override;
|
|
|
|
|
2021-06-08 19:39:47 +00:00
|
|
|
DECLARE_EVENT_TABLE();
|
|
|
|
|
2023-04-29 17:14:24 +00:00
|
|
|
protected:
|
2021-06-08 19:39:47 +00:00
|
|
|
/// The last filename chosen to be proposed to the user
|
2023-04-29 17:14:24 +00:00
|
|
|
PROPERTIES_FRAME* m_propertiesPagelayout;
|
2021-06-08 19:39:47 +00:00
|
|
|
|
|
|
|
private:
|
2023-04-29 17:14:24 +00:00
|
|
|
PL_EDITOR_LAYOUT m_pageLayout;
|
2021-06-08 19:39:47 +00:00
|
|
|
|
2023-04-29 17:14:24 +00:00
|
|
|
int m_propertiesFrameWidth; // last width (in pixels) of m_propertiesPagelayout
|
2021-06-08 19:39:47 +00:00
|
|
|
|
2023-04-29 17:14:24 +00:00
|
|
|
wxChoice* m_originSelectBox; // Corner origin choice for coordinates
|
|
|
|
int m_originSelectChoice; // the last choice for m_originSelectBox
|
|
|
|
wxChoice* m_pageSelectBox; // The page number sel'ector (page 1 or other pages
|
|
|
|
// useful when there are some items which are
|
|
|
|
wxString m_mruImagePath; // Most recently used path for placing a new image
|
|
|
|
// only on page 1, not on page 1
|
|
|
|
VECTOR2I m_grid_origin;
|
2013-07-19 18:27:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _PL_EDITOR_FRAME_H */
|