Container class that manages stored canvas states (canvas snapshots) and implements basic Undo/Redo functionality.  
 More...
#include <CanvasHistory.h>
Container class that manages stored canvas states (canvas snapshots) and implements basic Undo/Redo functionality. 
Two different working modes are available: 'histUSE_SERIALIZATION' mode uses basic serialization functionality encapsulated by a diagram manager for storing of current canvas content, but in the 'histUSE_CLONING' mode full copy of diagram manager content is done via its copy constructor. The first mode is slower than the second one, but do not require implementation of xsSerializable::Clone() virtual function in all classes derived from xsSerializable like the second posible working mode. 
- See also
- wxSFCanvasState, wxSFCanvasHistory::MODE, xsSerializable::Clone, wxXmlSerializer::CopyItems 
◆ MODE
| Enumerator | 
|---|
| histUSE_SERIALIZATION | Use serialization for storing of a canvas content.  | 
| histUSE_CLONING | Use diagram manager's copy constructor for storing of a canvas content.  | 
 
 
◆ wxSFCanvasHistory() [1/2]
Default constructor. 
- Parameters
- 
  
    | hmode | Working mode (see MODE enumeration for more details) |  
 
 
 
◆ wxSFCanvasHistory() [2/2]
User constructor. 
- Parameters
- 
  
    | canvas | Pointer to managed canvas |  | hmode | Working mode (see MODE enumeration for more details) |  
 
- See also
- MODE 
 
 
◆ ~wxSFCanvasHistory()
      
        
          | wxSFCanvasHistory::~wxSFCanvasHistory | ( | void |  | ) |  | 
      
 
 
◆ CanRedo()
      
        
          | bool wxSFCanvasHistory::CanRedo | ( |  | ) |  | 
      
 
The function gives information whether the 'Redo' operation is available (exists any stored canvas state newer than the current one. 
- Returns
- TRUE if the 'Undo' operation can be performed, otherwise FALSE 
 
 
◆ CanUndo()
      
        
          | bool wxSFCanvasHistory::CanUndo | ( |  | ) |  | 
      
 
The function gives information whether the 'Undo' operation is available (exists any stored canvas state older than the current one. 
- Returns
- TRUE if the 'Undo' operation can be performed, otherwise FALSE 
 
 
◆ Clear()
      
        
          | void wxSFCanvasHistory::Clear | ( |  | ) |  | 
      
 
Clear all canvas history. 
 
 
◆ GetHistoryDepth()
  
  | 
        
          | size_t wxSFCanvasHistory::GetHistoryDepth | ( |  | ) |  |  | inline | 
 
Get total number of canvas states which can be stored at the same time. 
- Returns
- Number of allowed concuretly stored canvas states 
- See also
- SetHistoryDepth 
 
 
◆ GetMode()
  
  | 
        
          | MODE wxSFCanvasHistory::GetMode | ( |  | ) |  |  | inline | 
 
Get currently used working mode. 
 
 
◆ RestoreNewerState()
      
        
          | void wxSFCanvasHistory::RestoreNewerState | ( |  | ) |  | 
      
 
Perform the 'Redo' operation. 
 
 
◆ RestoreOlderState()
      
        
          | void wxSFCanvasHistory::RestoreOlderState | ( |  | ) |  | 
      
 
Perform the 'Undo' operation. 
 
 
◆ SaveCanvasState()
      
        
          | void wxSFCanvasHistory::SaveCanvasState | ( |  | ) |  | 
      
 
Save current canvas state. 
 
 
◆ SetHistoryDepth()
  
  | 
        
          | void wxSFCanvasHistory::SetHistoryDepth | ( | size_t | depth | ) |  |  | inline | 
 
Set total number of stored canvas states. 
- Parameters
- 
  
    | depth | Number of stored canvas states |  
 
- See also
- GetHistoryDepth 
 
 
◆ SetMode()
      
        
          | void wxSFCanvasHistory::SetMode | ( | MODE | hmode | ) |  | 
      
 
Set history working mode. 
For more details about available working modes see the wxSFCanvasHistory class
description. Note that all stored canvas history will be cleared after
usage of this function.
 - Parameters
- 
  
  
- See also
- MODE 
 
 
◆ SetParentCanvas()
Set pointer to the parent shapes canvas. All Undo/Redo operation defined by this class will be performed on this shape canvas instance. 
- Parameters
- 
  
    | canvas | Pointer to parent shape canvas |  
 
 
 
◆ m_lstCanvasStates
  
  | 
        
          | StateList wxSFCanvasHistory::m_lstCanvasStates |  | protected | 
 
 
◆ m_nHistoryDepth
  
  | 
        
          | size_t wxSFCanvasHistory::m_nHistoryDepth |  | protected | 
 
Total allowed amount of stored canvas states. 
 
 
◆ m_nWorkingMode
  
  | 
        
          | MODE wxSFCanvasHistory::m_nWorkingMode |  | protected | 
 
 
◆ m_pCurrentCanvasState
Auxilary pointer to current canvas state. 
 
 
◆ m_pParentCanvas
Pointer to the parent canvas. 
 
 
The documentation for this class was generated from the following file: