~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to gui/XFilter/src/BlackBody.c

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*===========================================================================
 
2
  Copyright (C) 1995-2009 European Southern Observatory (ESO)
 
3
 
 
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.
 
8
 
 
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.
 
13
 
 
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, 
 
17
  MA 02139, USA.
 
18
 
 
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 
 
25
                        GERMANY
 
26
===========================================================================*/
 
27
 
 
28
 
 
29
/*******************************************************************************
 
30
        BlackBody.c
 
31
 
 
32
.VERSION
 
33
 090826         last modif
 
34
 
 
35
*******************************************************************************/
 
36
 
 
37
#include <stdio.h>
 
38
#include "UxLib.h"
 
39
#include "UxText.h"
 
40
#include "UxLabel.h"
 
41
#include "UxSep.h"
 
42
#include "UxPushB.h"
 
43
#include "UxForm.h"
 
44
#include "UxApplSh.h"
 
45
 
 
46
/*******************************************************************************
 
47
        Includes, Defines, and Global variables from the Declarations Editor:
 
48
*******************************************************************************/
 
49
 
 
50
#include <ExternResources.h>
 
51
#include <model.h>
 
52
#include <global.h>
 
53
 
 
54
extern void do_bbody();
 
55
 
 
56
 
 
57
 
 
58
extern struct s_bbody N;
 
59
 
 
60
/*******************************************************************************
 
61
        The definition of the context structure:
 
62
        If you create multiple instances of your interface, the context
 
63
        structure ensures that your callbacks use the variables for the
 
64
        correct instance.
 
65
 
 
66
        For each swidget in the interface, each argument to the Interface
 
67
        function, and each variable in the Instance Specific section of the
 
68
        Declarations Editor, there is an entry in the context structure.
 
69
        and a #define.  The #define makes the variable name refer to the
 
70
        corresponding entry in the context structure.
 
71
*******************************************************************************/
 
72
 
 
73
typedef struct
 
74
{
 
75
        swidget Uxform7;
 
76
        swidget Uxform8;
 
77
        swidget UxApplyBB;
 
78
        swidget UxCancelBB;
 
79
        swidget Uxseparator9;
 
80
        swidget Uxlbl_T;
 
81
        swidget Uxlbl_Dist;
 
82
        swidget Uxtf_T;
 
83
        swidget Uxtf_Dist;
 
84
        swidget Uxlbl_radius;
 
85
        swidget Uxlbl_wr;
 
86
        swidget Uxtf_radius;
 
87
        swidget Uxtf_wrmin;
 
88
        swidget Uxtf_wrmax;
 
89
} _UxCBlackBody;
 
90
 
 
91
#define form7                   UxBlackBodyContext->Uxform7
 
92
#define form8                   UxBlackBodyContext->Uxform8
 
93
#define ApplyBB                 UxBlackBodyContext->UxApplyBB
 
94
#define CancelBB                UxBlackBodyContext->UxCancelBB
 
95
#define separator9              UxBlackBodyContext->Uxseparator9
 
96
#define lbl_T                   UxBlackBodyContext->Uxlbl_T
 
97
#define lbl_Dist                UxBlackBodyContext->Uxlbl_Dist
 
98
#define tf_T                    UxBlackBodyContext->Uxtf_T
 
99
#define tf_Dist                 UxBlackBodyContext->Uxtf_Dist
 
100
#define lbl_radius              UxBlackBodyContext->Uxlbl_radius
 
101
#define lbl_wr                  UxBlackBodyContext->Uxlbl_wr
 
102
#define tf_radius               UxBlackBodyContext->Uxtf_radius
 
103
#define tf_wrmin                UxBlackBodyContext->Uxtf_wrmin
 
104
#define tf_wrmax                UxBlackBodyContext->Uxtf_wrmax
 
105
 
 
106
static _UxCBlackBody    *UxBlackBodyContext;
 
107
 
 
108
swidget BlackBody;
 
109
 
 
110
/*******************************************************************************
 
111
        The following are translation tables.
 
112
*******************************************************************************/
 
113
 
 
114
static char     *BBtext_tab = "#override\n\
 
115
<Key>Delete:delete-previous-character()\n\
 
116
<Key>BackSpace:delete-previous-character()\n\
 
117
<Key>osfBackSpace:delete-previous-character()\n\
 
118
<Key>osfDelete:delete-previous-character()\n";
 
119
 
 
120
/*******************************************************************************
 
121
        Forward declarations of functions that are defined later in this file.
 
122
*******************************************************************************/
 
123
 
 
124
swidget create_BlackBody();
 
125
 
 
126
/*******************************************************************************
 
127
        The following are callback functions.
 
128
*******************************************************************************/
 
129
 
 
130
static void     activateCB_ApplyBB( UxWidget, UxClientData, UxCallbackArg )
 
131
        Widget          UxWidget;
 
132
        XtPointer       UxClientData, UxCallbackArg;
 
133
{
 
134
        _UxCBlackBody           *UxSaveCtx, *UxContext;
 
135
        swidget                 UxThisWidget;
 
136
 
 
137
        UxThisWidget = UxWidgetToSwidget( UxWidget );
 
138
        UxSaveCtx = UxBlackBodyContext;
 
139
        UxBlackBodyContext = UxContext =
 
140
                        (_UxCBlackBody *) UxGetContext( UxThisWidget );
 
141
        {
 
142
        do_bbody();
 
143
        }
 
144
        UxBlackBodyContext = UxSaveCtx;
 
145
}
 
146
 
 
147
static void     activateCB_CancelBB( UxWidget, UxClientData, UxCallbackArg )
 
148
        Widget          UxWidget;
 
149
        XtPointer       UxClientData, UxCallbackArg;
 
150
{
 
151
        _UxCBlackBody           *UxSaveCtx, *UxContext;
 
152
        swidget                 UxThisWidget;
 
153
 
 
154
        UxThisWidget = UxWidgetToSwidget( UxWidget );
 
155
        UxSaveCtx = UxBlackBodyContext;
 
156
        UxBlackBodyContext = UxContext =
 
157
                        (_UxCBlackBody *) UxGetContext( UxThisWidget );
 
158
        {
 
159
        UxPopdownInterface(BlackBody);
 
160
        }
 
161
        UxBlackBodyContext = UxSaveCtx;
 
162
}
 
163
 
 
164
static void     losingFocusCB_tf_T( UxWidget, UxClientData, UxCallbackArg )
 
165
        Widget          UxWidget;
 
166
        XtPointer       UxClientData, UxCallbackArg;
 
167
{
 
168
        _UxCBlackBody           *UxSaveCtx, *UxContext;
 
169
        swidget                 UxThisWidget;
 
170
 
 
171
        UxThisWidget = UxWidgetToSwidget( UxWidget );
 
172
        UxSaveCtx = UxBlackBodyContext;
 
173
        UxBlackBodyContext = UxContext =
 
174
                        (_UxCBlackBody *) UxGetContext( UxThisWidget );
 
175
        {
 
176
        
 
177
        int nid;
 
178
        char am[10];
 
179
        float temp;
 
180
        
 
181
        nid=sscanf(UxGetText(UxFindSwidget("tf_T")),"%f",&temp);
 
182
        if (nid==1)
 
183
                {
 
184
                if ((temp>=1000.)&&(temp<=100000.))
 
185
                        N.T=temp;
 
186
                else if (temp<1000.)
 
187
                        N.T=1000.;
 
188
                else if (temp>10000.)
 
189
                        N.T=10000.;
 
190
                }
 
191
        
 
192
        sprintf(am,"%.1f",N.T);
 
193
        UxPutText(UxFindSwidget("tf_T"),am);
 
194
        
 
195
        }
 
196
        UxBlackBodyContext = UxSaveCtx;
 
197
}
 
198
 
 
199
static void     losingFocusCB_tf_Dist( UxWidget, UxClientData, UxCallbackArg )
 
200
        Widget          UxWidget;
 
201
        XtPointer       UxClientData, UxCallbackArg;
 
202
{
 
203
        _UxCBlackBody           *UxSaveCtx, *UxContext;
 
204
        swidget                 UxThisWidget;
 
205
 
 
206
        UxThisWidget = UxWidgetToSwidget( UxWidget );
 
207
        UxSaveCtx = UxBlackBodyContext;
 
208
        UxBlackBodyContext = UxContext =
 
209
                        (_UxCBlackBody *) UxGetContext( UxThisWidget );
 
210
        {
 
211
        int nid;
 
212
        char am[10];
 
213
        float real;
 
214
        
 
215
        nid=sscanf(UxGetText(UxFindSwidget("tf_Dist")),"%f",&real);
 
216
        if (nid==1)
 
217
                {
 
218
                if ((real>=.01)&&(real<=10000.))
 
219
                        N.dist=real;
 
220
                else if (real<.01)
 
221
                        N.dist=.01;
 
222
                else if (real>10000.)
 
223
                        N.dist=10000.;
 
224
                }
 
225
        
 
226
        sprintf(am,"%.2f",N.dist);
 
227
        UxPutText(UxFindSwidget("tf_Dist"),am);
 
228
        
 
229
        }
 
230
        UxBlackBodyContext = UxSaveCtx;
 
231
}
 
232
 
 
233
static void     losingFocusCB_tf_radius( UxWidget, UxClientData, UxCallbackArg )
 
234
        Widget          UxWidget;
 
235
        XtPointer       UxClientData, UxCallbackArg;
 
236
{
 
237
        _UxCBlackBody           *UxSaveCtx, *UxContext;
 
238
        swidget                 UxThisWidget;
 
239
 
 
240
        UxThisWidget = UxWidgetToSwidget( UxWidget );
 
241
        UxSaveCtx = UxBlackBodyContext;
 
242
        UxBlackBodyContext = UxContext =
 
243
                        (_UxCBlackBody *) UxGetContext( UxThisWidget );
 
244
        {
 
245
        
 
246
        int nid;
 
247
        char am[10];
 
248
        float real;
 
249
        
 
250
        nid=sscanf(UxGetText(UxFindSwidget("tf_radius")),"%f",&real);
 
251
        if (nid==1)
 
252
                {
 
253
                if ((real>=.01)&&(real<=10000.))
 
254
                        N.radius=real;
 
255
                else if (real<.01)
 
256
                        N.radius=.01;
 
257
                else if (real>10000.)
 
258
                        N.radius=10000.;
 
259
                }
 
260
        
 
261
        sprintf(am,"%.2f",N.radius);
 
262
        UxPutText(UxFindSwidget("tf_radius"),am);
 
263
        
 
264
        }
 
265
        UxBlackBodyContext = UxSaveCtx;
 
266
}
 
267
 
 
268
static void     losingFocusCB_tf_wrmin( UxWidget, UxClientData, UxCallbackArg )
 
269
        Widget          UxWidget;
 
270
        XtPointer       UxClientData, UxCallbackArg;
 
271
{
 
272
        _UxCBlackBody           *UxSaveCtx, *UxContext;
 
273
        swidget                 UxThisWidget;
 
274
 
 
275
        UxThisWidget = UxWidgetToSwidget( UxWidget );
 
276
        UxSaveCtx = UxBlackBodyContext;
 
277
        UxBlackBodyContext = UxContext =
 
278
                        (_UxCBlackBody *) UxGetContext( UxThisWidget );
 
279
        {
 
280
        int nid;
 
281
        char am[10];
 
282
        float minw;
 
283
        
 
284
        nid=sscanf(UxGetText(UxFindSwidget("tf_wrmin")),"%f",&minw);
 
285
        if (nid==1)
 
286
                {
 
287
                if ((minw>=300.)&&(minw<=1200.))
 
288
                        N.wrmin=minw;
 
289
                else if (minw<300.)
 
290
                        N.wrmin=300.;
 
291
                else if (minw>1200.)
 
292
                        N.wrmin=1200.;
 
293
                }
 
294
        
 
295
        sprintf(am,"%.1f",N.wrmin);
 
296
        UxPutText(UxFindSwidget("tf_wrmin"),am);
 
297
        
 
298
        
 
299
        }
 
300
        UxBlackBodyContext = UxSaveCtx;
 
301
}
 
302
 
 
303
static void     losingFocusCB_tf_wrmax( UxWidget, UxClientData, UxCallbackArg )
 
304
        Widget          UxWidget;
 
305
        XtPointer       UxClientData, UxCallbackArg;
 
306
{
 
307
        _UxCBlackBody           *UxSaveCtx, *UxContext;
 
308
        swidget                 UxThisWidget;
 
309
 
 
310
        UxThisWidget = UxWidgetToSwidget( UxWidget );
 
311
        UxSaveCtx = UxBlackBodyContext;
 
312
        UxBlackBodyContext = UxContext =
 
313
                        (_UxCBlackBody *) UxGetContext( UxThisWidget );
 
314
        {
 
315
        
 
316
        int nid;
 
317
        char am[20];
 
318
        float maxw;
 
319
        
 
320
        nid=sscanf(UxGetText(UxFindSwidget("tf_wrmax")),"%f",&maxw);
 
321
        if (nid==1)
 
322
                {
 
323
                if ((maxw>=300.)&&(maxw<=1200.))
 
324
                        N.wrmax=maxw;
 
325
                else if (maxw<300.)
 
326
                        N.wrmax=300.;
 
327
                else if (maxw>1200.)
 
328
                        N.wrmax=1200.;
 
329
                }
 
330
        
 
331
        sprintf(am,"%.1f",N.wrmax);
 
332
        UxPutText(UxFindSwidget("tf_wrmax"),am);
 
333
        
 
334
        
 
335
        }
 
336
        UxBlackBodyContext = UxSaveCtx;
 
337
}
 
338
 
 
339
/*******************************************************************************
 
340
        The 'init_' function sets the private properties for all the
 
341
        swidgets to the values specified in the Property Table.
 
342
        Some properties need to be set after the X widgets have been
 
343
        created and the setting of these properties is done in the
 
344
        'build_' function after the UxCreateWidget call.
 
345
*******************************************************************************/
 
346
 
 
347
static void     _Uxinit_BlackBody()
 
348
{
 
349
        UxPutBackground( BlackBody, WindowBackground );
 
350
        UxPutBorderColor( BlackBody, WindowBackground );
 
351
        UxPutKeyboardFocusPolicy( BlackBody, "pointer" );
 
352
        UxPutIconName( BlackBody, "Black Body" );
 
353
        UxPutHeight( BlackBody, 230 );
 
354
        UxPutWidth( BlackBody, 380 );
 
355
        UxPutY( BlackBody, 165 );
 
356
        UxPutX( BlackBody, 430 );
 
357
 
 
358
        UxPutBorderColor( form7, WindowBackground );
 
359
        UxPutBackground( form7, WindowBackground );
 
360
        UxPutHeight( form7, 548 );
 
361
        UxPutWidth( form7, 490 );
 
362
        UxPutY( form7, 4 );
 
363
        UxPutX( form7, 4 );
 
364
        UxPutUnitType( form7, "pixels" );
 
365
        UxPutResizePolicy( form7, "resize_none" );
 
366
 
 
367
        UxPutBorderColor( form8, ButtonBackground );
 
368
        UxPutBackground( form8, ButtonBackground );
 
369
        UxPutHeight( form8, 44 );
 
370
        UxPutWidth( form8, 490 );
 
371
        UxPutY( form8, 150 );
 
372
        UxPutX( form8, 0 );
 
373
        UxPutResizePolicy( form8, "resize_none" );
 
374
 
 
375
        UxPutLabelString( ApplyBB, "Apply" );
 
376
        UxPutForeground( ApplyBB, ApplyForeground );
 
377
        UxPutFontList( ApplyBB, BoldTextFont );
 
378
        UxPutBorderColor( ApplyBB, ButtonBackground );
 
379
        UxPutBackground( ApplyBB, ButtonBackground );
 
380
        UxPutHeight( ApplyBB, 30 );
 
381
        UxPutWidth( ApplyBB, 80 );
 
382
        UxPutY( ApplyBB, 6 );
 
383
        UxPutX( ApplyBB, 10 );
 
384
 
 
385
        UxPutLabelString( CancelBB, "Cancel" );
 
386
        UxPutForeground( CancelBB, CancelForeground );
 
387
        UxPutFontList( CancelBB, BoldTextFont );
 
388
        UxPutBorderColor( CancelBB, ButtonBackground );
 
389
        UxPutBackground( CancelBB, ButtonBackground );
 
390
        UxPutHeight( CancelBB, 30 );
 
391
        UxPutWidth( CancelBB, 86 );
 
392
        UxPutY( CancelBB, 6 );
 
393
        UxPutX( CancelBB, 110 );
 
394
 
 
395
        UxPutBorderColor( separator9, WindowBackground );
 
396
        UxPutBackground( separator9, WindowBackground );
 
397
        UxPutHeight( separator9, 10 );
 
398
        UxPutWidth( separator9, 492 );
 
399
        UxPutY( separator9, 140 );
 
400
        UxPutX( separator9, 0 );
 
401
 
 
402
        UxPutForeground( lbl_T, TextForeground );
 
403
        UxPutAlignment( lbl_T, "alignment_beginning" );
 
404
        UxPutLabelString( lbl_T, "Temperature (K) :" );
 
405
        UxPutFontList( lbl_T, TextFont );
 
406
        UxPutBorderColor( lbl_T, LabelBackground );
 
407
        UxPutBackground( lbl_T, LabelBackground );
 
408
        UxPutHeight( lbl_T, 30 );
 
409
        UxPutWidth( lbl_T, 126 );
 
410
        UxPutY( lbl_T, 10 );
 
411
        UxPutX( lbl_T, 10 );
 
412
 
 
413
        UxPutForeground( lbl_Dist, TextForeground );
 
414
        UxPutAlignment( lbl_Dist, "alignment_beginning" );
 
415
        UxPutLabelString( lbl_Dist, "Distance (pc) :" );
 
416
        UxPutFontList( lbl_Dist, TextFont );
 
417
        UxPutBorderColor( lbl_Dist, LabelBackground );
 
418
        UxPutBackground( lbl_Dist, LabelBackground );
 
419
        UxPutHeight( lbl_Dist, 30 );
 
420
        UxPutWidth( lbl_Dist, 104 );
 
421
        UxPutY( lbl_Dist, 50 );
 
422
        UxPutX( lbl_Dist, 10 );
 
423
 
 
424
        UxPutTranslations( tf_T, BBtext_tab );
 
425
        UxPutSelectionArrayCount( tf_T, 3 );
 
426
        UxPutMaxLength( tf_T, 200 );
 
427
        UxPutForeground( tf_T, TextForeground );
 
428
        UxPutFontList( tf_T, TextFont );
 
429
        UxPutBorderColor( tf_T, TextBackground );
 
430
        UxPutBackground( tf_T, TextBackground );
 
431
        UxPutHeight( tf_T, 35 );
 
432
        UxPutWidth( tf_T, 80 );
 
433
        UxPutY( tf_T, 6 );
 
434
        UxPutX( tf_T, 190 );
 
435
 
 
436
        UxPutTranslations( tf_Dist, BBtext_tab );
 
437
        UxPutSelectionArrayCount( tf_Dist, 3 );
 
438
        UxPutMaxLength( tf_Dist, 200 );
 
439
        UxPutForeground( tf_Dist, TextForeground );
 
440
        UxPutFontList( tf_Dist, TextFont );
 
441
        UxPutBorderColor( tf_Dist, TextBackground );
 
442
        UxPutBackground( tf_Dist, TextBackground );
 
443
        UxPutHeight( tf_Dist, 35 );
 
444
        UxPutWidth( tf_Dist, 80 );
 
445
        UxPutY( tf_Dist, 48 );
 
446
        UxPutX( tf_Dist, 190 );
 
447
 
 
448
        UxPutForeground( lbl_radius, TextForeground );
 
449
        UxPutAlignment( lbl_radius, "alignment_beginning" );
 
450
        UxPutLabelString( lbl_radius, "Radius (solar unit) :" );
 
451
        UxPutFontList( lbl_radius, TextFont );
 
452
        UxPutBorderColor( lbl_radius, LabelBackground );
 
453
        UxPutBackground( lbl_radius, LabelBackground );
 
454
        UxPutHeight( lbl_radius, 30 );
 
455
        UxPutWidth( lbl_radius, 132 );
 
456
        UxPutY( lbl_radius, 90 );
 
457
        UxPutX( lbl_radius, 10 );
 
458
 
 
459
        UxPutForeground( lbl_wr, TextForeground );
 
460
        UxPutAlignment( lbl_wr, "alignment_beginning" );
 
461
        UxPutLabelString( lbl_wr, "Wavelength Range (nm):" );
 
462
        UxPutFontList( lbl_wr, TextFont );
 
463
        UxPutBorderColor( lbl_wr, LabelBackground );
 
464
        UxPutBackground( lbl_wr, LabelBackground );
 
465
        UxPutHeight( lbl_wr, 30 );
 
466
        UxPutWidth( lbl_wr, 170 );
 
467
        UxPutY( lbl_wr, 130 );
 
468
        UxPutX( lbl_wr, 10 );
 
469
 
 
470
        UxPutTranslations( tf_radius, BBtext_tab );
 
471
        UxPutSelectionArrayCount( tf_radius, 3 );
 
472
        UxPutMaxLength( tf_radius, 200 );
 
473
        UxPutForeground( tf_radius, TextForeground );
 
474
        UxPutFontList( tf_radius, TextFont );
 
475
        UxPutBorderColor( tf_radius, TextBackground );
 
476
        UxPutBackground( tf_radius, TextBackground );
 
477
        UxPutHeight( tf_radius, 35 );
 
478
        UxPutWidth( tf_radius, 80 );
 
479
        UxPutY( tf_radius, 88 );
 
480
        UxPutX( tf_radius, 190 );
 
481
 
 
482
        UxPutTranslations( tf_wrmin, BBtext_tab );
 
483
        UxPutSelectionArrayCount( tf_wrmin, 3 );
 
484
        UxPutMaxLength( tf_wrmin, 200 );
 
485
        UxPutForeground( tf_wrmin, TextForeground );
 
486
        UxPutFontList( tf_wrmin, TextFont );
 
487
        UxPutBorderColor( tf_wrmin, TextBackground );
 
488
        UxPutBackground( tf_wrmin, TextBackground );
 
489
        UxPutHeight( tf_wrmin, 35 );
 
490
        UxPutWidth( tf_wrmin, 80 );
 
491
        UxPutY( tf_wrmin, 128 );
 
492
        UxPutX( tf_wrmin, 190 );
 
493
 
 
494
        UxPutTranslations( tf_wrmax, BBtext_tab );
 
495
        UxPutSelectionArrayCount( tf_wrmax, 3 );
 
496
        UxPutMaxLength( tf_wrmax, 200 );
 
497
        UxPutForeground( tf_wrmax, TextForeground );
 
498
        UxPutFontList( tf_wrmax, TextFont );
 
499
        UxPutBorderColor( tf_wrmax, TextBackground );
 
500
        UxPutBackground( tf_wrmax, TextBackground );
 
501
        UxPutHeight( tf_wrmax, 35 );
 
502
        UxPutWidth( tf_wrmax, 80 );
 
503
        UxPutY( tf_wrmax, 128 );
 
504
        UxPutX( tf_wrmax, 278 );
 
505
 
 
506
}
 
507
 
 
508
/*******************************************************************************
 
509
        The 'build_' function creates all the swidgets and X widgets,
 
510
        and sets their properties to the values specified in the
 
511
        Property Editor.
 
512
*******************************************************************************/
 
513
 
 
514
static swidget  _Uxbuild_BlackBody()
 
515
{
 
516
        /* Create the swidgets */
 
517
 
 
518
        BlackBody = UxCreateApplicationShell( "BlackBody", NO_PARENT );
 
519
        UxPutContext( BlackBody, UxBlackBodyContext );
 
520
 
 
521
        form7 = UxCreateForm( "form7", BlackBody );
 
522
        form8 = UxCreateForm( "form8", form7 );
 
523
        ApplyBB = UxCreatePushButton( "ApplyBB", form8 );
 
524
        CancelBB = UxCreatePushButton( "CancelBB", form8 );
 
525
        separator9 = UxCreateSeparator( "separator9", form7 );
 
526
        lbl_T = UxCreateLabel( "lbl_T", form7 );
 
527
        lbl_Dist = UxCreateLabel( "lbl_Dist", form7 );
 
528
        tf_T = UxCreateText( "tf_T", form7 );
 
529
        tf_Dist = UxCreateText( "tf_Dist", form7 );
 
530
        lbl_radius = UxCreateLabel( "lbl_radius", form7 );
 
531
        lbl_wr = UxCreateLabel( "lbl_wr", form7 );
 
532
        tf_radius = UxCreateText( "tf_radius", form7 );
 
533
        tf_wrmin = UxCreateText( "tf_wrmin", form7 );
 
534
        tf_wrmax = UxCreateText( "tf_wrmax", form7 );
 
535
 
 
536
        _Uxinit_BlackBody();
 
537
 
 
538
        /* Create the X widgets */
 
539
 
 
540
        UxCreateWidget( BlackBody );
 
541
        UxCreateWidget( form7 );
 
542
        UxPutRightAttachment( form8, "attach_form" );
 
543
        UxPutLeftAttachment( form8, "attach_form" );
 
544
        UxPutBottomOffset( form8, 2 );
 
545
        UxPutBottomAttachment( form8, "attach_form" );
 
546
        UxCreateWidget( form8 );
 
547
 
 
548
        UxCreateWidget( ApplyBB );
 
549
        UxCreateWidget( CancelBB );
 
550
        UxPutRightAttachment( separator9, "attach_form" );
 
551
        UxPutLeftAttachment( separator9, "attach_form" );
 
552
        UxPutBottomWidget( separator9, "form8" );
 
553
        UxPutBottomOffset( separator9, 0 );
 
554
        UxPutBottomAttachment( separator9, "attach_widget" );
 
555
        UxCreateWidget( separator9 );
 
556
 
 
557
        UxCreateWidget( lbl_T );
 
558
        UxCreateWidget( lbl_Dist );
 
559
        UxCreateWidget( tf_T );
 
560
        UxCreateWidget( tf_Dist );
 
561
        UxCreateWidget( lbl_radius );
 
562
        UxCreateWidget( lbl_wr );
 
563
        UxCreateWidget( tf_radius );
 
564
        UxCreateWidget( tf_wrmin );
 
565
        UxCreateWidget( tf_wrmax );
 
566
 
 
567
        UxAddCallback( ApplyBB, XmNactivateCallback,
 
568
                        activateCB_ApplyBB,
 
569
                        (XtPointer) UxBlackBodyContext );
 
570
 
 
571
        UxAddCallback( CancelBB, XmNactivateCallback,
 
572
                        activateCB_CancelBB,
 
573
                        (XtPointer) UxBlackBodyContext );
 
574
 
 
575
        UxAddCallback( tf_T, XmNlosingFocusCallback,
 
576
                        losingFocusCB_tf_T,
 
577
                        (XtPointer) UxBlackBodyContext );
 
578
 
 
579
        UxAddCallback( tf_Dist, XmNlosingFocusCallback,
 
580
                        losingFocusCB_tf_Dist,
 
581
                        (XtPointer) UxBlackBodyContext );
 
582
 
 
583
        UxAddCallback( tf_radius, XmNlosingFocusCallback,
 
584
                        losingFocusCB_tf_radius,
 
585
                        (XtPointer) UxBlackBodyContext );
 
586
 
 
587
        UxAddCallback( tf_wrmin, XmNlosingFocusCallback,
 
588
                        losingFocusCB_tf_wrmin,
 
589
                        (XtPointer) UxBlackBodyContext );
 
590
 
 
591
        UxAddCallback( tf_wrmax, XmNlosingFocusCallback,
 
592
                        losingFocusCB_tf_wrmax,
 
593
                        (XtPointer) UxBlackBodyContext );
 
594
 
 
595
 
 
596
        /* Finally, call UxRealizeInterface to create the X windows
 
597
           for the widgets created above. */
 
598
 
 
599
        UxRealizeInterface( BlackBody );
 
600
 
 
601
        return ( BlackBody );
 
602
}
 
603
 
 
604
/*******************************************************************************
 
605
        The following function includes the code that was entered
 
606
        in the 'Initial Code' and 'Final Code' sections of the
 
607
        Declarations Editor. This function is called from the
 
608
        'Interface function' below.
 
609
*******************************************************************************/
 
610
 
 
611
static swidget  _Ux_create_BlackBody()
 
612
{
 
613
        swidget                 rtrn;
 
614
        _UxCBlackBody           *UxContext;
 
615
 
 
616
        UxBlackBodyContext = UxContext =
 
617
                (_UxCBlackBody *) UxMalloc( sizeof(_UxCBlackBody) );
 
618
 
 
619
        rtrn = _Uxbuild_BlackBody();
 
620
 
 
621
        return(rtrn);
 
622
}
 
623
 
 
624
/*******************************************************************************
 
625
        The following is the 'Interface function' which is the
 
626
        external entry point for creating this interface.
 
627
        This function should be called from your application or from
 
628
        a callback function.
 
629
*******************************************************************************/
 
630
 
 
631
swidget create_BlackBody()
 
632
{
 
633
        swidget                 _Uxrtrn;
 
634
 
 
635
        _Uxrtrn = _Ux_create_BlackBody();
 
636
 
 
637
        return ( _Uxrtrn );
 
638
}
 
639
 
 
640
/*******************************************************************************
 
641
        END OF FILE
 
642
*******************************************************************************/
 
643