1 /*** DTB_USER_CODE_START vvv Add file header below vvv ***/
2 //%% (c) Copyright 1993, 1994 Hewlett-Packard Company
3 //%% (c) Copyright 1993, 1994 International Business Machines Corp.
4 //%% (c) Copyright 1993, 1994 Sun Microsystems, Inc.
5 //%% (c) Copyright 1993, 1994 Novell, Inc.
6 //%% $XConsortium: argChooser_stubs.C.src /main/3 1995/11/06 17:12:12 rswiston $
7 /*** DTB_USER_CODE_END ^^^ Add file header above ^^^ ***/
10 * File: argChooser_stubs.c
11 * Contains: Module callbacks and connection functions
13 * This file was generated by dtcodegen, from module argChooser
15 * Any text may be added between the DTB_USER_CODE_START and
16 * DTB_USER_CODE_END comments (even non-C code). Descriptive comments
17 * are provided only as an aid.
19 * ** EDIT ONLY WITHIN SECTIONS MARKED WITH DTB_USER_CODE COMMENTS. **
20 * ** ALL OTHER MODIFICATIONS WILL BE OVERWRITTEN. DO NOT MODIFY OR **
21 * ** DELETE THE GENERATED COMMENTS! **
26 #include "dtb_utils.h"
27 #include "argChooser_ui.h"
30 * Header files for cross-module connections
32 #include "ttsnoop_ui.h"
35 /**************************************************************************
36 *** DTB_USER_CODE_START
38 *** All necessary header files have been included.
40 *** Add include files, types, macros, externs, and user functions here.
45 #include <Dt/SpinBox.h>
50 _DtArgChooserAction choice,
60 DtbArgChooserArgChooserInfo instance =
61 &dtb_arg_chooser_arg_chooser;
62 if (! instance->initialized) {
63 dtb_arg_chooser_arg_chooser_initialize(
64 instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin );
70 modeChoice = instance->modeChoice_items.IN_item;
73 modeChoice = instance->modeChoice_items.OUT_item;
76 modeChoice = instance->modeChoice_items.INOUT_item;
79 XtVaSetValues( instance->modeChoice, XmNmenuHistory, modeChoice, NULL );
81 Widget valType = instance->argValTypeChoice_items.None_item;
85 argValTypeChoice_items.char_item;
88 argValTypeChoice_items.int_item;
91 XtVaSetValues( instance->argValTypeChoice, XmNmenuHistory, valType, NULL);
93 XmTextFieldSetString( instance->vtypeText, vtype );
94 XtVaSetValues( instance->argIvalBox, DtNposition, ival, NULL );
95 XtVaSetValues( instance->argValText, XmNvalue, val, NULL );
97 _DtArgChooserSet( choice, entity, nth );
102 _DtArgChooserAction choice,
107 Boolean vtypeActive = True;
108 Boolean modeActive = True;
109 char *vtypeLabel = "vtype:";
113 case _DtArgChoosePatternArgAdd:
114 case _DtArgChoosePatternIArgAdd:
116 title = "tt_pattern_arg_add";
118 case _DtArgChoosePatternContextAdd:
119 case _DtArgChoosePatternIContextAdd:
121 title = "tt_pattern_context_add";
123 vtypeLabel = "slot:";
125 case _DtArgChooseMessageArgAdd:
126 case _DtArgChooseMessageIArgAdd:
128 title = "tt_message_arg_add";
130 case _DtArgChooseMessageArgSet:
131 case _DtArgChooseMessageIArgSet:
133 title = "tt_message_arg_val_set";
137 case _DtArgChooseMessageContextSet:
138 case _DtArgChooseMessageIContextSet:
140 title = "tt_message_context_set";
142 vtypeLabel = "slot:";
147 DtbArgChooserArgChooserInfo instance =
148 &dtb_arg_chooser_arg_chooser;
149 if (! instance->initialized) {
150 dtb_arg_chooser_arg_chooser_initialize(
151 instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin );
154 DtTtSetLabel( instance->argChooserOkButton, okString );
155 XtVaSetValues( instance->argChooser, XmNtitle, title, NULL );
156 DtTtSetLabel( instance->vtypeText_label, vtypeLabel );
157 XtSetSensitive( instance->vtypeText, vtypeActive );
158 XtSetSensitive( instance->modeChoice, modeActive );
160 // Remember dialog mode, entity, nth
161 XtVaSetValues( instance->argChooserOkButton, XmNuserData, choice, NULL );
162 XtVaSetValues( instance->argChooserCancelButton,
163 XmNuserData, entity, NULL );
164 XtVaSetValues( instance->argChooserHelpButton, XmNuserData, nth, NULL );
167 // Pre-select vtype text
168 XmTextPosition last =
169 XmTextFieldGetLastPosition( instance->vtypeText );
170 Time when = XtLastTimestampProcessed(
171 XtDisplay( instance->vtypeText ));
172 XmTextFieldSetSelection( instance->vtypeText, 0, last, when );
175 XtManageChild( instance->argChooser_shellform );
178 /*** DTB_USER_CODE_END
180 *** End of user code section
182 **************************************************************************/
187 argChooser_argValTypeChoice_None_item_CB1(
189 XtPointer clientData,
193 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
194 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
196 DtbArgChooserArgChooserInfo instance = (DtbArgChooserArgChooserInfo)clientData;
198 if (!(instance->initialized))
200 dtb_arg_chooser_arg_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
203 XtSetSensitive(instance->argIvalBox, False);
205 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
206 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
211 argChooser_argValTypeChoice_char_item_CB1(
213 XtPointer clientData,
217 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
218 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
220 DtbArgChooserArgChooserInfo instance = (DtbArgChooserArgChooserInfo)clientData;
222 if (!(instance->initialized))
224 dtb_arg_chooser_arg_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
227 XtSetSensitive(instance->argIvalBox, False);
229 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
230 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
235 argChooser_argValTypeChoice_int_item_CB1(
237 XtPointer clientData,
241 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
242 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
244 DtbArgChooserArgChooserInfo instance = (DtbArgChooserArgChooserInfo)clientData;
246 if (!(instance->initialized))
248 dtb_arg_chooser_arg_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
251 XtSetSensitive(instance->argIvalBox, True);
253 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
254 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
259 argChooser_argChooserOkButton_CB1(
261 XtPointer clientData,
265 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
266 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
268 DtbArgChooserArgChooserInfo instance = (DtbArgChooserArgChooserInfo)clientData;
270 if (!(instance->initialized))
272 dtb_arg_chooser_arg_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
274 XtUnmanageChild(instance->argChooser_shellform);
276 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
277 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
282 argChooser_argChooserCancelButton_CB1(
284 XtPointer clientData,
288 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
289 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
291 DtbArgChooserArgChooserInfo instance = (DtbArgChooserArgChooserInfo)clientData;
293 if (!(instance->initialized))
295 dtb_arg_chooser_arg_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
297 XtUnmanageChild(instance->argChooser_shellform);
299 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
300 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
305 argChooser_argValTypeChoice_None_item_CB2(
307 XtPointer clientData,
311 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
312 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
314 DtbArgChooserArgChooserInfo instance = (DtbArgChooserArgChooserInfo)clientData;
316 if (!(instance->initialized))
318 dtb_arg_chooser_arg_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
321 XtSetSensitive(instance->argValText, False);
323 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
324 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
329 argChooser_argValTypeChoice_int_item_CB2(
331 XtPointer clientData,
335 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
336 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
338 DtbArgChooserArgChooserInfo instance = (DtbArgChooserArgChooserInfo)clientData;
340 if (!(instance->initialized))
342 dtb_arg_chooser_arg_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
345 XtSetSensitive(instance->argValText, False);
347 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
348 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
353 argChooser_argValTypeChoice_char_item_CB2(
355 XtPointer clientData,
359 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
360 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
362 DtbArgChooserArgChooserInfo instance = (DtbArgChooserArgChooserInfo)clientData;
364 if (!(instance->initialized))
366 dtb_arg_chooser_arg_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
369 XtSetSensitive(instance->argValText, True);
371 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
372 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
379 XtPointer clientData,
383 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
384 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
386 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
387 DtbArgChooserArgChooserInfo instance =
388 (DtbArgChooserArgChooserInfo)clientData;
393 _DtArgChooserAction choice = _DtArgChooseNone;
396 XtVaGetValues( instance->argChooserOkButton, XmNuserData, &pval, NULL );
397 choice = (_DtArgChooserAction) (long) pval;
398 XtVaGetValues( instance->argChooserCancelButton, XmNuserData, &pval, NULL );
399 msg = (Tt_message)pval;
400 pat = (Tt_pattern)pval;
401 XtVaGetValues( instance->argChooserHelpButton, XmNuserData, &pval, NULL );
402 nth = (int) (long) pval;
404 char *vtype = XmTextFieldGetString( instance->vtypeText );
405 if ((vtype != 0) && (vtype[0] == '\0')) {
411 XtVaGetValues( instance->modeChoice, XmNmenuHistory, &modeWidget, NULL );
412 Tt_mode mode = TT_IN;
413 if (modeWidget == instance->modeChoice_items.OUT_item) {
415 } else if (modeWidget == instance->modeChoice_items.INOUT_item) {
421 Widget valTypeWidget;
422 XtVaGetValues( instance->argValTypeChoice,
423 XmNmenuHistory, &valTypeWidget, NULL );
424 if (valTypeWidget == instance->argValTypeChoice_items.char_item) {
425 val = XmTextGetString( instance->argValText );
426 } else if (valTypeWidget == instance->argValTypeChoice_items.int_item) {
427 // see _DtArgChooserAction invariant in DtTt.h
428 choice = (_DtArgChooserAction)(choice + 1);
429 XtVaGetValues( instance->argIvalBox, DtNposition, &ival, NULL );
434 case _DtArgChooseMessageArgAdd:
435 case _DtArgChooseMessageIArgAdd:
436 case _DtArgChooseMessageArgSet:
437 case _DtArgChooseMessageIArgSet:
438 case _DtArgChooseMessageContextSet:
439 case _DtArgChooseMessageIContextSet:
440 _DtTtMessageUpdate( msg, choice, nth, mode, vtype, val, ival );
441 case _DtArgChoosePatternArgAdd:
442 case _DtArgChoosePatternIArgAdd:
443 case _DtArgChoosePatternContextAdd:
444 case _DtArgChoosePatternIContextAdd:
445 _DtTtPatternUpdate( pat, choice, mode, vtype, val, ival );
450 if (vtype != 0) XtFree( vtype );
451 if (val != 0) XtFree( val );
452 XtUnmanageChild(instance->argChooser_shellform);
453 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
460 XtPointer clientData,
464 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
465 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
467 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
468 DtbArgChooserArgChooserInfo instance =
469 (DtbArgChooserArgChooserInfo)clientData;
471 XtVaGetValues( instance->argChooserOkButton, XmNuserData, &val, NULL );
472 _DtArgChooserAction choice = (_DtArgChooserAction) (long) val;
473 Widget label = dtb_ttsnoop_ttsnoop_win.ttsnoopWin_label;
475 case _DtArgChoosePatternArgAdd:
476 case _DtArgChoosePatternIArgAdd:
477 _DtMan( label, "tt_pattern_arg_add" );
479 case _DtArgChoosePatternContextAdd:
480 case _DtArgChoosePatternIContextAdd:
481 _DtMan( label, "tt_pattern_context_add" );
483 case _DtArgChooseMessageArgAdd:
484 case _DtArgChooseMessageIArgAdd:
485 _DtMan( label, "tt_message_arg_add" );
487 case _DtArgChooseMessageArgSet:
488 case _DtArgChooseMessageIArgSet:
489 _DtMan( label, "tt_message_arg_val_set" );
491 case _DtArgChooseMessageContextSet:
492 case _DtArgChooseMessageIContextSet:
493 _DtMan( label, "tt_message_context_set" );
498 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
503 /**************************************************************************
504 *** DTB_USER_CODE_START
506 *** All automatically-generated data and functions have been defined.
508 *** Add new functions here, or at the top of the file.
511 /*** DTB_USER_CODE_END
513 *** End of user code section
515 **************************************************************************/