1
/*===========================================================================
2
Copyright (C) 1995-2009 European Southern Observatory (ESO)
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License as
6
published by the Free Software Foundation; either version 2 of
7
the License, or (at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public
15
License along with this program; if not, write to the Free
16
Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,
19
Correspondence concerning ESO-MIDAS should be addressed as follows:
20
Internet e-mail: midas@eso.org
21
Postal address: European Southern Observatory
22
Data Management Division
23
Karl-Schwarzschild-Strasse 2
24
D 85748 Garching bei Muenchen
26
===========================================================================*/
33
/*******************************************************************************
36
*******************************************************************************/
46
/*******************************************************************************
47
Includes, Defines, and Global variables from the Declarations Editor:
48
*******************************************************************************/
50
#include <ExternResources.h>
52
/*******************************************************************************
53
The definition of the context structure:
54
If you create multiple instances of your interface, the context
55
structure ensures that your callbacks use the variables for the
58
For each swidget in the interface, each argument to the Interface
59
function, and each variable in the Instance Specific section of the
60
Declarations Editor, there is an entry in the context structure.
61
and a #define. The #define makes the variable name refer to the
62
corresponding entry in the context structure.
63
*******************************************************************************/
67
swidget UxtransientShell4;
70
swidget UxNewsButton4;
71
swidget UxPrintButton4;
74
} _UxCtransientShell4;
76
#define transientShell4 UxTransientShell4Context->UxtransientShell4
77
#define workArea4 UxTransientShell4Context->UxworkArea4
78
#define SHelp4 UxTransientShell4Context->UxSHelp4
79
#define NewsButton4 UxTransientShell4Context->UxNewsButton4
80
#define PrintButton4 UxTransientShell4Context->UxPrintButton4
81
#define label5 UxTransientShell4Context->Uxlabel5
82
#define textField4 UxTransientShell4Context->UxtextField4
84
static _UxCtransientShell4 *UxTransientShell4Context;
86
extern void helpPR(), InitHelp(), WriteHelpAW(), makeReport(), SensMenu();
89
/*******************************************************************************
90
The following are translation tables.
91
*******************************************************************************/
94
/*******************************************************************************
95
Forward declarations of functions that are defined later in this file.
96
*******************************************************************************/
98
swidget create_transientShell4();
100
/*******************************************************************************
101
The following are Action functions.
102
*******************************************************************************/
104
static void action_WriteHelp( UxWidget, UxEvent, UxParams, p_UxNumParams )
108
Cardinal *p_UxNumParams;
110
_UxCtransientShell4 *UxSaveCtx, *UxContext;
111
swidget UxThisWidget;
113
UxThisWidget = UxWidgetToSwidget( UxWidget );
114
UxSaveCtx = UxTransientShell4Context;
115
UxTransientShell4Context = UxContext =
116
(_UxCtransientShell4 *) UxGetContext( UxThisWidget );
118
WriteHelpAW(UxWidget);
122
UxTransientShell4Context = UxSaveCtx;
125
/*******************************************************************************
126
The following are callback functions.
127
*******************************************************************************/
129
static void mapCB_workArea4( UxWidget, UxClientData, UxCallbackArg )
131
XtPointer UxClientData, UxCallbackArg;
133
_UxCtransientShell4 *UxSaveCtx, *UxContext;
134
swidget UxThisWidget;
136
UxThisWidget = UxWidgetToSwidget( UxWidget );
137
UxSaveCtx = UxTransientShell4Context;
138
UxTransientShell4Context = UxContext =
139
(_UxCtransientShell4 *) UxGetContext( UxThisWidget );
143
UxTransientShell4Context = UxSaveCtx;
146
static void createCB_workArea4( UxWidget, UxClientData, UxCallbackArg )
148
XtPointer UxClientData, UxCallbackArg;
150
_UxCtransientShell4 *UxSaveCtx, *UxContext;
151
swidget UxThisWidget;
153
UxThisWidget = UxWidgetToSwidget( UxWidget );
154
UxSaveCtx = UxTransientShell4Context;
155
UxTransientShell4Context = UxContext =
156
(_UxCtransientShell4 *) UxGetContext( UxThisWidget );
160
UxTransientShell4Context = UxSaveCtx;
163
static void activateCB_SHelp4( UxWidget, UxClientData, UxCallbackArg )
165
XtPointer UxClientData, UxCallbackArg;
167
_UxCtransientShell4 *UxSaveCtx, *UxContext;
168
swidget UxThisWidget;
170
UxThisWidget = UxWidgetToSwidget( UxWidget );
171
UxSaveCtx = UxTransientShell4Context;
172
UxTransientShell4Context = UxContext =
173
(_UxCtransientShell4 *) UxGetContext( UxThisWidget );
177
UxTransientShell4Context = UxSaveCtx;
180
static void activateCB_NewsButton4( UxWidget, UxClientData, UxCallbackArg )
182
XtPointer UxClientData, UxCallbackArg;
184
_UxCtransientShell4 *UxSaveCtx, *UxContext;
185
swidget UxThisWidget;
187
UxThisWidget = UxWidgetToSwidget( UxWidget );
188
UxSaveCtx = UxTransientShell4Context;
189
UxTransientShell4Context = UxContext =
190
(_UxCtransientShell4 *) UxGetContext( UxThisWidget );
196
strcpy(addr,UxGetText(textField4));
200
UxPopdownInterface(save);
203
UxTransientShell4Context = UxSaveCtx;
206
static void activateCB_PrintButton4( UxWidget, UxClientData, UxCallbackArg )
208
XtPointer UxClientData, UxCallbackArg;
210
_UxCtransientShell4 *UxSaveCtx, *UxContext;
211
swidget UxThisWidget;
213
UxThisWidget = UxWidgetToSwidget( UxWidget );
214
UxSaveCtx = UxTransientShell4Context;
215
UxTransientShell4Context = UxContext =
216
(_UxCtransientShell4 *) UxGetContext( UxThisWidget );
220
UxPopdownInterface(save);
223
UxTransientShell4Context = UxSaveCtx;
226
/*******************************************************************************
227
The 'init_' function sets the private properties for all the
228
swidgets to the values specified in the Property Table.
229
Some properties need to be set after the X widgets have been
230
created and the setting of these properties is done in the
231
'build_' function after the UxCreateWidget call.
232
*******************************************************************************/
234
static void _Uxinit_transientShell4()
236
UxPutTitle( transientShell4, "Save Report" );
237
UxPutHeight( transientShell4, 140 );
238
UxPutWidth( transientShell4, 300 );
239
UxPutY( transientShell4, 600 );
240
UxPutX( transientShell4, 630 );
242
UxPutResizePolicy( workArea4, "resize_none" );
243
UxPutNoResize( workArea4, "true" );
244
UxPutUnitType( workArea4, "pixels" );
245
UxPutBackground( workArea4, WindowBackground );
246
UxPutBorderWidth( workArea4, 0 );
247
UxPutHeight( workArea4, 498 );
248
UxPutWidth( workArea4, 600 );
249
UxPutY( workArea4, 2 );
250
UxPutX( workArea4, 20 );
252
UxPutText( SHelp4, "Enter file name" );
253
UxPutEditable( SHelp4, "false" );
254
UxPutAccelerators( SHelp4, "" );
255
UxPutWordWrap( SHelp4, "false" );
256
UxPutHighlightOnEnter( SHelp4, "true" );
257
UxPutEditMode( SHelp4, "single_line_edit" );
258
UxPutBlinkRate( SHelp4, 500 );
259
UxPutPendingDelete( SHelp4, "true" );
260
UxPutTranslations( SHelp4, "" );
261
UxPutCursorPositionVisible( SHelp4, "true" );
262
UxPutFontList( SHelp4, TextFont );
263
UxPutHighlightColor( SHelp4, ApplicBackground );
264
UxPutForeground( SHelp4, TextForeground );
265
UxPutBackground( SHelp4, SHelpBackground );
266
UxPutHeight( SHelp4, 40 );
267
UxPutWidth( SHelp4, 325 );
268
UxPutY( SHelp4, 380 );
269
UxPutX( SHelp4, 30 );
271
UxPutHighlightColor( NewsButton4, "Black" );
272
UxPutRecomputeSize( NewsButton4, "false" );
273
UxPutFontList( NewsButton4, BoldTextFont );
274
UxPutForeground( NewsButton4, ButtonForeground );
275
UxPutLabelString( NewsButton4, "OK" );
276
UxPutBackground( NewsButton4, ButtonBackground );
277
UxPutHeight( NewsButton4, 30 );
278
UxPutWidth( NewsButton4, 95 );
279
UxPutY( NewsButton4, 630 );
280
UxPutX( NewsButton4, 20 );
282
UxPutHighlightColor( PrintButton4, "Black" );
283
UxPutRecomputeSize( PrintButton4, "false" );
284
UxPutFontList( PrintButton4, BoldTextFont );
285
UxPutForeground( PrintButton4, ButtonForeground );
286
UxPutLabelString( PrintButton4, "Cancel" );
287
UxPutBackground( PrintButton4, ButtonBackground );
288
UxPutHeight( PrintButton4, 30 );
289
UxPutWidth( PrintButton4, 95 );
290
UxPutY( PrintButton4, 330 );
291
UxPutX( PrintButton4, 280 );
293
UxPutLabelString( label5, "File Name" );
294
UxPutForeground( label5, TextForeground );
295
UxPutFontList( label5, BoldTextFont );
296
UxPutBackground( label5, LabelBackground );
297
UxPutHeight( label5, 20 );
298
UxPutWidth( label5, 80 );
299
UxPutY( label5, 10 );
300
UxPutX( label5, 10 );
302
UxPutText( textField4, "midas.report" );
303
UxPutForeground( textField4, TextForeground );
304
UxPutFontList( textField4, TextFont );
305
UxPutBackground( textField4, TextBackground );
306
UxPutHeight( textField4, 35 );
307
UxPutWidth( textField4, 250 );
308
UxPutY( textField4, 60 );
309
UxPutX( textField4, 140 );
313
/*******************************************************************************
314
The 'build_' function creates all the swidgets and X widgets,
315
and sets their properties to the values specified in the
317
*******************************************************************************/
319
static swidget _Uxbuild_transientShell4()
321
/* Create the swidgets */
323
transientShell4 = UxCreateTransientShell( "transientShell4", NO_PARENT );
324
UxPutContext( transientShell4, UxTransientShell4Context );
326
workArea4 = UxCreateForm( "workArea4", transientShell4 );
327
SHelp4 = UxCreateText( "SHelp4", workArea4 );
328
NewsButton4 = UxCreatePushButton( "NewsButton4", workArea4 );
329
PrintButton4 = UxCreatePushButton( "PrintButton4", workArea4 );
330
label5 = UxCreateLabel( "label5", workArea4 );
331
textField4 = UxCreateText( "textField4", workArea4 );
333
_Uxinit_transientShell4();
335
/* Create the X widgets */
337
UxCreateWidget( transientShell4 );
338
UxCreateWidget( workArea4 );
339
createCB_workArea4( UxGetWidget( workArea4 ),
340
(XtPointer) UxTransientShell4Context, (XtPointer) NULL );
342
UxPutBottomOffset( SHelp4, 50 );
343
UxPutBottomAttachment( SHelp4, "attach_form" );
344
UxPutRightOffset( SHelp4, 5 );
345
UxPutRightAttachment( SHelp4, "attach_form" );
346
UxPutLeftOffset( SHelp4, 5 );
347
UxPutLeftAttachment( SHelp4, "attach_form" );
348
UxCreateWidget( SHelp4 );
350
UxPutLeftOffset( NewsButton4, 50 );
351
UxPutLeftAttachment( NewsButton4, "attach_form" );
352
UxPutTopWidget( NewsButton4, "SHelp4" );
353
UxPutTopOffset( NewsButton4, 10 );
354
UxPutTopAttachment( NewsButton4, "attach_widget" );
355
UxCreateWidget( NewsButton4 );
357
UxPutLeftWidget( PrintButton4, "NewsButton4" );
358
UxPutLeftOffset( PrintButton4, 40 );
359
UxPutLeftAttachment( PrintButton4, "attach_widget" );
360
UxPutTopWidget( PrintButton4, "SHelp4" );
361
UxPutTopOffset( PrintButton4, 10 );
362
UxPutTopAttachment( PrintButton4, "attach_widget" );
363
UxCreateWidget( PrintButton4 );
365
UxPutTopOffset( label5, 15 );
366
UxPutTopAttachment( label5, "attach_form" );
367
UxPutLeftOffset( label5, 5 );
368
UxPutLeftAttachment( label5, "attach_form" );
369
UxCreateWidget( label5 );
371
UxPutTopOffset( textField4, 10 );
372
UxPutTopAttachment( textField4, "attach_form" );
373
UxPutRightOffset( textField4, 5 );
374
UxPutRightAttachment( textField4, "attach_form" );
375
UxPutLeftOffset( textField4, 90 );
376
UxPutLeftAttachment( textField4, "attach_form" );
377
UxCreateWidget( textField4 );
380
UxAddCallback( workArea4, XmNmapCallback,
382
(XtPointer) UxTransientShell4Context );
384
UxAddCallback( SHelp4, XmNactivateCallback,
386
(XtPointer) UxTransientShell4Context );
388
UxAddCallback( NewsButton4, XmNactivateCallback,
389
activateCB_NewsButton4,
390
(XtPointer) UxTransientShell4Context );
392
UxAddCallback( PrintButton4, XmNactivateCallback,
393
activateCB_PrintButton4,
394
(XtPointer) UxTransientShell4Context );
397
/* Finally, call UxRealizeInterface to create the X windows
398
for the widgets created above. */
400
UxRealizeInterface( transientShell4 );
402
return ( transientShell4 );
405
/*******************************************************************************
406
The following function includes the code that was entered
407
in the 'Initial Code' and 'Final Code' sections of the
408
Declarations Editor. This function is called from the
409
'Interface function' below.
410
*******************************************************************************/
412
static swidget _Ux_create_transientShell4()
415
_UxCtransientShell4 *UxContext;
417
UxTransientShell4Context = UxContext =
418
(_UxCtransientShell4 *) UxMalloc( sizeof(_UxCtransientShell4) );
420
rtrn = _Uxbuild_transientShell4();
425
/*******************************************************************************
426
The following is the 'Interface function' which is the
427
external entry point for creating this interface.
428
This function should be called from your application or from
430
*******************************************************************************/
432
swidget create_transientShell4()
435
static int _Uxinit = 0;
439
static XtActionsRec _Uxactions[] = {
440
{ "WriteHelp", action_WriteHelp }
443
XtAppAddActions( UxAppContext,
445
XtNumber(_Uxactions) );
450
_Uxrtrn = _Ux_create_transientShell4();
455
/*******************************************************************************
457
*******************************************************************************/