--- a/ObjectView.st Mon May 09 09:20:28 2005 +0200
+++ b/ObjectView.st Mon May 09 09:26:31 2005 +0200
@@ -2912,7 +2912,11 @@
(selection == something) ifFalse:[
self hideSelection.
- selection := something.
+ (something isCollection and:[something size == 0]) ifTrue:[
+ selection := nil.
+ ] ifFalse:[
+ selection := something.
+ ].
self showSelection.
self changed:#selection with:selection.
]
@@ -2923,51 +2927,31 @@
selectAll
"select all objects"
- self hideSelection.
- selection := contents copy.
- self showSelection.
- self changed:#selection.
-
- "Modified: / 4.7.1999 / 15:22:56 / cg"
+ self select:contents copy.
!
selectAllIn:aRectangle
- "select all objects fully in aRectangle"
-
- self hideSelection.
- selection := OrderedCollection new.
+ "select all objects which are fully contained in aRectangle"
+
+ |newSelection|
+
+ newSelection := OrderedCollection new.
self objectsIn:aRectangle do:[:theObject |
- selection add:theObject
+ newSelection add:theObject
].
- (selection size == 0) ifTrue:[
- selection := nil
- ] ifFalse:[
- (selection size == 1) ifTrue:[selection := selection first]
- ].
- self showSelection.
- self changed:#selection.
-
- "Modified: / 4.7.1999 / 15:23:08 / cg"
+ self select:newSelection.
!
selectAllIntersecting:aRectangle
- "select all objects touched by aRectangle"
-
- self hideSelection.
- selection := OrderedCollection new.
-
+ "select all objects which are touched by aRectangle"
+
+ |newSelection|
+
+ newSelection := OrderedCollection new.
self objectsIntersecting:aRectangle do:[:theObject |
- selection add:theObject
+ newSelection add:theObject
].
- (selection size == 0) ifTrue:[
- selection := nil
- ] ifFalse:[
- (selection size == 1) ifTrue:[selection := selection first]
- ].
- self showSelection.
- self changed:#selection.
-
- "Modified: / 4.7.1999 / 15:23:15 / cg"
+ self select:newSelection.
!
selection
@@ -2991,7 +2975,7 @@
"show the selection - draw hilights - whatever that is"
self selectionDo:[:object |
- self showSelected:object
+ self showSelected:object
]
!
@@ -2999,9 +2983,7 @@
"unselect - hide selection; clear selection"
selection notNil ifTrue:[
- self hideSelection.
- selection := nil.
- self changed:#selection.
+ self select:nil.
]
"Modified: / 4.7.1999 / 15:30:36 / cg"
@@ -3360,5 +3342,5 @@
!ObjectView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/ObjectView.st,v 1.107 2004-09-21 10:53:43 ca Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/ObjectView.st,v 1.108 2005-05-09 07:26:31 cg Exp $'
! !