You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1068 lines
36 KiB

* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
++PCBNew * Removed Pcb_Frame argument from BOARD() constructor, since it precludes having a BOARD being edited by more than one editor, it was a bad design. And this meant removing m_PcbFrame from BOARD. * removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame * Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp * added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance * a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed, such as dialog_mask_clearance, dialog_drc, etc. * Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it with build_version.h's #define BOARD_FILE_VERSION, although there may be a better place for this constant. * Made the public functions in PARAM_CFG_ARRAY be type const. void SaveParam(..) const and void ReadParam(..) const * PARAM_CFG_BASE now has virtual destructor since we have various way of destroying the derived class and boost::ptr_vector must be told about this. * Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use an automatic PARAM_CFG_ARRAY which is on the stack.\ * PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array, since it has to access the current BOARD and the BOARD can change. Remember BOARD_DESIGN_SETTINGS are now in the BOARD. * Made the m_BoundingBox member private, this was a brutally hard task, and indicative of the lack of commitment to accessors and object oriented design on the part of KiCad developers. We must do better. Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox(). * Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
14 years ago
14 years ago
11 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
14 years ago
14 years ago
14 years ago
14 years ago
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.
12 years ago
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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
  5. * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
  6. * Copyright (C) 2013 Wayne Stambaugh <stambaughw@verizon.net>
  7. * Copyright (C) 2013 KiCad Developers, see change_log.txt for contributors.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, you may find one here:
  21. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  22. * or you may search the http://www.gnu.org website for the version 2 license,
  23. * or you may write to the Free Software Foundation, Inc.,
  24. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  25. */
  26. /**
  27. * @file pcbframe.cpp
  28. * @brief PCB editor main window implementation.
  29. */
  30. #include <fctsys.h>
  31. #include <kiface_i.h>
  32. #include <pgm_base.h>
  33. #include <class_drawpanel.h>
  34. #include <confirm.h>
  35. #include <wxPcbStruct.h>
  36. #include <collectors.h>
  37. #include <build_version.h>
  38. #include <macros.h>
  39. #include <3d_viewer.h>
  40. #include <msgpanel.h>
  41. #include <fp_lib_table.h>
  42. #include <pcbnew.h>
  43. #include <pcbnew_id.h>
  44. #include <drc_stuff.h>
  45. #include <layer_widget.h>
  46. #include <dialog_design_rules.h>
  47. #include <class_pcb_layer_widget.h>
  48. #include <hotkeys.h>
  49. #include <pcbnew_config.h>
  50. #include <module_editor_frame.h>
  51. #include <dialog_helpers.h>
  52. #include <dialog_plot.h>
  53. #include <convert_from_iu.h>
  54. #include <view/view.h>
  55. #include <view/view_controls.h>
  56. #include <pcb_painter.h>
  57. #include <invoke_pcb_dialog.h>
  58. #include <class_track.h>
  59. #include <class_board.h>
  60. #include <class_module.h>
  61. #include <worksheet_viewitem.h>
  62. #include <ratsnest_data.h>
  63. #include <ratsnest_viewitem.h>
  64. #include <tool/tool_manager.h>
  65. #include <tool/tool_dispatcher.h>
  66. #include <tools/common_actions.h>
  67. #include <scripting/python_console_frame.h>
  68. #if defined(KICAD_SCRIPTING) || defined(KICAD_SCRIPTING_WXPYTHON)
  69. #include <python_scripting.h>
  70. #endif
  71. #include <pcb_draw_panel_gal.h>
  72. #include <gal/graphics_abstraction_layer.h>
  73. #include <boost/bind.hpp>
  74. // Keys used in read/write config
  75. #define OPTKEY_DEFAULT_LINEWIDTH_VALUE wxT( "PlotLineWidth_mm" )
  76. #define PCB_SHOW_FULL_RATSNET_OPT wxT( "PcbFullRatsnest" )
  77. #define PCB_MAGNETIC_PADS_OPT wxT( "PcbMagPadOpt" )
  78. #define PCB_MAGNETIC_TRACKS_OPT wxT( "PcbMagTrackOpt" )
  79. #define SHOW_MICROWAVE_TOOLS wxT( "ShowMicrowaveTools" )
  80. #define SHOW_LAYER_MANAGER_TOOLS wxT( "ShowLayerManagerTools" )
  81. BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
  82. EVT_SOCKET( ID_EDA_SOCKET_EVENT_SERV, PCB_EDIT_FRAME::OnSockRequestServer )
  83. EVT_SOCKET( ID_EDA_SOCKET_EVENT, PCB_EDIT_FRAME::OnSockRequest )
  84. EVT_CHOICE( ID_ON_ZOOM_SELECT, PCB_EDIT_FRAME::OnSelectZoom )
  85. EVT_CHOICE( ID_ON_GRID_SELECT, PCB_EDIT_FRAME::OnSelectGrid )
  86. EVT_CLOSE( PCB_EDIT_FRAME::OnCloseWindow )
  87. EVT_SIZE( PCB_EDIT_FRAME::OnSize )
  88. EVT_TOOL( ID_LOAD_FILE, PCB_EDIT_FRAME::Files_io )
  89. EVT_TOOL( ID_MENU_READ_BOARD_BACKUP_FILE, PCB_EDIT_FRAME::Files_io )
  90. EVT_TOOL( ID_MENU_RECOVER_BOARD_AUTOSAVE, PCB_EDIT_FRAME::Files_io )
  91. EVT_TOOL( ID_NEW_BOARD, PCB_EDIT_FRAME::Files_io )
  92. EVT_TOOL( ID_SAVE_BOARD, PCB_EDIT_FRAME::Files_io )
  93. EVT_TOOL( ID_OPEN_MODULE_EDITOR, PCB_EDIT_FRAME::Process_Special_Functions )
  94. EVT_TOOL( ID_OPEN_MODULE_VIEWER, PCB_EDIT_FRAME::Process_Special_Functions )
  95. // Menu Files:
  96. EVT_MENU( ID_MAIN_MENUBAR, PCB_EDIT_FRAME::Process_Special_Functions )
  97. EVT_MENU( ID_APPEND_FILE, PCB_EDIT_FRAME::Files_io )
  98. EVT_MENU( ID_SAVE_BOARD_AS, PCB_EDIT_FRAME::Files_io )
  99. EVT_MENU( ID_COPY_BOARD_AS, PCB_EDIT_FRAME::Files_io )
  100. EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, PCB_EDIT_FRAME::OnFileHistory )
  101. EVT_MENU( ID_GEN_PLOT, PCB_EDIT_FRAME::ToPlotter )
  102. EVT_MENU( ID_GEN_EXPORT_SPECCTRA, PCB_EDIT_FRAME::ExportToSpecctra )
  103. EVT_MENU( ID_GEN_EXPORT_FILE_GENCADFORMAT, PCB_EDIT_FRAME::ExportToGenCAD )
  104. EVT_MENU( ID_GEN_EXPORT_FILE_MODULE_REPORT, PCB_EDIT_FRAME::GenFootprintsReport )
  105. EVT_MENU( ID_GEN_EXPORT_FILE_VRML, PCB_EDIT_FRAME::OnExportVRML )
  106. EVT_MENU( ID_GEN_EXPORT_FILE_IDF3, PCB_EDIT_FRAME::ExportToIDF3 )
  107. EVT_MENU( ID_GEN_IMPORT_SPECCTRA_SESSION,PCB_EDIT_FRAME::ImportSpecctraSession )
  108. EVT_MENU( ID_GEN_IMPORT_SPECCTRA_DESIGN, PCB_EDIT_FRAME::ImportSpecctraDesign )
  109. EVT_MENU( ID_GEN_IMPORT_DXF_FILE, PCB_EDIT_FRAME::Process_Special_Functions )
  110. EVT_MENU( ID_MENU_ARCHIVE_MODULES_IN_LIBRARY, PCB_EDIT_FRAME::Process_Special_Functions )
  111. EVT_MENU( ID_MENU_CREATE_LIBRARY_AND_ARCHIVE_MODULES, PCB_EDIT_FRAME::Process_Special_Functions )
  112. EVT_MENU( wxID_EXIT, PCB_EDIT_FRAME::OnQuit )
  113. // menu Config
  114. EVT_MENU( ID_PCB_DRAWINGS_WIDTHS_SETUP, PCB_EDIT_FRAME::OnConfigurePcbOptions )
  115. EVT_MENU( ID_PCB_LIB_TABLE_EDIT, PCB_EDIT_FRAME::Process_Config )
  116. EVT_MENU( ID_PCB_LIB_WIZARD, PCB_EDIT_FRAME::Process_Config )
  117. EVT_MENU( ID_PCB_3DSHAPELIB_WIZARD, PCB_EDIT_FRAME::Process_Config )
  118. EVT_MENU( ID_PREFERENCES_CONFIGURE_PATHS, PCB_EDIT_FRAME::OnConfigurePaths )
  119. EVT_MENU( ID_CONFIG_SAVE, PCB_EDIT_FRAME::Process_Config )
  120. EVT_MENU( ID_CONFIG_READ, PCB_EDIT_FRAME::Process_Config )
  121. EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END,
  122. PCB_EDIT_FRAME::Process_Config )
  123. EVT_MENU( ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG, PCB_EDIT_FRAME::Process_Config )
  124. EVT_MENU( ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR, PCB_EDIT_FRAME::Process_Config )
  125. EVT_MENU( wxID_PREFERENCES, PCB_EDIT_FRAME::Process_Config )
  126. EVT_MENU( ID_PCB_LAYERS_SETUP, PCB_EDIT_FRAME::Process_Config )
  127. EVT_MENU( ID_PCB_MASK_CLEARANCE, PCB_EDIT_FRAME::Process_Config )
  128. EVT_MENU( ID_PCB_PAD_SETUP, PCB_EDIT_FRAME::Process_Config )
  129. EVT_MENU( ID_CONFIG_SAVE, PCB_EDIT_FRAME::Process_Config )
  130. EVT_MENU( ID_CONFIG_READ, PCB_EDIT_FRAME::Process_Config )
  131. EVT_MENU( ID_PREFRENCES_MACROS_SAVE, PCB_EDIT_FRAME::Process_Config )
  132. EVT_MENU( ID_PREFRENCES_MACROS_READ, PCB_EDIT_FRAME::Process_Config )
  133. EVT_MENU( ID_PCB_DISPLAY_OPTIONS_SETUP, PCB_EDIT_FRAME::InstallDisplayOptionsDialog )
  134. EVT_MENU( ID_PCB_USER_GRID_SETUP, PCB_EDIT_FRAME::Process_Special_Functions )
  135. // menu Postprocess
  136. EVT_MENU( ID_PCB_GEN_POS_MODULES_FILE, PCB_EDIT_FRAME::GenFootprintsPositionFile )
  137. EVT_MENU( ID_PCB_GEN_DRILL_FILE, PCB_EDIT_FRAME::InstallDrillFrame )
  138. EVT_MENU( ID_PCB_GEN_D356_FILE, PCB_EDIT_FRAME::GenD356File )
  139. EVT_MENU( ID_PCB_GEN_CMP_FILE, PCB_EDIT_FRAME::RecreateCmpFileFromBoard )
  140. EVT_MENU( ID_PCB_GEN_BOM_FILE_FROM_BOARD, PCB_EDIT_FRAME::RecreateBOMFileFromBoard )
  141. // menu Miscellaneous
  142. EVT_MENU( ID_MENU_LIST_NETS, PCB_EDIT_FRAME::ListNetsAndSelect )
  143. EVT_MENU( ID_PCB_GLOBAL_DELETE, PCB_EDIT_FRAME::Process_Special_Functions )
  144. EVT_MENU( ID_MENU_PCB_CLEAN, PCB_EDIT_FRAME::Process_Special_Functions )
  145. EVT_MENU( ID_MENU_PCB_SWAP_LAYERS, PCB_EDIT_FRAME::Process_Special_Functions )
  146. EVT_MENU( ID_MENU_PCB_RESET_TEXTMODULE_FIELDS_SIZES,
  147. PCB_EDIT_FRAME::OnResetModuleTextSizes )
  148. // Menu Help
  149. EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
  150. EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp )
  151. EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
  152. // Menu 3D Frame
  153. EVT_MENU( ID_MENU_PCB_SHOW_3D_FRAME, PCB_EDIT_FRAME::Show3D_Frame )
  154. // Switching canvases
  155. EVT_MENU( ID_MENU_CANVAS_DEFAULT, PCB_BASE_FRAME::SwitchCanvas )
  156. EVT_MENU( ID_MENU_CANVAS_CAIRO, PCB_BASE_FRAME::SwitchCanvas )
  157. EVT_MENU( ID_MENU_CANVAS_OPENGL, PCB_BASE_FRAME::SwitchCanvas )
  158. // Menu Get Design Rules Editor
  159. EVT_MENU( ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG, PCB_EDIT_FRAME::ShowDesignRulesEditor )
  160. // Horizontal toolbar
  161. EVT_TOOL( ID_RUN_LIBRARY, PCB_EDIT_FRAME::Process_Special_Functions )
  162. EVT_TOOL( ID_SHEET_SET, EDA_DRAW_FRAME::Process_PageSettings )
  163. EVT_TOOL( wxID_CUT, PCB_EDIT_FRAME::Process_Special_Functions )
  164. EVT_TOOL( wxID_COPY, PCB_EDIT_FRAME::Process_Special_Functions )
  165. EVT_TOOL( wxID_PASTE, PCB_EDIT_FRAME::Process_Special_Functions )
  166. EVT_TOOL( wxID_UNDO, PCB_EDIT_FRAME::RestoreCopyFromUndoList )
  167. EVT_TOOL( wxID_REDO, PCB_EDIT_FRAME::RestoreCopyFromRedoList )
  168. EVT_TOOL( wxID_PRINT, PCB_EDIT_FRAME::ToPrinter )
  169. EVT_TOOL( ID_GEN_PLOT_SVG, PCB_EDIT_FRAME::SVG_Print )
  170. EVT_TOOL( ID_GEN_PLOT, PCB_EDIT_FRAME::Process_Special_Functions )
  171. EVT_TOOL( ID_FIND_ITEMS, PCB_EDIT_FRAME::Process_Special_Functions )
  172. EVT_TOOL( ID_GET_NETLIST, PCB_EDIT_FRAME::Process_Special_Functions )
  173. EVT_TOOL( ID_DRC_CONTROL, PCB_EDIT_FRAME::Process_Special_Functions )
  174. EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, PCB_EDIT_FRAME::Process_Special_Functions )
  175. EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
  176. EVT_COMBOBOX( ID_TOOLBARH_PCB_SELECT_LAYER, PCB_EDIT_FRAME::Process_Special_Functions )
  177. EVT_CHOICE( ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
  178. EVT_CHOICE( ID_AUX_TOOLBAR_PCB_VIA_SIZE, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
  179. EVT_TOOL( ID_TOOLBARH_PCB_MODE_MODULE, PCB_EDIT_FRAME::OnSelectAutoPlaceMode )
  180. EVT_TOOL( ID_TOOLBARH_PCB_MODE_TRACKS, PCB_EDIT_FRAME::OnSelectAutoPlaceMode )
  181. EVT_TOOL( ID_TOOLBARH_PCB_FREEROUTE_ACCESS, PCB_EDIT_FRAME::Access_to_External_Tool )
  182. // has meaning only with KICAD_SCRIPTING_WXPYTHON enabled
  183. EVT_TOOL( ID_TOOLBARH_PCB_SCRIPTING_CONSOLE, PCB_EDIT_FRAME::ScriptingConsoleEnableDisable )
  184. EVT_UPDATE_UI( ID_TOOLBARH_PCB_SCRIPTING_CONSOLE,
  185. PCB_EDIT_FRAME::OnUpdateScriptingConsoleState )
  186. // Option toolbar
  187. EVT_TOOL( ID_TB_OPTIONS_DRC_OFF,
  188. PCB_EDIT_FRAME::OnSelectOptionToolbar )
  189. EVT_TOOL( ID_TB_OPTIONS_SHOW_RATSNEST,
  190. PCB_EDIT_FRAME::OnSelectOptionToolbar )
  191. EVT_TOOL( ID_TB_OPTIONS_SHOW_MODULE_RATSNEST,
  192. PCB_EDIT_FRAME::OnSelectOptionToolbar )
  193. EVT_TOOL( ID_TB_OPTIONS_AUTO_DEL_TRACK,
  194. PCB_EDIT_FRAME::OnSelectOptionToolbar )
  195. EVT_TOOL( ID_TB_OPTIONS_SHOW_VIAS_SKETCH,
  196. PCB_EDIT_FRAME::OnSelectOptionToolbar )
  197. EVT_TOOL( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH,
  198. PCB_EDIT_FRAME::OnSelectOptionToolbar )
  199. EVT_TOOL( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE,
  200. PCB_EDIT_FRAME::OnSelectOptionToolbar )
  201. EVT_TOOL( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE,
  202. PCB_EDIT_FRAME::OnSelectOptionToolbar )
  203. EVT_TOOL_RANGE( ID_TB_OPTIONS_SHOW_ZONES, ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY,
  204. PCB_EDIT_FRAME::OnSelectOptionToolbar )
  205. EVT_TOOL( ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR,
  206. PCB_EDIT_FRAME::OnSelectOptionToolbar )
  207. // Vertical main toolbar:
  208. EVT_TOOL( ID_NO_TOOL_SELECTED, PCB_EDIT_FRAME::OnSelectTool )
  209. EVT_TOOL_RANGE( ID_PCB_HIGHLIGHT_BUTT, ID_PCB_PLACE_GRID_COORD_BUTT,
  210. PCB_EDIT_FRAME::OnSelectTool )
  211. EVT_TOOL_RANGE( ID_PCB_MUWAVE_START_CMD, ID_PCB_MUWAVE_END_CMD,
  212. PCB_EDIT_FRAME::ProcessMuWaveFunctions )
  213. EVT_MENU_RANGE( ID_POPUP_PCB_AUTOPLACE_START_RANGE, ID_POPUP_PCB_AUTOPLACE_END_RANGE,
  214. PCB_EDIT_FRAME::OnPlaceOrRouteFootprints )
  215. EVT_MENU( ID_POPUP_PCB_REORIENT_ALL_MODULES, PCB_EDIT_FRAME::OnOrientFootprints )
  216. EVT_MENU_RANGE( ID_POPUP_PCB_START_RANGE, ID_POPUP_PCB_END_RANGE,
  217. PCB_EDIT_FRAME::Process_Special_Functions )
  218. // Tracks and vias sizes general options
  219. EVT_MENU_RANGE( ID_POPUP_PCB_SELECT_WIDTH_START_RANGE,
  220. ID_POPUP_PCB_SELECT_WIDTH_END_RANGE,
  221. PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
  222. // popup menus
  223. EVT_MENU( ID_POPUP_PCB_DELETE_TRACKSEG, PCB_EDIT_FRAME::Process_Special_Functions )
  224. EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
  225. PCB_EDIT_FRAME::Process_Special_Functions )
  226. // User interface update event handlers.
  227. EVT_UPDATE_UI( ID_SAVE_BOARD, PCB_EDIT_FRAME::OnUpdateSave )
  228. EVT_UPDATE_UI( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, PCB_EDIT_FRAME::OnUpdateLayerPair )
  229. EVT_UPDATE_UI( ID_TOOLBARH_PCB_SELECT_LAYER, PCB_EDIT_FRAME::OnUpdateLayerSelectBox )
  230. EVT_UPDATE_UI( ID_TB_OPTIONS_DRC_OFF, PCB_EDIT_FRAME::OnUpdateDrcEnable )
  231. EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_RATSNEST, PCB_EDIT_FRAME::OnUpdateShowBoardRatsnest )
  232. EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_MODULE_RATSNEST, PCB_EDIT_FRAME::OnUpdateShowModuleRatsnest )
  233. EVT_UPDATE_UI( ID_TB_OPTIONS_AUTO_DEL_TRACK, PCB_EDIT_FRAME::OnUpdateAutoDeleteTrack )
  234. EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, PCB_EDIT_FRAME::OnUpdateViaDrawMode )
  235. EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, PCB_EDIT_FRAME::OnUpdateTraceDrawMode )
  236. EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE,
  237. PCB_EDIT_FRAME::OnUpdateHighContrastDisplayMode )
  238. EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR,
  239. PCB_EDIT_FRAME::OnUpdateShowLayerManager )
  240. EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE,
  241. PCB_EDIT_FRAME::OnUpdateShowMicrowaveToolbar )
  242. EVT_UPDATE_UI( ID_NO_TOOL_SELECTED, PCB_EDIT_FRAME::OnUpdateVerticalToolbar )
  243. EVT_UPDATE_UI( ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, PCB_EDIT_FRAME::OnUpdateSelectTrackWidth )
  244. EVT_UPDATE_UI( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH,
  245. PCB_EDIT_FRAME::OnUpdateSelectAutoTrackWidth )
  246. EVT_UPDATE_UI( ID_POPUP_PCB_SELECT_AUTO_WIDTH, PCB_EDIT_FRAME::OnUpdateSelectAutoTrackWidth )
  247. EVT_UPDATE_UI( ID_POPUP_PCB_SELECT_CUSTOM_WIDTH,
  248. PCB_EDIT_FRAME::OnUpdateSelectCustomTrackWidth )
  249. EVT_UPDATE_UI( ID_AUX_TOOLBAR_PCB_VIA_SIZE, PCB_EDIT_FRAME::OnUpdateSelectViaSize )
  250. EVT_UPDATE_UI( ID_TOOLBARH_PCB_MODE_MODULE, PCB_EDIT_FRAME::OnUpdateAutoPlaceModulesMode )
  251. EVT_UPDATE_UI( ID_TOOLBARH_PCB_MODE_TRACKS, PCB_EDIT_FRAME::OnUpdateAutoPlaceTracksMode )
  252. EVT_UPDATE_UI_RANGE( ID_POPUP_PCB_SELECT_WIDTH1, ID_POPUP_PCB_SELECT_WIDTH8,
  253. PCB_EDIT_FRAME::OnUpdateSelectTrackWidth )
  254. EVT_UPDATE_UI_RANGE( ID_POPUP_PCB_SELECT_VIASIZE1, ID_POPUP_PCB_SELECT_VIASIZE8,
  255. PCB_EDIT_FRAME::OnUpdateSelectViaSize )
  256. EVT_UPDATE_UI_RANGE( ID_PCB_HIGHLIGHT_BUTT, ID_PCB_PLACE_GRID_COORD_BUTT,
  257. PCB_EDIT_FRAME::OnUpdateVerticalToolbar )
  258. EVT_UPDATE_UI_RANGE( ID_TB_OPTIONS_SHOW_ZONES, ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY,
  259. PCB_EDIT_FRAME::OnUpdateZoneDisplayStyle )
  260. EVT_UPDATE_UI_RANGE( ID_PCB_MUWAVE_START_CMD, ID_PCB_MUWAVE_END_CMD,
  261. PCB_EDIT_FRAME::OnUpdateMuWaveToolbar )
  262. EVT_COMMAND( wxID_ANY, LAYER_WIDGET::EVT_LAYER_COLOR_CHANGE, PCB_EDIT_FRAME::OnLayerColorChange )
  263. END_EVENT_TABLE()
  264. PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
  265. PCB_BASE_EDIT_FRAME( aKiway, aParent, FRAME_PCB, wxT( "Pcbnew" ), wxDefaultPosition,
  266. wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, PCB_EDIT_FRAME_NAME )
  267. {
  268. m_showBorderAndTitleBlock = true; // true to display sheet references
  269. m_showAxis = false; // true to display X and Y axis
  270. m_showOriginAxis = true;
  271. m_showGridAxis = true;
  272. m_SelTrackWidthBox = NULL;
  273. m_SelViaSizeBox = NULL;
  274. m_SelLayerBox = NULL;
  275. m_show_microwave_tools = false;
  276. m_show_layer_manager_tools = true;
  277. m_hotkeysDescrList = g_Board_Editor_Hokeys_Descr;
  278. m_hasAutoSave = true;
  279. m_RecordingMacros = -1;
  280. m_microWaveToolBar = NULL;
  281. m_rotationAngle = 900;
  282. for ( int i = 0; i < 10; i++ )
  283. m_Macros[i].m_Record.clear();
  284. // Create GAL canvas
  285. EDA_DRAW_PANEL_GAL* galCanvas = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ),
  286. m_FrameSize, EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE );
  287. SetGalCanvas( galCanvas );
  288. SetBoard( new BOARD() );
  289. // Create the PCB_LAYER_WIDGET *after* SetBoard():
  290. wxFont font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
  291. int pointSize = font.GetPointSize();
  292. int screenHeight = wxSystemSettings::GetMetric( wxSYS_SCREEN_Y );
  293. // printf( "pointSize:%d 80%%:%d\n", pointSize, (pointSize*8)/10 );
  294. if( screenHeight <= 900 )
  295. pointSize = (pointSize * 8) / 10;
  296. m_Layers = new PCB_LAYER_WIDGET( this, GetCanvas(), pointSize );
  297. m_drc = new DRC( this ); // these 2 objects point to each other
  298. wxIcon icon;
  299. icon.CopyFromBitmap( KiBitmap( icon_pcbnew_xpm ) );
  300. SetIcon( icon );
  301. // LoadSettings() *after* creating m_LayersManager, because LoadSettings()
  302. // initialize parameters in m_LayersManager
  303. LoadSettings( config() );
  304. SetScreen( new PCB_SCREEN( GetPageSettings().GetSizeIU() ) );
  305. GetScreen()->SetMaxUndoItems( m_UndoRedoCountMax );
  306. // PCB drawings start in the upper left corner.
  307. GetScreen()->m_Center = false;
  308. SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
  309. GetScreen()->AddGrid( m_UserGridSize, m_UserGridUnit, ID_POPUP_GRID_USER );
  310. GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
  311. if( m_canvas )
  312. m_canvas->SetEnableBlockCommands( true );
  313. ReCreateMenuBar();
  314. ReCreateHToolbar();
  315. ReCreateAuxiliaryToolbar();
  316. ReCreateVToolbar();
  317. ReCreateOptToolbar();
  318. ReCreateMicrowaveVToolbar();
  319. m_auimgr.SetManagedWindow( this );
  320. EDA_PANEINFO horiz;
  321. horiz.HorizontalToolbarPane();
  322. EDA_PANEINFO vert;
  323. vert.VerticalToolbarPane();
  324. EDA_PANEINFO mesg;
  325. mesg.MessageToolbarPane();
  326. // Create a wxAuiPaneInfo for the Layers Manager, not derived from the template.
  327. // LAYER_WIDGET is floatable, but initially docked at far right
  328. EDA_PANEINFO lyrs;
  329. lyrs.LayersToolbarPane();
  330. lyrs.MinSize( m_Layers->GetBestSize() ); // updated in ReFillLayerWidget
  331. lyrs.BestSize( m_Layers->GetBestSize() );
  332. lyrs.Caption( _( "Visibles" ) );
  333. lyrs.TopDockable( false ).BottomDockable( false );
  334. if( m_mainToolBar ) // The main horizontal toolbar
  335. {
  336. m_auimgr.AddPane( m_mainToolBar,
  337. wxAuiPaneInfo( horiz ).Name( wxT( "m_mainToolBar" ) ).Top().Row( 0 ) );
  338. }
  339. if( m_auxiliaryToolBar ) // the auxiliary horizontal toolbar, that shows track and via sizes, zoom ...)
  340. {
  341. m_auimgr.AddPane( m_auxiliaryToolBar,
  342. wxAuiPaneInfo( horiz ).Name( wxT( "m_auxiliaryToolBar" ) ).Top().Row( 1 ) );
  343. }
  344. if( m_microWaveToolBar ) // The auxiliary vertical right toolbar (currently microwave tools)
  345. m_auimgr.AddPane( m_microWaveToolBar,
  346. wxAuiPaneInfo( vert ).Name( wxT( "m_microWaveToolBar" ) ).
  347. Right().Layer( 1 ).Position(1).Hide() );
  348. if( m_drawToolBar ) // The main right vertical toolbar
  349. m_auimgr.AddPane( m_drawToolBar,
  350. wxAuiPaneInfo( vert ).Name( wxT( "m_VToolBar" ) ).Right().Layer( 2 ) );
  351. // Add the layer manager ( most right side of pcbframe )
  352. m_auimgr.AddPane( m_Layers, lyrs.Name( wxT( "m_LayersManagerToolBar" ) ).Right().Layer( 3 ) );
  353. if( m_optionsToolBar ) // The left vertical toolbar (fast acces display options of Pcbnew)
  354. {
  355. m_auimgr.AddPane( m_optionsToolBar,
  356. wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left().Layer(1) );
  357. m_auimgr.GetPane( wxT( "m_LayersManagerToolBar" ) ).Show( m_show_layer_manager_tools );
  358. m_auimgr.GetPane( wxT( "m_microWaveToolBar" ) ).Show( m_show_microwave_tools );
  359. }
  360. if( m_canvas )
  361. m_auimgr.AddPane( m_canvas,
  362. wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
  363. if( GetGalCanvas() )
  364. m_auimgr.AddPane( (wxWindow*) GetGalCanvas(),
  365. wxAuiPaneInfo().Name( wxT( "DrawFrameGal" ) ).CentrePane().Hide() );
  366. if( m_messagePanel )
  367. m_auimgr.AddPane( m_messagePanel,
  368. wxAuiPaneInfo( mesg ).Name( wxT( "MsgPanel" ) ).Bottom().Layer(10) );
  369. ReFillLayerWidget(); // this is near end because contents establish size
  370. m_Layers->ReFillRender(); // Update colors in Render after the config is read
  371. syncLayerWidgetLayer();
  372. m_auimgr.Update();
  373. setupTools();
  374. Zoom_Automatique( false );
  375. EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = LoadCanvasTypeSetting();
  376. if( canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
  377. {
  378. if( GetGalCanvas()->SwitchBackend( canvasType ) )
  379. UseGalCanvas( true );
  380. }
  381. enableGALSpecificMenus();
  382. }
  383. PCB_EDIT_FRAME::~PCB_EDIT_FRAME()
  384. {
  385. m_RecordingMacros = -1;
  386. for( int i = 0; i < 10; i++ )
  387. m_Macros[i].m_Record.clear();
  388. delete m_drc;
  389. }
  390. void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard )
  391. {
  392. PCB_BASE_EDIT_FRAME::SetBoard( aBoard );
  393. if( IsGalCanvasActive() )
  394. {
  395. aBoard->GetRatsnest()->Recalculate();
  396. // reload the worksheet
  397. SetPageSettings( aBoard->GetPageSettings() );
  398. }
  399. }
  400. void PCB_EDIT_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
  401. {
  402. PCB_BASE_FRAME::SetPageSettings( aPageSettings );
  403. if( IsGalCanvasActive() )
  404. {
  405. PCB_DRAW_PANEL_GAL* drawPanel = static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() );
  406. // Prepare worksheet template
  407. KIGFX::WORKSHEET_VIEWITEM* worksheet;
  408. worksheet = new KIGFX::WORKSHEET_VIEWITEM( &m_Pcb->GetPageSettings(),
  409. &m_Pcb->GetTitleBlock() );
  410. worksheet->SetSheetName( std::string( GetScreenDesc().mb_str() ) );
  411. BASE_SCREEN* screen = GetScreen();
  412. if( screen != NULL )
  413. {
  414. worksheet->SetSheetNumber( screen->m_ScreenNumber );
  415. worksheet->SetSheetCount( screen->m_NumberOfScreens );
  416. }
  417. // PCB_DRAW_PANEL_GAL takes ownership of the worksheet
  418. drawPanel->SetWorksheet( worksheet );
  419. }
  420. }
  421. bool PCB_EDIT_FRAME::isAutoSaveRequired() const
  422. {
  423. if( GetScreen() )
  424. return GetScreen()->IsSave();
  425. return false;
  426. }
  427. void PCB_EDIT_FRAME::setupTools()
  428. {
  429. // Create the manager and dispatcher & route draw panel events to the dispatcher
  430. m_toolManager = new TOOL_MANAGER;
  431. m_toolManager->SetEnvironment( m_Pcb, GetGalCanvas()->GetView(),
  432. GetGalCanvas()->GetViewControls(), this );
  433. m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager );
  434. // Register tools
  435. registerAllTools( m_toolManager );
  436. m_toolManager->ResetTools( TOOL_BASE::RUN );
  437. // Run the selection tool, it is supposed to be always active
  438. m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" );
  439. }
  440. void PCB_EDIT_FRAME::ReFillLayerWidget()
  441. {
  442. m_Layers->ReFill();
  443. wxAuiPaneInfo& lyrs = m_auimgr.GetPane( m_Layers );
  444. wxSize bestz = m_Layers->GetBestSize();
  445. lyrs.MinSize( bestz );
  446. lyrs.BestSize( bestz );
  447. lyrs.FloatingSize( bestz );
  448. if( lyrs.IsDocked() )
  449. m_auimgr.Update();
  450. else
  451. m_Layers->SetSize( bestz );
  452. }
  453. void PCB_EDIT_FRAME::OnQuit( wxCommandEvent& event )
  454. {
  455. Close( false );
  456. }
  457. void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
  458. {
  459. m_canvas->SetAbortRequest( true );
  460. if( GetScreen()->IsModify() )
  461. {
  462. wxString msg = wxString::Format( _(
  463. "Save the changes in\n"
  464. "'%s'\n"
  465. "before closing?" ),
  466. GetChars( GetBoard()->GetFileName() )
  467. );
  468. int ii = DisplayExitDialog( this, msg );
  469. switch( ii )
  470. {
  471. case wxID_CANCEL:
  472. Event.Veto();
  473. return;
  474. case wxID_NO:
  475. break;
  476. case wxID_YES:
  477. // save the board. if the board has no name,
  478. // the ID_SAVE_BOARD_AS will actually made
  479. Files_io_from_id( ID_SAVE_BOARD );
  480. break;
  481. }
  482. }
  483. GetGalCanvas()->StopDrawing();
  484. // Delete the auto save file if it exists.
  485. wxFileName fn = GetBoard()->GetFileName();
  486. // Auto save file name is the normal file name prefixed with a '$'.
  487. fn.SetName( wxT( "$" ) + fn.GetName() );
  488. // Remove the auto save file on a normal close of Pcbnew.
  489. if( fn.FileExists() && !wxRemoveFile( fn.GetFullPath() ) )
  490. {
  491. wxString msg = wxString::Format( _(
  492. "The auto save file '%s' could not be removed!" ),
  493. GetChars( fn.GetFullPath() )
  494. );
  495. wxMessageBox( msg, Pgm().App().GetAppName(), wxOK | wxICON_ERROR, this );
  496. }
  497. // Delete board structs and undo/redo lists, to avoid crash on exit
  498. // when deleting some structs (mainly in undo/redo lists) too late
  499. Clear_Pcb( false );
  500. // do not show the window because ScreenPcb will be deleted and we do not
  501. // want any paint event
  502. Show( false );
  503. Destroy();
  504. }
  505. void PCB_EDIT_FRAME::Show3D_Frame( wxCommandEvent& event )
  506. {
  507. if( m_Draw3DFrame )
  508. {
  509. // Raising the window does not show the window on Windows if iconized.
  510. // This should work on any platform.
  511. if( m_Draw3DFrame->IsIconized() )
  512. m_Draw3DFrame->Iconize( false );
  513. m_Draw3DFrame->Raise();
  514. // Raising the window does not set the focus on Linux. This should work on any platform.
  515. if( wxWindow::FindFocus() != m_Draw3DFrame )
  516. m_Draw3DFrame->SetFocus();
  517. return;
  518. }
  519. m_Draw3DFrame = new EDA_3D_FRAME( &Kiway(), this, _( "3D Viewer" ) );
  520. m_Draw3DFrame->SetDefaultFileName( GetBoard()->GetFileName() );
  521. m_Draw3DFrame->Raise(); // Needed with some Window Managers
  522. m_Draw3DFrame->Show( true );
  523. }
  524. void PCB_EDIT_FRAME::UseGalCanvas( bool aEnable )
  525. {
  526. if( aEnable )
  527. {
  528. BOARD* board = GetBoard();
  529. if( board )
  530. board->GetRatsnest()->ProcessBoard();
  531. }
  532. else
  533. {
  534. Compile_Ratsnest( NULL, true );
  535. }
  536. PCB_BASE_EDIT_FRAME::UseGalCanvas( aEnable );
  537. enableGALSpecificMenus();
  538. }
  539. void PCB_EDIT_FRAME::enableGALSpecificMenus()
  540. {
  541. // some menus are active only in GAL mode and do nothing in legacy mode.
  542. // So enable or disable them, depending on the display mode
  543. if( GetMenuBar() )
  544. {
  545. // Enable / disable some menus which are usable only on GAL
  546. pcbnew_ids id_list[] =
  547. {
  548. ID_MENU_INTERACTIVE_ROUTER_SETTINGS,
  549. ID_DIFF_PAIR_BUTT,
  550. ID_TUNE_SINGLE_TRACK_LEN_BUTT,
  551. ID_TUNE_DIFF_PAIR_LEN_BUTT,
  552. ID_TUNE_DIFF_PAIR_SKEW_BUTT,
  553. ID_MENU_DIFF_PAIR_DIMENSIONS
  554. };
  555. bool enbl = IsGalCanvasActive();
  556. for( unsigned ii = 0; ii < DIM( id_list ); ii++ )
  557. {
  558. if( GetMenuBar()->FindItem( id_list[ii] ) )
  559. GetMenuBar()->FindItem( id_list[ii] )->Enable( enbl );
  560. }
  561. }
  562. }
  563. void PCB_EDIT_FRAME::ShowDesignRulesEditor( wxCommandEvent& event )
  564. {
  565. DIALOG_DESIGN_RULES dR_editor( this );
  566. int returncode = dR_editor.ShowModal();
  567. if( returncode == wxID_OK ) // New rules, or others changes.
  568. {
  569. ReCreateLayerBox();
  570. ReCreateAuxiliaryToolbar();
  571. OnModify();
  572. }
  573. }
  574. void PCB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
  575. {
  576. PCB_BASE_FRAME::LoadSettings( aCfg );
  577. wxConfigLoadSetups( aCfg, GetConfigurationSettings() );
  578. double dtmp;
  579. aCfg->Read( OPTKEY_DEFAULT_LINEWIDTH_VALUE, &dtmp, 0.1 ); // stored in mm
  580. if( dtmp < 0.01 )
  581. dtmp = 0.01;
  582. if( dtmp > 5.0 )
  583. dtmp = 5.0;
  584. g_DrawDefaultLineThickness = Millimeter2iu( dtmp );
  585. long tmp;
  586. aCfg->Read( PCB_SHOW_FULL_RATSNET_OPT, &tmp );
  587. GetBoard()->SetElementVisibility(RATSNEST_VISIBLE, tmp);
  588. aCfg->Read( PCB_MAGNETIC_PADS_OPT, &g_MagneticPadOption );
  589. aCfg->Read( PCB_MAGNETIC_TRACKS_OPT, &g_MagneticTrackOption );
  590. aCfg->Read( SHOW_MICROWAVE_TOOLS, &m_show_microwave_tools );
  591. aCfg->Read( SHOW_LAYER_MANAGER_TOOLS, &m_show_layer_manager_tools );
  592. }
  593. void PCB_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
  594. {
  595. PCB_BASE_FRAME::SaveSettings( aCfg );
  596. wxConfigSaveSetups( aCfg, GetConfigurationSettings() );
  597. // This value is stored in mm )
  598. aCfg->Write( OPTKEY_DEFAULT_LINEWIDTH_VALUE,
  599. MM_PER_IU * g_DrawDefaultLineThickness );
  600. long tmp = GetBoard()->IsElementVisible(RATSNEST_VISIBLE);
  601. aCfg->Write( PCB_SHOW_FULL_RATSNET_OPT, tmp );
  602. aCfg->Write( PCB_MAGNETIC_PADS_OPT, (long) g_MagneticPadOption );
  603. aCfg->Write( PCB_MAGNETIC_TRACKS_OPT, (long) g_MagneticTrackOption );
  604. aCfg->Write( SHOW_MICROWAVE_TOOLS, (long) m_show_microwave_tools );
  605. aCfg->Write( SHOW_LAYER_MANAGER_TOOLS, (long)m_show_layer_manager_tools );
  606. }
  607. bool PCB_EDIT_FRAME::IsGridVisible() const
  608. {
  609. return IsElementVisible( GRID_VISIBLE );
  610. }
  611. void PCB_EDIT_FRAME::SetGridVisibility(bool aVisible)
  612. {
  613. SetElementVisibility( GRID_VISIBLE, aVisible );
  614. }
  615. EDA_COLOR_T PCB_EDIT_FRAME::GetGridColor() const
  616. {
  617. return GetBoard()->GetVisibleElementColor( GRID_VISIBLE );
  618. }
  619. void PCB_EDIT_FRAME::SetGridColor( EDA_COLOR_T aColor )
  620. {
  621. GetBoard()->SetVisibleElementColor( GRID_VISIBLE, aColor );
  622. }
  623. void PCB_EDIT_FRAME::SetCursorShape( int aCursorShape )
  624. {
  625. const unsigned int BIG_CURSOR = 8000;
  626. const unsigned int SMALL_CURSOR = 80;
  627. EDA_DRAW_FRAME::SetCursorShape( aCursorShape );
  628. KIGFX::GAL* gal = GetGalCanvas()->GetGAL();
  629. if( gal )
  630. gal->SetCursorSize( aCursorShape ? BIG_CURSOR : SMALL_CURSOR );
  631. }
  632. bool PCB_EDIT_FRAME::IsMicroViaAcceptable()
  633. {
  634. int copperlayercnt = GetBoard()->GetCopperLayerCount( );
  635. LAYER_ID currLayer = GetActiveLayer();
  636. if( !GetDesignSettings().m_MicroViasAllowed )
  637. return false; // Obvious..
  638. if( copperlayercnt < 4 )
  639. return false; // Only on multilayer boards..
  640. if( ( currLayer == B_Cu )
  641. || ( currLayer == F_Cu )
  642. || ( currLayer == copperlayercnt - 2 )
  643. || ( currLayer == In1_Cu ) )
  644. return true;
  645. return false;
  646. }
  647. void PCB_EDIT_FRAME::SetActiveLayer( LAYER_ID aLayer )
  648. {
  649. PCB_BASE_FRAME::SetActiveLayer( aLayer );
  650. GetGalCanvas()->SetHighContrastLayer( aLayer );
  651. syncLayerWidgetLayer();
  652. if( IsGalCanvasActive() )
  653. {
  654. m_toolManager->RunAction( COMMON_ACTIONS::layerChanged ); // notify other tools
  655. GetGalCanvas()->SetFocus(); // otherwise hotkeys are stuck somewhere
  656. GetGalCanvas()->Refresh();
  657. }
  658. }
  659. void PCB_EDIT_FRAME::syncLayerWidgetLayer()
  660. {
  661. m_Layers->SelectLayer( GetActiveLayer() );
  662. m_Layers->OnLayerSelected();
  663. }
  664. void PCB_EDIT_FRAME::syncRenderStates()
  665. {
  666. m_Layers->SyncRenderStates();
  667. }
  668. void PCB_EDIT_FRAME::syncLayerVisibilities()
  669. {
  670. m_Layers->SyncLayerVisibilities();
  671. static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->SyncLayersVisibility( m_Pcb );
  672. }
  673. void PCB_EDIT_FRAME::unitsChangeRefresh()
  674. {
  675. PCB_BASE_FRAME::unitsChangeRefresh(); // Update the grid size select box.
  676. ReCreateAuxiliaryToolbar();
  677. }
  678. bool PCB_EDIT_FRAME::IsElementVisible( int aElement ) const
  679. {
  680. return GetBoard()->IsElementVisible( aElement );
  681. }
  682. void PCB_EDIT_FRAME::SetElementVisibility( int aElement, bool aNewState )
  683. {
  684. GetGalCanvas()->GetView()->SetLayerVisible( ITEM_GAL_LAYER( aElement ), aNewState );
  685. GetBoard()->SetElementVisibility( aElement, aNewState );
  686. m_Layers->SetRenderState( aElement, aNewState );
  687. }
  688. void PCB_EDIT_FRAME::SetVisibleAlls()
  689. {
  690. GetBoard()->SetVisibleAlls();
  691. for( int ii = 0; ii < PCB_VISIBLE( END_PCB_VISIBLE_LIST ); ii++ )
  692. m_Layers->SetRenderState( ii, true );
  693. }
  694. void PCB_EDIT_FRAME::ShowChangedLanguage()
  695. {
  696. // call my base class
  697. PCB_BASE_FRAME::ShowChangedLanguage();
  698. m_Layers->SetLayersManagerTabsText();
  699. wxAuiPaneInfo& pane_info = m_auimgr.GetPane( m_Layers );
  700. pane_info.Caption( _( "Visibles" ) );
  701. m_auimgr.Update();
  702. ReFillLayerWidget();
  703. }
  704. wxString PCB_EDIT_FRAME::GetLastNetListRead()
  705. {
  706. wxFileName absoluteFileName = m_lastNetListRead;
  707. wxFileName pcbFileName = GetBoard()->GetFileName();
  708. if( !absoluteFileName.MakeAbsolute( pcbFileName.GetPath() ) || !absoluteFileName.FileExists() )
  709. {
  710. absoluteFileName.Clear();
  711. m_lastNetListRead = wxEmptyString;
  712. }
  713. return absoluteFileName.GetFullPath();
  714. }
  715. void PCB_EDIT_FRAME::SetLastNetListRead( const wxString& aLastNetListRead )
  716. {
  717. wxFileName relativeFileName = aLastNetListRead;
  718. wxFileName pcbFileName = GetBoard()->GetFileName();
  719. if( relativeFileName.MakeRelativeTo( pcbFileName.GetPath() )
  720. && relativeFileName.GetFullPath() != aLastNetListRead )
  721. {
  722. m_lastNetListRead = relativeFileName.GetFullPath();
  723. }
  724. }
  725. void PCB_EDIT_FRAME::OnModify( )
  726. {
  727. PCB_BASE_FRAME::OnModify();
  728. if( m_Draw3DFrame )
  729. m_Draw3DFrame->ReloadRequest();
  730. }
  731. void PCB_EDIT_FRAME::SVG_Print( wxCommandEvent& event )
  732. {
  733. PCB_PLOT_PARAMS tmp = GetPlotSettings();
  734. // we don't want dialogs knowing about complex wxFrame functions so
  735. // pass everything the dialog needs without reference to *this frame's class.
  736. if( InvokeSVGPrint( this, GetBoard(), &tmp ) )
  737. {
  738. if( tmp != GetPlotSettings() )
  739. {
  740. SetPlotSettings( tmp );
  741. OnModify();
  742. }
  743. }
  744. }
  745. void PCB_EDIT_FRAME::UpdateTitle()
  746. {
  747. wxFileName fileName = GetBoard()->GetFileName();
  748. wxString title = wxString::Format( wxT( "Pcbnew %s " ), GetChars( GetBuildVersion() ) );
  749. if( fileName.IsOk() && fileName.FileExists() )
  750. {
  751. title << fileName.GetFullPath();
  752. if( !fileName.IsFileWritable() )
  753. title << _( " [Read Only]" );
  754. }
  755. else
  756. {
  757. title << _( " [new file]" ) << wxT(" ") << fileName.GetFullPath();
  758. }
  759. SetTitle( title );
  760. }
  761. wxSize PYTHON_CONSOLE_FRAME::m_frameSize; ///< The size of the PYTHON_CONSOLE_FRAME frame, stored during a session
  762. wxPoint PYTHON_CONSOLE_FRAME::m_framePos; ///< The position ofPYTHON_CONSOLE_FRAME the frame, stored during a session
  763. void PCB_EDIT_FRAME::ScriptingConsoleEnableDisable( wxCommandEvent& aEvent )
  764. {
  765. wxWindow * pythonPanelFrame = findPythonConsole();
  766. bool pythonPanelShown = true;
  767. if( pythonPanelFrame == NULL )
  768. pythonPanelFrame = new PYTHON_CONSOLE_FRAME( this, pythonConsoleNameId() );
  769. else
  770. pythonPanelShown = ! pythonPanelFrame->IsShown();
  771. pythonPanelFrame->Show( pythonPanelShown );
  772. }
  773. void PCB_EDIT_FRAME::OnSelectAutoPlaceMode( wxCommandEvent& aEvent )
  774. {
  775. // Automatic placement of modules and tracks is a mutually exclusive operation so
  776. // clear the other tool if one of the two is selected.
  777. // Be careful: this event function is called both by the
  778. // ID_TOOLBARH_PCB_MODE_MODULE and the ID_TOOLBARH_PCB_MODE_TRACKS tool
  779. // Therefore we should avoid a race condition when deselecting one of these tools
  780. // inside this function (seems happen on some Linux/wxWidgets versions)
  781. // when the other tool is selected
  782. switch( aEvent.GetId() )
  783. {
  784. case ID_TOOLBARH_PCB_MODE_MODULE:
  785. if( aEvent.IsChecked() &&
  786. m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_TRACKS ) )
  787. {
  788. m_mainToolBar->ToggleTool( ID_TOOLBARH_PCB_MODE_TRACKS, false );
  789. }
  790. break;
  791. case ID_TOOLBARH_PCB_MODE_TRACKS:
  792. if( aEvent.IsChecked() &&
  793. m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_MODULE ) )
  794. {
  795. m_mainToolBar->ToggleTool( ID_TOOLBARH_PCB_MODE_MODULE, false );
  796. }
  797. break;
  798. }
  799. }
  800. void PCB_EDIT_FRAME::OnLayerColorChange( wxCommandEvent& aEvent )
  801. {
  802. ReCreateLayerBox();
  803. }
  804. void PCB_EDIT_FRAME::ToPlotter( wxCommandEvent& event )
  805. {
  806. DIALOG_PLOT dlg( this );
  807. dlg.ShowModal();
  808. }
  809. bool PCB_EDIT_FRAME::SetCurrentNetClass( const wxString& aNetClassName )
  810. {
  811. bool change = GetDesignSettings().SetCurrentNetClass( aNetClassName );
  812. if( change )
  813. {
  814. ReCreateAuxiliaryToolbar();
  815. }
  816. return change;
  817. }
  818. void PCB_EDIT_FRAME::OnConfigurePaths( wxCommandEvent& aEvent )
  819. {
  820. Pgm().ConfigurePaths( this );
  821. }