Ctrl-CursorUp/Down in tree
authorClaus Gittinger <cg@exept.de>
Mon, 23 Jan 2006 19:04:54 +0100
changeset 1957 cd30f8cd59f8
parent 1956 65cc475656d3
child 1958 109ef8358a55
Ctrl-CursorUp/Down in tree
UIPainter.st
--- a/UIPainter.st	Fri Jan 20 16:27:10 2006 +0100
+++ b/UIPainter.st	Mon Jan 23 19:04:54 2006 +0100
@@ -2856,6 +2856,44 @@
     ].
     super doesNotUnderstand:aMessage
 
+!
+
+processEvent:anEvent
+    "filter keyboard events.
+     Return true, if I have eaten the event"
+
+    |key|
+
+    anEvent isKeyPressEvent ifTrue:[ 
+
+        anEvent targetView == treeView ifFalse:[^ false].
+        treeView hasFocus ifFalse:[^ false].
+
+        key := anEvent key.
+
+"/        (anEvent rawKey == #Cmdr) ifTrue:[
+"/            self openNameEditorOnTreeSelection.
+"/            ^ true.
+"/        ].
+        (anEvent rawKey == #CtrlCursorUp) ifTrue:[ 
+            self doStepUp.
+            ^ true.
+        ].
+        (anEvent rawKey == #CtrlCursorDown) ifTrue:[ 
+            self doStepDown.
+            ^ true.
+        ].
+        (anEvent rawKey == #CtrlCursorLeft) ifTrue:[ 
+            self doStepOut.
+            ^ true.
+        ].
+        (anEvent rawKey == #CtrlCursorRight) ifTrue:[ 
+            self doStepIn.
+            ^ true.
+        ].
+    ].
+
+    ^ false.
 ! !
 
 !UIPainter methodsFor:'help'!
@@ -3652,9 +3690,13 @@
     "sets the initial selection"
 
     |myWindow canvasWindow canvasOrg galleryWindow 
-     galleryOrg myOrg myCorner|
+     galleryOrg myOrg myCorner windowGroup|
 
     super postOpenWith: aBuilder.
+
+    windowGroup := self topApplication windowGroup.
+    windowGroup addPreEventHook:self.
+
     treeView selection: #(1).
     aBuilder keyboardProcessor menuBar:nil.