1 /*****************************************************************************
2   FILE           : $Source: /projects/higgs1/SNNS/CVS/SNNS/xgui/sources/ui_layer.c,v $
3   SHORTNAME      : layer.c
4   SNNS VERSION   : 4.2
5 
6   PURPOSE        : popups a window with all layers. It is possible to choose layers
7                    and to alter layer names as well.
8   NOTES          : is called only during initialisation
9 
10   AUTHOR         : Tilman Sommer
11   DATE           : 31.8.1990
12 
13   CHANGED BY     :
14   RCS VERSION    : $Revision: 2.7 $
15   LAST CHANGE    : $Date: 1998/03/03 14:10:33 $
16 
17     Copyright (c) 1990-1995  SNNS Group, IPVR, Univ. Stuttgart, FRG
18     Copyright (c) 1996-1998  SNNS Group, WSI, Univ. Tuebingen, FRG
19 
20 ******************************************************************************/
21 #include <config.h>
22 
23 
24 #include <stdio.h>
25 
26 #include "ui.h"
27 
28 #include <X11/Xaw3d/Form.h>
29 #include <X11/Xaw3d/Command.h>
30 #include <X11/Xaw3d/Box.h>
31 #include <X11/Xaw3d/AsciiText.h>
32 #include <X11/Xaw3d/Label.h>
33 #include <X11/Xaw3d/Cardinals.h>
34 
35 #include "ui_xWidgets.h"
36 
37 #include "ui_layerP.h"
38 
39 #include "ui_layer.ph"
40 
41 
42 
43 /*****************************************************************************
44   FUNCTION : ui_xCreateLayerPanel
45 
46   PURPOSE  : create the panel
47   RETURNS  : void
48   NOTES    : the wigdet will be created in relative position to eachother
49 
50   UPDATE   :
51 *****************************************************************************/
52 
ui_xCreateLayerPanel(Widget parent)53 void ui_xCreateLayerPanel (Widget parent)
54 
55 {
56 
57     /* tabs for data fields and small buttons */
58 
59     Widget      oldLabel, nameLabel, nrLabel, label;
60 
61     int    i;
62     char   buf[80];
63     int    flagWord = ui_layerStartValue;
64     int    bit = 1;
65 
66     int  fontWidth = 8;
67 
68     int  labelWidth  =  9 * fontWidth;
69     int  nameWidth   = 25 * fontWidth;
70 
71 
72 
73 /***************************************************************************/
74 
75     ui_layerPanel =
76 	XtCreateManagedWidget("lPanel", formWidgetClass, parent, NULL, ZERO);
77 
78 
79 /*****************************  HEAD LINE  *********************************/
80 
81     nrLabel =
82 	ui_xCreateLabelItem("layer", ui_layerPanel, labelWidth,
83 			    NULL, NULL);
84     ui_xSetResize(nrLabel, TRUE);
85 
86     label = nrLabel;
87 
88     nameLabel =
89 	ui_xCreateLabelItem("name", ui_layerPanel, nameWidth,
90 			    nrLabel, NULL);
91 
92 /*****************************  LINES  *************************************/
93 
94     for (i=0; i<MAX_NO_LAYERS; i++) {
95 
96 	oldLabel = label;
97 	sprintf(buf,"%2d",i+1);
98 	label =
99 	    ui_xCreateLabelItem(buf, ui_layerPanel, labelWidth, NULL, label);
100 	ui_xSetResize(label, TRUE);
101 
102 	ui_layerNameWidgets[i] =
103 	    ui_xCreateDialogItem("layerName", ui_layerPanel,
104 				 &ui_layerNames[i][0], nameWidth,
105 				 nrLabel, oldLabel);
106 
107 	ui_layerButtonWidgets[i] =
108 	    ui_xCreateToggleItem("on", ui_layerPanel, NULL,
109 				 ui_layerNameWidgets[i], oldLabel);
110 	ui_xSetToggleState(ui_layerButtonWidgets[i],
111 			   ui_utilIsSet(flagWord, bit));
112 	bit *= 2;
113     }
114 
115 /***************************************************************************/
116 
117     XawFormDoLayout(ui_layerPanel, True);
118 }
119 
120 
121 
122 
123 
124 
125 
126 
127 
128 /* end of file */
129 /* lines: 132 */
130