SimpleView.st
changeset 6515 5d55e5781b73
parent 6490 deef195b37b8
child 6516 41d8ab4b00c4
--- a/SimpleView.st	Mon Jun 16 14:04:00 2014 +0200
+++ b/SimpleView.st	Wed Jun 18 12:00:51 2014 +0200
@@ -1998,24 +1998,31 @@
     "Modified: 23.10.2009 / 14:11:50 / cg"
 !
 
-borderWidth:aNumber
+borderWidth:aNumberOrNil
     "set my borderWidth"
+    |aNumber|
+
+    aNumber := aNumberOrNil.
+    aNumber notNil ifTrue:[
+        self assert:(aNumber >= 0).
+        aNumber := aNumber max: 0 
+    ].
 
     "/ backward compatibility
     "/ superView will be renamed to container soon.
     (superView notNil and:[superView isBorderedWrapper]) ifTrue:[
-	^ superView borderWidth:aNumber
+        ^ superView borderWidth:aNumber
     ].
 
     (aNumber == 0 or:[aNumber isNil]) ifTrue:[
-	border isNil ifTrue:[^ self].
-	self border:nil.
+        border isNil ifTrue:[^ self].
+        self border:nil.
     ] ifFalse:[
-	border notNil ifTrue:[
-	    self border:(border copy width:aNumber)
-	] ifFalse:[
-	    self border:(SimpleBorder new width:aNumber color:(self borderColor)).
-	]
+        border notNil ifTrue:[
+            self border:(border copy width:aNumber)
+        ] ifFalse:[
+            self border:(SimpleBorder new width:aNumber color:(self borderColor)).
+        ]
     ].
 
 "/    (aNumber ~~ borderWidth) ifTrue:[
@@ -11224,11 +11231,11 @@
 !SimpleView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.754 2014-06-03 16:19:48 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.755 2014-06-18 10:00:51 ca Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.754 2014-06-03 16:19:48 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.755 2014-06-18 10:00:51 ca Exp $'
 !
 
 version_SVN