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.

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