Debian Codegraph @

gui/XDo/src/Classify.c

raw
1
2 /*******************************************************************************
3 Classify.c
4
5 .VERSION
6 090825 last modif
7
8 *******************************************************************************/
9
10 #include <stdio.h>
11 #include "UxLib.h"
12 #include "UxText.h"
13 #include "UxPushB.h"
14 #include "UxLabel.h"
15 #include "UxScrW.h"
16 #include "UxForm.h"
17 #include "UxCascB.h"
18 #include "UxPushBG.h"
19 #include "UxRowCol.h"
20 #include "UxMainW.h"
21 #include "UxApplSh.h"
22
23 /*******************************************************************************
24 Includes, Defines, and Global variables from the Declarations Editor:
25 *******************************************************************************/
26
27 #include <ExternResources.h>
28 #include <midas_def.h>
29
30 /*******************************************************************************
31 The definition of the context structure:
32 If you create multiple instances of your interface, the context
33 structure ensures that your callbacks use the variables for the
34 correct instance.
35
36 For each swidget in the interface, each argument to the Interface
37 function, and each variable in the Instance Specific section of the
38 Declarations Editor, there is an entry in the context structure.
39 and a #define. The #define makes the variable name refer to the
40 corresponding entry in the context structure.
41 *******************************************************************************/
42
43 typedef struct
44 {
45 swidget UxClassify;
46 swidget UxmainWindow2;
47 swidget UxpullDownMenu2;
48 swidget UxquitPane2;
49 swidget UxquitPane_b3;
50 swidget UxpullDownMenu_top_b3;
51 swidget UxUtilsPane2;
52 swidget UxUtilsPane_b3;
53 swidget UxUtilsPane_b8;
54 swidget UxcommandsCascade2;
55 swidget UxpullDownMenu1_p1;
56 swidget UxpullDownMenu1_p3_b3;
57 swidget UxpullDownMenu1_p1_b3;
58 swidget UxpullDownMenu1_top_b2;
59 swidget UxpullDownMenu2_p4;
60 swidget UxpullDownMenu2_p4_b1;
61 swidget UxpullDownMenu2_p4_b2;
62 swidget UxpullDownMenu2_top_b1;
63 swidget UxworkAreaForm2;
64 swidget Uxform3;
65 swidget UxscrolledWindow1;
66 swidget Uxrowproc;
67 swidget Uxlabel5;
68 swidget UxpushButton6;
69 swidget Uxlabel11;
70 swidget Uxlabel12;
71 swidget Uxlabel13;
72 swidget Uxlabel21;
73 swidget Uxsclas_t1;
74 } _UxCClassify;
75
76 #define Classify UxClassifyContext->UxClassify
77 #define mainWindow2 UxClassifyContext->UxmainWindow2
78 #define pullDownMenu2 UxClassifyContext->UxpullDownMenu2
79 #define quitPane2 UxClassifyContext->UxquitPane2
80 #define quitPane_b3 UxClassifyContext->UxquitPane_b3
81 #define pullDownMenu_top_b3 UxClassifyContext->UxpullDownMenu_top_b3
82 #define UtilsPane2 UxClassifyContext->UxUtilsPane2
83 #define UtilsPane_b3 UxClassifyContext->UxUtilsPane_b3
84 #define UtilsPane_b8 UxClassifyContext->UxUtilsPane_b8
85 #define commandsCascade2 UxClassifyContext->UxcommandsCascade2
86 #define pullDownMenu1_p1 UxClassifyContext->UxpullDownMenu1_p1
87 #define pullDownMenu1_p3_b3 UxClassifyContext->UxpullDownMenu1_p3_b3
88 #define pullDownMenu1_p1_b3 UxClassifyContext->UxpullDownMenu1_p1_b3
89 #define pullDownMenu1_top_b2 UxClassifyContext->UxpullDownMenu1_top_b2
90 #define pullDownMenu2_p4 UxClassifyContext->UxpullDownMenu2_p4
91 #define pullDownMenu2_p4_b1 UxClassifyContext->UxpullDownMenu2_p4_b1
92 #define pullDownMenu2_p4_b2 UxClassifyContext->UxpullDownMenu2_p4_b2
93 #define pullDownMenu2_top_b1 UxClassifyContext->UxpullDownMenu2_top_b1
94 #define workAreaForm2 UxClassifyContext->UxworkAreaForm2
95 #define form3 UxClassifyContext->Uxform3
96 #define scrolledWindow1 UxClassifyContext->UxscrolledWindow1
97 #define rowproc UxClassifyContext->Uxrowproc
98 #define label5 UxClassifyContext->Uxlabel5
99 #define pushButton6 UxClassifyContext->UxpushButton6
100 #define label11 UxClassifyContext->Uxlabel11
101 #define label12 UxClassifyContext->Uxlabel12
102 #define label13 UxClassifyContext->Uxlabel13
103 #define label21 UxClassifyContext->Uxlabel21
104 #define sclas_t1 UxClassifyContext->Uxsclas_t1
105
106 static _UxCClassify *UxClassifyContext;
107
108
109 extern void display_col_table(), display_help(), SetFileList();
110
111 extern int classify(), save_clas_table();
112
113
114 /*******************************************************************************
115 The following are translation tables.
116 *******************************************************************************/
117
118
119 /*******************************************************************************
120 Forward declarations of functions that are defined later in this file.
121 *******************************************************************************/
122
123 swidget create_Classify();
124
125 /*******************************************************************************
126 The following are Action functions.
127 *******************************************************************************/
128
129 static void action_HInit( UxWidget, UxEvent, UxParams, p_UxNumParams )
130 Widget UxWidget;
131 XEvent *UxEvent;
132 String *UxParams;
133 Cardinal *p_UxNumParams;
134 {
135 _UxCClassify *UxSaveCtx, *UxContext;
136 swidget UxThisWidget;
137
138 UxThisWidget = UxWidgetToSwidget( UxWidget );
139 UxSaveCtx = UxClassifyContext;
140 UxClassifyContext = UxContext =
141 (_UxCClassify *) UxGetContext( UxThisWidget );
142 {
143
144 }
145 UxClassifyContext = UxSaveCtx;
146 }
147
148 static void action_nothing( UxWidget, UxEvent, UxParams, p_UxNumParams )
149 Widget UxWidget;
150 XEvent *UxEvent;
151 String *UxParams;
152 Cardinal *p_UxNumParams;
153 {
154 _UxCClassify *UxSaveCtx, *UxContext;
155 swidget UxThisWidget;
156
157 UxThisWidget = UxWidgetToSwidget( UxWidget );
158 UxSaveCtx = UxClassifyContext;
159 UxClassifyContext = UxContext =
160 (_UxCClassify *) UxGetContext( UxThisWidget );
161 {
162 printf("toto:\n");
163 }
164 UxClassifyContext = UxSaveCtx;
165 }
166
167 static void action_SelectCommand( UxWidget, UxEvent, UxParams, p_UxNumParams )
168 Widget UxWidget;
169 XEvent *UxEvent;
170 String *UxParams;
171 Cardinal *p_UxNumParams;
172 {
173 _UxCClassify *UxSaveCtx, *UxContext;
174 swidget UxThisWidget;
175
176 UxThisWidget = UxWidgetToSwidget( UxWidget );
177 UxSaveCtx = UxClassifyContext;
178 UxClassifyContext = UxContext =
179 (_UxCClassify *) UxGetContext( UxThisWidget );
180 {
181
182
183
184 }
185 UxClassifyContext = UxSaveCtx;
186 }
187
188 static void action_ClearHelp( UxWidget, UxEvent, UxParams, p_UxNumParams )
189 Widget UxWidget;
190 XEvent *UxEvent;
191 String *UxParams;
192 Cardinal *p_UxNumParams;
193 {
194 _UxCClassify *UxSaveCtx, *UxContext;
195 swidget UxThisWidget;
196
197 UxThisWidget = UxWidgetToSwidget( UxWidget );
198 UxSaveCtx = UxClassifyContext;
199 UxClassifyContext = UxContext =
200 (_UxCClassify *) UxGetContext( UxThisWidget );
201 {
202 UxPutText(UxFindSwidget("SHelp"),"");
203 }
204 UxClassifyContext = UxSaveCtx;
205 }
206
207 static void action_WriteHelp( UxWidget, UxEvent, UxParams, p_UxNumParams )
208 Widget UxWidget;
209 XEvent *UxEvent;
210 String *UxParams;
211 Cardinal *p_UxNumParams;
212 {
213 _UxCClassify *UxSaveCtx, *UxContext;
214 swidget UxThisWidget;
215
216 UxThisWidget = UxWidgetToSwidget( UxWidget );
217 UxSaveCtx = UxClassifyContext;
218 UxClassifyContext = UxContext =
219 (_UxCClassify *) UxGetContext( UxThisWidget );
220 {
221 char s[100];
222
223 Widget sw = UxWidget;
224
225 strcpy(s,"");
226 /*sprintf(comm,"WRITE/OUT here");
227 AppendDialogText(comm);*/
228
229 if (sw == UxGetWidget(UxFindSwidget("ColButton"))) {
230 strcpy(s,"Select the OST columns to be displayed into the scrolled window");
231 UxPutText(UxFindSwidget("SHelp") ,s);
232 }
233 else if (sw == UxGetWidget(UxFindSwidget("ClassiButton"))) {
234 strcpy(s,"Activate interface for defining classification rules ");
235 UxPutText(UxFindSwidget("SHelp") ,s);
236 }
237 else if (sw == UxGetWidget(UxFindSwidget("AssoButton"))) {
238 strcpy(s,"Activate interface for classifying images");
239 UxPutText(UxFindSwidget("SHelp") ,s);
240 }
241 else if (sw == UxGetWidget(UxFindSwidget("AssoButton1"))) {
242 strcpy(s,"Activate interface for associating calibration exposures to scientific frames");
243 UxPutText(UxFindSwidget("SHelp") ,s);
244 }
245 else if (sw == UxGetWidget(UxFindSwidget("NewsButton3"))) {
246 strcpy(s,"Create the OST table");
247 UxPutText(UxFindSwidget("SHelp3") ,s);
248 }
249 else if (sw == UxGetWidget(UxFindSwidget("PrintButton3"))) {
250 strcpy(s,"Popdown this interface");
251 UxPutText(UxFindSwidget("SHelp3") ,s);
252 }
253 else if (sw == UxGetWidget(UxFindSwidget("ost_t1"))){
254 strcpy(s,"Name of the Observation Summary Table to be created ");
255 UxPutText(UxFindSwidget("SHelp3") ,s);
256 }
257 else if (sw == UxGetWidget(UxFindSwidget("ost_t2"))){
258 strcpy(s,"List of frames to be processed ");
259 UxPutText(UxFindSwidget("SHelp3") ,s);
260 }
261 else if (sw == UxGetWidget(UxFindSwidget("ost_t3"))){
262 strcpy(s,"Name of the table containing the list of relevant Midas descriptors");
263 UxPutText(UxFindSwidget("SHelp3") ,s);
264 }
265 else if (sw == UxGetWidget(UxFindSwidget("pushButton4"))){
266 strcpy(s,"Push button to popup the File Selection Box");
267 UxPutText(UxFindSwidget("SHelp3") ,s);
268 }
269 else if (sw == UxGetWidget(UxFindSwidget("pushButton5"))){
270 strcpy(s,"Push button to popup the File Selection Box");
271 UxPutText(UxFindSwidget("SHelp3") ,s);
272 }
273 }
274 UxClassifyContext = UxSaveCtx;
275 }
276
277 static void action_HelpACT( UxWidget, UxEvent, UxParams, p_UxNumParams )
278 Widget UxWidget;
279 XEvent *UxEvent;
280 String *UxParams;
281 Cardinal *p_UxNumParams;
282 {
283 _UxCClassify *UxSaveCtx, *UxContext;
284 swidget UxThisWidget;
285
286 UxThisWidget = UxWidgetToSwidget( UxWidget );
287 UxSaveCtx = UxClassifyContext;
288 UxClassifyContext = UxContext =
289 (_UxCClassify *) UxGetContext( UxThisWidget );
290 {
291 /* char *s;
292 s = XmTextGetSelection(UxWidget);
293
294 XmTextClearSelection(UxWidget,XtLastTimestampProcessed(UxDisplay));
295 */}
296 UxClassifyContext = UxSaveCtx;
297 }
298
299 /*******************************************************************************
300 The following are callback functions.
301 *******************************************************************************/
302
303 static void activateCB_quitPane_b3( UxWidget, UxClientData, UxCallbackArg )
304 Widget UxWidget;
305 XtPointer UxClientData, UxCallbackArg;
306 {
307 _UxCClassify *UxSaveCtx, *UxContext;
308 swidget UxThisWidget;
309
310 UxThisWidget = UxWidgetToSwidget( UxWidget );
311 UxSaveCtx = UxClassifyContext;
312 UxClassifyContext = UxContext =
313 (_UxCClassify *) UxGetContext( UxThisWidget );
314 {
315 extern swidget clashaupt;
316 extern Widget row1[40],row2[40],row3[40];
317 extern int rowno;
318 int i;
319 for (i=0; i<5; i++) {
320 XmTextSetString(row1[i],"");
321 XmTextSetString(row2[i],"");
322 XmTextSetString(row3[i],"");
323 }
324 for (i=5; i<rowno; i++) {
325 XtDestroyWidget(row1[i]);
326 row1[i] = (Widget )0;
327 XtDestroyWidget(row2[i]);
328 row2[i] = (Widget )0;
329 XtDestroyWidget(row3[i]);
330 row2[i] = (Widget )0;
331 }
332 rowno = 5;
333 UxPopdownInterface(clashaupt);
334 }
335 UxClassifyContext = UxSaveCtx;
336 }
337
338 static void activateCB_UtilsPane_b3( UxWidget, UxClientData, UxCallbackArg )
339 Widget UxWidget;
340 XtPointer UxClientData, UxCallbackArg;
341 {
342 _UxCClassify *UxSaveCtx, *UxContext;
343 swidget UxThisWidget;
344
345 UxThisWidget = UxWidgetToSwidget( UxWidget );
346 UxSaveCtx = UxClassifyContext;
347 UxClassifyContext = UxContext =
348 (_UxCClassify *) UxGetContext( UxThisWidget );
349 {
350 char s[1000];
351 extern swidget klist,tablelist;
352
353 extern int do8;
354 int strip =1;
355 strcpy(s,"*.tbl");
356 SetFileList(UxGetWidget(tablelist),strip,s);
357 UxPutTitle(UxFindSwidget("transientShell8"),"Select Classification Table");
358 do8 = 1;
359 UxPopupInterface(klist,no_grab);
360 }
361 UxClassifyContext = UxSaveCtx;
362 }
363
364 static void activateCB_UtilsPane_b8( UxWidget, UxClientData, UxCallbackArg )
365 Widget UxWidget;
366 XtPointer UxClientData, UxCallbackArg;
367 {
368 _UxCClassify *UxSaveCtx, *UxContext;
369 swidget UxThisWidget;
370
371 UxThisWidget = UxWidgetToSwidget( UxWidget );
372 UxSaveCtx = UxClassifyContext;
373 UxClassifyContext = UxContext =
374 (_UxCClassify *) UxGetContext( UxThisWidget );
375 {
376 char mytext[60];
377 int tid;
378 strcpy(mytext,UxGetText(UxFindSwidget("sclas_t1")));
379
380 tid = TCTID(mytext);
381 if (tid != -1) TCTCLO(tid);
382 save_clas_table(mytext);
383
384 }
385 UxClassifyContext = UxSaveCtx;
386 }
387
388 static void activateCB_pullDownMenu1_p3_b3( UxWidget, UxClientData, UxCallbackArg )
389 Widget UxWidget;
390 XtPointer UxClientData, UxCallbackArg;
391 {
392 _UxCClassify *UxSaveCtx, *UxContext;
393 swidget UxThisWidget;
394
395 UxThisWidget = UxWidgetToSwidget( UxWidget );
396 UxSaveCtx = UxClassifyContext;
397 UxClassifyContext = UxContext =
398 (_UxCClassify *) UxGetContext( UxThisWidget );
399 {
400 extern int rowno;
401 extern Widget row1[40],row2[40],row3[40];
402 char mytext[8];
403 rowno++;
404 XtVaSetValues(UxGetWidget(UxFindSwidget("rowproc")),XmNnumColumns,rowno,NULL);
405 sprintf(mytext,"text1_%d",rowno-1);
406 row1[rowno-1] = XtVaCreateManagedWidget(mytext, xmTextWidgetClass,UxGetWidget( UxFindSwidget("rowproc")),NULL);
407 sprintf(mytext,"text2_%d",rowno-1);
408 row2[rowno-1] = XtVaCreateManagedWidget(mytext, xmTextWidgetClass,UxGetWidget( UxFindSwidget("rowproc")),NULL);
409 sprintf(mytext,"text3_%d",rowno-1);
410 row3[rowno-1] = XtVaCreateManagedWidget(mytext, xmTextWidgetClass,UxGetWidget( UxFindSwidget("rowproc")),NULL);
411 }
412 UxClassifyContext = UxSaveCtx;
413 }
414
415 static void activateCB_pullDownMenu1_p1_b3( UxWidget, UxClientData, UxCallbackArg )
416 Widget UxWidget;
417 XtPointer UxClientData, UxCallbackArg;
418 {
419 _UxCClassify *UxSaveCtx, *UxContext;
420 swidget UxThisWidget;
421
422 UxThisWidget = UxWidgetToSwidget( UxWidget );
423 UxSaveCtx = UxClassifyContext;
424 UxClassifyContext = UxContext =
425 (_UxCClassify *) UxGetContext( UxThisWidget );
426 {
427 extern int rowno;
428 extern Widget row1[40],row2[40],row3[40];
429 int i;
430 for (i=0; i<rowno; i++) {
431 XmTextSetString(row1[i],"");
432 XmTextSetString(row2[i],"");
433 XmTextSetString(row3[i],"");
434 }
435 }
436 UxClassifyContext = UxSaveCtx;
437 }
438
439 static void activateCB_pullDownMenu2_p4_b1( UxWidget, UxClientData, UxCallbackArg )
440 Widget UxWidget;
441 XtPointer UxClientData, UxCallbackArg;
442 {
443 _UxCClassify *UxSaveCtx, *UxContext;
444 swidget UxThisWidget;
445
446 UxThisWidget = UxWidgetToSwidget( UxWidget );
447 UxSaveCtx = UxClassifyContext;
448 UxClassifyContext = UxContext =
449 (_UxCClassify *) UxGetContext( UxThisWidget );
450 {
451 extern swidget help;
452 display_help(help,"Classi.help");
453 }
454 UxClassifyContext = UxSaveCtx;
455 }
456
457 static void activateCB_pullDownMenu2_p4_b2( UxWidget, UxClientData, UxCallbackArg )
458 Widget UxWidget;
459 XtPointer UxClientData, UxCallbackArg;
460 {
461 _UxCClassify *UxSaveCtx, *UxContext;
462 swidget UxThisWidget;
463
464 UxThisWidget = UxWidgetToSwidget( UxWidget );
465 UxSaveCtx = UxClassifyContext;
466 UxClassifyContext = UxContext =
467 (_UxCClassify *) UxGetContext( UxThisWidget );
468 {
469
470 }
471 UxClassifyContext = UxSaveCtx;
472 }
473
474 static void entryCB_rowproc( UxWidget, UxClientData, UxCallbackArg )
475 Widget UxWidget;
476 XtPointer UxClientData, UxCallbackArg;
477 {
478 _UxCClassify *UxSaveCtx, *UxContext;
479 swidget UxThisWidget;
480
481 UxThisWidget = UxWidgetToSwidget( UxWidget );
482 UxSaveCtx = UxClassifyContext;
483 UxClassifyContext = UxContext =
484 (_UxCClassify *) UxGetContext( UxThisWidget );
485 {
486 /*XmRowColumnCallbackStruct *cbs;
487 Widget pb = cbs->widget;
488 cbs = (XmRowColumnCallbackStruct *)UxCallbackArg;
489 printf("%s: %s\n",XtName(pb),cbs->data);*/
490 }
491 UxClassifyContext = UxSaveCtx;
492 }
493
494 static void createCB_rowproc( UxWidget, UxClientData, UxCallbackArg )
495 Widget UxWidget;
496 XtPointer UxClientData, UxCallbackArg;
497 {
498 _UxCClassify *UxSaveCtx, *UxContext;
499 swidget UxThisWidget;
500
501 UxThisWidget = UxWidgetToSwidget( UxWidget );
502 UxSaveCtx = UxClassifyContext;
503 UxClassifyContext = UxContext =
504 (_UxCClassify *) UxGetContext( UxThisWidget );
505 {
506
507 }
508 UxClassifyContext = UxSaveCtx;
509 }
510
511 static void activateCB_pushButton6( UxWidget, UxClientData, UxCallbackArg )
512 Widget UxWidget;
513 XtPointer UxClientData, UxCallbackArg;
514 {
515 _UxCClassify *UxSaveCtx, *UxContext;
516 swidget UxThisWidget;
517
518 UxThisWidget = UxWidgetToSwidget( UxWidget );
519 UxSaveCtx = UxClassifyContext;
520 UxClassifyContext = UxContext =
521 (_UxCClassify *) UxGetContext( UxThisWidget );
522 {
523 extern char ostchoice[60];
524 extern int tidost;
525 extern swidget myerror;
526 char command[160],mycval[81],column[18];
527 if (tidost == -1) {
528 UxPutMessageString(UxFindSwidget("errorDialog1"),"No OST opened");
529 UxPopupInterface(myerror,no_grab);
530 return;
531 }
532 save_clas_table("TEMP_CLAS");
533 sprintf(command,"CLASSIFY/IMAGE %s TEMP_CLAS.tbl",ostchoice);
534 /*AppendDialogText(command);*/
535 mycval[0] = '\0';
536 column[0] = '\0';
537 TCTCLO(tidost);
538 classify(ostchoice,"TEMP_CLAS.tbl",column,mycval);
539 TCTOPN(ostchoice,F_I_MODE,&tidost);
540 display_col_table(UxGetWidget(UxFindSwidget("readtable")));
541
542 }
543 UxClassifyContext = UxSaveCtx;
544 }
545
546 /*******************************************************************************
547 The 'init_' function sets the private properties for all the
548 swidgets to the values specified in the Property Table.
549 Some properties need to be set after the X widgets have been
550 created and the setting of these properties is done in the
551 'build_' function after the UxCreateWidget call.
552 *******************************************************************************/
553
554 static void _Uxinit_Classify()
555 {
556 UxPutHeight( Classify, 450 );
557 UxPutWidth( Classify, 500 );
558 UxPutY( Classify, 387 );
559 UxPutX( Classify, 29 );
560
561 UxPutUnitType( mainWindow2, "pixels" );
562 UxPutBackground( mainWindow2, WindowBackground );
563 UxPutHeight( mainWindow2, 470 );
564 UxPutWidth( mainWindow2, 700 );
565 UxPutY( mainWindow2, 180 );
566 UxPutX( mainWindow2, 200 );
567
568 UxPutForeground( pullDownMenu2, MenuForeground );
569 UxPutBackground( pullDownMenu2, MenuBackground );
570 UxPutMenuAccelerator( pullDownMenu2, "<KeyUp>F10" );
571 UxPutRowColumnType( pullDownMenu2, "menu_bar" );
572 UxPutBorderWidth( pullDownMenu2, 0 );
573
574 UxPutForeground( quitPane2, MenuForeground );
575 UxPutBackground( quitPane2, MenuBackground );
576 UxPutRowColumnType( quitPane2, "menu_pulldown" );
577
578 UxPutFontList( quitPane_b3, BoldTextFont );
579 UxPutLabelString( quitPane_b3, "Bye" );
580
581 UxPutForeground( pullDownMenu_top_b3, MenuForeground );
582 UxPutFontList( pullDownMenu_top_b3, BoldTextFont );
583 UxPutBackground( pullDownMenu_top_b3, MenuBackground );
584 UxPutMnemonic( pullDownMenu_top_b3, "Q" );
585 UxPutLabelString( pullDownMenu_top_b3, "Quit" );
586
587 UxPutForeground( UtilsPane2, MenuForeground );
588 UxPutBackground( UtilsPane2, MenuBackground );
589 UxPutRowColumnType( UtilsPane2, "menu_pulldown" );
590
591 UxPutFontList( UtilsPane_b3, BoldTextFont );
592 UxPutLabelString( UtilsPane_b3, "Open ..." );
593
594 UxPutFontList( UtilsPane_b8, BoldTextFont );
595 UxPutLabelString( UtilsPane_b8, "Save" );
596
597 UxPutX( commandsCascade2, 101 );
598 UxPutMnemonic( commandsCascade2, "F" );
599 UxPutForeground( commandsCascade2, MenuForeground );
600 UxPutFontList( commandsCascade2, BoldTextFont );
601 UxPutBackground( commandsCascade2, MenuBackground );
602 UxPutLabelString( commandsCascade2, "File" );
603
604 UxPutForeground( pullDownMenu1_p1, MenuForeground );
605 UxPutBackground( pullDownMenu1_p1, MenuBackground );
606 UxPutRowColumnType( pullDownMenu1_p1, "menu_pulldown" );
607
608 UxPutFontList( pullDownMenu1_p3_b3, BoldTextFont );
609 UxPutLabelString( pullDownMenu1_p3_b3, "Add" );
610
611 UxPutFontList( pullDownMenu1_p1_b3, BoldTextFont );
612 UxPutLabelString( pullDownMenu1_p1_b3, "Clear" );
613
614 UxPutForeground( pullDownMenu1_top_b2, MenuForeground );
615 UxPutFontList( pullDownMenu1_top_b2, BoldTextFont );
616 UxPutBackground( pullDownMenu1_top_b2, MenuBackground );
617 UxPutMnemonic( pullDownMenu1_top_b2, "E" );
618 UxPutLabelString( pullDownMenu1_top_b2, "Edit" );
619
620 UxPutForeground( pullDownMenu2_p4, MenuForeground );
621 UxPutBackground( pullDownMenu2_p4, MenuBackground );
622 UxPutRowColumnType( pullDownMenu2_p4, "menu_pulldown" );
623
624 UxPutFontList( pullDownMenu2_p4_b1, BoldTextFont );
625 UxPutLabelString( pullDownMenu2_p4_b1, "On this interface..." );
626
627 UxPutFontList( pullDownMenu2_p4_b2, BoldTextFont );
628 UxPutLabelString( pullDownMenu2_p4_b2, "On importing data..." );
629
630 UxPutForeground( pullDownMenu2_top_b1, MenuForeground );
631 UxPutFontList( pullDownMenu2_top_b1, BoldTextFont );
632 UxPutBackground( pullDownMenu2_top_b1, MenuBackground );
633 UxPutMnemonic( pullDownMenu2_top_b1, "H" );
634 UxPutLabelString( pullDownMenu2_top_b1, "Help" );
635
636 UxPutBackground( workAreaForm2, WindowBackground );
637 UxPutBorderWidth( workAreaForm2, 0 );
638 UxPutHeight( workAreaForm2, 400 );
639 UxPutWidth( workAreaForm2, 700 );
640
641 UxPutBackground( form3, WindowBackground );
642 UxPutHeight( form3, 400 );
643 UxPutWidth( form3, 480 );
644 UxPutY( form3, 10 );
645 UxPutX( form3, 10 );
646 UxPutUnitType( form3, "pixels" );
647 UxPutResizePolicy( form3, "resize_none" );
648
649 UxPutVisualPolicy( scrolledWindow1, "variable" );
650 UxPutScrollBarDisplayPolicy( scrolledWindow1, "static" );
651 UxPutScrollBarPlacement( scrolledWindow1, "bottom_left" );
652 UxPutBackground( scrolledWindow1, WindowBackground );
653 UxPutHeight( scrolledWindow1, 300 );
654 UxPutWidth( scrolledWindow1, 350 );
655 UxPutY( scrolledWindow1, 30 );
656 UxPutX( scrolledWindow1, 10 );
657 UxPutScrollingPolicy( scrolledWindow1, "automatic" );
658
659 UxPutResizeWidth( rowproc, "true" );
660 UxPutNumColumns( rowproc, 3 );
661 UxPutPacking( rowproc, "pack_column" );
662 UxPutOrientation( rowproc, "horizontal" );
663 UxPutEntryAlignment( rowproc, "alignment_center" );
664 UxPutBackground( rowproc, WindowBackground );
665 UxPutHeight( rowproc, 370 );
666 UxPutWidth( rowproc, 500 );
667 UxPutY( rowproc, 8 );
668 UxPutX( rowproc, 8 );
669
670 UxPutAlignment( label5, "alignment_beginning" );
671 UxPutLabelString( label5, "Selection Criteria" );
672 UxPutFontList( label5, BoldTextFont );
673 UxPutBackground( label5, WindowBackground );
674 UxPutHeight( label5, 40 );
675 UxPutWidth( label5, 240 );
676 UxPutY( label5, 420 );
677 UxPutX( label5, 10 );
678
679 UxPutLabelString( pushButton6, "Apply" );
680 UxPutForeground( pushButton6, ButtonForeground );
681 UxPutFontList( pushButton6, BoldTextFont );
682 UxPutBackground( pushButton6, ButtonBackground );
683 UxPutHeight( pushButton6, 40 );
684 UxPutWidth( pushButton6, 80 );
685 UxPutY( pushButton6, 530 );
686 UxPutX( pushButton6, 140 );
687
688 UxPutLabelString( label11, "DESCR" );
689 UxPutFontList( label11, BoldTextFont );
690 UxPutBackground( label11, WindowBackground );
691 UxPutHeight( label11, 30 );
692 UxPutWidth( label11, 130 );
693 UxPutY( label11, 10 );
694 UxPutX( label11, 40 );
695
696 UxPutLabelString( label12, "OUTCOL" );
697 UxPutFontList( label12, BoldTextFont );
698 UxPutBackground( label12, WindowBackground );
699 UxPutHeight( label12, 30 );
700 UxPutWidth( label12, 130 );
701 UxPutY( label12, 20 );
702 UxPutX( label12, 50 );
703
704 UxPutLabelString( label13, "OUTCHAR" );
705 UxPutFontList( label13, BoldTextFont );
706 UxPutBackground( label13, WindowBackground );
707 UxPutHeight( label13, 30 );
708 UxPutWidth( label13, 130 );
709 UxPutY( label13, 20 );
710 UxPutX( label13, 190 );
711
712 UxPutLabelString( label21, "Classification Table Name" );
713 UxPutFontList( label21, BoldTextFont );
714 UxPutBackground( label21, WindowBackground );
715 UxPutHeight( label21, 30 );
716 UxPutWidth( label21, 200 );
717 UxPutY( label21, 110 );
718 UxPutX( label21, 50 );
719
720 UxPutForeground( sclas_t1, TextForeground );
721 UxPutFontList( sclas_t1, BoldTextFont );
722 UxPutBackground( sclas_t1, TextBackground );
723 UxPutHeight( sclas_t1, 40 );
724 UxPutWidth( sclas_t1, 240 );
725 UxPutY( sclas_t1, 20 );
726 UxPutX( sclas_t1, 230 );
727
728 }
729
730 /*******************************************************************************
731 The 'build_' function creates all the swidgets and X widgets,
732 and sets their properties to the values specified in the
733 Property Editor.
734 *******************************************************************************/
735
736 static swidget _Uxbuild_Classify()
737 {
738 /* Create the swidgets */
739
740 Classify = UxCreateApplicationShell( "Classify", NO_PARENT );
741 UxPutContext( Classify, UxClassifyContext );
742
743 mainWindow2 = UxCreateMainWindow( "mainWindow2", Classify );
744 pullDownMenu2 = UxCreateRowColumn( "pullDownMenu2", mainWindow2 );
745 quitPane2 = UxCreateRowColumn( "quitPane2", pullDownMenu2 );
746 quitPane_b3 = UxCreatePushButtonGadget( "quitPane_b3", quitPane2 );
747 pullDownMenu_top_b3 = UxCreateCascadeButton( "pullDownMenu_top_b3", pullDownMenu2 );
748 UtilsPane2 = UxCreateRowColumn( "UtilsPane2", pullDownMenu2 );
749 UtilsPane_b3 = UxCreatePushButtonGadget( "UtilsPane_b3", UtilsPane2 );
750 UtilsPane_b8 = UxCreatePushButtonGadget( "UtilsPane_b8", UtilsPane2 );
751 commandsCascade2 = UxCreateCascadeButton( "commandsCascade2", pullDownMenu2 );
752 pullDownMenu1_p1 = UxCreateRowColumn( "pullDownMenu1_p1", pullDownMenu2 );
753 pullDownMenu1_p3_b3 = UxCreatePushButtonGadget( "pullDownMenu1_p3_b3", pullDownMenu1_p1 );
754 pullDownMenu1_p1_b3 = UxCreatePushButtonGadget( "pullDownMenu1_p1_b3", pullDownMenu1_p1 );
755 pullDownMenu1_top_b2 = UxCreateCascadeButton( "pullDownMenu1_top_b2", pullDownMenu2 );
756 pullDownMenu2_p4 = UxCreateRowColumn( "pullDownMenu2_p4", pullDownMenu2 );
757 pullDownMenu2_p4_b1 = UxCreatePushButtonGadget( "pullDownMenu2_p4_b1", pullDownMenu2_p4 );
758 pullDownMenu2_p4_b2 = UxCreatePushButtonGadget( "pullDownMenu2_p4_b2", pullDownMenu2_p4 );
759 pullDownMenu2_top_b1 = UxCreateCascadeButton( "pullDownMenu2_top_b1", pullDownMenu2 );
760 workAreaForm2 = UxCreateForm( "workAreaForm2", mainWindow2 );
761 form3 = UxCreateForm( "form3", workAreaForm2 );
762 scrolledWindow1 = UxCreateScrolledWindow( "scrolledWindow1", form3 );
763 rowproc = UxCreateRowColumn( "rowproc", scrolledWindow1 );
764 label5 = UxCreateLabel( "label5", form3 );
765 pushButton6 = UxCreatePushButton( "pushButton6", form3 );
766 label11 = UxCreateLabel( "label11", form3 );
767 label12 = UxCreateLabel( "label12", form3 );
768 label13 = UxCreateLabel( "label13", form3 );
769 label21 = UxCreateLabel( "label21", form3 );
770 sclas_t1 = UxCreateText( "sclas_t1", form3 );
771
772 _Uxinit_Classify();
773
774 /* Create the X widgets */
775
776 UxCreateWidget( Classify );
777 UxCreateWidget( mainWindow2 );
778 UxCreateWidget( pullDownMenu2 );
779 UxCreateWidget( quitPane2 );
780 UxCreateWidget( quitPane_b3 );
781 UxPutSubMenuId( pullDownMenu_top_b3, "quitPane2" );
782 UxCreateWidget( pullDownMenu_top_b3 );
783
784 UxCreateWidget( UtilsPane2 );
785 UxCreateWidget( UtilsPane_b3 );
786 UxCreateWidget( UtilsPane_b8 );
787 UxPutSubMenuId( commandsCascade2, "UtilsPane2" );
788 UxCreateWidget( commandsCascade2 );
789
790 UxCreateWidget( pullDownMenu1_p1 );
791 UxCreateWidget( pullDownMenu1_p3_b3 );
792 UxCreateWidget( pullDownMenu1_p1_b3 );
793 UxPutSubMenuId( pullDownMenu1_top_b2, "pullDownMenu1_p1" );
794 UxCreateWidget( pullDownMenu1_top_b2 );
795
796 UxCreateWidget( pullDownMenu2_p4 );
797 UxCreateWidget( pullDownMenu2_p4_b1 );
798 UxCreateWidget( pullDownMenu2_p4_b2 );
799 UxPutSubMenuId( pullDownMenu2_top_b1, "pullDownMenu2_p4" );
800 UxCreateWidget( pullDownMenu2_top_b1 );
801
802 UxCreateWidget( workAreaForm2 );
803 UxCreateWidget( form3 );
804 UxPutTopAttachment( scrolledWindow1, "attach_form" );
805 UxPutTopOffset( scrolledWindow1, 150 );
806 UxPutBottomOffset( scrolledWindow1, 60 );
807 UxPutBottomAttachment( scrolledWindow1, "attach_form" );
808 UxPutLeftOffset( scrolledWindow1, 10 );
809 UxPutRightOffset( scrolledWindow1, 10 );
810 UxPutRightAttachment( scrolledWindow1, "attach_form" );
811 UxPutLeftAttachment( scrolledWindow1, "attach_form" );
812 UxCreateWidget( scrolledWindow1 );
813
814 UxCreateWidget( rowproc );
815 createCB_rowproc( UxGetWidget( rowproc ),
816 (XtPointer) UxClassifyContext, (XtPointer) NULL );
817
818 UxPutTopAttachment( label5, "attach_form" );
819 UxPutTopOffset( label5, 440 );
820 UxCreateWidget( label5 );
821
822 UxPutLeftOffset( pushButton6, 200 );
823 UxPutLeftAttachment( pushButton6, "attach_form" );
824 UxPutBottomOffset( pushButton6, 10 );
825 UxPutBottomAttachment( pushButton6, "attach_form" );
826 UxCreateWidget( pushButton6 );
827
828 UxPutLeftOffset( label11, 40 );
829 UxPutLeftAttachment( label11, "attach_form" );
830 UxPutTopOffset( label11, 100 );
831 UxPutTopAttachment( label11, "attach_form" );
832 UxCreateWidget( label11 );
833
834 UxPutTopOffset( label12, 100 );
835 UxPutTopAttachment( label12, "attach_form" );
836 UxPutLeftOffset( label12, 180 );
837 UxPutLeftAttachment( label12, "attach_form" );
838 UxCreateWidget( label12 );
839
840 UxPutTopOffset( label13, 100 );
841 UxPutTopAttachment( label13, "attach_form" );
842 UxPutLeftOffset( label13, 320 );
843 UxPutLeftAttachment( label13, "attach_form" );
844 UxCreateWidget( label13 );
845
846 UxPutLeftOffset( label21, 20 );
847 UxPutLeftAttachment( label21, "attach_form" );
848 UxPutTopOffset( label21, 30 );
849 UxPutTopAttachment( label21, "attach_form" );
850 UxCreateWidget( label21 );
851
852 UxPutTopOffset( sclas_t1, 25 );
853 UxPutTopAttachment( sclas_t1, "attach_form" );
854 UxCreateWidget( sclas_t1 );
855
856
857 UxPutMenuHelpWidget( pullDownMenu2, "pullDownMenu_top_b3" );
858
859 UxAddCallback( quitPane_b3, XmNactivateCallback,
860 activateCB_quitPane_b3,
861 (XtPointer) UxClassifyContext );
862
863 UxAddCallback( UtilsPane_b3, XmNactivateCallback,
864 activateCB_UtilsPane_b3,
865 (XtPointer) UxClassifyContext );
866
867 UxAddCallback( UtilsPane_b8, XmNactivateCallback,
868 activateCB_UtilsPane_b8,
869 (XtPointer) UxClassifyContext );
870
871 UxAddCallback( pullDownMenu1_p3_b3, XmNactivateCallback,
872 activateCB_pullDownMenu1_p3_b3,
873 (XtPointer) UxClassifyContext );
874
875 UxAddCallback( pullDownMenu1_p1_b3, XmNactivateCallback,
876 activateCB_pullDownMenu1_p1_b3,
877 (XtPointer) UxClassifyContext );
878
879 UxAddCallback( pullDownMenu2_p4_b1, XmNactivateCallback,
880 activateCB_pullDownMenu2_p4_b1,
881 (XtPointer) UxClassifyContext );
882
883 UxAddCallback( pullDownMenu2_p4_b2, XmNactivateCallback,
884 activateCB_pullDownMenu2_p4_b2,
885 (XtPointer) UxClassifyContext );
886
887 UxAddCallback( rowproc, XmNentryCallback,
888 entryCB_rowproc,
889 (XtPointer) UxClassifyContext );
890
891 UxAddCallback( pushButton6, XmNactivateCallback,
892 activateCB_pushButton6,
893 (XtPointer) UxClassifyContext );
894
895
896 /* Finally, call UxRealizeInterface to create the X windows
897 for the widgets created above. */
898
899 UxRealizeInterface( Classify );
900
901 UxMainWindowSetAreas( mainWindow2, pullDownMenu2, NULL_SWIDGET,
902 NULL_SWIDGET, NULL_SWIDGET, workAreaForm2 );
903 return ( Classify );
904 }
905
906 /*******************************************************************************
907 The following function includes the code that was entered
908 in the 'Initial Code' and 'Final Code' sections of the
909 Declarations Editor. This function is called from the
910 'Interface function' below.
911 *******************************************************************************/
912
913 static swidget _Ux_create_Classify()
914 {
915 swidget rtrn;
916 _UxCClassify *UxContext;
917
918 UxClassifyContext = UxContext =
919 (_UxCClassify *) UxMalloc( sizeof(_UxCClassify) );
920
921 rtrn = _Uxbuild_Classify();
922
923 return(rtrn);
924 }
925
926 /*******************************************************************************
927 The following is the 'Interface function' which is the
928 external entry point for creating this interface.
929 This function should be called from your application or from
930 a callback function.
931 *******************************************************************************/
932
933 swidget create_Classify()
934 {
935 swidget _Uxrtrn;
936 static int _Uxinit = 0;
937
938 if ( ! _Uxinit )
939 {
940 static XtActionsRec _Uxactions[] = {
941 { "HInit", action_HInit },
942 { "nothing", action_nothing },
943 { "SelectCommand", action_SelectCommand },
944 { "ClearHelp", action_ClearHelp },
945 { "WriteHelp", action_WriteHelp },
946 { "HelpACT", action_HelpACT }
947 };
948
949 XtAppAddActions( UxAppContext,
950 _Uxactions,
951 XtNumber(_Uxactions) );
952
953 _Uxinit = 1;
954 }
955
956 _Uxrtrn = _Ux_create_Classify();
957
958 return ( _Uxrtrn );
959 }
960
961 /*******************************************************************************
962 END OF FILE
963 *******************************************************************************/
964