82 |
82 |
83 preferenceFor:aSymbol |
83 preferenceFor:aSymbol |
84 ^ false |
84 ^ false |
85 |
85 |
86 |
86 |
87 ! ! |
|
88 |
|
89 !UIPainter class methodsFor:'help specs'! |
|
90 |
|
91 helpSpec |
|
92 "return a dictionary filled with helpKey -> helptext associations. |
|
93 These are used by the activeHelp tool." |
|
94 |
|
95 |dict| |
|
96 |
|
97 dict := super helpSpec. |
|
98 dict at:#maxChars put:'set the maximum number of |
|
99 characters that are allowed |
|
100 in the editfield.'. |
|
101 dict at:#id put:'enter the name of the field |
|
102 here. This ID can be used |
|
103 by the applicationModel |
|
104 to access components, |
|
105 using #componentAt:<key>'. |
|
106 ^ dict |
|
107 ! ! |
87 ! ! |
108 |
88 |
109 !UIPainter class methodsFor:'icons'! |
89 !UIPainter class methodsFor:'icons'! |
110 |
90 |
111 iconAlignB |
91 iconAlignB |
451 <resource: #canvas> |
431 <resource: #canvas> |
452 |
432 |
453 ^ |
433 ^ |
454 |
434 |
455 #(#FullSpec |
435 #(#FullSpec |
|
436 #'flags:' 0 |
456 #'window:' |
437 #'window:' |
457 #(#WindowSpec |
438 #(#WindowSpec |
458 #'name:' 'uIPainterView' |
439 #'name:' 'uIPainterView' |
459 #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
440 #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
441 #'flags:' 0 |
460 #'label:' 'Tree-View' |
442 #'label:' 'Tree-View' |
461 #'bounds:' #(#Rectangle 0 0 478 429) |
443 #'bounds:' #(#Rectangle 0 0 524 456) |
462 ) |
444 ) |
463 #'component:' |
445 #'component:' |
464 #(#SpecCollection |
446 #(#SpecCollection |
465 #'collection:' |
447 #'collection:' |
466 #( |
448 #( |
467 #(#MenuPanelSpec |
449 #(#MenuPanelSpec |
468 #'name:' 'menuPullDown' |
450 #'name:' 'menuPullDown' |
469 #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 24 0) |
451 #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 25 0) |
|
452 #'flags:' 0 |
470 #'tabable:' true |
453 #'tabable:' true |
471 #'menu:' #menuPullDown |
454 #'menu:' #menuPullDown |
472 ) |
455 ) |
473 #(#MenuPanelSpec |
456 #(#MenuPanelSpec |
474 #'name:' 'menuAlignment' |
457 #'name:' 'menuAlignment' |
475 #'layout:' #(#LayoutFrame 0 0.0 29 0 233 0 54 0) |
458 #'layout:' #(#LayoutFrame 0 0.0 29 0 233 0 54 0) |
|
459 #'flags:' 0 |
476 #'tabable:' true |
460 #'tabable:' true |
477 #'menu:' #menuAlignment |
461 #'menu:' #menuAlignment |
478 #'showSeparatingLines:' true |
462 #'showSeparatingLines:' true |
479 ) |
463 ) |
480 #(#PanelViewSpec |
464 #(#PanelViewSpec |
481 #'name:' 'panelViewButtons' |
465 #'name:' 'panelViewButtons' |
482 #'layout:' #(#LayoutFrame -125 1.0 25 0.0 0 1.0 57 0.0) |
466 #'layout:' #(#LayoutFrame -125 1.0 25 0.0 0 1.0 57 0.0) |
|
467 #'flags:' 0 |
483 #'component:' |
468 #'component:' |
484 #(#SpecCollection |
469 #(#SpecCollection |
485 #'collection:' |
470 #'collection:' |
486 #( |
471 #( |
487 #(#ActionButtonSpec |
472 #(#ActionButtonSpec |
488 #'name:' 'moveLeft' |
473 #'name:' 'moveLeft' |
|
474 #'flags:' 0 |
489 #'label:' '' |
475 #'label:' '' |
490 #'translateLabel:' true |
476 #'translateLabel:' true |
491 #'labelChannel:' #'LABELb_moveLeft.xbm' |
477 #'labelChannel:' #'LABELb_moveLeft.xbm' |
492 #'tabable:' true |
478 #'tabable:' true |
493 #'defaultable:' true |
479 #'defaultable:' true |
541 #'verticalSpace:' 4 |
530 #'verticalSpace:' 4 |
542 ) |
531 ) |
543 #(#SequenceViewSpec |
532 #(#SequenceViewSpec |
544 #'name:' 'objectTree' |
533 #'name:' 'objectTree' |
545 #'layout:' #(#LayoutFrame 0 0.0 59 0.0 0 0.35 -25 1.0) |
534 #'layout:' #(#LayoutFrame 0 0.0 59 0.0 0 0.35 -25 1.0) |
|
535 #'flags:' 0 |
546 #'enableChannel:' #enableChannel |
536 #'enableChannel:' #enableChannel |
547 #'tabable:' true |
537 #'tabable:' true |
548 #'menu:' #objectListMenu |
538 #'menu:' #objectListMenu |
549 #'model:' #objectList |
539 #'model:' #objectList |
550 #'hasHorizontalScrollBar:' true |
540 #'hasHorizontalScrollBar:' true |
570 #'canvas:' #noteBookView |
561 #'canvas:' #noteBookView |
571 ) |
562 ) |
572 #(#HorizontalPanelViewSpec |
563 #(#HorizontalPanelViewSpec |
573 #'name:' 'modifyPanel' |
564 #'name:' 'modifyPanel' |
574 #'layout:' #(#LayoutFrame 0 0.35 -55 1.0 0 1.0 -25 1.0) |
565 #'layout:' #(#LayoutFrame 0 0.35 -55 1.0 0 1.0 -25 1.0) |
|
566 #'flags:' 0 |
575 #'component:' |
567 #'component:' |
576 #(#SpecCollection |
568 #(#SpecCollection |
577 #'collection:' |
569 #'collection:' |
578 #( |
570 #( |
579 #(#ActionButtonSpec |
571 #(#ActionButtonSpec |
580 #'name:' 'cancelButton' |
572 #'name:' 'cancelButton' |
|
573 #'flags:' 0 |
581 #'label:' 'cancel' |
574 #'label:' 'cancel' |
582 #'tabable:' true |
575 #'tabable:' true |
583 #'model:' #cancel |
576 #'model:' #cancel |
584 #'enableChannel:' #modifiedChannel |
577 #'enableChannel:' #modifiedChannel |
585 #'extent:' #(#Point 151 24) |
578 #'extent:' #(#Point 166 24) |
586 ) |
579 ) |
587 #(#ActionButtonSpec |
580 #(#ActionButtonSpec |
588 #'name:' 'acceptButton' |
581 #'name:' 'acceptButton' |
|
582 #'flags:' 0 |
589 #'label:' 'ok' |
583 #'label:' 'ok' |
590 #'tabable:' true |
584 #'tabable:' true |
591 #'model:' #accept |
585 #'model:' #accept |
592 #'enableChannel:' #modifiedChannel |
586 #'enableChannel:' #modifiedChannel |
593 #'extent:' #(#Point 151 24) |
587 #'extent:' #(#Point 166 24) |
594 ) |
588 ) |
595 ) |
589 ) |
596 ) |
590 ) |
597 #'level:' 0 |
591 #'level:' 0 |
598 #'horizontalLayout:' #fitSpace |
592 #'horizontalLayout:' #fitSpace |
629 ] |
640 ] |
630 ] ifFalse:[ |
641 ] ifFalse:[ |
631 self isHelpToolSelected ifTrue:[ |
642 self isHelpToolSelected ifTrue:[ |
632 activeHelpTool accept |
643 activeHelpTool accept |
633 ]. |
644 ]. |
634 self painter updateFromSpec:(specTool specEdited). |
645 self painter updateFromSpec:(specTool specification). |
635 ]. |
646 ]. |
636 self modifiedChannel value:false. |
647 self modifiedChannel value:false. |
637 objectList addDependent:self. |
648 objectList addDependent:self. |
638 |
649 |
639 ! |
650 ! |
640 |
651 |
641 cancel |
652 cancel |
642 "cancel all changes and read back attributes from current view |
653 "cancel all changes and read back attributes from current view |
643 " |
654 " |
644 self modifiedChannel value ifTrue:[ |
655 self modifiedChannel value ifTrue:[ |
645 specTool specEdited:(self painter specForSelection). |
656 specTool specification:(self painter specForSelection). |
646 layoutTool layoutView:(layoutTool layoutView). |
657 layoutTool layoutView:(layoutTool layoutView). |
647 self modifiedChannel value:false. |
658 self modifiedChannel value:false. |
648 ] |
659 ] |
649 ! |
660 ! |
650 |
661 |
651 doubleClick |
662 doubleClick |
652 objectList selectGroup |
663 objectList selectGroup |
|
664 ! |
|
665 |
|
666 raiseGallery |
|
667 |top| |
|
668 |
|
669 top := selectionPanel window. |
|
670 top map. |
|
671 top bePartner. |
|
672 (builder componentAt:#raiseGallery) beInvisible. |
|
673 |
|
674 ! |
|
675 |
|
676 raisePainter |
|
677 |top| |
|
678 |
|
679 top := self painter topView. |
|
680 top map. |
|
681 top bePartner. |
|
682 (builder componentAt:#raisePainter) beInvisible. |
|
683 |
|
684 |
653 ! ! |
685 ! ! |
654 |
686 |
655 !UIPainter methodsFor:'active help'! |
687 !UIPainter methodsFor:'active help'! |
|
688 |
|
689 activeHelpApplicationClass |
|
690 "gets application class keeping the associated help component |
|
691 " |
|
692 |cls| |
|
693 |
|
694 specClass notNil ifTrue:[ |
|
695 specClass isBehavior ifFalse:[cls := Smalltalk at:specClass asSymbol] |
|
696 ifTrue:[cls := specClass]. |
|
697 |
|
698 (cls isSubclassOf:UISpecification) ifTrue:[ |
|
699 cls := UISpecificationTool |
|
700 ] |
|
701 ]. |
|
702 ^ cls |
|
703 ! |
656 |
704 |
657 activeHelpTool |
705 activeHelpTool |
658 |cls| |
706 |cls| |
659 |
707 |
660 activeHelpTool isNil ifTrue:[ |
708 activeHelpTool isNil ifTrue:[ |
661 activeHelpTool := UIHelpTool new. |
709 activeHelpTool := UIHelpTool new. |
662 |
710 |
663 specClass notNil ifTrue:[ |
711 (cls := self activeHelpApplicationClass) notNil ifTrue:[ |
664 specClass isBehavior ifFalse:[ |
|
665 cls := Smalltalk at:specClass asSymbol |
|
666 ] ifTrue:[ |
|
667 cls := specClass |
|
668 ]. |
|
669 (cls isSubclassOf:UISpecification) ifTrue:[ |
|
670 cls := self class |
|
671 ]. |
|
672 activeHelpTool dictionary:(cls helpSpec). |
712 activeHelpTool dictionary:(cls helpSpec). |
673 ]. |
713 ] |
674 ]. |
714 ]. |
675 ^ activeHelpTool |
715 ^ activeHelpTool |
676 |
|
677 "Modified: 17.6.1997 / 12:51:15 / cg" |
|
678 ! |
716 ! |
679 |
717 |
680 showHelp:aHelpText for:view |
718 showHelp:aHelpText for:view |
681 "hook to allow an application to display active help |
719 "hook to allow an application to display active help |
682 texts in its own info area. |
720 texts in its own info area. |
876 ]. |
914 ]. |
877 (list findFirst:[:n| n = oldSelection ]) ~~ 0 ifTrue:[ |
915 (list findFirst:[:n| n = oldSelection ]) ~~ 0 ifTrue:[ |
878 tabSelection := oldSelection |
916 tabSelection := oldSelection |
879 ] ifFalse:[ |
917 ] ifFalse:[ |
880 tabSelection := list first |
918 tabSelection := list first |
881 ] |
919 ]. |
882 ]. |
920 nameOfSpec := spec class name. |
|
921 ] ifTrue:[ |
|
922 nameOfSpec := '' |
|
923 ]. |
|
924 |
|
925 self showHelp:nameOfSpec for:nil. |
|
926 |
883 layoutTool layoutView:view. |
927 layoutTool layoutView:view. |
884 specTool specEdited:spec. |
928 specTool specification:spec. |
885 |
929 |
886 tabSelection notNil ifTrue:[ |
930 tabSelection notNil ifTrue:[ |
887 self isLayoutToolSelected ifTrue:[ |
931 self isLayoutToolSelected ifTrue:[ |
888 (self noteBookView subViews at:1) raise |
932 (self noteBookView subViews at:1) raise |
889 ] ifFalse:[ |
933 ] ifFalse:[ |
963 ! |
1007 ! |
964 |
1008 |
965 closeRequestFor:aTopView |
1009 closeRequestFor:aTopView |
966 "handle a close request for a specific view |
1010 "handle a close request for a specific view |
967 " |
1011 " |
968 |topView| |
1012 |topView id| |
969 |
1013 |
970 topView := self window. |
1014 topView := self window. |
971 |
1015 |
972 topView == aTopView ifTrue:[ |
1016 topView == aTopView ifTrue:[ |
973 super closeRequestFor:aTopView |
1017 super closeRequestFor:aTopView |
974 ] ifFalse:[ |
1018 ] ifFalse:[ |
|
1019 "/ aTopView beSlave. |
|
1020 aTopView beIndependent. |
|
1021 |
|
1022 aTopView unmap. |
|
1023 |
|
1024 aTopView = selectionPanel window ifTrue:[id := #raiseGallery] |
|
1025 ifFalse:[id := #raisePainter]. |
|
1026 |
|
1027 (builder componentAt:id) beVisible. |
975 topView raise. |
1028 topView raise. |
976 topView device beep |
|
977 ]. |
1029 ]. |
978 ! |
1030 ! |
979 |
1031 |
980 openInterface |
1032 openInterface |
981 "open interfaces |
1033 "open interfaces |
1278 ! |
1330 ! |
1279 |
1331 |
1280 doInstallHelp |
1332 doInstallHelp |
1281 |dict cls src| |
1333 |dict cls src| |
1282 |
1334 |
1283 specClass isNil ifTrue:[ |
1335 cls := self activeHelpApplicationClass. |
1284 ^ self information:'no class defined' |
|
1285 ]. |
|
1286 specClass isBehavior ifFalse:[ |
|
1287 cls := Smalltalk at:specClass asSymbol |
|
1288 ] ifTrue:[ |
|
1289 cls := specClass |
|
1290 ]. |
|
1291 |
1336 |
1292 cls isNil ifTrue:[ |
1337 cls isNil ifTrue:[ |
1293 ^ self information:'no class yet'. |
1338 ^ self information:'no application class defined' |
1294 ]. |
1339 ]. |
1295 |
1340 |
1296 activeHelpTool isNil ifTrue:[ |
1341 activeHelpTool isNil ifTrue:[ |
1297 ^ self information:'no help text defined' |
1342 ^ self information:'no help text defined' |
1298 ]. |
1343 ]. |
1299 dict := activeHelpTool dictionary. |
1344 dict := activeHelpTool dictionary. |
1300 (cls isSubclassOf:UISpecification) ifTrue:[ |
1345 src := '' writeStream. |
1301 cls := self class |
1346 |
1302 ]. |
1347 src nextPutAll: |
1303 |
1348 |
1304 src := '' writeStream. |
1349 'helpSpec |
1305 src nextPutAll:'helpSpec |
|
1306 "return a dictionary filled with helpKey -> helptext associations. |
1350 "return a dictionary filled with helpKey -> helptext associations. |
1307 These are used by the activeHelp tool." |
1351 These are used by the activeHelp tool. |
1308 |
1352 " |
1309 |dict| |
1353 ^ super helpSpec addPairsFrom:#( |
1310 |
1354 |
1311 dict := super helpSpec. |
|
1312 '. |
1355 '. |
1313 |
1356 |
1314 dict keysAndValuesDo:[:key :txt | |
1357 dict keysAndValuesDo:[:key :txt| |
1315 |t| |
1358 |t| |
1316 |
1359 src nextPutLine:key storeString. |
|
1360 |
1317 t := txt asString. |
1361 t := txt asString. |
1318 (t endsWith:Character cr) ifTrue:[t := t copyWithoutLast:1]. |
1362 (t endsWith:Character cr) ifTrue:[ |
1319 src nextPutLine:' dict at:' , key storeString , ' put:' , t storeString , '.'. |
1363 t := t copyWithoutLast:1 |
1320 ]. |
1364 ]. |
1321 src nextPutLine:' ^ dict'. |
1365 src nextPutLine:t storeString; cr. |
|
1366 ]. |
|
1367 src nextPutLine:')'. |
1322 src := src contents. |
1368 src := src contents. |
1323 Compiler compile:src forClass:cls class inCategory:'help specs' |
1369 Compiler compile:src forClass:cls class inCategory:'help specs' |
1324 ! |
1370 ! |
1325 |
1371 |
1326 doInstallSpec |
1372 doInstallSpec |