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 librararies 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 *******************************************************************************/
33 #include <Xm/MessageB.h>
34 #include <sys/signal.h>
38 #include "CreateActionAppShell.h"
40 #define CONTEXT_MACRO_ACCESS 1
41 #include "Confirmed.h"
42 #undef CONTEXT_MACRO_ACCESS
44 /*******************************************************************************
45 The following are callback functions for Confirmed dialog.
46 *******************************************************************************/
48 /******************************************************************************/
49 /* activateCB_Confirmed_OkButton */
50 /******************************************************************************/
51 void activateCB_Confirmed_OkButton( Widget UxWidget,
52 XtPointer UxClientData,
53 XtPointer UxCallbackArg)
56 XtDestroyWidget(XtParent(UxWidget));
58 /******************************************************************************/
59 /* display_confirmed_message */
61 /* INPUT: Widget parent - parent to position dialog on. */
62 /* char *message - message to display in dialog box */
65 /******************************************************************************/
66 void display_confirmed_message (Widget parent, char *message)
69 Confirmed = XmCreateInformationDialog(parent, "confirmedDialog", NULL, 0);
70 XtUnmanageChild (XmMessageBoxGetChild (Confirmed, XmDIALOG_CANCEL_BUTTON));
71 XtUnmanageChild (XmMessageBoxGetChild (Confirmed, XmDIALOG_HELP_BUTTON));
73 XtAddCallback( Confirmed, XmNokCallback,
74 (XtCallbackProc) activateCB_Confirmed_OkButton,
77 XtVaSetValues (Confirmed,
78 RES_CONVERT(XmNdialogTitle, GETMESSAGE(6, 41, "Create Action - Confirmation")),
79 RES_CONVERT(XmNmessageString, message),
81 XtRealizeWidget(Confirmed);
83 XtManageChild (Confirmed);
86 /*******************************************************************************
87 The following are callback functions for Question dialog
88 *******************************************************************************/
90 /******************************************************************************/
92 /* cancelCB_QuestionDialog */
94 /******************************************************************************/
95 void cancelCB_QuestionDialog(Widget UxWidget,
96 XtPointer UxClientData,
97 XtPointer UxCallbackArg)
99 XtDestroyWidget(XtParent(UxWidget));
102 /******************************************************************************/
104 /* nosaveCB_QuestionDialog */
106 /******************************************************************************/
107 void nosaveCB_QuestionDialog(Widget UxWidget,
108 XtPointer UxClientData,
109 XtPointer UxCallbackArg)
111 XtDestroyWidget(XtParent(UxWidget));
116 /******************************************************************************/
118 /* saveCallbackB_QuestionDialog */
120 /******************************************************************************/
121 void saveCB_QuestionDialog(Widget UxWidget,
122 XtPointer UxClientData,
123 XtPointer UxCallbackArg)
126 XtDestroyWidget(XtParent(UxWidget));
128 /********************************************************************/
129 /* Activate the save routine. */
130 /********************************************************************/
131 activateCB_CA_MB_FileSave((Widget)NULL, (XtPointer)NULL, (XtPointer)NULL);
135 /******************************************************************************/
136 /* display_question_message */
138 /* INPUT: Widget parent - parent to position dialog on. */
139 /* char *message - message to display in dialog box */
142 /******************************************************************************/
143 void display_question_message (Widget parent, char *message,
144 char *button1, XtCallbackProc cb_button1,
145 char *button2, XtCallbackProc cb_button2,
146 char *button3, XtCallbackProc cb_button3)
150 QuestionDialog = XmCreateQuestionDialog(parent, "questionDialog", NULL, 0);
152 tmpw = XmMessageBoxGetChild(QuestionDialog, XmDIALOG_OK_BUTTON);
155 RES_CONVERT( XmNlabelString, button1),
157 XtAddCallback( QuestionDialog, XmNokCallback,
158 (XtCallbackProc) cb_button1,
161 XtUnmanageChild (tmpw);
164 tmpw = XmMessageBoxGetChild(QuestionDialog, XmDIALOG_CANCEL_BUTTON);
167 RES_CONVERT( XmNlabelString, button2),
169 XtAddCallback( QuestionDialog, XmNcancelCallback,
170 (XtCallbackProc) cb_button2,
173 XtUnmanageChild (tmpw);
176 tmpw = XmMessageBoxGetChild(QuestionDialog, XmDIALOG_HELP_BUTTON);
179 RES_CONVERT( XmNlabelString, button3),
181 XtAddCallback( QuestionDialog, XmNhelpCallback,
182 (XtCallbackProc) cb_button3,
185 XtUnmanageChild (tmpw);
188 XtVaSetValues (QuestionDialog,
189 RES_CONVERT(XmNdialogTitle, GETMESSAGE(6, 51, "Create Action - Question")),
190 RES_CONVERT(XmNmessageString, message),
193 XtManageChild (QuestionDialog);
196 /*******************************************************************************
198 *******************************************************************************/