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 Massachusetss Ave, Cambridge,
19
Corresponding 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
===========================================================================*/
29
/*******************************************************************************
36
*******************************************************************************/
55
#include "midas_def.h"
58
#include <spec_comm.h>
61
/*******************************************************************************
62
Includes, Defines, and Global variables from the Declarations Editor:
63
*******************************************************************************/
65
#include <ExternResources.h>
67
/*******************************************************************************
68
The definition of the context structure:
69
If you create multiple instances of your interface, the context
70
structure ensures that your callbacks use the variables for the
73
For each swidget in the interface, each argument to the Interface
74
function, and each variable in the Instance Specific section of the
75
Declarations Editor, there is an entry in the context structure.
76
and a #define. The #define makes the variable name refer to the
77
corresponding entry in the context structure.
78
*******************************************************************************/
82
swidget UxApplicWindow;
86
swidget Uxmenu1_p1_b1;
87
swidget Uxmenu1_p1_b2;
88
swidget Uxmenu1_p1_b3;
89
swidget Uxmenu1_p1_b4;
90
swidget Uxmenu1_top_b1;
92
swidget Uxmenu1_p4_b1;
93
swidget Uxmenu1_p4_b2;
94
swidget Uxmenu1_p4_b8;
95
swidget Uxmenu1_p4_b10;
96
swidget Uxmenu1_p4_b13;
97
swidget Uxmenu1_p4_b12;
98
swidget Uxmenu1_p4_b3;
99
swidget Uxmenu1_p4_b4;
100
swidget Uxmenu1_p4_b9;
101
swidget Uxmenu1_p4_b5;
102
swidget Uxmenu1_p4_b11;
103
swidget Uxmenu1_p4_b14;
104
swidget Uxmenu1_p4_b15;
105
swidget Uxmenu1_top_b4;
107
swidget Uxmenu_help_context;
108
swidget Uxmenu_help_help;
109
swidget Uxmenu1_p5_b5;
110
swidget Uxmenu_help_tutorial;
111
swidget Uxmenu_help_version;
112
swidget Uxmenu1_top_b5;
115
swidget Uxpb_main_search;
116
swidget Uxpb_main_ident;
117
swidget Uxpb_main_calib;
118
swidget Uxpb_main_rebin;
119
swidget Uxpb_main_extract;
120
swidget Uxpb_main_flux;
121
swidget Uxpb_main_batch;
122
swidget Uxseparator12;
123
swidget Uxshelp_main;
124
swidget Uxseparator1;
134
swidget Uxtf_instrume;
138
swidget Uxtf_session;
143
#define ApplicWindow UxApplicWindowContext->UxApplicWindow
144
#define MainWindow UxApplicWindowContext->UxMainWindow
145
#define menu1 UxApplicWindowContext->Uxmenu1
146
#define menu1_p1 UxApplicWindowContext->Uxmenu1_p1
147
#define menu1_p1_b1 UxApplicWindowContext->Uxmenu1_p1_b1
148
#define menu1_p1_b2 UxApplicWindowContext->Uxmenu1_p1_b2
149
#define menu1_p1_b3 UxApplicWindowContext->Uxmenu1_p1_b3
150
#define menu1_p1_b4 UxApplicWindowContext->Uxmenu1_p1_b4
151
#define menu1_top_b1 UxApplicWindowContext->Uxmenu1_top_b1
152
#define menu1_p4 UxApplicWindowContext->Uxmenu1_p4
153
#define menu1_p4_b1 UxApplicWindowContext->Uxmenu1_p4_b1
154
#define menu1_p4_b2 UxApplicWindowContext->Uxmenu1_p4_b2
155
#define menu1_p4_b8 UxApplicWindowContext->Uxmenu1_p4_b8
156
#define menu1_p4_b10 UxApplicWindowContext->Uxmenu1_p4_b10
157
#define menu1_p4_b13 UxApplicWindowContext->Uxmenu1_p4_b13
158
#define menu1_p4_b12 UxApplicWindowContext->Uxmenu1_p4_b12
159
#define menu1_p4_b3 UxApplicWindowContext->Uxmenu1_p4_b3
160
#define menu1_p4_b4 UxApplicWindowContext->Uxmenu1_p4_b4
161
#define menu1_p4_b9 UxApplicWindowContext->Uxmenu1_p4_b9
162
#define menu1_p4_b5 UxApplicWindowContext->Uxmenu1_p4_b5
163
#define menu1_p4_b11 UxApplicWindowContext->Uxmenu1_p4_b11
164
#define menu1_p4_b14 UxApplicWindowContext->Uxmenu1_p4_b14
165
#define menu1_p4_b15 UxApplicWindowContext->Uxmenu1_p4_b15
166
#define menu1_top_b4 UxApplicWindowContext->Uxmenu1_top_b4
167
#define menu1_p5 UxApplicWindowContext->Uxmenu1_p5
168
#define menu_help_context UxApplicWindowContext->Uxmenu_help_context
169
#define menu_help_help UxApplicWindowContext->Uxmenu_help_help
170
#define menu1_p5_b5 UxApplicWindowContext->Uxmenu1_p5_b5
171
#define menu_help_tutorial UxApplicWindowContext->Uxmenu_help_tutorial
172
#define menu_help_version UxApplicWindowContext->Uxmenu_help_version
173
#define menu1_top_b5 UxApplicWindowContext->Uxmenu1_top_b5
174
#define form1 UxApplicWindowContext->Uxform1
175
#define form5 UxApplicWindowContext->Uxform5
176
#define pb_main_search UxApplicWindowContext->Uxpb_main_search
177
#define pb_main_ident UxApplicWindowContext->Uxpb_main_ident
178
#define pb_main_calib UxApplicWindowContext->Uxpb_main_calib
179
#define pb_main_rebin UxApplicWindowContext->Uxpb_main_rebin
180
#define pb_main_extract UxApplicWindowContext->Uxpb_main_extract
181
#define pb_main_flux UxApplicWindowContext->Uxpb_main_flux
182
#define pb_main_batch UxApplicWindowContext->Uxpb_main_batch
183
#define separator12 UxApplicWindowContext->Uxseparator12
184
#define shelp_main UxApplicWindowContext->Uxshelp_main
185
#define separator1 UxApplicWindowContext->Uxseparator1
186
#define tf_imin UxApplicWindowContext->Uxtf_imin
187
#define label6 UxApplicWindowContext->Uxlabel6
188
#define tf_wrang1 UxApplicWindowContext->Uxtf_wrang1
189
#define label5 UxApplicWindowContext->Uxlabel5
190
#define tf_wrang2 UxApplicWindowContext->Uxtf_wrang2
191
#define tf_lincat UxApplicWindowContext->Uxtf_lincat
192
#define label4 UxApplicWindowContext->Uxlabel4
193
#define tf_ystart UxApplicWindowContext->Uxtf_ystart
194
#define label3 UxApplicWindowContext->Uxlabel3
195
#define tf_instrume UxApplicWindowContext->Uxtf_instrume
196
#define label8 UxApplicWindowContext->Uxlabel8
197
#define label1 UxApplicWindowContext->Uxlabel1
198
#define tf_wlc UxApplicWindowContext->Uxtf_wlc
199
#define tf_session UxApplicWindowContext->Uxtf_session
200
#define label2 UxApplicWindowContext->Uxlabel2
201
#define label7 UxApplicWindowContext->Uxlabel7
203
static _UxCApplicWindow *UxApplicWindowContext;
205
extern void DisplayExtendedHelp(), DisplayShortHelp(), PopupLong();
206
extern void SetFileList(), WriteKeyword();
208
extern int file_exists(), PopupList(), AppendDialogText();
211
/*******************************************************************************
212
The following are translation tables.
213
*******************************************************************************/
215
static char *SelectFileMain = "#override\n\
216
<Btn3Down>:FileSelectACT()\n";
218
/*******************************************************************************
219
Forward declarations of functions that are defined later in this file.
220
*******************************************************************************/
222
swidget create_ApplicWindow();
224
/*******************************************************************************
225
The following are Action functions.
226
*******************************************************************************/
228
static void action_ExtendedHelp( UxWidget, UxEvent, UxParams, p_UxNumParams )
232
Cardinal *p_UxNumParams;
234
_UxCApplicWindow *UxSaveCtx, *UxContext;
235
swidget UxThisWidget;
237
UxThisWidget = UxWidgetToSwidget( UxWidget );
238
UxSaveCtx = UxApplicWindowContext;
239
UxApplicWindowContext = UxContext =
240
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
242
DisplayExtendedHelp(UxWidget);
244
UxApplicWindowContext = UxSaveCtx;
247
static void action_WriteHelp( UxWidget, UxEvent, UxParams, p_UxNumParams )
251
Cardinal *p_UxNumParams;
253
_UxCApplicWindow *UxSaveCtx, *UxContext;
254
swidget UxThisWidget;
256
UxThisWidget = UxWidgetToSwidget( UxWidget );
257
UxSaveCtx = UxApplicWindowContext;
258
UxApplicWindowContext = UxContext =
259
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
261
DisplayShortHelp(UxWidget);
263
UxApplicWindowContext = UxSaveCtx;
266
static void action_ClearHelp( UxWidget, UxEvent, UxParams, p_UxNumParams )
270
Cardinal *p_UxNumParams;
272
_UxCApplicWindow *UxSaveCtx, *UxContext;
273
swidget UxThisWidget;
275
UxThisWidget = UxWidgetToSwidget( UxWidget );
276
UxSaveCtx = UxApplicWindowContext;
277
UxApplicWindowContext = UxContext =
278
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
280
UxPutText(UxFindSwidget("shelp_main"), "");
281
UxPutText(UxFindSwidget("shelp_search"), "");
282
UxPutText(UxFindSwidget("shelp_calib"), "");
283
UxPutText(UxFindSwidget("shelp_rebin"), "");
284
UxPutText(UxFindSwidget("shelp_extract"), "");
285
UxPutText(UxFindSwidget("shelp_flux"), "");
287
UxApplicWindowContext = UxSaveCtx;
290
static void action_FileSelectACT( UxWidget, UxEvent, UxParams, p_UxNumParams )
294
Cardinal *p_UxNumParams;
296
_UxCApplicWindow *UxSaveCtx, *UxContext;
297
swidget UxThisWidget;
299
UxThisWidget = UxWidgetToSwidget( UxWidget );
300
UxSaveCtx = UxApplicWindowContext;
301
UxApplicWindowContext = UxContext =
302
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
305
extern swidget FileListInterface, TextFieldSwidget;
306
extern Widget FileListWidget;
307
extern char DirSpecs[];
310
int strip = 1; /* strip off */
312
TextFieldSwidget = UxThisWidget;
314
if ( UxWidget == UxGetWidget(UxFindSwidget("tf_lincat")) ) {
315
SET_LIST_TITLE("Enter line catalog");
316
ListType = LIST_LINCAT;
318
else if ( UxWidget == UxGetWidget(UxFindSwidget("tf_guess")) ) {
319
SET_LIST_TITLE("Enter guess table");
320
ListType = LIST_GUESS;
322
else if ( UxWidget == UxGetWidget(UxFindSwidget("tf_flux_tbl")) ) {
323
SET_LIST_TITLE("Enter flux table");
324
ListType = LIST_FLUX_TBL;
326
else if ( UxWidget == UxGetWidget(UxFindSwidget("tf_extin_tbl")) ) {
327
SET_LIST_TITLE("Enter extinction table");
328
ListType = LIST_EXTIN_TBL;
331
strcpy(DirSpecs, "*.tbl");
332
SetFileList(FileListWidget, strip, DirSpecs);
333
UxPopupInterface(FileListInterface, exclusive_grab);
336
UxApplicWindowContext = UxSaveCtx;
339
/*******************************************************************************
340
The following are callback functions.
341
*******************************************************************************/
343
static void activateCB_menu1_p1_b1( UxWidget, UxClientData, UxCallbackArg )
345
XtPointer UxClientData, UxCallbackArg;
347
_UxCApplicWindow *UxSaveCtx, *UxContext;
348
swidget UxThisWidget;
350
UxThisWidget = UxWidgetToSwidget( UxWidget );
351
UxSaveCtx = UxApplicWindowContext;
352
UxApplicWindowContext = UxContext =
353
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
356
PopupList(LIST_SESSION);
358
UxApplicWindowContext = UxSaveCtx;
361
static void activateCB_menu1_p1_b2( UxWidget, UxClientData, UxCallbackArg )
363
XtPointer UxClientData, UxCallbackArg;
365
_UxCApplicWindow *UxSaveCtx, *UxContext;
366
swidget UxThisWidget;
368
UxThisWidget = UxWidgetToSwidget( UxWidget );
369
UxSaveCtx = UxApplicWindowContext;
370
UxApplicWindowContext = UxContext =
371
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
373
#include <spec_comm.h>
375
extern char Session[];
378
sprintf(command, "%s%s", C_SAVE, Session);
379
AppendDialogText(command);
381
UxApplicWindowContext = UxSaveCtx;
384
static void activateCB_menu1_p1_b3( UxWidget, UxClientData, UxCallbackArg )
386
XtPointer UxClientData, UxCallbackArg;
388
_UxCApplicWindow *UxSaveCtx, *UxContext;
389
swidget UxThisWidget;
391
UxThisWidget = UxWidgetToSwidget( UxWidget );
392
UxSaveCtx = UxApplicWindowContext;
393
UxApplicWindowContext = UxContext =
394
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
397
#include <spec_comm.h>
399
extern int DialogType;
400
extern char Session[];
402
SET_DIALOG_PROMPT("Output parameters table :");
404
XmTextSetString(UxGetWidget(UxFindSwidget("tf_file_dialog")), Session);
405
DialogType = DIALOG_SESSION;
406
UxPopupInterface(UxFindSwidget("file_dialog"), exclusive_grab);
408
UxApplicWindowContext = UxSaveCtx;
411
static void activateCB_menu1_p1_b4( UxWidget, UxClientData, UxCallbackArg )
413
XtPointer UxClientData, UxCallbackArg;
415
_UxCApplicWindow *UxSaveCtx, *UxContext;
416
swidget UxThisWidget;
418
UxThisWidget = UxWidgetToSwidget( UxWidget );
419
UxSaveCtx = UxApplicWindowContext;
420
UxApplicWindowContext = UxContext =
421
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
423
#include <spec_comm.h>
425
AppendDialogText(C_CLEAN);
430
UxApplicWindowContext = UxSaveCtx;
433
static void activateCB_menu1_p4_b1( UxWidget, UxClientData, UxCallbackArg )
435
XtPointer UxClientData, UxCallbackArg;
437
_UxCApplicWindow *UxSaveCtx, *UxContext;
438
swidget UxThisWidget;
440
UxThisWidget = UxWidgetToSwidget( UxWidget );
441
UxSaveCtx = UxApplicWindowContext;
442
UxApplicWindowContext = UxContext =
443
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
444
AppendDialogText("make/display");
445
UxApplicWindowContext = UxSaveCtx;
448
static void activateCB_menu1_p4_b2( UxWidget, UxClientData, UxCallbackArg )
450
XtPointer UxClientData, UxCallbackArg;
452
_UxCApplicWindow *UxSaveCtx, *UxContext;
453
swidget UxThisWidget;
455
UxThisWidget = UxWidgetToSwidget( UxWidget );
456
UxSaveCtx = UxApplicWindowContext;
457
UxApplicWindowContext = UxContext =
458
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
459
AppendDialogText("graph/long");
460
UxApplicWindowContext = UxSaveCtx;
463
static void activateCB_menu1_p4_b10( UxWidget, UxClientData, UxCallbackArg )
465
XtPointer UxClientData, UxCallbackArg;
467
_UxCApplicWindow *UxSaveCtx, *UxContext;
468
swidget UxThisWidget;
470
UxThisWidget = UxWidgetToSwidget( UxWidget );
471
UxSaveCtx = UxApplicWindowContext;
472
UxApplicWindowContext = UxContext =
473
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
475
#include <spec_comm.h>
477
PopupList(LIST_LOAD_IMA);
479
UxApplicWindowContext = UxSaveCtx;
482
static void activateCB_menu1_p4_b13( UxWidget, UxClientData, UxCallbackArg )
484
XtPointer UxClientData, UxCallbackArg;
486
_UxCApplicWindow *UxSaveCtx, *UxContext;
487
swidget UxThisWidget;
489
UxThisWidget = UxWidgetToSwidget( UxWidget );
490
UxSaveCtx = UxApplicWindowContext;
491
UxApplicWindowContext = UxContext =
492
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
493
AppendDialogText("clear/channel over");
494
UxApplicWindowContext = UxSaveCtx;
497
static void activateCB_menu1_p4_b3( UxWidget, UxClientData, UxCallbackArg )
499
XtPointer UxClientData, UxCallbackArg;
501
_UxCApplicWindow *UxSaveCtx, *UxContext;
502
swidget UxThisWidget;
504
UxThisWidget = UxWidgetToSwidget( UxWidget );
505
UxSaveCtx = UxApplicWindowContext;
506
UxApplicWindowContext = UxContext =
507
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
508
AppendDialogText("copy/display laser");
509
UxApplicWindowContext = UxSaveCtx;
512
static void activateCB_menu1_p4_b4( UxWidget, UxClientData, UxCallbackArg )
514
XtPointer UxClientData, UxCallbackArg;
516
_UxCApplicWindow *UxSaveCtx, *UxContext;
517
swidget UxThisWidget;
519
UxThisWidget = UxWidgetToSwidget( UxWidget );
520
UxSaveCtx = UxApplicWindowContext;
521
UxApplicWindowContext = UxContext =
522
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
523
AppendDialogText("copy/graph laser");
524
UxApplicWindowContext = UxSaveCtx;
527
static void activateCB_menu1_p4_b5( UxWidget, UxClientData, UxCallbackArg )
529
XtPointer UxClientData, UxCallbackArg;
531
_UxCApplicWindow *UxSaveCtx, *UxContext;
532
swidget UxThisWidget;
534
UxThisWidget = UxWidgetToSwidget( UxWidget );
535
UxSaveCtx = UxApplicWindowContext;
536
UxApplicWindowContext = UxContext =
537
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
538
AppendDialogText("get/gcursor");
539
UxApplicWindowContext = UxSaveCtx;
542
static void activateCB_menu1_p4_b11( UxWidget, UxClientData, UxCallbackArg )
544
XtPointer UxClientData, UxCallbackArg;
546
_UxCApplicWindow *UxSaveCtx, *UxContext;
547
swidget UxThisWidget;
549
UxThisWidget = UxWidgetToSwidget( UxWidget );
550
UxSaveCtx = UxApplicWindowContext;
551
UxApplicWindowContext = UxContext =
552
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
553
AppendDialogText("get/cursor");
554
UxApplicWindowContext = UxSaveCtx;
557
static void activateCB_menu1_p4_b15( UxWidget, UxClientData, UxCallbackArg )
559
XtPointer UxClientData, UxCallbackArg;
561
_UxCApplicWindow *UxSaveCtx, *UxContext;
562
swidget UxThisWidget;
564
UxThisWidget = UxWidgetToSwidget( UxWidget );
565
UxSaveCtx = UxApplicWindowContext;
566
UxApplicWindowContext = UxContext =
567
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
569
#include <spec_comm.h>
572
extern char DirSpecs[];
575
osfphname("MIDASHOME", midashome);
576
sprintf(DirSpecs, "%s/calib/data/", midashome);
578
PopupList(LIST_BROWSER);
580
UxApplicWindowContext = UxSaveCtx;
583
static void activateCB_menu_help_context( UxWidget, UxClientData, UxCallbackArg )
585
XtPointer UxClientData, UxCallbackArg;
587
_UxCApplicWindow *UxSaveCtx, *UxContext;
588
swidget UxThisWidget;
590
UxThisWidget = UxWidgetToSwidget( UxWidget );
591
UxSaveCtx = UxApplicWindowContext;
592
UxApplicWindowContext = UxContext =
593
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
594
DisplayExtendedHelp(UxWidget);
595
UxApplicWindowContext = UxSaveCtx;
598
static void activateCB_menu_help_help( UxWidget, UxClientData, UxCallbackArg )
600
XtPointer UxClientData, UxCallbackArg;
602
_UxCApplicWindow *UxSaveCtx, *UxContext;
603
swidget UxThisWidget;
605
UxThisWidget = UxWidgetToSwidget( UxWidget );
606
UxSaveCtx = UxApplicWindowContext;
607
UxApplicWindowContext = UxContext =
608
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
609
DisplayExtendedHelp(UxWidget);
610
UxApplicWindowContext = UxSaveCtx;
613
static void activateCB_menu_help_tutorial( UxWidget, UxClientData, UxCallbackArg )
615
XtPointer UxClientData, UxCallbackArg;
617
_UxCApplicWindow *UxSaveCtx, *UxContext;
618
swidget UxThisWidget;
620
UxThisWidget = UxWidgetToSwidget( UxWidget );
621
UxSaveCtx = UxApplicWindowContext;
622
UxApplicWindowContext = UxContext =
623
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
624
DisplayExtendedHelp(UxWidget);
625
UxApplicWindowContext = UxSaveCtx;
628
static void activateCB_menu_help_version( UxWidget, UxClientData, UxCallbackArg )
630
XtPointer UxClientData, UxCallbackArg;
632
_UxCApplicWindow *UxSaveCtx, *UxContext;
633
swidget UxThisWidget;
635
UxThisWidget = UxWidgetToSwidget( UxWidget );
636
UxSaveCtx = UxApplicWindowContext;
637
UxApplicWindowContext = UxContext =
638
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
639
DisplayExtendedHelp(UxWidget);
640
UxApplicWindowContext = UxSaveCtx;
643
static void activateCB_pb_main_search( UxWidget, UxClientData, UxCallbackArg )
645
XtPointer UxClientData, UxCallbackArg;
647
_UxCApplicWindow *UxSaveCtx, *UxContext;
648
swidget UxThisWidget;
650
UxThisWidget = UxWidgetToSwidget( UxWidget );
651
UxSaveCtx = UxApplicWindowContext;
652
UxApplicWindowContext = UxContext =
653
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
655
PopupLong("SearchShell");
657
UxApplicWindowContext = UxSaveCtx;
660
static void activateCB_pb_main_ident( UxWidget, UxClientData, UxCallbackArg )
662
XtPointer UxClientData, UxCallbackArg;
664
_UxCApplicWindow *UxSaveCtx, *UxContext;
665
swidget UxThisWidget;
667
UxThisWidget = UxWidgetToSwidget( UxWidget );
668
UxSaveCtx = UxApplicWindowContext;
669
UxApplicWindowContext = UxContext =
670
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
673
#include <spec_comm.h>
675
extern char Lincat[], Wlc[];
677
if ( !file_exists(Wlc, ".bdf") ) {
678
SCTPUT("*** Error: invalid calibration frame ***");
681
if ( !file_exists(Lincat, ".tbl") ) {
682
SCTPUT("*** Error: invalid line catalog table ***");
686
AppendDialogText(C_IDENT);
689
UxApplicWindowContext = UxSaveCtx;
692
static void activateCB_pb_main_calib( UxWidget, UxClientData, UxCallbackArg )
694
XtPointer UxClientData, UxCallbackArg;
696
_UxCApplicWindow *UxSaveCtx, *UxContext;
697
swidget UxThisWidget;
699
UxThisWidget = UxWidgetToSwidget( UxWidget );
700
UxSaveCtx = UxApplicWindowContext;
701
UxApplicWindowContext = UxContext =
702
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
705
#include <spec_comm.h>
707
AppendDialogText(C_CALIB_ERAS);
708
PopupLong("CalibShell");
712
UxApplicWindowContext = UxSaveCtx;
715
static void activateCB_pb_main_rebin( UxWidget, UxClientData, UxCallbackArg )
717
XtPointer UxClientData, UxCallbackArg;
719
_UxCApplicWindow *UxSaveCtx, *UxContext;
720
swidget UxThisWidget;
722
UxThisWidget = UxWidgetToSwidget( UxWidget );
723
UxSaveCtx = UxApplicWindowContext;
724
UxApplicWindowContext = UxContext =
725
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
727
PopupLong("RebinShell");
729
UxApplicWindowContext = UxSaveCtx;
732
static void activateCB_pb_main_extract( UxWidget, UxClientData, UxCallbackArg )
734
XtPointer UxClientData, UxCallbackArg;
736
_UxCApplicWindow *UxSaveCtx, *UxContext;
737
swidget UxThisWidget;
739
UxThisWidget = UxWidgetToSwidget( UxWidget );
740
UxSaveCtx = UxApplicWindowContext;
741
UxApplicWindowContext = UxContext =
742
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
744
PopupLong("ExtractShell");
746
UxApplicWindowContext = UxSaveCtx;
749
static void activateCB_pb_main_flux( UxWidget, UxClientData, UxCallbackArg )
751
XtPointer UxClientData, UxCallbackArg;
753
_UxCApplicWindow *UxSaveCtx, *UxContext;
754
swidget UxThisWidget;
756
UxThisWidget = UxWidgetToSwidget( UxWidget );
757
UxSaveCtx = UxApplicWindowContext;
758
UxApplicWindowContext = UxContext =
759
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
761
PopupLong("FluxShell");
763
UxApplicWindowContext = UxSaveCtx;
766
static void activateCB_pb_main_batch( UxWidget, UxClientData, UxCallbackArg )
768
XtPointer UxClientData, UxCallbackArg;
770
_UxCApplicWindow *UxSaveCtx, *UxContext;
771
swidget UxThisWidget;
773
UxThisWidget = UxWidgetToSwidget( UxWidget );
774
UxSaveCtx = UxApplicWindowContext;
775
UxApplicWindowContext = UxContext =
776
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
779
#include <spec_comm.h>
781
AppendDialogText(C_BATCHRED);
784
UxApplicWindowContext = UxSaveCtx;
787
static void losingFocusCB_tf_imin( UxWidget, UxClientData, UxCallbackArg )
789
XtPointer UxClientData, UxCallbackArg;
791
_UxCApplicWindow *UxSaveCtx, *UxContext;
792
swidget UxThisWidget;
794
UxThisWidget = UxWidgetToSwidget( UxWidget );
795
UxSaveCtx = UxApplicWindowContext;
796
UxApplicWindowContext = UxContext =
797
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
799
#include <spec_comm.h>
805
text = XmTextGetString(UxWidget);
806
sscanf(text, "%f", &val);
810
WriteKeyword(text, K_IMIN);
815
UxApplicWindowContext = UxSaveCtx;
818
static void losingFocusCB_tf_wrang1( UxWidget, UxClientData, UxCallbackArg )
820
XtPointer UxClientData, UxCallbackArg;
822
_UxCApplicWindow *UxSaveCtx, *UxContext;
823
swidget UxThisWidget;
825
UxThisWidget = UxWidgetToSwidget( UxWidget );
826
UxSaveCtx = UxApplicWindowContext;
827
UxApplicWindowContext = UxContext =
828
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
830
#include <spec_comm.h>
836
text = XmTextGetString(UxWidget);
837
sscanf(text, "%d", &val);
839
if ( val != Wrang[0] ) {
841
WriteKeyword(text, K_WRANG1);
846
UxApplicWindowContext = UxSaveCtx;
849
static void losingFocusCB_tf_wrang2( UxWidget, UxClientData, UxCallbackArg )
851
XtPointer UxClientData, UxCallbackArg;
853
_UxCApplicWindow *UxSaveCtx, *UxContext;
854
swidget UxThisWidget;
856
UxThisWidget = UxWidgetToSwidget( UxWidget );
857
UxSaveCtx = UxApplicWindowContext;
858
UxApplicWindowContext = UxContext =
859
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
861
#include <spec_comm.h>
867
text = XmTextGetString(UxWidget);
868
sscanf(text, "%d", &val);
870
if ( val != Wrang[1] ) {
872
WriteKeyword(text, K_WRANG2);
877
UxApplicWindowContext = UxSaveCtx;
880
static void losingFocusCB_tf_lincat( UxWidget, UxClientData, UxCallbackArg )
882
XtPointer UxClientData, UxCallbackArg;
884
_UxCApplicWindow *UxSaveCtx, *UxContext;
885
swidget UxThisWidget;
887
UxThisWidget = UxWidgetToSwidget( UxWidget );
888
UxSaveCtx = UxApplicWindowContext;
889
UxApplicWindowContext = UxContext =
890
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
892
#include <spec_comm.h>
895
extern char Lincat[];
897
text = XmTextGetString(UxWidget);
899
if ( strcmp(text, Lincat) ) {
900
strcpy(Lincat, text);
901
WriteKeyword(text, K_LINCAT);
906
UxApplicWindowContext = UxSaveCtx;
909
static void losingFocusCB_tf_ystart( UxWidget, UxClientData, UxCallbackArg )
911
XtPointer UxClientData, UxCallbackArg;
913
_UxCApplicWindow *UxSaveCtx, *UxContext;
914
swidget UxThisWidget;
916
UxThisWidget = UxWidgetToSwidget( UxWidget );
917
UxSaveCtx = UxApplicWindowContext;
918
UxApplicWindowContext = UxContext =
919
(_UxCApplicWindow *) UxGetContext( UxThisWidget );
921
#include <spec_comm.h>
927
text = XmTextGetString(UxWidget);
928
sscanf(text, "%d", &val);
930
if ( val != Ystart ) {
932
WriteKeyword(text, K_YSTART);
937
UxApplicWindowContext = UxSaveCtx;
940
/*******************************************************************************
941
The 'init_' function sets the private properties for all the
942
swidgets to the values specified in the Property Table.
943
Some properties need to be set after the X widgets have been
944
created and the setting of these properties is done in the
945
'build_' function after the UxCreateWidget call.
946
*******************************************************************************/
948
static void _Uxinit_ApplicWindow()
950
UxPutGeometry( ApplicWindow, "+0+0" );
951
UxPutTitle( ApplicWindow, "Long slit reduction" );
952
UxPutKeyboardFocusPolicy( ApplicWindow, "pointer" );
953
UxPutIconName( ApplicWindow, "Long Slit" );
954
UxPutHeight( ApplicWindow, 460 );
955
UxPutWidth( ApplicWindow, 447 );
956
UxPutY( ApplicWindow, 21 );
957
UxPutX( ApplicWindow, 2 );
959
UxPutBackground( MainWindow, WindowBackground );
960
UxPutHeight( MainWindow, 460 );
961
UxPutWidth( MainWindow, 440 );
962
UxPutY( MainWindow, 0 );
963
UxPutX( MainWindow, 10 );
964
UxPutUnitType( MainWindow, "pixels" );
966
UxPutBackground( menu1, MenuBackground );
967
UxPutMenuAccelerator( menu1, "<KeyUp>F10" );
968
UxPutRowColumnType( menu1, "menu_bar" );
970
UxPutForeground( menu1_p1, MenuForeground );
971
UxPutBackground( menu1_p1, MenuBackground );
972
UxPutRowColumnType( menu1_p1, "menu_pulldown" );
974
UxPutFontList( menu1_p1_b1, BoldTextFont );
975
UxPutMnemonic( menu1_p1_b1, "O" );
976
UxPutLabelString( menu1_p1_b1, "Open" );
978
UxPutFontList( menu1_p1_b2, BoldTextFont );
979
UxPutMnemonic( menu1_p1_b2, "S" );
980
UxPutLabelString( menu1_p1_b2, "Save" );
982
UxPutFontList( menu1_p1_b3, BoldTextFont );
983
UxPutMnemonic( menu1_p1_b3, "S" );
984
UxPutLabelString( menu1_p1_b3, "Save As ..." );
986
UxPutFontList( menu1_p1_b4, BoldTextFont );
987
UxPutAccelerator( menu1_p1_b4, "E" );
988
UxPutLabelString( menu1_p1_b4, "Exit" );
990
UxPutForeground( menu1_top_b1, MenuForeground );
991
UxPutFontList( menu1_top_b1, BoldTextFont );
992
UxPutBackground( menu1_top_b1, MenuBackground );
993
UxPutMnemonic( menu1_top_b1, "F" );
994
UxPutLabelString( menu1_top_b1, "File" );
996
UxPutForeground( menu1_p4, MenuForeground );
997
UxPutBackground( menu1_p4, MenuBackground );
998
UxPutRowColumnType( menu1_p4, "menu_pulldown" );
1000
UxPutFontList( menu1_p4_b1, BoldTextFont );
1001
UxPutMnemonic( menu1_p4_b1, "D" );
1002
UxPutLabelString( menu1_p4_b1, "Create Display" );
1004
UxPutFontList( menu1_p4_b2, BoldTextFont );
1005
UxPutMnemonic( menu1_p4_b2, "G" );
1006
UxPutLabelString( menu1_p4_b2, "Create Graphics" );
1008
UxPutMnemonic( menu1_p4_b10, "L" );
1009
UxPutFontList( menu1_p4_b10, BoldTextFont );
1010
UxPutLabelString( menu1_p4_b10, "Load image" );
1012
UxPutMnemonic( menu1_p4_b13, "o" );
1013
UxPutFontList( menu1_p4_b13, BoldTextFont );
1014
UxPutLabelString( menu1_p4_b13, "Clear overlay" );
1016
UxPutFontList( menu1_p4_b3, BoldTextFont );
1017
UxPutMnemonic( menu1_p4_b3, "P" );
1018
UxPutLabelString( menu1_p4_b3, "Print Display" );
1020
UxPutFontList( menu1_p4_b4, BoldTextFont );
1021
UxPutMnemonic( menu1_p4_b4, "r" );
1022
UxPutLabelString( menu1_p4_b4, "Print Graphics" );
1024
UxPutFontList( menu1_p4_b5, BoldTextFont );
1025
UxPutMnemonic( menu1_p4_b5, "C" );
1026
UxPutLabelString( menu1_p4_b5, "Graphics Cursor" );
1028
UxPutFontList( menu1_p4_b11, BoldTextFont );
1029
UxPutMnemonic( menu1_p4_b11, "u" );
1030
UxPutLabelString( menu1_p4_b11, "Display Cursor" );
1032
UxPutFontList( menu1_p4_b15, BoldTextFont );
1033
UxPutLabelString( menu1_p4_b15, "get MIDAS table" );
1035
UxPutForeground( menu1_top_b4, MenuForeground );
1036
UxPutFontList( menu1_top_b4, BoldTextFont );
1037
UxPutBackground( menu1_top_b4, MenuBackground );
1038
UxPutMnemonic( menu1_top_b4, "U" );
1039
UxPutLabelString( menu1_top_b4, "Utils" );
1041
UxPutForeground( menu1_p5, MenuForeground );
1042
UxPutBackground( menu1_p5, MenuBackground );
1043
UxPutRowColumnType( menu1_p5, "menu_pulldown" );
1045
UxPutFontList( menu_help_context, BoldTextFont );
1046
UxPutMnemonic( menu_help_context, "C" );
1047
UxPutLabelString( menu_help_context, "On Context ..." );
1049
UxPutFontList( menu_help_help, BoldTextFont );
1050
UxPutMnemonic( menu_help_help, "H" );
1051
UxPutLabelString( menu_help_help, "On Help ..." );
1053
UxPutFontList( menu_help_tutorial, BoldTextFont );
1054
UxPutMnemonic( menu_help_tutorial, "T" );
1055
UxPutLabelString( menu_help_tutorial, "Tutorial" );
1057
UxPutFontList( menu_help_version, BoldTextFont );
1058
UxPutMnemonic( menu_help_version, "V" );
1059
UxPutLabelString( menu_help_version, "On Version..." );
1061
UxPutForeground( menu1_top_b5, MenuForeground );
1062
UxPutFontList( menu1_top_b5, BoldTextFont );
1063
UxPutBackground( menu1_top_b5, MenuBackground );
1064
UxPutMnemonic( menu1_top_b5, "H" );
1065
UxPutLabelString( menu1_top_b5, "Help" );
1067
UxPutBackground( form1, WindowBackground );
1069
UxPutBackground( form5, ButtonBackground );
1070
UxPutHeight( form5, 72 );
1071
UxPutWidth( form5, 451 );
1072
UxPutY( form5, 368 );
1073
UxPutX( form5, -1 );
1074
UxPutResizePolicy( form5, "resize_none" );
1076
UxPutLabelString( pb_main_search, "Search ..." );
1077
UxPutForeground( pb_main_search, ButtonForeground );
1078
UxPutFontList( pb_main_search, BoldTextFont );
1079
UxPutBackground( pb_main_search, ButtonBackground );
1080
UxPutHeight( pb_main_search, 30 );
1081
UxPutWidth( pb_main_search, 86 );
1082
UxPutY( pb_main_search, 6 );
1083
UxPutX( pb_main_search, 4 );
1085
UxPutLabelString( pb_main_ident, "Identify ..." );
1086
UxPutForeground( pb_main_ident, ButtonForeground );
1087
UxPutFontList( pb_main_ident, BoldTextFont );
1088
UxPutBackground( pb_main_ident, ButtonBackground );
1089
UxPutHeight( pb_main_ident, 30 );
1090
UxPutWidth( pb_main_ident, 86 );
1091
UxPutY( pb_main_ident, 6 );
1092
UxPutX( pb_main_ident, 94 );
1094
UxPutLabelString( pb_main_calib, "Calibrate ..." );
1095
UxPutForeground( pb_main_calib, ButtonForeground );
1096
UxPutFontList( pb_main_calib, BoldTextFont );
1097
UxPutBackground( pb_main_calib, ButtonBackground );
1098
UxPutHeight( pb_main_calib, 30 );
1099
UxPutWidth( pb_main_calib, 86 );
1100
UxPutY( pb_main_calib, 6 );
1101
UxPutX( pb_main_calib, 182 );
1103
UxPutLabelString( pb_main_rebin, "Rebin ..." );
1104
UxPutForeground( pb_main_rebin, ButtonForeground );
1105
UxPutFontList( pb_main_rebin, BoldTextFont );
1106
UxPutBackground( pb_main_rebin, ButtonBackground );
1107
UxPutHeight( pb_main_rebin, 30 );
1108
UxPutWidth( pb_main_rebin, 86 );
1109
UxPutY( pb_main_rebin, 6 );
1110
UxPutX( pb_main_rebin, 270 );
1112
UxPutLabelString( pb_main_extract, "Extract ..." );
1113
UxPutForeground( pb_main_extract, ButtonForeground );
1114
UxPutFontList( pb_main_extract, BoldTextFont );
1115
UxPutBackground( pb_main_extract, ButtonBackground );
1116
UxPutHeight( pb_main_extract, 30 );
1117
UxPutWidth( pb_main_extract, 86 );
1118
UxPutY( pb_main_extract, 6 );
1119
UxPutX( pb_main_extract, 358 );
1121
UxPutLabelString( pb_main_flux, "Flux ..." );
1122
UxPutForeground( pb_main_flux, ButtonForeground );
1123
UxPutFontList( pb_main_flux, BoldTextFont );
1124
UxPutBackground( pb_main_flux, ButtonBackground );
1125
UxPutHeight( pb_main_flux, 30 );
1126
UxPutWidth( pb_main_flux, 86 );
1127
UxPutY( pb_main_flux, 38 );
1128
UxPutX( pb_main_flux, 4 );
1130
UxPutLabelString( pb_main_batch, "Batch ..." );
1131
UxPutForeground( pb_main_batch, ButtonForeground );
1132
UxPutFontList( pb_main_batch, BoldTextFont );
1133
UxPutBackground( pb_main_batch, ButtonBackground );
1134
UxPutHeight( pb_main_batch, 30 );
1135
UxPutWidth( pb_main_batch, 86 );
1136
UxPutY( pb_main_batch, 38 );
1137
UxPutX( pb_main_batch, 94 );
1139
UxPutBackground( separator12, LabelBackground );
1140
UxPutHeight( separator12, 6 );
1141
UxPutWidth( separator12, 450 );
1142
UxPutY( separator12, 360 );
1143
UxPutX( separator12, 0 );
1145
UxPutFontList( shelp_main, TextFont );
1146
UxPutEditable( shelp_main, "false" );
1147
UxPutCursorPositionVisible( shelp_main, "false" );
1148
UxPutBackground( shelp_main, SHelpBackground );
1149
UxPutHeight( shelp_main, 50 );
1150
UxPutWidth( shelp_main, 448 );
1151
UxPutY( shelp_main, 310 );
1152
UxPutX( shelp_main, 0 );
1154
UxPutBackground( separator1, LabelBackground );
1155
UxPutHeight( separator1, 6 );
1156
UxPutWidth( separator1, 450 );
1157
UxPutY( separator1, 304 );
1158
UxPutX( separator1, -2 );
1160
UxPutForeground( tf_imin, TextForeground );
1161
UxPutHighlightOnEnter( tf_imin, "true" );
1162
UxPutFontList( tf_imin, TextFont );
1163
UxPutBackground( tf_imin, TextBackground );
1164
UxPutHeight( tf_imin, 37 );
1165
UxPutWidth( tf_imin, 68 );
1166
UxPutY( tf_imin, 268 );
1167
UxPutX( tf_imin, 204 );
1169
UxPutForeground( label6, TextForeground );
1170
UxPutAlignment( label6, "alignment_beginning" );
1171
UxPutLabelString( label6, "Minimal Intensity in Catalog :" );
1172
UxPutFontList( label6, TextFont );
1173
UxPutBackground( label6, LabelBackground );
1174
UxPutHeight( label6, 30 );
1175
UxPutWidth( label6, 190 );
1176
UxPutY( label6, 270 );
1177
UxPutX( label6, 12 );
1179
UxPutForeground( tf_wrang1, TextForeground );
1180
UxPutHighlightOnEnter( tf_wrang1, "true" );
1181
UxPutFontList( tf_wrang1, TextFont );
1182
UxPutBackground( tf_wrang1, TextBackground );
1183
UxPutHeight( tf_wrang1, 37 );
1184
UxPutWidth( tf_wrang1, 68 );
1185
UxPutY( tf_wrang1, 230 );
1186
UxPutX( tf_wrang1, 204 );
1188
UxPutForeground( label5, TextForeground );
1189
UxPutAlignment( label5, "alignment_beginning" );
1190
UxPutLabelString( label5, "Wavelength Range :" );
1191
UxPutFontList( label5, TextFont );
1192
UxPutBackground( label5, LabelBackground );
1193
UxPutHeight( label5, 30 );
1194
UxPutWidth( label5, 190 );
1195
UxPutY( label5, 232 );
1196
UxPutX( label5, 12 );
1198
UxPutForeground( tf_wrang2, TextForeground );
1199
UxPutHighlightOnEnter( tf_wrang2, "true" );
1200
UxPutFontList( tf_wrang2, TextFont );
1201
UxPutBackground( tf_wrang2, TextBackground );
1202
UxPutHeight( tf_wrang2, 37 );
1203
UxPutWidth( tf_wrang2, 68 );
1204
UxPutY( tf_wrang2, 230 );
1205
UxPutX( tf_wrang2, 272 );
1207
UxPutTranslations( tf_lincat, SelectFileMain );
1208
UxPutForeground( tf_lincat, TextForeground );
1209
UxPutHighlightOnEnter( tf_lincat, "true" );
1210
UxPutFontList( tf_lincat, TextFont );
1211
UxPutBackground( tf_lincat, TextBackground );
1212
UxPutHeight( tf_lincat, 37 );
1213
UxPutWidth( tf_lincat, 236 );
1214
UxPutY( tf_lincat, 192 );
1215
UxPutX( tf_lincat, 204 );
1217
UxPutForeground( label4, TextForeground );
1218
UxPutAlignment( label4, "alignment_beginning" );
1219
UxPutLabelString( label4, "Line Catalog :" );
1220
UxPutFontList( label4, TextFont );
1221
UxPutBackground( label4, LabelBackground );
1222
UxPutHeight( label4, 30 );
1223
UxPutWidth( label4, 190 );
1224
UxPutY( label4, 196 );
1225
UxPutX( label4, 12 );
1227
UxPutForeground( tf_ystart, TextForeground );
1228
UxPutHighlightOnEnter( tf_ystart, "true" );
1229
UxPutFontList( tf_ystart, TextFont );
1230
UxPutBackground( tf_ystart, TextBackground );
1231
UxPutHeight( tf_ystart, 37 );
1232
UxPutWidth( tf_ystart, 71 );
1233
UxPutY( tf_ystart, 156 );
1234
UxPutX( tf_ystart, 204 );
1236
UxPutForeground( label3, TextForeground );
1237
UxPutAlignment( label3, "alignment_beginning" );
1238
UxPutLabelString( label3, "Calibration Starting Row :" );
1239
UxPutFontList( label3, TextFont );
1240
UxPutBackground( label3, LabelBackground );
1241
UxPutHeight( label3, 30 );
1242
UxPutWidth( label3, 190 );
1243
UxPutY( label3, 158 );
1244
UxPutX( label3, 12 );
1246
UxPutBorderWidth( tf_instrume, 0 );
1247
UxPutForeground( tf_instrume, TextForeground );
1248
UxPutHighlightOnEnter( tf_instrume, "true" );
1249
UxPutFontList( tf_instrume, TextFont );
1250
UxPutBackground( tf_instrume, TextBackground );
1251
UxPutHeight( tf_instrume, 37 );
1252
UxPutWidth( tf_instrume, 236 );
1253
UxPutY( tf_instrume, 118 );
1254
UxPutX( tf_instrume, 204 );
1256
UxPutForeground( label8, TextForeground );
1257
UxPutAlignment( label8, "alignment_beginning" );
1258
UxPutLabelString( label8, "Instrument :" );
1259
UxPutFontList( label8, TextFont );
1260
UxPutBackground( label8, LabelBackground );
1261
UxPutHeight( label8, 30 );
1262
UxPutWidth( label8, 190 );
1263
UxPutY( label8, 122 );
1264
UxPutX( label8, 12 );
1266
UxPutForeground( label1, TextForeground );
1267
UxPutAlignment( label1, "alignment_beginning" );
1268
UxPutLabelString( label1, "Calibration Frame :" );
1269
UxPutFontList( label1, TextFont );
1270
UxPutBackground( label1, LabelBackground );
1271
UxPutHeight( label1, 30 );
1272
UxPutWidth( label1, 190 );
1273
UxPutY( label1, 84 );
1274
UxPutX( label1, 12 );
1276
UxPutBorderWidth( tf_wlc, 1 );
1277
UxPutEditable( tf_wlc, "false" );
1278
UxPutCursorPositionVisible( tf_wlc, "false" );
1279
UxPutForeground( tf_wlc, TextForeground );
1280
UxPutHighlightOnEnter( tf_wlc, "false" );
1281
UxPutFontList( tf_wlc, TextFont );
1282
UxPutBackground( tf_wlc, TextBackground );
1283
UxPutHeight( tf_wlc, 37 );
1284
UxPutWidth( tf_wlc, 235 );
1285
UxPutY( tf_wlc, 80 );
1286
UxPutX( tf_wlc, 204 );
1288
UxPutBorderWidth( tf_session, 1 );
1289
UxPutEditable( tf_session, "false" );
1290
UxPutCursorPositionVisible( tf_session, "false" );
1291
UxPutForeground( tf_session, TextForeground );
1292
UxPutHighlightOnEnter( tf_session, "false" );
1293
UxPutFontList( tf_session, TextFont );
1294
UxPutBackground( tf_session, TextBackground );
1295
UxPutHeight( tf_session, 37 );
1296
UxPutWidth( tf_session, 235 );
1297
UxPutY( tf_session, 42 );
1298
UxPutX( tf_session, 204 );
1300
UxPutForeground( label2, TextForeground );
1301
UxPutAlignment( label2, "alignment_beginning" );
1302
UxPutLabelString( label2, "Session :" );
1303
UxPutFontList( label2, TextFont );
1304
UxPutBackground( label2, LabelBackground );
1305
UxPutHeight( label2, 30 );
1306
UxPutWidth( label2, 190 );
1307
UxPutY( label2, 44 );
1308
UxPutX( label2, 12 );
1310
UxPutForeground( label7, TextForeground );
1311
UxPutAlignment( label7, "alignment_beginning" );
1312
UxPutLabelString( label7, "GENERAL PARAMETERS" );
1313
UxPutFontList( label7, TextFont );
1314
UxPutBackground( label7, LabelBackground );
1315
UxPutHeight( label7, 30 );
1316
UxPutWidth( label7, 180 );
1317
UxPutY( label7, 8 );
1318
UxPutX( label7, 2 );
1322
/*******************************************************************************
1323
The 'build_' function creates all the swidgets and X widgets,
1324
and sets their properties to the values specified in the
1326
*******************************************************************************/
1328
static swidget _Uxbuild_ApplicWindow()
1330
/* Create the swidgets */
1332
ApplicWindow = UxCreateApplicationShell( "ApplicWindow", NO_PARENT );
1333
UxPutContext( ApplicWindow, UxApplicWindowContext );
1335
MainWindow = UxCreateMainWindow( "MainWindow", ApplicWindow );
1336
menu1 = UxCreateRowColumn( "menu1", MainWindow );
1337
menu1_p1 = UxCreateRowColumn( "menu1_p1", menu1 );
1338
menu1_p1_b1 = UxCreatePushButtonGadget( "menu1_p1_b1", menu1_p1 );
1339
menu1_p1_b2 = UxCreatePushButtonGadget( "menu1_p1_b2", menu1_p1 );
1340
menu1_p1_b3 = UxCreatePushButtonGadget( "menu1_p1_b3", menu1_p1 );
1341
menu1_p1_b4 = UxCreatePushButtonGadget( "menu1_p1_b4", menu1_p1 );
1342
menu1_top_b1 = UxCreateCascadeButton( "menu1_top_b1", menu1 );
1343
menu1_p4 = UxCreateRowColumn( "menu1_p4", menu1 );
1344
menu1_p4_b1 = UxCreatePushButtonGadget( "menu1_p4_b1", menu1_p4 );
1345
menu1_p4_b2 = UxCreatePushButtonGadget( "menu1_p4_b2", menu1_p4 );
1346
menu1_p4_b8 = UxCreateSeparatorGadget( "menu1_p4_b8", menu1_p4 );
1347
menu1_p4_b10 = UxCreatePushButtonGadget( "menu1_p4_b10", menu1_p4 );
1348
menu1_p4_b13 = UxCreatePushButtonGadget( "menu1_p4_b13", menu1_p4 );
1349
menu1_p4_b12 = UxCreateSeparatorGadget( "menu1_p4_b12", menu1_p4 );
1350
menu1_p4_b3 = UxCreatePushButtonGadget( "menu1_p4_b3", menu1_p4 );
1351
menu1_p4_b4 = UxCreatePushButtonGadget( "menu1_p4_b4", menu1_p4 );
1352
menu1_p4_b9 = UxCreateSeparatorGadget( "menu1_p4_b9", menu1_p4 );
1353
menu1_p4_b5 = UxCreatePushButtonGadget( "menu1_p4_b5", menu1_p4 );
1354
menu1_p4_b11 = UxCreatePushButtonGadget( "menu1_p4_b11", menu1_p4 );
1355
menu1_p4_b14 = UxCreateSeparatorGadget( "menu1_p4_b14", menu1_p4 );
1356
menu1_p4_b15 = UxCreatePushButtonGadget( "menu1_p4_b15", menu1_p4 );
1357
menu1_top_b4 = UxCreateCascadeButton( "menu1_top_b4", menu1 );
1358
menu1_p5 = UxCreateRowColumn( "menu1_p5", menu1 );
1359
menu_help_context = UxCreatePushButtonGadget( "menu_help_context", menu1_p5 );
1360
menu_help_help = UxCreatePushButtonGadget( "menu_help_help", menu1_p5 );
1361
menu1_p5_b5 = UxCreateSeparatorGadget( "menu1_p5_b5", menu1_p5 );
1362
menu_help_tutorial = UxCreatePushButtonGadget( "menu_help_tutorial", menu1_p5 );
1363
menu_help_version = UxCreatePushButtonGadget( "menu_help_version", menu1_p5 );
1364
menu1_top_b5 = UxCreateCascadeButton( "menu1_top_b5", menu1 );
1365
form1 = UxCreateForm( "form1", MainWindow );
1366
form5 = UxCreateForm( "form5", form1 );
1367
pb_main_search = UxCreatePushButton( "pb_main_search", form5 );
1368
pb_main_ident = UxCreatePushButton( "pb_main_ident", form5 );
1369
pb_main_calib = UxCreatePushButton( "pb_main_calib", form5 );
1370
pb_main_rebin = UxCreatePushButton( "pb_main_rebin", form5 );
1371
pb_main_extract = UxCreatePushButton( "pb_main_extract", form5 );
1372
pb_main_flux = UxCreatePushButton( "pb_main_flux", form5 );
1373
pb_main_batch = UxCreatePushButton( "pb_main_batch", form5 );
1374
separator12 = UxCreateSeparator( "separator12", form1 );
1375
shelp_main = UxCreateText( "shelp_main", form1 );
1376
separator1 = UxCreateSeparator( "separator1", form1 );
1377
tf_imin = UxCreateTextField( "tf_imin", form1 );
1378
label6 = UxCreateLabel( "label6", form1 );
1379
tf_wrang1 = UxCreateTextField( "tf_wrang1", form1 );
1380
label5 = UxCreateLabel( "label5", form1 );
1381
tf_wrang2 = UxCreateTextField( "tf_wrang2", form1 );
1382
tf_lincat = UxCreateTextField( "tf_lincat", form1 );
1383
label4 = UxCreateLabel( "label4", form1 );
1384
tf_ystart = UxCreateTextField( "tf_ystart", form1 );
1385
label3 = UxCreateLabel( "label3", form1 );
1386
tf_instrume = UxCreateTextField( "tf_instrume", form1 );
1387
label8 = UxCreateLabel( "label8", form1 );
1388
label1 = UxCreateLabel( "label1", form1 );
1389
tf_wlc = UxCreateTextField( "tf_wlc", form1 );
1390
tf_session = UxCreateTextField( "tf_session", form1 );
1391
label2 = UxCreateLabel( "label2", form1 );
1392
label7 = UxCreateLabel( "label7", form1 );
1394
_Uxinit_ApplicWindow();
1396
/* Create the X widgets */
1398
UxCreateWidget( ApplicWindow );
1399
UxCreateWidget( MainWindow );
1400
UxCreateWidget( menu1 );
1401
UxCreateWidget( menu1_p1 );
1402
UxCreateWidget( menu1_p1_b1 );
1403
UxCreateWidget( menu1_p1_b2 );
1404
UxCreateWidget( menu1_p1_b3 );
1405
UxCreateWidget( menu1_p1_b4 );
1406
UxPutSubMenuId( menu1_top_b1, "menu1_p1" );
1407
UxCreateWidget( menu1_top_b1 );
1409
UxCreateWidget( menu1_p4 );
1410
UxCreateWidget( menu1_p4_b1 );
1411
UxCreateWidget( menu1_p4_b2 );
1412
UxCreateWidget( menu1_p4_b8 );
1413
UxCreateWidget( menu1_p4_b10 );
1414
UxCreateWidget( menu1_p4_b13 );
1415
UxCreateWidget( menu1_p4_b12 );
1416
UxCreateWidget( menu1_p4_b3 );
1417
UxCreateWidget( menu1_p4_b4 );
1418
UxCreateWidget( menu1_p4_b9 );
1419
UxCreateWidget( menu1_p4_b5 );
1420
UxCreateWidget( menu1_p4_b11 );
1421
UxCreateWidget( menu1_p4_b14 );
1422
UxCreateWidget( menu1_p4_b15 );
1423
UxPutSubMenuId( menu1_top_b4, "menu1_p4" );
1424
UxCreateWidget( menu1_top_b4 );
1426
UxCreateWidget( menu1_p5 );
1427
UxCreateWidget( menu_help_context );
1428
UxCreateWidget( menu_help_help );
1429
UxCreateWidget( menu1_p5_b5 );
1430
UxCreateWidget( menu_help_tutorial );
1431
UxCreateWidget( menu_help_version );
1432
UxPutSubMenuId( menu1_top_b5, "menu1_p5" );
1433
UxCreateWidget( menu1_top_b5 );
1435
UxCreateWidget( form1 );
1436
UxPutBottomAttachment( form5, "attach_form" );
1437
UxCreateWidget( form5 );
1439
UxCreateWidget( pb_main_search );
1440
UxCreateWidget( pb_main_ident );
1441
UxCreateWidget( pb_main_calib );
1442
UxCreateWidget( pb_main_rebin );
1443
UxCreateWidget( pb_main_extract );
1444
UxCreateWidget( pb_main_flux );
1445
UxCreateWidget( pb_main_batch );
1446
UxPutBottomWidget( separator12, "form5" );
1447
UxPutBottomAttachment( separator12, "attach_widget" );
1448
UxCreateWidget( separator12 );
1450
UxPutBottomWidget( shelp_main, "separator12" );
1451
UxPutBottomAttachment( shelp_main, "attach_widget" );
1452
UxCreateWidget( shelp_main );
1454
UxPutBottomWidget( separator1, "shelp_main" );
1455
UxPutBottomAttachment( separator1, "attach_widget" );
1456
UxCreateWidget( separator1 );
1458
UxPutBottomWidget( tf_imin, "separator1" );
1459
UxPutBottomAttachment( tf_imin, "attach_widget" );
1460
UxCreateWidget( tf_imin );
1462
UxPutBottomWidget( label6, "separator1" );
1463
UxPutBottomAttachment( label6, "attach_widget" );
1464
UxCreateWidget( label6 );
1466
UxPutBottomWidget( tf_wrang1, "tf_imin" );
1467
UxPutBottomAttachment( tf_wrang1, "attach_widget" );
1468
UxCreateWidget( tf_wrang1 );
1470
UxPutBottomWidget( label5, "tf_imin" );
1471
UxPutBottomAttachment( label5, "attach_widget" );
1472
UxCreateWidget( label5 );
1474
UxPutBottomWidget( tf_wrang2, "tf_imin" );
1475
UxPutBottomAttachment( tf_wrang2, "attach_widget" );
1476
UxCreateWidget( tf_wrang2 );
1478
UxPutBottomWidget( tf_lincat, "tf_wrang1" );
1479
UxPutBottomAttachment( tf_lincat, "attach_widget" );
1480
UxCreateWidget( tf_lincat );
1482
UxPutBottomWidget( label4, "tf_wrang1" );
1483
UxPutBottomAttachment( label4, "attach_widget" );
1484
UxCreateWidget( label4 );
1486
UxPutBottomWidget( tf_ystart, "tf_lincat" );
1487
UxPutBottomAttachment( tf_ystart, "attach_widget" );
1488
UxCreateWidget( tf_ystart );
1490
UxPutBottomWidget( label3, "tf_lincat" );
1491
UxPutBottomAttachment( label3, "attach_widget" );
1492
UxCreateWidget( label3 );
1494
UxPutBottomWidget( tf_instrume, "tf_ystart" );
1495
UxPutBottomAttachment( tf_instrume, "attach_widget" );
1496
UxCreateWidget( tf_instrume );
1498
UxPutBottomWidget( label8, "tf_ystart" );
1499
UxPutBottomAttachment( label8, "attach_widget" );
1500
UxCreateWidget( label8 );
1502
UxPutBottomWidget( label1, "tf_instrume" );
1503
UxPutBottomAttachment( label1, "attach_widget" );
1504
UxCreateWidget( label1 );
1506
UxPutBottomWidget( tf_wlc, "tf_instrume" );
1507
UxPutBottomAttachment( tf_wlc, "attach_widget" );
1508
UxCreateWidget( tf_wlc );
1510
UxPutBottomWidget( tf_session, "tf_wlc" );
1511
UxPutBottomAttachment( tf_session, "attach_widget" );
1512
UxCreateWidget( tf_session );
1514
UxPutBottomWidget( label2, "tf_wlc" );
1515
UxPutBottomAttachment( label2, "attach_widget" );
1516
UxCreateWidget( label2 );
1518
UxPutBottomWidget( label7, "tf_session" );
1519
UxPutBottomAttachment( label7, "attach_widget" );
1520
UxCreateWidget( label7 );
1523
UxPutMenuHelpWidget( menu1, "menu1_top_b5" );
1525
UxAddCallback( menu1_p1_b1, XmNactivateCallback,
1526
activateCB_menu1_p1_b1,
1527
(XtPointer) UxApplicWindowContext );
1529
UxAddCallback( menu1_p1_b2, XmNactivateCallback,
1530
activateCB_menu1_p1_b2,
1531
(XtPointer) UxApplicWindowContext );
1533
UxAddCallback( menu1_p1_b3, XmNactivateCallback,
1534
activateCB_menu1_p1_b3,
1535
(XtPointer) UxApplicWindowContext );
1537
UxAddCallback( menu1_p1_b4, XmNactivateCallback,
1538
activateCB_menu1_p1_b4,
1539
(XtPointer) UxApplicWindowContext );
1541
UxAddCallback( menu1_p4_b1, XmNactivateCallback,
1542
activateCB_menu1_p4_b1,
1543
(XtPointer) UxApplicWindowContext );
1545
UxAddCallback( menu1_p4_b2, XmNactivateCallback,
1546
activateCB_menu1_p4_b2,
1547
(XtPointer) UxApplicWindowContext );
1549
UxAddCallback( menu1_p4_b10, XmNactivateCallback,
1550
activateCB_menu1_p4_b10,
1551
(XtPointer) UxApplicWindowContext );
1553
UxAddCallback( menu1_p4_b13, XmNactivateCallback,
1554
activateCB_menu1_p4_b13,
1555
(XtPointer) UxApplicWindowContext );
1557
UxAddCallback( menu1_p4_b3, XmNactivateCallback,
1558
activateCB_menu1_p4_b3,
1559
(XtPointer) UxApplicWindowContext );
1561
UxAddCallback( menu1_p4_b4, XmNactivateCallback,
1562
activateCB_menu1_p4_b4,
1563
(XtPointer) UxApplicWindowContext );
1565
UxAddCallback( menu1_p4_b5, XmNactivateCallback,
1566
activateCB_menu1_p4_b5,
1567
(XtPointer) UxApplicWindowContext );
1569
UxAddCallback( menu1_p4_b11, XmNactivateCallback,
1570
activateCB_menu1_p4_b11,
1571
(XtPointer) UxApplicWindowContext );
1573
UxAddCallback( menu1_p4_b15, XmNactivateCallback,
1574
activateCB_menu1_p4_b15,
1575
(XtPointer) UxApplicWindowContext );
1577
UxAddCallback( menu_help_context, XmNactivateCallback,
1578
activateCB_menu_help_context,
1579
(XtPointer) UxApplicWindowContext );
1581
UxAddCallback( menu_help_help, XmNactivateCallback,
1582
activateCB_menu_help_help,
1583
(XtPointer) UxApplicWindowContext );
1585
UxAddCallback( menu_help_tutorial, XmNactivateCallback,
1586
activateCB_menu_help_tutorial,
1587
(XtPointer) UxApplicWindowContext );
1589
UxAddCallback( menu_help_version, XmNactivateCallback,
1590
activateCB_menu_help_version,
1591
(XtPointer) UxApplicWindowContext );
1593
UxAddCallback( pb_main_search, XmNactivateCallback,
1594
activateCB_pb_main_search,
1595
(XtPointer) UxApplicWindowContext );
1597
UxAddCallback( pb_main_ident, XmNactivateCallback,
1598
activateCB_pb_main_ident,
1599
(XtPointer) UxApplicWindowContext );
1601
UxAddCallback( pb_main_calib, XmNactivateCallback,
1602
activateCB_pb_main_calib,
1603
(XtPointer) UxApplicWindowContext );
1605
UxAddCallback( pb_main_rebin, XmNactivateCallback,
1606
activateCB_pb_main_rebin,
1607
(XtPointer) UxApplicWindowContext );
1609
UxAddCallback( pb_main_extract, XmNactivateCallback,
1610
activateCB_pb_main_extract,
1611
(XtPointer) UxApplicWindowContext );
1613
UxAddCallback( pb_main_flux, XmNactivateCallback,
1614
activateCB_pb_main_flux,
1615
(XtPointer) UxApplicWindowContext );
1617
UxAddCallback( pb_main_batch, XmNactivateCallback,
1618
activateCB_pb_main_batch,
1619
(XtPointer) UxApplicWindowContext );
1621
UxAddCallback( tf_imin, XmNlosingFocusCallback,
1622
losingFocusCB_tf_imin,
1623
(XtPointer) UxApplicWindowContext );
1625
UxAddCallback( tf_wrang1, XmNlosingFocusCallback,
1626
losingFocusCB_tf_wrang1,
1627
(XtPointer) UxApplicWindowContext );
1629
UxAddCallback( tf_wrang2, XmNlosingFocusCallback,
1630
losingFocusCB_tf_wrang2,
1631
(XtPointer) UxApplicWindowContext );
1633
UxAddCallback( tf_lincat, XmNlosingFocusCallback,
1634
losingFocusCB_tf_lincat,
1635
(XtPointer) UxApplicWindowContext );
1637
UxAddCallback( tf_ystart, XmNlosingFocusCallback,
1638
losingFocusCB_tf_ystart,
1639
(XtPointer) UxApplicWindowContext );
1642
/* Finally, call UxRealizeInterface to create the X windows
1643
for the widgets created above. */
1645
UxRealizeInterface( ApplicWindow );
1647
UxMainWindowSetAreas( MainWindow, menu1, NULL_SWIDGET,
1648
NULL_SWIDGET, NULL_SWIDGET, form1 );
1649
return ( ApplicWindow );
1652
/*******************************************************************************
1653
The following function includes the code that was entered
1654
in the 'Initial Code' and 'Final Code' sections of the
1655
Declarations Editor. This function is called from the
1656
'Interface function' below.
1657
*******************************************************************************/
1659
static swidget _Ux_create_ApplicWindow()
1662
_UxCApplicWindow *UxContext;
1664
UxApplicWindowContext = UxContext =
1665
(_UxCApplicWindow *) UxMalloc( sizeof(_UxCApplicWindow) );
1668
extern swidget create_SearchShell();
1669
extern swidget create_CalibShell();
1670
extern swidget create_RebinShell();
1671
extern swidget create_FluxShell();
1672
extern swidget create_file_dialog();
1673
extern swidget create_extin_dialog();
1674
extern swidget create_resid_dialog();
1675
extern swidget create_ExtractShell();
1676
extern swidget create_HelpShell();
1677
rtrn = _Uxbuild_ApplicWindow();
1679
create_SearchShell();
1680
create_CalibShell();
1681
create_RebinShell();
1683
create_file_dialog();
1684
create_extin_dialog();
1685
create_resid_dialog();
1686
create_ExtractShell();
1693
/*******************************************************************************
1694
The following is the 'Interface function' which is the
1695
external entry point for creating this interface.
1696
This function should be called from your application or from
1697
a callback function.
1698
*******************************************************************************/
1700
swidget create_ApplicWindow()
1703
static int _Uxinit = 0;
1707
static XtActionsRec _Uxactions[] = {
1708
{ "ExtendedHelp", action_ExtendedHelp },
1709
{ "WriteHelp", action_WriteHelp },
1710
{ "ClearHelp", action_ClearHelp },
1711
{ "FileSelectACT", action_FileSelectACT }
1714
XtAppAddActions( UxAppContext,
1716
XtNumber(_Uxactions) );
1721
_Uxrtrn = _Ux_create_ApplicWindow();
1726
/*******************************************************************************
1728
*******************************************************************************/