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
24 * $XConsortium: objxm_objects.c /main/6 1996/10/28 16:24:20 mustafa $
26 * @(#)objxm_objects.c 1.117 23 May 1995
28 * RESTRICTED CONFIDENTIAL INFORMATION:
30 * The information in this document is subject to special
31 * restrictions in a confidential disclosure agreement between
32 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
33 * document outside HP, IBM, Sun, USL, SCO, or Univel without
34 * Sun's specific written approval. This document and all copies
35 * and derivative works thereof must be returned or destroyed at
38 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
44 * objxm_objects.c - Implements methods for configuring the Set
45 * of UI Objects into their appropriate
50 #include <Xm/MenuShell.h>
51 #include <Xm/PanedW.h>
52 #include <Xm/ScrolledW.h>
53 #include <Xm/ToggleB.h>
54 #include <Xm/RowColumn.h>
55 #include <Xm/FileSB.h>
58 #include <Dt/ComboBox.h>
59 #include <Dt/TermPrim.h>
61 #include <Dt/SpinBox.h>
62 #include <ab_private/obj.h>
63 #include <ab_private/obj_notify.h>
67 #define SELECT_OBJ_KEY "__selected__"
70 /*************************************************************************
72 ** Private Function Declartions **
74 **************************************************************************/
78 #define check_obj_class_name(obj) \
79 ((obj_get_class_name(obj) != NULL)? \
82 obj_set_class_name(obj, objxm_obj_get_default_motif_class(obj)))
85 * XmConfigure/UnConfigure Methods
87 static int mainwin_xmconfig(
90 static int mainwin_unconfig(
93 static int choice_xmconfig(
96 static int choice_unconfig(
99 static int combo_box_xmconfig(
102 static int combo_box_unconfig(
105 static ABObj combo_box_get_config_obj(
109 static int cpanel_xmconfig(
112 static int cpanel_unconfig(
115 static int custdlg_xmconfig(
118 static int custdlg_unconfig(
121 static int layer_xmconfig(
124 static int layer_unconfig(
127 static int group_xmconfig(
130 static int group_unconfig(
133 static int item_xmconfig(
136 static int list_xmconfig(
139 static int list_unconfig(
142 static int menu_xmconfig(
145 static int menu_unconfig(
148 static int menubar_xmconfig(
151 static int pane_xmconfig(
154 static int pane_unconfig(
157 static int simple_xmconfig(
160 static int simple_unconfig(
163 static int scale_xmconfig(
166 static int scale_unconfig(
169 static int spin_box_xmconfig(
172 static int spin_box_unconfig(
175 static int textf_xmconfig(
178 static int textf_unconfig(
181 static int fchooser_xmconfig(
184 static int box_unconfig(
189 * GetConfigObj Methods
191 static ABObj mainwin_get_config_obj(
195 static ABObj choice_get_config_obj(
199 static ABObj container_get_config_obj(
203 static ABObj custdlg_get_config_obj(
207 static ABObj layer_get_config_obj(
211 static ABObj item_get_config_obj(
215 static ABObj list_get_config_obj(
219 static ABObj menu_get_config_obj(
223 static ABObj pane_get_config_obj(
227 static ABObj separator_get_config_obj(
231 static ABObj spin_box_get_config_obj(
235 static ABObj simple_get_config_obj(
239 static ABObj textf_get_config_obj(
243 static ABObj scale_get_config_obj(
247 static ABObj box_get_config_obj(
251 static ABObj panedwin_get_config_obj(
257 * Resource Setting methods
259 static int mainwin_set_args(
261 OBJXM_CONFIG_TYPE ctype
263 static int simple_set_args(
265 OBJXM_CONFIG_TYPE ctype
267 static int choice_set_args(
269 OBJXM_CONFIG_TYPE ctype
271 static int combo_box_set_args(
273 OBJXM_CONFIG_TYPE ctype
275 static int cpanel_set_args(
277 OBJXM_CONFIG_TYPE ctype
279 static int custdlg_set_args(
281 OBJXM_CONFIG_TYPE ctype
283 static int layer_set_args(
285 OBJXM_CONFIG_TYPE ctype
287 static int group_set_args(
289 OBJXM_CONFIG_TYPE ctype
291 static int item_set_args(
293 OBJXM_CONFIG_TYPE ctype
295 static int drawp_set_args(
297 OBJXM_CONFIG_TYPE ctype
299 static int separator_set_args(
301 OBJXM_CONFIG_TYPE ctype
303 static int spin_box_set_args(
305 OBJXM_CONFIG_TYPE ctype
307 static int termp_set_args(
309 OBJXM_CONFIG_TYPE ctype
311 static int textp_set_args(
313 OBJXM_CONFIG_TYPE ctype
315 static int list_set_args(
317 OBJXM_CONFIG_TYPE ctype
319 static int menu_set_args(
321 OBJXM_CONFIG_TYPE ctype
323 static int menubar_set_args(
325 OBJXM_CONFIG_TYPE ctype
327 static int textf_set_args(
329 OBJXM_CONFIG_TYPE ctype
331 static int scale_set_args(
333 OBJXM_CONFIG_TYPE ctype
335 static int fchooser_set_args(
337 OBJXM_CONFIG_TYPE ctype
341 * Post-Instantiation Methods
343 static int post_set_size(
345 OBJXM_CONFIG_TYPE ctype
347 static int mainwin_post_inst(
349 OBJXM_CONFIG_TYPE ctype
351 static int choice_post_inst(
353 OBJXM_CONFIG_TYPE ctype
355 static int cpanel_post_inst(
357 OBJXM_CONFIG_TYPE ctype
359 static int dialog_post_inst(
361 OBJXM_CONFIG_TYPE ctype
363 static int drawp_post_inst(
365 OBJXM_CONFIG_TYPE ctype
367 static int item_post_inst(
369 OBJXM_CONFIG_TYPE ctype
371 static int list_post_inst(
373 OBJXM_CONFIG_TYPE ctype
375 static int menubar_post_inst(
377 OBJXM_CONFIG_TYPE ctype
379 static int termp_post_inst(
381 OBJXM_CONFIG_TYPE ctype
383 static int fchooser_post_inst(
385 OBJXM_CONFIG_TYPE ctype
387 static void clear_fchooser_fields(
395 static ABObj get_menu_ref(
400 /*************************************************************************
404 **************************************************************************/
406 XmConfigInfoRec button_config_rec = {
407 /* xmconfig */ simple_xmconfig,
408 /* xmunconfig */ simple_unconfig,
409 /* get_config_obj */ simple_get_config_obj,
410 /* set_args */ simple_set_args,
411 /* post_instantiate */ NULL,
412 /* is_a_test */ obj_is_button,
415 XmConfigInfoRec choice_config_rec = {
416 /* xmconfig */ choice_xmconfig,
417 /* xmunconfig */ choice_unconfig,
418 /* get_config_obj */ choice_get_config_obj,
419 /* set_args */ choice_set_args,
420 /* post_instantiate */ choice_post_inst,
421 /* is_a_test */ obj_is_choice,
424 XmConfigInfoRec combo_box_config_rec = {
425 /* xmconfig */ combo_box_xmconfig,
426 /* xmunconfig */ combo_box_unconfig,
427 /* get_config_obj */ combo_box_get_config_obj,
428 /* set_args */ combo_box_set_args,
429 /* post_instantiate */ post_set_size,
430 /* is_a_test */ obj_is_combo_box,
433 XmConfigInfoRec cpanel_config_rec = {
434 /* xmconfig */ cpanel_xmconfig,
435 /* xmunconfig */ cpanel_unconfig,
436 /* get_config_obj */ container_get_config_obj,
437 /* set_args */ cpanel_set_args,
438 /* post_instantiate */ cpanel_post_inst,
439 /* is_a_test */ obj_is_control_panel,
442 XmConfigInfoRec custdlg_config_rec = {
443 /* xmconfig */ custdlg_xmconfig,
444 /* xmunconfig */ custdlg_unconfig,
445 /* get_config_obj */ custdlg_get_config_obj,
446 /* set_args */ custdlg_set_args,
447 /* post_instantiate */ dialog_post_inst,
448 /* is_a_test */ obj_is_popup_win,
451 XmConfigInfoRec layer_config_rec = {
452 /* xmconfig */ layer_xmconfig,
453 /* xmunconfig */ layer_unconfig,
454 /* get_config_obj */ layer_get_config_obj,
455 /* set_args */ layer_set_args,
456 /* post_instantiate */ NULL,
457 /* is_a_test */ obj_is_layers,
460 XmConfigInfoRec group_config_rec = {
461 /* xmconfig */ group_xmconfig,
462 /* xmunconfig */ group_unconfig,
463 /* get_config_obj */ container_get_config_obj,
464 /* set_args */ group_set_args,
465 /* post_instantiate */ NULL,
466 /* is_a_test */ obj_is_group,
469 XmConfigInfoRec drawp_config_rec = {
470 /* xmconfig */ pane_xmconfig,
471 /* xmunconfig */ pane_unconfig,
472 /* get_config_obj */ pane_get_config_obj,
473 /* set_args */ drawp_set_args,
474 /* post_instantiate */ drawp_post_inst,
475 /* is_a_test */ obj_is_drawing_area,
478 XmConfigInfoRec item_config_rec = {
479 /* xmconfig */ item_xmconfig,
480 /* xmunconfig */ simple_unconfig,
481 /* get_config_obj */ item_get_config_obj,
482 /* set_args */ item_set_args,
483 /* post_instantiate */ item_post_inst,
484 /* is_a_test */ obj_is_item,
487 XmConfigInfoRec label_config_rec = {
488 /* xmconfig */ simple_xmconfig,
489 /* xmunconfig */ simple_unconfig,
490 /* get_config_obj */ simple_get_config_obj,
491 /* set_args */ simple_set_args,
492 /* post_instantiate */ NULL,
493 /* is_a_test */ obj_is_label,
496 XmConfigInfoRec list_config_rec = {
497 /* xmconfig */ list_xmconfig,
498 /* xmunconfig */ list_unconfig,
499 /* get_config_obj */ list_get_config_obj,
500 /* set_args */ list_set_args,
501 /* post_instantiate */ list_post_inst,
502 /* is_a_test */ obj_is_list,
505 XmConfigInfoRec mainwin_config_rec = {
506 /* xmconfig */ mainwin_xmconfig,
507 /* xmunconfig */ mainwin_unconfig,
508 /* get_config_obj */ mainwin_get_config_obj,
509 /* set_args */ mainwin_set_args,
510 /* post_instantiate */ mainwin_post_inst,
511 /* is_a_test */ obj_is_base_win,
514 XmConfigInfoRec menu_config_rec = {
515 /* xmconfig */ menu_xmconfig,
516 /* xmunconfig */ menu_unconfig,
517 /* get_config_obj */ menu_get_config_obj,
518 /* set_args */ menu_set_args,
519 /* post_instantiate */ NULL,
520 /* is_a_test */ obj_is_menu,
523 XmConfigInfoRec menubar_config_rec = {
524 /* xmconfig */ menubar_xmconfig,
525 /* xmunconfig */ simple_unconfig,
526 /* get_config_obj */ container_get_config_obj,
527 /* set_args */ menubar_set_args,
528 /* post_instantiate */ menubar_post_inst,
529 /* is_a_test */ obj_is_menubar,
532 XmConfigInfoRec separator_config_rec = {
533 /* xmconfig */ simple_xmconfig,
534 /* xmunconfig */ simple_unconfig,
535 /* get_config_obj */ separator_get_config_obj,
536 /* set_args */ separator_set_args,
537 /* post_instantiate */ NULL,
538 /* is_a_test */ obj_is_separator,
541 XmConfigInfoRec spin_box_config_rec = {
542 /* xmconfig */ spin_box_xmconfig,
543 /* xmunconfig */ spin_box_unconfig,
544 /* get_config_obj */ spin_box_get_config_obj,
545 /* set_args */ spin_box_set_args,
546 /* post_instantiate */ post_set_size,
547 /* is_a_test */ obj_is_spin_box,
550 XmConfigInfoRec termp_config_rec = {
551 /* xmconfig */ pane_xmconfig,
552 /* xmunconfig */ pane_unconfig,
553 /* get_config_obj */ pane_get_config_obj,
554 /* set_args */ termp_set_args,
555 /* post_instantiate */ termp_post_inst,
556 /* is_a_test */ obj_is_term_pane,
559 XmConfigInfoRec textf_config_rec = {
560 /* xmconfig */ textf_xmconfig,
561 /* xmunconfig */ textf_unconfig,
562 /* get_config_obj */ textf_get_config_obj,
563 /* set_args */ textf_set_args,
564 /* post_instantiate */ NULL,
565 /* is_a_test */ obj_is_text_field,
568 XmConfigInfoRec textp_config_rec = {
569 /* xmconfig */ pane_xmconfig,
570 /* xmunconfig */ pane_unconfig,
571 /* get_config_obj */ pane_get_config_obj,
572 /* set_args */ textp_set_args,
573 /* post_instantiate */ NULL,
574 /* is_a_test */ obj_is_text_pane,
577 XmConfigInfoRec scale_config_rec = {
578 /* xmconfig */ scale_xmconfig,
579 /* xmunconfig */ scale_unconfig,
580 /* get_config_obj */ scale_get_config_obj,
581 /* set_args */ scale_set_args,
582 /* post_instantiate */ NULL,
583 /* is_a_test */ obj_is_scale,
586 XmConfigInfoRec file_chooser_config_rec = {
587 /* xmconfig */ fchooser_xmconfig,
588 /* xmunconfig */ box_unconfig,
589 /* get_config_obj */ box_get_config_obj,
590 /* set_args */ fchooser_set_args,
591 /* post_instantiate */ fchooser_post_inst,
592 /* is_a_test */ obj_is_file_chooser,
595 XmConfigInfoRec panedwin_config_rec = {
596 /* xmconfig */ simple_xmconfig,
597 /* xmunconfig */ simple_unconfig,
598 /* get_config_obj */ panedwin_get_config_obj,
600 /* post_instantiate */ NULL,
601 /* is_a_test */ obj_is_paned_win,
605 static BOOL init_done = FALSE;
607 Widget ObjxmP_toplevel = NULL;
608 int ObjxmP_visual_depth = 0;
610 /*************************************************************************
612 ** Function Definitions **
614 **************************************************************************/
617 * Initialize Data & state information for Objxm library.
618 * "toplevel" can be a valid widget ID (when called by AB Front-end)
619 * or NULL (when called from code-generator)
628 ObjxmP_toplevel = toplevel;
629 if (toplevel != NULL)
630 XtVaGetValues(toplevel, XmNdepth, &ObjxmP_visual_depth, NULL);
634 objxm_register_config_info(&mainwin_config_rec);
635 objxm_register_config_info(&button_config_rec);
636 objxm_register_config_info(&choice_config_rec);
637 objxm_register_config_info(&combo_box_config_rec);
638 objxm_register_config_info(&cpanel_config_rec);
639 objxm_register_config_info(&custdlg_config_rec);
640 objxm_register_config_info(&drawp_config_rec);
641 objxm_register_config_info(&group_config_rec);
642 objxm_register_config_info(&item_config_rec);
643 objxm_register_config_info(&label_config_rec);
644 objxm_register_config_info(&layer_config_rec);
645 objxm_register_config_info(&list_config_rec);
646 objxm_register_config_info(&separator_config_rec);
647 objxm_register_config_info(&spin_box_config_rec);
648 objxm_register_config_info(&menu_config_rec);
649 objxm_register_config_info(&menubar_config_rec);
650 objxm_register_config_info(&termp_config_rec);
651 objxm_register_config_info(&textf_config_rec);
652 objxm_register_config_info(&textp_config_rec);
653 objxm_register_config_info(&scale_config_rec);
654 objxm_register_config_info(&file_chooser_config_rec);
655 objxm_register_config_info(&panedwin_config_rec);
657 obj_add_destroy_callback(objxmP_destroy, NULL);
666 * Create the footer-select area for Window Objects:
669 xmconfig_window_select_area(
674 ABObj msgobj, modobj, selobj;
676 /* Create MessageArea SubObj */
677 msgobj = obj_create(AB_TYPE_LABEL, NULL);
678 msgobj->part_of = winobj;
679 obj_append_child(parentobj, msgobj);
680 obj_set_class_name(msgobj, _xmForm);
681 obj_set_flag(msgobj, NoCodeGenFlag);
682 obj_set_unique_name(msgobj,
683 ab_ident_from_name_and_label(obj_get_name(winobj),"status_area"));
685 /* Create StatusArea SubObj inside MessageArea */
686 modobj = obj_create(AB_TYPE_LABEL, NULL);
687 modobj->part_of = winobj;
688 obj_append_child(msgobj, modobj);
689 obj_set_unique_name(modobj,
690 ab_ident_from_name_and_label(obj_get_name(winobj),"module_display"));
691 obj_set_class_name(modobj, _xmLabel);
692 obj_set_attachment(modobj, AB_CP_WEST, AB_ATTACH_GRIDLINE, (void*)0, 0);
693 obj_set_attachment(modobj, AB_CP_EAST, AB_ATTACH_GRIDLINE, (void*)50, 0);
694 obj_set_flag(modobj, NoCodeGenFlag);
696 /* Create Select-Status SubObj inside MessageArea*/
697 selobj = obj_create(AB_TYPE_LABEL, NULL);
698 selobj->part_of = winobj;
699 obj_append_child(msgobj, selobj);
700 obj_set_label(selobj, SELECT_OBJ_KEY); /* Key for identifying */
701 obj_set_unique_name(selobj,
702 ab_ident_from_name_and_label(obj_get_name(winobj),"select_display"));
703 obj_set_class_name(selobj, _xmLabel);
704 obj_set_attachment(selobj, AB_CP_WEST, AB_ATTACH_GRIDLINE, (void*)50, 0);
705 obj_set_attachment(selobj, AB_CP_EAST, AB_ATTACH_GRIDLINE, (void*)100, 0);
706 obj_set_flag(selobj, NoCodeGenFlag);
712 set_window_select_area_args(
716 ABObj modobj, selobj;
719 modobj = objxm_comp_get_subobj(obj, AB_CFG_STATUS_OBJ);
720 selobj = objxm_comp_get_subobj(obj, AB_CFG_SELECT_OBJ);
722 msgobj = obj_get_parent(modobj);
725 objxm_obj_set_ui_arg(msgobj, AB_ARG_INT, XmNpositionIndex, XmLAST_POSITION);
727 /* REMIND: aim - memory leak */
728 /* Module-area Resources */
729 objxm_obj_set_ui_arg(modobj, AB_ARG_XMSTRING, XmNlabelString,
730 XmStringCreateLocalized(obj_get_name(obj_get_module(obj))));
731 objxm_obj_set_ui_arg(modobj, AB_ARG_BOOLEAN, XmNrecomputeSize, FALSE);
732 objxm_obj_set_ui_arg(modobj, AB_ARG_LITERAL, XmNalignment, XmALIGNMENT_BEGINNING);
734 /* Select-area Resources */
735 objxm_obj_set_ui_arg(selobj, AB_ARG_XMSTRING, XmNlabelString,
736 XmStringCreateLocalized(" "));
737 objxm_obj_set_ui_arg(selobj, AB_ARG_BOOLEAN, XmNrecomputeSize, FALSE);
738 objxm_obj_set_ui_arg(selobj, AB_ARG_LITERAL, XmNalignment, XmALIGNMENT_END);
745 make_pane_fixed_height(
753 Dimension pane_hgt = 0;
755 /* If a child is specified, it's height takes preference,
756 * else the "height" parameter is used.
760 if (child->ui_handle != NULL)
761 XtVaGetValues((Widget)child->ui_handle,
768 hgt = (Dimension)height;
770 pane_hgt = (Dimension)(hgt + margin);
772 /* If something goes wrong, at least force the pane to be visible! */
773 objxm_obj_set_ui_arg(paneobj, AB_ARG_INT, XmNpaneMinimum,
774 pane_hgt > 1? pane_hgt : 32);
775 objxm_obj_set_ui_arg(paneobj, AB_ARG_INT, XmNpaneMaximum,
776 pane_hgt > 1? pane_hgt : 32);
778 obj_set_flag(paneobj, AttrChangedFlag);
784 post_inst_window_select_area(
788 ABObj selobj, msgobj;
790 selobj = objxm_comp_get_subobj(obj, AB_CFG_SELECT_OBJ);
791 msgobj = obj_get_parent(selobj);
793 make_pane_fixed_height(msgobj, selobj, 0, 0);
800 ************************************************
801 ************************************************
804 objxm_comp_mainwin_get_area(
806 AB_CONTAINER_TYPE area_type
809 ABObj pwobj, mwobj, child;
813 if (!obj_is_base_win(obj))
816 if (obj_has_flag(obj, XmConfiguredFlag))
818 pwobj = obj_get_child(obj, 0);
819 mwobj = obj_get_child(pwobj, 0);
824 num_children = obj_get_num_children(mwobj);
825 for (i = 0; i < num_children; i++)
827 child = obj_get_child(mwobj, i);
828 if (child->type == AB_TYPE_CONTAINER &&
829 obj_get_subtype(child) == area_type)
840 ABObj project = obj_get_project(obj);
841 ABObj pwobj, mwobj, workobj;
842 ABObj menubar, toolbar, footer;
844 /* ApplicationShell */
846 if (obj_get_root_window(project) == obj)
847 obj_set_class_name(obj, _applicationShell);
849 obj_set_class_name(obj, _topLevelShell);
851 /* Create PanedWindow SubObj (used for BUILD MODE ONLY) */
852 pwobj = obj_create(AB_TYPE_CONTAINER, NULL);
853 pwobj->part_of = obj;
854 obj_set_class_name(pwobj, _xmPanedWindow);
855 obj_set_flag(pwobj, NoCodeGenFlag);
857 /* Create MainWindow SubObj */
858 mwobj = obj_create(AB_TYPE_CONTAINER, NULL);
859 mwobj->part_of = obj;
860 obj_set_class_name(mwobj, _xmMainWindow);
862 /* If Window has a Menubar child, reparent it */
863 menubar = objxm_comp_mainwin_get_area(obj, AB_CONT_MENU_BAR);
866 obj_unparent(menubar);
867 obj_insert_child(mwobj, menubar, 0);
870 /* If Window has a Toolbar child, reparent it */
871 toolbar = objxm_comp_mainwin_get_area(obj, AB_CONT_TOOL_BAR);
874 obj_unparent(toolbar);
875 obj_append_child(mwobj, toolbar);
878 /* Create WorkArea SubObj */
879 workobj = obj_create(AB_TYPE_CONTAINER, NULL);
880 workobj->part_of = obj;
881 obj_append_child(mwobj, workobj);
882 obj_set_class_name(workobj, _xmForm);
884 /* If Window has a Footer child, reparent it */
885 footer = objxm_comp_mainwin_get_area(obj, AB_CONT_FOOTER);
888 obj_unparent(footer);
889 obj_append_child(mwobj, footer);
892 /* Move any remaining children to be parented off WorkObj
893 * BEFORE the ShellObj is parented off obj
895 obj_move_children(workobj, obj);
896 obj_append_child(pwobj, mwobj);
897 obj_append_child(obj, pwobj);
898 obj_set_unique_name(pwobj,
899 ab_ident_from_name_and_label(obj_get_name(obj), "panedwin"));
900 obj_set_unique_name(mwobj,
901 ab_ident_from_name_and_label(obj_get_name(obj), "mainwin"));
902 obj_set_unique_name(workobj,
903 ab_ident_from_name_and_label(obj_get_name(obj), "form"));
905 xmconfig_window_select_area(obj, pwobj);
916 ABObj workobj, pwobj, mwobj;
917 ABObj menubar, toolbar, footer;
919 workobj = objxm_comp_get_subobj(obj, AB_CFG_PARENT_OBJ);
921 pwobj = obj_get_child(obj, 0);
922 mwobj = obj_get_child(pwobj, 0);
924 menubar = objxm_comp_mainwin_get_area(obj, AB_CONT_MENU_BAR);
925 toolbar = objxm_comp_mainwin_get_area(obj, AB_CONT_TOOL_BAR);
926 footer = objxm_comp_mainwin_get_area(obj, AB_CONT_FOOTER);
929 obj_reparent(menubar, obj);
932 obj_reparent(toolbar, obj);
935 obj_reparent(footer, obj);
937 /* Move all other Children to RootObj */
938 obj_move_children(obj, workobj);
940 obj_destroy(pwobj); /* destroys PanedWindow,MainWindow & Message SubObjs */
946 mainwin_get_config_obj(
951 ABObj cfg_obj = NULL;
952 ABObj workobj = NULL;
953 ABObj pwobj, mwobj, msgobj, child;
956 pwobj = obj_get_child(obj, 0);
957 mwobj = obj_get_child(pwobj, 0);
958 msgobj = obj_get_child(pwobj, 1);
962 case AB_CFG_WINDOW_PW_OBJ:
965 case AB_CFG_OBJECT_OBJ:
966 case AB_CFG_POSITION_OBJ:
967 case AB_CFG_LABEL_OBJ:
970 case AB_CFG_STATUS_OBJ:
971 cfg_obj = obj_get_child(msgobj, 0);
973 case AB_CFG_SELECT_OBJ:
974 cfg_obj = obj_get_child(msgobj, 1);
976 case AB_CFG_MENU_PARENT_OBJ:
977 case AB_CFG_WINDOW_MW_OBJ:
978 case AB_CFG_HELP_OBJ:
982 case AB_CFG_SIZE_OBJ:
983 case AB_CFG_PARENT_OBJ:
985 num_children = obj_get_num_children(mwobj);
986 for (i = 0; i < num_children; i++)
988 child = obj_get_child(mwobj, i);
989 if (obj_is_control_panel(child) && child->part_of == obj)
999 case AB_CFG_MENU_OBJ:
1000 case AB_CFG_BORDER_OBJ:
1001 case AB_CFG_SCROLLBAR_OBJ:
1006 util_dprintf(1, "mainwin_get_config_obj: unknown type\n");
1016 OBJXM_CONFIG_TYPE ctype
1020 ABObj module = obj_get_module(obj);
1021 ABObj pwobj = objxm_comp_get_subobj(obj, AB_CFG_WINDOW_PW_OBJ);
1022 ABObj mwobj = objxm_comp_get_subobj(obj, AB_CFG_WINDOW_MW_OBJ);
1023 ABObj shobj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
1024 ABObj workobj = objxm_comp_get_subobj(obj, AB_CFG_PARENT_OBJ);
1027 cgen_args = (ctype == OBJXM_CONFIG_CODEGEN? TRUE : FALSE);
1029 /* Shell Resources */
1030 objxm_comp_set_icon_args(obj, ctype);
1032 if ((label = obj_get_label(obj)) != NULL)
1033 objxm_obj_set_ui_arg(shobj, AB_ARG_STRING, XmNtitle, label);
1035 objxm_obj_set_ui_arg(shobj, AB_ARG_BOOLEAN, XmNallowShellResize, TRUE);
1037 /* PanedWindow Resources */
1038 objxm_obj_set_ui_arg(pwobj, AB_ARG_INT, XmNmarginWidth, 0);
1039 objxm_obj_set_ui_arg(pwobj, AB_ARG_INT, XmNmarginHeight, 0);
1040 objxm_obj_set_ui_arg(pwobj, AB_ARG_INT, XmNspacing, 0);
1041 objxm_obj_set_ui_arg(pwobj, AB_ARG_INT, XmNsashHeight, 1);
1042 objxm_obj_set_ui_arg(pwobj, AB_ARG_INT, XmNsashWidth, 1);
1044 /* MainWindow Resources */
1046 objxm_obj_set_ui_arg(mwobj, AB_ARG_BOOLEAN, XmNallowResize, True);
1048 /* Form WorkArea resources */
1049 objxm_obj_set_literal_ui_arg(workobj, ctype, XmNresizePolicy,
1050 obj_get_width(obj) == -1? XmRESIZE_ANY : XmRESIZE_GROW);
1051 objxm_obj_set_ui_arg(workobj, AB_ARG_INT, XmNmarginWidth, 0);
1052 objxm_obj_set_ui_arg(workobj, AB_ARG_INT, XmNmarginHeight, 0);
1054 /* Set the interface name and select-state on the footer */
1055 if (ctype == OBJXM_CONFIG_BUILD)
1056 set_window_select_area_args(obj);
1063 OBJXM_CONFIG_TYPE ctype
1066 ABObj workobj = objxm_comp_get_subobj(obj, AB_CFG_PARENT_OBJ);
1067 ABObj mwobj = obj_get_parent(workobj);
1069 if (ctype == OBJXM_CONFIG_BUILD)
1071 post_inst_window_select_area(obj);
1073 XtManageChild(objxm_get_widget(workobj));
1074 util_dprintf(3,"MANAGING %s\n", obj_get_name(workobj));
1075 XtVaSetValues(objxm_get_widget(mwobj),
1076 XmNworkWindow, objxm_get_widget(workobj),
1081 objxm_obj_set_widget_ui_arg(mwobj, ctype, XmNworkWindow, workobj);
1082 obj_set_flag(mwobj, AttrChangedFlag);
1088 ************************************************
1089 ** Custom Dialog Methods *
1090 ************************************************
1094 objxm_comp_custdlg_get_area(
1096 AB_CONTAINER_TYPE area_type
1099 ABObj pwobj, bbobj, child;
1103 if (!obj_is_popup_win(obj))
1106 if (obj_has_flag(obj, XmConfiguredFlag))
1108 bbobj = obj_get_child(obj, 0);
1109 pwobj = obj_get_child(bbobj, 0);
1114 num_children = obj_get_num_children(pwobj);
1115 for (i = 0; i < num_children; i++)
1117 child = obj_get_child(pwobj, i);
1118 if (child->type == AB_TYPE_CONTAINER &&
1119 obj_get_subtype(child) == area_type)
1130 ABObj bbobj, pwobj, workobj;
1131 ABObj button_panel, footer;
1137 obj_set_class_name(obj, _xmDialogShell);
1140 bbobj = obj_create(AB_TYPE_CONTAINER, NULL);
1141 bbobj->part_of = obj;
1142 obj_set_class_name(bbobj, _xmForm);
1144 /* Create PanedWindow SubObj */
1145 pwobj = obj_create(AB_TYPE_CONTAINER, NULL);
1146 pwobj->part_of = obj;
1147 obj_set_class_name(pwobj, _xmPanedWindow);
1149 /* Create WorkArea SubObj */
1150 workobj = obj_create(AB_TYPE_CONTAINER, NULL);
1151 workobj->part_of = obj;
1152 obj_append_child(pwobj, workobj);
1153 obj_set_class_name(workobj, _xmForm);
1155 /* Look to see if it has an Button Panel child */
1156 button_panel = objxm_comp_custdlg_get_area(obj, AB_CONT_BUTTON_PANEL);
1157 if (button_panel != NULL)
1158 obj_reparent(button_panel, pwobj);
1160 /* Look to see if it has a footer child */
1161 footer = objxm_comp_custdlg_get_area(obj, AB_CONT_FOOTER);
1163 obj_reparent(footer, pwobj);
1165 /* Move any remaining children to be parented off WorkObj
1166 * BEFORE the ShellObj is parented off obj
1168 obj_move_children(workobj, obj);
1169 obj_append_child(obj, bbobj);
1170 obj_append_child(bbobj, pwobj);
1172 name = obj_get_name(obj);
1174 obj_set_unique_name(bbobj,
1175 ab_ident_from_name_and_label(name, "shellform"));
1176 obj_set_unique_name(pwobj,
1177 ab_ident_from_name_and_label(name, "panedwin"));
1178 obj_set_unique_name(workobj,
1179 ab_ident_from_name_and_label(name, "form"));
1181 /* Make PanedWindow SubObj Fill entire Dialog-Form */
1182 obj_set_attachment(pwobj, AB_CP_WEST, AB_ATTACH_GRIDLINE, (void*)0, 0);
1183 obj_set_attachment(pwobj, AB_CP_EAST, AB_ATTACH_GRIDLINE, (void*)100, 0);
1184 obj_set_attachment(pwobj, AB_CP_NORTH, AB_ATTACH_GRIDLINE, (void*)0, 0);
1185 obj_set_attachment(pwobj, AB_CP_SOUTH, AB_ATTACH_GRIDLINE, (void*)100, 0);
1187 xmconfig_window_select_area(obj, pwobj);
1198 ABObj bbobj, workobj;
1199 ABObj button_panel, footer;
1201 bbobj = objxm_comp_get_subobj(obj, AB_CFG_WINDOW_BB_OBJ);
1202 workobj = objxm_comp_get_subobj(obj, AB_CFG_PARENT_OBJ);
1204 button_panel = objxm_comp_custdlg_get_area(obj, AB_CONT_BUTTON_PANEL);
1205 footer = objxm_comp_custdlg_get_area(obj, AB_CONT_FOOTER);
1207 if (button_panel != NULL)
1208 obj_reparent(button_panel, obj);
1211 obj_reparent(footer, obj);
1213 /* Move all other Children to RootObj */
1214 obj_move_children(obj, workobj);
1223 custdlg_get_config_obj(
1225 AB_CFG_OBJ_TYPE type
1228 ABObj cfg_obj = NULL;
1229 ABObj workobj = NULL;
1230 ABObj modobj = NULL;
1231 ABObj selobj = NULL;
1232 ABObj bbobj, pwobj, msgobj, child;
1233 int i, num_children;
1235 bbobj = obj_get_child(obj, 0);
1236 pwobj = obj_get_child(bbobj, 0);
1240 case AB_CFG_WINDOW_BB_OBJ:
1241 case AB_CFG_HELP_OBJ:
1244 case AB_CFG_WINDOW_PW_OBJ:
1245 case AB_CFG_MENU_PARENT_OBJ:
1248 case AB_CFG_OBJECT_OBJ:
1249 case AB_CFG_POSITION_OBJ:
1250 case AB_CFG_LABEL_OBJ:
1253 case AB_CFG_DND_OBJ:
1254 case AB_CFG_SIZE_OBJ:
1255 case AB_CFG_PARENT_OBJ:
1256 case AB_CFG_STATUS_OBJ:
1257 case AB_CFG_SELECT_OBJ:
1258 num_children = obj_get_num_children(pwobj);
1259 /* Search through immediate children of the Shell-container
1260 * and find the WorkArea & Status SubObjs if they exist
1262 for (i = 0; i < num_children; i++)
1264 child = obj_get_child(pwobj, i);
1265 if (obj_is_control_panel(child) && child->part_of == obj)
1267 else if (obj_is_label(child) && child->part_of == obj)
1270 modobj = obj_get_child(msgobj, 0);
1271 selobj = obj_get_child(msgobj, 1);
1274 if (type == AB_CFG_SELECT_OBJ)
1276 else if (type == AB_CFG_STATUS_OBJ)
1278 else /* PARENT or SIZE */
1279 cfg_obj = (workobj? workobj : pwobj);
1283 case AB_CFG_BORDER_OBJ:
1284 case AB_CFG_MENU_OBJ:
1285 case AB_CFG_SCROLLBAR_OBJ:
1290 util_dprintf(1, "custdlg_get_config_obj: unknown type\n");
1299 OBJXM_CONFIG_TYPE ctype
1303 ABObj shobj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
1304 ABObj bbobj = objxm_comp_get_subobj(obj, AB_CFG_WINDOW_BB_OBJ);
1305 ABObj pwobj = objxm_comp_get_subobj(obj, AB_CFG_WINDOW_PW_OBJ);
1306 ABObj workobj = objxm_comp_get_subobj(obj, AB_CFG_PARENT_OBJ);
1309 cgen_args = (ctype == OBJXM_CONFIG_CODEGEN? TRUE : FALSE);
1311 /* Shell Resources */
1312 if ((label = obj_get_label(obj)) != NULL)
1313 objxm_obj_set_ui_arg(shobj, AB_ARG_STRING, XmNtitle, label);
1314 objxm_obj_set_ui_arg(shobj, AB_ARG_BOOLEAN, XmNallowShellResize, TRUE);
1316 /* BulletinBoard-Dialog Resources */
1317 objxm_obj_set_ui_arg(bbobj, AB_ARG_INT, XmNmarginWidth, 0);
1318 objxm_obj_set_ui_arg(bbobj, AB_ARG_INT, XmNmarginHeight, 0);
1319 objxm_obj_set_ui_arg(bbobj, AB_ARG_BOOLEAN, XmNdefaultPosition, False);
1321 /* Since all windows should be resizable in Build mode, ONLY set
1322 * this resource (to remove resize decorations from the dialog) if
1323 * we are doing Code-generation.
1325 if (cgen_args && !obj_get_resizable(obj))
1326 objxm_obj_set_ui_arg(bbobj, AB_ARG_BOOLEAN, XmNnoResize, True);
1328 /* PanedWindow Resources */
1329 objxm_obj_set_ui_arg(pwobj, AB_ARG_INT, XmNmarginWidth, 0);
1330 objxm_obj_set_ui_arg(pwobj, AB_ARG_INT, XmNmarginHeight, 0);
1331 objxm_obj_set_ui_arg(pwobj, AB_ARG_INT, XmNspacing, 0);
1332 objxm_obj_set_ui_arg(pwobj, AB_ARG_INT, XmNsashHeight, 1);
1333 objxm_obj_set_ui_arg(pwobj, AB_ARG_INT, XmNsashWidth, 1);
1335 /* Form WorkArea resources */
1336 objxm_obj_set_literal_ui_arg(workobj, ctype, XmNresizePolicy,
1337 obj_get_width(obj) == -1? XmRESIZE_ANY : XmRESIZE_GROW);
1338 objxm_obj_set_ui_arg(workobj, AB_ARG_INT, XmNmarginWidth, 0);
1339 objxm_obj_set_ui_arg(workobj, AB_ARG_INT, XmNmarginHeight, 0);
1340 objxm_obj_set_ui_arg(workobj, AB_ARG_BOOLEAN, XmNallowResize, True);
1342 /* Set the interface name and select-state on the footer */
1343 if (ctype == OBJXM_CONFIG_BUILD)
1344 set_window_select_area_args(obj);
1352 OBJXM_CONFIG_TYPE ctype
1356 if (ctype == OBJXM_CONFIG_BUILD)
1357 post_inst_window_select_area(obj);
1359 if (obj_is_popup_win(obj))
1360 objxm_comp_set_default_button_args(obj, ctype);
1367 **********************************************
1368 ** Simple Methods (Button, Label, Item, ...)**
1369 **********************************************
1376 /* Configure Menu-reference if a menu exists for obj */
1377 objxm_comp_config_menu_ref(obj);
1379 obj_set_class_name(obj, objxm_obj_get_default_motif_class(obj));
1389 ABObj mr_obj = NULL;
1391 /* Delete Menu-reference */
1392 objxm_comp_unconfig_menu_ref(obj);
1398 simple_get_config_obj(
1400 AB_CFG_OBJ_TYPE type
1403 ABObj cfg_obj = NULL;
1407 case AB_CFG_OBJECT_OBJ:
1408 case AB_CFG_DND_OBJ:
1409 case AB_CFG_HELP_OBJ:
1410 case AB_CFG_LABEL_OBJ:
1411 case AB_CFG_POSITION_OBJ:
1412 case AB_CFG_SIZE_OBJ:
1413 case AB_CFG_SELECT_OBJ:
1414 case AB_CFG_MENU_PARENT_OBJ:
1418 case AB_CFG_MENU_OBJ:
1419 /* Menu-Refs are the only possible children */
1420 cfg_obj = (obj_get_num_children(obj) > 0)? obj_get_child(obj, 0) : NULL;
1422 case AB_CFG_PARENT_OBJ:
1423 case AB_CFG_SCROLLBAR_OBJ:
1424 case AB_CFG_SCROLLING_OBJ:
1425 case AB_CFG_STATUS_OBJ:
1426 case AB_CFG_BORDER_OBJ:
1429 util_dprintf(1, "simple_get_config_obj: unsupported config-type\n");
1438 OBJXM_CONFIG_TYPE ctype
1443 objxm_comp_set_label_args(obj, ctype);
1444 objxm_comp_set_lbl_align_args(obj, ctype);
1446 lbl_obj = objxm_comp_get_subobj(obj, AB_CFG_LABEL_OBJ);
1447 objxm_obj_set_ui_arg(lbl_obj, AB_ARG_BOOLEAN, XmNrecomputeSize,
1448 obj_get_width(obj) == -1? True : False);
1455 *************************
1456 ** Choice Methods **
1457 *************************
1465 AB_CHOICE_TYPE type;
1466 ABObj ch_obj, p_obj;
1467 ABObj lbl_obj = NULL;
1470 type = obj->info.choice.type;
1471 num_items = obj_get_num_children(obj);
1474 obj_set_class_name(obj, _xmRowColumn);
1476 if (obj_has_label(obj))
1478 /* Create Label SubObj */
1479 lbl_obj = obj_create(AB_TYPE_LABEL, NULL);
1480 lbl_obj->part_of = obj;
1481 obj_set_class_name(lbl_obj, _xmLabel);
1483 /* Create Choice SubObj */
1484 ch_obj = obj_create(AB_TYPE_CHOICE, NULL);
1485 ch_obj->part_of = obj;
1486 obj_set_class_name(ch_obj, _xmRowColumn);
1491 /* If OptionMenu, must build menu hierarchy for items */
1492 if (type == AB_CHOICE_OPTION_MENU)
1494 /* Create Option PulldownMenu SubObj */
1495 /* NOTE: Menu must be FIRST child */
1496 p_obj = obj_create(AB_TYPE_CHOICE, NULL);
1497 p_obj->part_of = obj;
1498 obj_set_class_name(p_obj, _xmPulldownMenu);
1500 else /* AB_CHOICE_EXCLUSIVE || AB_CHOICE_NONEXCLUSIVE */
1504 obj_move_children(p_obj, obj);
1506 if (type == AB_CHOICE_OPTION_MENU)
1508 obj_insert_child(obj, p_obj, 0);
1509 obj_set_unique_name(p_obj,
1510 ab_ident_from_name_and_label(obj_get_name(obj), "menu"));
1513 if (lbl_obj) /* Has Label */
1515 obj_append_child(obj, lbl_obj);
1516 obj_set_unique_name(lbl_obj,
1517 ab_ident_from_name_and_label(obj_get_name(obj), "label"));
1519 obj_append_child(obj, ch_obj);
1520 obj_set_unique_name(ch_obj,
1521 ab_ident_from_name_and_label(obj_get_name(obj), "choice"));
1531 ABObj lbl_obj, ch_obj;
1534 if (obj_get_subtype(obj) == AB_CHOICE_OPTION_MENU)
1535 m_obj = obj_get_child(obj, 0);
1537 if (obj_has_label(obj)) /* Has Label */
1539 lbl_obj = obj_get_child(obj, m_obj? 1 : 0);
1540 ch_obj = obj_get_child(obj, m_obj? 2 : 1);
1542 obj_move_children(obj, m_obj? m_obj : ch_obj);
1544 obj_destroy(lbl_obj);
1545 obj_destroy(ch_obj);
1547 else if (m_obj) /* No Label */
1548 obj_move_children(obj, m_obj);
1558 choice_get_config_obj(
1560 AB_CFG_OBJ_TYPE type
1563 ABObj cfg_obj = NULL;
1564 AB_CHOICE_TYPE choice_type;
1565 BOOL has_label = TRUE;
1567 choice_type = obj->info.choice.type;
1568 if (!obj_has_label(obj))
1573 case AB_CFG_HELP_OBJ:
1577 case AB_CFG_OBJECT_OBJ:
1578 case AB_CFG_SIZE_OBJ:
1580 cfg_obj = obj_get_child(obj, choice_type == AB_CHOICE_OPTION_MENU? 2: 1);
1584 case AB_CFG_PARENT_OBJ:
1585 if (choice_type == AB_CHOICE_OPTION_MENU)
1586 cfg_obj = obj_get_child(obj, 0);
1588 cfg_obj = has_label? obj_get_child(obj, 1) : obj;
1590 case AB_CFG_LABEL_OBJ:
1592 cfg_obj = obj_get_child(obj, choice_type == AB_CHOICE_OPTION_MENU? 1: 0);
1596 case AB_CFG_POSITION_OBJ:
1597 case AB_CFG_SELECT_OBJ:
1598 case AB_CFG_MENU_PARENT_OBJ:
1601 case AB_CFG_DND_OBJ:
1602 case AB_CFG_SCROLLBAR_OBJ:
1603 case AB_CFG_SCROLLING_OBJ:
1604 case AB_CFG_STATUS_OBJ:
1605 case AB_CFG_MENU_OBJ:
1606 case AB_CFG_BORDER_OBJ:
1610 util_dprintf(1, "choice_get_config_obj: unsupported config-type\n");
1620 OBJXM_CONFIG_TYPE ctype
1623 AB_CHOICE_TYPE type;
1624 AB_ORIENTATION orient;
1625 ABObj ch_obj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
1626 ABObj xy_obj = objxm_comp_get_subobj(obj, AB_CFG_POSITION_OBJ);
1627 ABObj lbl_obj = objxm_comp_get_subobj(obj, AB_CFG_LABEL_OBJ);
1629 objxm_comp_set_label_args(obj, ctype);
1630 objxm_comp_set_lbl_pos_args(obj, ctype);
1631 if (lbl_obj) /* Clear margins on RowColumn */
1633 objxm_obj_set_ui_arg(xy_obj, AB_ARG_INT, XmNmarginHeight, 0);
1634 objxm_obj_set_ui_arg(xy_obj, AB_ARG_INT, XmNmarginWidth, 0);
1637 objxm_obj_set_ui_arg(xy_obj, AB_ARG_BOOLEAN, XmNisHomogeneous, FALSE);
1638 objxm_obj_set_literal_ui_arg(xy_obj, ctype, XmNpacking, XmPACK_TIGHT);
1640 if ((type = (AB_CHOICE_TYPE)obj_get_subtype(obj)) != AB_CHOICE_OPTION_MENU)
1642 orient = obj_get_orientation(obj);
1646 case AB_ORIENT_HORIZONTAL:
1647 objxm_obj_set_literal_ui_arg(ch_obj, ctype, XmNorientation, XmHORIZONTAL);
1648 if (obj_get_num_columns(obj) > 1)
1650 objxm_obj_set_literal_ui_arg(xy_obj, ctype, XmNentryVerticalAlignment,
1651 XmALIGNMENT_BASELINE_BOTTOM);
1653 objxm_obj_set_ui_arg(lbl_obj, AB_ARG_INT, XmNmarginHeight, 8);
1656 case AB_ORIENT_VERTICAL:
1657 objxm_obj_set_literal_ui_arg(ch_obj, ctype, XmNorientation,XmVERTICAL);
1658 objxm_obj_set_literal_ui_arg(xy_obj, ctype, XmNentryVerticalAlignment,
1659 XmALIGNMENT_BASELINE_BOTTOM);
1661 objxm_obj_set_ui_arg(lbl_obj, AB_ARG_INT, XmNmarginHeight, 8);
1664 if (obj_get_num_columns(obj) > 1)
1665 objxm_obj_set_literal_ui_arg(ch_obj, ctype, XmNpacking, XmPACK_COLUMN);
1667 objxm_obj_set_literal_ui_arg(ch_obj, ctype, XmNpacking, XmPACK_TIGHT);
1668 objxm_obj_set_literal_ui_arg(ch_obj, ctype, XmNrowColumnType, XmWORK_AREA);
1669 objxm_obj_set_ui_arg(ch_obj, AB_ARG_INT, XmNspacing, 0);
1670 objxm_obj_set_ui_arg(ch_obj, AB_ARG_BOOLEAN, XmNisHomogeneous, TRUE);
1671 objxm_obj_set_ui_arg(ch_obj, AB_ARG_INT, XmNnumColumns, obj_get_num_columns(obj));
1672 objxm_obj_set_ui_arg(ch_obj, AB_ARG_INT, XmNentryClass, xmToggleButtonWidgetClass);
1673 objxm_obj_set_ui_arg(ch_obj, AB_ARG_BOOLEAN, XmNradioBehavior,
1674 type == AB_CHOICE_EXCLUSIVE? TRUE : FALSE);
1676 else /* AB_CHOICE_OPTION_MENU */
1678 ABObj p_obj = objxm_comp_get_subobj(obj, AB_CFG_PARENT_OBJ);
1680 objxm_obj_set_ui_arg(ch_obj, AB_ARG_INT, XmNspacing, 0);
1681 objxm_obj_set_literal_ui_arg(ch_obj, ctype, XmNrowColumnType, XmMENU_OPTION);
1682 objxm_obj_set_literal_ui_arg(p_obj, ctype, XmNrowColumnType, XmMENU_PULLDOWN);
1691 OBJXM_CONFIG_TYPE ctype
1694 /* REMIND: aim - does this do any good?? */
1695 if (ctype == OBJXM_CONFIG_BUILD &&
1696 obj_get_subtype(obj) == AB_CHOICE_OPTION_MENU)
1702 chobj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
1703 widget = objxm_get_widget(chobj);
1705 XtVaGetValues(widget, XmNx, &x, NULL);
1706 XtVaSetValues(widget, XmNx, x-6, NULL);
1713 *******************************
1714 ** ControlPanel Methods **
1715 *******************************
1725 /* Configure for border-frame */
1726 if ((panel_obj = objxm_comp_config_border_frame(obj)) == NULL)
1729 /* Configure for Menu */
1730 objxm_comp_config_menu_ref(obj);
1732 obj_set_class_name(panel_obj, _xmForm);
1743 ABObj mr_obj = NULL;
1745 /* Delete Menu-reference first */
1746 objxm_comp_unconfig_menu_ref(obj);
1748 /* Remove Border Rootobj (collapse) */
1749 objxm_comp_unconfig_border_frame(obj);
1757 OBJXM_CONFIG_TYPE ctype
1760 AB_CONTAINER_TYPE cont_type;
1762 ABObj cp_obj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
1763 ABObj xy_obj = objxm_comp_get_subobj(obj, AB_CFG_POSITION_OBJ);
1765 unsigned char resize_policy = XmRESIZE_GROW;
1767 objxm_comp_set_border_args(obj, ctype);
1769 cont_type = obj_get_container_type(obj);
1773 case AB_CONT_BUTTON_PANEL:
1776 objxm_obj_set_ui_arg(xy_obj, AB_ARG_INT, XmNpositionIndex, 1);
1779 case AB_CONT_FOOTER:
1780 parent = obj_get_root(obj_get_parent(obj));
1781 if (obj_is_popup_win(parent))
1783 if (objxm_comp_custdlg_get_area(parent, AB_CONT_BUTTON_PANEL) != NULL)
1784 objxm_obj_set_ui_arg(xy_obj, AB_ARG_INT, XmNpositionIndex, 2);
1786 objxm_obj_set_ui_arg(xy_obj, AB_ARG_INT, XmNpositionIndex, 1);
1793 objxm_obj_set_ui_arg(cp_obj, AB_ARG_INT, XmNmarginWidth, margin);
1794 objxm_obj_set_ui_arg(cp_obj, AB_ARG_INT, XmNmarginHeight, margin);
1796 objxm_obj_set_literal_ui_arg(cp_obj, ctype, XmNresizePolicy, XmRESIZE_GROW);
1798 /* For standard ControlPane's with Resize Policy of "Fit Contents", we want
1799 * to use XmRESIZE_ANY, all other cases we want to use XmRESIZE_GROW to ensure
1800 * they don't snap to a zero size if they have no children (because there is
1801 * no way to get it back!). Only standard ControlPanes can have a height ==
1804 objxm_obj_set_literal_ui_arg(cp_obj, ctype, XmNresizePolicy,
1805 obj_get_height(obj) == -1? XmRESIZE_ANY : XmRESIZE_GROW);
1807 /* Need to set additional resources if child of panedWindow */
1808 parent = obj_get_parent(obj);
1809 if ((obj_get_type(parent) == AB_TYPE_CONTAINER) &&
1810 (obj_get_container_type(parent) == AB_CONT_PANED))
1812 /* Set PanedWindow Contraint Resources */
1813 objxm_obj_set_ui_arg(xy_obj, AB_ARG_INT, XmNpaneMinimum,
1814 obj_get_pane_min(obj));
1815 objxm_obj_set_ui_arg(xy_obj, AB_ARG_INT, XmNpaneMaximum,
1816 obj_get_pane_max(obj));
1824 OBJXM_CONFIG_TYPE ctype
1827 AB_CONTAINER_TYPE cont_type;
1831 cont_type = obj_get_container_type(obj);
1835 case AB_CONT_FOOTER:
1836 case AB_CONT_BUTTON_PANEL:
1837 if (obj_is_base_win(obj_get_root(obj_get_parent(obj))))
1839 mwobj = obj_get_parent(obj);
1841 if (ctype == OBJXM_CONFIG_BUILD)
1843 /* Area must be Managed before MainWindow resource gets set */
1844 XtManageChild(objxm_get_widget(obj));
1845 util_dprintf(3, "MANAGING %s\n", obj_get_name(obj));
1846 XtVaSetValues(objxm_get_widget(mwobj),
1847 XmNmessageWindow, objxm_get_widget(obj),
1852 objxm_obj_set_widget_ui_arg(mwobj, ctype, XmNmessageWindow, obj);
1853 obj_set_flag(mwobj, AttrChangedFlag);
1858 height = obj_get_height(obj);
1860 /* If a height is specified for the pane, use that value, else
1861 * pass in the object responsible for the size of the pane and
1862 * let the routine query its widget's size.
1864 make_pane_fixed_height(obj, height == -1?
1865 objxm_comp_get_subobj(obj, AB_CFG_SIZE_OBJ) : NULL,
1869 case AB_CONT_TOOL_BAR:
1870 mwobj = obj_get_parent(obj);
1872 /* Attach Toolbar to MainWindow SubObj */
1874 if (ctype == OBJXM_CONFIG_BUILD)
1876 /* Area must be Managed before MainWindow resource gets set */
1877 XtManageChild(objxm_get_widget(obj));
1878 util_dprintf(3, "MANAGING %s\n", obj_get_name(obj));
1879 XtVaSetValues(objxm_get_widget(mwobj),
1880 XmNcommandWindow, objxm_get_widget(obj),
1881 XmNcommandWindowLocation, XmCOMMAND_ABOVE_WORKSPACE,
1886 objxm_obj_set_widget_ui_arg(mwobj, ctype, XmNcommandWindow, obj);
1887 objxm_obj_set_literal_ui_arg(mwobj, ctype, XmNcommandWindowLocation,
1888 XmCOMMAND_ABOVE_WORKSPACE);
1889 obj_set_flag(mwobj, AttrChangedFlag);
1899 ****************************************************
1900 ** Container Methods (ControlPanel & MenuBar) **
1901 ****************************************************
1904 container_get_config_obj(
1906 AB_CFG_OBJ_TYPE type
1909 ABObj cfg_obj = NULL;
1910 ABObj mr_obj = NULL;
1913 mr_obj = get_menu_ref(obj);
1915 if (obj_has_border_frame(obj))
1920 case AB_CFG_HELP_OBJ:
1924 case AB_CFG_POSITION_OBJ:
1925 if (obj_is_layers(obj_get_root(obj_get_parent(obj))))
1926 cfg_obj = obj_get_root(obj_get_parent(obj));
1930 case AB_CFG_DND_OBJ:
1931 case AB_CFG_OBJECT_OBJ:
1932 case AB_CFG_LABEL_OBJ:
1933 case AB_CFG_SELECT_OBJ:
1934 case AB_CFG_SIZE_OBJ:
1935 case AB_CFG_PARENT_OBJ:
1936 case AB_CFG_MENU_PARENT_OBJ:
1937 cfg_obj = (b_obj? obj_get_child(obj, mr_obj? 1 : 0) : obj);
1939 case AB_CFG_BORDER_OBJ:
1942 case AB_CFG_MENU_OBJ:
1945 case AB_CFG_SCROLLBAR_OBJ:
1946 case AB_CFG_SCROLLING_OBJ:
1947 case AB_CFG_STATUS_OBJ:
1951 util_dprintf(1, "container_get_config_obj: unknown type\n");
1959 *******************************
1961 *******************************
1971 obj_set_class_name(obj, _xmForm);
1973 /* Make the first layered-pane the one initially
1974 * visible for editing
1976 for(i=0; i < obj_get_num_salient_children(obj); i++)
1978 pane = obj_get_salient_child(obj, i);
1980 obj_set_flag(pane, VisibleFlag);
1982 obj_clear_flag(pane, VisibleFlag);
1996 layer_get_config_obj(
1998 AB_CFG_OBJ_TYPE type
2005 case AB_CFG_HELP_OBJ:
2006 case AB_CFG_POSITION_OBJ:
2007 case AB_CFG_OBJECT_OBJ:
2008 case AB_CFG_SIZE_OBJ:
2009 case AB_CFG_PARENT_OBJ:
2013 case AB_CFG_DND_OBJ:
2014 case AB_CFG_LABEL_OBJ:
2015 case AB_CFG_SELECT_OBJ:
2016 case AB_CFG_MENU_PARENT_OBJ:
2017 case AB_CFG_BORDER_OBJ:
2018 case AB_CFG_MENU_OBJ:
2019 case AB_CFG_SCROLLBAR_OBJ:
2020 case AB_CFG_SCROLLING_OBJ:
2021 case AB_CFG_STATUS_OBJ:
2026 util_dprintf(1, "layer_get_config_obj: unknown type\n");
2035 OBJXM_CONFIG_TYPE ctype
2039 objxm_obj_set_literal_ui_arg(obj, ctype, XmNresizePolicy, XmRESIZE_ANY);
2045 *******************************
2047 *******************************
2057 /* Configure for border-frame */
2058 if ((panel_obj = objxm_comp_config_border_frame(obj)) == NULL)
2061 obj_set_class_name(panel_obj, _xmForm);
2067 /* Group Unconfig */
2074 ABObj mr_obj = NULL;
2076 /* Delete Menu-reference first */
2077 objxm_comp_unconfig_menu_ref(obj);
2079 /* Remove Border Rootobj (collapse) */
2080 objxm_comp_unconfig_border_frame(obj);
2089 OBJXM_CONFIG_TYPE ctype
2092 ABObj g_obj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
2094 objxm_comp_set_border_args(obj, ctype);
2096 objxm_obj_set_ui_arg(g_obj, AB_ARG_INT, XmNmarginWidth, 0);
2097 objxm_obj_set_ui_arg(g_obj, AB_ARG_INT, XmNmarginHeight, 0);
2098 objxm_obj_set_literal_ui_arg(g_obj, ctype, XmNresizePolicy, XmRESIZE_ANY);
2100 /* REMIND: aim,11/16/93 -do we need to support this row-column stuff? */
2101 if (util_streq(obj_get_class_name(g_obj), _xmRowColumn))
2103 switch (obj->info.container.packing)
2106 objxm_obj_set_literal_ui_arg(g_obj, ctype, XmNpacking, XmPACK_NONE);
2109 objxm_obj_set_literal_ui_arg(g_obj, ctype, XmNpacking, XmPACK_TIGHT);
2112 objxm_obj_set_literal_ui_arg(g_obj, ctype, XmNpacking, XmPACK_COLUMN);
2115 switch (obj->info.container.group_type)
2117 case AB_GROUP_COLUMNS:
2118 objxm_obj_set_literal_ui_arg(g_obj, ctype, XmNorientation, XmVERTICAL);
2121 objxm_obj_set_literal_ui_arg(g_obj, ctype, XmNorientation, XmHORIZONTAL);
2129 *******************************
2131 *******************************
2139 ABObj parentobj = obj_get_root(obj_get_parent(obj));
2141 switch(obj_get_subtype(obj))
2143 case AB_ITEM_FOR_CHOICE:
2144 if (obj_get_subtype(parentobj) == AB_CHOICE_OPTION_MENU)
2145 obj_set_class_name(obj, _xmPushButton);
2147 obj_set_class_name(obj, _xmToggleButton);
2149 case AB_ITEM_FOR_MENU:
2150 obj_set_class_name(obj,
2151 obj_has_menu(obj)? _xmCascadeButton : _xmPushButton);
2153 case AB_ITEM_FOR_MENUBAR:
2154 obj_set_class_name(obj, _xmCascadeButton);
2156 case AB_ITEM_FOR_LIST:
2160 objxm_comp_config_menu_ref(obj);
2166 /* Item Unconfig: simple_unconfig */
2169 item_get_config_obj(
2171 AB_CFG_OBJ_TYPE type
2178 case AB_CFG_HELP_OBJ:
2179 case AB_CFG_OBJECT_OBJ:
2180 case AB_CFG_LABEL_OBJ:
2183 case AB_CFG_MENU_PARENT_OBJ:
2184 cfg_obj = obj_get_parent(obj);
2186 case AB_CFG_POSITION_OBJ:
2187 case AB_CFG_SIZE_OBJ:
2188 case AB_CFG_SELECT_OBJ:
2189 cfg_obj = objxm_comp_get_subobj(obj_get_parent(obj), type);
2191 case AB_CFG_MENU_OBJ:
2192 /* Menu-refs are the only possible children */
2193 cfg_obj = (obj_get_num_children(obj) > 0)? obj_get_child(obj, 0) : NULL;
2195 case AB_CFG_BORDER_OBJ:
2196 case AB_CFG_DND_OBJ:
2197 case AB_CFG_PARENT_OBJ:
2198 case AB_CFG_SCROLLBAR_OBJ:
2199 case AB_CFG_SCROLLING_OBJ:
2200 case AB_CFG_STATUS_OBJ:
2204 util_dprintf(1, "item_get_config_obj: unknown config-type\n");
2213 OBJXM_CONFIG_TYPE ctype
2216 ABObj i_obj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
2217 STRING mnemonic, accel, acceltext;
2219 objxm_comp_set_label_args(obj, ctype);
2221 if (obj_is_choice_item(obj))
2223 ABObj parentobj = obj_get_parent(obj);
2224 ABObj vobj = obj_get_root(parentobj);
2226 if (vobj->info.choice.type == AB_CHOICE_EXCLUSIVE)
2227 objxm_obj_set_literal_ui_arg(i_obj, ctype, XmNindicatorType, XmONE_OF_MANY);
2228 else if (vobj->info.choice.type == AB_CHOICE_NONEXCLUSIVE)
2229 objxm_obj_set_literal_ui_arg(i_obj, ctype, XmNindicatorType, XmN_OF_MANY);
2231 if (vobj->info.choice.type != AB_CHOICE_OPTION_MENU)
2232 objxm_obj_set_ui_arg(i_obj, AB_ARG_BOOLEAN, XmNset,
2233 obj_is_initially_selected(i_obj));
2236 if ((mnemonic = obj_get_mnemonic(obj)) != NULL)
2238 objxm_obj_set_ui_arg(i_obj, AB_ARG_MNEMONIC, XmNmnemonic,
2239 ctype == OBJXM_CONFIG_BUILD? (XtArgVal)XStringToKeysym(mnemonic) :
2240 (XtArgVal)istr_create(mnemonic));
2242 if ((accel = obj_get_accelerator(obj)) != NULL)
2244 acceltext = objxm_accel_to_acceltext(accel);
2246 objxm_obj_set_ui_arg(i_obj, AB_ARG_STRING, XmNaccelerator, accel);
2247 objxm_obj_set_ui_arg(i_obj, AB_ARG_XMSTRING, XmNacceleratorText,
2248 ctype == OBJXM_CONFIG_BUILD? (XtArgVal)XmStringCreateLocalized(acceltext) :
2249 (XtArgVal)istr_create(acceltext));
2258 OBJXM_CONFIG_TYPE ctype
2261 /* Ensure the item's select-state gets set correctly */
2262 if (ctype == OBJXM_CONFIG_BUILD)
2263 objxm_comp_set_item_selection(obj);
2269 **********************************************
2270 ** Pane Methods (TextPane & GraphicPane) **
2271 **********************************************
2281 /* Configure for border-frame and set root_obj
2282 * to Obj directly under Frame
2284 if ((root_obj = objxm_comp_config_border_frame(obj)) == NULL)
2287 if ( obj_has_hscrollbar(obj) || obj_has_vscrollbar(obj) )
2289 /* Configure ScrolledWindow */
2290 root_obj->part_of = obj;
2291 obj_set_class_name(root_obj, _xmScrolledWindow);
2293 /* Pane SubObj is child of ScrolledWindow */
2294 pane_obj = objxmP_create_direct_subobj(root_obj, obj->type, "pane");
2295 pane_obj->part_of = obj;
2297 /* If TermPane, we must create the Vertical scrollbar as a
2298 * child of the ScrolledWindow and hook it up later to the
2301 if (obj_is_term_pane(obj))
2305 sbobj = obj_create(AB_TYPE_TERM_PANE, NULL);
2306 sbobj->part_of = obj;
2307 obj_set_class_name(sbobj, _xmScrollBar);
2308 obj_append_child(root_obj, sbobj);
2309 obj_set_unique_name(sbobj,
2310 ab_ident_from_name_and_label(obj_get_name(obj), "vscrollbar"));
2313 else /* No Scrolling */
2314 pane_obj = root_obj;
2316 if (obj_is_text_pane(obj))
2317 obj_set_class_name(pane_obj, _xmText);
2318 else if (obj_is_term_pane(obj))
2319 obj_set_class_name(pane_obj, _dtTerm);
2321 obj_set_class_name(pane_obj, _xmDrawingArea);
2323 /* Configure Menu-ref if a menu exists */
2324 objxm_comp_config_menu_ref(obj);
2337 /* Destroy Menu-reference if it exists */
2338 objxm_comp_unconfig_menu_ref(obj);
2340 /* Collapse Frame if it exists */
2341 objxm_comp_unconfig_border_frame(obj);
2343 if (obj_has_vscrollbar(obj) || obj_has_hscrollbar(obj) )
2345 pane_obj = obj_get_child(obj, 0);
2347 if (obj_get_num_children(pane_obj) > 0)
2348 obj_move_children(obj, pane_obj);
2350 if (obj_is_term_pane(obj)) /* Destroy Scrollbar SubObj */
2352 ABObj doomedPane = obj_get_child(obj, 1);
2353 obj_destroy(doomedPane);
2356 obj_destroy(pane_obj);
2364 pane_get_config_obj(
2366 AB_CFG_OBJ_TYPE type
2369 ABObj cfg_obj = NULL;
2370 ABObj pane_obj = obj; /* Pane SubObj */
2371 ABObj mr_obj = NULL; /* Menu-ref SubObj */
2372 ABObj sb_obj = NULL; /* Scrollbar SubObj */
2373 ABObj b_obj = NULL; /* Border SubObj */
2375 mr_obj = get_menu_ref(obj);
2377 if (obj_has_border_frame(obj))
2380 if (obj_has_scrollbar(obj))
2382 if (b_obj) /* has border frame */
2383 sb_obj = obj_get_child(b_obj, (mr_obj? 1 : 0));
2388 if (b_obj) /* has border frame */
2390 if (sb_obj) /* has scrolling */
2391 pane_obj = obj_get_child(sb_obj, 0);
2393 pane_obj = obj_get_child(b_obj, (mr_obj? 1 : 0));
2395 else if (sb_obj) /* has no border frame, but has scrolling */
2397 pane_obj = obj_get_child(sb_obj, (mr_obj? 1 : 0));
2399 else /* has no border frame and no scrolling */
2406 case AB_CFG_HELP_OBJ:
2410 case AB_CFG_OBJECT_OBJ:
2411 case AB_CFG_MENU_PARENT_OBJ:
2412 case AB_CFG_SELECT_OBJ:
2415 case AB_CFG_POSITION_OBJ:
2416 if (obj_is_layers(obj_get_root(obj_get_parent(obj))))
2417 cfg_obj = obj_get_root(obj_get_parent(obj));
2421 case AB_CFG_BORDER_OBJ:
2424 case AB_CFG_SIZE_OBJ:
2425 cfg_obj = sb_obj? sb_obj : obj;
2427 case AB_CFG_DND_OBJ:
2428 case AB_CFG_PARENT_OBJ:
2429 if (obj_is_text_pane(obj) ||
2430 obj_is_term_pane(obj))
2435 case AB_CFG_SCROLLBAR_OBJ:
2436 if (obj_is_term_pane(obj) && sb_obj)
2437 cfg_obj = obj_get_child(sb_obj, b_obj? 1:(mr_obj? 2:1));
2439 case AB_CFG_MENU_OBJ:
2442 case AB_CFG_SCROLLING_OBJ:
2445 case AB_CFG_LABEL_OBJ:
2446 case AB_CFG_STATUS_OBJ:
2449 util_dprintf(1, "pane_get_config_obj: unknown type\n");
2458 OBJXM_CONFIG_TYPE ctype
2461 ABObj da_obj = NULL, /* DrawArea SubObj */
2462 sw_obj = NULL, /* ScrolledWin SubObj */
2463 xy_obj = NULL, /* Position SubObj */
2464 parent = NULL; /* ABObj parent NOT config parent */
2466 objxm_comp_set_border_args(obj, ctype);
2468 da_obj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
2469 xy_obj = objxm_comp_get_subobj(obj, AB_CFG_POSITION_OBJ);
2471 if (obj_has_vscrollbar(obj) || obj_has_hscrollbar(obj) )
2473 sw_obj = objxm_comp_get_subobj(obj, AB_CFG_SIZE_OBJ);
2475 objxm_obj_set_literal_ui_arg(sw_obj, ctype, XmNscrollingPolicy, XmAUTOMATIC);
2476 objxm_obj_set_ui_arg(sw_obj, AB_ARG_INT, XmNspacing, 0);
2478 if (obj_get_vscrollbar_policy(obj) == AB_SCROLLBAR_ALWAYS ||
2479 obj_get_hscrollbar_policy(obj) == AB_SCROLLBAR_ALWAYS )
2480 objxm_obj_set_literal_ui_arg(sw_obj, ctype, XmNscrollBarDisplayPolicy, XmSTATIC);
2482 objxm_obj_set_literal_ui_arg(sw_obj, ctype, XmNscrollBarDisplayPolicy, XmAS_NEEDED);
2484 /* This sets the TOTAL width/height of the DrawArea (not necessarily
2485 * the 'visible' portion)
2487 objxm_obj_set_ui_arg(da_obj, AB_ARG_INT, XmNwidth, obj_get_drawarea_width(obj));
2488 objxm_obj_set_ui_arg(da_obj, AB_ARG_INT, XmNheight, obj_get_drawarea_height(obj));
2491 /* Need to set additional resources if child of panedWindow */
2492 parent = obj_get_parent(obj);
2493 if ((obj_get_type(parent) == AB_TYPE_CONTAINER) &&
2494 (obj_get_container_type(parent) == AB_CONT_PANED))
2496 /* Set PanedWindow Contraint Resources */
2497 objxm_obj_set_ui_arg(xy_obj, AB_ARG_INT, XmNpaneMinimum,
2498 obj_get_pane_min(obj));
2499 objxm_obj_set_ui_arg(xy_obj, AB_ARG_INT, XmNpaneMaximum,
2500 obj_get_pane_max(obj));
2508 OBJXM_CONFIG_TYPE ctype
2511 ABObj gp_obj, sw_obj;
2513 if (ctype == OBJXM_CONFIG_BUILD &&
2514 (obj_has_hscrollbar(obj) || obj_has_vscrollbar(obj)))
2516 gp_obj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
2517 sw_obj = objxm_comp_get_subobj(obj, AB_CFG_SCROLLING_OBJ);
2519 XmScrolledWindowSetAreas(objxm_get_widget(sw_obj), NULL, NULL,
2520 objxm_get_widget(gp_obj));
2528 OBJXM_CONFIG_TYPE ctype
2531 ABObj tp_obj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
2532 ABObj xy_obj = objxm_comp_get_subobj(obj, AB_CFG_POSITION_OBJ);
2533 ABObj scrolling_obj = objxm_comp_get_subobj(obj, AB_CFG_SCROLLING_OBJ);
2534 ABObj parent; /* ABObj parent NOT config parent */
2538 objxm_comp_set_border_args(obj, ctype);
2540 if ((value = obj_get_num_rows(obj)) > 0)
2541 objxm_obj_set_ui_arg(tp_obj, AB_ARG_INT, XmNrows, value);
2543 if ((value = obj_get_num_columns(obj)) > 0)
2544 objxm_obj_set_ui_arg(tp_obj, AB_ARG_INT, XmNcolumns, value);
2546 if ((pstr = obj_get_process_string(obj)) != NULL)
2547 objxm_obj_set_ui_arg(tp_obj, AB_ARG_STRING, DtNsubprocessCmd, pstr);
2549 if (obj_has_vscrollbar(obj))
2551 ABObj sb_obj = objxm_comp_get_subobj(obj, AB_CFG_SCROLLBAR_OBJ);
2553 objxm_obj_set_literal_ui_arg(scrolling_obj, ctype, XmNscrollingPolicy, XmAPPLICATION_DEFINED);
2554 objxm_obj_set_literal_ui_arg(scrolling_obj, ctype, XmNvisualPolicy, XmVARIABLE);
2556 if (obj_get_vscrollbar_policy(obj) == AB_SCROLLBAR_ALWAYS)
2557 objxm_obj_set_literal_ui_arg(scrolling_obj, ctype,
2558 XmNscrollBarDisplayPolicy, XmSTATIC);
2560 objxm_obj_set_literal_ui_arg(scrolling_obj, ctype,
2561 XmNscrollBarDisplayPolicy, XmAS_NEEDED);
2563 objxm_obj_set_ui_arg(scrolling_obj, AB_ARG_INT, XmNspacing, 0);
2565 objxm_obj_set_literal_ui_arg(sb_obj, ctype, XmNorientation, XmVERTICAL);
2568 /* Need to set additional resources if child of panedWindow */
2569 parent = obj_get_parent(obj);
2570 if ((obj_get_type(parent) == AB_TYPE_CONTAINER) &&
2571 (obj_get_container_type(parent) == AB_CONT_PANED))
2573 /* Set PanedWindow Contraint Resources */
2574 objxm_obj_set_ui_arg(xy_obj, AB_ARG_INT, XmNpaneMinimum,
2575 obj_get_pane_min(obj));
2576 objxm_obj_set_ui_arg(xy_obj, AB_ARG_INT, XmNpaneMaximum,
2577 obj_get_pane_max(obj));
2580 /* CMVC 3704 - Set the blink rate to 0 to eliminate distractions */
2581 objxm_obj_set_ui_arg(obj, AB_ARG_INT, XmNblinkRate, 0);
2588 OBJXM_CONFIG_TYPE ctype
2591 ABObj paneObj = (ABObj) NULL,
2592 sbObj = (ABObj) NULL;
2594 /* If Scrollable TermPane, hook up vertical scrollbar to Term widget */
2595 if (obj_has_vscrollbar(obj))
2597 sbObj = objxm_comp_get_subobj(obj_get_root(obj), AB_CFG_SCROLLBAR_OBJ);
2598 paneObj = objxm_comp_get_subobj(obj_get_root(obj), AB_CFG_OBJECT_OBJ);
2600 objxm_obj_set_widget_ui_arg(paneObj, ctype, DtNverticalScrollBar, sbObj);
2601 obj_set_flag(obj, AttrChangedFlag);
2610 OBJXM_CONFIG_TYPE ctype
2613 AB_SCROLLBAR_POLICY vsb_policy, hsb_policy;
2614 ABObj tx_obj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
2615 ABObj sz_obj = objxm_comp_get_subobj(obj, AB_CFG_SIZE_OBJ);
2616 ABObj xy_obj = objxm_comp_get_subobj(obj, AB_CFG_POSITION_OBJ);
2618 ABObj parent; /* ABObj parent NOT config parent */
2622 objxm_comp_set_read_only_args(obj, ctype);
2623 objxm_comp_set_border_args(obj, ctype);
2625 if ((value = obj_get_num_rows(obj)) != -1)
2626 objxm_obj_set_ui_arg(tx_obj, AB_ARG_INT, XmNrows, value);
2628 if ((value = obj_get_num_columns(obj)) != -1)
2629 objxm_obj_set_ui_arg(tx_obj, AB_ARG_INT, XmNcolumns, value);
2631 vsb_policy = obj_get_vscrollbar_policy(obj);
2632 hsb_policy = obj_get_hscrollbar_policy(obj);
2634 /* Check vertical scrollbar to determine if scrolling is enabled.
2635 * The presence of a Horizontal scrollbar is then determined based
2636 * on whether word-wrap is set or not.
2638 if (obj_has_vscrollbar(obj))
2640 objxm_obj_set_ui_arg(tx_obj, AB_ARG_BOOLEAN, XmNscrollVertical,
2641 vsb_policy != AB_SCROLLBAR_NEVER);
2642 objxm_obj_set_ui_arg(tx_obj, AB_ARG_BOOLEAN, XmNscrollHorizontal,
2643 hsb_policy != AB_SCROLLBAR_NEVER);
2645 sw_obj = objxm_comp_get_subobj(obj, AB_CFG_SIZE_OBJ);
2647 objxm_obj_set_literal_ui_arg(sw_obj, ctype,
2648 XmNscrollingPolicy, XmAPPLICATION_DEFINED);
2649 objxm_obj_set_literal_ui_arg(sw_obj, ctype,
2650 XmNvisualPolicy, XmVARIABLE);
2651 objxm_obj_set_literal_ui_arg(sw_obj, ctype,
2652 XmNscrollBarDisplayPolicy, XmSTATIC);
2654 objxm_obj_set_literal_ui_arg(sw_obj, ctype,
2655 XmNwidth, obj_get_textpane_height(sw_obj));
2656 objxm_obj_set_literal_ui_arg(sw_obj, ctype,
2657 XmNheight, obj_get_textpane_width(sw_obj));
2660 objxm_obj_set_literal_ui_arg(tx_obj, ctype, XmNeditMode, XmMULTI_LINE_EDIT);
2661 objxm_obj_set_ui_arg(tx_obj, AB_ARG_BOOLEAN, XmNwordWrap, obj->info.text.word_wrap);
2663 if ((strval = obj_get_initial_value_string(obj)) != NULL)
2664 objxm_obj_set_ui_arg(tx_obj, AB_ARG_STRING, XmNvalue, strval);
2665 else /* strval == NULL, make sure the text pane is clean */
2666 if (ctype == OBJXM_CONFIG_BUILD)
2667 objxm_obj_set_ui_arg(tx_obj, AB_ARG_STRING, XmNvalue, Util_empty_string);
2669 /* Need to set additional resources if child of panedWindow */
2670 parent = obj_get_parent(obj);
2671 if ((obj_get_type(parent) == AB_TYPE_CONTAINER) &&
2672 (obj_get_container_type(parent) == AB_CONT_PANED))
2674 /* Set PanedWindow Contraint Resources */
2675 objxm_obj_set_ui_arg(xy_obj, AB_ARG_INT, XmNpaneMinimum,
2676 obj_get_pane_min(obj));
2677 objxm_obj_set_ui_arg(xy_obj, AB_ARG_INT, XmNpaneMaximum,
2678 obj_get_pane_max(obj));
2685 ***********************
2687 ***********************
2694 ABObj sw_obj, l_obj;
2695 ABObj lbl_obj = NULL;
2699 if (obj_has_label(obj)) /* Has Label */
2701 /* Set Container RootObj class */
2702 obj_set_class_name(obj, _xmRowColumn);
2704 /* Create Label SubObj */
2705 lbl_obj = obj_create(AB_TYPE_LABEL, NULL);
2706 lbl_obj->part_of = obj;
2707 obj_set_class_name(lbl_obj, _xmLabel);
2709 /* Create ScrolledWindow SubObj */
2710 sw_obj = obj_create(AB_TYPE_LIST, NULL);
2711 sw_obj->part_of = obj;
2713 else /* No Label: Set Container RootObj class */
2716 obj_set_class_name(sw_obj, _xmScrolledWindow);
2718 /* Create List SubObj */
2719 l_obj = obj_create(AB_TYPE_LIST, NULL);
2720 l_obj->part_of = obj;
2721 obj_set_class_name(l_obj, _xmList);
2723 /* Move Item children to the list SubObj */
2724 obj_move_children(l_obj, obj);
2726 /* Now that Items are moved, parent SubObjs from Root */
2727 if (lbl_obj != NULL)
2729 obj_append_child(obj, lbl_obj);
2730 obj_set_unique_name(lbl_obj,
2731 ab_ident_from_name_and_label(obj_get_name(obj), "label"));
2733 obj_append_child(obj, sw_obj);
2734 obj_set_unique_name(sw_obj,
2735 ab_ident_from_name_and_label(obj_get_name(obj), "scrolledwin"));
2738 obj_append_child(sw_obj, l_obj);
2739 obj_set_unique_name(l_obj,
2740 ab_ident_from_name_and_label(obj_get_name(obj), "list"));
2742 objxm_comp_config_menu_ref(obj);
2753 ABObj lbl_obj = NULL;
2754 ABObj sw_obj = NULL;
2757 objxm_comp_unconfig_menu_ref(obj);
2759 if (obj_has_label(obj))
2761 lbl_obj = obj_get_child(obj, 0);
2762 sw_obj = obj_get_child(obj, 1);
2763 l_obj = obj_get_child(sw_obj, 0);
2766 l_obj = obj_get_child(obj, 0);
2768 /* Move children from ListPane SubObj back to Root */
2769 obj_move_children(obj, l_obj);
2773 obj_destroy(lbl_obj);
2774 obj_destroy(sw_obj); /* destroys sw_obj & l_obj */
2784 list_get_config_obj(
2786 AB_CFG_OBJ_TYPE type
2789 ABObj cfg_obj = NULL;
2791 ABObj lbl_obj = NULL;
2792 ABObj sw_obj = NULL;
2793 ABObj mr_obj = NULL;
2794 BOOL has_label = FALSE;
2796 if (obj_has_label(obj))
2799 /* Check if 1st child is Menu-ref */
2800 mr_obj = get_menu_ref(obj);
2804 lbl_obj = obj_get_child(obj, mr_obj? 1 : 0);
2805 sw_obj = obj_get_child(obj, mr_obj? 2 : 1);
2806 l_obj = obj_get_child(sw_obj, 0);
2811 l_obj = obj_get_child(sw_obj, mr_obj? 1 : 0);
2816 case AB_CFG_HELP_OBJ:
2820 case AB_CFG_OBJECT_OBJ:
2821 case AB_CFG_PARENT_OBJ:
2822 case AB_CFG_MENU_PARENT_OBJ:
2825 case AB_CFG_LABEL_OBJ:
2828 case AB_CFG_POSITION_OBJ:
2829 case AB_CFG_SELECT_OBJ:
2832 case AB_CFG_MENU_OBJ:
2835 case AB_CFG_SCROLLING_OBJ:
2836 case AB_CFG_SIZE_OBJ:
2839 case AB_CFG_DND_OBJ:
2840 case AB_CFG_SCROLLBAR_OBJ:
2841 case AB_CFG_STATUS_OBJ:
2842 case AB_CFG_BORDER_OBJ:
2846 util_dprintf(1, "list_get_config_obj: unknown type\n");
2854 OBJXM_CONFIG_TYPE ctype
2858 ABObj l_obj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
2859 ABObj sz_obj = objxm_comp_get_subobj(obj, AB_CFG_SIZE_OBJ);
2861 objxm_comp_set_label_args(obj, ctype);
2862 objxm_comp_set_lbl_pos_args(obj, ctype);
2864 if ((rows = obj_get_num_rows(obj)) != -1)
2866 objxm_obj_set_ui_arg(l_obj, AB_ARG_INT, XmNvisibleItemCount, rows);
2867 objxm_obj_remove_ui_arg(sz_obj, XmNheight);
2870 objxm_obj_set_selection_arg(l_obj, ctype);
2872 objxm_obj_set_literal_ui_arg(l_obj, ctype, XmNlistSizePolicy,
2873 obj_get_width(obj) == -1? XmVARIABLE : XmCONSTANT);
2874 objxm_obj_set_literal_ui_arg(l_obj, ctype, XmNscrollBarDisplayPolicy,
2877 if (obj->width >= 0 && l_obj != NULL)
2878 objxm_obj_set_ui_arg(l_obj, AB_ARG_INT, XmNwidth, (Dimension)obj->width);
2885 OBJXM_CONFIG_TYPE ctype
2891 /* If list width is fixed size, we must set it after
2892 * the encompassing ScrolledWindow has been instantiated/managed
2894 if (obj_has_label(obj) && obj_get_width(obj) != -1)
2896 szObj = objxm_comp_get_subobj(obj, AB_CFG_SIZE_OBJ);
2897 subObj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
2899 if (ctype == OBJXM_CONFIG_BUILD)
2901 XtManageChild(objxm_get_widget(subObj));
2902 XtManageChild(objxm_get_widget(szObj));
2905 objxm_obj_set_ui_arg(szObj, AB_ARG_INT, XmNwidth,
2906 (Dimension)obj_get_width(obj));
2907 obj_set_flag(szObj, AttrChangedFlag);
2914 ***********************
2916 ***********************
2935 menu_get_config_obj(
2937 AB_CFG_OBJ_TYPE type
2944 case AB_CFG_HELP_OBJ:
2945 case AB_CFG_OBJECT_OBJ:
2946 case AB_CFG_POSITION_OBJ:
2947 case AB_CFG_SIZE_OBJ:
2948 case AB_CFG_SELECT_OBJ:
2949 case AB_CFG_PARENT_OBJ:
2952 case AB_CFG_DND_OBJ:
2953 case AB_CFG_LABEL_OBJ:
2954 case AB_CFG_MENU_PARENT_OBJ:
2955 case AB_CFG_SCROLLBAR_OBJ:
2956 case AB_CFG_SCROLLING_OBJ:
2957 case AB_CFG_STATUS_OBJ:
2958 case AB_CFG_MENU_OBJ:
2959 case AB_CFG_BORDER_OBJ:
2963 util_dprintf(1, "menu_get_config_obj: unknown type\n");
2972 OBJXM_CONFIG_TYPE ctype
2975 ABObj pobj = objxm_comp_get_subobj(obj, AB_CFG_PARENT_OBJ);
2977 objxm_obj_set_literal_ui_arg(pobj, ctype, XmNtearOffModel,
2978 obj_get_tearoff(obj)? XmTEAR_OFF_ENABLED : XmTEAR_OFF_DISABLED);
2985 ***********************
2986 ** MenuBar Methods **
2987 ***********************
2995 /* Set MenuShell RootObj class */
2996 obj_set_class_name(obj, _xmRowColumn);
3002 /* Menubar Unconfig: simple_unconfig */
3007 OBJXM_CONFIG_TYPE ctype
3010 ABObj mb_obj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
3012 objxm_obj_set_literal_ui_arg(mb_obj, ctype, XmNrowColumnType, XmMENU_BAR);
3020 OBJXM_CONFIG_TYPE ctype
3024 ABObj mwobj = obj_get_parent(obj);
3026 /* Attach Menubar to MainWindow SubObj */
3027 if (ctype == OBJXM_CONFIG_BUILD)
3029 /* Area must be Managed before MainWindow resource is set */
3030 XtManageChild(objxm_get_widget(obj));
3031 util_dprintf(3,"MANAGING %s\n", obj_get_name(obj));
3032 XtVaSetValues(objxm_get_widget(mwobj),
3033 XmNmenuBar, objxm_get_widget(obj),
3038 objxm_obj_set_widget_ui_arg(mwobj, ctype, XmNmenuBar, obj);
3039 obj_set_flag(mwobj, AttrChangedFlag);
3042 /* Find "Help" cascade button and set the resource on the menubar */
3043 if ((help_item = obj_get_menubar_help_item(obj)) != NULL)
3045 objxm_obj_set_widget_ui_arg(obj, ctype, XmNmenuHelpWidget, help_item);
3046 obj_set_flag(obj, AttrChangedFlag);
3053 ***********************
3054 ** TextField Methods **
3055 ***********************
3062 objxm_comp_config_labeled_obj(obj, AB_TYPE_TEXT_FIELD, "field", _xmTextField);
3072 objxm_comp_unconfig_menu_ref(obj);
3073 objxm_comp_unconfig_labeled_obj(obj);
3079 textf_get_config_obj(
3081 AB_CFG_OBJ_TYPE type
3085 BOOL has_label = TRUE;
3087 if (!obj_has_label(obj))
3092 case AB_CFG_HELP_OBJ:
3096 case AB_CFG_OBJECT_OBJ:
3097 case AB_CFG_MENU_PARENT_OBJ:
3098 case AB_CFG_SIZE_OBJ:
3100 cfg_obj = obj_get_child(obj, 1);
3104 case AB_CFG_LABEL_OBJ:
3106 cfg_obj = obj_get_child(obj, 0);
3110 case AB_CFG_POSITION_OBJ:
3111 case AB_CFG_SELECT_OBJ:
3114 case AB_CFG_DND_OBJ:
3115 case AB_CFG_PARENT_OBJ:
3116 case AB_CFG_SCROLLING_OBJ:
3117 case AB_CFG_STATUS_OBJ:
3118 case AB_CFG_MENU_OBJ:
3119 case AB_CFG_BORDER_OBJ:
3123 util_dprintf(1, "textf_get_config_obj: unknown config-type\n");
3133 OBJXM_CONFIG_TYPE ctype
3136 ABObj tf_obj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
3137 ABObj sz_obj = objxm_comp_get_subobj(obj, AB_CFG_SIZE_OBJ);
3141 objxm_comp_set_label_args(obj, ctype);
3142 objxm_comp_set_lbl_pos_args(obj, ctype);
3143 objxm_comp_set_read_only_args(obj, ctype);
3145 if ((value = obj_get_num_columns(obj)) > 0)
3147 objxm_obj_set_ui_arg(tf_obj, AB_ARG_INT, XmNcolumns, value);
3148 objxm_obj_remove_ui_arg(sz_obj, XmNwidth);
3150 if ((value = obj_get_max_length(obj)) > 0)
3151 objxm_obj_set_ui_arg(tf_obj, AB_ARG_INT, XmNmaxLength, value);
3153 if ((valstr = obj_get_initial_value_string(obj)) != NULL)
3154 objxm_obj_set_ui_arg(tf_obj, AB_ARG_STRING, XmNvalue, valstr);
3155 else /* valstr == NULL, make sure the text field is clean */
3156 if (ctype == OBJXM_CONFIG_BUILD)
3157 objxm_obj_set_ui_arg(tf_obj, AB_ARG_STRING, XmNvalue, Util_empty_string);
3169 first_child = obj_get_child(obj, 0);
3170 if (first_child && obj_is_menu_ref(first_child))
3184 separator_get_config_obj(
3186 AB_CFG_OBJ_TYPE type
3189 ABObj cfg_obj = NULL;
3193 case AB_CFG_HELP_OBJ:
3197 case AB_CFG_OBJECT_OBJ:
3198 case AB_CFG_POSITION_OBJ:
3199 case AB_CFG_SIZE_OBJ:
3200 case AB_CFG_SCROLLBAR_OBJ:
3201 case AB_CFG_SELECT_OBJ:
3202 case AB_CFG_PARENT_OBJ:
3203 case AB_CFG_BORDER_OBJ:
3207 case AB_CFG_DND_OBJ:
3208 case AB_CFG_LABEL_OBJ:
3209 case AB_CFG_MENU_PARENT_OBJ:
3210 case AB_CFG_MENU_OBJ:
3211 case AB_CFG_SCROLLING_OBJ:
3212 case AB_CFG_STATUS_OBJ:
3216 util_dprintf(1, "simple_get_config_obj: unsupported config-type\n");
3226 OBJXM_CONFIG_TYPE ctype
3231 objxm_comp_set_label_args(obj, ctype);
3232 objxm_comp_set_lbl_pos_args(obj, ctype);
3234 o_obj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
3236 objxm_obj_set_orientation_arg(obj, ctype);
3237 objxm_obj_set_line_style_arg(obj, ctype);
3252 objxm_comp_config_labeled_obj(obj, AB_TYPE_SPIN_BOX, "field", _dtSpinBox);
3262 objxm_comp_unconfig_labeled_obj(obj);
3268 spin_box_get_config_obj(
3270 AB_CFG_OBJ_TYPE type
3273 ABObj cfg_obj = NULL;
3274 BOOL has_label = FALSE;
3276 if (obj_has_label(obj))
3281 case AB_CFG_HELP_OBJ:
3284 case AB_CFG_OBJECT_OBJ:
3285 case AB_CFG_SIZE_OBJ:
3286 case AB_CFG_PARENT_OBJ:
3287 cfg_obj = has_label? obj_get_child(obj, 1) : obj;
3289 case AB_CFG_LABEL_OBJ:
3290 cfg_obj = has_label? obj_get_child(obj, 0) : NULL;
3292 case AB_CFG_POSITION_OBJ:
3293 case AB_CFG_SELECT_OBJ:
3296 case AB_CFG_DND_OBJ:
3297 case AB_CFG_SCROLLING_OBJ:
3298 case AB_CFG_STATUS_OBJ:
3299 case AB_CFG_MENU_OBJ:
3300 case AB_CFG_BORDER_OBJ:
3301 case AB_CFG_MENU_PARENT_OBJ:
3305 util_dprintf(1, "spin_box_get_config_obj: unsupported config-type\n");
3314 OBJXM_CONFIG_TYPE ctype
3321 objxm_comp_set_label_args(obj, ctype);
3322 objxm_comp_set_lbl_pos_args(obj, ctype);
3324 sb_obj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
3327 objxm_obj_set_literal_ui_arg(sb_obj, ctype, DtNspinBoxChildType,
3328 obj_get_text_type(obj) == AB_TEXT_NUMERIC? DtNUMERIC : XmSTRING);
3331 objxm_obj_set_arrow_style_arg(sb_obj, ctype);
3333 if (obj_get_text_type(obj) == AB_TEXT_NUMERIC)
3336 objxm_obj_set_ui_arg(sb_obj, AB_ARG_INT, DtNminimumValue,
3337 obj_get_min_value(obj));
3338 objxm_obj_set_ui_arg(sb_obj, AB_ARG_INT, DtNmaximumValue,
3339 obj_get_max_value(obj));
3342 objxm_obj_set_ui_arg(sb_obj, AB_ARG_INT, DtNposition,
3343 obj_get_initial_value_int(obj));
3345 /* Increment/Decimal Points */
3346 objxm_obj_set_ui_arg(sb_obj, AB_ARG_INT, DtNincrementValue,
3347 obj_get_increment(obj));
3348 objxm_obj_set_ui_arg(sb_obj, AB_ARG_INT, XmNdecimalPoints,
3349 obj_get_decimal_points(obj));
3351 else if (ctype == OBJXM_CONFIG_CODEGEN) /* String List */
3353 /* Set Initially Selected Item - can only do this for generated code
3354 * because in Build mode, the items might not be created yet!
3356 num_items = obj_get_num_items(obj);
3357 for (i = 0; i < num_items; i++)
3358 if (obj_is_initially_selected(obj_get_item(obj, i)))
3360 objxm_obj_set_ui_arg(sb_obj, AB_ARG_INT, DtNposition, i);
3377 objxm_comp_config_labeled_obj(obj, AB_TYPE_COMBO_BOX, "field", _dtComboBox);
3387 objxm_comp_unconfig_labeled_obj(obj);
3393 combo_box_get_config_obj(
3395 AB_CFG_OBJ_TYPE type
3398 ABObj cfg_obj = NULL;
3399 BOOL has_label = FALSE;
3401 if (obj_has_label(obj))
3406 case AB_CFG_HELP_OBJ:
3410 case AB_CFG_OBJECT_OBJ:
3411 case AB_CFG_PARENT_OBJ:
3412 case AB_CFG_SIZE_OBJ:
3413 cfg_obj = has_label? obj_get_child(obj, 1) : obj;
3415 case AB_CFG_LABEL_OBJ:
3416 cfg_obj = has_label? obj_get_child(obj, 0) : NULL;
3418 case AB_CFG_POSITION_OBJ:
3419 case AB_CFG_SELECT_OBJ:
3422 case AB_CFG_DND_OBJ:
3423 case AB_CFG_SCROLLING_OBJ:
3424 case AB_CFG_STATUS_OBJ:
3425 case AB_CFG_MENU_OBJ:
3426 case AB_CFG_BORDER_OBJ:
3427 case AB_CFG_MENU_PARENT_OBJ:
3431 util_dprintf(1, "combo_box_get_config_obj: unsupported config-type\n");
3441 OBJXM_CONFIG_TYPE ctype
3444 objxm_comp_set_label_args(obj, ctype);
3445 objxm_comp_set_lbl_pos_args(obj, ctype);
3446 objxm_comp_set_read_only_args(obj, ctype);
3454 OBJXM_CONFIG_TYPE ctype
3459 szObj = objxm_comp_get_subobj(obj, AB_CFG_SIZE_OBJ);
3461 /* For objects which don't honor size requests at create-time
3462 * (SpinBox, ComboBox), we need to set the size after instantiation...
3464 if (obj_get_width(obj) != -1)
3466 objxm_obj_set_ui_arg(szObj, AB_ARG_INT, XmNwidth, obj_get_width(obj));
3467 obj_set_flag(szObj, AttrChangedFlag);
3469 if (obj_get_height(obj) != -1)
3471 objxm_obj_set_ui_arg(szObj, AB_ARG_INT, XmNheight, obj_get_height(obj));
3472 obj_set_flag(szObj, AttrChangedFlag);
3488 objxm_comp_config_labeled_obj(obj, AB_TYPE_SCALE, "scale", _xmScale);
3498 objxm_comp_unconfig_labeled_obj(obj);
3504 scale_get_config_obj(
3506 AB_CFG_OBJ_TYPE type
3509 ABObj cfg_obj = NULL;
3510 BOOL has_label = FALSE;
3512 if (obj_has_label(obj))
3517 case AB_CFG_HELP_OBJ:
3521 case AB_CFG_OBJECT_OBJ:
3522 case AB_CFG_SIZE_OBJ:
3523 cfg_obj = has_label? obj_get_child(obj, 1) : obj;
3525 case AB_CFG_LABEL_OBJ:
3526 cfg_obj = has_label? obj_get_child(obj, 0) : NULL;
3528 case AB_CFG_POSITION_OBJ:
3529 case AB_CFG_SELECT_OBJ:
3533 case AB_CFG_DND_OBJ:
3534 case AB_CFG_MENU_PARENT_OBJ:
3535 case AB_CFG_PARENT_OBJ:
3536 case AB_CFG_SCROLLING_OBJ:
3537 case AB_CFG_STATUS_OBJ:
3538 case AB_CFG_MENU_OBJ:
3539 case AB_CFG_BORDER_OBJ:
3544 util_dprintf(1, "scale_get_config_obj: unknown config-type\n");
3554 OBJXM_CONFIG_TYPE ctype
3559 objxm_comp_set_label_args(obj, ctype);
3560 objxm_comp_set_lbl_pos_args(obj, ctype);
3561 objxm_comp_set_read_only_args(obj, ctype);
3563 o_obj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
3566 objxm_obj_set_orientation_arg(o_obj, ctype);
3569 objxm_obj_set_direction_arg(o_obj, ctype);
3572 objxm_obj_set_ui_arg(o_obj, AB_ARG_INT, XmNminimum, obj_get_min_value(obj));
3573 objxm_obj_set_ui_arg(o_obj, AB_ARG_INT, XmNmaximum, obj_get_max_value(obj));
3575 /* Increment/Decimal Points */
3576 objxm_obj_set_ui_arg(o_obj, AB_ARG_INT, XmNscaleMultiple,
3577 obj_get_increment(obj));
3578 objxm_obj_set_ui_arg(o_obj, AB_ARG_INT, XmNdecimalPoints,
3579 obj_get_decimal_points(obj));
3581 /* Initial Value/Show Value */
3582 objxm_obj_set_ui_arg(o_obj, AB_ARG_INT, XmNvalue,
3583 obj_get_initial_value_int(obj));
3584 objxm_obj_set_ui_arg(o_obj, AB_ARG_BOOLEAN, XmNshowValue,
3585 obj_get_show_value(obj));
3591 **********************
3592 * File Chooser methods
3593 **********************
3600 ABObj pwobj, workobj;
3605 obj_set_class_name(obj, _xmDialogShell);
3607 /* Create PanedWindow SubObj */
3608 pwobj = obj_create(AB_TYPE_CONTAINER, NULL);
3609 pwobj->part_of = obj;
3610 obj_set_class_name(pwobj, _xmPanedWindow);
3611 obj_set_flag(pwobj, NoCodeGenFlag);
3613 /* Create WorkArea (FileSelectionBox) SubObj. Can't make it
3614 * type AB_TYPE_FILE_CHOOSER because it will be parented off
3615 * of AB_toplevel in xm_instantiate_obj(), which we don't
3618 workobj = obj_create(AB_TYPE_CONTAINER, NULL);
3619 workobj->part_of = obj;
3620 obj_append_child(pwobj, workobj);
3621 obj_set_class_name(workobj, _xmFileSelectionBox);
3623 obj_append_child(obj, pwobj);
3624 obj_set_unique_name(pwobj,
3625 ab_ident_from_name_and_label(obj_get_name(obj), "panedwin"));
3626 obj_set_unique_name(workobj,
3627 ab_ident_from_name_and_label(obj_get_name(obj), "fsb"));
3629 xmconfig_window_select_area(obj, pwobj);
3641 pwobj = obj_get_child(obj, 0);
3650 AB_CFG_OBJ_TYPE type
3653 ABObj cfg_obj = NULL;
3654 ABObj modobj = NULL;
3655 ABObj selobj = NULL;
3656 ABObj pwobj, msgobj, childobj;
3658 pwobj = obj_get_child(obj, 0);
3662 case AB_CFG_WINDOW_PW_OBJ:
3665 case AB_CFG_OBJECT_OBJ:
3667 /* Return the FileSelectionBox child */
3668 cfg_obj = obj_get_child(pwobj, 0);
3671 case AB_CFG_POSITION_OBJ:
3672 case AB_CFG_LABEL_OBJ:
3673 /* Return the shell object (label = title) */
3676 case AB_CFG_SIZE_OBJ:
3677 case AB_CFG_STATUS_OBJ:
3678 case AB_CFG_SELECT_OBJ:
3680 int num_children = 0, i;
3682 if (type == AB_CFG_SIZE_OBJ)
3686 num_children = obj_get_num_children(pwobj);
3687 /* Search through immediate children of the Shell-container
3688 * and find the WorkArea & Status SubObjs if they exist
3690 for (i = 0; i < num_children; i++)
3692 childobj = obj_get_child(pwobj, i);
3693 if (obj_is_label(childobj) && childobj->part_of == obj)
3696 modobj = obj_get_child(msgobj, 0);
3697 selobj = obj_get_child(msgobj, 1);
3700 if (type == AB_CFG_SELECT_OBJ)
3702 else if (type == AB_CFG_STATUS_OBJ)
3709 case AB_CFG_DND_OBJ:
3710 case AB_CFG_HELP_OBJ:
3711 case AB_CFG_MENU_OBJ:
3712 case AB_CFG_BORDER_OBJ:
3713 case AB_CFG_PARENT_OBJ:
3714 case AB_CFG_MENU_PARENT_OBJ:
3719 if (util_get_verbosity() > 0)
3720 fprintf(stderr,"box_get_config_obj: unsupported config-type\n");
3731 OBJXM_CONFIG_TYPE ctype
3734 AB_FILE_TYPE_MASK ftm = AB_FILE_TYPE_MASK_UNDEF;
3735 STRING label = NULL, str = NULL;
3736 ABObj fsb_obj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
3737 ABObj lbl_obj = objxm_comp_get_subobj(obj, AB_CFG_LABEL_OBJ);
3738 ABObj pwobj = objxm_comp_get_subobj(obj, AB_CFG_WINDOW_PW_OBJ);
3742 /* Shell Resources */
3743 if ((label = obj_get_label(obj)) != NULL)
3744 objxm_obj_set_ui_arg(lbl_obj, AB_ARG_STRING, XmNtitle, label);
3745 objxm_obj_set_ui_arg(lbl_obj, AB_ARG_BOOLEAN, XmNallowShellResize, TRUE);
3747 /* PanedWindow Resources */
3748 objxm_obj_set_ui_arg(pwobj, AB_ARG_INT, XmNmarginWidth, 0);
3749 objxm_obj_set_ui_arg(pwobj, AB_ARG_INT, XmNmarginHeight, 0);
3750 objxm_obj_set_ui_arg(pwobj, AB_ARG_INT, XmNspacing, 0);
3751 objxm_obj_set_ui_arg(pwobj, AB_ARG_INT, XmNsashHeight, 1);
3752 objxm_obj_set_ui_arg(pwobj, AB_ARG_INT, XmNsashWidth, 1);
3754 cgen_args = (ctype == OBJXM_CONFIG_CODEGEN? TRUE : FALSE);
3756 /* FileSelectionBox Resources */
3757 str = obj_get_filter_pattern(obj);
3758 if (!util_strempty(str))
3761 valstr = (XtArgVal) istr_create(str);
3763 valstr = (XtArgVal) objxm_str_to_xmstr(ObjxmP_toplevel, str);
3764 objxm_obj_set_ui_arg(fsb_obj, AB_ARG_XMSTRING, XmNpattern, valstr);
3767 str = obj_get_directory(obj);
3768 if (!util_strempty(str))
3771 valstr = (XtArgVal) istr_create(str);
3773 valstr = (XtArgVal) objxm_str_to_xmstr(ObjxmP_toplevel, str);
3774 objxm_obj_set_ui_arg(fsb_obj, AB_ARG_XMSTRING, XmNdirectory, valstr);
3777 str = obj_get_ok_label(obj);
3778 if (!util_strempty(str))
3781 valstr = (XtArgVal) istr_create(str);
3783 valstr = (XtArgVal) objxm_str_to_xmstr(ObjxmP_toplevel, str);
3784 objxm_obj_set_ui_arg(fsb_obj, AB_ARG_XMSTRING, XmNokLabelString, valstr);
3787 objxm_obj_set_ui_arg(fsb_obj, AB_ARG_BOOLEAN,
3788 XmNautoUnmanage, obj_get_auto_dismiss(obj)? TRUE : FALSE);
3790 ftm = obj_get_file_type_mask(obj);
3793 case AB_FILE_REGULAR:
3794 objxm_obj_set_literal_ui_arg(fsb_obj, ctype, XmNfileTypeMask,
3797 case AB_FILE_DIRECTORY:
3798 objxm_obj_set_literal_ui_arg(fsb_obj, ctype, XmNfileTypeMask,
3802 objxm_obj_set_literal_ui_arg(fsb_obj, ctype, XmNfileTypeMask,
3807 /* Set the interface name and select-state on the footer */
3808 if (ctype == OBJXM_CONFIG_BUILD)
3809 set_window_select_area_args(obj);
3817 OBJXM_CONFIG_TYPE ctype
3820 Widget dir_list = NULL,
3823 ABObj fsb_obj = objxm_comp_get_subobj(obj, AB_CFG_OBJECT_OBJ);
3825 if (ctype == OBJXM_CONFIG_BUILD)
3827 post_inst_window_select_area(obj);
3829 fselnbox = objxm_get_widget(fsb_obj);
3830 clear_fchooser_fields(fselnbox);
3832 dir_list = XmFileSelectionBoxGetChild(fselnbox, XmDIALOG_DIR_LIST);
3834 XmListDeleteAllItems(dir_list);
3836 files_list = XmFileSelectionBoxGetChild(fselnbox, XmDIALOG_LIST);
3838 XmListDeleteAllItems(files_list);
3844 clear_fchooser_fields(
3848 WidgetList children = NULL;
3849 Cardinal numChild = (Cardinal) 0;
3852 if (widget == NULL) return;
3854 XtVaGetValues(widget,
3855 XmNnumChildren, &numChild,
3856 XmNchildren, &children,
3859 for (i = 0; i < (int)numChild; i++)
3861 if (XtClass(children[i]) == xmTextFieldWidgetClass)
3863 XmTextFieldSetString(children[i], "");
3865 else if (XtIsComposite(children[i]))
3867 clear_fchooser_fields(children[i]);
3873 **********************
3874 * Paned Window methods
3875 **********************
3878 panedwin_get_config_obj(
3880 AB_CFG_OBJ_TYPE type
3883 ABObj cfg_obj = NULL;
3887 case AB_CFG_OBJECT_OBJ:
3888 case AB_CFG_HELP_OBJ:
3889 case AB_CFG_POSITION_OBJ:
3890 case AB_CFG_SIZE_OBJ:
3891 case AB_CFG_SELECT_OBJ:
3892 case AB_CFG_MENU_PARENT_OBJ:
3893 case AB_CFG_PARENT_OBJ:
3896 case AB_CFG_DND_OBJ:
3897 case AB_CFG_LABEL_OBJ:
3898 case AB_CFG_MENU_OBJ:
3899 case AB_CFG_SCROLLBAR_OBJ:
3900 case AB_CFG_SCROLLING_OBJ:
3901 case AB_CFG_STATUS_OBJ:
3902 case AB_CFG_BORDER_OBJ:
3905 util_dprintf(1, "panedwin_get_config_obj: unsupported config-type\n");