Tools__BrowserList.st
changeset 14196 88445b43e752
parent 14164 e638a1c10eef
child 14378 f72e7478174e
--- a/Tools__BrowserList.st	Wed Apr 09 17:34:51 2014 +0200
+++ b/Tools__BrowserList.st	Thu Apr 10 11:56:57 2014 +0200
@@ -30,7 +30,7 @@
 Object subclass:#SearchHandler
 	instanceVariableNames:'listView listViewVisualBlock listViewSelectedVisualBlock
 		listHolder listSelectionHolder searchField searchWindow
-		searchHolder'
+		searchHolder nextDelegate'
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:BrowserList
@@ -1644,6 +1644,26 @@
 
 !BrowserList::SearchHandler methodsFor:'event handling'!
 
+buttonMotion:button x:x y:y view:aView
+    nextDelegate notNil ifTrue:[
+        ^ (nextDelegate respondsTo: #buttonMotion:x:y:view:)
+            and:[nextDelegate buttonMotion:button x:x y:y view:aView]
+    ].
+    ^false
+
+    "Created: / 10-04-2014 / 11:43:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+buttonPress:button x:x y:y view:aView
+    nextDelegate notNil ifTrue:[
+        ^ (nextDelegate respondsTo: #buttonPress:x:y:view:)
+            and:[nextDelegate buttonPress:button x:x y:y view:aView]
+    ].
+    ^false
+
+    "Created: / 10-04-2014 / 11:43:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 keyPress:key x:x y:y view:aView
     <resource: #keyboard (#Escape #Accept #Return #CursorUp #CursorDown)>
 
@@ -1668,32 +1688,73 @@
         searchWindow isNil ifTrue:[
             key isCharacter ifTrue:[
                 searchHolder setValue: key asString.
-                self startSearch
+                self startSearch.
+                ^ self
             ]
         ] ifFalse:[
-            key == #Escape ifTrue:[self stopSearch].
-            key == #Accept ifTrue:[self stopSearch].
-            key == #Return ifTrue:[self stopSearch].
+            key == #Escape ifTrue:[self stopSearch. ^ self].
+            key == #Accept ifTrue:[self stopSearch. ^ self].
+            key == #Return ifTrue:[self stopSearch. ^ self].
         ]
     ].
 
     aView == searchField ifTrue:[
-        key == #Escape ifTrue:[self stopSearch].
-        key == #Accept ifTrue:[self stopSearch].
-        key == #Return ifTrue:[self stopSearch].
+        key == #Escape ifTrue:[self stopSearch. ^ self].
+        key == #Accept ifTrue:[self stopSearch. ^ self].
+        key == #Return ifTrue:[self stopSearch. ^ self].
         (key == #CursorUp or:[key == #CursorDown]) ifTrue:[
             listView sensor setCtrlDown: false.
             listView sensor setShiftDown: false.
-            listView keyPress:key x:x y:y
+            listView keyPress:key x:x y:y.
+            ^ self
         ].
+    ].
 
-    ]
+    nextDelegate notNil ifTrue:[
+        ^ (nextDelegate respondsTo: #keyPress:x:y:view:)
+            and:[nextDelegate keyPress:key x:x y:y view:aView]
+    ].
 
     "Created: / 27-07-2011 / 20:39:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 10-04-2014 / 11:44:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+keyRelease:key x:x y:y view:aView
+    nextDelegate notNil ifTrue:[
+        ^ (nextDelegate respondsTo: #keyRelease:x:y:view:)
+            and:[nextDelegate keyRelease:key x:x y:y view:aView]
+    ].
+    ^false
+
+    "Created: / 10-04-2014 / 11:41:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !BrowserList::SearchHandler methodsFor:'event handling-queries'!
 
+handlesButtonMotion:something inView:aView
+    "I am not interested in button events"
+
+    nextDelegate notNil ifTrue:[
+        ^ (nextDelegate respondsTo: #handlesButtonMotion:inView:)
+            and:[nextDelegate handlesButtonMotion:something inView:aView]
+    ].
+    ^false
+
+    "Modified: / 10-04-2014 / 11:40:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+handlesButtonPress:something inView:aView
+    "I am not interested in button events"
+
+    nextDelegate notNil ifTrue:[
+        ^ (nextDelegate respondsTo: #handlesButtonPress:inView:)
+            and:[nextDelegate handlesButtonPress:something inView:aView]
+    ].
+    ^false
+
+    "Modified: / 10-04-2014 / 11:40:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 handlesKeyPress:key inView:aView
     <resource: #keyboard (#Escape #Accept #Return #CursorUp #CursorDown)>
 
@@ -1707,9 +1768,29 @@
             ^true
         ]
     ].
+
+    nextDelegate notNil ifTrue:[
+        ^ (nextDelegate respondsTo: #handlesKeyPress:inView:)
+            and:[nextDelegate handlesKeyPress:key inView:aView]
+    ].
     ^false
 
     "Created: / 27-07-2011 / 20:39:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 10-04-2014 / 11:39:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+handlesKeyRelease:key inView:aView
+    "this is the query from the sensor to ask me if I would like to
+     get a keyRelease event for key from aView. Return true, if I want so,
+     false otherwise."
+
+    nextDelegate notNil ifTrue:[
+        ^ (nextDelegate respondsTo: #handlesKeyRelease:inView:)
+            and:[nextDelegate handlesKeyRelease:key inView:aView]
+    ].
+    ^false
+
+    "Modified: / 10-04-2014 / 11:40:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !BrowserList::SearchHandler methodsFor:'initialization'!
@@ -1721,11 +1802,13 @@
     ] ifFalse:[
         listView := aView.
     ].
+    nextDelegate := listView delegate.
     listView delegate: self.
     searchHolder := ValueHolder with: nil.
     searchHolder onChangeSend: #updateList to: self.
 
     "Created: / 27-07-2011 / 20:32:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 10-04-2014 / 11:36:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !BrowserList::SearchHandler methodsFor:'private'!
@@ -1929,10 +2012,10 @@
 !BrowserList class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__BrowserList.st,v 1.65 2014-03-26 10:00:25 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__BrowserList.st,v 1.66 2014-04-10 09:56:57 vrany Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__BrowserList.st,v 1.65 2014-03-26 10:00:25 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__BrowserList.st,v 1.66 2014-04-10 09:56:57 vrany Exp $'
 ! !