comparison pkg-src/tree-x/intf.c @ 169:15872534500d r20-3b11

Import from CVS: tag r20-3b11
author cvs
date Mon, 13 Aug 2007 09:46:53 +0200
parents 85ec50267440
children 8eaf7971accc
comparison
equal deleted inserted replaced
168:9851d5c6556e 169:15872534500d
103 /* ------------------------------------------------------------------------- */ 103 /* ------------------------------------------------------------------------- */
104 104
105 static Tree *PopupNode; /* node selected for popup */ 105 static Tree *PopupNode; /* node selected for popup */
106 static NodePosition NodePos; 106 static NodePosition NodePos;
107 107
108 static Widget mainWindow;
109 static Widget topForm;
110
111 static Widget statusLabel;
112 static Widget statusText; 108 static Widget statusText;
113 109
114 static Widget scrolledWindow; 110 static Widget scrolledWindow;
115 111
116 static Widget helpShell; 112 static Widget helpShell;
117 static Widget helpForm; 113 static Widget helpForm;
118 static Widget helpScrollWindow;
119 static Widget helpText; 114 static Widget helpText;
120 static Widget helpDoneButton; 115 static Widget helpDoneButton;
121 static Widget helpTitle; 116 static Widget helpTitle;
122 static Widget helpFrame; 117
123
124 static Widget treeMenubar;
125 static Widget treeMenus[NUM_MENUS]; 118 static Widget treeMenus[NUM_MENUS];
126 static Widget treeMenuBtns[NUM_MENUS - 1]; /* don't need button for */ 119 static Widget treeMenuBtns[NUM_MENUS - 1]; /* don't need button for */
127 /* node popup menu */ 120 /* node popup menu */
128 121
129 static Widget treeMenuItems[TREE_MENU_ITEMS]; 122 static Widget treeMenuItems[TREE_MENU_ITEMS];
390 */ 383 */
391 384
392 static void 385 static void
393 BuildPopupMenus(Widget parent) 386 BuildPopupMenus(Widget parent)
394 { 387 {
395 Arg args[2]; 388 Arg al[2];
396 String xstr;
397 389
398 labelStr[STR_NODE_COLLAPSE] = "Collapse Node"; 390 labelStr[STR_NODE_COLLAPSE] = "Collapse Node";
399 labelStr[STR_NODE_EXPAND] = "Expand Node"; 391 labelStr[STR_NODE_EXPAND] = "Expand Node";
400 392
401 treeMenus[NODE_MENU] = XtVaCreatePopupShell("nodeMenu", 393 XtSetArg (al [0], XtNlabel, " ");
402 simpleMenuWidgetClass, 394 treeMenus[NODE_MENU] =
403 parent, 395 XtCreatePopupShell("nodeMenu", simpleMenuWidgetClass, parent, al, 1);
404 XtNlabel, " ", 396
405 NULL); 397 XtCreateManagedWidget("nodeMenuAddChild", smeLineObjectClass,
406 398 treeMenus[NODE_MENU], NULL, 0);
407 (void) XtVaCreateManagedWidget("nodeMenuAddChild", smeLineObjectClass, 399
408 treeMenus[NODE_MENU], 400 XtSetArg (al [0], XtNlabel, "Add Child");
409 NULL);
410
411 nodeMenuItems[NODE_MENU_ADD_CHILD] = 401 nodeMenuItems[NODE_MENU_ADD_CHILD] =
412 XtVaCreateManagedWidget("nodeMenuAddChild", smeBSBObjectClass, 402 XtCreateManagedWidget("nodeMenuAddChild", smeBSBObjectClass,
413 treeMenus[NODE_MENU], 403 treeMenus[NODE_MENU], al, 1);
414 XtNlabel, "Add Child",
415 NULL);
416 XtAddCallback(nodeMenuItems[NODE_MENU_ADD_CHILD], 404 XtAddCallback(nodeMenuItems[NODE_MENU_ADD_CHILD],
417 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_ADD_CHILD); 405 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_ADD_CHILD);
418 406
407 XtSetArg (al [0], XtNlabel, "Add Sibling Before");
419 nodeMenuItems[NODE_MENU_ADD_BEFORE] = 408 nodeMenuItems[NODE_MENU_ADD_BEFORE] =
420 XtVaCreateManagedWidget("nodeMenuAddSiblingBefore", smeBSBObjectClass, 409 XtCreateManagedWidget("nodeMenuAddSiblingBefore", smeBSBObjectClass,
421 treeMenus[NODE_MENU], 410 treeMenus[NODE_MENU], al, 1);
422 XtNlabel, "Add Sibling Before",
423 NULL);
424 XtAddCallback(nodeMenuItems[NODE_MENU_ADD_BEFORE], 411 XtAddCallback(nodeMenuItems[NODE_MENU_ADD_BEFORE],
425 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_ADD_BEFORE); 412 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_ADD_BEFORE);
426 413
427 nodeMenuItems[NODE_MENU_ADD_AFTER] = 414 XtSetArg (al [0], XtNlabel, "Add Sibling After");
428 XtVaCreateManagedWidget("nodeMenuAddSiblingAfter", smeBSBObjectClass, 415 nodeMenuItems[NODE_MENU_ADD_AFTER] =
429 treeMenus[NODE_MENU], 416 XtCreateManagedWidget("nodeMenuAddSiblingAfter", smeBSBObjectClass,
430 XtNlabel, "Add Sibling After", 417 treeMenus[NODE_MENU], al, 1);
431 NULL); 418 XtAddCallback(nodeMenuItems[NODE_MENU_ADD_AFTER],
432 XtAddCallback(nodeMenuItems[NODE_MENU_ADD_AFTER], 419 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_ADD_AFTER);
433 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_ADD_AFTER); 420
434 421 XtSetArg (al [0], XtNlabel, labelStr[STR_NODE_COLLAPSE]);
435 nodeMenuItems[NODE_MENU_ELISION] = 422 nodeMenuItems[NODE_MENU_ELISION] =
436 XtVaCreateManagedWidget("nodeMenuElision", smeBSBObjectClass, 423 XtCreateManagedWidget("nodeMenuElision", smeBSBObjectClass,
437 treeMenus[NODE_MENU], 424 treeMenus[NODE_MENU], al, 1);
438 XtNlabel, labelStr[STR_NODE_COLLAPSE], 425 XtAddCallback(nodeMenuItems[NODE_MENU_ELISION],
439 NULL); 426 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_ELISION);
440 XtAddCallback(nodeMenuItems[NODE_MENU_ELISION], 427
441 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_ELISION); 428
442 429 XtSetArg (al [0], XtNlabel, "Delete Node");
443 430 nodeMenuItems[NODE_MENU_DELETE] =
444 nodeMenuItems[NODE_MENU_DELETE] = 431 XtCreateManagedWidget("nodeMenuDeleteNode", smeBSBObjectClass,
445 XtVaCreateManagedWidget("nodeMenuDeleteNode", smeBSBObjectClass, 432 treeMenus[NODE_MENU], al, 1);
446 treeMenus[NODE_MENU], 433 XtAddCallback(nodeMenuItems[NODE_MENU_DELETE],
447 XtNlabel, "Delete Node", 434 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_DELETE);
448 NULL);
449 XtAddCallback(nodeMenuItems[NODE_MENU_DELETE],
450 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_DELETE);
451
452
453 } 435 }
454 436
455 /* ---------------------------------------------------------------------------- 437 /* ----------------------------------------------------------------------------
456 * 438 *
457 * BuildMenubar() builds the menubar that appears in the main window. 439 * BuildMenubar() builds the menubar that appears in the main window.
461 443
462 444
463 static void 445 static void
464 BuildMenubar(Widget parent) 446 BuildMenubar(Widget parent)
465 { 447 {
466 Arg al[4]; 448 Arg al[4];
467 int i; 449 Widget box;
468 Widget box; 450
469 451 XtSetArg (al [0], XtNshowGrip, FALSE);
470 XtSetArg (al [0], XtNshowGrip, FALSE); 452 XtSetArg (al [1], XtNborderWidth, 0);
471 XtSetArg (al [1], XtNborderWidth, 0); 453 box = XtCreateManagedWidget("menuBox", boxWidgetClass, parent, al, 2);
472 box = XtCreateManagedWidget("menuBox", 454
473 boxWidgetClass, 455 /* menu button widgets */
474 parent, 456 XtSetArg (al [0], XtNmenuName, "treeMenu");
475 al, 2); 457 treeMenuBtns[TREE_MENU] =
476 458 XtCreateManagedWidget("treeMenuBtn", menuButtonWidgetClass, box, al, 1);
477 /* menu button widgets */ 459 XtSetArg (al [0], XtNmenuName, "layoutMenu");
478 XtSetArg (al [0], XtNmenuName, "treeMenu"); 460 treeMenuBtns[LAYOUT_MENU] =
479 treeMenuBtns[TREE_MENU] = 461 XtCreateManagedWidget("layoutMenuBtn", menuButtonWidgetClass, box, al, 1);
480 XtCreateManagedWidget("treeMenuBtn", 462
481 menuButtonWidgetClass, 463 helpBtn = XtCreateManagedWidget("helpBtn", commandWidgetClass, box, NULL, 0);
482 box, al, 1); 464
483 XtSetArg (al [0], XtNmenuName, "layoutMenu"); 465 XtAddCallback(helpBtn, XtNcallback, Help_CB, NULL);
484 treeMenuBtns[LAYOUT_MENU] = 466
485 XtCreateManagedWidget("layoutMenuBtn", 467 /* create pulldown menus */
486 menuButtonWidgetClass, 468
487 box, al, 1); 469 treeMenus[TREE_MENU] =
488 470 XtCreatePopupShell("treeMenu", simpleMenuWidgetClass,
489 helpBtn = XtCreateManagedWidget("helpBtn", 471 treeMenuBtns[TREE_MENU], NULL, 0);
490 commandWidgetClass, 472
491 box, NULL, 0); 473 treeMenus[LAYOUT_MENU] =
492 474 XtCreatePopupShell("layoutMenu", simpleMenuWidgetClass,
493 XtAddCallback(helpBtn, XtNcallback, Help_CB, NULL); 475 treeMenuBtns[LAYOUT_MENU], NULL, 0);
494 476
495 /* create pulldown menus */ 477
496 478 /* adding menu entries */
497 treeMenus[TREE_MENU] = XtCreatePopupShell("treeMenu", 479
498 simpleMenuWidgetClass, 480 /* Tree menu */
499 treeMenuBtns[TREE_MENU], 481
500 NULL, 0); 482 treeMenuItems[TREE_MENU_NEW] =
501 483 XtCreateManagedWidget("treeMenuNew", smeBSBObjectClass,
502 treeMenus[LAYOUT_MENU] = XtCreatePopupShell("layoutMenu", 484 treeMenus[TREE_MENU], NULL, 0);
503 simpleMenuWidgetClass, 485 XtAddCallback(treeMenuItems[TREE_MENU_NEW],
504 treeMenuBtns[LAYOUT_MENU], 486 XtNcallback, TreeMenu_CB, TREE_MENU_NEW);
505 NULL, 0); 487
506 488 treeMenuItems[TREE_MENU_LOAD] =
507 489 XtCreateManagedWidget("treeMenuLoad", smeBSBObjectClass,
508 /* adding menu entries */ 490 treeMenus[TREE_MENU], NULL, 0);
509 491 XtAddCallback(treeMenuItems[TREE_MENU_LOAD],
510 /* Tree menu */ 492 XtNcallback, TreeMenu_CB, (XtPointer) TREE_MENU_LOAD);
511 493
512 treeMenuItems[TREE_MENU_NEW] = 494 treeMenuItems[TREE_MENU_SAVE] =
513 XtCreateManagedWidget("treeMenuNew", smeBSBObjectClass, 495 XtCreateManagedWidget("treeMenuSave", smeBSBObjectClass,
514 treeMenus[TREE_MENU], NULL, 0); 496 treeMenus[TREE_MENU], NULL, 0);
515 XtAddCallback(treeMenuItems[TREE_MENU_NEW], 497 XtAddCallback(treeMenuItems[TREE_MENU_SAVE],
516 XtNcallback, TreeMenu_CB, TREE_MENU_NEW); 498 XtNcallback, TreeMenu_CB, (XtPointer) TREE_MENU_SAVE);
517 499
518 treeMenuItems[TREE_MENU_LOAD] = 500 treeMenuItems[TREE_MENU_SEP1] =
519 XtVaCreateManagedWidget("treeMenuLoad", smeBSBObjectClass, 501 XtCreateManagedWidget("treeMenuSep1", smeLineObjectClass,
520 treeMenus[TREE_MENU], 502 treeMenus[TREE_MENU], NULL, 0);
521 NULL);
522 XtAddCallback(treeMenuItems[TREE_MENU_LOAD],
523 XtNcallback, TreeMenu_CB, (XtPointer) TREE_MENU_LOAD);
524
525 treeMenuItems[TREE_MENU_SAVE] =
526 XtVaCreateManagedWidget("treeMenuSave", smeBSBObjectClass,
527 treeMenus[TREE_MENU],
528 NULL);
529 XtAddCallback(treeMenuItems[TREE_MENU_SAVE],
530 XtNcallback, TreeMenu_CB, (XtPointer) TREE_MENU_SAVE);
531
532 treeMenuItems[TREE_MENU_SEP1] =
533 XtVaCreateManagedWidget("treeMenuSep1", smeLineObjectClass,
534 treeMenus[TREE_MENU],
535 NULL);
536 503
537 #ifdef COMMENT 504 #ifdef COMMENT
538 treeMenuItems[TREE_MENU_STATS] = 505 XtSetArg (al [0], XtNlabel, labelStr[STR_SHOW_STATS]);
539 XtVaCreateManagedWidget("treeMenuStats", smeBSBObjectClass, 506 treeMenuItems[TREE_MENU_STATS] =
540 treeMenus[TREE_MENU], 507 XtCreateManagedWidget("treeMenuStats", smeBSBObjectClass,
541 XtNlabel, labelStr[STR_SHOW_STATS], 508 treeMenus[TREE_MENU], al, 1);
542 NULL); 509 XtAddCallback(treeMenuItems[TREE_MENU_STATS],
543 510 XtNcallback, TreeMenu_CB, (XtPointer) TREE_MENU_STATS);
544 XtAddCallback(treeMenuItems[TREE_MENU_STATS], 511 XtSetSensitive(treeMenuItems[TREE_MENU_STATS], FALSE);
545 XtNcallback, TreeMenu_CB, (XtPointer) TREE_MENU_STATS); 512
546 513 treeMenuItems[TREE_MENU_SEP2] =
547 XtSetSensitive(treeMenuItems[TREE_MENU_STATS], FALSE); 514 XtCreateManagedWidget("treeMenuSep2", smeLineObjectClass,
548 515 treeMenus[TREE_MENU], NULL, 0);
549 treeMenuItems[TREE_MENU_SEP2] =
550 XtVaCreateManagedWidget("treeMenuSep2", smeLineObjectClass,
551 treeMenus[TREE_MENU],
552 NULL);
553 #endif /* COMMENT */ 516 #endif /* COMMENT */
554 517
555 treeMenuItems[TREE_MENU_QUIT] = 518 treeMenuItems[TREE_MENU_QUIT] =
556 XtVaCreateManagedWidget("treeMenuQuit", smeBSBObjectClass, 519 XtCreateManagedWidget("treeMenuQuit", smeBSBObjectClass,
557 treeMenus[TREE_MENU], 520 treeMenus[TREE_MENU], NULL, 0);
558 NULL); 521 XtAddCallback(treeMenuItems[TREE_MENU_QUIT],
559 XtAddCallback(treeMenuItems[TREE_MENU_QUIT], 522 XtNcallback, TreeMenu_CB, (XtPointer) TREE_MENU_QUIT);
560 XtNcallback, TreeMenu_CB, (XtPointer) TREE_MENU_QUIT); 523
561 524
562 525
563 526 /* Layout menu */
564 /* Layout menu */
565 527
566 #ifdef COMMENT 528 #ifdef COMMENT
567 treeMenuItems[LAYOUT_MENU_FIXED] = 529 XtSetArg (al [0], XtNleftMargin, 18);
568 XtVaCreateManagedWidget("layoutMenuFixed", smeBSBObjectClass, 530 treeMenuItems[LAYOUT_MENU_FIXED] =
569 treeMenus[LAYOUT_MENU], 531 XtCreateManagedWidget("layoutMenuFixed", smeBSBObjectClass,
570 XtNleftMargin, 18, 532 treeMenus[LAYOUT_MENU], al, 1);
571 NULL); 533
572 534 XtAddCallback(treeMenuItems[LAYOUT_MENU_FIXED],
573 XtAddCallback(treeMenuItems[LAYOUT_MENU_FIXED], 535 XtNcallback, LayoutMenu_CB, (XtPointer) LAYOUT_MENU_FIXED);
574 XtNcallback, LayoutMenu_CB, (XtPointer) LAYOUT_MENU_FIXED); 536
575 537 XtSetArg (al [0], XtNleftMargin, 18);
576 treeMenuItems[LAYOUT_MENU_VARIABLE] = 538 treeMenuItems[LAYOUT_MENU_VARIABLE] =
577 XtVaCreateManagedWidget("layoutMenuVariable", smeBSBObjectClass, 539 XtCreateManagedWidget("layoutMenuVariable", smeBSBObjectClass,
578 treeMenus[LAYOUT_MENU], 540 treeMenus[LAYOUT_MENU], al, 1);
579 XtNleftMargin, 18, 541
580 NULL); 542 XtAddCallback(treeMenuItems[LAYOUT_MENU_VARIABLE],
581 543 XtNcallback, LayoutMenu_CB, (XtPointer) LAYOUT_MENU_VARIABLE);
582 XtAddCallback(treeMenuItems[LAYOUT_MENU_VARIABLE], 544
583 XtNcallback, LayoutMenu_CB, (XtPointer) LAYOUT_MENU_VARIABLE); 545
584 546 treeMenuItems[LAYOUT_MENU_SEP1] =
585 547 XtCreateManagedWidget("layoutSep1", smeLineObjectClass,
586 treeMenuItems[LAYOUT_MENU_SEP1] = 548 treeMenus[LAYOUT_MENU], NULL, 0)
587 XtVaCreateManagedWidget("layoutSep1", smeLineObjectClass,
588 treeMenus[LAYOUT_MENU],
589 NULL);
590 #endif /* COMMENT */ 549 #endif /* COMMENT */
591 550
592 treeMenuItems[LAYOUT_MENU_SPACING] = 551 XtSetArg (al [0], XtNleftMargin, 18);
593 XtVaCreateManagedWidget("layoutMenuSpacing", smeBSBObjectClass, 552 treeMenuItems[LAYOUT_MENU_SPACING] =
594 treeMenus[LAYOUT_MENU], 553 XtCreateManagedWidget("layoutMenuSpacing", smeBSBObjectClass,
595 XtNleftMargin, 18, 554 treeMenus[LAYOUT_MENU], al, 1);
596 NULL); 555 XtAddCallback(treeMenuItems[LAYOUT_MENU_SPACING],
597 XtAddCallback(treeMenuItems[LAYOUT_MENU_SPACING], 556 XtNcallback, LayoutMenu_CB, (XtPointer) LAYOUT_MENU_SPACING);
598 XtNcallback, LayoutMenu_CB, (XtPointer) LAYOUT_MENU_SPACING); 557
599 558 treeMenuItems[LAYOUT_MENU_SEP2] =
600 treeMenuItems[LAYOUT_MENU_SEP2] = 559 XtCreateManagedWidget("layoutMenuSep2", smeLineObjectClass,
601 XtVaCreateManagedWidget("layoutMenuSep2", smeLineObjectClass, 560 treeMenus[LAYOUT_MENU], NULL, 0);
602 treeMenus[LAYOUT_MENU], 561
603 NULL); 562 /* the following is a toggle button - we hack it using a bitmap */
604 563 XtSetArg (al [0], XtNleftMargin, 18);
605 /* the following is a toggle button - we hack it using a bitmap */ 564 treeMenuItems[LAYOUT_MENU_ALIGN_NODES] =
606 treeMenuItems[LAYOUT_MENU_ALIGN_NODES] = 565 XtCreateManagedWidget("layoutMenuAlignNodes", smeBSBObjectClass,
607 XtVaCreateManagedWidget("layoutMenuAlignNodes", smeBSBObjectClass, 566 treeMenus[LAYOUT_MENU], al, 1);
608 treeMenus[LAYOUT_MENU], 567 XtAddCallback(treeMenuItems[LAYOUT_MENU_ALIGN_NODES],
609 XtNleftMargin, 18, 568 XtNcallback, LayoutMenu_CB,
610 NULL); 569 (XtPointer) LAYOUT_MENU_ALIGN_NODES);
611 XtAddCallback(treeMenuItems[LAYOUT_MENU_ALIGN_NODES],
612 XtNcallback, LayoutMenu_CB,
613 (XtPointer) LAYOUT_MENU_ALIGN_NODES);
614
615 } 570 }
616 571
617 /* ---------------------------------------------------------------------------- 572 /* ----------------------------------------------------------------------------
618 * 573 *
619 * BuildDialogs() builds all the dialogs used in this application. 574 * BuildDialogs() builds all the dialogs used in this application.
622 */ 577 */
623 578
624 static void 579 static void
625 BuildDialogs (Widget parent) 580 BuildDialogs (Widget parent)
626 { 581 {
627 int i; 582 Arg al [20]; int ac;
628 Widget 583 Widget
629 tmpwidget, dlgForm, dlgValue, 584 tmpwidget, dlgForm, dlgValue,
630 dlgLevelLabel, dlgSiblingLabel, 585 dlgLevelLabel, dlgSiblingLabel,
631 dlgOkButton, dlgCancelButton; 586 dlgOkButton, dlgCancelButton;
632 587
640 errStr[ERR_NOEND] = "Beginning of list does not have a matching end."; 595 errStr[ERR_NOEND] = "Beginning of list does not have a matching end.";
641 errStr[ERR_NOROOT] = "Input file does not have a root label."; 596 errStr[ERR_NOROOT] = "Input file does not have a root label.";
642 errStr[ERR_MANYROOT] = "Input file has more than one root label."; 597 errStr[ERR_MANYROOT] = "Input file has more than one root label.";
643 598
644 599
645 dialog[DLG_NEW] = XtVaCreatePopupShell("dlgNewTree", 600 XtSetArg (al [0], XtNresizable, TRUE);
646 transientShellWidgetClass, 601 dialog[DLG_NEW] = XtCreatePopupShell("dlgNewTree", transientShellWidgetClass,
647 parent, 602 parent, al, 1);
648 XtNresizable, TRUE, 603
649 NULL); 604 XtSetArg (al [0], XtNresizable, TRUE);
650 605 XtSetArg (al [1], XtNvalue, "");
651 tmpwidget = XtVaCreateManagedWidget("dlgNewTreeForm", 606 tmpwidget = XtCreateManagedWidget("dlgNewTreeForm", dialogWidgetClass,
652 dialogWidgetClass, 607 dialog[DLG_NEW], al, 2);
653 dialog[DLG_NEW],
654 XtNresizable, TRUE,
655 XtNvalue, "",
656 NULL);
657 608
658 XawDialogAddButton(tmpwidget, "dlgNewTreeOk", NewTree_CB, 609 XawDialogAddButton(tmpwidget, "dlgNewTreeOk", NewTree_CB,
659 (XtPointer) TRUE); 610 (XtPointer) TRUE);
660 XawDialogAddButton(tmpwidget, "dlgNewTreeCancel", NewTree_CB, 611 XawDialogAddButton(tmpwidget, "dlgNewTreeCancel", NewTree_CB,
661 (XtPointer) FALSE); 612 (XtPointer) FALSE);
665 XtOverrideTranslations 616 XtOverrideTranslations
666 (dlgValue, XtParseTranslationTable 617 (dlgValue, XtParseTranslationTable
667 ("<Key>Return:dlg_activate(dlgNewTreeOk)\n")); 618 ("<Key>Return:dlg_activate(dlgNewTreeOk)\n"));
668 619
669 620
670 dialog[DLG_NODE_NAME] = XtVaCreatePopupShell("dlgNodeName", 621 XtSetArg (al [0], XtNresizable, TRUE);
671 transientShellWidgetClass, 622 dialog[DLG_NODE_NAME] = XtCreatePopupShell("dlgNodeName",
672 TreeTopLevel, 623 transientShellWidgetClass,
673 XtNresizable, TRUE, 624 TreeTopLevel, al, 1);
674 NULL); 625
675 626 XtSetArg (al [0], XtNresizable, TRUE);
676 627 XtSetArg (al [1], XtNvalue, "");
677 tmpwidget= XtVaCreateManagedWidget("dlgNodeNameForm", 628 tmpwidget= XtCreateManagedWidget("dlgNodeNameForm", dialogWidgetClass,
678 dialogWidgetClass, 629 dialog[DLG_NODE_NAME], al, 2);
679 dialog[DLG_NODE_NAME],
680 XtNresizable, TRUE,
681 XtNvalue, "",
682 NULL);
683 630
684 XawDialogAddButton(tmpwidget, "dlgNodeNameOk", NodeLabel_CB, 631 XawDialogAddButton(tmpwidget, "dlgNodeNameOk", NodeLabel_CB,
685 (XtPointer) TRUE); 632 (XtPointer) TRUE);
686 XawDialogAddButton(tmpwidget, "dlgNodeNameCancel", NodeLabel_CB, 633 XawDialogAddButton(tmpwidget, "dlgNodeNameCancel", NodeLabel_CB,
687 (XtPointer) FALSE); 634 (XtPointer) FALSE);
691 XtOverrideTranslations 638 XtOverrideTranslations
692 (dlgValue, XtParseTranslationTable 639 (dlgValue, XtParseTranslationTable
693 ("<Key>Return: dlg_activate(dlgNodeNameOk)\n")); 640 ("<Key>Return: dlg_activate(dlgNodeNameOk)\n"));
694 641
695 642
696 dialog[DLG_FILE] = XtVaCreatePopupShell("dlgFile", 643 XtSetArg (al [0], XtNresizable, TRUE);
697 transientShellWidgetClass, 644 dialog[DLG_FILE] = XtCreatePopupShell("dlgFile",
698 TreeTopLevel, 645 transientShellWidgetClass,
699 XtNresizable, TRUE, 646 TreeTopLevel, al, 1);
700 NULL); 647
701 648 XtSetArg (al [0], XtNresizable, TRUE);
702 tmpwidget = XtVaCreateManagedWidget("dlgFileForm", 649 XtSetArg (al [1], XtNvalue, "");
703 dialogWidgetClass, 650 tmpwidget = XtCreateManagedWidget("dlgFileForm", dialogWidgetClass,
704 dialog[DLG_FILE], 651 dialog[DLG_FILE], al, 2);
705 XtNresizable, TRUE, 652
706 XtNvalue, "", 653 XawDialogAddButton(tmpwidget, "dlgFileOk", File_CB, (XtPointer) TRUE);
707 NULL);
708
709 XawDialogAddButton(tmpwidget, "dlgFileOk", File_CB, (XtPointer) TRUE);
710 XawDialogAddButton(tmpwidget, "dlgFileCancel", File_CB, (XtPointer) FALSE); 654 XawDialogAddButton(tmpwidget, "dlgFileCancel", File_CB, (XtPointer) FALSE);
711 655
712 dlgValue = XtNameToWidget(tmpwidget, "value"); 656 dlgValue = XtNameToWidget(tmpwidget, "value");
713 657
714 XtOverrideTranslations 658 XtOverrideTranslations
715 (dlgValue, XtParseTranslationTable 659 (dlgValue, XtParseTranslationTable
716 ("<Key>Return:dlg_activate(dlgFileOk)\n")); 660 ("<Key>Return:dlg_activate(dlgFileOk)\n"));
717 661
718 662
719 dialog[DLG_INFO] = XtVaCreatePopupShell("dlgInfo", 663 XtSetArg (al [0], XtNresizable, TRUE);
720 transientShellWidgetClass, 664 dialog[DLG_INFO] = XtCreatePopupShell("dlgInfo",
721 TreeTopLevel, 665 transientShellWidgetClass,
722 XtNresizable, TRUE, 666 TreeTopLevel, al, 1);
723 NULL); 667
724 668 XtSetArg (al [0], XtNresizable, TRUE);
725 tmpwidget = XtVaCreatePopupShell("dlgInfoForm", 669 XtSetArg (al [1], XtNvalue, "");
726 dialogWidgetClass, 670 tmpwidget = XtCreatePopupShell("dlgInfoForm",
727 dialog[DLG_INFO], 671 dialogWidgetClass,
728 XtNresizable, TRUE, 672 dialog[DLG_INFO], al, 2);
729 XtNvalue, "",
730 NULL);
731 673
732 XawDialogAddButton(tmpwidget, "dlgInfoButton", Popdown_CB, 674 XawDialogAddButton(tmpwidget, "dlgInfoButton", Popdown_CB,
733 (XtPointer) dialog[DLG_INFO]); 675 (XtPointer) dialog[DLG_INFO]);
734 676
735 677
736 dialog[DLG_ERROR] = XtVaCreatePopupShell("dlgError", 678 XtSetArg (al [0], XtNresizable, TRUE);
737 transientShellWidgetClass, 679 dialog[DLG_ERROR] = XtCreatePopupShell("dlgError",
738 TreeTopLevel, 680 transientShellWidgetClass,
739 XtNresizable, TRUE, 681 TreeTopLevel, al, 1);
740 NULL); 682
741 683 XtSetArg (al [0], XtNresizable, TRUE);
742 tmpwidget = XtVaCreateManagedWidget("dlgErrorForm", 684 XtSetArg (al [1], XtNvalue, "");
685 tmpwidget = XtCreateManagedWidget("dlgErrorForm",
743 dialogWidgetClass, 686 dialogWidgetClass,
744 dialog[DLG_ERROR], 687 dialog[DLG_ERROR], al, 2);
745 XtNresizable, TRUE,
746 XtNvalue, "",
747 NULL);
748 688
749 XawDialogAddButton(tmpwidget, "dlgErrorButton", Popdown_CB, 689 XawDialogAddButton(tmpwidget, "dlgErrorButton", Popdown_CB,
750 (XtPointer) dialog[DLG_ERROR]); 690 (XtPointer) dialog[DLG_ERROR]);
751 691
752 692
753 dialog[DLG_SPACING] = XtVaCreatePopupShell("dlgSpacing", 693 XtSetArg (al [0], XtNresizable, FALSE);
754 transientShellWidgetClass, 694 dialog[DLG_SPACING] = XtCreatePopupShell("dlgSpacing",
755 TreeTopLevel, 695 transientShellWidgetClass,
756 XtNresizable, FALSE, 696 TreeTopLevel, al, 1);
757 NULL); 697
758 dlgForm = XtVaCreateManagedWidget("dlgSpacingForm", 698 XtSetArg (al [0], XtNresizable, FALSE);
759 formWidgetClass, 699 dlgForm = XtCreateManagedWidget("dlgSpacingForm",
760 dialog[DLG_SPACING], 700 formWidgetClass,
761 XtNresizable, FALSE, 701 dialog[DLG_SPACING], al, 1);
762 NULL); 702
763 703 ac = 0;
764 dlgLevelLabel = XtVaCreateManagedWidget("dlgLevelLabel", 704 XtSetArg (al [ac], XtNfromVert, NULL); ac++;
765 labelWidgetClass, 705 XtSetArg (al [ac], XtNfromHoriz, NULL); ac++;
766 dlgForm, 706 XtSetArg (al [ac], XtNtop, XawChainTop); ac++;
767 XtNfromVert, NULL, 707 XtSetArg (al [ac], XtNbottom, XawChainTop); ac++;
768 XtNfromHoriz, NULL, 708 XtSetArg (al [ac], XtNleft, XawChainLeft); ac++;
769 XtNtop, XawChainTop, 709 XtSetArg (al [ac], XtNright, XawChainLeft); ac++;
770 XtNbottom, XawChainTop, 710 XtSetArg (al [ac], XtNborderWidth, 0); ac++;
771 XtNleft, XawChainLeft, 711 dlgLevelLabel = XtCreateManagedWidget("dlgLevelLabel", labelWidgetClass,
772 XtNright, XawChainLeft, 712 dlgForm, al, ac);
773 XtNborderWidth, 0, 713
774 NULL); 714 ac = 0;
775 715 XtSetArg (al [ac], XtNfromVert, NULL); ac++;
776 dlgLevelValuator = XtVaCreateManagedWidget("dlgLevelValuator", 716 XtSetArg (al [ac], XtNfromHoriz, dlgLevelLabel); ac++;
777 labelWidgetClass, 717 XtSetArg (al [ac], XtNtop, XawChainTop); ac++;
778 dlgForm, 718 XtSetArg (al [ac], XtNbottom, XawChainTop); ac++;
779 XtNfromVert, NULL, 719 XtSetArg (al [ac], XtNleft, XawChainLeft); ac++;
780 XtNfromHoriz, dlgLevelLabel, 720 XtSetArg (al [ac], XtNright, XawChainLeft); ac++;
781 XtNtop, XawChainTop, 721 XtSetArg (al [ac], XtNlabel, " "); ac++;
782 XtNbottom, XawChainTop, 722 dlgLevelValuator = XtCreateManagedWidget("dlgLevelValuator",
783 XtNleft, XawChainLeft, 723 labelWidgetClass,
784 XtNright, XawChainLeft, 724 dlgForm, al, ac);
785 XtNlabel, " ", 725
786 NULL); 726 ac = 0;
787 727 XtSetArg (al [ac], XtNfromVert, dlgLevelLabel); ac++;
788 728 XtSetArg (al [ac], XtNfromHoriz, NULL); ac++;
789 dlgLevelScale = XtVaCreateManagedWidget("dlgLevelScale", 729 XtSetArg (al [ac], XtNtop, XawChainTop); ac++;
790 pannerWidgetClass, 730 XtSetArg (al [ac], XtNbottom, XawChainTop); ac++;
791 dlgForm, 731 XtSetArg (al [ac], XtNleft, XawChainLeft); ac++;
792 XtNfromVert, dlgLevelLabel, 732 XtSetArg (al [ac], XtNright, XawChainLeft); ac++;
793 XtNfromHoriz, NULL, 733 XtSetArg (al [ac], XtNcanvasWidth, 110); ac++;
794 XtNtop, XawChainTop, 734 XtSetArg (al [ac], XtNdefaultScale, 1); ac++;
795 XtNbottom, XawChainTop, 735 XtSetArg (al [ac], XtNinternalSpace, 1); ac++;
796 XtNleft, XawChainLeft, 736 XtSetArg (al [ac], XtNrubberBand, FALSE); ac++;
797 XtNright, XawChainLeft, 737 XtSetArg (al [ac], XtNshadowThickness, 0); ac++;
798 XtNcanvasWidth, 110, 738 XtSetArg (al [ac], XtNallowOff, FALSE); ac++;
799 XtNdefaultScale, 1, 739 XtSetArg (al [ac], XtNwidth, 200); ac++;
800 XtNinternalSpace, 1, 740 XtSetArg (al [ac], XtNsliderWidth, 10); ac++;
801 XtNrubberBand, FALSE, 741 XtSetArg (al [ac], XtNheight, 15); ac++;
802 XtNshadowThickness, 0, 742 dlgLevelScale = XtCreateManagedWidget("dlgLevelScale",
803 XtNallowOff, FALSE, 743 pannerWidgetClass,
804 XtNwidth, 200, 744 dlgForm, al, ac);
805 XtNsliderWidth, 10,
806 XtNheight, 15,
807 NULL);
808 745
809 XtOverrideTranslations(dlgLevelScale, XtParseTranslationTable("\ 746 XtOverrideTranslations(dlgLevelScale, XtParseTranslationTable("\
810 <Btn2Down>: start()\n\ 747 <Btn2Down>: start()\n\
811 <Btn2Motion>: move()\n\ 748 <Btn2Motion>: move()\n\
812 <Btn2Up>: notify()stop()\n\ 749 <Btn2Up>: notify()stop()\n\
815 XtAddCallback(dlgLevelScale, XtNreportCallback, levelscale_CB, 752 XtAddCallback(dlgLevelScale, XtNreportCallback, levelscale_CB,
816 (XtPointer) dlgLevelValuator); 753 (XtPointer) dlgLevelValuator);
817 XtAddCallback(dlgLevelScale, XtNreportCallback, levelvalue_CB, 754 XtAddCallback(dlgLevelScale, XtNreportCallback, levelvalue_CB,
818 (XtPointer) &dlgLevelValue); 755 (XtPointer) &dlgLevelValue);
819 756
820 dlgSiblingLabel = XtVaCreateManagedWidget("dlgSiblingLabel", 757 ac = 0;
821 labelWidgetClass, 758 XtSetArg (al [ac], XtNfromVert, dlgLevelScale); ac++;
822 dlgForm, 759 XtSetArg (al [ac], XtNfromHoriz, NULL); ac++;
823 XtNfromVert, dlgLevelScale, 760 XtSetArg (al [ac], XtNtop, XawChainTop); ac++;
824 XtNfromHoriz, NULL, 761 XtSetArg (al [ac], XtNbottom, XawChainTop); ac++;
825 XtNtop, XawChainTop, 762 XtSetArg (al [ac], XtNleft, XawChainLeft); ac++;
826 XtNbottom, XawChainTop, 763 XtSetArg (al [ac], XtNright, XawChainLeft); ac++;
827 XtNleft, XawChainLeft, 764 XtSetArg (al [ac], XtNborderWidth, 0); ac++;
828 XtNright, XawChainLeft, 765 dlgSiblingLabel = XtCreateManagedWidget("dlgSiblingLabel",
829 XtNborderWidth, 0, 766 labelWidgetClass,
830 NULL); 767 dlgForm, al, ac);
831 768
832 dlgSiblingValuator = XtVaCreateManagedWidget("dlgLevelValuator", 769 ac = 0;
833 labelWidgetClass, 770 XtSetArg (al [ac], XtNfromVert, dlgLevelScale); ac++;
834 dlgForm, 771 XtSetArg (al [ac], XtNfromHoriz, dlgSiblingLabel); ac++;
835 XtNfromVert, dlgLevelScale, 772 XtSetArg (al [ac], XtNtop, XawChainTop); ac++;
836 XtNfromHoriz, dlgSiblingLabel, 773 XtSetArg (al [ac], XtNbottom, XawChainTop); ac++;
837 XtNtop, XawChainTop, 774 XtSetArg (al [ac], XtNleft, XawChainLeft); ac++;
838 XtNbottom, XawChainTop, 775 XtSetArg (al [ac], XtNright, XawChainLeft); ac++;
839 XtNleft, XawChainLeft, 776 XtSetArg (al [ac], XtNlabel, " "); ac++;
840 XtNright, XawChainLeft, 777 dlgSiblingValuator = XtCreateManagedWidget("dlgLevelValuator",
841 XtNlabel, " ", 778 labelWidgetClass,
842 NULL); 779 dlgForm, al, ac);
843 dlgSiblingScale = XtVaCreateManagedWidget("dlgSiblingScale", 780
844 pannerWidgetClass, 781 ac = 0;
845 dlgForm, 782 XtSetArg (al [ac], XtNfromVert, dlgSiblingLabel); ac++;
846 XtNfromVert, dlgSiblingLabel, 783 XtSetArg (al [ac], XtNfromHoriz, NULL); ac++;
847 XtNfromHoriz, NULL, 784 XtSetArg (al [ac], XtNtop, XawChainTop); ac++;
848 XtNtop, XawChainTop, 785 XtSetArg (al [ac], XtNbottom, XawChainTop); ac++;
849 XtNbottom, XawChainTop, 786 XtSetArg (al [ac], XtNleft, XawChainLeft); ac++;
850 XtNleft, XawChainLeft, 787 XtSetArg (al [ac], XtNright, XawChainLeft); ac++;
851 XtNright, XawChainLeft, 788 XtSetArg (al [ac], XtNcanvasWidth, 110); ac++;
852 XtNcanvasWidth, 110, 789 XtSetArg (al [ac], XtNdefaultScale, 1); ac++;
853 XtNdefaultScale, 1, 790 XtSetArg (al [ac], XtNinternalSpace, 1); ac++;
854 XtNinternalSpace, 1, 791 XtSetArg (al [ac], XtNrubberBand, FALSE); ac++;
855 XtNrubberBand, FALSE, 792 XtSetArg (al [ac], XtNshadowThickness, 0); ac++;
856 XtNshadowThickness, 0, 793 XtSetArg (al [ac], XtNallowOff, FALSE); ac++;
857 XtNallowOff, FALSE, 794 XtSetArg (al [ac], XtNwidth, 200); ac++;
858 XtNwidth, 200, 795 XtSetArg (al [ac], XtNsliderWidth, 10); ac++;
859 XtNsliderWidth, 10, 796 XtSetArg (al [ac], XtNheight, 15); ac++;
860 XtNheight, 15, 797 dlgSiblingScale = XtCreateManagedWidget("dlgSiblingScale",
861 NULL); 798 pannerWidgetClass,
799 dlgForm, al, ac);
862 800
863 XtOverrideTranslations(dlgSiblingScale, XtParseTranslationTable("\ 801 XtOverrideTranslations(dlgSiblingScale, XtParseTranslationTable("\
864 <Btn2Down>: start()\n\ 802 <Btn2Down>: start()\n\
865 <Btn2Motion>: move()\n\ 803 <Btn2Motion>: move()\n\
866 <Btn2Up>: notify()stop()\n\ 804 <Btn2Up>: notify()stop()\n\
869 XtAddCallback(dlgSiblingScale, XtNreportCallback, siblingscale_CB, 807 XtAddCallback(dlgSiblingScale, XtNreportCallback, siblingscale_CB,
870 (XtPointer) dlgSiblingValuator); 808 (XtPointer) dlgSiblingValuator);
871 XtAddCallback(dlgSiblingScale, XtNreportCallback, siblingvalue_CB, 809 XtAddCallback(dlgSiblingScale, XtNreportCallback, siblingvalue_CB,
872 (XtPointer) &dlgSiblingValue); 810 (XtPointer) &dlgSiblingValue);
873 811
874 dlgOkButton = XtVaCreateManagedWidget("dlgOkButton", 812 ac = 0;
875 commandWidgetClass, 813 XtSetArg (al [ac], XtNfromVert, dlgSiblingLabel); ac++;
876 dlgForm, 814 XtSetArg (al [ac], XtNfromHoriz, NULL); ac++;
877 XtNfromVert, dlgSiblingScale, 815 XtSetArg (al [ac], XtNtop, XawChainTop); ac++;
878 XtNfromHoriz, NULL, 816 XtSetArg (al [ac], XtNbottom, XawChainTop); ac++;
879 XtNtop, XawChainTop, 817 XtSetArg (al [ac], XtNleft, XawChainLeft); ac++;
880 XtNbottom, XawChainTop, 818 XtSetArg (al [ac], XtNright, XawChainLeft); ac++;
881 XtNleft, XawChainLeft, 819 XtSetArg (al [ac], XtNlabel, " "); ac++;
882 XtNright, XawChainLeft, 820 dlgOkButton = XtCreateManagedWidget("dlgOkButton", commandWidgetClass,
883 NULL); 821 dlgForm, al, ac);
884 822
885 dlgCancelButton = XtVaCreateManagedWidget("dlgCancelButton", 823 ac = 0;
886 commandWidgetClass, 824 XtSetArg (al [ac], XtNfromVert, dlgSiblingScale); ac++;
887 dlgForm, 825 XtSetArg (al [ac], XtNfromHoriz, dlgOkButton); ac++;
888 XtNfromVert, dlgSiblingScale, 826 XtSetArg (al [ac], XtNtop, XawChainTop); ac++;
889 XtNfromHoriz, dlgOkButton, 827 XtSetArg (al [ac], XtNbottom, XawChainTop); ac++;
890 XtNtop, XawChainTop, 828 XtSetArg (al [ac], XtNleft, XawChainLeft); ac++;
891 XtNbottom, XawChainTop, 829 XtSetArg (al [ac], XtNright, XawChainLeft); ac++;
892 XtNleft, XawChainLeft, 830 dlgCancelButton = XtCreateManagedWidget("dlgCancelButton",
893 XtNright, XawChainLeft, 831 commandWidgetClass,
894 NULL); 832 dlgForm, al, ac);
895 833
896 XtAddCallback(dlgOkButton, XtNcallback, Scale_CB, (XtPointer) TRUE); 834 XtAddCallback(dlgOkButton, XtNcallback, Scale_CB, (XtPointer) TRUE);
897 XtAddCallback(dlgCancelButton, XtNcallback, Scale_CB, (XtPointer) FALSE); 835 XtAddCallback(dlgCancelButton, XtNcallback, Scale_CB, (XtPointer) FALSE);
898 } 836 }
899 837
900 /* ---------------------------------------------------------------------------- 838 /* ----------------------------------------------------------------------------
901 * 839 *
907 845
908 846
909 static void 847 static void
910 BuildHelpWindow(Widget parent) 848 BuildHelpWindow(Widget parent)
911 { 849 {
912 int i; 850 Arg al [20]; int ac;
913 851
914 helpShell = XtVaCreatePopupShell("helpShell", transientShellWidgetClass, 852 helpShell = XtCreatePopupShell("helpShell", transientShellWidgetClass,
915 parent, 853 parent, NULL, 0);
916 NULL); 854
917 855 helpForm = XtCreateManagedWidget("helpForm", formWidgetClass,
918 helpForm = XtVaCreateManagedWidget("helpForm", 856 helpShell, NULL, 0);
919 formWidgetClass, 857
920 helpShell, 858 ac = 0;
921 NULL); 859 XtSetArg (al [ac], XtNfromVert, NULL); ac++;
922 860 XtSetArg (al [ac], XtNfromHoriz, NULL); ac++;
923 helpDoneButton = XtVaCreateManagedWidget("helpDoneButton", 861 XtSetArg (al [ac], XtNtop, XawChainTop); ac++;
924 commandWidgetClass, 862 XtSetArg (al [ac], XtNbottom, XawChainTop); ac++;
925 helpForm, 863 XtSetArg (al [ac], XtNleft, XawChainLeft); ac++;
926 XtNfromVert, NULL, 864 XtSetArg (al [ac], XtNright, XawChainLeft); ac++;
927 XtNfromHoriz, NULL, 865 helpDoneButton = XtCreateManagedWidget("helpDoneButton",
928 XtNtop, XawChainTop, 866 commandWidgetClass,
929 XtNbottom, XawChainTop, 867 helpForm, al, ac);
930 XtNleft, XawChainLeft,
931 XtNright, XawChainLeft,
932 NULL);
933 868
934 XtAddCallback(helpDoneButton, XtNcallback, Popdown_CB, 869 XtAddCallback(helpDoneButton, XtNcallback, Popdown_CB,
935 (XtPointer) helpShell); 870 (XtPointer) helpShell);
936 871
937 helpTitle = XtVaCreateManagedWidget("helpTitle", 872 ac = 0;
938 labelWidgetClass, 873 XtSetArg (al [ac], XtNfromVert, NULL); ac++;
939 helpForm, 874 XtSetArg (al [ac], XtNfromHoriz, helpDoneButton); ac++;
940 XtNfromVert, NULL, 875 XtSetArg (al [ac], XtNtop, XawChainTop); ac++;
941 XtNfromHoriz, helpDoneButton, 876 XtSetArg (al [ac], XtNbottom, XawChainTop); ac++;
942 XtNtop, XawChainTop, 877 XtSetArg (al [ac], XtNleft, XawChainLeft); ac++;
943 XtNbottom, XawChainTop, 878 XtSetArg (al [ac], XtNright, XawChainLeft); ac++;
944 XtNleft, XawChainLeft, 879 XtSetArg (al [ac], XtNborderWidth, 0); ac++;
945 XtNright, XawChainLeft, 880 XtSetArg (al [ac], XtNlabel, " "); ac++;
946 XtNborderWidth, 0, 881 helpTitle = XtCreateManagedWidget("helpTitle", labelWidgetClass,
947 XtNlabel, "", 882 helpForm, al, ac);
948 NULL); 883
949 884
950 helpText = XtVaCreateManagedWidget("helpText", 885 ac = 0;
951 asciiTextWidgetClass, 886 XtSetArg (al [ac], XtNfromVert, helpDoneButton); ac++;
952 helpForm, 887 XtSetArg (al [ac], XtNfromHoriz, NULL); ac++;
953 XtNfromVert, helpDoneButton, 888 XtSetArg (al [ac], XtNtop, XawChainTop); ac++;
954 XtNfromHoriz, NULL, 889 XtSetArg (al [ac], XtNbottom, XawChainBottom); ac++;
955 XtNtop, XawChainTop, 890 XtSetArg (al [ac], XtNleft, XawChainLeft); ac++;
956 XtNbottom, XawChainBottom, 891 XtSetArg (al [ac], XtNright, XawChainRight); ac++;
957 XtNleft, XawChainLeft, 892 XtSetArg (al [ac], XtNeditType, XawtextRead); ac++;
958 XtNright, XawChainRight, 893 XtSetArg (al [ac], XtNdisplayCaret, FALSE); ac++;
959 XtNeditType, XawtextRead, 894 XtSetArg (al [ac], XtNuseStringInPlace, TRUE); ac++;
960 XtNdisplayCaret, FALSE, 895 XtSetArg (al [ac], XtNstring, help_text); ac++;
961 XtNscrollVertical, XawtextScrollAlways, 896 XtSetArg (al [ac], XtNwidth, 530); ac++;
962 XtNscrollHorizontal, 897 XtSetArg (al [ac], XtNheight, 650); ac++;
963 XawtextScrollWhenNeeded, 898 XtSetArg (al [ac], XtNscrollVertical, XawtextScrollAlways); ac++;
964 XtNuseStringInPlace, TRUE, 899 XtSetArg (al [ac], XtNscrollHorizontal, XawtextScrollWhenNeeded); ac++;
965 XtNstring, help_text, 900 helpText = XtCreateManagedWidget("helpText", asciiTextWidgetClass,
966 XtNwidth, 530, 901 helpForm, al, ac);
967 XtNheight, 650,
968 NULL);
969 } 902 }
970 903
971 /* ---------------------------------------------------------------------------- 904 /* ----------------------------------------------------------------------------
972 * 905 *
973 * BuildApplicationWindow() assumes that TreeTopLevel has been initialized 906 * BuildApplicationWindow() assumes that TreeTopLevel has been initialized
979 912
980 913
981 static void 914 static void
982 BuildApplicationWindow(Widget parent) 915 BuildApplicationWindow(Widget parent)
983 { 916 {
984 Widget topPane, box; 917 Widget topPane;
985 918 Arg al [20]; int ac;
986 topPane = XtVaCreateManagedWidget("topPane", 919
987 panedWidgetClass, 920 XtSetArg (al [0], XtNorientation, XtorientVertical);
988 parent, 921 topPane = XtCreateManagedWidget("topPane", panedWidgetClass, parent, al, 1);
989 XtNorientation, XtorientVertical,
990 NULL);
991 922
992 BuildMenubar(topPane); 923 BuildMenubar(topPane);
993 924
994 statusText = XtVaCreateManagedWidget("statusText", 925 XtSetArg (al [0], XtNborderWidth, 0);
995 labelWidgetClass, 926 statusText = XtCreateManagedWidget("statusText", labelWidgetClass,
996 topPane, 927 topPane, al, 1);
997 XtNborderWidth, 0, 928
998 NULL); 929 ac = 0;
999 930 XtSetArg (al [ac], XtNshowGrip, FALSE); ac++;
1000 scrolledWindow = XtVaCreateManagedWidget("scrolledWindow", 931 XtSetArg (al [ac], XtNallowHoriz, TRUE); ac++;
1001 viewportWidgetClass, 932 XtSetArg (al [ac], XtNallowVert, TRUE); ac++;
1002 topPane, 933 XtSetArg (al [ac], XtNuseBottom, TRUE); ac++;
1003 XtNshowGrip, FALSE, 934 XtSetArg (al [ac], XtNuseRight, TRUE); ac++;
1004 XtNallowHoriz, TRUE, 935 scrolledWindow = XtCreateManagedWidget("scrolledWindow", viewportWidgetClass,
1005 XtNallowVert, TRUE, 936 topPane, al, ac);
1006 XtNuseBottom, TRUE, 937
1007 XtNuseRight, TRUE, 938 TreeDrawingArea = XtCreateManagedWidget("treeDrawingArea", simpleWidgetClass,
1008 NULL); 939 scrolledWindow, NULL, 0);
1009
1010 TreeDrawingArea = XtVaCreateManagedWidget("treeDrawingArea",
1011 simpleWidgetClass,
1012 scrolledWindow,
1013 NULL);
1014 } 940 }
1015 941
1016 /* ---------------------------------------------------------------------------- 942 /* ----------------------------------------------------------------------------
1017 * 943 *
1018 * HandleError() is used when ReadTreeFromFile() or SaveTreeToFile() returns 944 * HandleError() is used when ReadTreeFromFile() or SaveTreeToFile() returns
1075 so don't use this call: 1001 so don't use this call:
1076 1002
1077 XtSetLanguageProc(NULL, NULL, NULL); 1003 XtSetLanguageProc(NULL, NULL, NULL);
1078 */ 1004 */
1079 1005
1080 TreeTopLevel = XtVaAppInitialize(&app, "Xoobr", 1006 TreeTopLevel = XtAppInitialize(&app, "Xoobr",
1081 NULL, 0, 1007 NULL, 0,
1082 argc, argv, 1008 argc, argv,
1083 fallback_resources, 1009 fallback_resources,
1084 NULL); 1010 NULL, 0);
1085 1011
1086 ASSERT(TreeTopLevel, "failed to open connection to X server"); 1012 ASSERT(TreeTopLevel, "failed to open connection to X server");
1087 1013
1088 TreeDisplay = XtDisplay(TreeTopLevel); 1014 TreeDisplay = XtDisplay(TreeTopLevel);
1089 TreeScreen = DefaultScreen(TreeDisplay); 1015 TreeScreen = DefaultScreen(TreeDisplay);
1132 XtAddEventHandler(TreeDrawingArea, ExposureMask, FALSE, 1058 XtAddEventHandler(TreeDrawingArea, ExposureMask, FALSE,
1133 ExposeHandler, (XtPointer) NULL); 1059 ExposeHandler, (XtPointer) NULL);
1134 1060
1135 XtSetArg (al [0], XtNbackground, applRsrcsPtr->background_color); 1061 XtSetArg (al [0], XtNbackground, applRsrcsPtr->background_color);
1136 XtSetValues(TreeDrawingArea, al, 1); 1062 XtSetValues(TreeDrawingArea, al, 1);
1137 1063
1138 XtRealizeWidget(TreeTopLevel); 1064 XtRealizeWidget(TreeTopLevel);
1139 1065
1140 XtOverrideTranslations 1066 XtOverrideTranslations
1141 (TreeTopLevel, 1067 (TreeTopLevel,
1142 XtParseTranslationTable("<Message>WM_PROTOCOLS: quit()")); 1068 XtParseTranslationTable("<Message>WM_PROTOCOLS: quit()"));
1438 File_CB(Widget w, XtPointer client_data, XtPointer call_data) 1364 File_CB(Widget w, XtPointer client_data, XtPointer call_data)
1439 { 1365 {
1440 char *fname; 1366 char *fname;
1441 Tree *tree; 1367 Tree *tree;
1442 ErrCode error; 1368 ErrCode error;
1443 Arg args[1];
1444 int menuItem; 1369 int menuItem;
1445 1370
1446 if (client_data == (XtPointer) TRUE) { 1371 if (client_data == (XtPointer) TRUE) {
1447 fname = XawDialogGetValueString(XtParent(w)); 1372 fname = XawDialogGetValueString(XtParent(w));
1448 if (*fname) { 1373 if (*fname) {
1482 /* ------------------------------------------------------------------------- */ 1407 /* ------------------------------------------------------------------------- */
1483 1408
1484 static void 1409 static void
1485 Scale_CB(Widget w, XtPointer client_data, XtPointer call_data) 1410 Scale_CB(Widget w, XtPointer client_data, XtPointer call_data)
1486 { 1411 {
1487 int level_value, sibling_value; 1412 int level_value, sibling_value;
1488 float tmp;
1489 1413
1490 XtPopdown(dialog[DLG_SPACING]); 1414 XtPopdown(dialog[DLG_SPACING]);
1491 1415
1492 /* check if OK button was selected */ 1416 /* check if OK button was selected */
1493 if (client_data) { 1417 if (client_data) {
1549 1473
1550 static void 1474 static void
1551 select_action(Widget w, XEvent *event, String *params, Cardinal *num_params) 1475 select_action(Widget w, XEvent *event, String *params, Cardinal *num_params)
1552 { 1476 {
1553 Tree *node; 1477 Tree *node;
1554 int height;
1555 Boolean edit = FALSE; 1478 Boolean edit = FALSE;
1556 1479
1557 if ((*num_params > 0) && 1480 if ((*num_params > 0) &&
1558 (!strcmp(params[0], "EDIT") || 1481 (!strcmp(params[0], "EDIT") ||
1559 !strcmp(params[0], "edit"))) 1482 !strcmp(params[0], "edit")))
1584 1507
1585 static void 1508 static void
1586 menu_popup_action(Widget w, XEvent *event, String *params, Cardinal *num_params) 1509 menu_popup_action(Widget w, XEvent *event, String *params, Cardinal *num_params)
1587 { 1510 {
1588 char *strargs[] = {"nodeMenu", NULL}; 1511 char *strargs[] = {"nodeMenu", NULL};
1589 Widget menu = XtNameToWidget(TreeTopLevel, params[0]); 1512 /* Widget menu = XtNameToWidget(TreeTopLevel, params[0]); */
1590 Boolean popup; 1513 /* Boolean popup; */
1591 ShellWidget shell_widget = (ShellWidget) menu; 1514 /* ShellWidget shell_widget = (ShellWidget) menu; */
1592 1515
1593 if (nodeFound) { 1516 if (nodeFound) {
1594 1517
1595 /* This is giving me a headache. 1518 /* This is giving me a headache.
1596 * Why do popup menus come up unselectable? 1519 * Why do popup menus come up unselectable?