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.

412 lines
14 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
12 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2013 CERN
  5. * Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
  6. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version 2
  11. * of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, you may find one here:
  20. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  21. * or you may search the http://www.gnu.org website for the version 2 license,
  22. * or you may write to the Free Software Foundation, Inc.,
  23. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  24. */
  25. /**
  26. * @file pl_editor_frame.h
  27. */
  28. #ifndef _PL_EDITOR_FRAME_H
  29. #define _PL_EDITOR_FRAME_H
  30. #include <config_params.h>
  31. #include <draw_frame.h>
  32. #include <class_drawpanel.h>
  33. #include <class_pl_editor_screen.h>
  34. #include <class_pl_editor_layout.h>
  35. class PROPERTIES_FRAME;
  36. class DESIGN_TREE_FRAME;
  37. class WORKSHEET_DATAITEM;
  38. /**
  39. * Class PL_EDITOR_FRAME
  40. * is the main window used in the page layout editor.
  41. */
  42. #define PL_EDITOR_FRAME_NAME wxT( "PlEditorFrame" )
  43. class PL_EDITOR_FRAME : public EDA_DRAW_FRAME
  44. {
  45. PL_EDITOR_LAYOUT m_pageLayout;
  46. int m_designTreeWidth; // the last width (in pixels) of m_treePagelayout
  47. int m_propertiesFrameWidth; // the last width (in pixels) of m_propertiesPagelayout
  48. wxChoice* m_originSelectBox; // Corner origin choice for coordinates
  49. int m_originSelectChoice; // the last choice for m_originSelectBox
  50. wxChoice* m_pageSelectBox; // The page number sel'ector (page 1 or other pages
  51. // usefull when there are some items which are
  52. // only on page 1, not on page 1
  53. wxPoint m_grid_origin;
  54. protected:
  55. /// The last filename chosen to be proposed to the user
  56. wxString m_lastFileName;
  57. DESIGN_TREE_FRAME* m_treePagelayout;
  58. PROPERTIES_FRAME* m_propertiesPagelayout;
  59. private:
  60. // list of PARAM_CFG_xxx to read/write parameters saved in config
  61. PARAM_CFG_ARRAY m_configSettings;
  62. public:
  63. PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent );
  64. ~PL_EDITOR_FRAME();
  65. bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl ) override;
  66. /**
  67. * Function LoadPageLayoutDescrFile
  68. * Loads a .kicad_wks page layout descr file
  69. * @param aFullFileName = the filename.
  70. */
  71. bool LoadPageLayoutDescrFile( const wxString& aFullFileName );
  72. /**
  73. * Function SavePageLayoutDescrFile
  74. * Save the current layout in a .kicad_wks page layout descr file
  75. * @param aFullFileName = the filename.
  76. */
  77. bool SavePageLayoutDescrFile( const wxString& aFullFileName );
  78. /**
  79. * Function InsertPageLayoutDescrFile
  80. * Loads a .kicad_wks page layout descr file, and add items
  81. * to the current layout list
  82. * @param aFullFileName = the filename.
  83. */
  84. bool InsertPageLayoutDescrFile( const wxString& aFullFileName );
  85. void OnCloseWindow( wxCloseEvent& Event );
  86. // Virtual basic functions:
  87. void RedrawActiveWindow( wxDC* DC, bool EraseBg ) override;
  88. void ReCreateHToolbar() override;
  89. void SetPageSettings(const PAGE_INFO&) override;
  90. const PAGE_INFO& GetPageSettings () const override;
  91. const wxSize GetPageSizeIU() const override;
  92. /**
  93. * Function GetZoomLevelIndicator
  94. * returns a human readable value which can be displayed as zoom
  95. * level indicator in dialogs.
  96. * Virtual from the base class
  97. */
  98. const wxString GetZoomLevelIndicator() const override;
  99. PL_EDITOR_SCREEN* GetScreen() const override
  100. {
  101. return (PL_EDITOR_SCREEN*) EDA_DRAW_FRAME::GetScreen();
  102. }
  103. const wxPoint& GetAuxOrigin() const override
  104. {
  105. static wxPoint dummy; // ( 0,0 );
  106. return dummy;
  107. }
  108. void SetAuxOrigin( const wxPoint& aPosition ) override {}
  109. const wxPoint& GetGridOrigin() const override
  110. {
  111. return m_grid_origin;
  112. }
  113. void SetGridOrigin( const wxPoint& aPoint ) override
  114. {
  115. m_grid_origin = aPoint;
  116. }
  117. const TITLE_BLOCK& GetTitleBlock() const override;
  118. void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) override;
  119. void UpdateStatusBar() override;
  120. /**
  121. * Must be called to initialize parameters when a new page layout
  122. * description is loaded
  123. */
  124. void OnNewPageLayout();
  125. /**
  126. * creates or updates the right vertical toolbar.
  127. * @note This is currently not used.
  128. */
  129. void ReCreateVToolbar() override;
  130. /**
  131. * Create or update the left vertical toolbar (option toolbar
  132. * @note This is currently not used.
  133. */
  134. void ReCreateOptToolbar();
  135. void ReCreateMenuBar() override;
  136. void OnLeftClick( wxDC* aDC, const wxPoint& aMousePos ) override;
  137. void OnLeftDClick( wxDC* aDC, const wxPoint& aMousePos ) override;
  138. bool OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) override;
  139. double BestZoom() override;
  140. // Events created by clicking on the design tree list:
  141. void OnTreeSelection( wxTreeEvent& event );
  142. void OnTreeMiddleClick( wxTreeEvent& event );
  143. void OnTreeRightClick( wxTreeEvent& event );
  144. const PL_EDITOR_LAYOUT& GetPageLayout() const { return m_pageLayout; }
  145. /**
  146. * Page layout editor can show the title block using a page number
  147. * 1 or an other number.
  148. * This is because some items can be shown (or not) only on page 1
  149. * (a feature which look like word processing option
  150. * "page 1 differs from other pages".
  151. * @return true if the page 1 is selected, and false if not
  152. */
  153. bool GetPageNumberOption() const
  154. {
  155. return m_pageSelectBox->GetSelection() == 0;
  156. }
  157. /**
  158. * Displays the short filename (if exists) loaded file
  159. * on the caption of the main window
  160. */
  161. void UpdateTitleAndInfo();
  162. /**
  163. * Populates the applicatios settings list.
  164. * (list of parameters that must be saved in project parameters)
  165. * Currently, only the settings that are needed at start up by the main window are
  166. * defined here. There are other locally used settings scattered throughout the
  167. * source code (mainly in dialogs). If you need to define a configuration
  168. * setting that need to be loaded at run time, this is the place to define it.
  169. */
  170. PARAM_CFG_ARRAY& GetConfigurationSettings( void );
  171. void LoadSettings( wxConfigBase* aCfg ) override;
  172. void SaveSettings( wxConfigBase* aCfg ) override;
  173. void Process_Special_Functions( wxCommandEvent& event );
  174. void OnSelectOptionToolbar( wxCommandEvent& event );
  175. /**
  176. * called when the user select one of the 4 page corner as corner
  177. * reference (or the left top paper corner)
  178. */
  179. void OnSelectCoordOriginCorner( wxCommandEvent& event );
  180. /**
  181. * Toggle the display mode between the normal mode and the editor mode:
  182. * In normal mode, title block texts are shown like they will be
  183. * shown in other kicad applications: the format symbols in texts
  184. * are replaced by the actual text.
  185. * In editor mode, the format symbols in texts are not replaced
  186. * by the actual text, and therefore format symbols are displayed.
  187. */
  188. void OnSelectTitleBlockDisplayMode( wxCommandEvent& event );
  189. void OnUpdateTitleBlockDisplayNormalMode( wxUpdateUIEvent& event );
  190. void OnUpdateTitleBlockDisplaySpecialMode( wxUpdateUIEvent& event );
  191. void OnUpdateSelectTool( wxUpdateUIEvent& aEvent );
  192. /**
  193. * Function BlockCommand
  194. * returns the block command (BLOCK_MOVE, BLOCK_COPY...) corresponding to
  195. * the \a aKey (ALT, SHIFT ALT ..)
  196. */
  197. virtual int BlockCommand( EDA_KEY key ) override;
  198. /**
  199. * Function HandleBlockPlace
  200. * handles the block place command.
  201. */
  202. virtual void HandleBlockPlace( wxDC* DC ) override;
  203. /**
  204. * Function HandleBlockEnd( )
  205. * handles the end of a block command,
  206. * It is called at the end of the definition of the area of a block.
  207. * Depending on the current block command, this command is executed
  208. * or parameters are initialized to prepare a call to HandleBlockPlace
  209. * in GetScreen()->m_BlockLocate
  210. *
  211. * @return false if no item selected, or command finished,
  212. * true if some items found and HandleBlockPlace must be called later.
  213. */
  214. virtual bool HandleBlockEnd( wxDC* DC ) override;
  215. /**
  216. * Function Block_Move
  217. * moves all items within the selected block.
  218. * New location is determined by the current offset from the selected
  219. * block's original location.
  220. *
  221. * @param DC A device context to draw on.
  222. */
  223. void Block_Move( wxDC* DC );
  224. /**
  225. * Function OnQuit
  226. * called on request of application quit
  227. */
  228. void OnQuit( wxCommandEvent& event );
  229. ///> @copydoc EDA_DRAW_FRAME::GetHotKeyDescription()
  230. EDA_HOTKEY* GetHotKeyDescription( int aCommand ) const override;
  231. /**
  232. * Function OnHotKey.
  233. * ** Commands are case insensitive **
  234. * Some commands are relatives to the item under the mouse cursor
  235. * @param aDC = current device context
  236. * @param aHotkeyCode = hotkey code (ascii or wxWidget code for special keys)
  237. * @param aPosition The cursor position in logical (drawing) units.
  238. * @param aItem = NULL or pointer on a EDA_ITEM under the mouse cursor
  239. */
  240. bool OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosition, EDA_ITEM* aItem = NULL ) override;
  241. void Process_Settings( wxCommandEvent& event );
  242. void Process_Config( wxCommandEvent& event );
  243. /**
  244. * Function ToPlotter
  245. * Open a dialog frame to create plot and drill files
  246. * relative to the current board
  247. */
  248. void ToPlotter( wxCommandEvent& event );
  249. /**
  250. * Function ToPrinter
  251. * Open a dialog frame to print layers
  252. */
  253. void ToPrinter( wxCommandEvent& event );
  254. void Files_io( wxCommandEvent& event );
  255. bool GeneralControl( wxDC* aDC, const wxPoint& aPosition, EDA_KEY aHotKey = 0 ) override;
  256. /** Virtual function PrintPage
  257. * used to print a page
  258. * @param aDC = wxDC given by the calling print function
  259. * @param aPrintMasklayer = a 32 bits mask: bit n = 1 -> layer n is printed
  260. * @param aPrintMirrorMode = not used here (Set when printing in mirror mode)
  261. * @param aData = a pointer on an auxiliary data (not always used, NULL if not used)
  262. */
  263. virtual void PrintPage( wxDC* aDC, LSET aPrintMasklayer,
  264. bool aPrintMirrorMode, void * aData ) override;
  265. void OnFileHistory( wxCommandEvent& event );
  266. /**
  267. * @return the filename of the current layout descr file
  268. * If this is the default (no loaded file) returns a emtpy name
  269. * or a new design.
  270. */
  271. const wxString& GetCurrFileName() const;
  272. /**
  273. * Stores the current layout descr file filename
  274. */
  275. void SetCurrFileName( const wxString& aName );
  276. /**
  277. * Function RebuildDesignTree
  278. * Re creates the design graphic tree list items,
  279. * and ensures each item has an unique name
  280. */
  281. void RebuildDesignTree();
  282. /**
  283. * Function AddPageLayoutItem
  284. * Add a new item to the page layout item list.
  285. * @param aType = the type of item:
  286. * WS_TEXT, WS_SEGMENT, WS_RECT, WS_POLYPOLYGON
  287. * @param aIdx = the position in list to insert the new item.
  288. * @return a reference to the new item
  289. */
  290. WORKSHEET_DATAITEM * AddPageLayoutItem( int aType, int aIdx = -1 );
  291. /**
  292. * Function GetSelectedItem
  293. * @return the current selected item, or NULL
  294. */
  295. WORKSHEET_DATAITEM * GetSelectedItem();
  296. /**
  297. * Function Locate
  298. * @return the page layout item found at position aPosition
  299. * @param aPosition = the position (in user units) of the reference point
  300. */
  301. WORKSHEET_DATAITEM *Locate( const wxPoint& aPosition );
  302. /**
  303. * Initialize a move item command
  304. * @param aItem is the item to move
  305. */
  306. void MoveItem( WORKSHEET_DATAITEM* aItem );
  307. /**
  308. * Save in Undo list the layout, and place an item being moved.
  309. * @param aItem is the item moved
  310. */
  311. void PlaceItem( WORKSHEET_DATAITEM* aItem );
  312. /**
  313. * Must be called after a change
  314. * in order to set the "modify" flag of the current screen
  315. */
  316. void OnModify()
  317. {
  318. GetScreen()->SetModify();
  319. }
  320. /**
  321. * Save a copy of the description (in a S expr string)
  322. * for Undo/redo commands
  323. */
  324. void SaveCopyInUndoList();
  325. /** Redo the last edition:
  326. * - Place the current edited layout in undo list
  327. * - Get the previous version of the current edited layput
  328. */
  329. void GetLayoutFromRedoList( wxCommandEvent& event );
  330. /** Undo the last edition:
  331. * - Place the current layout in Redo list
  332. * - Get the previous version of the current edited layout
  333. */
  334. void GetLayoutFromUndoList( wxCommandEvent& event );
  335. /**
  336. * Remove the last command in Undo List.
  337. * Used to clean the Undo stack after a cancel command
  338. */
  339. void RemoveLastCommandInUndoList();
  340. DECLARE_EVENT_TABLE()
  341. };
  342. #endif /* _PL_EDITOR_FRAME_H */