2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: Confirmed.c /main/5 1996/10/15 14:44:45 rswiston $ */
24 /*******************************************************************************
27 Associated Header file: Confirmed.h
28 *******************************************************************************/
34 #include <Xm/MessageB.h>
35 #include <sys/signal.h>
40 #include "CreateActionAppShell.h"
42 #define CONTEXT_MACRO_ACCESS 1
43 #include "Confirmed.h"
44 #undef CONTEXT_MACRO_ACCESS
46 /*******************************************************************************
47 The following are callback functions for Confirmed dialog.
48 *******************************************************************************/
50 /******************************************************************************/
51 /* activateCB_Confirmed_OkButton */
52 /******************************************************************************/
53 void activateCB_Confirmed_OkButton( Widget UxWidget,
54 XtPointer UxClientData,
55 XtPointer UxCallbackArg)
58 XtDestroyWidget(XtParent(UxWidget));
60 /******************************************************************************/
61 /* display_confirmed_message */
63 /* INPUT: Widget parent - parent to position dialog on. */
64 /* char *message - message to display in dialog box */
67 /******************************************************************************/
68 void display_confirmed_message (Widget parent, char *message)
71 Confirmed = XmCreateInformationDialog(parent, "confirmedDialog", NULL, 0);
72 XtUnmanageChild (XmMessageBoxGetChild (Confirmed, XmDIALOG_CANCEL_BUTTON));
73 XtUnmanageChild (XmMessageBoxGetChild (Confirmed, XmDIALOG_HELP_BUTTON));
75 XtAddCallback( Confirmed, XmNokCallback,
76 (XtCallbackProc) activateCB_Confirmed_OkButton,
79 XtVaSetValues (Confirmed,
80 RES_CONVERT(XmNdialogTitle, GETMESSAGE(6, 41, "Create Action - Confirmation")),
81 RES_CONVERT(XmNmessageString, message),
83 XtRealizeWidget(Confirmed);
85 XtManageChild (Confirmed);
88 /*******************************************************************************
89 The following are callback functions for Question dialog
90 *******************************************************************************/
92 /******************************************************************************/
94 /* cancelCB_QuestionDialog */
96 /******************************************************************************/
97 void cancelCB_QuestionDialog(Widget UxWidget,
98 XtPointer UxClientData,
99 XtPointer UxCallbackArg)
101 XtDestroyWidget(XtParent(UxWidget));
104 /******************************************************************************/
106 /* nosaveCB_QuestionDialog */
108 /******************************************************************************/
109 void nosaveCB_QuestionDialog(Widget UxWidget,
110 XtPointer UxClientData,
111 XtPointer UxCallbackArg)
113 XtDestroyWidget(XtParent(UxWidget));
118 /******************************************************************************/
120 /* saveCallbackB_QuestionDialog */
122 /******************************************************************************/
123 void saveCB_QuestionDialog(Widget UxWidget,
124 XtPointer UxClientData,
125 XtPointer UxCallbackArg)
128 XtDestroyWidget(XtParent(UxWidget));
130 /********************************************************************/
131 /* Activate the save routine. */
132 /********************************************************************/
133 activateCB_CA_MB_FileSave((Widget)NULL, (XtPointer)NULL, (XtPointer)NULL);
137 /******************************************************************************/
138 /* display_question_message */
140 /* INPUT: Widget parent - parent to position dialog on. */
141 /* char *message - message to display in dialog box */
144 /******************************************************************************/
145 void display_question_message (Widget parent, char *message,
146 char *button1, XtCallbackProc cb_button1,
147 char *button2, XtCallbackProc cb_button2,
148 char *button3, XtCallbackProc cb_button3)
152 QuestionDialog = XmCreateQuestionDialog(parent, "questionDialog", NULL, 0);
154 tmpw = XmMessageBoxGetChild(QuestionDialog, XmDIALOG_OK_BUTTON);
157 RES_CONVERT( XmNlabelString, button1),
159 XtAddCallback( QuestionDialog, XmNokCallback,
160 (XtCallbackProc) cb_button1,
163 XtUnmanageChild (tmpw);
166 tmpw = XmMessageBoxGetChild(QuestionDialog, XmDIALOG_CANCEL_BUTTON);
169 RES_CONVERT( XmNlabelString, button2),
171 XtAddCallback( QuestionDialog, XmNcancelCallback,
172 (XtCallbackProc) cb_button2,
175 XtUnmanageChild (tmpw);
178 tmpw = XmMessageBoxGetChild(QuestionDialog, XmDIALOG_HELP_BUTTON);
181 RES_CONVERT( XmNlabelString, button3),
183 XtAddCallback( QuestionDialog, XmNhelpCallback,
184 (XtCallbackProc) cb_button3,
187 XtUnmanageChild (tmpw);
190 XtVaSetValues (QuestionDialog,
191 RES_CONVERT(XmNdialogTitle, GETMESSAGE(6, 51, "Create Action - Question")),
192 RES_CONVERT(XmNmessageString, message),
195 XtManageChild (QuestionDialog);
198 /*******************************************************************************
200 *******************************************************************************/