Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / dtmail / MotifApp / MotifCmds.C
1 /* $TOG: MotifCmds.C /main/5 1998/09/21 18:49:41 mgreess $ */
2 /*
3  *+SNOTICE
4  *
5  *      RESTRICTED CONFIDENTIAL INFORMATION:
6  *      
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
13  *      Sun's request.
14  *
15  *      Copyright 1993 Sun Microsystems, Inc.  All rights reserved.
16  *
17  *+ENOTICE
18  */
19 #include "MotifCmds.h"
20
21 SeparatorCmd::SeparatorCmd ( 
22     char *name, 
23     char *,
24     int active 
25 ) : Cmd ( name, NULL, active )
26 {
27 }
28
29
30 void
31 SeparatorCmd::doit()
32 {
33 }
34
35
36 void
37 SeparatorCmd::undoit()
38 {
39
40 }
41
42
43 ToggleButtonCmd::ToggleButtonCmd ( 
44     char *name, 
45     char *label,
46     int active,
47     Boolean visible_when_off,
48     unsigned char indicator_type
49 ) : Cmd ( name, label, active )
50 {
51     _indicator_type = indicator_type;
52     _visible_when_off = visible_when_off;
53 }
54
55
56 void
57 ToggleButtonCmd::doit()
58 {
59 }
60
61
62 void
63 ToggleButtonCmd::undoit()
64 {
65
66 }
67
68
69 // Returns TRUE if button is ON, FALSE if OFF.
70
71 Boolean
72 ToggleButtonCmd::getButtonState()
73 {
74    CmdInterface *ci;
75    Widget toggleButton;
76
77    if (!_ci) return(NULL);
78
79    ci = _ci[0];
80
81    toggleButton = ci->baseWidget();
82
83    return (XmToggleButtonGetState(toggleButton));
84
85 }
86
87 void
88 ToggleButtonCmd::setButtonState(
89     Boolean state,
90     Boolean notify
91 )
92 {
93     
94     CmdInterface *ci;
95     Widget toggleButton;
96
97     if (!_ci) return;
98
99     ci = _ci[0];
100
101     if (ci) {
102         toggleButton = ci->baseWidget();
103
104         XmToggleButtonSetState(toggleButton, state, notify);
105     }
106 }
107
108 #ifndef CAN_INLINE_VIRTUALS
109 const char *const
110 ToggleButtonCmd::className( void )
111 {
112     return "ToggleButtonCmd";
113 }
114 #endif /* ! CAN_INLINE_VIRTUALS */
115
116 unsigned char
117 ToggleButtonCmd::indicatorType( void )
118 {
119     return _indicator_type;
120 }
121
122 Boolean
123 ToggleButtonCmd::visibleWhenOff( void )
124 {
125     return _visible_when_off;
126 }