ARB
AW_option_toggle.cxx
Go to the documentation of this file.
1 // ============================================================== //
2 // //
3 // File : AW_option_toggle.cxx //
4 // Purpose : option-menu- and toggle-code //
5 // //
6 // Institute of Microbiology (Technical University Munich) //
7 // http://www.arb-home.de/ //
8 // //
9 // ============================================================== //
10 
11 #include "aw_at.hxx"
12 #include "aw_window.hxx"
13 #include "aw_awar.hxx"
14 #include "aw_window_Xm.hxx"
15 #include "aw_root.hxx"
16 #include "aw_xargs.hxx"
17 #include "aw_varupdate.hxx"
18 #include "aw_localdef.hxx"
19 
20 #include <Xm/MenuShell.h>
21 #include <Xm/RowColumn.h>
22 #include <Xm/ToggleB.h>
23 #include <Xm/Label.h>
24 #include <Xm/PushB.h>
25 
26 __ATTR__NORETURN inline void option_type_mismatch(const char *triedType) { type_mismatch(triedType, "option-menu"); }
27 __ATTR__NORETURN inline void toggle_type_mismatch(const char *triedType) { type_mismatch(triedType, "toggle"); }
28 
29 // ----------------------
30 // Options-Menu
31 
33  Widget optionMenu_shell;
34  Widget optionMenu;
35  Widget optionMenu1;
36  int x_for_position_of_menu;
37 
38  _at->saved_x = _at->x_for_next_button - (_at->label_for_inputfield ? 0 : 10);
39  x_for_position_of_menu = 10;
40 
41  optionMenu_shell = XtVaCreatePopupShell ("optionMenu shell",
42  xmMenuShellWidgetClass,
44  XmNwidth, 1,
45  XmNheight, 1,
46  XmNallowShellResize, true,
47  XmNoverrideRedirect, true,
48  XmNfontList, p_global->fontlist,
49  NULp);
50 
51  optionMenu = XtVaCreateWidget("optionMenu_p1",
52  xmRowColumnWidgetClass,
53  optionMenu_shell,
54  XmNrowColumnType, XmMENU_PULLDOWN,
55  XmNfontList, p_global->fontlist,
56  NULp);
57  {
58  aw_xargs args(3);
59  args.add(XmNfontList, (XtArgVal)p_global->fontlist);
60  if (!_at->attach_x && !_at->attach_lx) args.add(XmNx, x_for_position_of_menu);
61  if (!_at->attach_y && !_at->attach_ly) args.add(XmNy, _at->y_for_next_button-5);
62 
63  if (_at->label_for_inputfield) {
64  int width_help_label, height_help_label;
65  calculate_label_size(&width_help_label, &height_help_label, false);
66  // we do not use 'height_help_label' for Y-alignment, but it works well for multiline label. why?
67 #if defined(DUMP_BUTTON_CREATION)
68  printf("width_help_label=%i height_help_label=%i label='%s'\n", width_help_label, height_help_label, _at->label_for_inputfield);
69 #endif // DUMP_BUTTON_CREATION
70 
71  {
72  aw_assert(!AW_IS_IMAGEREF(_at->label_for_inputfield)); // using images as labels for option menus does not work in motif
73 
74  char *help_label = this->align_string(_at->label_for_inputfield, width_help_label);
75  optionMenu1 = XtVaCreateManagedWidget("optionMenu1",
76  xmRowColumnWidgetClass,
77  (_at->attach_any) ? INFO_FORM : INFO_WIDGET,
78  XmNrowColumnType, XmMENU_OPTION,
79  XmNsubMenuId, optionMenu,
80  RES_CONVERT(XmNlabelString, help_label),
81  NULp);
82  free(help_label);
83  }
84  }
85  else {
86  _at->x_for_next_button = _at->saved_x;
87 
88  optionMenu1 = XtVaCreateManagedWidget("optionMenu1",
89  xmRowColumnWidgetClass,
90  (_at->attach_any) ? INFO_FORM : INFO_WIDGET,
91  XmNrowColumnType, XmMENU_OPTION,
92  XmNsubMenuId, optionMenu,
93  NULp);
94  }
95  args.assign_to_widget(optionMenu1);
96  }
97 
98 #if 0
99  // setting background color for radio button only does not work.
100  // works only for label and button together, but that's not what we want.
101  TuneBackground(optionMenu_shell, TUNE_BUTTON); // set background color for radio button
102  XtVaSetValues(optionMenu1, // colorizes background and label
103  XmNbackground, _at->background_color,
104  NULp);
105 #endif
106 
108 
109  AW_awar *vs = root->awar(awar_name);
110  {
111  AW_option_menu_struct *next =
112  new AW_option_menu_struct(get_root()->number_of_option_menus,
113  awar_name,
114  vs->variable_type,
115  optionMenu1,
116  optionMenu,
117  _at->x_for_next_button - 7,
118  _at->y_for_next_button,
119  _at->correct_for_at_center);
120 
121  if (p_global->option_menu_list) {
122  p_global->last_option_menu->next = next;
123  p_global->last_option_menu = p_global->last_option_menu->next;
124  }
125  else {
126  p_global->last_option_menu = p_global->option_menu_list = next;
127  }
128  }
129 
130  p_global->current_option_menu = p_global->last_option_menu;
131 
132  vs->tie_widget((AW_CL)p_global->current_option_menu, optionMenu, AW_WIDGET_CHOICE_MENU, this);
133  root->make_sensitive(optionMenu1, _at->widget_mask);
134 
135  return p_global->current_option_menu;
136 }
137 
139  aw_root->remove_button_from_sens_list(os->widget);
140  XtDestroyWidget(os->widget);
141 }
142 
144  p_global->current_option_menu = oms; // define as current (for subsequent inserts)
145 
146  AW_widget_value_pair *next_os;
147  for (AW_widget_value_pair *os = oms->first_choice; os; os = next_os) {
148  next_os = os->next;
149  os->next = NULp;
151  delete os;
152  }
153 
154  if (oms->default_choice) {
156  oms->default_choice = NULp;
157  }
158 
159  oms->first_choice = NULp;
160  oms->last_choice = NULp;
161 }
162 
163 void *AW_window::_create_option_entry(AW_VARIABLE_TYPE IF_ASSERTION_USED(type), const char *name, const char */*mnemonic*/, const char *name_of_color) {
164  Widget entry;
165  AW_option_menu_struct *oms = p_global->current_option_menu;
166 
167  aw_assert(oms->variable_type == type); // adding wrong entry type
168 
169  TuneOrSetBackground(oms->menu_widget, name_of_color, TUNE_BUTTON); // set background color for radio button entries
170  entry = XtVaCreateManagedWidget("optionMenu_entry",
171  xmPushButtonWidgetClass,
172  oms->menu_widget,
173  RES_CONVERT(XmNlabelString, name), // force text
174  XmNfontList, p_global->fontlist,
175  XmNbackground, _at->background_color,
176  NULp);
177  AW_label_in_awar_list(this, entry, name);
178  return (void *)entry;
179 }
180 
181 inline void option_menu_add_option(AW_option_menu_struct *oms, AW_widget_value_pair *os, bool default_option) {
182  if (default_option) {
183  oms->default_choice = os;
184  }
185  else {
186  if (oms->first_choice) {
187  oms->last_choice->next = os;
188  oms->last_choice = oms->last_choice->next;
189  }
190  else {
191  oms->last_choice = oms->first_choice = os;
192  }
193  }
194 }
195 
196 void AW_window::insert_option_internal(AW_label option_name, const char *mnemonic, const char *var_value, const char *name_of_color, bool default_option) {
197  AW_option_menu_struct *oms = p_global->current_option_menu;
198  aw_assert(oms); // "current" option menu has to be set (insert-functions may only be used between create_option_menu/clear_option_menu and update_option_menu)
199 
200  if (oms->variable_type != AW_STRING) {
201  option_type_mismatch("string");
202  }
203  else {
204  Widget entry = (Widget)_create_option_entry(AW_STRING, option_name, mnemonic, name_of_color);
205  AW_cb *cbs = _callback; // user-own callback
206 
207  // callback for new choice
208  XtAddCallback(entry, XmNactivateCallback,
209  (XtCallbackProc) AW_variable_update_callback,
210  (XtPointer) new VarUpdateInfo(this, NULp, AW_WIDGET_CHOICE_MENU, root->awar(oms->variable_name), var_value, cbs));
211 
212  option_menu_add_option(p_global->current_option_menu, new AW_widget_value_pair(var_value, entry), default_option);
213  root->make_sensitive(entry, _at->widget_mask);
214  this->unset_at_commands();
215  }
216 }
217 void AW_window::insert_option_internal(AW_label option_name, const char *mnemonic, int var_value, const char *name_of_color, bool default_option) {
218  AW_option_menu_struct *oms = p_global->current_option_menu;
219  aw_assert(oms); // "current" option menu has to be set (insert-functions may only be used between create_option_menu/clear_option_menu and update_option_menu)
220 
221  if (oms->variable_type != AW_INT) {
222  option_type_mismatch("int");
223  }
224  else {
225  Widget entry = (Widget)_create_option_entry(AW_INT, option_name, mnemonic, name_of_color);
226  AW_cb *cbs = _callback; // user-own callback
227 
228  // callback for new choice
229  XtAddCallback(entry, XmNactivateCallback,
230  (XtCallbackProc) AW_variable_update_callback,
231  (XtPointer) new VarUpdateInfo(this, NULp, AW_WIDGET_CHOICE_MENU, root->awar(oms->variable_name), var_value, cbs));
232 
233  option_menu_add_option(p_global->current_option_menu, new AW_widget_value_pair(var_value, entry), default_option);
234  root->make_sensitive(entry, _at->widget_mask);
235  this->unset_at_commands();
236  }
237 }
238 void AW_window::insert_option_internal(AW_label option_name, const char *mnemonic, float var_value, const char *name_of_color, bool default_option) {
239  AW_option_menu_struct *oms = p_global->current_option_menu;
240  aw_assert(oms); // "current" option menu has to be set (insert-functions may only be used between create_option_menu/clear_option_menu and update_option_menu)
241 
242  if (oms->variable_type != AW_FLOAT) {
243  option_type_mismatch("float");
244  }
245  else {
246  Widget entry = (Widget)_create_option_entry(AW_FLOAT, option_name, mnemonic, name_of_color);
247  AW_cb *cbs = _callback; // user-own callback
248 
249  // callback for new choice
250  XtAddCallback(entry, XmNactivateCallback,
251  (XtCallbackProc) AW_variable_update_callback,
252  (XtPointer) new VarUpdateInfo(this, NULp, AW_WIDGET_CHOICE_MENU, root->awar(oms->variable_name), var_value, cbs));
253 
254  option_menu_add_option(p_global->current_option_menu, new AW_widget_value_pair(var_value, entry), default_option);
255  root->make_sensitive(entry, _at->widget_mask);
256  this->unset_at_commands();
257  }
258 }
259 
260 void AW_window::insert_option (const char *on, const char *mn, const char *vv, const char *noc) { insert_option_internal(on, mn, vv, noc, false); }
261 void AW_window::insert_default_option(const char *on, const char *mn, const char *vv, const char *noc) { insert_option_internal(on, mn, vv, noc, true); }
262 void AW_window::insert_option (const char *on, const char *mn, int vv, const char *noc) { insert_option_internal(on, mn, vv, noc, false); }
263 void AW_window::insert_default_option(const char *on, const char *mn, int vv, const char *noc) { insert_option_internal(on, mn, vv, noc, true); }
264 void AW_window::insert_option (const char *on, const char *mn, float vv, const char *noc) { insert_option_internal(on, mn, vv, noc, false); }
265 void AW_window::insert_default_option(const char *on, const char *mn, float vv, const char *noc) { insert_option_internal(on, mn, vv, noc, true); }
266 // (see insert_option_internal for longer parameter names)
267 
269  AW_option_menu_struct *oms = p_global->current_option_menu;
270  refresh_option_menu(oms);
271 
272  if (_at->attach_any) aw_attach_widget(oms->label_widget, _at);
273 
274  short width;
275  short height;
276  XtVaGetValues(oms->label_widget, XmNwidth, &width, XmNheight, &height, NULp);
277  int width_of_last_widget = width;
278  int height_of_last_widget = height;
279 
280  if (!_at->to_position_exists) {
281  if (oms->correct_for_at_center_intern == 0) { // left aligned
282  XtVaSetValues(oms->label_widget, XmNx, short(_at->saved_x), NULp);
283  }
284  if (oms->correct_for_at_center_intern == 1) { // middle centered
285  XtVaSetValues(oms->label_widget, XmNx, short(_at->saved_x - width/2), NULp);
286  width_of_last_widget = width_of_last_widget / 2;
287  }
288  if (oms->correct_for_at_center_intern == 2) { // right aligned
289  XtVaSetValues(oms->label_widget, XmNx, short(_at->saved_x - width), NULp);
290  width_of_last_widget = 0;
291  }
292  }
293 
294  width_of_last_widget += SPACE_BEHIND_BUTTON;
295 
296  this->unset_at_commands();
297  this->increment_at_commands(width_of_last_widget, height_of_last_widget);
298 }
299 
301  if (get_root()->changer_of_variable != oms->label_widget) {
302  AW_widget_value_pair *active_choice = oms->first_choice;
303  {
304  AW_scalar global_var_value(root->awar(oms->variable_name));
305  while (active_choice && global_var_value != active_choice->value) {
306  active_choice = active_choice->next;
307  }
308  }
309 
310  if (!active_choice) active_choice = oms->default_choice;
311  if (active_choice) XtVaSetValues(oms->label_widget, XmNmenuHistory, active_choice->widget, NULp);
312 
313  }
314 }
315 
316 // -------------------------------------------------------
317 // toggle field (actually this are radio buttons)
318 
319 void AW_window::create_toggle_field(const char *var_name, AW_label labeli, AW_orientation orientation) {
324  aw_assert(labeli); // use method flavor below when you don't want to define a label
325  label(labeli);
326  create_toggle_field(var_name, orientation);
327 }
328 
329 void AW_window::create_toggle_field(const char *var_name, AW_orientation orientation) {
336  Widget label_for_toggle;
337  Widget toggle_field;
338 
339  int xoff_for_label = 0;
340  int width_of_label = 0;
341  int x_for_position_of_option = 0;
342 
343  if (_at->correct_for_at_center) {
344  _at->saved_x = _at->x_for_next_button;
345  x_for_position_of_option = 10;
346  }
347  else {
348  x_for_position_of_option = _at->x_for_next_button;
349  }
350 
351  if (_at->label_for_inputfield) {
352  int height_of_label;
353  calculate_label_size(&width_of_label, &height_of_label, true);
354  // Note: we do not use height_of_label for Y-alignment.
355  // the label is always displayed at top position!
356 
357  label_for_toggle = XtVaCreateManagedWidget("label",
358  xmLabelWidgetClass,
359  INFO_WIDGET,
360  XmNx, (int)_at->x_for_next_button,
361  XmNy, (int)(_at->y_for_next_button) + this->get_root()->y_correction_for_input_labels,
362  XmNwidth, (int)(width_of_label + 2),
363  RES_CONVERT(XmNlabelString, _at->label_for_inputfield),
364  XmNrecomputeSize, false,
365  XmNalignment, XmALIGNMENT_BEGINNING,
366  XmNfontList, p_global->fontlist,
367  NULp);
368 
369  _at->saved_xoff_for_label = xoff_for_label = width_of_label + 10;
370 
371  p_w->toggle_label = label_for_toggle;
372  }
373  else {
374  p_w->toggle_label = NULp;
375  _at->saved_xoff_for_label = 0;
376  }
377 
378  {
379  aw_xargs args(6);
380  args.add(XmNx, x_for_position_of_option + xoff_for_label);
381  args.add(XmNy, _at->y_for_next_button - 2);
382  args.add(XmNradioBehavior, True);
383  args.add(XmNradioAlwaysOne, True);
384  args.add(XmNfontList, (XtArgVal)p_global->fontlist);
385  args.add(XmNorientation, orientation == AW_HORIZONTAL ? XmHORIZONTAL : XmVERTICAL);
386 
387  toggle_field = XtVaCreateManagedWidget("rowColumn for toggle field", xmRowColumnWidgetClass, (_at->attach_any) ? INFO_FORM : INFO_WIDGET, NULp);
388 
389  args.assign_to_widget(toggle_field);
390  }
391  if (_at->attach_any) {
392  aw_attach_widget(toggle_field, _at, 300);
393  }
394 
395  AW_awar *vs = root->awar(var_name);
396 
397  p_w->toggle_field = toggle_field;
398  free((p_w->toggle_field_var_name));
399  p_w->toggle_field_var_name = strdup(var_name);
401 
403 
404  if (p_global->toggle_field_list) {
405  p_global->last_toggle_field->next = new AW_toggle_field_struct(get_root()->number_of_toggle_fields, var_name, vs->variable_type, toggle_field, _at->correct_for_at_center);
406  p_global->last_toggle_field = p_global->last_toggle_field->next;
407  }
408  else {
409  p_global->last_toggle_field = p_global->toggle_field_list = new AW_toggle_field_struct(get_root()->number_of_toggle_fields, var_name, vs->variable_type, toggle_field, _at->correct_for_at_center);
410  }
411 
412  vs->tie_widget(get_root()->number_of_toggle_fields, toggle_field, AW_WIDGET_TOGGLE_FIELD, this);
413  root->make_sensitive(toggle_field, _at->widget_mask);
414 }
415 
416 static Widget _aw_create_toggle_entry(AW_window *aww, Widget toggle_field,
417  const char *labeltext, const char *mnemonic,
418  VarUpdateInfo *awus,
419  AW_widget_value_pair *toggle, bool default_toggle) {
420  AW_root *root = aww->get_root();
421 
422  Label label(labeltext, aww);
423  Widget toggleButton = XtVaCreateManagedWidget("toggleButton",
424  xmToggleButtonWidgetClass,
425  toggle_field,
426  RES_LABEL_CONVERT(label),
427  RES_CONVERT(XmNmnemonic, mnemonic),
428  XmNindicatorSize, 16,
429  XmNfontList, p_global->fontlist,
430  NULp);
431 
432  toggle->widget = toggleButton;
433  awus->set_widget(toggleButton);
434  XtAddCallback(toggleButton, XmNvalueChangedCallback,
435  (XtCallbackProc) AW_variable_update_callback,
436  (XtPointer) awus);
437  if (default_toggle) {
438  delete p_global->last_toggle_field->default_toggle;
439  p_global->last_toggle_field->default_toggle = toggle;
440  }
441  else {
442  if (p_global->last_toggle_field->first_toggle) {
443  p_global->last_toggle_field->last_toggle->next = toggle;
444  p_global->last_toggle_field->last_toggle = toggle;
445  }
446  else {
447  p_global->last_toggle_field->last_toggle = toggle;
448  p_global->last_toggle_field->first_toggle = toggle;
449  }
450  }
451  root->make_sensitive(toggleButton, aww->get_at().widget_mask);
452 
453  aww->unset_at_commands();
454  return toggleButton;
455 }
456 
457 
458 void AW_window::insert_toggle_internal(AW_label toggle_label, const char *mnemonic, const char *var_value, bool default_toggle) {
460  toggle_type_mismatch("string");
461  }
462  else {
463  _aw_create_toggle_entry(this, p_w->toggle_field, toggle_label, mnemonic,
465  new AW_widget_value_pair(var_value, NULp),
466  default_toggle);
467  }
468 }
469 void AW_window::insert_toggle_internal(AW_label toggle_label, const char *mnemonic, int var_value, bool default_toggle) {
470  if (p_w->toggle_field_var_type != AW_INT) {
471  toggle_type_mismatch("int");
472  }
473  else {
474  _aw_create_toggle_entry(this, p_w->toggle_field, toggle_label, mnemonic,
476  new AW_widget_value_pair(var_value, NULp),
477  default_toggle);
478  }
479 }
480 void AW_window::insert_toggle_internal(AW_label toggle_label, const char *mnemonic, float var_value, bool default_toggle) {
482  toggle_type_mismatch("float");
483  }
484  else {
485  _aw_create_toggle_entry(this, p_w->toggle_field, toggle_label, mnemonic,
487  new AW_widget_value_pair(var_value, NULp),
488  default_toggle);
489  }
490 }
491 
492 
493 void AW_window::insert_toggle (const char *toggle_label, const char *mnemonic, const char *var_value) { insert_toggle_internal(toggle_label, mnemonic, var_value, false); }
494 void AW_window::insert_default_toggle(const char *toggle_label, const char *mnemonic, const char *var_value) { insert_toggle_internal(toggle_label, mnemonic, var_value, true); }
495 void AW_window::insert_toggle (const char *toggle_label, const char *mnemonic, int var_value) { insert_toggle_internal(toggle_label, mnemonic, var_value, false); }
496 void AW_window::insert_default_toggle(const char *toggle_label, const char *mnemonic, int var_value) { insert_toggle_internal(toggle_label, mnemonic, var_value, true); }
497 void AW_window::insert_toggle (const char *toggle_label, const char *mnemonic, float var_value) { insert_toggle_internal(toggle_label, mnemonic, var_value, false); }
498 void AW_window::insert_default_toggle(const char *toggle_label, const char *mnemonic, float var_value) { insert_toggle_internal(toggle_label, mnemonic, var_value, true); }
499 
501  this->refresh_toggle_field(get_root()->number_of_toggle_fields);
502 }
503 
504 
505 void AW_window::refresh_toggle_field(int toggle_field_number) {
506 #if defined(DEBUG)
507  static int inside_here = 0;
508  aw_assert(!inside_here);
509  inside_here++;
510 #endif // DEBUG
511 
512  AW_toggle_field_struct *toggle_field_list = p_global->toggle_field_list;
513  {
514  while (toggle_field_list) {
515  if (toggle_field_number == toggle_field_list->toggle_field_number) {
516  break;
517  }
518  toggle_field_list = toggle_field_list->next;
519  }
520  }
521 
522  if (toggle_field_list) {
523  AW_widget_value_pair *active_toggle = toggle_field_list->first_toggle;
524  {
525  AW_scalar global_value(root->awar(toggle_field_list->variable_name));
526  while (active_toggle && active_toggle->value != global_value) {
527  active_toggle = active_toggle->next;
528  }
529  if (!active_toggle) active_toggle = toggle_field_list->default_toggle;
530  }
531 
532  // iterate over all toggles including default_toggle and set their state
533  for (AW_widget_value_pair *toggle = toggle_field_list->first_toggle; toggle;) {
534  XmToggleButtonSetState(toggle->widget, toggle == active_toggle, False);
535 
536  if (toggle->next) toggle = toggle->next;
537  else if (toggle != toggle_field_list->default_toggle) toggle = toggle_field_list->default_toggle;
538  else toggle = NULp;
539  }
540 
541  // @@@ code below should go to update_toggle_field
542  {
543  short length;
544  short height;
545  XtVaGetValues(p_w->toggle_field, XmNwidth, &length, XmNheight, &height, NULp);
546  length += (short)_at->saved_xoff_for_label;
547 
548  int width_of_last_widget = length;
549  int height_of_last_widget = height;
550 
551  if (toggle_field_list->correct_for_at_center_intern) {
552  if (toggle_field_list->correct_for_at_center_intern == 1) { // middle centered
553  XtVaSetValues(p_w->toggle_field, XmNx, (short)((short)_at->saved_x - (short)(length/2) + (short)_at->saved_xoff_for_label), NULp);
554  if (p_w->toggle_label) {
555  XtVaSetValues(p_w->toggle_label, XmNx, (short)((short)_at->saved_x - (short)(length/2)), NULp);
556  }
557  width_of_last_widget = width_of_last_widget / 2;
558  }
559  if (toggle_field_list->correct_for_at_center_intern == 2) { // right centered
560  XtVaSetValues(p_w->toggle_field, XmNx, (short)((short)_at->saved_x - length + (short)_at->saved_xoff_for_label), NULp);
561  if (p_w->toggle_label) {
562  XtVaSetValues(p_w->toggle_label, XmNx, (short)((short)_at->saved_x - length), NULp);
563  }
564  width_of_last_widget = 0;
565  }
566  }
567 
568  this->unset_at_commands();
569  this->increment_at_commands(width_of_last_widget, height_of_last_widget);
570  }
571  }
572  else {
573  GBK_terminatef("update_toggle_field: toggle field %i does not exist", toggle_field_number);
574  }
575 
576 #if defined(DEBUG)
577  inside_here--;
578 #endif // DEBUG
579 }
void TuneBackground(Widget w, int modStrength)
Definition: AW_window.cxx:3172
AW_widget_value_pair * first_toggle
AW_VARIABLE_TYPE toggle_field_var_type
void insert_option(AW_label choice_label, const char *mnemonic, const char *var_value, const char *name_of_color=NULp)
bool to_position_exists
Definition: aw_at.hxx:40
bool attach_x
Definition: aw_at.hxx:58
int x_for_next_button
Definition: aw_at.hxx:33
void refresh_option_menu(AW_option_menu_struct *)
AW_cb * _callback
Definition: aw_window.hxx:289
bool attach_ly
Definition: aw_at.hxx:61
#define TUNE_BUTTON
Definition: aw_window.hxx:39
GB_TYPES type
void insert_toggle(AW_label toggle_label, const char *mnemonic, const char *var_value)
__ATTR__NORETURN void toggle_type_mismatch(const char *triedType)
AW_widget_value_pair * default_choice
static Widget _aw_create_toggle_entry(AW_window *aww, Widget toggle_field, const char *labeltext, const char *mnemonic, VarUpdateInfo *awus, AW_widget_value_pair *toggle, bool default_toggle)
bool remove_button_from_sens_list(Widget button)
Definition: AW_window.cxx:3316
__ATTR__NORETURN void option_type_mismatch(const char *triedType)
AW_VARIABLE_TYPE variable_type
Definition: aw_awar.hxx:102
void unset_at_commands()
Definition: AW_at.cxx:220
void GBK_terminatef(const char *templat,...)
Definition: arb_msg.cxx:523
void update_option_menu()
AW_widget_value_pair * first_choice
void update_toggle_field()
bool AW_IS_IMAGEREF(const char *label)
Definition: aw_localdef.hxx:13
short saved_xoff_for_label
Definition: aw_at.hxx:52
#define short
Definition: ureadseq.h:8
void create_toggle_field(const char *awar_name, AW_label label, AW_orientation orientation=AW_VERTICAL)
AW_widget_value_pair * next
AW_VARIABLE_TYPE
Definition: aw_base.hxx:53
#define RES_LABEL_CONVERT(label)
char * toggle_field_var_name
void increment_at_commands(int width, int height)
Definition: AW_at.cxx:234
#define aw_assert(bed)
Definition: aw_position.hxx:29
bool attach_y
Definition: aw_at.hxx:59
AW_root * root
Definition: aw_window.hxx:272
void assign_to_widget(Widget w)
Definition: aw_xargs.hxx:45
const char * mnemonic
int number_of_option_menus
Definition: aw_root.hxx:112
AW_toggle_field_struct * next
void * _create_option_entry(AW_VARIABLE_TYPE type, const char *name, const char *mnemonic, const char *name_of_color)
void label(const char *label)
Definition: AW_window.cxx:102
void aw_attach_widget(Widget w, AW_at *_at, int default_width)
Definition: AW_button.cxx:186
AW_VARIABLE_TYPE variable_type
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:163
void TuneOrSetBackground(Widget w, const char *color, int modStrength)
Definition: AW_window.cxx:3141
#define INFO_WIDGET
void refresh_toggle_field(int toggle_field_number)
void AW_variable_update_callback(Widget, XtPointer variable_update_struct, XtPointer call_data)
Definition: AW_button.cxx:34
AW_orientation
Definition: aw_window.hxx:51
AW_awar * awar(const char *awar)
Definition: AW_root.cxx:554
AW_active widget_mask
Definition: aw_at.hxx:27
short saved_x
Definition: aw_at.hxx:54
void clear_option_menu(AW_option_menu_struct *oms)
void insert_default_option(AW_label choice_label, const char *mnemonic, const char *var_value, const char *name_of_color=NULp)
#define RES_CONVERT(res_name, res_value)
#define p_global
unsigned long int background_color
Definition: aw_at.hxx:29
AW_window_Motif * p_w
Definition: aw_window.hxx:288
#define IF_ASSERTION_USED(x)
Definition: arb_assert.h:308
long AW_CL
Definition: cb.h:21
__ATTR__NORETURN void type_mismatch(const char *triedType, const char *intoWhat)
void make_sensitive(Widget w, AW_active mask)
Definition: AW_window.cxx:3279
int y_for_next_button
Definition: aw_at.hxx:34
void option_menu_add_option(AW_option_menu_struct *oms, AW_widget_value_pair *os, bool default_option)
AW_option_menu_struct * create_option_menu(const char *awar_name)
void insert_default_toggle(AW_label toggle_label, const char *mnemonic, const char *var_value)
AW_root * get_root()
Definition: aw_window.hxx:359
static void remove_option_from_option_menu(AW_root *aw_root, AW_widget_value_pair *os)
#define NULp
Definition: cxxforward.h:116
char * label_for_inputfield
Definition: aw_at.hxx:31
#define INFO_FORM
#define __ATTR__NORETURN
Definition: attributes.h:56
void AW_label_in_awar_list(AW_window *aww, Widget widget, const char *str)
Definition: AW_window.cxx:2172
#define SPACE_BEHIND_BUTTON
void set_widget(Widget w)
size_t length
bool attach_any
Definition: aw_at.hxx:62
void add(String name, XtArgVal value)
Definition: aw_xargs.hxx:39
bool attach_lx
Definition: aw_at.hxx:60
int number_of_toggle_fields
Definition: aw_root.hxx:111
int correct_for_at_center
Definition: aw_at.hxx:55
struct _WidgetRec * Widget
Definition: aw_base.hxx:48
void tie_widget(AW_CL cd1, Widget widget, AW_widget_type type, AW_window *aww)
Definition: AW_awar.cxx:257
AW_widget_value_pair * default_toggle
const char * label
AW_widget_value_pair * last_choice