care for transformations.
authorClaus Gittinger <cg@exept.de>
Mon, 20 Mar 2006 14:53:19 +0100
changeset 2130 31edece2051b
parent 2129 e68ef88be0c7
child 2131 768a3cb71598
care for transformations.
ActiveHelp.st
--- a/ActiveHelp.st	Mon Mar 20 09:53:46 2006 +0100
+++ b/ActiveHelp.st	Mon Mar 20 14:53:19 2006 +0100
@@ -393,7 +393,7 @@
 
 !ActiveHelp methodsFor:'private'!
 
-helpTextFor:aView at:aPointOrNil 
+helpTextFor:aView at:aDevicePointOrNil 
     "retrieve helptext for aView as a string; 
      walk along the views superView chain,
      asking models and views encountered while walking.
@@ -401,31 +401,37 @@
      #helpTextFor:at: or #helpTextFor: message ends this search and the
      returned string is returned."
 
-    |model app1 app2 text v sv topView|
+    |model app1 app2 text v sv topView domainPointOrNil|
 
-    text := self helpTextFromView:aView at:aPointOrNil.
+    aView transformation notNil ifTrue:[
+        domainPointOrNil := aView transformation applyInverseTo:aDevicePointOrNil.
+    ] ifFalse:[
+        domainPointOrNil := aDevicePointOrNil.
+    ].
+
+    text := self helpTextFromView:aView at:domainPointOrNil.
     text notNil ifTrue:[ ^ text ].
 
     ((aView respondsTo:#application)
     and:[ (app1 := aView application) notNil ]) ifTrue:[
-        text := self helpTextFromModel:app1 view:aView at:aPointOrNil.
+        text := self helpTextFromModel:app1 view:aView at:domainPointOrNil.
         text notNil ifTrue:[ ^ text ].
     ] ifFalse:[
         "/ old style (i.e. StandardSystemView ...)
         topView := aView topView.
         (topView notNil and:[topView ~~ aView]) ifTrue:[
-            text := self helpTextFromModel:topView view:aView at:aPointOrNil.
+            text := self helpTextFromModel:topView view:aView at:domainPointOrNil.
             text notNil ifTrue:[ ^ text ].
         ]
     ].
 
     (model := aView model) notNil ifTrue:[
         model ~~ app1 ifTrue:[
-            text := self helpTextFromModel:model view:aView at:aPointOrNil.
+            text := self helpTextFromModel:model view:aView at:domainPointOrNil.
             text notNil ifTrue:[ ^ text ].
         ].
     ].
-    text := self helpTextFromView:aView at:aPointOrNil.
+    text := self helpTextFromView:aView at:domainPointOrNil.
     text notNil ifTrue:[ ^ text ].
 
     "walk up the chain - maybe someone knows about its subview ..."
@@ -434,7 +440,7 @@
         (sv := v container) notNil
     ] whileTrue:[
         (model := sv model) notNil ifTrue:[
-            text := self helpTextFromModel:model view:aView at:aPointOrNil.
+            text := self helpTextFromModel:model view:aView at:domainPointOrNil.
             text notNil ifTrue:[ ^ text ].
         ].
         text := self helpTextFromView:sv at:nil.
@@ -445,14 +451,14 @@
     (v notNil and:[v respondsTo:#application]) ifTrue:[
         (app2 := v application) notNil ifTrue:[
             (app2 ~~ app1) ifTrue:[
-                text := self helpTextFromModel:app2 view:aView at:aPointOrNil.
+                text := self helpTextFromModel:app2 view:aView at:domainPointOrNil.
                 text notNil ifTrue:[ ^ text ].
             ]
         ]
     ].
     (v notNil and:[v respondsTo:#model]) ifTrue:[
         (model := v model) notNil ifTrue:[
-            text := self helpTextFromModel:model view:aView at:aPointOrNil.
+            text := self helpTextFromModel:model view:aView at:domainPointOrNil.
             text notNil ifTrue:[ ^ text ].
         ]
     ].
@@ -549,15 +555,16 @@
                 ^ self
             ].
 
-sensor := aView sensor.
-sensor notNil ifTrue:[
-  sensor flushEventsFor:self withType:#initiateHelpFor:at:.
-  sensor 
-    pushUserEvent:#initiateHelpFor:at: for:self 
-    withArguments:(Array with:aView with:(x @ y)).
-  ^ self.
-].
-            self initiateHelpFor:aView at:(x @ y).
+            "/ if there is a sensor, let the view do it itself (in its process)
+            sensor := aView sensor.
+            sensor notNil ifTrue:[
+              sensor flushEventsFor:self withType:#initiateHelpFor:at:.
+              sensor 
+                pushUserEvent:#initiateHelpFor:at: for:self 
+                withArguments:(Array with:aView with:(x @ y)).
+            ] ifFalse:[
+                self initiateHelpFor:aView at:(x @ y).
+            ]
         ].
     ].
 !
@@ -683,7 +690,7 @@
 !ActiveHelp class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/ActiveHelp.st,v 1.57 2006-01-20 14:52:57 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/ActiveHelp.st,v 1.58 2006-03-20 13:53:19 cg Exp $'
 ! !
 
 ActiveHelp initialize!