--- a/SelectionInTreeView.st Wed Dec 12 16:18:27 2001 +0100
+++ b/SelectionInTreeView.st Wed Dec 12 17:01:01 2001 +0100
@@ -1447,25 +1447,37 @@
^ self
].
- (key == #CursorLeft or:[key == #CursorRight]) ifTrue:[
- (idx := self selectedIndex) == 0 ifTrue:[ ^ self ].
-
- (key == #CursorLeft) ifTrue:[ inc := -1. end := 0 ]
- ifFalse:[ inc := 1. end := 1 + listOfNodes size ].
-
- [(idx := idx + inc) ~~ end] whileTrue:[
- node := listOfNodes at:idx.
- node hasChildren ifTrue:[
- ^ self key:key select:idx x:x y:y
- ]
+ "/ cg: its nicer to expand/collaps on these keys
+ key == #CursorRight ifTrue:[
+ (node := self selectedNode) notNil ifTrue:[
+ model doExpand:node.
+ ^ self.
+ ].
+ ].
+ key == #CursorLeft ifTrue:[
+ (node := self selectedNode) notNil ifTrue:[
+ model doCollapse:node.
+ ^ self.
].
- ^ self
].
+
+ "/ search fwd/bwd for a node with children
+
+"/ (key == #CursorLeft or:[key == #CursorRight]) ifTrue:[
+"/ (idx := self selectedIndex) == 0 ifTrue:[ ^ self ].
+"/
+"/ (key == #CursorLeft) ifTrue:[ inc := -1. end := 0 ]
+"/ ifFalse:[ inc := 1. end := 1 + listOfNodes size ].
+"/
+"/ [(idx := idx + inc) ~~ end] whileTrue:[
+"/ node := listOfNodes at:idx.
+"/ node hasChildren ifTrue:[
+"/ ^ self key:key select:idx x:x y:y
+"/ ]
+"/ ].
+"/ ^ self
+"/ ].
^ super keyPress:key x:x y:y
-
-
-
-
! !
!SelectionInTreeView methodsFor:'initialize / release'!
@@ -2468,5 +2480,5 @@
!SelectionInTreeView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInTreeView.st,v 1.96 2001-11-19 15:28:39 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInTreeView.st,v 1.97 2001-12-12 16:01:01 cg Exp $'
! !