687 asking models and views encountered while walking. |
687 asking models and views encountered while walking. |
688 The first one who understands and returns a nonNil answer to the |
688 The first one who understands and returns a nonNil answer to the |
689 #helpTextFor:at: or #helpTextFor: message ends this search and the |
689 #helpTextFor:at: or #helpTextFor: message ends this search and the |
690 returned string is returned." |
690 returned string is returned." |
691 |
691 |
692 |text| |
692 |text pntRel v superView| |
693 |
693 |
694 text := self basicHelpTextFor:aView at:aDevicePointOrNil. |
694 text := self basicHelpTextFor:aView at:aDevicePointOrNil. |
695 |
695 text notNil ifTrue:[^ text]. |
696 "/ in case of embedded toggles, buttons, etc. |
696 |
697 "/ walk along the container hierarchy... |
697 "/ I guess the following is already done in basicHelpTextFor:at: |
698 text isNil ifTrue:[ |
698 ^ nil. |
699 |pntRel v| |
699 |
700 |
700 "/ "/ in case of embedded toggles, buttons, etc. |
701 pntRel := aDevicePointOrNil. |
701 "/ "/ walk along the container hierarchy... |
702 v := aView. |
702 "/ pntRel := aDevicePointOrNil. |
703 [text isNil and:[v superView notNil]] whileTrue:[ |
703 "/ v := aView. |
704 pntRel notNil ifTrue:[ |
704 "/ [(superView := v superView) notNil] whileTrue:[ |
705 pntRel := aView device translatePoint:pntRel fromView:v toView:(v superView). |
705 "/ pntRel notNil ifTrue:[ |
706 ]. |
706 "/ pntRel := aView device translatePoint:pntRel fromView:v toView:superView. |
707 v := v superView. |
707 "/ ]. |
708 text := self basicHelpTextFor:v at:pntRel |
708 "/ v := superView. |
709 ]. |
709 "/ text := self basicHelpTextFor:v at:pntRel. |
710 v superView isNil ifTrue:[ |
710 "/ text notNil ifTrue:[^ text]. |
711 Debugging ifTrue:['no superview provides helptext' infoPrintCR]. |
711 "/ ]. |
712 ^ nil |
712 "/ |
713 ]. |
713 "/ v superView isNil ifTrue:[ |
714 ]. |
714 "/ Debugging ifTrue:['no superview provides helptext' infoPrintCR]. |
715 ^ text |
715 "/ ]. |
|
716 "/ ^ nil |
716 ! |
717 ! |
717 |
718 |
718 helpTextFromModel:aModelOrTopView view:aView at:aPointOrNil |
719 helpTextFromModel:aModelOrTopView view:aView at:aPointOrNil |
719 "helper: ask aModel for its helpText." |
720 "helper: ask aModel for its helpText." |
720 |
721 |