Fix typo in license headers
[oweals/cde.git] / cde / programs / dticon / stdErrDialog.c
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
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)
10  * any later version.
11  *
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
16  * details.
17  *
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
22  */
23 /* $XConsortium: stdErrDialog.c /main/4 1995/11/02 14:06:41 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
29 *      Novell, Inc.
30 **********************************************************************/
31 /*******************************************************************************
32         stdErrDialog.c
33
34 *******************************************************************************/
35
36 #include <stdio.h>
37 #include <Xm/Xm.h>
38 #include <Xm/DialogS.h>
39 #include <Xm/MenuShell.h>
40 #include <Xm/MwmUtil.h>
41 #include "main.h"
42 #include "externals.h"
43
44 #include <Xm/MessageB.h>
45
46 /*******************************************************************************
47         Includes, Defines, and Global variables from the Declarations Editor:
48 *******************************************************************************/
49
50 Widget  stdErrDialog;
51
52 /*******************************************************************************
53         Forward declarations of functions that are defined later in this file.
54 *******************************************************************************/
55
56 Widget  create_stdErrDialog();
57
58 /*******************************************************************************
59         The following are callback functions.
60 *******************************************************************************/
61
62 static void
63 okCallback_stdErrDialog(
64         Widget w,
65         XtPointer clientData,
66         XtPointer callbackArg )
67 {
68         Process_StdErr_OK();
69 }
70
71 /*******************************************************************************
72         The 'build_' function creates all the widgets
73         using the resource values specified in the Property Editor.
74 *******************************************************************************/
75
76 static Widget
77 build_stdErrDialog( void )
78 {
79     Widget    stdErrDialog_shell;
80     XmString tmpXmStr, tmpXmStr2;
81     Arg  args[10];
82     int  n;
83
84
85     stdErrDialog_shell = XtVaCreatePopupShell( "stdErrDialog_shell",
86                         xmDialogShellWidgetClass, mainWindow,
87                         XmNtitle, GETSTR(8,2, "Icon Editor - Error"),
88                         NULL );
89
90     tmpXmStr = GETXMSTR(8,4, "Continue");
91     tmpXmStr2= GETXMSTR(8,2, "Icon Editor - Error");
92     stdErrDialog = XtVaCreateWidget( "stdErrDialog",
93                         xmMessageBoxWidgetClass, stdErrDialog_shell,
94                         XmNokLabelString, tmpXmStr,
95                         XmNdialogTitle, tmpXmStr2,
96                         XmNdialogType, XmDIALOG_ERROR,
97                         NULL );
98     XmStringFree(tmpXmStr);
99     XmStringFree(tmpXmStr2);
100
101     XtAddCallback( stdErrDialog, XmNokCallback, okCallback_stdErrDialog, NULL);
102
103     n = 0;
104     XtSetArg (args[n], XmNuseAsyncGeometry, True);                          n++;
105     XtSetArg (args[n], XmNmwmInputMode,MWM_INPUT_PRIMARY_APPLICATION_MODAL);n++;
106     XtSetValues (stdErrDialog_shell, args, n);
107
108     return ( stdErrDialog );
109 }
110
111
112 /*******************************************************************************
113         The following is the 'Interface function' which is the
114         external entry point for creating this interface.
115         This function should be called from your application or from
116         a callback function.
117 *******************************************************************************/
118
119 Widget
120 create_stdErrDialog( void )
121 {
122         Widget                  rtrn;
123
124         rtrn = build_stdErrDialog();
125
126         {
127           Widget w0, w1, w2;
128           Arg arg[10];
129           int i;
130           w0 = rtrn;
131           w1 = XmMessageBoxGetChild(w0, XmDIALOG_CANCEL_BUTTON);
132           w2 = XmMessageBoxGetChild(w0, XmDIALOG_HELP_BUTTON);
133           XtUnmanageChild(w1);
134           XtUnmanageChild(w2);
135         }
136         return(rtrn);
137 }
138
139 /*******************************************************************************
140         END OF FILE
141 *******************************************************************************/
142