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.

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