VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "UndoCommand"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'Klasa UndoCommand
Implements Command
Private undoList As Collection
'-----
Public Sub init()
  Set undoList = New Collection
End Sub
'-----
Public Sub add(cmd As Command)
  If Not (cmd.isUndo) Then
    undoList.add cmd
  End If
End Sub
'-----
Private Sub Command_Execute()
  Dim Index As Integer
  Dim cmd As Command
  Index = undoList.Count
  If undoList.Count > 0 Then
    Set cmd = undoList(Index)
    cmd.Undo
    undoList.Remove Index
  End If
End Sub
'-----
Private Function Command_isUndo() As Boolean
  Command_isUndo = True
End Function
'-----
Private Sub Command_Undo()
  'Pusta
End Sub
