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: queryDialog.c /main/4 1995/11/02 14:06:32 rswiston $ */
24 /*********************************************************************
25 * (c) Copyright 1993, 1994 Hewlett-Packard Company
26 * (c) Copyright 1993, 1994 International Business Machines Corp.
27 * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
28 * (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
30 **********************************************************************/
31 /*******************************************************************************
34 *******************************************************************************/
38 #include <Xm/DialogS.h>
39 #include <Xm/MenuShell.h>
40 #include <Xm/MwmUtil.h>
41 #include <Xm/MessageB.h>
43 #include "externals.h"
45 #define RES_CONVERT( res_name, res_value) \
46 XtVaTypedArg, (res_name), XmRString, (res_value), strlen(res_value) + 1
48 /*******************************************************************************
49 Includes, Defines, and Global variables from the Declarations Editor:
50 *******************************************************************************/
54 /*******************************************************************************
55 Forward declarations of functions that are defined later in this file.
56 *******************************************************************************/
58 Widget create_queryDialog();
60 /*******************************************************************************
61 The following are callback functions.
62 *******************************************************************************/
65 okCallback_queryDialog(
68 XtPointer callbackArg )
77 XtPointer callbackArg )
79 Process_Query_Cancel();
82 /*******************************************************************************
83 The 'build_' function creates all the widgets
84 using the resource values specified in the Property Editor.
85 *******************************************************************************/
88 build_queryDialog( void )
90 Widget queryDialog_shell;
91 XmString tmpXmStr, tmpXmStr2, tmpXmStr3, tmpXmStr4, tmpXmStr5;
96 queryDialog_shell = XtVaCreatePopupShell( "queryDialog_shell",
97 xmDialogShellWidgetClass, mainWindow,
98 XmNtitle, GETSTR(6,2, "Icon Editor - Warning"),
101 tmpXmStr = GETXMSTR(6,2, "Icon Editor - Warning");
102 tmpXmStr2= GETXMSTR(6,6, "OK");
103 tmpXmStr3= GETXMSTR(6,8, "Do ya really wanna?");
104 tmpXmStr4= GETXMSTR(6,10, "Cancel");
105 tmpXmStr5= GETXMSTR(4,10, "Help");
106 queryDialog = XtVaCreateWidget( "queryDialog",
107 xmMessageBoxWidgetClass, queryDialog_shell,
108 XmNdefaultButtonType, XmDIALOG_CANCEL_BUTTON,
109 XmNdialogTitle, tmpXmStr,
110 XmNokLabelString, tmpXmStr2,
111 XmNmessageString, tmpXmStr3,
112 XmNcancelLabelString, tmpXmStr4,
113 XmNhelpLabelString, tmpXmStr5,
114 XmNdialogType, XmDIALOG_WARNING,
116 XmStringFree(tmpXmStr);
117 XmStringFree(tmpXmStr2);
118 XmStringFree(tmpXmStr3);
119 XmStringFree(tmpXmStr4);
120 XmStringFree(tmpXmStr5);
122 XtAddCallback( queryDialog, XmNokCallback, okCallback_queryDialog, NULL);
123 XtAddCallback( queryDialog, XmNcancelCallback, cancelCB_queryDialog, NULL);
126 XtSetArg (args[n], XmNuseAsyncGeometry, True); n++;
127 XtSetArg (args[n], XmNmwmInputMode,MWM_INPUT_PRIMARY_APPLICATION_MODAL);n++;
128 XtSetValues (queryDialog_shell, args, n);
131 return ( queryDialog );
134 /*******************************************************************************
135 The following is the 'Interface function' which is the
136 external entry point for creating this interface.
137 This function should be called from your application or from
139 *******************************************************************************/
142 create_queryDialog( void )
146 rtrn = build_queryDialog();
151 /*******************************************************************************
153 *******************************************************************************/