annotate pkg-src/tree-x/intf.c @ 163:0132846995bd r20-3b8

Import from CVS: tag r20-3b8
author cvs
date Mon, 13 Aug 2007 09:43:35 +0200
parents
children 85ec50267440
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1 /* ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
2 * File : intf.c
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
3 * Purpose : X11/Athena interface code
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
4 * ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
5 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
6
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
7 #define GLOBALS 1
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
8
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
9 #include <stdio.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
10 #include <string.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
11 #include <fcntl.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
12
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
13 #include <X11/IntrinsicP.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
14 #include <X11/ShellP.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
15
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
16 #include <X11/Intrinsic.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
17 #include <X11/StringDefs.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
18
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
19 #ifdef XAW3D
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
20 #include <X11/Xaw3d/Box.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
21 #include <X11/Xaw3d/Simple.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
22 #include <X11/Xaw3d/MenuButton.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
23 #include <X11/Xaw3d/SimpleMenu.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
24 #include <X11/Xaw3d/SmeBSB.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
25 #include <X11/Xaw3d/SmeLine.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
26 #include <X11/Xaw3d/Form.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
27 #include <X11/Xaw3d/Label.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
28 #include <X11/Xaw3d/Dialog.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
29 #include <X11/Xaw3d/AsciiText.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
30 #include <X11/Xaw3d/AsciiSrc.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
31 #include <X11/Xaw3d/Viewport.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
32 #include <X11/Xaw3d/Scrollbar.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
33 #include <X11/Xaw3d/Paned.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
34 #include <X11/Xaw3d/Panner.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
35 #include <X11/Xaw3d/Reports.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
36 #else
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
37 #include <X11/Xaw/Box.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
38 #include <X11/Xaw/Simple.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
39 #include <X11/Xaw/MenuButton.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
40 #include <X11/Xaw/SimpleMenu.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
41 #include <X11/Xaw/SmeBSB.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
42 #include <X11/Xaw/SmeLine.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
43 #include <X11/Xaw/Form.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
44 #include <X11/Xaw/Label.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
45 #include <X11/Xaw/Dialog.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
46 #include <X11/Xaw/AsciiText.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
47 #include <X11/Xaw/AsciiSrc.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
48 #include <X11/Xaw/Viewport.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
49 #include <X11/Xaw/Scrollbar.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
50 #include <X11/Xaw/Paned.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
51 #include <X11/Xaw/Panner.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
52 #include <X11/Xaw/Reports.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
53 #endif
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
54
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
55 #include "defs.h"
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
56 #include "tree.h"
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
57 #include "dbl.h"
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
58 #include "intf.h"
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
59 #include "rsrc.h"
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
60 #include "input.h"
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
61 #include "help.h"
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
62
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
63 #include <X11/cursorfont.h>
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
64
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
65
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
66 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
67 /* Global Variables */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
68 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
69
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
70 extern char *EnvNm; /* Stores name of current Envir file */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
71
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
72 Atom wm_delete_window;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
73 Widget TreeTopLevel;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
74 Widget TreeDrawingArea;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
75 Display *TreeDisplay;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
76 XtAppContext app;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
77 int TreeScreen;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
78 int TreeContourWidth;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
79 int TreeBorderSize = BORDER_SIZE;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
80 int TreeParentDistance = PARENT_DISTANCE;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
81 XFontStruct *TreeLabelFont;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
82 DoubleBuffer *TreeDrawingAreaDB;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
83 ContourOption TreeShowContourOption = NoContours;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
84 DensityOption TreeLayoutDensity = Fixed;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
85 char TreeShowSteps = FALSE;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
86 char TreeAlignNodes = FALSE;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
87 char PauseAfterStep = FALSE;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
88
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
89 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
90 /* Local Variables */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
91 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
92
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
93 static Tree *PopupNode; /* node selected for popup */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
94 static NodePosition NodePos;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
95
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
96 static Widget mainWindow;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
97 static Widget topForm;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
98
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
99 static Widget statusLabel;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
100 static Widget statusText;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
101
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
102 static Widget scrolledWindow;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
103
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
104 static Widget helpShell;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
105 static Widget helpForm;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
106 static Widget helpScrollWindow;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
107 static Widget helpText;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
108 static Widget helpDoneButton;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
109 static Widget helpTitle;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
110 static Widget helpFrame;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
111
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
112 static Widget treeMenubar;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
113 static Widget treeMenus[NUM_MENUS];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
114 static Widget treeMenuBtns[NUM_MENUS - 1]; /* don't need button for */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
115 /* node popup menu */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
116
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
117 static Widget treeMenuItems[TREE_MENU_ITEMS];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
118 static Widget layoutMenuItems[LAYOUT_MENU_ITEMS];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
119 static Widget nodeMenuItems[NODE_MENU_ITEMS];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
120 static Widget helpBtn;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
121
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
122 static String labelStr[NUM_MENU_STRS];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
123 static String errStr[NUM_ERRS];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
124
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
125 static Widget dialog[NUM_DLG];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
126
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
127 /* globals used for state values */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
128
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
129 static Widget dlgLevelScale, dlgLevelValuator,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
130 dlgSiblingValuator, dlgSiblingScale;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
131 static int dlgLevelValue;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
132 static int dlgSiblingValue;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
133 static int loading_file = 0;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
134
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
135 static Pixmap check_pixmap, slider_pixmap;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
136
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
137 static Boolean nodeFound;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
138
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
139 static int PauseTime = ANIMATION_SPEED_FAST;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
140 static Cursor PauseCursor;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
141
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
142 static XtResource applRsrcsDesc[] = {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
143 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
144 TrNbackgroundColor, TrCBackgroundColor,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
145 XtRPixel, sizeof(Pixel),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
146 XtOffset(ApplRsrcDataPtr, background_color),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
147 XtRString, TrDefaultBackgroundColor
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
148 },
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
149 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
150 TrNtreeColor, TrCTreeColor,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
151 XtRPixel, sizeof(Pixel),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
152 XtOffset(ApplRsrcDataPtr, tree_color),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
153 XtRString, TrDefaultTreeColor
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
154 },
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
155 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
156 TrNcontourColor, TrCContourColor,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
157 XtRPixel, sizeof(Pixel),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
158 XtOffset(ApplRsrcDataPtr, contour_color),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
159 XtRString, TrDefaultContourColor
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
160 },
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
161 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
162 TrNsplitColor, TrCSplitColor,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
163 XtRPixel, sizeof(Pixel),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
164 XtOffset(ApplRsrcDataPtr, split_color),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
165 XtRString, TrDefaultSplitColor
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
166 },
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
167 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
168 TrNhighlightColor, TrCHighlightColor,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
169 XtRPixel, sizeof(Pixel),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
170 XtOffset(ApplRsrcDataPtr, highlight_color),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
171 XtRString, TrDefaultHighlightColor
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
172 },
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
173 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
174 TrNactionColor, TrCActionColor,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
175 XtRPixel, sizeof(Pixel),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
176 XtOffset(ApplRsrcDataPtr, action_color),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
177 XtRString, TrDefaultActionColor
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
178 },
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
179 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
180 TrNcontourWidth, TrCContourWidth,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
181 XtRInt, sizeof(int),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
182 XtOffset(ApplRsrcDataPtr, contour_width),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
183 XtRImmediate, (XtPointer) TrDefaultContourWidth
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
184 },
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
185 };
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
186
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
187 static void popdown_action();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
188 static void activate_action();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
189 static void quit_action();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
190 static void Action();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
191
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
192 static void select_action();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
193 static void button_action();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
194 static void menu_popup_action();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
195
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
196 static void set_levelscale_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
197 static void levelscale_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
198 static void set_siblingscale_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
199 static void siblingscale_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
200 static void set_levelvalue_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
201 static void set_siblingvalue_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
202 static void levelvalue_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
203 static void siblingvalue_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
204
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
205 static void center_widget();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
206
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
207 static XtActionsRec local_actions[] = {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
208 {"wmpopdown", popdown_action},
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
209 {"dlg_activate", activate_action},
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
210 {"node_select", select_action},
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
211 {"node_menu_prepare", button_action},
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
212 {"maybe_menu_popup", menu_popup_action},
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
213 {"quit", quit_action},
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
214 };
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
215
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
216 String fallback_resources[] = {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
217 "*statusText.width: 310",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
218 "*treeDrawingArea.width: 310",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
219 "*treeDrawingArea.height: 400",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
220 "*Text.Font: -*-lucidatypewriter-medium-r-*-*-12-*-*-*-*-*-iso8859-1",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
221 "*Label.Font: -*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-1",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
222 "*Command.Font: -*-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
223 "*SimpleMenu.Font: -*-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
224 "*SmeBSB.Font: -*-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
225 "*MenuButton.Font: -*-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
226 "*List.Font: -*-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
227 "*treeMenuBtn.label: Tree",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
228 "*layoutMenuBtn.label: Layout",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
229 "*helpBtn.label: Help...",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
230 "*treeMenu*treeMenuNew.label: New Tree",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
231 "*treeMenu*treeMenuLoad.label: Load Tree",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
232 "*treeMenu*treeMenuSave.label: Save Tree",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
233 "*treeMenu*treeMenuQuit.label: Quit",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
234 "*layoutMenu*layoutMenuFixed.label: Fixed",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
235 "*layoutMenu*layoutMenuVariable.label: Variable",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
236 "*layoutMenu*layoutMenuSpacing.label: Spacing...",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
237 "*layoutMenu*layoutMenuAlignNodes.label: Align Nodes on Level",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
238 "*dlgNewTree.title: New Tree",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
239 "*dlgNodeName.title: Node Name",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
240 "*dlgInfo.title: Information",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
241 "*dlgError.title: Error!",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
242 "*dlgSpacing.title: Tree Node Spacing",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
243 "*helpShell.title: Help",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
244 "*dlgNewTreeForm.label: Enter name of root node:",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
245 "*dlgNodeNameForm.label: Enter name of new node:",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
246 "*dlgFileForm.label: Enter name of file:",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
247 "*dlgInfoForm.label: Information:",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
248 "*dlgErrorForm.label: Error:",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
249 "*dlgSpacing.label: Spacing Dialog",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
250 "*dlgLevelLabel.label: Level spacing:",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
251 "*dlgSiblingLabel.label: Sibling spacing:",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
252 "*dlgLevelValuator.width: 40",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
253 "*dlgLevelValuator.width: 40",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
254 "*dlgNewTreeOk.label: Ok",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
255 "*dlgNewTreeCancel.label: Cancel",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
256 "*dlgFileOk.label: Ok",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
257 "*dlgFileCancel.label: Cancel",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
258 "*dlgInfoButton.label: Acknowledged",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
259 "*dlgErrorButton.label: Acknowledged",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
260 "*dlgOkButton.label: Ok",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
261 "*dlgCancelButton.label: Cancel",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
262 "*dlgNodeNameOk.label: Ok",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
263 "*dlgNodeNameCancel.label: Cancel",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
264 "*helpDoneButton.label: Dismiss",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
265 "*helpTitle.label: Help for Drawing Dynamic Trees",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
266 "*treeDrawingArea.Translations: #override \\n\
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
267 <Btn1Down>: node_select(EDIT)\\n\
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
268 <Btn2Down>: node_select(VIEW)\\n\
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
269 <Btn3Down>: XawPositionSimpleMenu(nodeMenu)node_menu_prepare()XtMenuPopup(nodeMenu)\\n",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
270 NULL,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
271 };
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
272
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
273 static ApplRsrcData applRsrcs;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
274 static ApplRsrcDataPtr applRsrcsPtr;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
275
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
276 /* included bitmaps */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
277
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
278 #define gray_width 8
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
279 #define gray_height 8
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
280 static unsigned char gray_bits[] = {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
281 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
282 };
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
283
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
284 /* This is a check mark stolen from the xmh application. :) */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
285 #define check_width 9
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
286 #define check_height 8
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
287 static unsigned char check_bits[] = {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
288 0x00, 0x01, 0x80, 0x01, 0xc0, 0x00, 0x60, 0x00,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
289 0x31, 0x00, 0x1b, 0x00, 0x0e, 0x00, 0x04, 0x00
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
290 };
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
291
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
292 #define slider_pixmap_width 4
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
293 #define slider_pixmap_height 4
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
294 static char slider_pixmap_bits[] = {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
295 0x05, 0x0a, 0x05, 0x0a
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
296 };
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
297
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
298 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
299 /* Forward Function Declarations */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
300 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
301
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
302 static void popup_dialog();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
303
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
304 static void Quit_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
305
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
306 static void Contours_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
307 static void ShowContours_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
308 static void Pause_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
309 static void Speed_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
310
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
311 static void Help_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
312 static void HelpDone_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
313 static void Scale_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
314
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
315 static void TreeMenu_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
316 static void LayoutMenu_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
317 static void NodeMenu_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
318
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
319 static void NodeLabel_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
320 static void NewTree_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
321 static void File_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
322
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
323 static void Popdown_CB();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
324 static void ButtonHandler();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
325
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
326 extern void ExposeHandler();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
327
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
328 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
329 /* Functions */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
330 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
331
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
332 /* ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
333 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
334 * Status() displays the specified text in the status area.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
335 * 'urgent' overrides the value of TreeShowSteps.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
336 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
337 * ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
338 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
339
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
340 void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
341 StatusMsg(msg, urgent)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
342 char *msg;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
343 int urgent;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
344 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
345 if (TreeShowSteps || urgent)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
346 XtVaSetValues(statusText, XtNlabel, msg, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
347 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
348
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
349
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
350 /* ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
351 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
352 * Pause is a trivial function, for the benefit of interface-dependent code
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
353 * inside tree.c. This avoids having to include X11 stuff inside that file.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
354 * PauseTime is expected to contain an integer indicating 1/10ths of a sec.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
355 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
356 * ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
357 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
358
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
359 void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
360 Pause()
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
361 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
362 XEvent event;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
363
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
364 if (PauseAfterStep) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
365 XGrabKeyboard(TreeDisplay, XtWindow(TreeTopLevel), False,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
366 GrabModeAsync, GrabModeAsync, CurrentTime);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
367 XGrabPointer(TreeDisplay, XtWindow(TreeTopLevel), False,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
368 ButtonPressMask | ButtonReleaseMask,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
369 GrabModeAsync, GrabModeAsync, None,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
370 PauseCursor, CurrentTime);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
371 XMaskEvent(TreeDisplay, ButtonPressMask | KeyPress, &event);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
372 XUngrabPointer(TreeDisplay, CurrentTime);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
373 XUngrabKeyboard(TreeDisplay, CurrentTime);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
374 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
375 else if (TreeShowSteps) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
376 XSync(TreeDisplay, 0);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
377 usleep(PauseTime * 100000);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
378 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
379 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
380
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
381 /* ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
382 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
383 * BuildPopupMenus() builds the popup menus for use in the application
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
384 * window.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
385 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
386 * ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
387 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
388
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
389 void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
390 BuildPopupMenus(parent)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
391 Widget parent;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
392 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
393 Arg args[2];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
394 String xstr;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
395
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
396 labelStr[STR_NODE_COLLAPSE] = "Collapse Node";
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
397 labelStr[STR_NODE_EXPAND] = "Expand Node";
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
398
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
399 treeMenus[NODE_MENU] = XtVaCreatePopupShell("nodeMenu",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
400 simpleMenuWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
401 parent,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
402 XtNlabel, " ",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
403 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
404
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
405 (void) XtVaCreateManagedWidget("nodeMenuAddChild", smeLineObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
406 treeMenus[NODE_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
407 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
408
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
409 nodeMenuItems[NODE_MENU_ADD_CHILD] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
410 XtVaCreateManagedWidget("nodeMenuAddChild", smeBSBObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
411 treeMenus[NODE_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
412 XtNlabel, "Add Child",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
413 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
414 XtAddCallback(nodeMenuItems[NODE_MENU_ADD_CHILD],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
415 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_ADD_CHILD);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
416
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
417 nodeMenuItems[NODE_MENU_ADD_BEFORE] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
418 XtVaCreateManagedWidget("nodeMenuAddSiblingBefore", smeBSBObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
419 treeMenus[NODE_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
420 XtNlabel, "Add Sibling Before",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
421 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
422 XtAddCallback(nodeMenuItems[NODE_MENU_ADD_BEFORE],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
423 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_ADD_BEFORE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
424
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
425 nodeMenuItems[NODE_MENU_ADD_AFTER] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
426 XtVaCreateManagedWidget("nodeMenuAddSiblingAfter", smeBSBObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
427 treeMenus[NODE_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
428 XtNlabel, "Add Sibling After",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
429 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
430 XtAddCallback(nodeMenuItems[NODE_MENU_ADD_AFTER],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
431 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_ADD_AFTER);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
432
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
433 nodeMenuItems[NODE_MENU_ELISION] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
434 XtVaCreateManagedWidget("nodeMenuElision", smeBSBObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
435 treeMenus[NODE_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
436 XtNlabel, labelStr[STR_NODE_COLLAPSE],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
437 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
438 XtAddCallback(nodeMenuItems[NODE_MENU_ELISION],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
439 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_ELISION);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
440
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
441
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
442 nodeMenuItems[NODE_MENU_DELETE] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
443 XtVaCreateManagedWidget("nodeMenuDeleteNode", smeBSBObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
444 treeMenus[NODE_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
445 XtNlabel, "Delete Node",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
446 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
447 XtAddCallback(nodeMenuItems[NODE_MENU_DELETE],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
448 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_DELETE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
449
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
450
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
451 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
452
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
453 /* ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
454 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
455 * BuildMenubar() builds the menubar that appears in the main window.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
456 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
457 * ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
458 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
459
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
460
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
461 void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
462 BuildMenubar(parent)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
463 Widget parent;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
464 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
465 Arg args[4];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
466 int i;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
467 Widget box;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
468
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
469 box = XtVaCreateManagedWidget("menuBox",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
470 boxWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
471 parent,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
472 XtNshowGrip, FALSE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
473 XtNborderWidth, 0,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
474 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
475
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
476
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
477 /* menu button widgets */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
478 treeMenuBtns[TREE_MENU] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
479 XtVaCreateManagedWidget("treeMenuBtn",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
480 menuButtonWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
481 box,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
482 XtNmenuName, "treeMenu",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
483 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
484 treeMenuBtns[LAYOUT_MENU] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
485 XtVaCreateManagedWidget("layoutMenuBtn",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
486 menuButtonWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
487 box,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
488 XtNmenuName, "layoutMenu",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
489 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
490
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
491 helpBtn = XtVaCreateManagedWidget("helpBtn",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
492 commandWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
493 box,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
494 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
495
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
496 XtAddCallback(helpBtn, XtNcallback, Help_CB, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
497
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
498 /* create pulldwon menus */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
499
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
500 treeMenus[TREE_MENU] = XtVaCreatePopupShell("treeMenu",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
501 simpleMenuWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
502 treeMenuBtns[TREE_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
503 NULL, 0);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
504 treeMenus[LAYOUT_MENU] = XtVaCreatePopupShell("layoutMenu",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
505 simpleMenuWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
506 treeMenuBtns[LAYOUT_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
507 NULL, 0);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
508
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
509
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
510 /* adding menu entries */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
511
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
512 /* Tree menu */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
513
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
514 treeMenuItems[TREE_MENU_NEW] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
515 XtVaCreateManagedWidget("treeMenuNew", smeBSBObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
516 treeMenus[TREE_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
517 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
518 XtAddCallback(treeMenuItems[TREE_MENU_NEW],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
519 XtNcallback, TreeMenu_CB, TREE_MENU_NEW);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
520
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
521 treeMenuItems[TREE_MENU_LOAD] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
522 XtVaCreateManagedWidget("treeMenuLoad", smeBSBObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
523 treeMenus[TREE_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
524 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
525 XtAddCallback(treeMenuItems[TREE_MENU_LOAD],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
526 XtNcallback, TreeMenu_CB, (XtPointer) TREE_MENU_LOAD);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
527
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
528 treeMenuItems[TREE_MENU_SAVE] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
529 XtVaCreateManagedWidget("treeMenuSave", smeBSBObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
530 treeMenus[TREE_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
531 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
532 XtAddCallback(treeMenuItems[TREE_MENU_SAVE],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
533 XtNcallback, TreeMenu_CB, (XtPointer) TREE_MENU_SAVE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
534
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
535 treeMenuItems[TREE_MENU_SEP1] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
536 XtVaCreateManagedWidget("treeMenuSep1", smeLineObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
537 treeMenus[TREE_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
538 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
539
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
540 #ifdef COMMENT
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
541 treeMenuItems[TREE_MENU_STATS] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
542 XtVaCreateManagedWidget("treeMenuStats", smeBSBObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
543 treeMenus[TREE_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
544 XtNlabel, labelStr[STR_SHOW_STATS],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
545 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
546
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
547 XtAddCallback(treeMenuItems[TREE_MENU_STATS],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
548 XtNcallback, TreeMenu_CB, (XtPointer) TREE_MENU_STATS);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
549
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
550 XtSetSensitive(treeMenuItems[TREE_MENU_STATS], FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
551
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
552 treeMenuItems[TREE_MENU_SEP2] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
553 XtVaCreateManagedWidget("treeMenuSep2", smeLineObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
554 treeMenus[TREE_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
555 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
556 #endif /* COMMENT */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
557
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
558 treeMenuItems[TREE_MENU_QUIT] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
559 XtVaCreateManagedWidget("treeMenuQuit", smeBSBObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
560 treeMenus[TREE_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
561 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
562 XtAddCallback(treeMenuItems[TREE_MENU_QUIT],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
563 XtNcallback, TreeMenu_CB, (XtPointer) TREE_MENU_QUIT);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
564
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
565
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
566
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
567 /* Layout menu */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
568
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
569 #ifdef COMMENT
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
570 treeMenuItems[LAYOUT_MENU_FIXED] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
571 XtVaCreateManagedWidget("layoutMenuFixed", smeBSBObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
572 treeMenus[LAYOUT_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
573 XtNleftMargin, 18,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
574 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
575
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
576 XtAddCallback(treeMenuItems[LAYOUT_MENU_FIXED],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
577 XtNcallback, LayoutMenu_CB, (XtPointer) LAYOUT_MENU_FIXED);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
578
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
579 treeMenuItems[LAYOUT_MENU_VARIABLE] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
580 XtVaCreateManagedWidget("layoutMenuVariable", smeBSBObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
581 treeMenus[LAYOUT_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
582 XtNleftMargin, 18,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
583 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
584
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
585 XtAddCallback(treeMenuItems[LAYOUT_MENU_VARIABLE],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
586 XtNcallback, LayoutMenu_CB, (XtPointer) LAYOUT_MENU_VARIABLE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
587
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
588
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
589 treeMenuItems[LAYOUT_MENU_SEP1] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
590 XtVaCreateManagedWidget("layoutSep1", smeLineObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
591 treeMenus[LAYOUT_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
592 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
593 #endif /* COMMENT */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
594
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
595 treeMenuItems[LAYOUT_MENU_SPACING] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
596 XtVaCreateManagedWidget("layoutMenuSpacing", smeBSBObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
597 treeMenus[LAYOUT_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
598 XtNleftMargin, 18,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
599 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
600 XtAddCallback(treeMenuItems[LAYOUT_MENU_SPACING],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
601 XtNcallback, LayoutMenu_CB, (XtPointer) LAYOUT_MENU_SPACING);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
602
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
603 treeMenuItems[LAYOUT_MENU_SEP2] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
604 XtVaCreateManagedWidget("layoutMenuSep2", smeLineObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
605 treeMenus[LAYOUT_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
606 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
607
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
608 /* the following is a toggle button - we hack it using a bitmap */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
609 treeMenuItems[LAYOUT_MENU_ALIGN_NODES] =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
610 XtVaCreateManagedWidget("layoutMenuAlignNodes", smeBSBObjectClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
611 treeMenus[LAYOUT_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
612 XtNleftMargin, 18,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
613 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
614 XtAddCallback(treeMenuItems[LAYOUT_MENU_ALIGN_NODES],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
615 XtNcallback, LayoutMenu_CB,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
616 (XtPointer) LAYOUT_MENU_ALIGN_NODES);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
617
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
618 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
619
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
620 /* ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
621 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
622 * BuildDialogs() builds all the dialogs used in this application.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
623 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
624 * ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
625 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
626
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
627
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
628 BuildDialogs(parent)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
629 Widget parent;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
630 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
631 int i;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
632 Widget
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
633 tmpwidget, dlgForm, dlgValue,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
634 dlgLevelLabel, dlgSiblingLabel,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
635 dlgOkButton, dlgCancelButton;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
636
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
637 labelStr[STR_LOAD_FILE] = "Name of file to load:";
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
638 labelStr[STR_SAVE_FILE] = "Name of file to save:";
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
639
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
640 errStr[ERR_OPENFAIL] = "Failed to open file.";
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
641 errStr[ERR_EMPTYFILE] = "Input file is empty.";
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
642 errStr[ERR_MEMALLOC] = "Memory allocation failed.";
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
643 errStr[ERR_NOBEGIN] = "End of list does not have a matching beginning.";
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
644 errStr[ERR_NOEND] = "Beginning of list does not have a matching end.";
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
645 errStr[ERR_NOROOT] = "Input file does not have a root label.";
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
646 errStr[ERR_MANYROOT] = "Input file has more than one root label.";
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
647
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
648
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
649 dialog[DLG_NEW] = XtVaCreatePopupShell("dlgNewTree",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
650 transientShellWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
651 parent,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
652 XtNresizable, TRUE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
653 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
654
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
655 tmpwidget = XtVaCreateManagedWidget("dlgNewTreeForm",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
656 dialogWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
657 dialog[DLG_NEW],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
658 XtNresizable, TRUE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
659 XtNvalue, "",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
660 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
661
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
662 XawDialogAddButton(tmpwidget, "dlgNewTreeOk", NewTree_CB,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
663 (XtPointer) TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
664 XawDialogAddButton(tmpwidget, "dlgNewTreeCancel", NewTree_CB,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
665 (XtPointer) FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
666
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
667 dlgValue = XtNameToWidget(tmpwidget, "value");
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
668
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
669 XtOverrideTranslations
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
670 (dlgValue, XtParseTranslationTable
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
671 ("<Key>Return:dlg_activate(dlgNewTreeOk)\n"));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
672
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
673
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
674 dialog[DLG_NODE_NAME] = XtVaCreatePopupShell("dlgNodeName",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
675 transientShellWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
676 TreeTopLevel,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
677 XtNresizable, TRUE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
678 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
679
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
680
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
681 tmpwidget= XtVaCreateManagedWidget("dlgNodeNameForm",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
682 dialogWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
683 dialog[DLG_NODE_NAME],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
684 XtNresizable, TRUE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
685 XtNvalue, "",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
686 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
687
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
688 XawDialogAddButton(tmpwidget, "dlgNodeNameOk", NodeLabel_CB,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
689 (XtPointer) TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
690 XawDialogAddButton(tmpwidget, "dlgNodeNameCancel", NodeLabel_CB,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
691 (XtPointer) FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
692
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
693 dlgValue = XtNameToWidget(tmpwidget, "value");
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
694
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
695 XtOverrideTranslations
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
696 (dlgValue, XtParseTranslationTable
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
697 ("<Key>Return: dlg_activate(dlgNodeNameOk)\n"));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
698
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
699
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
700 dialog[DLG_FILE] = XtVaCreatePopupShell("dlgFile",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
701 transientShellWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
702 TreeTopLevel,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
703 XtNresizable, TRUE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
704 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
705
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
706 tmpwidget = XtVaCreateManagedWidget("dlgFileForm",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
707 dialogWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
708 dialog[DLG_FILE],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
709 XtNresizable, TRUE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
710 XtNvalue, "",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
711 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
712
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
713 XawDialogAddButton(tmpwidget, "dlgFileOk", File_CB, (XtPointer) TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
714 XawDialogAddButton(tmpwidget, "dlgFileCancel", File_CB, (XtPointer) FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
715
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
716 dlgValue = XtNameToWidget(tmpwidget, "value");
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
717
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
718 XtOverrideTranslations
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
719 (dlgValue, XtParseTranslationTable
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
720 ("<Key>Return:dlg_activate(dlgFileOk)\n"));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
721
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
722
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
723 dialog[DLG_INFO] = XtVaCreatePopupShell("dlgInfo",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
724 transientShellWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
725 TreeTopLevel,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
726 XtNresizable, TRUE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
727 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
728
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
729 tmpwidget = XtVaCreatePopupShell("dlgInfoForm",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
730 dialogWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
731 dialog[DLG_INFO],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
732 XtNresizable, TRUE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
733 XtNvalue, "",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
734 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
735
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
736 XawDialogAddButton(tmpwidget, "dlgInfoButton", Popdown_CB,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
737 (XtPointer) dialog[DLG_INFO]);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
738
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
739
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
740 dialog[DLG_ERROR] = XtVaCreatePopupShell("dlgError",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
741 transientShellWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
742 TreeTopLevel,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
743 XtNresizable, TRUE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
744 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
745
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
746 tmpwidget = XtVaCreateManagedWidget("dlgErrorForm",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
747 dialogWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
748 dialog[DLG_ERROR],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
749 XtNresizable, TRUE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
750 XtNvalue, "",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
751 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
752
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
753 XawDialogAddButton(tmpwidget, "dlgErrorButton", Popdown_CB,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
754 (XtPointer) dialog[DLG_ERROR]);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
755
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
756
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
757 dialog[DLG_SPACING] = XtVaCreatePopupShell("dlgSpacing",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
758 transientShellWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
759 TreeTopLevel,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
760 XtNresizable, FALSE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
761 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
762 dlgForm = XtVaCreateManagedWidget("dlgSpacingForm",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
763 formWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
764 dialog[DLG_SPACING],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
765 XtNresizable, FALSE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
766 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
767
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
768 dlgLevelLabel = XtVaCreateManagedWidget("dlgLevelLabel",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
769 labelWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
770 dlgForm,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
771 XtNfromVert, NULL,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
772 XtNfromHoriz, NULL,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
773 XtNtop, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
774 XtNbottom, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
775 XtNleft, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
776 XtNright, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
777 XtNborderWidth, 0,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
778 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
779
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
780 dlgLevelValuator = XtVaCreateManagedWidget("dlgLevelValuator",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
781 labelWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
782 dlgForm,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
783 XtNfromVert, NULL,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
784 XtNfromHoriz, dlgLevelLabel,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
785 XtNtop, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
786 XtNbottom, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
787 XtNleft, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
788 XtNright, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
789 XtNlabel, " ",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
790 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
791
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
792
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
793 dlgLevelScale = XtVaCreateManagedWidget("dlgLevelScale",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
794 pannerWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
795 dlgForm,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
796 XtNfromVert, dlgLevelLabel,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
797 XtNfromHoriz, NULL,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
798 XtNtop, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
799 XtNbottom, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
800 XtNleft, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
801 XtNright, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
802 XtNcanvasWidth, 110,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
803 XtNdefaultScale, 1,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
804 XtNinternalSpace, 1,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
805 XtNrubberBand, FALSE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
806 XtNshadowThickness, 0,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
807 XtNallowOff, FALSE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
808 XtNwidth, 200,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
809 XtNsliderWidth, 10,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
810 XtNheight, 15,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
811 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
812
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
813 XtOverrideTranslations(dlgLevelScale, XtParseTranslationTable("\
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
814 <Btn2Down>: start()\n\
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
815 <Btn2Motion>: move()\n\
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
816 <Btn2Up>: notify()stop()\n\
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
817 <Btn3Down>: abort()\n"));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
818
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
819 XtAddCallback(dlgLevelScale, XtNreportCallback, levelscale_CB,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
820 (XtPointer) dlgLevelValuator);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
821 XtAddCallback(dlgLevelScale, XtNreportCallback, levelvalue_CB,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
822 (XtPointer) &dlgLevelValue);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
823
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
824 dlgSiblingLabel = XtVaCreateManagedWidget("dlgSiblingLabel",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
825 labelWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
826 dlgForm,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
827 XtNfromVert, dlgLevelScale,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
828 XtNfromHoriz, NULL,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
829 XtNtop, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
830 XtNbottom, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
831 XtNleft, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
832 XtNright, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
833 XtNborderWidth, 0,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
834 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
835
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
836 dlgSiblingValuator = XtVaCreateManagedWidget("dlgLevelValuator",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
837 labelWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
838 dlgForm,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
839 XtNfromVert, dlgLevelScale,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
840 XtNfromHoriz, dlgSiblingLabel,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
841 XtNtop, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
842 XtNbottom, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
843 XtNleft, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
844 XtNright, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
845 XtNlabel, " ",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
846 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
847 dlgSiblingScale = XtVaCreateManagedWidget("dlgSiblingScale",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
848 pannerWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
849 dlgForm,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
850 XtNfromVert, dlgSiblingLabel,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
851 XtNfromHoriz, NULL,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
852 XtNtop, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
853 XtNbottom, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
854 XtNleft, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
855 XtNright, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
856 XtNcanvasWidth, 110,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
857 XtNdefaultScale, 1,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
858 XtNinternalSpace, 1,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
859 XtNrubberBand, FALSE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
860 XtNshadowThickness, 0,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
861 XtNallowOff, FALSE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
862 XtNwidth, 200,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
863 XtNsliderWidth, 10,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
864 XtNheight, 15,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
865 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
866
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
867 XtOverrideTranslations(dlgSiblingScale, XtParseTranslationTable("\
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
868 <Btn2Down>: start()\n\
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
869 <Btn2Motion>: move()\n\
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
870 <Btn2Up>: notify()stop()\n\
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
871 <Btn3Down>: abort()\n"));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
872
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
873 XtAddCallback(dlgSiblingScale, XtNreportCallback, siblingscale_CB,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
874 (XtPointer) dlgSiblingValuator);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
875 XtAddCallback(dlgSiblingScale, XtNreportCallback, siblingvalue_CB,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
876 (XtPointer) &dlgSiblingValue);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
877
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
878 dlgOkButton = XtVaCreateManagedWidget("dlgOkButton",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
879 commandWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
880 dlgForm,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
881 XtNfromVert, dlgSiblingScale,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
882 XtNfromHoriz, NULL,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
883 XtNtop, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
884 XtNbottom, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
885 XtNleft, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
886 XtNright, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
887 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
888
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
889 dlgCancelButton = XtVaCreateManagedWidget("dlgCancelButton",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
890 commandWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
891 dlgForm,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
892 XtNfromVert, dlgSiblingScale,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
893 XtNfromHoriz, dlgOkButton,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
894 XtNtop, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
895 XtNbottom, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
896 XtNleft, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
897 XtNright, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
898 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
899
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
900 XtAddCallback(dlgOkButton, XtNcallback, Scale_CB, (XtPointer) TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
901 XtAddCallback(dlgCancelButton, XtNcallback, Scale_CB, (XtPointer) FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
902 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
903
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
904 /* ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
905 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
906 * BuildHelpWindow() builds the help window that is displayed when the
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
907 * Help button on the application main window is pressed.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
908 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
909 * ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
910 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
911
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
912
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
913 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
914 BuildHelpWindow(parent)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
915 Widget parent;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
916 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
917 int i;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
918
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
919 helpShell = XtVaCreatePopupShell("helpShell", transientShellWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
920 parent,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
921 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
922
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
923 helpForm = XtVaCreateManagedWidget("helpForm",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
924 formWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
925 helpShell,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
926 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
927
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
928 helpDoneButton = XtVaCreateManagedWidget("helpDoneButton",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
929 commandWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
930 helpForm,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
931 XtNfromVert, NULL,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
932 XtNfromHoriz, NULL,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
933 XtNtop, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
934 XtNbottom, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
935 XtNleft, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
936 XtNright, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
937 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
938
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
939 XtAddCallback(helpDoneButton, XtNcallback, Popdown_CB,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
940 (XtPointer) helpShell);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
941
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
942 helpTitle = XtVaCreateManagedWidget("helpTitle",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
943 labelWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
944 helpForm,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
945 XtNfromVert, NULL,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
946 XtNfromHoriz, helpDoneButton,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
947 XtNtop, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
948 XtNbottom, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
949 XtNleft, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
950 XtNright, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
951 XtNborderWidth, 0,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
952 XtNlabel, "",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
953 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
954
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
955 helpText = XtVaCreateManagedWidget("helpText",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
956 asciiTextWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
957 helpForm,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
958 XtNfromVert, helpDoneButton,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
959 XtNfromHoriz, NULL,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
960 XtNtop, XawChainTop,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
961 XtNbottom, XawChainBottom,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
962 XtNleft, XawChainLeft,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
963 XtNright, XawChainRight,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
964 XtNeditType, XawtextRead,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
965 XtNdisplayCaret, FALSE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
966 XtNscrollVertical, XawtextScrollAlways,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
967 XtNscrollHorizontal,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
968 XawtextScrollWhenNeeded,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
969 XtNuseStringInPlace, TRUE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
970 XtNstring, help_text,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
971 XtNwidth, 530,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
972 XtNheight, 650,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
973 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
974 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
975
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
976 /* ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
977 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
978 * BuildApplicationWindow() assumes that TreeTopLevel has been initialized
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
979 * by XtInitialize(). TreeDrawingArea is set to the drawing area in this
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
980 * application window.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
981 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
982 * ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
983 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
984
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
985
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
986 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
987 BuildApplicationWindow(parent)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
988 Widget parent;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
989 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
990 Widget topPane, box;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
991
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
992 topPane = XtVaCreateManagedWidget("topPane",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
993 panedWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
994 parent,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
995 XtNorientation, XtorientVertical,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
996 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
997
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
998 BuildMenubar(topPane);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
999
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1000 statusText = XtVaCreateManagedWidget("statusText",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1001 labelWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1002 topPane,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1003 XtNborderWidth, 0,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1004 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1005
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1006 scrolledWindow = XtVaCreateManagedWidget("scrolledWindow",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1007 viewportWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1008 topPane,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1009 XtNshowGrip, FALSE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1010 XtNallowHoriz, TRUE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1011 XtNallowVert, TRUE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1012 XtNuseBottom, TRUE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1013 XtNuseRight, TRUE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1014 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1015
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1016 TreeDrawingArea = XtVaCreateManagedWidget("treeDrawingArea",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1017 simpleWidgetClass,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1018 scrolledWindow,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1019 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1020 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1021
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1022 /* ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1023 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1024 * HandleError() is used when ReadTreeFromFile() or SaveTreeToFile() returns
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1025 * an error.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1026 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1027 * ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1028 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1029
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1030 void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1031 HandleError(error, tree)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1032 ErrCode error;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1033 Tree *tree;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1034 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1035 Widget dlg, text;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1036
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1037 if (tree) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1038 dlg = XtNameToWidget(dialog[DLG_INFO], "dlgInfoForm");
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1039 if (dlg) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1040 XtVaSetValues(dlg,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1041 XtNvalue, errStr[error],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1042 XtNwidth, 200,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1043 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1044 text = XtNameToWidget(dlg, "value");
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1045 if (text) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1046 XtVaSetValues(text, XtNdisplayCaret, FALSE, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1047 XtVaSetValues(XawTextGetSource(text), XtNeditType, XawtextRead, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1048 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1049 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1050 popup_dialog(dialog[DLG_INFO], XtGrabExclusive);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1051 } else {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1052 dlg = XtNameToWidget(dialog[DLG_ERROR], "dlgErrorForm");
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1053 if (dlg) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1054 XtVaSetValues(dlg,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1055 XtNvalue, errStr[error],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1056 XtNwidth, 200,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1057 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1058 text = XtNameToWidget(dlg, "value");
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1059 if (text) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1060 XtVaSetValues(text, XtNdisplayCaret, FALSE, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1061 XtVaSetValues(XawTextGetSource(text), XtNeditType, XawtextRead, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1062 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1063 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1064 popup_dialog(dialog[DLG_ERROR], XtGrabExclusive);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1065 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1066 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1067
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1068
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1069 /* ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1070 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1071 * InitializeInterface() initializes the environment for displaying
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1072 * the tree and creates the necessary supporting structures for interaction
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1073 * and display. This function should be called only once.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1074 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1075 * ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1076 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1077
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1078 void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1079 InitializeInterface(argc, argv)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1080 int *argc;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1081 char *argv[];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1082 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1083 XrmValue rmvalue;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1084 char *rmtype;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1085 Window win;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1086 Pixel background;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1087 XColor colors[NUM_COLORS];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1088 Colormap cmap;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1089 Pixmap gray_pixmap;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1090 Atom wm_delete_window;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1091
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1092 /* XtSetLanguageProc is broken on some systems.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1093 The symptom is an error of the form:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1094 Warning: X locale modifiers not supported, using default
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1095 so don't use this call:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1096
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1097 XtSetLanguageProc(NULL, NULL, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1098 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1099
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1100 TreeTopLevel = XtVaAppInitialize(&app, "Xoobr",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1101 NULL, 0,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1102 argc, argv,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1103 fallback_resources,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1104 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1105
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1106 ASSERT(TreeTopLevel, "failed to open connection to X server");
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1107
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1108 TreeDisplay = XtDisplay(TreeTopLevel);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1109 TreeScreen = DefaultScreen(TreeDisplay);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1110
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1111 /* set up color resources */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1112 applRsrcsPtr = &applRsrcs;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1113 XtGetApplicationResources(TreeTopLevel, applRsrcsPtr,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1114 applRsrcsDesc, XtNumber(applRsrcsDesc),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1115 NULL, 0);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1116
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1117 /* add actions */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1118 XtAppAddActions(app, local_actions, 6);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1119 XawSimpleMenuAddGlobalActions(app);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1120
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1121 TreeContourWidth = applRsrcsPtr->contour_width;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1122
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1123 /* set up label font info */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1124 if (XrmGetResource(XtDatabase(TreeDisplay),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1125 X11_FONT_RESOURCE, X11_FONT_CLASS_RESOURCE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1126 &rmtype, &rmvalue)) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1127 if (! (TreeLabelFont = XLoadQueryFont(TreeDisplay, rmvalue.addr)) ) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1128 WARN_4("cannot load user-specified font:", rmvalue.addr,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1129 "using font:", X11_DEFAULT_FONT);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1130 TreeLabelFont = XLoadQueryFont(TreeDisplay, X11_DEFAULT_FONT);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1131 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1132 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1133 else
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1134 TreeLabelFont = XLoadQueryFont(TreeDisplay, X11_DEFAULT_FONT);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1135 TreeLabelFont = XLoadQueryFont(TreeDisplay, "fixed");
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1136
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1137 check_pixmap =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1138 XCreateBitmapFromData(TreeDisplay, RootWindow(TreeDisplay, TreeScreen),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1139 check_bits, check_width, check_height);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1140
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1141 slider_pixmap =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1142 XCreateBitmapFromData(TreeDisplay, RootWindow(TreeDisplay, TreeScreen),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1143 slider_pixmap_bits, slider_pixmap_width,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1144 slider_pixmap_height);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1145
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1146 BuildApplicationWindow(TreeTopLevel);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1147 BuildHelpWindow(TreeTopLevel);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1148 BuildPopupMenus(TreeTopLevel);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1149 BuildDialogs(TreeTopLevel);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1150
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1151
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1152 XtAddEventHandler(TreeDrawingArea, ExposureMask, FALSE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1153 ExposeHandler, (XtPointer) NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1154
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1155 XtVaSetValues(TreeDrawingArea,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1156 XtNbackground, applRsrcsPtr->background_color,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1157 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1158
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1159 XtRealizeWidget(TreeTopLevel);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1160
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1161 XtOverrideTranslations
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1162 (TreeTopLevel,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1163 XtParseTranslationTable("<Message>WM_PROTOCOLS: quit()"));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1164
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1165 wm_delete_window = XInternAtom(TreeDisplay, "WM_DELETE_WINDOW", FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1166 (void) XSetWMProtocols(TreeDisplay, XtWindow(TreeTopLevel),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1167 &wm_delete_window, 1);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1168
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1169
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1170 win = XtWindow(TreeDrawingArea);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1171 cmap = DefaultColormap(TreeDisplay, TreeScreen);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1172
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1173 /* set up double buffer */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1174 colors[BACKGROUND_COLOR].pixel = applRsrcsPtr->background_color;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1175 XQueryColor(TreeDisplay, cmap, &(colors[BACKGROUND_COLOR]));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1176 colors[TREE_COLOR].pixel = applRsrcsPtr->tree_color;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1177 XQueryColor(TreeDisplay, cmap, &(colors[TREE_COLOR]));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1178 colors[CONTOUR_COLOR].pixel = applRsrcsPtr->contour_color;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1179 XQueryColor(TreeDisplay, cmap, &(colors[CONTOUR_COLOR]));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1180 colors[HIGHLIGHT_COLOR].pixel = applRsrcsPtr->highlight_color;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1181 XQueryColor(TreeDisplay, cmap, &(colors[HIGHLIGHT_COLOR]));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1182 colors[SPLIT_COLOR].pixel = applRsrcsPtr->split_color;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1183 XQueryColor(TreeDisplay, cmap, &(colors[SPLIT_COLOR]));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1184 colors[ACTION_COLOR].pixel = applRsrcsPtr->action_color;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1185 XQueryColor(TreeDisplay, cmap, &(colors[ACTION_COLOR]));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1186
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1187 TreeDrawingAreaDB =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1188 DBLcreate_double_buffer(TreeDisplay,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1189 XtWindow(TreeDrawingArea), TRUE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1190 colors, NUM_COLORS);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1191
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1192 ASSERT(TreeDrawingAreaDB, "could not create double buffer");
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1193
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1194 background = DBLinq_background(TreeDrawingAreaDB);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1195
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1196
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1197 XtVaSetValues(TreeDrawingArea, XtNbackground, background, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1198
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1199 /* also set the scrolledWindow background to same color */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1200 XtVaSetValues(XtParent(TreeDrawingArea), XtNbackground, background, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1201
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1202 XSetFont(TreeDrawingAreaDB->display, TreeDrawingAreaDB->gc,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1203 TreeLabelFont->fid);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1204
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1205 gray_pixmap =
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1206 XCreatePixmapFromBitmapData(TreeDisplay, XtWindow(TreeDrawingArea),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1207 gray_bits, gray_width, gray_height,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1208 TreeDrawingAreaDB->colors[TREE_COLOR],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1209 background,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1210 DefaultDepth(TreeDisplay, TreeScreen));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1211
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1212 #ifdef COMMENT
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1213 XtVaSetValues(treeMenuItems[LAYOUT_MENU_VARIABLE],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1214 XtNleftBitmap, check_pixmap,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1215 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1216 #endif
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1217
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1218 XSetTile(TreeDrawingAreaDB->display, TreeDrawingAreaDB->gc, gray_pixmap);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1219 SetDrawColor(TREE_COLOR);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1220
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1221 InitializeDissolveEffect(TreeDisplay, XtWindow(TreeDrawingArea),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1222 TreeDrawingAreaDB->colors[TREE_COLOR], background);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1223
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1224 PauseCursor = XCreateFontCursor(TreeDisplay, XC_watch);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1225
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1226 StatusMsg("Ready", TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1227 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1228
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1229
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1230 /* ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1231 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1232 * UserEventLoop() is called after InitializeInterface() to handle
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1233 * processing of events.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1234 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1235 * ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1236 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1237
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1238 void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1239 UserEventLoop()
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1240 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1241 XtAppMainLoop(app);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1242 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1243
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1244
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1245 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1246 /* Callback Routines */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1247 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1248
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1249 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1250 TreeMenu_CB(w, client_data, call_data)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1251 Widget w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1252 XtPointer client_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1253 XtPointer call_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1254 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1255 long menuItem = (long) client_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1256 Widget dlgFileForm;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1257
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1258 switch (menuItem) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1259 case TREE_MENU_NEW:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1260 popup_dialog(dialog[DLG_NEW], XtGrabExclusive);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1261 break;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1262 case TREE_MENU_LOAD:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1263 loading_file = 1;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1264 XtVaSetValues(dialog[DLG_FILE], XtNtitle, "Load File", NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1265 dlgFileForm = XtNameToWidget(dialog[DLG_FILE], "dlgFileForm");
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1266 XtVaSetValues(dlgFileForm, XtNvalue, "", NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1267 popup_dialog(dialog[DLG_FILE], XtGrabExclusive);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1268 break;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1269 case TREE_MENU_SAVE:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1270 loading_file = 0;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1271 XtVaSetValues(dialog[DLG_FILE], XtNtitle, "Save File", NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1272 dlgFileForm = XtNameToWidget(dialog[DLG_FILE], "dlgFileForm");
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1273 XtVaSetValues(dlgFileForm, XtNvalue, "", NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1274 popup_dialog(dialog[DLG_FILE], XtGrabExclusive);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1275 break;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1276 case TREE_MENU_QUIT:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1277 exit(0);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1278 break;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1279
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1280 default:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1281 WARN("unknown menu item in TreeMenu_CB");
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1282 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1283 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1284
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1285
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1286 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1287
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1288 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1289 LayoutMenu_CB(w, client_data, call_data)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1290 Widget w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1291 XtPointer client_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1292 XtPointer call_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1293 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1294 long menuItem = (long) client_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1295 char tmpstr[10];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1296
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1297 switch (menuItem) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1298 #ifdef COMMENT
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1299 case LAYOUT_MENU_FIXED:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1300 XtVaSetValues(layoutMenuItems[LAYOUT_MENU_VARIABLE],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1301 XtNleftBitmap, None, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1302 XtVaSetValues(layoutMenuItems[LAYOUT_MENU_FIXED],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1303 XtNleftBitmap, check_pixmap, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1304
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1305 if (TreeLayoutDensity != Fixed) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1306 TreeLayoutDensity = Fixed;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1307 DeleteTree(TheTree, TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1308 SetupTree(TheTree);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1309 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1310 break;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1311 case LAYOUT_MENU_VARIABLE:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1312 XtVaSetValues(layoutMenuItems[LAYOUT_MENU_VARIABLE],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1313 XtNleftBitmap, check_pixmap, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1314 XtVaSetValues(layoutMenuItems[LAYOUT_MENU_FIXED],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1315 XtNleftBitmap, None, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1316
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1317 if (TreeLayoutDensity != Variable) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1318 TreeLayoutDensity = Variable;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1319 DeleteTree(TheTree, TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1320 SetupTree(TheTree);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1321 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1322 break;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1323 #endif COMMENT
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1324 case LAYOUT_MENU_SPACING:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1325 dlgLevelValue = TreeParentDistance;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1326 dlgSiblingValue = TreeBorderSize;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1327 sprintf(tmpstr, "%d ", dlgLevelValue);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1328 XtVaSetValues(dlgLevelValuator, XtNlabel, tmpstr, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1329
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1330 /* These setvalues need some adjustments... */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1331 XtVaSetValues(dlgLevelScale,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1332 XtNsliderX, (dlgLevelValue * 2),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1333 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1334 sprintf(tmpstr, "%d ", dlgSiblingValue);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1335 XtVaSetValues(dlgSiblingValuator, XtNlabel, tmpstr, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1336 XtVaSetValues(dlgSiblingScale,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1337 XtNsliderX, (dlgSiblingValue * 4),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1338 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1339 popup_dialog(dialog[DLG_SPACING], XtGrabNone);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1340 break;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1341 case LAYOUT_MENU_ALIGN_NODES:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1342 TreeAlignNodes = !TreeAlignNodes;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1343 XtVaSetValues(treeMenuItems[LAYOUT_MENU_ALIGN_NODES],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1344 XtNleftBitmap, TreeAlignNodes ? check_pixmap : None,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1345 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1346 DeleteTree(TheTree, TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1347 ResetLabels(TheTree);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1348 SetupTree(TheTree);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1349 break;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1350 default:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1351 WARN("unknown menu item in LayoutMenu_CB");
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1352 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1353 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1354
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1355
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1356 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1357
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1358 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1359 NodeMenu_CB(w, client_data, call_data)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1360 Widget w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1361 XtPointer client_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1362 XtPointer call_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1363 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1364 long menuItem = (long) client_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1365
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1366 switch (menuItem) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1367 case NODE_MENU_ADD_CHILD:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1368 NodePos = Child;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1369 popup_dialog(dialog[DLG_NODE_NAME], XtGrabExclusive);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1370 break;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1371 case NODE_MENU_ADD_BEFORE:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1372 NodePos = Before;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1373 popup_dialog(dialog[DLG_NODE_NAME], XtGrabExclusive);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1374 break;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1375 case NODE_MENU_ADD_AFTER:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1376 NodePos = After;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1377 popup_dialog(dialog[DLG_NODE_NAME], XtGrabExclusive);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1378 break;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1379 case NODE_MENU_ELISION:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1380 ExpandCollapseNode(PopupNode);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1381 break;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1382 case NODE_MENU_DELETE:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1383 DeleteNode(PopupNode);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1384 if (TheTree == NULL)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1385 XtSetSensitive(treeMenuItems[TREE_MENU_SAVE], FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1386 break;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1387 default:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1388 WARN("unknown menu item in NodeMenu_CB");
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1389 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1390 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1391
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1392
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1393 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1394
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1395 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1396 Help_CB(w, client_data, call_data)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1397 Widget w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1398 XtPointer client_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1399 XtPointer call_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1400 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1401 popup_dialog(helpShell, XtGrabNone);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1402 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1403
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1404
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1405 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1406
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1407 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1408 HelpDone_CB(w, client_data, call_data)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1409 Widget w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1410 XtPointer client_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1411 XtPointer call_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1412 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1413 XtPopdown(helpShell);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1414 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1415
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1416
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1417 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1418
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1419 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1420 NodeLabel_CB(w, client_data, call_data)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1421 Widget w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1422 XtPointer client_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1423 XtPointer call_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1424 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1425 char *node_label;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1426
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1427 XtPopdown(dialog[DLG_NODE_NAME]);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1428 if (client_data == (XtPointer) TRUE) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1429 node_label = XtMalloc(strlen(XawDialogGetValueString(XtParent(w)))
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1430 * sizeof(char));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1431 node_label = strcpy(node_label, XawDialogGetValueString(XtParent(w)));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1432 if (*node_label)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1433 InsertNode(PopupNode, NodePos, node_label);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1434 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1435 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1436
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1437
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1438 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1439
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1440 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1441 NewTree_CB(w, client_data, call_data)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1442 Widget w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1443 XtPointer client_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1444 XtPointer call_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1445 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1446 char *node_label;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1447 Tree *tree;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1448
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1449 XtPopdown(dialog[DLG_NEW]);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1450 if (client_data == (XtPointer) TRUE) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1451 node_label = XtMalloc((strlen(XawDialogGetValueString(XtParent(w))) + 1)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1452 * sizeof(char));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1453 node_label = strcpy(node_label, XawDialogGetValueString(XtParent(w)));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1454 if (*node_label) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1455 if (TheTree) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1456 Delete(TheTree);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1457 XtSetSensitive(treeMenuItems[TREE_MENU_SAVE], FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1458 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1459 tree = MakeNode();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1460 SetNodeLabel(tree, node_label);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1461 SetupTree(tree);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1462 XtSetSensitive(treeMenuItems[TREE_MENU_SAVE], TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1463 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1464 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1465 XSync(TreeDisplay, FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1466 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1467
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1468
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1469 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1470
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1471 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1472 File_CB(w, client_data, call_data)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1473 Widget w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1474 XtPointer client_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1475 XtPointer call_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1476 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1477 char *fname;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1478 Tree *tree;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1479 ErrCode error;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1480 Arg args[1];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1481 int menuItem;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1482
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1483 if (client_data == (XtPointer) TRUE) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1484 fname = XawDialogGetValueString(XtParent(w));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1485 if (*fname) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1486
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1487 if (loading_file == 1) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1488 if (TheTree) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1489 Delete(TheTree);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1490 XtSetSensitive(treeMenuItems[TREE_MENU_SAVE], FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1491 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1492 tree = ReadTreeFromFile(fname, &error);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1493 XtPopdown(dialog[DLG_FILE]);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1494 if (error != ERR_NONE)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1495 HandleError(error, tree);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1496 XSync(TreeDisplay, 0);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1497 if (tree) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1498 SetupTree(tree);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1499 XtSetSensitive(treeMenuItems[TREE_MENU_SAVE], TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1500 } else {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1501 SetDrawingTree(NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1502 BeginFrame();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1503 EndFrame();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1504 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1505 } else if (menuItem == TREE_MENU_SAVE) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1506 if (!SaveTreeToFile(TheTree, fname)) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1507 XtPopdown(dialog[DLG_FILE]);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1508 HandleError(ERR_OPENFAIL, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1509 } else
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1510 XtPopdown(dialog[DLG_FILE]);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1511 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1512 } else
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1513 XtPopdown(dialog[DLG_FILE]);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1514 } else
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1515 XtPopdown(dialog[DLG_FILE]);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1516 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1517
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1518
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1519 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1520
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1521 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1522 Scale_CB(w, client_data, call_data)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1523 Widget w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1524 XtPointer client_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1525 XtPointer call_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1526 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1527 int level_value, sibling_value;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1528 float tmp;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1529
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1530 XtPopdown(dialog[DLG_SPACING]);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1531
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1532 /* check if OK button was selected */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1533 if (client_data) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1534 level_value = dlgLevelValue;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1535
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1536 sibling_value = dlgSiblingValue;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1537
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1538 if (level_value != TreeParentDistance ||
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1539 sibling_value != TreeBorderSize) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1540
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1541 TreeParentDistance = level_value;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1542 TreeBorderSize = sibling_value;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1543 XSync(TreeDisplay, 0);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1544 if (TheTree) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1545 DeleteTree(TheTree, TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1546 if (TreeAlignNodes)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1547 ResetLabels(TheTree);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1548 SetupTree(TheTree);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1549 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1550 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1551 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1552 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1553
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1554
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1555 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1556 /* */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1557 /* Auxilary actions and callback functions */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1558 /* */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1559 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1560
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1561 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1562 Popdown_CB(w, client_data, call_data)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1563 Widget w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1564 XtPointer client_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1565 XtPointer call_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1566 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1567 Widget widget = (Widget) client_data;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1568
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1569 XtPopdown(widget);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1570 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1571
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1572 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1573 activate_action(w, event, params, num_params)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1574 Widget w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1575 XButtonEvent *event;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1576 String *params;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1577 Cardinal *num_params;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1578 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1579 Widget button;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1580
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1581 if (*num_params == 1) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1582 button = XtNameToWidget(XtParent(w), params[0]);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1583
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1584 if (button)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1585 XtCallCallbacks(button, XtNcallback, (XtPointer) TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1586 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1587 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1588
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1589 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1590 quit_action(w, event, params, num_params)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1591 Widget w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1592 XButtonEvent *event;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1593 String *params;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1594 Cardinal *num_params;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1595 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1596 exit(0);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1597 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1598
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1599
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1600
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1601 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1602
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1603 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1604 select_action(w, event, params, num_params)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1605 Widget w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1606 XButtonEvent *event;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1607 String *params;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1608 Cardinal *num_params;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1609 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1610 Tree *node;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1611 int height;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1612 Boolean edit = FALSE;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1613
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1614 if ((*num_params > 0) &&
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1615 (!strcmp(params[0], "EDIT") ||
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1616 !strcmp(params[0], "edit")))
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1617 edit = TRUE;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1618
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1619 if (SearchTree(TheTree, event->x, event->y, &node)) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1620 static Tree *PrevNode = NULL;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1621 Tree *ParNode = NULL;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1622
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1623 PopupNode = node;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1624 if (PrevNode != NULL)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1625 DrawNode(PrevNode, New);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1626 PrevNode = PopupNode;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1627
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1628 printf("%s^^%s^^%s\n",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1629 EnvNm,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1630 edit ? "br-edit" : "br-view",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1631 (PopupNode->value) ? PopupNode->value : PopupNode->label.text);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1632
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1633 StatusMsg(PopupNode->label.text, 1);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1634
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1635 ParNode = PopupNode->parent;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1636 PopupNode->parent = NULL;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1637 HiliteNode(PopupNode, New);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1638 PopupNode->parent = ParNode;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1639 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1640 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1641
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1642 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1643 menu_popup_action(w, event, params, num_params)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1644 Widget w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1645 XEvent *event;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1646 String *params;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1647 Cardinal *num_params;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1648 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1649 Widget menu;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1650 Boolean popup;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1651 ShellWidget shell_widget;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1652
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1653 char *strargs[] = {"nodeMenu", NULL};
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1654
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1655 menu = XtNameToWidget(TreeTopLevel, params[0]);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1656 shell_widget = (ShellWidget) menu;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1657
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1658 if (nodeFound) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1659
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1660 /* This is giving me a headache.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1661 * Why does popup menus come up unselectable?
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1662 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1663
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1664 XtCallActionProc(TreeDrawingArea,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1665 "XtMenuPopup",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1666 event,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1667 strargs,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1668 1);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1669
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1670 /*
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1671 XtSetSensitive(menu, TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1672 XtPopupSpringLoaded(menu);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1673 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1674
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1675 /* if (!XtIsShell(menu)) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1676 printf("error: not shell widget!\n");
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1677 } else {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1678 if (! shell_widget->shell.popped_up) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1679
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1680 XtGrabKind call_data = XtGrabExclusive;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1681
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1682 XtCallCallbacks(menu, XtNpopupCallback, (XtPointer) &call_data);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1683
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1684 shell_widget->shell.popped_up = TRUE;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1685 shell_widget->shell.grab_kind = XtGrabExclusive;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1686 shell_widget->shell.spring_loaded = TRUE;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1687
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1688 if (shell_widget->shell.create_popup_child_proc != NULL) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1689 (*(shell_widget->shell.create_popup_child_proc))(menu);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1690 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1691
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1692 XtAddGrab(menu, TRUE, TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1693
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1694 XtRealizeWidget(menu);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1695
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1696 XMapRaised(XtDisplay(menu), XtWindow(menu));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1697
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1698 } else
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1699 XRaiseWindow(XtDisplay(menu), XtWindow(menu));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1700 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1701 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1702 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1703 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1704
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1705
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1706 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1707 button_action(w, event, params, num_params)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1708 Widget w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1709 XEvent *event;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1710 String *params;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1711 Cardinal *num_params;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1712 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1713 Tree *node;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1714
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1715 if (SearchTree(TheTree, event->xbutton.x, event->xbutton.y, &node)) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1716
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1717 nodeFound = TRUE;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1718
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1719 XtSetSensitive(nodeMenuItems[NODE_MENU_DELETE], TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1720
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1721 XtVaSetValues(treeMenus[NODE_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1722 XtNlabel, node->label.text,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1723 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1724 PopupNode = node;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1725 if (IS_LEAF(node)) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1726
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1727 XtSetSensitive(nodeMenuItems[NODE_MENU_ELISION], FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1728
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1729 XtVaSetValues(nodeMenuItems[NODE_MENU_ELISION],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1730 XtNlabel, labelStr[STR_NODE_COLLAPSE],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1731 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1732
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1733 } else {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1734
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1735 XtSetSensitive(nodeMenuItems[NODE_MENU_ELISION], TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1736 if (node->elision) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1737 XtVaSetValues(nodeMenuItems[NODE_MENU_ELISION],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1738 XtNlabel, labelStr[STR_NODE_EXPAND],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1739 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1740 } else {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1741 XtVaSetValues(nodeMenuItems[NODE_MENU_ELISION],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1742 XtNlabel, labelStr[STR_NODE_COLLAPSE],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1743 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1744 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1745 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1746
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1747 if (node->parent) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1748 XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_BEFORE], TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1749 XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_AFTER], TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1750 } else {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1751 XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_BEFORE], FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1752 XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_AFTER], FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1753 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1754
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1755 if (node->elision) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1756 XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_CHILD], FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1757 } else {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1758 XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_CHILD], TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1759 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1760
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1761 } else {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1762 nodeFound = FALSE;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1763
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1764 XtVaSetValues(treeMenus[NODE_MENU],
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1765 XtNlabel, " ",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1766 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1767
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1768 XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_BEFORE], FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1769 XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_AFTER], FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1770 XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_CHILD], FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1771 XtSetSensitive(nodeMenuItems[NODE_MENU_ELISION], FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1772 XtSetSensitive(nodeMenuItems[NODE_MENU_DELETE], FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1773 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1774 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1775
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1776
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1777 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1778 /* */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1779 /* General purpose popdown widget callback (for dialog popdown buttons) */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1780 /* */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1781 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1782
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1783 static void center_widget(w, x, y)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1784 Widget w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1785 int x, y;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1786 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1787 Dimension width, height, border;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1788 Position max_x, max_y;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1789
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1790 XtVaGetValues(w,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1791 XtNwidth, &width,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1792 XtNheight, &height,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1793 XtNborderWidth, &border,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1794 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1795
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1796 width += 2 * border;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1797 height += 2 * border;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1798
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1799 x -= ((Position) width / 2);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1800 y -= ((Position) height / 2);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1801
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1802 if (x < 0) x = 0;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1803 if (y < 0) y = 0;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1804
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1805 if (x > (max_x = (Position) (XtScreen(w)->width - width)) )
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1806 x = max_x;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1807
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1808 if (y > (max_y = (Position) (XtScreen(w)->height - height)) )
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1809 y = max_y;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1810
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1811 XtVaSetValues(w,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1812 XtNx, x,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1813 XtNy, y,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1814 NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1815 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1816
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1817 #define shell_translations "<Message>WM_PROTOCOLS: wmpopdown()\n"
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1818
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1819 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1820 popup_dialog(shell, grab_kind)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1821 Widget shell;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1822 XtGrabKind grab_kind;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1823 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1824 int idummy, x, y;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1825 Window wdummy;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1826
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1827 XtOverrideTranslations(shell, XtParseTranslationTable(shell_translations));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1828 XtRealizeWidget(shell);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1829 wm_delete_window = XInternAtom(XtDisplay(shell), "WM_DELETE_WINDOW",
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1830 FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1831 (void) XSetWMProtocols(XtDisplay(shell), XtWindow(shell),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1832 &wm_delete_window, 1);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1833
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1834 XQueryPointer(TreeDisplay, DefaultRootWindow(TreeDisplay),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1835 &wdummy, &wdummy,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1836 &x, &y, &idummy, &idummy, &idummy);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1837
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1838 center_widget(shell, x, y);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1839
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1840 XtPopup(shell, grab_kind);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1841 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1842
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1843 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1844 popdown_action(widget, event, params, num_params)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1845 Widget widget;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1846 XEvent *event;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1847 String *params;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1848 Cardinal *num_params;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1849 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1850 XtPopdown(widget);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1851 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1852
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1853 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1854 set_siblingscale_CB(widget, w, percent_ptr)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1855 Widget widget;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1856 XtPointer w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1857 XtPointer percent_ptr;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1858 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1859 char tmpstr[10];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1860
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1861 sprintf(tmpstr, "%d ", (int) (*(float*) percent_ptr*MAX_BORDER_SIZE));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1862
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1863 XtVaSetValues((Widget) w, XtNlabel, tmpstr, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1864 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1865
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1866 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1867 siblingscale_CB(widget, w, report)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1868 Widget widget;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1869 XtPointer w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1870 XawPannerReport *report;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1871 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1872 char tmpstr[10];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1873
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1874 sprintf(tmpstr, "%d ", (int)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1875 ((float) report->slider_x / report->slider_width
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1876 * MAX_BORDER_SIZE / 10));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1877
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1878 XtVaSetValues((Widget) w, XtNlabel, tmpstr, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1879 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1880
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1881 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1882 set_levelscale_CB(widget, w, percent_ptr)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1883 Widget widget;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1884 XtPointer w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1885 XtPointer percent_ptr;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1886 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1887 char tmpstr[10];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1888
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1889 sprintf(tmpstr, "%d ", (int) (*(float*) percent_ptr*MAX_PARENT_DISTANCE));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1890
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1891 XtVaSetValues((Widget) w, XtNlabel, tmpstr, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1892 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1893
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1894 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1895 levelscale_CB(widget, w, report)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1896 Widget widget;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1897 XtPointer w;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1898 XawPannerReport *report;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1899 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1900 char tmpstr[10];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1901
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1902 sprintf(tmpstr, "%d ", (int)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1903 ((float) report->slider_x / report->slider_width
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1904 * MAX_PARENT_DISTANCE / 10));
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1905
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1906 XtVaSetValues((Widget) w, XtNlabel, tmpstr, NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1907 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1908
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1909 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1910 set_siblingvalue_CB(widget, var_ptr, percent_ptr)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1911 Widget widget;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1912 XtPointer var_ptr;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1913 XtPointer percent_ptr;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1914 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1915 * (int *)var_ptr = (int) (*(float*) percent_ptr*MAX_BORDER_SIZE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1916 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1917
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1918 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1919 set_levelvalue_CB(widget, var_ptr, percent_ptr)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1920 Widget widget;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1921 XtPointer var_ptr;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1922 XtPointer percent_ptr;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1923 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1924 * (int *)var_ptr = (int) (*(float*) percent_ptr*MAX_PARENT_DISTANCE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1925 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1926
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1927
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1928 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1929 siblingvalue_CB(widget, var_ptr, report)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1930 Widget widget;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1931 XtPointer var_ptr;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1932 XawPannerReport *report;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1933 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1934 * (int *) var_ptr = (int)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1935 ((float) report->slider_x / report->slider_width
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1936 * MAX_BORDER_SIZE / 10);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1937 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1938
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1939 static void
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1940 levelvalue_CB(widget, var_ptr, report)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1941 Widget widget;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1942 XtPointer var_ptr;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1943 XawPannerReport *report;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1944 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1945 * (int *) var_ptr = (int)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1946 ((float) report->slider_x / report->slider_width
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1947 * MAX_PARENT_DISTANCE / 10);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1948 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1949
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1950
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1951 /* ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1952 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1953 * Main routine
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1954 *
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1955 * ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1956 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1957
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1958 main(argc, argv)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1959 int argc;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1960 char *argv[];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1961 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1962 Tree *tree = NULL;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1963 ErrCode error = ERR_NONE;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1964
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1965 ProgramName = strdup(argv[0]);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1966 if (ProgramName == NULL) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1967 fprintf(stderr, "%s: insufficient memory available\n", argv[0]);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1968 exit(0);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1969 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1970
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1971 InitializeInterface(&argc, argv);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1972 XSync(TreeDisplay, 0);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1973
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1974 if (argc >= 2) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1975 tree = ReadTreeFromFile(argv[1], &error);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1976 if (tree) StatusMsg(argv[1], TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1977 if (argc > 2)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1978 WARN("extraneous arguments ignored");
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1979 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1980
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1981 if (tree) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1982 SetupTree(tree);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1983 XtSetSensitive(treeMenuItems[TREE_MENU_SAVE], TRUE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1984 } else {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1985 SetDrawingTree(NULL);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1986 XtSetSensitive(treeMenuItems[TREE_MENU_SAVE], FALSE);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1987 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1988
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1989 if (error != ERR_NONE)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1990 HandleError(error, tree);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1991
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1992 StatusMsg("Left = Edit Node; Mid = View Node; Right = Node Menu", 1);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1993 UserEventLoop();
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1994 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1995
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1996 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1997 /* End of File */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1998 /* ------------------------------------------------------------------------- */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1999
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
2000
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
2001
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
2002
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
2003
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
2004