2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
25 * $XConsortium: pal_scale.c /main/5 1996/08/08 18:03:06 mustafa $
27 * @(#)pal_scale.c 1.26 11 Aug 1995 cde_app_builder/src/ab
29 * RESTRICTED CONFIDENTIAL INFORMATION:
31 * The information in this document is subject to special
32 * restrictions in a confidential disclosure agreement between
33 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
34 * document outside HP, IBM, Sun, USL, SCO, or Univel without
35 * Sun's specific written approval. This document and all copies
36 * and derivative works thereof must be returned or destroyed at
39 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
45 * pal_scale.c - Implements Palette Scale/Gauge object functionality
49 #include <ab_private/ab.h>
50 #include <ab_private/pal.h>
51 #include <ab_private/prop.h>
52 #include <ab_private/abobj.h>
53 #include <ab_private/abobj_set.h>
54 #include <ab_private/ui_util.h>
58 typedef struct PROP_SCALE_SETTINGS
61 PropFieldSettingRec name;
62 PropRadioSettingRec scale_type;
63 PropGeometrySettingRec geometry;
64 PropRadioSettingRec orient;
65 PropOptionsSettingRec dir;
67 PropOptionsSettingRec label_type;
68 PropOptionsSettingRec label_pos;
69 PropFieldSettingRec label;
70 PropFieldSettingRec min;
71 PropFieldSettingRec max;
72 PropFieldSettingRec incr;
73 PropFieldSettingRec decimal;
74 PropFieldSettingRec ivalue;
75 PropCheckboxSettingRec show_value;
76 PropCheckboxSettingRec init_state;
77 PropColorSettingRec bg_color;
78 PropColorSettingRec fg_color;
80 } PropScaleSettingsRec, *PropScaleSettings;
82 /*************************************************************************
84 ** Private Function Declarations **
86 **************************************************************************/
90 static int scale_initialize(
93 static Widget scale_prop_init(
97 static int scale_prop_activate(
101 static int scale_prop_clear(
104 static int scale_prop_load(
107 unsigned long loadkey
109 static int scale_prop_apply(
112 static BOOL scale_prop_pending(
119 static BOOL verify_props(
122 static void turnoff_changebars(
125 static void setup_direction_setting(
127 AB_ORIENTATION orient
133 static void orientCB(
135 XtPointer clientdata,
136 XmToggleButtonCallbackStruct *state
139 /*************************************************************************
143 **************************************************************************/
144 PalItemInfo scale_palitem_rec = {
146 /* type */ AB_TYPE_SCALE,
148 /* animation pixmaps*/ NULL,
149 /* number of pixmaps*/ 0,
150 /* rev_prop_frame */ NULL,
151 /* fix_prop_dialog */ NULL,
152 /* initialize */ scale_initialize,
153 /* is_a_test */ obj_is_scale,
154 /* prop_initialize */ scale_prop_init,
155 /* prop_active */ scale_prop_activate,
156 /* prop_clear */ scale_prop_clear,
157 /* prop_load */ scale_prop_load,
158 /* prop_apply */ scale_prop_apply,
159 /* prop_pending */ scale_prop_pending
162 PalItemInfo *ab_scale_palitem = &scale_palitem_rec;
163 PropScaleSettingsRec prop_scale_settings_rec[AB_PROP_TYPE_NUM_VALUES];
166 /*************************************************************************
168 ** Function Definitions **
170 **************************************************************************/
176 if (obj_get_read_only(obj) == False)
178 obj_set_unique_name(obj, "scale");
179 obj_set_label(obj, catgets(Dtb_project_catd, 100, 260, "Scale:"));
183 obj_set_unique_name(obj, "gauge");
184 obj_set_label(obj, catgets(Dtb_project_catd, 100, 261, "Gauge:"));
186 obj_set_label_position(obj, AB_CP_NORTH);
188 obj_set_orientation(obj, AB_ORIENT_HORIZONTAL);
189 obj_set_direction(obj, AB_DIR_LEFT_TO_RIGHT);
190 obj_set_min_value(obj, 0);
191 obj_set_max_value(obj, 100);
192 obj_set_initial_value_int(obj, 50);
193 obj_set_increment(obj, 1);
195 obj_set_is_initially_visible(obj, True);
196 obj_set_is_initially_active(obj, True);
198 /* REMIND: Hack to get around Motif XmNtitleString bug (when set to NULL) */
199 obj_set_width(obj, 90);
200 obj_set_height(obj, 18);
202 obj_set_attachment(obj, AB_CP_NORTH, AB_ATTACH_POINT, NULL, obj->y);
203 obj_set_attachment(obj, AB_CP_WEST, AB_ATTACH_POINT, NULL, obj->x);
215 DtbScalePropDialogInfoRec rev_scale_prop_dialog; /* Revolving Props */
216 DtbScalePropDialogInfo cgen = &dtb_scale_prop_dialog; /* Codegen structure */
217 DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog);
218 PropScaleSettingsRec *pss = &(prop_scale_settings_rec[type]);
224 if (type == AB_PROP_REVOLVING)
227 * Only the Attributes ControlPanel needs to be created within
228 * the existing Revolving Prop dialog, so fill out all other
229 * fields with the Revolving Prop dialog equivelents, so the
230 * dtb initialize proc will skip those non-NULL fields...
232 dtbScalePropDialogInfo_clear(&rev_scale_prop_dialog);
234 cgen = &(rev_scale_prop_dialog);
235 cgen->prop_dialog = rpd->prop_dialog;
236 cgen->prop_dialog_shellform = rpd->prop_dialog_shellform;
237 cgen->prop_dialog_panedwin = rpd->prop_dialog_panedwin;
238 cgen->prop_dialog_form = rpd->prop_dialog_form;
239 cgen->objlist_panel = rpd->objlist_panel;
240 cgen->objlist_label = rpd->objlist_label2;
241 cgen->objlist_scrolledwin = rpd->objlist_scrolledwin;
242 cgen->objlist = rpd->objlist;
243 cgen->attrs_ctrlpanel_frame = rpd->attrs_ctrlpanel_frame;
244 cgen->activate_panel = rpd->activate_panel;
245 cgen->apply_button = rpd->apply_button;
246 cgen->ok_button = rpd->ok_button;
247 cgen->cancel_button = rpd->cancel_button;
248 cgen->reset_button = rpd->reset_button;
249 cgen->help_button = rpd->help_button;
252 else /* AB_PROP_FIXED */
253 cgen = &dtb_scale_prop_dialog;
256 if (dtb_scale_prop_dialog_initialize(cgen, parent) == 0)
258 pss->prop_sheet = cgen->attrs_ctrlpanel;
259 pss->current_obj = NULL;
261 if (type == AB_PROP_REVOLVING)
262 XtVaSetValues(parent,
263 XmNuserData, pss->current_obj,
266 /* Dialog/Object List */
267 if (type == AB_PROP_FIXED)
269 prop_fixed_dialog_init(ab_scale_palitem,
270 cgen->prop_dialog_shellform, cgen->objlist);
271 prop_activate_panel_init(type, ab_scale_palitem,
272 cgen->ok_button, cgen->apply_button,
273 cgen->reset_button, cgen->cancel_button,
277 /* Alternate Editor Buttons */
278 prop_editors_panel_init(type, ab_scale_palitem,
279 cgen->attach_button, cgen->conn_button, cgen->helptxt_button);
282 * Prop Sheet Settings....
286 prop_field_init(&(pss->name), cgen->name_field_label,
287 cgen->name_field, cgen->name_cb);
289 /* Label, Type, Position */
291 item[n] = cgen->labeltype_opmenu_items.String_item;
292 item_val[n] = AB_LABEL_STRING; n++;
293 item[n] = cgen->labeltype_opmenu_items.Graphic_item;
294 item_val[n] = AB_LABEL_GLYPH; n++;
295 prop_options_init(&(pss->label_type), cgen->labeltype_opmenu_label,
296 cgen->labeltype_opmenu,
297 cgen->labeltype_opmenu_menu,
298 n, item, (XtPointer*)item_val,
301 prop_field_init(&(pss->label), cgen->label_field_label,
302 cgen->label_field, cgen->label_cb);
304 prop_label_field_init(&(pss->label), cgen->graphic_hint, item, n);
307 item[n] = cgen->labelpos_opmenu_items.Left_item;
308 item_val[n] = AB_CP_WEST; n++;
309 item[n] = cgen->labelpos_opmenu_items.Above_item;
310 item_val[n] = AB_CP_NORTH; n++;
311 prop_options_init(&(pss->label_pos), cgen->labelpos_opmenu_label,
312 cgen->labelpos_opmenu,
313 cgen->labelpos_opmenu_menu,
314 n, item, (XtPointer*)item_val,
319 item[n] = cgen->scaletype_rbox_items.Scale_item;
320 item_val[n] = False; n++;
321 item[n] = cgen->scaletype_rbox_items.Gauge_item;
322 item_val[n] = True; n++;
323 prop_radiobox_init(&(pss->scale_type), cgen->scaletype_rbox_label,
324 cgen->scaletype_rbox, n, item, (XtPointer*)item_val,
328 prop_geomfield_init(&(pss->geometry), cgen->geom_label,
329 cgen->x_field_label, cgen->x_field,
330 cgen->y_field_label, cgen->y_field,
331 cgen->width_field_label, cgen->width_field,
332 cgen->height_field_label, cgen->height_field,
337 item[n] = cgen->orient_rbox_items.Horizontal_item;
338 item_val[n] = AB_ORIENT_HORIZONTAL; n++;
339 item[n] = cgen->orient_rbox_items.Vertical_item;
340 item_val[n] = AB_ORIENT_VERTICAL; n++;
341 prop_radiobox_init(&(pss->orient), cgen->orient_rbox_label,
342 cgen->orient_rbox, n, item, (XtPointer*)item_val,
346 XtAddCallback(item[i], XmNvalueChangedCallback,
347 (XtCallbackProc)orientCB, (XtPointer)type);
351 item[n] = cgen->dir_opmenu_items.Left_to_Right_item;
352 item_val[n] = AB_DIR_LEFT_TO_RIGHT; n++;
353 item[n] = cgen->dir_opmenu_items.Right_to_Left_item;
354 item_val[n] = AB_DIR_RIGHT_TO_LEFT; n++;
355 item[n] = cgen->dir_opmenu_items.Top_to_Bottom_item;
356 item_val[n] = AB_DIR_TOP_TO_BOTTOM; n++;
357 item[n] = cgen->dir_opmenu_items.Bottom_to_Top_item;
358 item_val[n] = AB_DIR_BOTTOM_TO_TOP; n++;
359 prop_options_init(&(pss->dir), cgen->dir_opmenu_label,
360 cgen->dir_opmenu, cgen->dir_opmenu_menu,
361 n, item, (XtPointer*)item_val,
364 for (i=0; i < n; i++)
365 pss->dir_items[i] = item[i];
367 /* Min & Max & Increment */
368 prop_field_init(&(pss->min), cgen->min_field_label,
369 cgen->min_field, cgen->valrange_cb);
370 prop_field_init(&(pss->max), cgen->max_field_label,
371 cgen->max_field, cgen->valrange_cb);
372 prop_field_init(&(pss->incr), cgen->incr_field_label,
373 cgen->incr_field, cgen->valrange_cb);
376 prop_field_init(&(pss->decimal), cgen->decimal_field_label,
377 cgen->decimal_field, cgen->dec_cb);
380 prop_field_init(&(pss->ivalue), cgen->ivalue_field_label,
381 cgen->ivalue_field, cgen->ivalue_cb);
383 item[n] = cgen->showval_ckbox_items.Show_Value_item;
384 item_val[n] = SHOW_VALUE_KEY; n++;
385 prop_checkbox_init(&(pss->show_value), NULL,
386 cgen->showval_ckbox, n, item, item_val,
391 item[n] = cgen->istate_ckbox_items.Visible_item;
392 item_val[n] = AB_STATE_VISIBLE; n++;
393 item[n] = cgen->istate_ckbox_items.Active_item;
394 item_val[n] = AB_STATE_ACTIVE; n++;
395 prop_checkbox_init(&(pss->init_state), cgen->istate_ckbox_label,
396 cgen->istate_ckbox, n, item, item_val,
400 prop_colorfield_init(&(pss->bg_color), cgen->bg_mbutton,
401 cgen->bg_mbutton_bg_mbutton_menu_items.None_item,
402 cgen->bg_mbutton_bg_mbutton_menu_items.Color_Chooser_item,
403 cgen->bg_swatch, cgen->bg_field, cgen->bg_cb);
405 prop_colorfield_init(&(pss->fg_color), cgen->fg_mbutton,
406 cgen->fg_mbutton_fg_mbutton_menu_items.None_item,
407 cgen->fg_mbutton_fg_mbutton_menu_items.Color_Chooser_item,
408 cgen->fg_swatch, cgen->fg_field, cgen->fg_cb);
410 prop_changebars_cleared(pss->prop_sheet);
412 return (cgen->prop_dialog_shellform);
425 ui_set_active(prop_scale_settings_rec[type].prop_sheet, active);
436 PropScaleSettingsRec *pss = &(prop_scale_settings_rec[type]);
438 if (pss->current_obj == NULL)
442 prop_field_set_value(&(pss->name), "", False);
444 /* Clear Label Type/Position */
445 prop_options_set_value(&(pss->label_type), (XtPointer)AB_LABEL_STRING, False);
446 prop_options_set_value(&(pss->label_pos), (XtPointer)AB_CP_WEST, False);
449 ui_set_label_string(pss->label.label, "Label:");
450 prop_field_set_value(&(pss->label), "", False);
452 /* Clear Scale Type*/
453 prop_radiobox_set_value(&(pss->scale_type), (XtPointer)False, False);
455 /* Clear Orientation */
456 prop_radiobox_set_value(&(pss->orient),
457 (XtPointer)AB_ORIENT_HORIZONTAL, False);
459 /* Clear Direction */
460 prop_options_set_value(&(pss->dir), (XtPointer)AB_DIR_LEFT_TO_RIGHT, False);
462 /* Clear Value Range */
463 prop_field_set_value(&(pss->min), "", False);
464 prop_field_set_value(&(pss->max), "", False);
465 prop_field_set_value(&(pss->incr), "", False);
467 /* Clear Decimal Points */
468 prop_field_set_value(&(pss->decimal), "", False);
470 /* Clear Initial Value/Show Value */
471 prop_field_set_value(&(pss->ivalue), "", False);
472 prop_checkbox_set_value(&(pss->show_value), True, False, False);
475 prop_geomfield_clear(&(pss->geometry), GEOM_X);
476 prop_geomfield_clear(&(pss->geometry), GEOM_Y);
477 prop_geomfield_clear(&(pss->geometry), GEOM_WIDTH);
478 prop_geomfield_clear(&(pss->geometry), GEOM_HEIGHT);
480 /* Clear Initial State */
481 prop_checkbox_set_value(&(pss->init_state), AB_STATE_VISIBLE, True, False);
482 prop_checkbox_set_value(&(pss->init_state), AB_STATE_ACTIVE, True, False);
485 prop_colorfield_set_value(&(pss->bg_color), "", False);
486 prop_colorfield_set_value(&(pss->fg_color), "", False);
488 pss->current_obj = NULL;
490 turnoff_changebars(type);
499 unsigned long loadkey
502 PropScaleSettingsRec *pss = &(prop_scale_settings_rec[type]);
503 AB_ORIENTATION orient;
504 BOOL load_all = (loadkey & LoadAll);
508 if (pss->current_obj != NULL)
509 obj = pss->current_obj;
513 else if (!obj_is_scale(obj))
516 pss->current_obj = obj;
519 if (load_all || loadkey & LoadName)
520 prop_field_set_value(&(pss->name), obj_get_name(obj), False);
524 /* Load Label Type/Position */
525 prop_options_set_value(&(pss->label_type), (XtPointer)obj->label_type, False);
526 prop_options_set_value(&(pss->label_pos), (XtPointer)obj_get_label_position(obj), False);
529 prop_setup_label_field(&(pss->label), NULL,
530 obj->label_type, obj_get_label(obj), AB_LINE_UNDEF);
532 /* Load Scale Type */
533 prop_radiobox_set_value(&(pss->scale_type),
534 (XtPointer)obj_get_read_only(obj), False);
536 /* Load Orientation */
537 orient = obj_get_orientation(obj);
538 prop_radiobox_set_value(&(pss->orient), (XtPointer)orient, False);
539 setup_direction_setting(type, orient);
542 prop_options_set_value(&(pss->dir), (XtPointer)obj_get_direction(obj), False);
544 /* Load Value Range */
545 prop_field_set_numeric_value(&(pss->min), obj_get_min_value(obj), False);
546 prop_field_set_numeric_value(&(pss->max), obj_get_max_value(obj), False);
547 prop_field_set_numeric_value(&(pss->incr), obj_get_increment(obj), False);
549 /* Load Decimal Points */
550 prop_field_set_numeric_value(&(pss->decimal),
551 obj_get_decimal_points(obj), False);
553 /* Load Initial Value/Show Value */
554 prop_field_set_numeric_value(&(pss->ivalue),
555 obj_get_initial_value_int(obj), False);
556 prop_checkbox_set_value(&(pss->show_value), SHOW_VALUE_KEY,
557 obj_get_show_value(obj), False);
559 /* Load Initial State */
560 prop_checkbox_set_value(&(pss->init_state), AB_STATE_VISIBLE,
561 obj_is_initially_visible(obj), False);
562 prop_checkbox_set_value(&(pss->init_state), AB_STATE_ACTIVE,
563 obj_is_initially_active(obj), False);
566 prop_colorfield_set_value(&(pss->bg_color), obj_get_bg_color(obj), False);
567 prop_colorfield_set_value(&(pss->fg_color), obj_get_fg_color(obj), False);
569 turnoff_changebars(type);
573 if (load_all || loadkey & LoadPosition)
574 prop_load_obj_position(obj, &(pss->geometry));
576 if (load_all || loadkey & LoadSize)
577 prop_load_obj_size(obj, &(pss->geometry));
587 PropScaleSettingsRec *pss = &(prop_scale_settings_rec[type]);
590 BOOL size_chg = False;
591 BOOL reset_bg = False;
592 BOOL reset_fg = False;
594 if (!verify_props(type))
597 if (prop_changed(pss->name.changebar))
599 value = prop_field_get_value(&(pss->name));
600 abobj_set_name(pss->current_obj, value);
603 if (prop_changed(pss->label.changebar) ||
604 prop_changed(pss->label_type.changebar))
606 value = prop_field_get_value(&(pss->label));
607 abobj_set_label(pss->current_obj,
608 (AB_LABEL_TYPE)prop_options_get_value(&(pss->label_type)),
612 abobj_set_label_position(pss->current_obj,
613 (AB_COMPASS_POINT)prop_options_get_value(&(pss->label_pos)));
616 if (prop_changed(pss->scale_type.changebar))
618 abobj_set_read_only(pss->current_obj,
619 (BOOL)prop_radiobox_get_value(&(pss->scale_type)));
622 if (prop_changed(pss->orient.changebar))
624 abobj_set_orientation(pss->current_obj,
625 (AB_ORIENTATION)prop_radiobox_get_value(&(pss->orient)));
627 if (prop_changed(pss->dir.changebar))
629 abobj_set_direction(pss->current_obj,
630 (AB_DIRECTION)prop_options_get_value(&(pss->dir)));
632 if (prop_changed(pss->min.changebar))
634 abobj_set_min_max_values(pss->current_obj,
635 prop_field_get_numeric_value(&(pss->min)),
636 prop_field_get_numeric_value(&(pss->max)));
637 abobj_set_increment(pss->current_obj,
638 prop_field_get_numeric_value(&(pss->incr)));
640 if (prop_changed(pss->decimal.changebar))
642 abobj_set_decimal_points(pss->current_obj,
643 prop_field_get_numeric_value(&(pss->decimal)));
645 if (prop_changed(pss->ivalue.changebar))
647 abobj_set_initial_value(pss->current_obj, NULL,
648 prop_field_get_numeric_value(&(pss->ivalue)));
649 abobj_set_show_value(pss->current_obj,
650 prop_checkbox_get_value(&(pss->show_value), SHOW_VALUE_KEY));
653 if (prop_changed(pss->geometry.changebar))
655 if (abobj_width_resizable(pss->current_obj))
657 new_w = prop_geomfield_get_value(&(pss->geometry), GEOM_WIDTH);
658 abobj_set_pixel_width(pss->current_obj, new_w, 0);
660 if (abobj_height_resizable(pss->current_obj))
662 new_h = prop_geomfield_get_value(&(pss->geometry), GEOM_HEIGHT);
663 abobj_set_pixel_height(pss->current_obj, new_h, 0);
665 if (abobj_is_movable(pss->current_obj))
666 abobj_set_xy(pss->current_obj,
667 prop_geomfield_get_value(&(pss->geometry), GEOM_X),
668 prop_geomfield_get_value(&(pss->geometry), GEOM_Y));
672 if (prop_changed(pss->init_state.changebar))
674 abobj_set_visible(pss->current_obj,
675 prop_checkbox_get_value(&(pss->init_state), AB_STATE_VISIBLE));
676 abobj_set_active(pss->current_obj,
677 prop_checkbox_get_value(&(pss->init_state), AB_STATE_ACTIVE));
679 if (prop_changed(pss->fg_color.changebar))
681 value = prop_colorfield_get_value(&(pss->fg_color));
682 abobj_set_foreground_color(pss->current_obj, value);
683 if (util_strempty(value))
686 prop_colorfield_set_value(&(pss->fg_color),
687 obj_get_fg_color(pss->current_obj), False);
689 if (prop_changed(pss->bg_color.changebar))
691 value = prop_colorfield_get_value(&(pss->bg_color));
692 abobj_set_background_color(pss->current_obj, value);
693 if (util_strempty(value))
696 prop_colorfield_set_value(&(pss->bg_color),
697 obj_get_bg_color(pss->current_obj), False);
700 abobj_instantiate_changes(pss->current_obj);
702 if (reset_bg || reset_fg) /* Set back to No Color */
703 abobj_reset_colors(pss->current_obj, reset_bg, reset_fg);
705 abobj_force_dang_form_resize(pss->current_obj);
707 turnoff_changebars(type);
717 return(prop_changebars_pending(prop_scale_settings_rec[type].prop_sheet));
725 PropScaleSettingsRec *pss = &(prop_scale_settings_rec[type]);
728 if (prop_changed(pss->name.changebar) &&
729 !prop_name_ok(pss->current_obj, pss->name.field))
732 if ((prop_changed(pss->label_type.changebar) || prop_changed(pss->label.changebar)) &&
733 prop_options_get_value(&(pss->label_type)) == (XtPointer)AB_LABEL_GLYPH &&
734 !prop_graphic_filename_ok(pss->label.field, False))
737 if (!prop_number_ok(pss->min.field, "Min Field", INT_MIN, INT_MAX))
740 min = prop_field_get_numeric_value(&(pss->min));
741 if (!prop_number_ok(pss->max.field, "Max Field", min+1, INT_MAX))
744 max = prop_field_get_numeric_value(&(pss->max));
745 if (!prop_number_ok(pss->incr.field, "Increment Field", 1, max - min))
748 if (prop_changed(pss->ivalue.changebar) &&
749 !prop_number_ok(pss->ivalue.field, "Initial Value Field", min, max))
752 if (prop_changed(pss->decimal.changebar) &&
753 !prop_number_ok(pss->decimal.field, "Decimal Field", 0, 99))
756 if (prop_changed(pss->geometry.changebar) &&
757 (!prop_number_ok(pss->geometry.x_field,(STRING)XFieldStr, -SHRT_MAX, SHRT_MAX) ||
758 !prop_number_ok(pss->geometry.y_field,(STRING)YFieldStr, -SHRT_MAX, SHRT_MAX) ||
759 !prop_number_ok(pss->geometry.h_field,(STRING)HFieldStr, 1, SHRT_MAX) ||
760 !prop_number_ok(pss->geometry.w_field,(STRING)WFieldStr, 1, SHRT_MAX)))
763 if (prop_changed(pss->fg_color.changebar) && !prop_color_ok(pss->fg_color.field))
766 if (prop_changed(pss->bg_color.changebar) && !prop_color_ok(pss->bg_color.field))
777 PropScaleSettingsRec *pss = &(prop_scale_settings_rec[type]);
779 prop_set_changebar(pss->name.changebar, PROP_CB_OFF);
780 prop_set_changebar(pss->scale_type.changebar, PROP_CB_OFF);
781 prop_set_changebar(pss->orient.changebar, PROP_CB_OFF);
782 prop_set_changebar(pss->dir.changebar, PROP_CB_OFF);
783 prop_set_changebar(pss->label_type.changebar, PROP_CB_OFF);
784 prop_set_changebar(pss->label.changebar, PROP_CB_OFF);
785 prop_set_changebar(pss->min.changebar, PROP_CB_OFF);
786 prop_set_changebar(pss->decimal.changebar, PROP_CB_OFF);
787 prop_set_changebar(pss->geometry.changebar, PROP_CB_OFF);
788 prop_set_changebar(pss->ivalue.changebar, PROP_CB_OFF);
789 prop_set_changebar(pss->init_state.changebar, PROP_CB_OFF);
790 prop_set_changebar(pss->bg_color.changebar, PROP_CB_OFF);
791 prop_set_changebar(pss->fg_color.changebar, PROP_CB_OFF);
793 prop_changebars_cleared(pss->prop_sheet);
800 XtPointer clientdata,
801 XmToggleButtonCallbackStruct *state
804 AB_PROP_TYPE type = (AB_PROP_TYPE)clientdata;
805 PropScaleSettingsRec *pss = &(prop_scale_settings_rec[type]);
810 XtVaGetValues(item, XmNuserData, &value, NULL);
811 setup_direction_setting(type, (AB_ORIENTATION)value);
813 if (value == AB_ORIENT_HORIZONTAL)
814 prop_options_set_value(&(pss->dir),
815 (XtPointer)AB_DIR_LEFT_TO_RIGHT, True);
817 prop_options_set_value(&(pss->dir),
818 (XtPointer)AB_DIR_BOTTOM_TO_TOP, True);
823 setup_direction_setting(
825 AB_ORIENTATION orient
828 PropScaleSettingsRec *pss = &(prop_scale_settings_rec[type]);
830 ui_set_active(pss->dir_items[0],
831 orient == AB_ORIENT_HORIZONTAL? True : False);
832 ui_set_active(pss->dir_items[1],
833 orient == AB_ORIENT_HORIZONTAL? True : False);
834 ui_set_active(pss->dir_items[2],
835 orient == AB_ORIENT_VERTICAL? True : False);
836 ui_set_active(pss->dir_items[3],
837 orient == AB_ORIENT_VERTICAL? True : False);