1 /* $XConsortium: UndoCmd.C /main/3 1995/11/06 16:02:46 rswiston $ */
5 * RESTRICTED CONFIDENTIAL INFORMATION:
7 * The information in this document is subject to special
8 * restrictions in a confidential disclosure agreement bertween
9 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
10 * document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
11 * Sun's specific written approval. This documment and all copies
12 * and derivative works thereof must be returned or destroyed at
15 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
19 ///////////////////////////////////////////////////////////////////////////////
20 //////////////////////////////////////////////////////////////////////////////
21 // This example code is from the book:
23 // Object-Oriented Programming with C++ and OSF/Motif
26 // Prentice Hall, 1992
29 // Copyright 1991 by Prentice Hall
30 // All Rights Reserved
32 // Permission to use, copy, modify, and distribute this software for
33 // any purpose except publication and without fee is hereby granted, provided
34 // that the above copyright notice appear in all copies of the software.
35 ///////////////////////////////////////////////////////////////////////////////
36 //////////////////////////////////////////////////////////////////////////////
39 //////////////////////////////////////////////////////////
40 // UndoCmd.C: An interface to undoing the last command
41 //////////////////////////////////////////////////////////
46 // Declare a global object: theUndoCmd
48 UndoCmd *theUndoCmd = new UndoCmd ( "Undo", "Undo" );
50 UndoCmd::UndoCmd ( char *name, char *label ) : NoUndoCmd ( name, label, 0 )
57 // If there is a current command, undo it
59 if ( _lastCmd != NULL )
61 // Undo the previous command
65 _lastCmd = NULL; // Make sure we can't undo twice