.
authorclaus
Wed, 30 Aug 1995 01:43:11 +0200
changeset 98 ab8ed9e213d0
parent 97 72fbe8f7130f
child 99 a656b0c9dd21
.
ActiveHelp.st
ActiveHelpView.st
EventListener.st
--- 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
--- a/ActiveHelpView.st	Tue Aug 29 19:46:11 1995 +0200
+++ b/ActiveHelpView.st	Wed Aug 30 01:43:11 1995 +0200
@@ -25,13 +25,19 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview2/ActiveHelpView.st,v 1.3 1995-08-29 17:42:50 claus Exp $
+$Header: /cvs/stx/stx/libview2/ActiveHelpView.st,v 1.4 1995-08-29 23:43:00 claus Exp $
 "
 !
 
 documentation
 "
-    a talking view
+    a talking view.
+    Instances of myself show up either as a comics-like talking
+    view, or as a simple square popup. This is configured via the
+    styleSheet; the default is simple-square. To get the fancy cmics
+    view, add a resource 'activeHelpStyle' with a symbol-value of #cartoon.
+    However, be aware that some servers have performance problems with
+    these view-shapes (or do not support shapes at all).
 "
 !
 
--- a/EventListener.st	Tue Aug 29 19:46:11 1995 +0200
+++ b/EventListener.st	Wed Aug 30 01:43:11 1995 +0200
@@ -25,13 +25,23 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview2/EventListener.st,v 1.4 1995-08-29 17:43:34 claus Exp $
+$Header: /cvs/stx/stx/libview2/EventListener.st,v 1.5 1995-08-29 23:43:11 claus Exp $
 "
 !
 
 documentation
 "
-    abstract class for event listeners. See example use in ActiveHelp.
+    abstract class for event listeners. EventListeners can be used to intercept
+    incoming events (keyboard & mouse) directly from a sensor, or even
+    for a complete display device.
+    One application is the automatic help, which tracks entering/leaving
+    views, to popup some help message. See concrete code in ActiveHelp.
+    For each intercepted event, a corresponding method is called for in instances
+    of myself - these should return true, if the event is to be ignored (i.e.
+    assumed to be processed and consumed by the reader, or false, if the normal
+    event procedure should be performed. Since this is an abstract class,
+    all of my intercept methods return false. They are meant to be redefined
+    in concrete subclasses.
 "
 !