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 *******************************************************************************/
34 #include <Xm/MessageB.h>
35 #include <sys/signal.h>
39 #include "CreateActionAppShell.h"
41 #define CONTEXT_MACRO_ACCESS 1
42 #include "Confirmed.h"
43 #undef CONTEXT_MACRO_ACCESS
45 /*******************************************************************************
46 The following are callback functions for Confirmed dialog.
47 *******************************************************************************/
49 /******************************************************************************/
50 /* activateCB_Confirmed_OkButton */
51 /******************************************************************************/
52 void activateCB_Confirmed_OkButton( Widget UxWidget,
53 XtPointer UxClientData,
54 XtPointer UxCallbackArg)
57 XtDestroyWidget(XtParent(UxWidget));
59 /******************************************************************************/
60 /* display_confirmed_message */
62 /* INPUT: Widget parent - parent to position dialog on. */
63 /* char *message - message to display in dialog box */
66 /******************************************************************************/
67 void display_confirmed_message (Widget parent, char *message)
70 Confirmed = XmCreateInformationDialog(parent, "confirmedDialog", NULL, 0);
71 XtUnmanageChild (XmMessageBoxGetChild (Confirmed, XmDIALOG_CANCEL_BUTTON));
72 XtUnmanageChild (XmMessageBoxGetChild (Confirmed, XmDIALOG_HELP_BUTTON));
74 XtAddCallback( Confirmed, XmNokCallback,
75 (XtCallbackProc) activateCB_Confirmed_OkButton,
78 XtVaSetValues (Confirmed,
79 RES_CONVERT(XmNdialogTitle, GETMESSAGE(6, 41, "Create Action - Confirmation")),
80 RES_CONVERT(XmNmessageString, message),
82 XtRealizeWidget(Confirmed);
84 XtManageChild (Confirmed);
87 /*******************************************************************************
88 The following are callback functions for Question dialog
89 *******************************************************************************/
91 /******************************************************************************/
93 /* cancelCB_QuestionDialog */
95 /******************************************************************************/
96 void cancelCB_QuestionDialog(Widget UxWidget,
97 XtPointer UxClientData,
98 XtPointer UxCallbackArg)
100 XtDestroyWidget(XtParent(UxWidget));
103 /******************************************************************************/
105 /* nosaveCB_QuestionDialog */
107 /******************************************************************************/
108 void nosaveCB_QuestionDialog(Widget UxWidget,
109 XtPointer UxClientData,
110 XtPointer UxCallbackArg)
112 XtDestroyWidget(XtParent(UxWidget));
117 /******************************************************************************/
119 /* saveCallbackB_QuestionDialog */
121 /******************************************************************************/
122 void saveCB_QuestionDialog(Widget UxWidget,
123 XtPointer UxClientData,
124 XtPointer UxCallbackArg)
127 XtDestroyWidget(XtParent(UxWidget));
129 /********************************************************************/
130 /* Activate the save routine. */
131 /********************************************************************/
132 activateCB_CA_MB_FileSave((Widget)NULL, (XtPointer)NULL, (XtPointer)NULL);
136 /******************************************************************************/
137 /* display_question_message */
139 /* INPUT: Widget parent - parent to position dialog on. */
140 /* char *message - message to display in dialog box */
143 /******************************************************************************/
144 void display_question_message (Widget parent, char *message,
145 char *button1, XtCallbackProc cb_button1,
146 char *button2, XtCallbackProc cb_button2,
147 char *button3, XtCallbackProc cb_button3)
151 QuestionDialog = XmCreateQuestionDialog(parent, "questionDialog", NULL, 0);
153 tmpw = XmMessageBoxGetChild(QuestionDialog, XmDIALOG_OK_BUTTON);
156 RES_CONVERT( XmNlabelString, button1),
158 XtAddCallback( QuestionDialog, XmNokCallback,
159 (XtCallbackProc) cb_button1,
162 XtUnmanageChild (tmpw);
165 tmpw = XmMessageBoxGetChild(QuestionDialog, XmDIALOG_CANCEL_BUTTON);
168 RES_CONVERT( XmNlabelString, button2),
170 XtAddCallback( QuestionDialog, XmNcancelCallback,
171 (XtCallbackProc) cb_button2,
174 XtUnmanageChild (tmpw);
177 tmpw = XmMessageBoxGetChild(QuestionDialog, XmDIALOG_HELP_BUTTON);
180 RES_CONVERT( XmNlabelString, button3),
182 XtAddCallback( QuestionDialog, XmNhelpCallback,
183 (XtCallbackProc) cb_button3,
186 XtUnmanageChild (tmpw);
189 XtVaSetValues (QuestionDialog,
190 RES_CONVERT(XmNdialogTitle, GETMESSAGE(6, 51, "Create Action - Question")),
191 RES_CONVERT(XmNmessageString, message),
194 XtManageChild (QuestionDialog);
197 /*******************************************************************************
199 *******************************************************************************/