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.

311 lines
11 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
* 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) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
  5. * Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version 2
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, you may find one here:
  19. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  20. * or you may search the http://www.gnu.org website for the version 2 license,
  21. * or you may write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  23. */
  24. /**
  25. * @file cvpcb_mainframe.h
  26. */
  27. #ifndef _CVPCB_MAINFRAME_H_
  28. #define _CVPCB_MAINFRAME_H_
  29. #include <wx/listctrl.h>
  30. #include <wx/filename.h>
  31. #include <pcb_netlist.h>
  32. #include <footprint_info.h>
  33. #include <wxBasePcbFrame.h>
  34. #include <config_params.h>
  35. #include <autosel.h>
  36. #include <memory>
  37. /* Forward declarations of all top-level window classes. */
  38. class wxAuiToolBar;
  39. class FOOTPRINTS_LISTBOX;
  40. class COMPONENTS_LISTBOX;
  41. class LIBRARY_LISTBOX;
  42. class DISPLAY_FOOTPRINTS_FRAME;
  43. class COMPONENT;
  44. class FP_LIB_TABLE;
  45. namespace CV { struct IFACE; }
  46. /**
  47. * The CvPcb application main window.
  48. */
  49. class CVPCB_MAINFRAME : public KIWAY_PLAYER
  50. {
  51. friend struct CV::IFACE;
  52. wxArrayString m_footprintListEntries;
  53. wxString m_currentSearchPattern;
  54. bool m_keepCvpcbOpen;
  55. NETLIST m_netlist;
  56. int m_filteringOptions;
  57. wxAuiToolBar* m_mainToolBar;
  58. FOOTPRINTS_LISTBOX* m_footprintListBox;
  59. LIBRARY_LISTBOX* m_libListBox;
  60. COMPONENTS_LISTBOX* m_compListBox;
  61. wxTextCtrl* m_tcFilterString;
  62. public:
  63. wxArrayString m_ModuleLibNames;
  64. wxArrayString m_EquFilesNames;
  65. wxString m_DocModulesFileName;
  66. std::unique_ptr<FOOTPRINT_LIST> m_FootprintsList;
  67. protected:
  68. int m_undefinedComponentCnt;
  69. bool m_modified;
  70. bool m_skipComponentSelect; // true to skip OnSelectComponent event
  71. // (in automatic selection/deletion of associations)
  72. PARAM_CFG_ARRAY m_projectFileParams;
  73. CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent );
  74. public:
  75. ~CVPCB_MAINFRAME();
  76. bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl=0 ) override;
  77. void KiwayMailIn( KIWAY_EXPRESS& aEvent ) override;
  78. /**
  79. * @return a pointer on the Footprint Viewer frame, if exists, or NULL
  80. */
  81. DISPLAY_FOOTPRINTS_FRAME* GetFootprintViewerFrame();
  82. /**
  83. * Function OnSelectComponent
  84. * Called when clicking on a component in component list window
  85. * * Updates the filtered footprint list, if the filtered list option is selected
  86. * * Updates the current selected footprint in footprint list
  87. * * Updates the footprint shown in footprint display window (if opened)
  88. */
  89. void OnSelectComponent( wxListEvent& event );
  90. /**
  91. * Function OnEditFootprintLibraryTable
  92. * displays the footprint library table editing dialog and updates the global and local
  93. * footprint tables accordingly.
  94. */
  95. void OnEditFootprintLibraryTable( wxCommandEvent& event );
  96. void OnQuit( wxCommandEvent& event );
  97. void OnCloseWindow( wxCloseEvent& Event );
  98. void OnSize( wxSizeEvent& SizeEvent );
  99. void ReCreateHToolbar();
  100. virtual void ReCreateMenuBar() override;
  101. void ChangeFocus( bool aMoveRight );
  102. void ToFirstNA( wxCommandEvent& event );
  103. void ToPreviousNA( wxCommandEvent& event );
  104. /**
  105. * Function DelAssociations
  106. * removes all component footprint associations already made
  107. */
  108. void DelAssociations( wxCommandEvent& event );
  109. void SaveQuitCvpcb( wxCommandEvent& event );
  110. void OnConfigurePaths( wxCommandEvent& aEvent );
  111. /**
  112. * Function OnEditEquFilesList
  113. * envokes the equ files list edit dialog.
  114. */
  115. void OnEditEquFilesList( wxCommandEvent& aEvent );
  116. void OnKeepOpenOnSave( wxCommandEvent& event );
  117. void DisplayModule( wxCommandEvent& event );
  118. /**
  119. * Called by the automatic association button
  120. * Read *.equ files to try to find corresponding footprint
  121. * for each component that is not already linked to a footprint ( a "free"
  122. * component )
  123. * format of a line:
  124. * 'cmp_ref' 'footprint_name'
  125. */
  126. void AutomaticFootprintMatching( wxCommandEvent& event );
  127. void DisplayDocFile( wxCommandEvent& event );
  128. /**
  129. * Function OnSelectFilteringFootprint
  130. * is the command event handler for enabling and disabling footprint filtering.
  131. */
  132. void OnSelectFilteringFootprint( wxCommandEvent& event );
  133. /**
  134. * Function OnEnterFilteringText
  135. * Is called each time the text of m_tcFilterString is changed.
  136. */
  137. void OnEnterFilteringText( wxCommandEvent& event );
  138. /**
  139. * Function SetNewPkg
  140. * links the footprint to the current selected component
  141. * and selects the next component.
  142. * @param aFootprintName = the selected footprint
  143. */
  144. void SetNewPkg( const wxString& aFootprintName );
  145. void BuildCmpListBox();
  146. void BuildFOOTPRINTS_LISTBOX();
  147. void BuildLIBRARY_LISTBOX();
  148. /**
  149. * Create or Update the frame showing the current highlighted footprint
  150. * and (if showed) the 3D display frame
  151. */
  152. void CreateScreenCmp();
  153. /**
  154. * Function SaveFootprintAssociation
  155. * saves the edits that the user has done by sending them back to eeschema
  156. * via the kiway.
  157. */
  158. void SaveFootprintAssociation();
  159. /**
  160. * Function ReadNetList
  161. * reads the netlist (.net) file defined by #m_NetlistFileName.
  162. * and the corresponding cmp to footprint (.cmp) link file
  163. * @param aNetlist is the netlist from eeschema in kicad s-expr format.
  164. */
  165. bool ReadNetListAndLinkFiles( const std::string& aNetlist );
  166. int ReadSchematicNetlist( const std::string& aNetlist );
  167. /**
  168. * Function LoadProjectFile
  169. * reads the CvPcb configuration parameter from the project (.pro) file \a aFileName
  170. */
  171. void LoadProjectFile();
  172. /**
  173. * Function SaveProjectFile
  174. * Saves the CvPcb configuration parameter from the project (.pro) file \a aFileName
  175. */
  176. void SaveProjectFile();
  177. void LoadSettings( wxConfigBase* aCfg ) override;
  178. void SaveSettings( wxConfigBase* aCfg ) override;
  179. /**
  180. * Function DisplayStatus
  181. * updates the information displayed on the status bar at bottom of the main frame.
  182. *
  183. * When the library or component list controls have the focus, the footprint assignment
  184. * status of the components is displayed in the first status bar pane and the list of
  185. * filters for the selected component is displayed in the second status bar pane. When
  186. * the footprint list control has the focus, the description of the selected footprint is
  187. * displayed in the first status bar pane and the key words for the selected footprint are
  188. * displayed in the second status bar pane. The third status bar pane always displays the
  189. * current footprint list filtering.
  190. */
  191. void DisplayStatus();
  192. /**
  193. * Function LoadFootprintFiles
  194. * reads the list of footprint (*.mod files) and generate the list of footprints.
  195. * for each module are stored
  196. * the module name
  197. * documentation string
  198. * associated keywords
  199. * m_ModuleLibNames is the list of library that must be read (loaded)
  200. * fills m_footprints
  201. * @return true if libraries are found, false otherwise.
  202. */
  203. bool LoadFootprintFiles();
  204. /**
  205. * Function GetProjectFileParameters
  206. * return project file parameter list for CvPcb.
  207. * <p>
  208. * Populate the project file parameter array specific to CvPcb if it hasn't
  209. * already been populated and return a reference to the array to the caller.
  210. * Creating the parameter list at run time has the advantage of being able
  211. * to define local variables. The old method of statically building the array
  212. * at compile time requiring global variable definitions.
  213. * </p>
  214. *
  215. * @return A reference to a PARAM_CFG_ARRAY contain the project settings for CvPcb.
  216. */
  217. PARAM_CFG_ARRAY& GetProjectFileParameters( void );
  218. /**
  219. * Function UpdateTitle
  220. * sets the main window title bar text.
  221. * <p>
  222. * If no current project open( eeschema run outside kicad manager with no schematic loaded),
  223. * the title is set to the application name appended with "no project".
  224. * Otherwise, the title shows the project name.
  225. */
  226. void UpdateTitle();
  227. /**
  228. * Function SendMessageToEESCHEMA
  229. * Send a remote command to Eeschema via a socket,
  230. * Commands are
  231. * $PART: "reference" put cursor on component anchor
  232. */
  233. void SendMessageToEESCHEMA();
  234. COMPONENT* GetSelectedComponent();
  235. /**
  236. * @return the LIB_ID of the selected footprint in footprint listview
  237. * or a empty string if no selection
  238. */
  239. const wxString GetSelectedFootprint();
  240. private:
  241. // UI event handlers.
  242. // Keep consistent the display state of toggle menus or tools in toolbar
  243. void OnUpdateKeepOpenOnSave( wxUpdateUIEvent& event );
  244. void OnFilterFPbyKeywords( wxUpdateUIEvent& event );
  245. void OnFilterFPbyPinCount( wxUpdateUIEvent& event );
  246. void OnFilterFPbyLibrary( wxUpdateUIEvent& event );
  247. void OnFilterFPbyKeyName( wxUpdateUIEvent& event );
  248. /**
  249. * read the .equ files and populate the list of equvalents
  250. * @param aList the list to populate
  251. * @param aErrorMessages is a pointer to a wxString to store error messages
  252. * (can be NULL)
  253. * @return the error count ( 0 = no error)
  254. */
  255. int buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList, wxString * aErrorMessages = NULL );
  256. void refreshAfterComponentSearch (COMPONENT* component);
  257. DECLARE_EVENT_TABLE()
  258. };
  259. #endif //#ifndef _CVPCB_MAINFRAME_H_