Debian Codegraph @

apps/demos/gview/FieldEditor.c++

raw symbols SCIP
1 /*
2 *
3 * Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * Further, this software is distributed without any warranty that it is
16 * free of the rightful claim of any third person regarding infringement
17 * or the like. Any license provided herein, whether implied or
18 * otherwise, applies only to this software file. Patent licenses, if
19 * any, provided herein do not apply to combinations of this program with
20 * other software, or any other product whatsoever.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
27 * Mountain View, CA 94043, or:
28 *
29 * http://www.sgi.com
30 *
31 * For further information regarding this notice, see:
32 *
33 * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
34 *
35 */
36
37 #include <cstdlib>
38 #include <ctype.h>
39 #include <X11/Intrinsic.h>
40
41 #include <Xm/Form.h>
42 #include <Xm/LabelG.h>
43 #include <Xm/PushB.h>
44 #include <Xm/Scale.h>
45 #include <Xm/SeparatoG.h>
46 #include <Xm/Text.h>
47 #include <Xm/ToggleBG.h>
48
49 #include <Inventor/errors/SoReadError.h>cxx . . $ `<file>/lib/database/include/Inventor/errors/SoReadError.h`/
50 #include <Inventor/fields/SoField.h>cxx . . $ `<file>/lib/database/include/Inventor/fields/SoField.h`/
51 #include <Inventor/fields/SoFieldData.h>cxx . . $ `<file>/lib/database/include/Inventor/fields/SoFieldData.h`/
52 #include <Inventor/nodes/SoNode.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoNode.h`/
53 #include <Inventor/sensors/SoNodeSensor.h>cxx . . $ `<file>/lib/database/include/Inventor/sensors/SoNodeSensor.h`/
54
55 #include "Error.h"cxx . . $ `<file>/apps/demos/gview/Error.h`/
56 #include "FieldEditor.h"cxx . . $ `<file>/apps/demos/gview/FieldEditor.h`/
57 #include "MotifHelp.h"cxx . . $ `<file>/apps/demos/gview/MotifHelp.h`/
58
59 char *FieldEditorcxx . . $ FieldEditor#::fieldBufcxx . . $ FieldEditor#fieldBuf.; // Buffer for writing field values
60 int FieldEditorcxx . . $ FieldEditor#::fieldBufSizecxx . . $ FieldEditor#fieldBufSize. = 0; // Size of buffer in bytes
61
62 ////////////////////////////////////////////////////////////////////////
63 //
64 // This class is used to hold info about each individual field widget.
65 // It contains the widget and other information accessible through
66 // callbacks in one neat package.
67 //
68 ////////////////////////////////////////////////////////////////////////
69
70 struct FieldInfocxx . . $ FieldInfo# {
71
72 // These are set in initInfo():
73
74 FieldEditorcxx . . $ FieldEditor# *editorcxx . . $ FieldInfo#editor.; // Pointer to FieldEditor this is part of
75 SoFieldcxx . . $ SoField# *fieldcxx . . $ FieldInfo#field.; // Field being edited
76 int indexcxx . . $ FieldInfo#index.; // Index of field in node
77 SbNamecxx . . $ SbName# fieldNamecxx . . $ FieldInfo#fieldName.; // Name of field
78 SbBoolcxx . . $ SbBool# setToDefaultcxx . . $ FieldInfo#setToDefault.; // TRUE if user set value to default
79 SbBoolcxx . . $ SbBool# isMultiplecxx . . $ FieldInfo#isMultiple.; // TRUE if field is multiple value
80
81 // These are set in buildFieldWidget():
82
83 Widgetcxx . . $ Widget# widgetcxx . . $ FieldInfo#widget.; // Top-level field editing widget
84 Widgetcxx . . $ Widget# textWidgetcxx . . $ FieldInfo#textWidget.; // Text editing widget
85 Widgetcxx . . $ Widget# ignoreButtoncxx . . $ FieldInfo#ignoreButton.; // Ignore button widget
86 Widgetcxx . . $ Widget# defaultButtoncxx . . $ FieldInfo#defaultButton.; // Set-default button widget
87
88 // These are used only for multiple-value fields:
89
90 Widgetcxx . . $ Widget# numberWidgetcxx . . $ FieldInfo#numberWidget.; // Text widget showing current scale value
91 Widgetcxx . . $ Widget# scrollWidgetcxx . . $ FieldInfo#scrollWidget.; // Text widget scrollbar widget
92 };
93
94 ////////////////////////////////////////////////////////////////////////
95 //
96 // Description:
97 // Constructor. Takes pointer to node whose fields we are to edit.
98 //
99
100 FieldEditorcxx . . $ FieldEditor#::FieldEditorcxx . . $ FieldEditor#FieldEditor(4909fcc765c4d614).(SoNodecxx . . $ SoNode# *node, Widgetcxx . . $ Widget# parent, const char *name)
101 : SoXtComponentcxx . . $ SoXtComponent#SoXtComponent(13a1a66a4f5d094a).(parent, name)
102 //
103 ////////////////////////////////////////////////////////////////////////
104 {
105 int i;
106
107 nodeToEditcxx . . $ FieldEditor#nodeToEdit. = node;
108 nodeToEditcxx . . $ FieldEditor#nodeToEdit.->refcxx . . $ SoBase#ref(83f5f38750778ac8).();
109
110 defNodecxx . . $ FieldEditor#defNode. = (SoNodecxx . . $ SoNode# *) node->getTypeIdcxx . . $ SoBase#getTypeId(70775439ff16cb15).().createInstancecxx . . $ SoType#createInstance(45a5c5ac6be858a8).();
111 defNodecxx . . $ FieldEditor#defNode.->refcxx . . $ SoBase#ref(83f5f38750778ac8).();
112
113 finishCBcxx . . $ FieldEditor#finishCB. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
114 finishDatacxx . . $ FieldEditor#finishData. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
115
116 errorStringcxx . . $ FieldEditor#errorString. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
117
118 // Set up sensor. Make it priority 0 so we can be called
119 // immediately when a field changes. This way we can update only
120 // the fields that change in the sensor callback.
121 nodeSensorcxx . . $ FieldEditor#nodeSensor. = new SoNodeSensorcxx . . $ SoNodeSensor#(&FieldEditorcxx . . $ FieldEditor#::nodeSensorCBcxx . . $ FieldEditor#nodeSensorCB(c8d298b3e215c027)., (void *) this);
122 nodeSensorcxx . . $ FieldEditor#nodeSensor.->setPrioritycxx . . $ SoDelayQueueSensor#setPriority(cb2f890c2fdad230).(0);
123 nodeSensorcxx . . $ FieldEditor#nodeSensor.->attachcxx . . $ SoNodeSensor#attach(da6c7544ccee32bd).(node);
124
125 // Allocate buffer to write field values into. We have to use
126 // malloc, since we may use realloc on it later
127 if (fieldBufSizecxx . . $ FieldEditor#fieldBufSize. == 0)
128 fieldBufcxx . . $ FieldEditor#fieldBuf. = (char *) malloc((unsigned) (fieldBufSizecxx . . $ FieldEditor#fieldBufSize. = 1028));
129
130 // Allocate and initialize field info structures
131 numFieldscxx . . $ FieldEditor#numFields. = getNumFieldscxx . . $ FieldEditor#getNumFields(17223a0c8fe933a2).(nodeToEditcxx . . $ FieldEditor#nodeToEdit.);
132 fieldInfoscxx . . $ FieldEditor#fieldInfos. = new FieldInfocxx . . $ FieldInfo#[numFieldscxx . . $ FieldEditor#numFields.];
133 for (i = 0; i < numFieldscxx . . $ FieldEditor#numFields.; i++)
134 initInfocxx . . $ FieldEditor#initInfo(9ee0af19d4567d0b).(&fieldInfoscxx . . $ FieldEditor#fieldInfos.[i], i);
135
136 // Set up the class name
137 setClassNamecxx . . $ SoXtComponent#setClassName(85c52e162fed56f9).("FieldEditor");
138
139 // Build and set the widget
140 setBaseWidgetcxx . . $ SoXtComponent#setBaseWidget(cfa999c5a14729dd).(buildWidgetcxx . . $ FieldEditor#buildWidget(a686be44a4028679).(getParentWidgetcxx . . $ SoXtComponent#getParentWidget(24ba213de9f943e3).()));
141 }
142
143 ////////////////////////////////////////////////////////////////////////
144 //
145 // Description:
146 // Destructor.
147 //
148
149 FieldEditorcxx . . $ FieldEditor#::~cxx . . $ FieldEditor#`~FieldEditor`(49f6e7a06ebc5aa8).FieldEditorcxx . . $ FieldEditor#()
150 //
151 ////////////////////////////////////////////////////////////////////////
152 {
153 // Widget stuff is handled in SoXtComponent...
154
155 nodeToEditcxx . . $ FieldEditor#nodeToEdit.->unrefcxx . . $ SoBase#unref(83f5f38750778ac8).();
156 defNodecxx . . $ FieldEditor#defNode.->unrefcxx . . $ SoBase#unref(83f5f38750778ac8).();
157 delete nodeSensorcxx . . $ FieldEditor#nodeSensor.;
158
159 delete [] fieldInfoscxx . . $ FieldEditor#fieldInfos.;
160 }
161
162 ////////////////////////////////////////////////////////////////////////
163 //
164 // Description:
165 // Returns number of fields in node being edited. This is static to
166 // allow the check to be made before an editor is constructed.
167 //
168
169 int
170 FieldEditorcxx . . $ FieldEditor#::getNumFieldscxx . . $ FieldEditor#getNumFields(17223a0c8fe933a2).(SoNodecxx . . $ SoNode# *node)
171 //
172 ////////////////////////////////////////////////////////////////////////
173 {
174 const SoFieldDatacxx . . $ SoFieldData# *fdata = node->getFieldDatacxx . . $ SoFieldContainer#getFieldData(56e90abbfb485471).();
175
176 if (fdata == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
177 return 0;
178
179 return fdata->getNumFieldscxx . . $ SoFieldData#getNumFields(455f465bc33b4cdf).();
180 }
181
182 ////////////////////////////////////////////////////////////////////////
183 //
184 // Description:
185 // Sets a callback to call when editing is finished.
186 //
187
188 void
189 FieldEditorcxx . . $ FieldEditor#::setFinishCallbackcxx . . $ FieldEditor#setFinishCallback(1979b7b7e1e77e39).(FieldEditorCBcxx . . $ FieldEditorCB# *cb, const void *userData)
190 //
191 ////////////////////////////////////////////////////////////////////////
192 {
193 finishCBcxx . . $ FieldEditor#finishCB. = cb;
194 finishDatacxx . . $ FieldEditor#finishData. = (void *) userData;
195 }
196
197 ////////////////////////////////////////////////////////////////////////
198 //
199 // Description:
200 // Builds and returns top-level editor widget.
201 //
202
203 Widgetcxx . . $ Widget#
204 FieldEditorcxx . . $ FieldEditor#::buildWidgetcxx . . $ FieldEditor#buildWidget(a686be44a4028679).(Widgetcxx . . $ Widget# parent)
205 //
206 ////////////////////////////////////////////////////////////////////////
207 {
208 Widgetcxx . . $ Widget# topWidget, fieldForm, sep, buttonForm;
209 ARG_VARScxx . . $ `apps/demos/gview/MotifHelp.h:44:9`!(20);
210
211 // If no fields to edit, go away
212 if (numFieldscxx . . $ FieldEditor#numFields. == 0)
213 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
214
215 // The title is the class of the node whose fields we are editing
216 setTitlecxx . . $ SoXtComponent#setTitle(85c52e162fed56f9).(nodeToEditcxx . . $ FieldEditor#nodeToEdit.->getTypeIdcxx . . $ SoBase#getTypeId(70775439ff16cb15).().getNamecxx . . $ SoType#getName(a4a84af177c3b6e7).().getStringcxx . . $ SbName#getString(a9f41ea0e82d88cf).());
217
218 // Create the top level form widget and register it with a class name
219 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
220 topWidget = XmCreateForm(parent, (char *) getWidgetNamecxx . . $ SoXtComponent#getWidgetName(a9f41ea0e82d88cf).(), ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
221 registerWidgetcxx . . $ SoXtComponent#registerWidget(cfa999c5a14729dd).(topWidget);
222
223 // Create buttons at bottom
224 buttonForm = buildButtonWidgetcxx . . $ FieldEditor#buildButtonWidget(a686be44a4028679).(topWidget);
225 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
226 ADD_LEFT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:59:9`!(4);
227 ADD_RIGHT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:68:9`!(4);
228 ADD_BOTTOM_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:86:9`!(4);
229 XtSetValues(buttonForm, ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
230
231 // Create separator between buttons and field editors
232 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
233 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNorientationcxx . . $ `<external>/427401153941432933/XmStrDefs.h:6206:9`!, XmHORIZONTAL);
234 ADD_LEFT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:59:9`!(0);
235 ADD_RIGHT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:68:9`!(0);
236 ADD_BOTTOM_WIDGETcxx . . $ `apps/demos/gview/MotifHelp.h:90:9`!(buttonForm, 4);
237 sep = XmCreateSeparatorGadget(topWidget, "Separator", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
238
239 // Create widget containing all field widgets
240 fieldForm = buildFieldFormcxx . . $ FieldEditor#buildFieldForm(a686be44a4028679).(topWidget);
241 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
242 ADD_TOP_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:77:9`!(4);
243 ADD_LEFT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:59:9`!(4);
244 ADD_RIGHT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:68:9`!(4);
245 ADD_BOTTOM_WIDGETcxx . . $ `apps/demos/gview/MotifHelp.h:90:9`!(sep, 4);
246 XtSetValues(fieldForm, ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
247
248 // Manage the children
249 XtManageChild(fieldForm);
250 XtManageChild(sep);
251 XtManageChild(buttonForm);
252
253 return topWidget;
254 }
255
256 ////////////////////////////////////////////////////////////////////////
257 //
258 // Description:
259 // Creates and returns a widget containing all field-editing widgets.
260 //
261
262 Widgetcxx . . $ Widget#
263 FieldEditorcxx . . $ FieldEditor#::buildFieldFormcxx . . $ FieldEditor#buildFieldForm(a686be44a4028679).(Widgetcxx . . $ Widget# parent)
264 //
265 ////////////////////////////////////////////////////////////////////////
266 {
267 Widgetcxx . . $ Widget# form, sep;
268 FieldInfocxx . . $ FieldInfo# *info;
269 int i;
270 ARG_VARScxx . . $ `apps/demos/gview/MotifHelp.h:44:9`!(20);
271
272 // Create form to hold all field widgets
273 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
274 form = XmCreateForm(parent, "Form", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
275
276 // Create widget for each field and add them to form
277 for (i = 0, info = fieldInfoscxx . . $ FieldEditor#fieldInfos.; i < numFieldscxx . . $ FieldEditor#numFields.; i++, info++) {
278
279 // Build separator if necessary
280 if (i > 0) {
281 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
282 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNorientationcxx . . $ `<external>/427401153941432933/XmStrDefs.h:6206:9`!, XmHORIZONTAL);
283 ADD_LEFT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:59:9`!(0);
284 ADD_RIGHT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:68:9`!(0);
285 ADD_TOP_WIDGETcxx . . $ `apps/demos/gview/MotifHelp.h:81:9`!((info - 1)->widget, 1);
286 sep = XmCreateSeparatorGadget(form, "Separator", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
287 XtManageChild(sep);
288 }
289
290 // Build field editor widget; sets widget field in info
291 buildFieldWidgetcxx . . $ FieldEditor#buildFieldWidget(54f962174d55df61).(form, info);
292
293 // Set up widget contents from node
294 updateInfocxx . . $ FieldEditor#updateInfo(5aaa8752eb0beb6c).(info);
295
296 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
297 ADD_LEFT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:59:9`!(0);
298 ADD_RIGHT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:68:9`!(0);
299 if (i == 0) {
300 ADD_TOP_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:77:9`!(0);
301 }
302 else {
303 ADD_TOP_WIDGETcxx . . $ `apps/demos/gview/MotifHelp.h:81:9`!(sep, 0);
304 }
305 if (i == numFieldscxx . . $ FieldEditor#numFields. - 1) {
306 ADD_BOTTOM_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:86:9`!(0);
307 }
308 XtSetValues(info->widgetcxx . . $ FieldInfo#widget., ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
309 XtManageChild(info->widgetcxx . . $ FieldInfo#widget.);
310 }
311
312 return form;
313 }
314
315 ////////////////////////////////////////////////////////////////////////
316 //
317 // Description:
318 // Creates a widget for editing the i'th field
319 //
320
321 void
322 FieldEditorcxx . . $ FieldEditor#::buildFieldWidgetcxx . . $ FieldEditor#buildFieldWidget(54f962174d55df61).(Widgetcxx . . $ Widget# parent, FieldInfocxx . . $ FieldInfo# *info)
323 //
324 ////////////////////////////////////////////////////////////////////////
325 {
326 Widgetcxx . . $ Widget# form, label, sep1, valueWidget, sep2, butForm, ign, def;
327 ARG_VARScxx . . $ `apps/demos/gview/MotifHelp.h:44:9`!(20);
328
329 // Create a form widget
330 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
331 form = XmCreateForm(parent, "Field", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
332
333 // Create a label widget with the name of the field
334 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
335 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNlabelStringcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2892:9`!, STRINGcxx . . $ `apps/demos/gview/MotifHelp.h:100:9`!((char *) info->fieldName.getString()));
336 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNwidthcxx . . $ `<external>/427401153941432933/XmStrDefs.h:6374:9`!, 140);
337 ADD_LEFT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:59:9`!(4);
338 ADD_TOP_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:77:9`!(4);
339 ADD_BOTTOM_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:86:9`!(4);
340 label = XmCreateLabelGadget(form, "Label", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
341
342 // Create a separator widget
343 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
344 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNorientationcxx . . $ `<external>/427401153941432933/XmStrDefs.h:6206:9`!, XmVERTICAL);
345 ADD_LEFT_WIDGETcxx . . $ `apps/demos/gview/MotifHelp.h:63:9`!(label, 4);
346 ADD_TOP_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:77:9`!(0);
347 ADD_BOTTOM_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:86:9`!(0);
348 sep1 = XmCreateSeparatorGadget(form, "Separator", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
349
350 // Create a form widget to hold buttons
351 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
352 ADD_BOTTOM_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:86:9`!(4);
353 ADD_RIGHT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:68:9`!(4);
354 butForm = XmCreateForm(form, "FieldButtons", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
355
356 // Create a push button to set the field to default value.
357 // (Disable it if the field is already the default value)
358 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
359 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNlabelStringcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2892:9`!, STRINGcxx . . $ `apps/demos/gview/MotifHelp.h:100:9`!("Set To Default"));
360 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNheightcxx . . $ `<external>/427401153941432933/XmStrDefs.h:6054:9`!, 28);
361 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNhighlightThicknesscxx . . $ `<external>/427401153941432933/XmStrDefs.h:2796:9`!, 0);
362 ADD_RIGHT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:68:9`!(0);
363 ADD_TOP_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:77:9`!(0);
364 ADD_BOTTOM_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:86:9`!(0);
365 def = XmCreatePushButton(butForm, "defaultButton", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
366 ADD_CBcxx . . $ `apps/demos/gview/MotifHelp.h:122:9`!(def, XmNactivateCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2349:9`!, &FieldEditor::defaultButtonCB, info);
367
368 // Create a toggle button to set the ignore flag
369 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
370 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNlabelStringcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2892:9`!, STRINGcxx . . $ `apps/demos/gview/MotifHelp.h:100:9`!("Ignore"));
371 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNhighlightThicknesscxx . . $ `<external>/427401153941432933/XmStrDefs.h:2796:9`!, 0);
372 ADD_TOP_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:77:9`!(0);
373 ADD_BOTTOM_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:86:9`!(0);
374 ADD_LEFT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:59:9`!(0);
375 ADD_RIGHT_WIDGETcxx . . $ `apps/demos/gview/MotifHelp.h:72:9`!(def, 4);
376 ign = XmCreateToggleButtonGadget(butForm, "ignoreButton", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
377
378 // Create a separator widget
379 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
380 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNorientationcxx . . $ `<external>/427401153941432933/XmStrDefs.h:6206:9`!, XmVERTICAL);
381 ADD_RIGHT_WIDGETcxx . . $ `apps/demos/gview/MotifHelp.h:72:9`!(butForm, 4);
382 ADD_TOP_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:77:9`!(0);
383 ADD_BOTTOM_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:86:9`!(0);
384 sep2 = XmCreateSeparatorGadget(form, "Separator", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
385
386 // Field value editor widget
387 if (info->isMultiplecxx . . $ FieldInfo#isMultiple.)
388 valueWidget = buildMultipleValueWidgetcxx . . $ FieldEditor#buildMultipleValueWidget(dab9fe67aca8dd36).(form, info);
389 else
390 valueWidget = buildSingleValueWidgetcxx . . $ FieldEditor#buildSingleValueWidget(dab9fe67aca8dd36).(form, info);
391 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
392 ADD_LEFT_WIDGETcxx . . $ `apps/demos/gview/MotifHelp.h:63:9`!(sep1, 4);
393 ADD_RIGHT_WIDGETcxx . . $ `apps/demos/gview/MotifHelp.h:72:9`!(sep2, 4);
394 ADD_TOP_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:77:9`!(0);
395 ADD_BOTTOM_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:86:9`!(0);
396 XtSetValues(valueWidget, ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
397
398 // Manage the children
399 XtManageChild(label);
400 XtManageChild(sep1);
401 XtManageChild(valueWidget);
402 XtManageChild(sep2);
403 XtManageChild(ign);
404 XtManageChild(def);
405 XtManageChild(butForm);
406
407 info->widgetcxx . . $ FieldInfo#widget. = form;
408 info->ignoreButtoncxx . . $ FieldInfo#ignoreButton. = ign;
409 info->defaultButtoncxx . . $ FieldInfo#defaultButton. = def;
410 }
411
412 ////////////////////////////////////////////////////////////////////////
413 //
414 // Description:
415 // Creates and returns a widget that does the main work of editing
416 // a multiple-value field.
417 //
418
419 Widgetcxx . . $ Widget#
420 FieldEditorcxx . . $ FieldEditor#::buildMultipleValueWidgetcxx . . $ FieldEditor#buildMultipleValueWidget(dab9fe67aca8dd36).(Widgetcxx . . $ Widget# parent, FieldInfocxx . . $ FieldInfo# *info)
421 //
422 ////////////////////////////////////////////////////////////////////////
423 {
424 Widgetcxx . . $ Widget# form, text, number, scroll;
425 char buf[20];
426 ARG_VARScxx . . $ `apps/demos/gview/MotifHelp.h:44:9`!(20);
427
428 //////////////////////////////////////////////////////////////////
429 //
430 // Set up top level form widget
431 //
432
433 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
434 form = XmCreateForm(parent, "Form", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
435
436 //////////////////////////////////////////////////////////////////
437 //
438 // Set up the main scrolled text widget
439 //
440
441 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
442 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNeditModecxx . . $ `<external>/427401153941432933/XmStrDefs.h:2703:9`!, XmMULTI_LINE_EDIT);
443 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNcolumnscxx . . $ `<external>/427401153941432933/XmStrDefs.h:2511:9`!, 30);
444 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNrowscxx . . $ `<external>/427401153941432933/XmStrDefs.h:3246:9`!, 5);
445 ADD_RIGHT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:68:9`!(4);
446 ADD_TOP_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:77:9`!(4);
447 ADD_BOTTOM_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:86:9`!(4);
448 text = XmCreateScrolledText(form, "text", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
449
450 // Set up a callback to check changes to text before allowing them
451 ADD_CBcxx . . $ `apps/demos/gview/MotifHelp.h:122:9`!(text, XmNmodifyVerifyCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3036:9`!, &FieldEditor::textChangedCB, info);
452
453 // Get the scroll bar resource from the scrolled window (the
454 // parent widget of the scrolled text)
455 XtVaGetValues(XtParent(text), XmNverticalScrollBarcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3543:9`!, &scroll, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
456
457 // Set up callbacks on the scroll bar so that the line number
458 // widget scrolls with the other text. Note that we have to add
459 // this to all of the scroll bar callbacks since they are already
460 // set up for the scrolled window.
461 ADD_CBcxx . . $ `apps/demos/gview/MotifHelp.h:122:9`!(scroll, XmNvalueChangedCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3531:9`!, &FieldEditor::scrollCB, info);
462 ADD_CBcxx . . $ `apps/demos/gview/MotifHelp.h:122:9`!(scroll, XmNincrementCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2835:9`!, &FieldEditor::scrollCB, info);
463 ADD_CBcxx . . $ `apps/demos/gview/MotifHelp.h:122:9`!(scroll, XmNdecrementCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2550:9`!, &FieldEditor::scrollCB, info);
464 ADD_CBcxx . . $ `apps/demos/gview/MotifHelp.h:122:9`!(scroll, XmNpageIncrementCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3147:9`!, &FieldEditor::scrollCB, info);
465 ADD_CBcxx . . $ `apps/demos/gview/MotifHelp.h:122:9`!(scroll, XmNpageDecrementCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3141:9`!, &FieldEditor::scrollCB, info);
466 ADD_CBcxx . . $ `apps/demos/gview/MotifHelp.h:122:9`!(scroll, XmNtoTopCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3450:9`!, &FieldEditor::scrollCB, info);
467 ADD_CBcxx . . $ `apps/demos/gview/MotifHelp.h:122:9`!(scroll, XmNtoBottomCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3444:9`!, &FieldEditor::scrollCB, info);
468 ADD_CBcxx . . $ `apps/demos/gview/MotifHelp.h:122:9`!(scroll, XmNdragCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2637:9`!, &FieldEditor::scrollCB, info);
469
470 //////////////////////////////////////////////////////////////////
471 //
472 // Set up the line number text widget
473 //
474
475 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
476 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNeditablecxx . . $ `<external>/427401153941432933/XmStrDefs.h:2706:9`!, Falsecxx . . $ `<external>/4815335266304551920/ICElib.h:38:9`!);
477 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNeditModecxx . . $ `<external>/427401153941432933/XmStrDefs.h:2703:9`!, XmMULTI_LINE_EDIT);
478 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNvaluecxx . . $ `<external>/427401153941432933/XmStrDefs.h:6362:9`!, buf);
479 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNcolumnscxx . . $ `<external>/427401153941432933/XmStrDefs.h:2511:9`!, 5);
480 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNrowscxx . . $ `<external>/427401153941432933/XmStrDefs.h:3246:9`!, 5);
481 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNhighlightThicknesscxx . . $ `<external>/427401153941432933/XmStrDefs.h:2796:9`!, 0);
482 ADD_RIGHT_WIDGETcxx . . $ `apps/demos/gview/MotifHelp.h:72:9`!(text, 0);
483 ADD_TOP_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:77:9`!(6);
484 ADD_LEFT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:59:9`!(4);
485 ADD_BOTTOM_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:86:9`!(4);
486 number = XmCreateText(form, "numbers", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
487 XmTextSetString(number, "?"); // Bogus value
488
489 // Set up a callback on the line number widget so that users
490 // cannot scroll the text in there by moving the cursor
491 ADD_CBcxx . . $ `apps/demos/gview/MotifHelp.h:122:9`!(number, XmNmotionVerifyCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3042:9`!, &FieldEditor::lineCB, info);
492
493 XtManageChild(text);
494 XtManageChild(number);
495
496 info->textWidgetcxx . . $ FieldInfo#textWidget. = text;
497 info->numberWidgetcxx . . $ FieldInfo#numberWidget. = number;
498 info->scrollWidgetcxx . . $ FieldInfo#scrollWidget. = scroll;
499
500 return form;
501 }
502
503 ////////////////////////////////////////////////////////////////////////
504 //
505 // Description:
506 // Creates and returns a widget that does the main work of editing
507 // a single-value field.
508 //
509
510 Widgetcxx . . $ Widget#
511 FieldEditorcxx . . $ FieldEditor#::buildSingleValueWidgetcxx . . $ FieldEditor#buildSingleValueWidget(dab9fe67aca8dd36).(Widgetcxx . . $ Widget# parent, FieldInfocxx . . $ FieldInfo# *info)
512 //
513 ////////////////////////////////////////////////////////////////////////
514 {
515 Widgetcxx . . $ Widget# form, text;
516 ARG_VARScxx . . $ `apps/demos/gview/MotifHelp.h:44:9`!(20);
517
518 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
519 form = XmCreateForm(parent, "Form", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
520
521 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
522 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNcolumnscxx . . $ `<external>/427401153941432933/XmStrDefs.h:2511:9`!, 30);
523 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNeditModecxx . . $ `<external>/427401153941432933/XmStrDefs.h:2703:9`!, XmSINGLE_LINE_EDIT);
524 ADD_LEFT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:59:9`!(4);
525 ADD_RIGHT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:68:9`!(4);
526 ADD_TOP_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:77:9`!(4);
527 ADD_BOTTOM_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:86:9`!(4);
528 text = XmCreateText(form, "Text", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
529
530 ADD_CBcxx . . $ `apps/demos/gview/MotifHelp.h:122:9`!(text, XmNmodifyVerifyCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3036:9`!, &FieldEditor::textChangedCB, info);
531
532 XtManageChild(text);
533
534 info->textWidgetcxx . . $ FieldInfo#textWidget. = text;
535
536 return form;
537 }
538
539 ////////////////////////////////////////////////////////////////////////
540 //
541 // Description:
542 // Creates and returns a widget containing all buttons.
543 //
544
545 Widgetcxx . . $ Widget#
546 FieldEditorcxx . . $ FieldEditor#::buildButtonWidgetcxx . . $ FieldEditor#buildButtonWidget(a686be44a4028679).(Widgetcxx . . $ Widget# parent)
547 //
548 ////////////////////////////////////////////////////////////////////////
549 {
550 Widgetcxx . . $ Widget# form, acceptButton, revertButton, cancelButton;
551 ARG_VARScxx . . $ `apps/demos/gview/MotifHelp.h:44:9`!(20);
552
553 // Create a form widget to hold it all
554 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
555 form = XmCreateForm(parent, "Field", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
556
557 // Create "Apply", "Accept", "Revert", and "Cancel" buttons
558 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
559 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNlabelStringcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2892:9`!, STRINGcxx . . $ `apps/demos/gview/MotifHelp.h:100:9`!("Accept"));
560 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNhighlightThicknesscxx . . $ `<external>/427401153941432933/XmStrDefs.h:2796:9`!, 0);
561 ADD_LEFT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:59:9`!(0);
562 ADD_TOP_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:77:9`!(0);
563 ADD_BOTTOM_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:86:9`!(0);
564 acceptButton = XmCreatePushButton(form, "acceptButton", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
565 ADD_CBcxx . . $ `apps/demos/gview/MotifHelp.h:122:9`!(acceptButton, XmNactivateCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2349:9`!,
566 &FieldEditor::acceptButtonCB, this);
567
568 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
569 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNlabelStringcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2892:9`!, STRINGcxx . . $ `apps/demos/gview/MotifHelp.h:100:9`!("Apply"));
570 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNhighlightThicknesscxx . . $ `<external>/427401153941432933/XmStrDefs.h:2796:9`!, 0);
571 ADD_TOP_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:77:9`!(0);
572 ADD_BOTTOM_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:86:9`!(0);
573 ADD_LEFT_WIDGETcxx . . $ `apps/demos/gview/MotifHelp.h:63:9`!(acceptButton, 4);
574 applyButtoncxx . . $ FieldEditor#applyButton. = XmCreatePushButton(form, "applyButton", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
575 ADD_CBcxx . . $ `apps/demos/gview/MotifHelp.h:122:9`!(applyButton, XmNactivateCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2349:9`!,
576 &FieldEditor::applyButtonCB, this);
577
578 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
579 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNlabelStringcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2892:9`!, STRINGcxx . . $ `apps/demos/gview/MotifHelp.h:100:9`!("Revert"));
580 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNhighlightThicknesscxx . . $ `<external>/427401153941432933/XmStrDefs.h:2796:9`!, 0);
581 ADD_TOP_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:77:9`!(0);
582 ADD_BOTTOM_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:86:9`!(0);
583 ADD_LEFT_WIDGETcxx . . $ `apps/demos/gview/MotifHelp.h:63:9`!(applyButton, 4);
584 revertButton = XmCreatePushButton(form, "revertButton", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
585 ADD_CBcxx . . $ `apps/demos/gview/MotifHelp.h:122:9`!(revertButton, XmNactivateCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2349:9`!,
586 &FieldEditor::revertButtonCB, this);
587
588 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
589 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNlabelStringcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2892:9`!, STRINGcxx . . $ `apps/demos/gview/MotifHelp.h:100:9`!("Cancel"));
590 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNhighlightThicknesscxx . . $ `<external>/427401153941432933/XmStrDefs.h:2796:9`!, 0);
591 ADD_TOP_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:77:9`!(0);
592 ADD_BOTTOM_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:86:9`!(0);
593 ADD_LEFT_WIDGETcxx . . $ `apps/demos/gview/MotifHelp.h:63:9`!(revertButton, 4);
594 cancelButton = XmCreatePushButton(form, "cancelButton", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
595 ADD_CBcxx . . $ `apps/demos/gview/MotifHelp.h:122:9`!(cancelButton, XmNactivateCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2349:9`!,
596 &FieldEditor::cancelButtonCB, this);
597
598 // Create an "Override" toggle button to allow user to change
599 // override flag for node
600 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
601 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNsetcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3333:9`!, nodeToEdit->isOverride());
602 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNlabelStringcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2892:9`!, STRINGcxx . . $ `apps/demos/gview/MotifHelp.h:100:9`!("Override"));
603 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNhighlightThicknesscxx . . $ `<external>/427401153941432933/XmStrDefs.h:2796:9`!, 0);
604 ADD_TOP_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:77:9`!(0);
605 ADD_BOTTOM_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:86:9`!(0);
606 ADD_RIGHT_FORMcxx . . $ `apps/demos/gview/MotifHelp.h:68:9`!(0);
607 overrideButtoncxx . . $ FieldEditor#overrideButton. = XmCreateToggleButtonGadget(form, "overrideButton", ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
608
609 XtManageChild(acceptButton);
610 XtManageChild(applyButtoncxx . . $ FieldEditor#applyButton.);
611 XtManageChild(revertButton);
612 XtManageChild(cancelButton);
613 XtManageChild(overrideButtoncxx . . $ FieldEditor#overrideButton.);
614
615 // Hitting a carriage-return activates the "Apply" button
616 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
617 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNdefaultButtoncxx . . $ `<external>/427401153941432933/XmStrDefs.h:2556:9`!, applyButton);
618 XtSetValues(parent, ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
619
620 return form;
621 }
622
623 ////////////////////////////////////////////////////////////////////////
624 //
625 // Description:
626 // Applies changes made in editor to node it is editing.
627 //
628
629 void
630 FieldEditorcxx . . $ FieldEditor#::applycxx . . $ FieldEditor#apply(49f6e7a06ebc5aa8).()
631 //
632 ////////////////////////////////////////////////////////////////////////
633 {
634 FieldInfocxx . . $ FieldInfo# *info;
635 int i;
636 SbBoolcxx . . $ SbBool# override;
637
638 // Turn off sensor for a minute...
639 nodeSensorcxx . . $ FieldEditor#nodeSensor.->detachcxx . . $ SoNodeSensor#detach(49f6e7a06ebc5aa8).();
640
641 // Get all field values and flags and store them back into the node
642 for (i = 0, info = fieldInfoscxx . . $ FieldEditor#fieldInfos.; i < numFieldscxx . . $ FieldEditor#numFields.; i++, info++)
643 updateNodecxx . . $ FieldEditor#updateNode(5aaa8752eb0beb6c).(info);
644
645 // Set the override flag if it has changed
646 override = XmToggleButtonGadgetGetState(overrideButtoncxx . . $ FieldEditor#overrideButton.);
647 if (nodeToEditcxx . . $ FieldEditor#nodeToEdit.->isOverridecxx . . $ SoNode#isOverride(455f465bc33b4cdf).() != override)
648 nodeToEditcxx . . $ FieldEditor#nodeToEdit.->setOverridecxx . . $ SoNode#setOverride(d4f767463ce0a6b3).(override);
649
650 // Make sure the text window reflects the exact state
651 revertcxx . . $ FieldEditor#revert(d4f767463ce0a6b3).();
652
653 // Reattach sensor
654 nodeSensorcxx . . $ FieldEditor#nodeSensor.->attachcxx . . $ SoNodeSensor#attach(da6c7544ccee32bd).(nodeToEditcxx . . $ FieldEditor#nodeToEdit.);
655 }
656
657 ////////////////////////////////////////////////////////////////////////
658 //
659 // Description:
660 // Sets field editor based on the values in the node being edited.
661 // If the passed field index is not -1 (the default), only the
662 // value for the specified field is reverted.
663 //
664
665 void
666 FieldEditorcxx . . $ FieldEditor#::revertcxx . . $ FieldEditor#revert(d4f767463ce0a6b3).(int fieldIndex)
667 //
668 ////////////////////////////////////////////////////////////////////////
669 {
670 FieldInfocxx . . $ FieldInfo# *info;
671 int i;
672
673 if (fieldIndex >= 0)
674 updateInfocxx . . $ FieldEditor#updateInfo(5aaa8752eb0beb6c).(&fieldInfoscxx . . $ FieldEditor#fieldInfos.[fieldIndex]);
675
676 // Update all field info from node
677 else
678 for (i = 0, info = fieldInfoscxx . . $ FieldEditor#fieldInfos.; i < numFieldscxx . . $ FieldEditor#numFields.; i++, info++)
679 updateInfocxx . . $ FieldEditor#updateInfo(5aaa8752eb0beb6c).(info);
680
681 // Set the override button
682 XmToggleButtonGadgetSetState(overrideButtoncxx . . $ FieldEditor#overrideButton.,
683 nodeToEditcxx . . $ FieldEditor#nodeToEdit.->isOverridecxx . . $ SoNode#isOverride(455f465bc33b4cdf).(), FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!);
684 }
685
686 ////////////////////////////////////////////////////////////////////////
687 //
688 // Description:
689 // Initializes given FieldInfo structure based on indexed field.
690 //
691
692 void
693 FieldEditorcxx . . $ FieldEditor#::initInfocxx . . $ FieldEditor#initInfo(9ee0af19d4567d0b).(FieldInfocxx . . $ FieldInfo# *info, int i)
694 //
695 ////////////////////////////////////////////////////////////////////////
696 {
697 info->editorcxx . . $ FieldInfo#editor. = this;
698 info->indexcxx . . $ FieldInfo#index. = i;
699 info->setToDefaultcxx . . $ FieldInfo#setToDefault. = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!;
700
701 // Set the field name and pointer and determine whether it is a
702 // single or multiple value field.
703 const SoFieldDatacxx . . $ SoFieldData# *fdata = nodeToEditcxx . . $ FieldEditor#nodeToEdit.->getFieldDatacxx . . $ SoFieldContainer#getFieldData(56e90abbfb485471).();
704
705 info->fieldcxx . . $ FieldInfo#field. = fdata->getFieldcxx . . $ SoFieldData#getField(f4cd4e797bb371f6).(nodeToEditcxx . . $ FieldEditor#nodeToEdit., i);
706 info->fieldNamecxx . . $ FieldInfo#fieldName. =cxx . . $ SbName#`operator=`(8da52b6fc1e0f7c6). fdata->getFieldNamecxx . . $ SoFieldData#getFieldName(e603ed4d11f0a676).(i);
707 info->isMultiplecxx . . $ FieldInfo#isMultiple. = info->fieldcxx . . $ FieldInfo#field.->isOfTypecxx . . $ SoField#isOfType(1fd66475a268b64e).(SoMFieldcxx . . $ SoMField#::getClassTypeIdcxx . . $ SoMField#getClassTypeId(c00c150378d2b968).());
708 }
709
710 ////////////////////////////////////////////////////////////////////////
711 //
712 // Description:
713 // Sets up field editor from correct field in node being edited.
714 //
715
716 void
717 FieldEditorcxx . . $ FieldEditor#::updateInfocxx . . $ FieldEditor#updateInfo(5aaa8752eb0beb6c).(FieldInfocxx . . $ FieldInfo# *info)
718 //
719 ////////////////////////////////////////////////////////////////////////
720 {
721 SbStringcxx . . $ SbString# fieldStringcxx . . $ SbString#SbString(49f6e7a06ebc5aa8).;
722 ARG_VARScxx . . $ `apps/demos/gview/MotifHelp.h:44:9`!(10);
723
724 // Set text field from current field value(s)
725 showFieldStringcxx . . $ FieldEditor#showFieldString(13b51cfb372e2d33).(info);
726
727 // Set ignore button state
728 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
729 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNsetcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3333:9`!, info->field->isIgnored());
730 XtSetValues(info->ignoreButtoncxx . . $ FieldInfo#ignoreButton., ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
731
732 // Turn set-default button on or off
733 info->setToDefaultcxx . . $ FieldInfo#setToDefault. = info->fieldcxx . . $ FieldInfo#field.->isDefaultcxx . . $ SoField#isDefault(455f465bc33b4cdf).();
734 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
735 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNsensitivecxx . . $ `<external>/427401153941432933/XmStrDefs.h:6282:9`!, ! info->setToDefault);
736 XtSetValues(info->defaultButtoncxx . . $ FieldInfo#defaultButton., ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
737 }
738
739 ////////////////////////////////////////////////////////////////////////
740 //
741 // Description:
742 // Makes field editor show default value for given field. Does NOT
743 // change the node at all!
744 //
745
746 void
747 FieldEditorcxx . . $ FieldEditor#::showDefaultValuecxx . . $ FieldEditor#showDefaultValue(5aaa8752eb0beb6c).(FieldInfocxx . . $ FieldInfo# *info)
748 //
749 ////////////////////////////////////////////////////////////////////////
750 {
751 SoFieldcxx . . $ SoField# *defField, *saveField;
752 ARG_VARScxx . . $ `apps/demos/gview/MotifHelp.h:44:9`!(10);
753
754 // Make sure we know that this was done
755 info->setToDefaultcxx . . $ FieldInfo#setToDefault. = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!;
756
757 // Get the appropriate field from a node instance with all default values
758 defField = defNodecxx . . $ FieldEditor#defNode.->getFieldDatacxx . . $ SoFieldContainer#getFieldData(56e90abbfb485471).()->getFieldcxx . . $ SoFieldData#getField(f4cd4e797bb371f6).(defNodecxx . . $ FieldEditor#defNode., info->indexcxx . . $ FieldInfo#index.);
759
760 // Temporarily change the field to the default one
761 saveField = info->fieldcxx . . $ FieldInfo#field.;
762 info->fieldcxx . . $ FieldInfo#field. = defField;
763
764 // Set the string in the text widget
765 showFieldStringcxx . . $ FieldEditor#showFieldString(13b51cfb372e2d33).(info);
766
767 // Restore the real field value
768 info->fieldcxx . . $ FieldInfo#field. = saveField;
769
770 // Disable the default button
771 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
772 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNsensitivecxx . . $ `<external>/427401153941432933/XmStrDefs.h:6282:9`!, FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!);
773 XtSetValues(info->defaultButtoncxx . . $ FieldInfo#defaultButton., ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
774 }
775
776 ////////////////////////////////////////////////////////////////////////
777 //
778 // Description:
779 // Sets string(s) in text widget to display field value(s).
780 //
781
782 void
783 FieldEditorcxx . . $ FieldEditor#::showFieldStringcxx . . $ FieldEditor#showFieldString(13b51cfb372e2d33).(FieldInfocxx . . $ FieldInfo# *info) const
784 //
785 ////////////////////////////////////////////////////////////////////////
786 {
787 SbStringcxx . . $ SbString# valueStringcxx . . $ SbString#SbString(49f6e7a06ebc5aa8).;
788
789 REM_CBcxx . . $ `apps/demos/gview/MotifHelp.h:125:9`!(info->textWidget, XmNmodifyVerifyCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3036:9`!,
790 &FieldEditor::textChangedCB, info);
791
792 // Get the field value(s) as a string
793 getFieldStringcxx . . $ FieldEditor#getFieldString(72390a37a9ce7dc3).(info, valueString);
794
795 // Set the text widget to show the string
796 XmTextSetString(info->textWidgetcxx . . $ FieldInfo#textWidget., (char *) valueString.getStringcxx . . $ SbString#getString(a9f41ea0e82d88cf).());
797
798 // Set up the line number widget for multiple-value fields
799 if (info->isMultiplecxx . . $ FieldInfo#isMultiple.)
800 updateLineNumberscxx . . $ FieldEditor#updateLineNumbers(732e194d681aaf2c).(info, TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!);
801
802 // Reconnect the callback
803 ADD_CBcxx . . $ `apps/demos/gview/MotifHelp.h:122:9`!(info->textWidget, XmNmodifyVerifyCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3036:9`!,
804 &FieldEditor::textChangedCB, info);
805 }
806
807 ////////////////////////////////////////////////////////////////////////
808 //
809 // Description:
810 // Updates field value and flags in node from current editor settings.
811 //
812
813 void
814 FieldEditorcxx . . $ FieldEditor#::updateNodecxx . . $ FieldEditor#updateNode(5aaa8752eb0beb6c).(FieldInfocxx . . $ FieldInfo# *info)
815 //
816 ////////////////////////////////////////////////////////////////////////
817 {
818 SbStringcxx . . $ SbString# stringcxx . . $ SbString#SbString(49f6e7a06ebc5aa8).;
819 SbBoolcxx . . $ SbBool# ignore;
820
821 getEditorStringcxx . . $ FieldEditor#getEditorString(72390a37a9ce7dc3).(info, string);
822
823 // Set the read-error callback so that read errors caused by the
824 // following call to SoField::set() can be trapped and displayed
825 // in an error dialog box
826 SoReadErrorcxx . . $ SoReadError#::setHandlerCallbackcxx . . $ SoReadError#setHandlerCallback(57fc034bd658fec0).(&FieldEditorcxx . . $ FieldEditor#::readErrorCBcxx . . $ FieldEditor#readErrorCB(31d4b2db3dc1fb08)., info);
827
828 if (! nodeToEditcxx . . $ FieldEditor#nodeToEdit.->setcxx . . $ SoFieldContainer#set(5c4306d8553b3696).(string.getStringcxx . . $ SbString#getString(a9f41ea0e82d88cf).()))
829 displayReadErrorcxx . . $ FieldEditor#displayReadError(49f6e7a06ebc5aa8).();
830
831 // If value was set to default, set flag in the field
832 if (info->setToDefaultcxx . . $ FieldInfo#setToDefault.)
833 info->fieldcxx . . $ FieldInfo#field.->setDefaultcxx . . $ SoField#setDefault(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!);
834
835 // Make sure ignore flag is correct
836 ignore = XmToggleButtonGadgetGetState(info->ignoreButtoncxx . . $ FieldInfo#ignoreButton.);
837 if (info->fieldcxx . . $ FieldInfo#field.->isIgnoredcxx . . $ SoField#isIgnored(455f465bc33b4cdf).() != ignore)
838 info->fieldcxx . . $ FieldInfo#field.->setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(ignore);
839 }
840
841 ////////////////////////////////////////////////////////////////////////
842 //
843 // Description:
844 // Fills in SbString with string representing field value that can
845 // be displayed in editor's text widget.
846 //
847
848 void
849 FieldEditorcxx . . $ FieldEditor#::getFieldStringcxx . . $ FieldEditor#getFieldString(72390a37a9ce7dc3).(FieldInfocxx . . $ FieldInfo# *info, SbStringcxx . . $ SbString# &string) const
850 //
851 ////////////////////////////////////////////////////////////////////////
852 {
853 // Get the field value(s) as a string
854 info->fieldcxx . . $ FieldInfo#field.->getcxx . . $ SoField#get(a526c26e8daafea0).(string);
855
856 // If it's a multiple-value string, we have to some extra work
857 if (info->isMultiplecxx . . $ FieldInfo#isMultiple.) {
858
859 const char *s = string.getStringcxx . . $ SbString#getString(a9f41ea0e82d88cf).();
860
861 // If first character is an open bracket, we have work to do
862 if (*s == '[') {
863
864 // Skip over the open brace
865 s++;
866
867 // Allocate working space for the string
868 char *buf = new char [strlen(s) + 1];
869
870 char *b = buf;
871 SbBoolcxx . . $ SbBool# atNewline = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!;
872
873 while (*s != '\0') {
874
875 // Skip over quoted strings - this will have a problem
876 // with quotes nested inside quotes ???
877 if (*s == '\"') {
878 *b++ = *s++;
879 while (*s != '\"')
880 *b++ = *s++;
881 *b++ = *s++; // Closing quote
882 }
883
884 // Change commas into newlines
885 if (*s == ',') {
886 *b++ = '\n';
887 atNewline = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!;
888 s++;
889 }
890
891 // Skip over spaces (including extra newlines) after newlines
892 else if (atNewline && isspace(*s))
893 s++;
894
895 else {
896 *b++ = *s++;
897 atNewline = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!;
898 }
899 }
900
901 // Remove closing brace and space before it
902 while (*b != ']')
903 b--;
904 while (isspace(*(b - 1)))
905 b--;
906
907 // Terminate string
908 *b = '\0';
909
910 string =cxx . . $ SbString#`operator=`(90e156a883234106). buf;
911
912 delete [] buf;
913 }
914 }
915 }
916
917 ////////////////////////////////////////////////////////////////////////
918 //
919 // Description:
920 // Fills in SbString with string containing current field value in
921 // editor's text widget, to store back into node being edited.
922 //
923
924 void
925 FieldEditorcxx . . $ FieldEditor#::getEditorStringcxx . . $ FieldEditor#getEditorString(72390a37a9ce7dc3).(FieldInfocxx . . $ FieldInfo# *info, SbStringcxx . . $ SbString# &string) const
926 //
927 ////////////////////////////////////////////////////////////////////////
928 {
929 char *str = XmTextGetString(info->textWidgetcxx . . $ FieldInfo#textWidget.);
930
931 // Store name of string and a space
932 string =cxx . . $ SbString#`operator=`(90e156a883234106). info->fieldNamecxx . . $ FieldInfo#fieldName..getStringcxx . . $ SbName#getString(a9f41ea0e82d88cf).();
933 string +=cxx . . $ SbString#`operator+=`(90e156a883234106). " ";
934
935 // If a single-value field, just append text string from widget
936 if (! info->isMultiplecxx . . $ FieldInfo#isMultiple.)
937 string +=cxx . . $ SbString#`operator+=`(90e156a883234106). str;
938
939 // If this is a multiple-value field, add extra characters
940 else {
941 char *c;
942
943 string +=cxx . . $ SbString#`operator+=`(90e156a883234106). "[";
944
945 for (c = str; *c != '\0'; c++) {
946
947 // Change all newlines to commas in string first
948 if (*c == '\n') {
949 *c = ',';
950
951 // Remove all whitespace after commas. This also gets
952 // rid of blank lines.
953 c++;
954 while (isspace(*c))
955 c++;
956
957 c--;
958 }
959 }
960 string +=cxx . . $ SbString#`operator+=`(90e156a883234106). str;
961
962 string +=cxx . . $ SbString#`operator+=`(90e156a883234106). "]";
963 }
964
965 XtFree(str);
966 }
967
968 ////////////////////////////////////////////////////////////////////////
969 //
970 // Description:
971 // Redefines this method to clean up when the window is destroyed.
972 //
973
974 void
975 FieldEditorcxx . . $ FieldEditor#::windowCloseActioncxx . . $ FieldEditor#windowCloseAction(49f6e7a06ebc5aa8).()
976 //
977 ////////////////////////////////////////////////////////////////////////
978 {
979 // Alert caller if necessary
980 if (finishCBcxx . . $ FieldEditor#finishCB. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
981 finishCBcxx . . $ FieldEditor#finishCB.(finishDatacxx . . $ FieldEditor#finishData., this);
982
983 delete this;
984 }
985
986 ////////////////////////////////////////////////////////////////////////
987 //
988 // Description:
989 // Updates the line-number widget whenever the text area changes or
990 // is scrolled. The textChanged flag indicates why the line number
991 // may be changing.
992 //
993
994 void
995 FieldEditorcxx . . $ FieldEditor#::updateLineNumberscxx . . $ FieldEditor#updateLineNumbers(732e194d681aaf2c).(FieldInfocxx . . $ FieldInfo# *info, SbBoolcxx . . $ SbBool# textChanged) const
996 //
997 ////////////////////////////////////////////////////////////////////////
998 {
999 if (textChanged) {
1000
1001 // See if the number of lines in the text area has changed. If
1002 // so, insert or remove line numbers from the widget.
1003
1004 // Count newlines in the text string
1005 char *textString = XmTextGetString(info->textWidgetcxx . . $ FieldInfo#textWidget.);
1006 int numLines = 0;
1007 char *b;
1008 for (b = textString; *b != '\0'; b++)
1009 if (*b == '\n')
1010 numLines++;
1011 // Last line may not end in a newline?
1012 if (b > textString && *(b-1) != '\n')
1013 numLines++;
1014 XtFree(textString);
1015
1016 // Make sure line number widget has the correct info
1017 char *numberString = XmTextGetString(info->numberWidgetcxx . . $ FieldInfo#numberWidget.);
1018 int numNumbers = strlen(numberString) / 6;
1019 XtFree(numberString);
1020
1021 // Too many line numbers? Remove some.
1022 if (numNumbers > numLines)
1023 XmTextReplace(info->numberWidgetcxx . . $ FieldInfo#numberWidget.,
1024 numLines * 6, numNumbers * 6, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
1025
1026 // Too few line numbers? Add some.
1027 else if (numNumbers < numLines) {
1028 int numNeeded = numLines - numNumbers, i;
1029 char *buf = new char [numNeeded * 6 + 1], *b = buf;
1030 for (i = 0; i < numNeeded; i++) {
1031 sprintf(b, "%5d\n", numNumbers + i);
1032 b += strlen(b);
1033 }
1034 if (numNumbers == 0)
1035 XmTextReplace(info->numberWidgetcxx . . $ FieldInfo#numberWidget., 0, 1, buf);
1036 else
1037 XmTextInsert(info->numberWidgetcxx . . $ FieldInfo#numberWidget., numLines * 6, buf);
1038 delete [] buf;
1039 }
1040 }
1041
1042 // Find out the scroll bar value and set the line number position
1043 // based on it
1044 ARG_VARScxx . . $ `apps/demos/gview/MotifHelp.h:44:9`!(1);
1045 int topLine;
1046
1047 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
1048 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNvaluecxx . . $ `<external>/427401153941432933/XmStrDefs.h:6362:9`!, &topLine);
1049 XtGetValues(info->scrollWidgetcxx . . $ FieldInfo#scrollWidget., ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
1050
1051 RESET_ARGScxx . . $ `apps/demos/gview/MotifHelp.h:51:9`!();
1052 ADD_ARGcxx . . $ `apps/demos/gview/MotifHelp.h:48:9`!(XmNtopCharactercxx . . $ `<external>/427401153941432933/XmStrDefs.h:3456:9`!, topLine * 6);
1053 XtSetValues(info->numberWidgetcxx . . $ FieldInfo#numberWidget., ARGScxx . . $ `apps/demos/gview/MotifHelp.h:52:9`!);
1054 }
1055
1056 ////////////////////////////////////////////////////////////////////////
1057 //
1058 // Description:
1059 // Callback called when the node we are editing changes. The data
1060 // pointer points to a FieldEditor instance.
1061 //
1062
1063 void
1064 FieldEditorcxx . . $ FieldEditor#::nodeSensorCBcxx . . $ FieldEditor#nodeSensorCB(c8d298b3e215c027).(void *data, SoSensorcxx . . $ SoSensor# *sensor)
1065 //
1066 ////////////////////////////////////////////////////////////////////////
1067 {
1068 // Try to update only the field that changed, if there is one
1069
1070 FieldEditorcxx . . $ FieldEditor# *editor = (FieldEditorcxx . . $ FieldEditor# *) data;
1071 SoNodeSensorcxx . . $ SoNodeSensor# *nodeSensor = (SoNodeSensorcxx . . $ SoNodeSensor# *) sensor;
1072 const SoFieldcxx . . $ SoField# *trigField = nodeSensor->getTriggerFieldcxx . . $ SoDataSensor#getTriggerField(c4a4d937024b6702).();
1073 int fieldIndex = -1;
1074
1075 if (trigField != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) {
1076 int i;
1077
1078 for (i = 0; i < editor->numFieldscxx . . $ FieldEditor#numFields.; i++) {
1079 if (editor->fieldInfoscxx . . $ FieldEditor#fieldInfos.[i].fieldcxx . . $ FieldInfo#field. == trigField) {
1080 fieldIndex = i;
1081 break;
1082 }
1083 }
1084 }
1085
1086 editor->revertcxx . . $ FieldEditor#revert(d4f767463ce0a6b3).(fieldIndex);
1087 }
1088
1089 ////////////////////////////////////////////////////////////////////////
1090 //
1091 // Description:
1092 // Callback called when the "Accept" button in the editor is
1093 // activated. The clientData pointer points to a FieldEditor instance.
1094 //
1095
1096 void
1097 FieldEditorcxx . . $ FieldEditor#::acceptButtonCBcxx . . $ FieldEditor#acceptButtonCB(ced67b223103c42b).(Widgetcxx . . $ Widget#, XtPointercxx . . $ XtPointer# clientData, XtPointercxx . . $ XtPointer#)
1098 //
1099 ////////////////////////////////////////////////////////////////////////
1100 {
1101 FieldEditorcxx . . $ FieldEditor# *editor = (FieldEditorcxx . . $ FieldEditor# *) clientData;
1102
1103 // Make sure latest changes were applied
1104 editor->applycxx . . $ FieldEditor#apply(49f6e7a06ebc5aa8).();
1105
1106 // Get rid of window
1107 editor->windowCloseActioncxx . . $ FieldEditor#windowCloseAction(49f6e7a06ebc5aa8).();
1108 }
1109
1110 ////////////////////////////////////////////////////////////////////////
1111 //
1112 // Description:
1113 // Callback called when the "Apply" button in the editor is
1114 // activated. The clientData pointer points to a FieldEditor instance.
1115 //
1116
1117 void
1118 FieldEditorcxx . . $ FieldEditor#::applyButtonCBcxx . . $ FieldEditor#applyButtonCB(ced67b223103c42b).(Widgetcxx . . $ Widget#, XtPointercxx . . $ XtPointer# clientData, XtPointercxx . . $ XtPointer#)
1119 //
1120 ////////////////////////////////////////////////////////////////////////
1121 {
1122 ((FieldEditorcxx . . $ FieldEditor# *) clientData)->applycxx . . $ FieldEditor#apply(49f6e7a06ebc5aa8).();
1123 }
1124
1125 ////////////////////////////////////////////////////////////////////////
1126 //
1127 // Description:
1128 // Callback called when the "Revert" button in the editor is
1129 // activated. The clientData pointer points to a FieldEditor instance.
1130 //
1131
1132 void
1133 FieldEditorcxx . . $ FieldEditor#::revertButtonCBcxx . . $ FieldEditor#revertButtonCB(ced67b223103c42b).(Widgetcxx . . $ Widget#, XtPointercxx . . $ XtPointer# clientData, XtPointercxx . . $ XtPointer#)
1134 //
1135 ////////////////////////////////////////////////////////////////////////
1136 {
1137 ((FieldEditorcxx . . $ FieldEditor# *) clientData)->revertcxx . . $ FieldEditor#revert(d4f767463ce0a6b3).();
1138 }
1139
1140 ////////////////////////////////////////////////////////////////////////
1141 //
1142 // Description:
1143 // Callback called when the "Cancel" button in the editor is
1144 // activated. The clientData pointer points to a FieldEditor instance.
1145 //
1146
1147 void
1148 FieldEditorcxx . . $ FieldEditor#::cancelButtonCBcxx . . $ FieldEditor#cancelButtonCB(ced67b223103c42b).(Widgetcxx . . $ Widget#, XtPointercxx . . $ XtPointer# clientData, XtPointercxx . . $ XtPointer#)
1149 //
1150 ////////////////////////////////////////////////////////////////////////
1151 {
1152 FieldEditorcxx . . $ FieldEditor# *editor = (FieldEditorcxx . . $ FieldEditor# *) clientData;
1153
1154 // Get rid of window
1155 editor->windowCloseActioncxx . . $ FieldEditor#windowCloseAction(49f6e7a06ebc5aa8).();
1156 }
1157
1158 ////////////////////////////////////////////////////////////////////////
1159 //
1160 // Description:
1161 // Callback called when the "Set Default" button in a field editor
1162 // is activated. The clientData pointer points to a FieldInfo
1163 // instance for the field to change.
1164 //
1165
1166 void
1167 FieldEditorcxx . . $ FieldEditor#::defaultButtonCBcxx . . $ FieldEditor#defaultButtonCB(ced67b223103c42b).(Widgetcxx . . $ Widget#, XtPointercxx . . $ XtPointer# clientData, XtPointercxx . . $ XtPointer#)
1168 //
1169 ////////////////////////////////////////////////////////////////////////
1170 {
1171 FieldInfocxx . . $ FieldInfo# *info = (FieldInfocxx . . $ FieldInfo# *) clientData;
1172
1173 // Make sure the correct value is displayed in the text widget
1174 info->editorcxx . . $ FieldInfo#editor.->showDefaultValuecxx . . $ FieldEditor#showDefaultValue(5aaa8752eb0beb6c).(info);
1175 }
1176
1177 ////////////////////////////////////////////////////////////////////////
1178 //
1179 // Description:
1180 // Callback called when the text in a field editor text widget
1181 // is changed. The clientData pointer points to a FieldInfo
1182 // instance.
1183 //
1184
1185 void
1186 FieldEditorcxx . . $ FieldEditor#::textChangedCBcxx . . $ FieldEditor#textChangedCB(ced67b223103c42b).(Widgetcxx . . $ Widget#, XtPointercxx . . $ XtPointer# clientData, XtPointercxx . . $ XtPointer# callData)
1187 //
1188 ////////////////////////////////////////////////////////////////////////
1189 {
1190 FieldInfocxx . . $ FieldInfo# *info = (FieldInfocxx . . $ FieldInfo# *) clientData;
1191 XmTextVerifyPtr tvp = (XmTextVerifyPtr) callData;
1192
1193 // If we are inserting a text character, see if it is a carriage return
1194 if (tvp->text->length > 0 && *tvp->text->ptr == '\n') {
1195
1196 // We don't want the text to be inserted if it's a
1197 // single-value field - just act as if we hit the "Apply"
1198 // button
1199 if (! info->isMultiplecxx . . $ FieldInfo#isMultiple.) {
1200 tvp->doit = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!;
1201 XtCallActionProc(info->editorcxx . . $ FieldInfo#editor.->applyButtoncxx . . $ FieldEditor#applyButton., "ArmAndActivate",
1202 tvp->event, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0);
1203 }
1204 }
1205
1206 // Multiple-value fields need to scroll correctly when the text
1207 // changes
1208 if (info->isMultiplecxx . . $ FieldInfo#isMultiple.)
1209 info->editorcxx . . $ FieldInfo#editor.->updateLineNumberscxx . . $ FieldEditor#updateLineNumbers(732e194d681aaf2c).(info, TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!);
1210
1211 // Reset the setToDefault flag to FALSE if necessary
1212 if (info->setToDefaultcxx . . $ FieldInfo#setToDefault. && tvp->doit) {
1213 XtSetSensitive(info->defaultButtoncxx . . $ FieldInfo#defaultButton., TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!);
1214 info->setToDefaultcxx . . $ FieldInfo#setToDefault. = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!;
1215 }
1216 }
1217
1218 ////////////////////////////////////////////////////////////////////////
1219 //
1220 // Description:
1221 // Callback called when the value of the scrollbar in a
1222 // multiple-value field text scrolling area changes. The clientData
1223 // pointer points to a FieldInfo instance.
1224 //
1225
1226 void
1227 FieldEditorcxx . . $ FieldEditor#::scrollCBcxx . . $ FieldEditor#scrollCB(ced67b223103c42b).(Widgetcxx . . $ Widget#, XtPointercxx . . $ XtPointer# clientData, XtPointercxx . . $ XtPointer#)
1228 //
1229 ////////////////////////////////////////////////////////////////////////
1230 {
1231 FieldInfocxx . . $ FieldInfo# *info = (FieldInfocxx . . $ FieldInfo# *) clientData;
1232
1233 // Determine the new top line number from the scroll bar
1234 info->editorcxx . . $ FieldInfo#editor.->updateLineNumberscxx . . $ FieldEditor#updateLineNumbers(732e194d681aaf2c).(info, FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!);
1235 }
1236
1237 ////////////////////////////////////////////////////////////////////////
1238 //
1239 // Description:
1240 // Callback used to keep the user from moving the insertion cursor
1241 // within the line-number widget. The clientData pointer points to
1242 // a FieldInfo instance.
1243 //
1244
1245 void
1246 FieldEditorcxx . . $ FieldEditor#::lineCBcxx . . $ FieldEditor#lineCB(ced67b223103c42b).(Widgetcxx . . $ Widget#, XtPointercxx . . $ XtPointer#, XtPointercxx . . $ XtPointer# callData)
1247 //
1248 ////////////////////////////////////////////////////////////////////////
1249 {
1250 XmTextVerifyCallbackStruct *cbInfo =
1251 (XmTextVerifyCallbackStruct *) callData;
1252
1253 // Indicate that no cursor motion should occur
1254 cbInfo->doit = Falsecxx . . $ `<external>/4815335266304551920/ICElib.h:38:9`!;
1255 }
1256
1257 ////////////////////////////////////////////////////////////////////////
1258 //
1259 // Description:
1260 // Reallocates fieldBuf and sets fieldBufSize.
1261 //
1262
1263 void *
1264 FieldEditorcxx . . $ FieldEditor#::reallocBufcxx . . $ FieldEditor#reallocBuf(417ab160f6baadc6).(void *ptr, size_t newSize)
1265 //
1266 ////////////////////////////////////////////////////////////////////////
1267 {
1268 fieldBufSizecxx . . $ FieldEditor#fieldBufSize. = newSize;
1269
1270 fieldBufcxx . . $ FieldEditor#fieldBuf. = (char *) realloc(ptr, newSize);
1271
1272 return fieldBufcxx . . $ FieldEditor#fieldBuf.;
1273 }
1274
1275 ////////////////////////////////////////////////////////////////////////
1276 //
1277 // Description:
1278 // Handler for read errors that occur when setting values in the
1279 // field. Saves the error message to be displayed later.
1280 //
1281
1282 void
1283 FieldEditorcxx . . $ FieldEditor#::readErrorCBcxx . . $ FieldEditor#readErrorCB(31d4b2db3dc1fb08).(const SoErrorcxx . . $ SoError# *error, void *data)
1284 //
1285 ////////////////////////////////////////////////////////////////////////
1286 {
1287 FieldInfocxx . . $ FieldInfo# *info = (FieldInfocxx . . $ FieldInfo# *) data;
1288
1289 // Save only the first error that is found
1290 if (info->editorcxx . . $ FieldInfo#editor.->errorStringcxx . . $ FieldEditor#errorString. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) {
1291
1292 SbStringcxx . . $ SbString# *err = new SbStringcxx . . $ SbString#;
1293
1294 (*err) =cxx . . $ SbString#`operator=`(90e156a883234106). "There was an error reading the values for the field named ";
1295 (*err) +=cxx . . $ SbString#`operator+=`(90e156a883234106). info->fieldNamecxx . . $ FieldInfo#fieldName..getStringcxx . . $ SbName#getString(a9f41ea0e82d88cf).();
1296 (*err) +=cxx . . $ SbString#`operator+=`(90e156a883234106). ":\n\n";
1297 (*err) +=cxx . . $ SbString#`operator+=`(d083593566fbb747). error->getDebugStringcxx . . $ SoError#getDebugString(fdbd3f046ea86381).();
1298
1299 info->editorcxx . . $ FieldInfo#editor.->errorStringcxx . . $ FieldEditor#errorString. = err;
1300 }
1301 }
1302
1303 ////////////////////////////////////////////////////////////////////////
1304 //
1305 // Description:
1306 // Displays error message detected during reading.
1307 //
1308
1309 void
1310 FieldEditorcxx . . $ FieldEditor#::displayReadErrorcxx . . $ FieldEditor#displayReadError(49f6e7a06ebc5aa8).()
1311 //
1312 ////////////////////////////////////////////////////////////////////////
1313 {
1314 if (errorStringcxx . . $ FieldEditor#errorString. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) {
1315 Errorcxx . . $ Error# *err = new Errorcxx . . $ Error#(XtParent(getWidgetcxx . . $ SoXtComponent#getWidget(24ba213de9f943e3).()),
1316 errorStringcxx . . $ FieldEditor#errorString.->getStringcxx . . $ SbString#getString(a9f41ea0e82d88cf).());
1317 delete errorStringcxx . . $ FieldEditor#errorString.;
1318
1319 errorStringcxx . . $ FieldEditor#errorString. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1320 }
1321 }