File: TUndo.h

package info (click to toggle)
gentle 1.9+cvs20100605+dfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 12,224 kB
  • ctags: 6,214
  • sloc: cpp: 41,569; ansic: 3,978; sh: 1,420; makefile: 243
file content (44 lines) | stat: -rw-r--r-- 1,308 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/** \file
	\brief The TUndo class
*/
#ifndef _UNDO_H_
#define _UNDO_H_

#include <wx/wx.h>

using namespace std ;

class TVector ;

#ifndef _wxArrayTVector
#define _wxArrayTVector
WX_DEFINE_ARRAY(TVector *, wxArrayTVector);
#endif

/// This class stores TVector objects for the undo function
class TUndo
    {
    public :
    TUndo () ; ///< Constructor
	~TUndo () {} ; ///< Destructor (empty)
    void setbase ( TVector *_base ) ; ///< Set the base TVector
    void start ( wxString _msg = _T("") ) ; ///< Start the undo record, with action name
    void stop () ; ///< End the undo record
    void abort () ; ///< Abort the undo record
    void pop () ; ///< Remove the last undo record
    bool canUndo () ; ///< Is there undo information available?
    wxString getLastMessage () ; ///< Returns the name of the last action with undo information
    void remember ( wxString _msg ) ; ///< Remember the current state and action name
    void clear () ; ///< Remove all undo information
    
    TUndo & operator = ( TUndo &u ) ;
    
    private :
    wxArrayTVector mem ; ///< The old TVector objects
    wxArrayString msg ; ///< The action names
    int cnt ; ///< Internam counter
    TVector *base ; ///< Pointer to the base TVector object
    } ;


#endif