--- a/ActiveHelp.st Tue Aug 29 19:46:11 1995 +0200
+++ b/ActiveHelp.st Wed Aug 30 01:43:11 1995 +0200
@@ -24,13 +24,22 @@
version
"
-$Header: /cvs/stx/stx/libview2/ActiveHelp.st,v 1.3 1995-08-29 17:46:11 claus Exp $
+$Header: /cvs/stx/stx/libview2/ActiveHelp.st,v 1.4 1995-08-29 23:42:57 claus Exp $
"
!
documentation
"
- The active help listener
+ The active help listener.
+ The one and only instance of myself intercepts incoming mouse & keyboard
+ events for the display device, being especially interested in view-enter/
+ leave ebents. When such an event arrives, it asks the corresponding view
+ or its model for a help message and display it via an ActiveHelpView.
+ All I need for automatic help is some model/view/applicationModel along
+ the superview chain of the entered component, which responds to the
+ #helpTextFor: message with a non-nil (string-) answer.
+ I close down the help view after a while, if a key is pressed or the mouse
+ moved to another view.
"
!
@@ -145,10 +154,11 @@
!
hideIfPointerLeft:aView
- |whereOnScreen|
+ |whereOnScreen p|
showProcess notNil ifTrue:[
- showProcess terminate.
+ p := showProcess. showProcess := nil.
+ p terminate.
].
whereOnScreen := aView device pointerPosition.
@@ -168,10 +178,11 @@
!
pointerEnter:state x:x y:y view:aView
- |text|
+ |text p|
showProcess notNil ifTrue:[
- showProcess terminate.
+ p := showProcess. showProcess := nil.
+ p terminate.
].
self hideIfPointerLeft:aView.
aView topView == currentHelpView ifTrue:[
@@ -183,7 +194,8 @@
text notNil ifTrue:[
DelayTime > 0 ifTrue:[
showProcess notNil ifTrue:[
- showProcess terminate.
+ p := showProcess. showProcess := nil.
+ p terminate.
].
showProcess := [
(Delay forSeconds:DelayTime) wait.
@@ -216,8 +228,11 @@
!ActiveHelp methodsFor:'show / hide help'!
hideHelp
+ |p|
+
showProcess notNil ifTrue:[
- showProcess terminate.
+ p := showProcess. showProcess := nil.
+ p terminate.
].
currentHelpView notNil ifTrue:[
[
@@ -228,17 +243,19 @@
].
currentFrame := nil.
closeProcess notNil ifTrue:[
- closeProcess terminate.
+ p := closeProcess. closeProcess := nil.
+ p terminate.
]
!
showHelp:aHelpText for:view
- |org|
+ |org p|
view == currentView ifTrue:[^ self].
closeProcess notNil ifTrue:[
- closeProcess terminate.
+ p := closeProcess. closeProcess := nil.
+ p terminate.
].
currentHelpView notNil ifTrue:[
self hideHelp