File: topLevelShell1.c

package info (click to toggle)
ctn 3.2.0~dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 15,336 kB
  • ctags: 21,262
  • sloc: ansic: 179,501; makefile: 7,004; java: 1,863; csh: 1,067; yacc: 523; sh: 424; cpp: 394; sql: 389; lex: 170
file content (1134 lines) | stat: -rw-r--r-- 29,964 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134

/*******************************************************************************
	topLevelShell1.c

       Associated Header file: topLevelShell1.h
*******************************************************************************/

#include <stdio.h>
#include <Xm/Xm.h>
#include <Xm/MwmUtil.h>
#include <Xm/MenuShell.h>
#include "UxXt.h"

#include <Xm/Text.h>
#include <Xm/Text.h>
#include <Xm/List.h>
#include <Xm/ScrolledW.h>
#include <Xm/Label.h>
#include <Xm/BulletinB.h>
#include <Xm/CascadeB.h>
#include <Xm/PushB.h>
#include <Xm/Separator.h>
#include <Xm/RowColumn.h>
#include <Xm/MainW.h>
#include <X11/Shell.h>

/*******************************************************************************
       Includes, Defines, and Global variables from the Declarations Editor:
*******************************************************************************/

/*
          Copyright (C) 1993, 1994, RSNA and Washington University

          The software and supporting documentation for the Radiological
          Society of North America (RSNA) 1993, 1994 Digital Imaging and
          Communications in Medicine (DICOM) Demonstration were developed
          at the
                  Electronic Radiology Laboratory
                  Mallinckrodt Institute of Radiology
                  Washington University School of Medicine
                  510 S. Kingshighway Blvd.
                  St. Louis, MO 63110
          as part of the 1993, 1994 DICOM Central Test Node project for, and
          under contract with, the Radiological Society of North America.

          THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND NEITHER RSNA NOR
          WASHINGTON UNIVERSITY MAKE ANY WARRANTY ABOUT THE SOFTWARE, ITS
          PERFORMANCE, ITS MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR
          USE, FREEDOM FROM ANY COMPUTER DISEASES OR ITS CONFORMITY TO ANY
          SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND PERFORMANCE OF
          THE SOFTWARE IS WITH THE USER.

          Copyright of the software and supporting documentation is
          jointly owned by RSNA and Washington University, and free access
          is hereby granted as a license to use this software, copy this
          software and prepare derivative works based upon this software.
          However, any distribution of this software source code or
          supporting documentation or derivative works (source code and
          supporting documentation) must include the three paragraphs of
          the copyright notice.
*/
/* Copyright marker.  Copyright will be inserted above.  Do not remove */

/*
**                     Electronic Radiology Laboratory
**                   Mallinckrodt Institute of Radiology
**                Washington University School of Medicine
**
** Module Name(s):        main
**                        openfile
**                        format
**                        browseSelectionCB_scrolledList1
**                        browseSelectionCB_scrolledList2
**                        browseSelectionCB_scrolledList3
**
** Author, Date:          Chander L. Sabharwal, 27-June-94
**
** Intent:                This program lets the user view all the data-
**                        items in the patient data file.
**
** Last Updates:	  $Author: smm $, $Date: 1995-12-19 21:58:31 $
**
** Source File:           $RCSfile: topLevelShell1.c,v $
**
** Revision:              $Revision: 1.4 $
**
** Status:		  $State: Exp $
*/

static char rcsid[] = "$Revision: 1.4 $ $RCSfile: topLevelShell1.c,v $";


#include "dicom.h"
#include "condition.h"
#include "lst.h"
#include "mut.h"

#include "dicom_uids.h"
#include "dicom_objects.h"
#include "dicom_ie.h"
#include "dicom_messages.h"

#include "format.h"

extern swidget fileSelectionBoxDialog1;
swidget create_fileSelectionBoxDialog1();

void openfile();
void copyWtext();

CTNBOOLEAN
errorstackP(unsigned long v, char *mes);

CTNBOOLEAN			/* to clear the stack of errors */
clearStack = TRUE;

/* byte order in data stream */
unsigned long options = DCM_ORDERLITTLEENDIAN;

/* Handle to the information object */
DCM_OBJECT *queryObject = NULL;

/* Handle to the IE_OBJECT object */
IE_OBJECT *ieObject = NULL;

/* Handle to IE_MODULE */
IE_MODULE *ieModule = NULL;

/* Handle to IE_ATTRIBUTE */
IE_ATTRIBUTE *ieAttr = NULL;

/* Handle to LST_HEAD */
LST_HEAD *ie_head,
   *mod_head,
   *attr_head;

/* Handle to the IE_INFORMATIONENTITY */
IE_INFORMATIONENTITY *ieIE = NULL;

/* Handle to the DCM_ELEMENT */
DCM_ELEMENT element;

/**char      info[500];**/
char *info;
int kount = 0;


static Widget topLevelShell1;
static Widget mainWindow1;
static Widget menu1;
static Widget menu1_p1;
static Widget menu1_p1_b1;
static Widget menu1_p1_b2;
static Widget menu1_p1_b3;
static Widget menu1_p1_b4;
static Widget menu1_top_b1;
static Widget bulletinBoard1;
static Widget label1;
static Widget label2;
static Widget scrolledWindowList1;
static Widget scrolledList1;
static Widget scrolledWindowList2;
static Widget scrolledList2;
static Widget label3;
static Widget text1;
static Widget scrolledWindowList3;
static Widget scrolledList3;
static Widget label4;
static Widget text2;
static Widget label5;
static Widget scrolledWindowText1;
static Widget scrolledText1;
static Widget text3;
static swidget UxParent;

#define CONTEXT_MACRO_ACCESS 1
#include "topLevelShell1.h"
#undef CONTEXT_MACRO_ACCESS


/*******************************************************************************
Auxiliary code from the Declarations Editor:
*******************************************************************************/

/* openfile
**
** Purpose:
**      This subroutine opens DICOM files that contain DICOM information
**      object, examines the object for information entity(IE),
**      and calls a function to load the information entity list
**      in scrolledList1(window) for viewing and selection. It also
**      writes the selected patient-data filename in a text widget.
**
** Parameter Dictionary:
**      filename       input, DICOM filename to be viewed
**
** Return Values:
**      list of information entity loaded in scrolledList1
**
** Notes:
**
** Algorithm:
**      Description of the algorithm (optional) and any other notes.
*/

void
openfile(char *filename)
{
    char buff[80],
        bname[80];
    int nitems;
    int cnt = 0;
    XmString *strlist;
    CONDITION cond;


/**memset(info, 0 ,sizeof(info));
copyWtext(info);**/

/* show selected patient filename in text widget */
    sprintf(bname, "File Selected:  %s", filename);
    XmTextSetString(text3, bname);

/* clear the scrolledlist windows, befor opening a new file*/
    XtVaGetValues(scrolledList1,
		  XmNitemCount, &cnt,
		  XmNitems, &strlist,
		  NULL);
    if (cnt != 0) {
	XmListDeleteAllItems(scrolledList1);
/*lint -e64*/
	XtFree(strlist);
/*lint +e64*/
    }
    XtVaGetValues(scrolledList2,
		  XmNitemCount, &cnt,
		  XmNitems, &strlist,
		  NULL);
    if (cnt != 0) {
	XmListDeleteAllItems(scrolledList2);
/*lint -e64*/
	XtFree(strlist);
/*lint +e64*/
    }
    XtVaGetValues(scrolledList3,
		  XmNitemCount, &cnt,
		  XmNitems, &strlist,
		  NULL);
    if (cnt != 0) {
	XmListDeleteAllItems(scrolledList3);
/*lint -e64*/
	XtFree(strlist);
/*lint +e64*/
    }
/* Clear text widgets */
    if (strlen(XmTextGetString(text1)) != 0)
	XmTextSetString(text1, NULL);
    if (strlen(XmTextGetString(text2)) != 0)
	XmTextSetString(text2, NULL);

    if (strlen(XmTextGetString(scrolledText1)) != 0)
	XmTextSetString(scrolledText1, NULL);

    if (ieObject != NULL) {
	cond = IE_Free((void **) &ieObject);
	if (cond != IE_NORMAL) {
	    (void) COND_ExtractConditions(errorstackP);
	    copyWtext(info);
	    (void) COND_PopCondition(clearStack);
	    free(info);
	}
    }
    free(ieObject);

    if (ieIE != NULL) {
	cond = IE_Free((void **) &ieIE);
	if (cond != IE_NORMAL) {
	    (void) COND_ExtractConditions(errorstackP);
	    copyWtext(info);
	    (void) COND_PopCondition(clearStack);
	    free(info);
	}
    }
    free(ieIE);
    if (ieModule != NULL) {
	cond = IE_Free((void **) &ieModule);
	if (cond != IE_NORMAL) {
	    (void) COND_ExtractConditions(errorstackP);
	    copyWtext(info);
	    (void) COND_PopCondition(clearStack);
	    free(info);
	}
    }
    free(ieModule);

    if (ieAttr != NULL) {
	cond = IE_Free((void **) &ieAttr);
	if (cond != IE_NORMAL) {
	    (void) COND_ExtractConditions(errorstackP);
	    copyWtext(info);
	    (void) COND_PopCondition(clearStack);
	    free(info);
	}
    }
    free(ieAttr);

    if (queryObject != NULL) {
	cond = DCM_CloseObject(&queryObject);
	if (cond != DCM_NORMAL) {
	    (void) COND_ExtractConditions(errorstackP);
	    copyWtext(info);
	    (void) COND_PopCondition(clearStack);
	    free(info);
	}
    }
    free(queryObject);

    kount = kount + 1;
    printf(" %d, %s\n", kount, filename);

    cond = DCM_OpenFile(filename, options, &queryObject);
    if (cond != DCM_NORMAL) {
	(void) COND_ExtractConditions(errorstackP);
	copyWtext(info);
	(void) COND_PopCondition(clearStack);
	free(info);
    } else {
	cond = IE_ExamineObject(&queryObject, &ieObject);
	if (cond != IE_NORMAL) {
	    (void) COND_ExtractConditions(errorstackP);
	    copyWtext(info);
	    (void) COND_PopCondition(clearStack);
	    free(info);
	}
	ie_head = ieObject->ieList;

	MUT_LoadList(scrolledList1, ie_head, formatieList, buff);

    }
    free(filename);
}



CTNBOOLEAN
errorstackP(unsigned long v, char *mes)
{

    char buff[20];

    if ((info = (char *) malloc(500)) == NULL)
	printf(" malloc info failed\n");

    sprintf(buff, "%8x", v);
    printf(" %s\n", mes);
    strcat(info, buff);
    strcat(info, "        ");
    strcat(info, mes);
    strcat(info, "\n");
    return (TRUE);
}



void
copyWtext(char *ptr)
{
    XmTextSetString(scrolledText1, ptr);
}

/*******************************************************************************
       The following are callback functions.
*******************************************************************************/

static void
activateCB_menu1_p1_b2(
		       Widget wgt,
		       XtPointer cd,
		       XtPointer cb)
{
    Widget UxWidget = wgt;
    XtPointer UxClientData = cd;
    XtPointer UxCallbackArg = cb;
    UxPopupInterface(fileSelectionBoxDialog1, no_grab);
}

static void
activateCB_menu1_p1_b4(
		       Widget wgt,
		       XtPointer cd,
		       XtPointer cb)
{
    Widget UxWidget = wgt;
    XtPointer UxClientData = cd;
    XtPointer UxCallbackArg = cb;
    /*
     * activateCP_menu1_p1_b4 *
     * 
     * Purpose: *   This subroutine closes all the open structures and dicom
     * Object *   before quitting the program *
     * 
     * Parameter Dictinary: *      none * Return Value: *      none *
     * 
     * Notes: *
     * 
     * Algorithm: *      Description of the algorithm (optional) and ant other
     * notes. *
     * 
     */


    if (ieIE != NULL)
	(void) IE_Free((void **) &ieIE);
    /**  cond = IE_Free(ieIE);
      if(cond != IE_NORMAL)
        (void) COND_DumpConditions();**/

    if (ieModule != NULL)
	(void) IE_Free((void **) &ieModule);
    /**  cond = IE_Free(ieModule);
      if(cond != IE_NORMAL)
        (void) COND_DumpConditions();**/

    if (ieAttr != NULL)
	(void) IE_Free((void **) &ieAttr);
    /**  cond = IE_Free(ieAttr);
      if(cond != IE_NORMAL)
        (void) COND_DumpConditions();**/

    if (ieObject != NULL)
	(void) IE_Free((void **) &ieObject);
    /**  cond = IE_Free(ieObject);
      if(cond != IE_NORMAL)
        (void) COND_DumpConditions();**/

    (void) DCM_CloseObject(&queryObject);

    exit(0);
}

static void
browseSelectionCB_scrolledList1(
				Widget wgt,
				XtPointer cd,
				XtPointer cb)
{
    Widget UxWidget = wgt;
    XtPointer UxClientData = cd;
    XtPointer UxCallbackArg = cb;
    {
	/*
	 * scrolledList1 *
	 * 
	 * Purpose: *   This subrouitne examines the selected information
	 * entity(IE), *   finds a pointer to module-list structure and loads
	 * the list of *   modules in scrolledList2(window). *
	 * 
	 * Parameter Dictionary: *      cbs             input, pointer to the
	 * selected IE structure *
	 * 
	 * Return Value: *      list of modules loaded in the scrolledList2 *
	 * 
	 * Notes: *
	 * 
	 * Algorithm: *      Description of the algorithm (optional) and any
	 * other notes. *
	 * 
	 */
	XmListCallbackStruct *cbs;

	char *iename;
	int i;
	char buff[80];

	CONDITION cond;

	int cnt3 = 0;
	XmString *strlist3;

	cbs = (XmListCallbackStruct *) UxCallbackArg;


	/* if selected a new item from List1(IE), then clear list3 */

	XtVaGetValues(scrolledList2,
		      XmNitemCount, &cnt3,
		      XmNitems, &strlist3,
		      NULL);

	if (cnt3 != 0) {
	    XmListDeleteAllItems(scrolledList2);
	    /* lint -e64 */
	    XtFree(strlist3);
	    /* lint +e64 */
	}
	XtVaGetValues(scrolledList3,
		      XmNitemCount, &cnt3,
		      XmNitems, &strlist3,
		      NULL);

	if (cnt3 != 0) {
	    XmListDeleteAllItems(scrolledList3);
	    /* lint -e64 */
	    XtFree(strlist3);
	    /* lint +e64 */
	}
	/* clear any previosly open structure IE */
	if (ieIE != NULL) {
	    cond = IE_Free((void **) &ieIE);
	    if (cond != IE_NORMAL) {
		(void) COND_ExtractConditions(errorstackP);
		copyWtext(info);
		(void) COND_PopCondition(clearStack);
		free(info);
	    }
	}
	free(ieIE);

	/* clear text widgets */
	if (strlen(XmTextGetString(text1)) != 0)
	    XmTextSetString(text1, NULL);
	if (strlen(XmTextGetString(text2)) != 0)
	    XmTextSetString(text2, NULL);

	/* pointer to the head-end of the list, ieList */
	ieIE = LST_Head(&ie_head);
	/* makes current the node */
	(void) LST_Position(&ie_head, ieIE);

	/* pointer to the next item  */
	for (i = 2; i <= cbs->item_position; i++)
	    ieIE = LST_Next(&ie_head);

	cond = IE_ExamineInformationEntity(&queryObject, ieIE->ieType, &ieIE);
	if (cond != IE_NORMAL) {
	    (void) COND_ExtractConditions(errorstackP);
	    copyWtext(info);
	    (void) COND_PopCondition(clearStack);
	    free(info);
	}
	mod_head = ieIE->moduleList;

	MUT_LoadList(scrolledList2, ieIE->moduleList, formatmodieList, buff);



    }
}

static void
browseSelectionCB_scrolledList2(
				Widget wgt,
				XtPointer cd,
				XtPointer cb)
{
    Widget UxWidget = wgt;
    XtPointer UxClientData = cd;
    XtPointer UxCallbackArg = cb;
    {
	/*
	 * scrolledList2 *
	 * 
	 * Purpose: *   This subroutine examines the selected module, finds a
	 * pointer *   to the atrribute-list structure and loads the list of
	 * attributes *   in scrolledList3(window) *
	 * 
	 * Parameter Dictinary: *      cbs            input, pointer to the
	 * selected module structure *
	 * 
	 * Return Value: *      list of attributes loaded in scrolledList3 *
	 * 
	 * Notes: *
	 * 
	 * Algorithm: *      Description of the algorithm (optional) and any
	 * other notes. *
	 * 
	 */
	XmListCallbackStruct *cbs;

	char *modname;
	char buff[80];
	int i;
	int cnt = 0;
	XmString *strlist;

	CONDITION cond;

	cbs = (XmListCallbackStruct *) UxCallbackArg;

	/* clear scrolledlist3 */
	XtVaGetValues(scrolledList3,
		      XmNitemCount, &cnt,
		      XmNitems, &strlist,
		      NULL);
	if (cnt != 0) {
	    XmListDeleteAllItems(scrolledList3);
	    /* lint -e64 */
	    XtFree(strlist);
	    /* lint +e64 */
	}
	if (strlen(XmTextGetString(text1)) != 0)
	    XmTextSetString(text1, NULL);
	if (strlen(XmTextGetString(text2)) != 0)
	    XmTextSetString(text2, NULL);

	/* if any previous module structure is open, free it */
	if (ieModule != NULL) {
	    cond = IE_Free((void **) &ieModule);
	    if (cond != IE_NORMAL) {
		(void) COND_ExtractConditions(errorstackP);
		copyWtext(info);
		(void) COND_PopCondition(clearStack);
		free(info);
	    }
	}
	free(ieModule);

	/* load scrolledList3 with attributeList */

	ieModule = LST_Head(&mod_head);
	(void) LST_Position(&mod_head, ieModule);
	for (i = 2; i <= cbs->item_position; i++)
	    ieModule = LST_Next(&mod_head);

	cond = IE_ExamineModule(&queryObject, ieIE->ieType, ieModule->moduleType, &ieModule);
	if (cond != IE_NORMAL) {
	    (void) COND_ExtractConditions(errorstackP);
	    copyWtext(info);
	    (void) COND_PopCondition(clearStack);
	    free(info);
	}
	attr_head = ieModule->attributeList;

	MUT_LoadList(scrolledList3, ieModule->attributeList, formatattrieList, buff);


    }
}

static void
browseSelectionCB_scrolledList3(
				Widget wgt,
				XtPointer cd,
				XtPointer cb)
{
    Widget UxWidget = wgt;
    XtPointer UxClientData = cd;
    XtPointer UxCallbackArg = cb;
    {
	/*
	 * scrolledList3 *
	 * 
	 * Purpose: *   This subroutine lists the description of the selected
	 * attribute *   in the text widgets. *
	 * 
	 * Parameter Dictinary: *      cbs            input, pointer to the
	 * selected attribute *
	 * 
	 * Return Value: *      Description of the element *
	 * 
	 * Notes: *
	 * 
	 * Algorithm: *      Description of the algorithm (optional) and any
	 * other notes. *
	 * 
	 */

	XmListCallbackStruct *cbs;

	char *atname;
	int i;
	char buf2[64],
	    buf1[64];

	CONDITION cond;

	unsigned short gg,
	    ee;

	cbs = (XmListCallbackStruct *) UxCallbackArg;

	if ((atname = (char *) malloc(64)) == NULL)
	    printf(" malloc atname failed\n");

	XmStringGetLtoR(cbs->item, XmSTRING_DEFAULT_CHARSET, &atname);


	if (strlen(XmTextGetString(text1)) != 0)
	    XmTextSetString(text1, NULL);
	if (strlen(XmTextGetString(text2)) != 0)
	    XmTextSetString(text2, NULL);

	ieAttr = LST_Head(&attr_head);
	(void) LST_Position(&attr_head, ieAttr);
	for (i = 2; i <= cbs->item_position; i++)
	    ieAttr = LST_Next(&attr_head);

	cond = DCM_LookupElement(&ieAttr->element);
	if (cond != DCM_NORMAL) {
	    (void) COND_ExtractConditions(errorstackP);
	    copyWtext(info);
	    (void) COND_PopCondition(clearStack);
	    free(info);
	}
	sprintf(buf1, " %s", atname);
	XmTextSetString(text1, buf1);

	if (ieAttr->element.length == 0) {
	    strcpy(buf2, "<None>");
	    XmTextSetString(text2, buf2);
	} else {
	    switch (ieAttr->element.representation) {

	    case DCM_AS:	/* Age String */
	    case DCM_CS:	/* control string */
	    case DCM_DA:	/* date */
	    case DCM_DS:	/* decimal string */
	    case DCM_IS:	/* integer string */
	    case DCM_LO:	/* long string */
	    case DCM_LT:	/* long text */
	    case DCM_ST:	/* short text */
	    case DCM_SH:	/* short string */
	    case DCM_TM:	/* time */
	    case DCM_UI:	/* uid */
	    case DCM_PN:	/* person name */

		gg = DCM_TAG_GROUP(ieAttr->element.tag);
		ee = DCM_TAG_ELEMENT(ieAttr->element.tag);

		sprintf(buf2, "%04x,  %04x,   %s", gg, ee, ieAttr->element.d.string);
		XmTextSetString(text2, buf2);

		break;

	    case DCM_SS:	/* signed short */
		gg = DCM_TAG_GROUP(ieAttr->element.tag);
		ee = DCM_TAG_ELEMENT(ieAttr->element.tag);
		sprintf(buf2, "%04x,  %04x,  %d", gg, ee, *(ieAttr->element.d.us));
		XmTextSetString(text2, buf2);
		break;

	    case DCM_SL:	/* signed long */
		gg = DCM_TAG_GROUP(ieAttr->element.tag);
		ee = DCM_TAG_ELEMENT(ieAttr->element.tag);
		sprintf(buf2, " %04x,  %04x,  %d", gg, ee, *(ieAttr->element.d.sl));
		XmTextSetString(text2, buf2);
		break;

	    case DCM_US:	/* unsigned short */
		gg = DCM_TAG_GROUP(ieAttr->element.tag);
		ee = DCM_TAG_ELEMENT(ieAttr->element.tag);
		sprintf(buf2, " %04x, %04x, %d", gg, ee, *(ieAttr->element.d.us));
		XmTextSetString(text2, buf2);
		break;

	    case DCM_UL:	/* unsigned long */
		gg = DCM_TAG_GROUP(ieAttr->element.tag);
		ee = DCM_TAG_ELEMENT(ieAttr->element.tag);
		sprintf(buf2, " %04x, %04x, %d", gg, ee, *(ieAttr->element.d.ul));
		XmTextSetString(text2, buf2);
		break;

	    default:
		break;
	    }
	}
	free(atname);

    }
}

/*******************************************************************************
       The 'build_' function creates all the widgets
       using the resource values specified in the Property Editor.
*******************************************************************************/

static Widget
_Uxbuild_topLevelShell1()
{
    Widget _UxParent;
    Widget menu1_p1_shell;


    /* Creation of topLevelShell1 */
    _UxParent = UxParent;
    if (_UxParent == NULL) {
	_UxParent = UxTopLevel;
    }
    topLevelShell1 = XtVaCreatePopupShell("topLevelShell1",
					  topLevelShellWidgetClass,
					  _UxParent,
					  XmNwidth, 1000,
					  XmNheight, 662,
					  XmNx, 49,
					  XmNy, 161,
					  XmNiconName, "OBJECT-VIEWER",
					  NULL);


    /* Creation of mainWindow1 */
    mainWindow1 = XtVaCreateManagedWidget("mainWindow1",
					  xmMainWindowWidgetClass,
					  topLevelShell1,
					  XmNwidth, 1000,
					  XmNheight, 662,
					  XmNx, 0,
					  XmNy, 0,
					  XmNunitType, XmPIXELS,
					  NULL);


    /* Creation of menu1 */
    menu1 = XtVaCreateManagedWidget("menu1",
				    xmRowColumnWidgetClass,
				    mainWindow1,
				    XmNrowColumnType, XmMENU_BAR,
				    XmNmenuAccelerator, "<KeyUp>F10",
				    NULL);


    /* Creation of menu1_p1 */
    menu1_p1_shell = XtVaCreatePopupShell("menu1_p1_shell",
					  xmMenuShellWidgetClass, menu1,
					  XmNwidth, 1,
					  XmNheight, 1,
					  XmNallowShellResize, TRUE,
					  XmNoverrideRedirect, TRUE,
					  NULL);

    menu1_p1 = XtVaCreateWidget("menu1_p1",
				xmRowColumnWidgetClass,
				menu1_p1_shell,
				XmNrowColumnType, XmMENU_PULLDOWN,
				NULL);


    /* Creation of menu1_p1_b1 */
    menu1_p1_b1 = XtVaCreateManagedWidget("menu1_p1_b1",
					  xmSeparatorWidgetClass,
					  menu1_p1,
					  NULL);


    /* Creation of menu1_p1_b2 */
    menu1_p1_b2 = XtVaCreateManagedWidget("menu1_p1_b2",
					  xmPushButtonWidgetClass,
					  menu1_p1,
					RES_CONVERT(XmNlabelString, "Open"),
					  RES_CONVERT(XmNmnemonic, "O"),
					  NULL);
    XtAddCallback(menu1_p1_b2, XmNactivateCallback,
		  (XtCallbackProc) activateCB_menu1_p1_b2,
		  (XtPointer) NULL);



    /* Creation of menu1_p1_b3 */
    menu1_p1_b3 = XtVaCreateManagedWidget("menu1_p1_b3",
					  xmSeparatorWidgetClass,
					  menu1_p1,
					  NULL);


    /* Creation of menu1_p1_b4 */
    menu1_p1_b4 = XtVaCreateManagedWidget("menu1_p1_b4",
					  xmPushButtonWidgetClass,
					  menu1_p1,
					RES_CONVERT(XmNlabelString, "Quit"),
					  RES_CONVERT(XmNmnemonic, "Q"),
					  NULL);
    XtAddCallback(menu1_p1_b4, XmNactivateCallback,
		  (XtCallbackProc) activateCB_menu1_p1_b4,
		  (XtPointer) NULL);



    /* Creation of menu1_top_b1 */
    menu1_top_b1 = XtVaCreateManagedWidget("menu1_top_b1",
					   xmCascadeButtonWidgetClass,
					   menu1,
					RES_CONVERT(XmNlabelString, "File"),
					   RES_CONVERT(XmNmnemonic, "F"),
					   XmNsubMenuId, menu1_p1,
					   XmNfontList, UxConvertFontList("-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1"),
					   NULL);


    /* Creation of bulletinBoard1 */
    bulletinBoard1 = XtVaCreateManagedWidget("bulletinBoard1",
					     xmBulletinBoardWidgetClass,
					     mainWindow1,
					     NULL);


    /* Creation of label1 */
    label1 = XtVaCreateManagedWidget("label1",
				     xmLabelWidgetClass,
				     bulletinBoard1,
				     XmNx, 10,
				     XmNy, 80,
				     XmNwidth, 176,
				     XmNheight, 28,
			  RES_CONVERT(XmNlabelString, "INFORMATION ENTITY"),
				     XmNfontList, UxConvertFontList("-adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1"),
				     NULL);


    /* Creation of label2 */
    label2 = XtVaCreateManagedWidget("label2",
				     xmLabelWidgetClass,
				     bulletinBoard1,
				     XmNx, 320,
				     XmNy, 80,
				     XmNwidth, 88,
				     XmNheight, 24,
				     RES_CONVERT(XmNlabelString, "MODULES"),
				     XmNfontList, UxConvertFontList("-adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1"),
				     NULL);


    /* Creation of scrolledWindowList1 */
    scrolledWindowList1 = XtVaCreateManagedWidget("scrolledWindowList1",
						xmScrolledWindowWidgetClass,
						  bulletinBoard1,
				  XmNscrollingPolicy, XmAPPLICATION_DEFINED,
						XmNvisualPolicy, XmVARIABLE,
					XmNscrollBarDisplayPolicy, XmSTATIC,
						  XmNshadowThickness, 0,
						  XmNx, 10,
						  XmNy, 110,
						  NULL);


    /* Creation of scrolledList1 */
    scrolledList1 = XtVaCreateManagedWidget("scrolledList1",
					    xmListWidgetClass,
					    scrolledWindowList1,
					    XmNwidth, 280,
					    XmNheight, 324,
					    XmNx, 0,
					    XmNy, 110,
					    XmNfontList, UxConvertFontList("-adobe-helvetica-bold-r-normal--14-100-100-100-p-82-iso8859-1"),
					    NULL);
    XtAddCallback(scrolledList1, XmNbrowseSelectionCallback,
		  (XtCallbackProc) browseSelectionCB_scrolledList1,
		  (XtPointer) NULL);



    /* Creation of scrolledWindowList2 */
    scrolledWindowList2 = XtVaCreateManagedWidget("scrolledWindowList2",
						xmScrolledWindowWidgetClass,
						  bulletinBoard1,
				  XmNscrollingPolicy, XmAPPLICATION_DEFINED,
						XmNvisualPolicy, XmVARIABLE,
					XmNscrollBarDisplayPolicy, XmSTATIC,
						  XmNshadowThickness, 0,
						  XmNx, 310,
						  XmNy, 110,
						  NULL);


    /* Creation of scrolledList2 */
    scrolledList2 = XtVaCreateManagedWidget("scrolledList2",
					    xmListWidgetClass,
					    scrolledWindowList2,
					    XmNwidth, 316,
					    XmNheight, 324,
					    XmNx, 0,
					    XmNy, 110,
					    XmNfontList, UxConvertFontList("-adobe-helvetica-bold-r-normal--14-100-100-100-p-82-iso8859-1"),
					    NULL);
    XtAddCallback(scrolledList2, XmNbrowseSelectionCallback,
		  (XtCallbackProc) browseSelectionCB_scrolledList2,
		  (XtPointer) NULL);



    /* Creation of label3 */
    label3 = XtVaCreateManagedWidget("label3",
				     xmLabelWidgetClass,
				     bulletinBoard1,
				     XmNx, 20,
				     XmNy, 440,
				     XmNwidth, 92,
				     XmNheight, 28,
				  RES_CONVERT(XmNlabelString, "ATTRIBUTE "),
				     XmNfontList, UxConvertFontList("-adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1"),
				     NULL);


    /* Creation of text1 */
    text1 = XtVaCreateManagedWidget("text1",
				    xmTextWidgetClass,
				    bulletinBoard1,
				    XmNwidth, 400,
				    XmNx, 10,
				    XmNy, 470,
				    XmNheight, 70,
				    XmNfontList, UxConvertFontList("-adobe-helvetica-bold-r-normal--14-100-100-100-p-82-iso8859-1"),
				    NULL);


    /* Creation of scrolledWindowList3 */
    scrolledWindowList3 = XtVaCreateManagedWidget("scrolledWindowList3",
						xmScrolledWindowWidgetClass,
						  bulletinBoard1,
				  XmNscrollingPolicy, XmAPPLICATION_DEFINED,
						XmNvisualPolicy, XmVARIABLE,
					XmNscrollBarDisplayPolicy, XmSTATIC,
						  XmNshadowThickness, 0,
						  XmNx, 650,
						  XmNy, 110,
						  NULL);


    /* Creation of scrolledList3 */
    scrolledList3 = XtVaCreateManagedWidget("scrolledList3",
					    xmListWidgetClass,
					    scrolledWindowList3,
					    XmNwidth, 304,
					    XmNheight, 324,
					    XmNx, 0,
					    XmNy, 110,
					    XmNfontList, UxConvertFontList("-adobe-helvetica-bold-r-normal--14-100-100-100-p-82-iso8859-1"),
					    NULL);
    XtAddCallback(scrolledList3, XmNbrowseSelectionCallback,
		  (XtCallbackProc) browseSelectionCB_scrolledList3,
		  (XtPointer) NULL);



    /* Creation of label4 */
    label4 = XtVaCreateManagedWidget("label4",
				     xmLabelWidgetClass,
				     bulletinBoard1,
				     XmNx, 660,
				     XmNy, 80,
				     XmNwidth, 104,
				     XmNheight, 24,
				  RES_CONVERT(XmNlabelString, "ATTRIBUTES"),
				     XmNfontList, UxConvertFontList("-adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1"),
				     NULL);


    /* Creation of text2 */
    text2 = XtVaCreateManagedWidget("text2",
				    xmTextWidgetClass,
				    bulletinBoard1,
				    XmNwidth, 560,
				    XmNx, 410,
				    XmNy, 470,
				    XmNheight, 70,
				    XmNfontList, UxConvertFontList("-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1"),
				    XmNwordWrap, FALSE,
				    NULL);


    /* Creation of label5 */
    label5 = XtVaCreateManagedWidget("label5",
				     xmLabelWidgetClass,
				     bulletinBoard1,
				     XmNx, 420,
				     XmNy, 440,
				     XmNwidth, 196,
				     XmNheight, 28,
		       RES_CONVERT(XmNlabelString, "ATTRIBUTE INFORMATION"),
				     XmNfontList, UxConvertFontList("-adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1"),
				     NULL);


    /* Creation of scrolledWindowText1 */
    scrolledWindowText1 = XtVaCreateManagedWidget("scrolledWindowText1",
						xmScrolledWindowWidgetClass,
						  bulletinBoard1,
				  XmNscrollingPolicy, XmAPPLICATION_DEFINED,
						XmNvisualPolicy, XmVARIABLE,
					XmNscrollBarDisplayPolicy, XmSTATIC,
						  XmNx, 30,
						  XmNy, 550,
						  NULL);


    /* Creation of scrolledText1 */
    scrolledText1 = XtVaCreateManagedWidget("scrolledText1",
					    xmTextWidgetClass,
					    scrolledWindowText1,
					    XmNwidth, 890,
					    XmNheight, 50,
					    XmNfontList, UxConvertFontList("-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1"),
					    NULL);


    /* Creation of text3 */
    text3 = XtVaCreateManagedWidget("text3",
				    xmTextWidgetClass,
				    bulletinBoard1,
				    XmNwidth, 880,
				    XmNx, 90,
				    XmNy, 20,
				    XmNheight, 40,
				    XmNfontList, UxConvertFontList("-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1"),
				    NULL);


    XmMainWindowSetAreas(mainWindow1, menu1, (Widget) NULL,
			 (Widget) NULL, (Widget) NULL, bulletinBoard1);

    return (topLevelShell1);
}

/*******************************************************************************
       The following is the 'Interface function' which is the
       external entry point for creating this interface.
       This function should be called from your application or from
       a callback function.
*******************************************************************************/

Widget
create_topLevelShell1(swidget _UxUxParent)
{
    Widget rtrn;

    UxParent = _UxUxParent;

    rtrn = _Uxbuild_topLevelShell1();

    create_fileSelectionBoxDialog1(NO_PARENT);
    return (rtrn);
}

/*******************************************************************************
       END OF FILE
*******************************************************************************/