Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / dtmail / dtmail / NoOpCmd.C
1 /*
2  *+SNOTICE
3  *
4  *      $TOG: NoOpCmd.C /main/5 1998/07/24 16:06:19 mgreess $
5  *
6  *      RESTRICTED CONFIDENTIAL INFORMATION:
7  *      
8  *      The information in this document is subject to special
9  *      restrictions in a confidential disclosure agreement between
10  *      HP, IBM, Sun, USL, SCO and Univel.  Do not distribute this
11  *      document outside HP, IBM, Sun, USL, SCO, or Univel without
12  *      Sun's specific written approval.  This document and all copies
13  *      and derivative works thereof must be returned or destroyed at
14  *      Sun's request.
15  *
16  *      Copyright 1993 Sun Microsystems, Inc.  All rights reserved.
17  *
18  *+ENOTICE
19  */
20
21 ///////////////////////////////////////////////////////////////////////////////
22 //////////////////////////////////////////////////////////////////////////////
23 //         This example code is from the book:
24 //
25 //           Object-Oriented Programming with C++ and OSF/Motif
26 //         by
27 //           Douglas Young
28 //           Prentice Hall, 1992
29 //           ISBN 0-13-630252-1 
30 //
31 //         Copyright 1991 by Prentice Hall
32 //         All Rights Reserved
33 //
34 //  Permission to use, copy, modify, and distribute this software for 
35 //  any purpose except publication and without fee is hereby granted, provided 
36 //  that the above copyright notice appear in all copies of the software.
37 ///////////////////////////////////////////////////////////////////////////////
38 //////////////////////////////////////////////////////////////////////////////
39
40
41 ///////////////////////////////////////////////////////////
42 // NoOpCmd.C: Example, dummy command class
43 //////////////////////////////////////////////////////////
44 #include <stdio.h>
45 #include "EUSDebug.hh"
46 #include "NoOpCmd.h"
47 #include "Application.h"
48
49 void okCallback (void *);
50
51 NoOpCmd::NoOpCmd ( char *name, 
52                    char *label,
53                    int active ) : Cmd ( name, label, active )
54 {
55
56 }
57
58 void NoOpCmd::doit()
59 {
60     // Just print a message that allows us to trace the execution
61     
62     char *buf = new char[1024];
63     char *tmpName;
64
65     tmpName = (char *) name();
66     
67     sprintf(buf, "%s : Sorry, not implemented.", tmpName);
68
69     theInfoDialogManager->post(tmpName, buf, (void *) this,
70                                okCallback);
71
72 //    this->setQuestion(buf);
73 //
74 //    this->execute();
75
76     delete [] buf;
77
78 //    cout <<  name() << ":" << "doit\n" << flush;
79 }      
80
81 void NoOpCmd::undoit()
82 {
83     // Just print a message that allows us to trace the execution
84
85     DebugPrintf(1, "%s:\n", name());
86 }       
87
88
89 void okCallback( void *)
90 {
91     
92 }
93
94 #ifndef CAN_INLINE_VIRTUALS
95 LabelCmd::~LabelCmd(void)
96 {
97 }
98
99 void
100 LabelCmd::doit(void)
101 {
102     return;
103 }
104
105 void
106 LabelCmd::undoit(void)
107 {
108     return;
109 }
110
111 const char *const
112 LabelCmd::className(void)
113 {
114     return "LabelCmd";
115 }
116 #endif /* ! CAN_INLINE_VIRTUALS */