SimpleBorder.st
changeset 5437 75f2638be06f
parent 5432 983983b0c312
child 6715 c02e6d42e2cb
--- a/SimpleBorder.st	Thu Oct 29 16:59:05 2009 +0100
+++ b/SimpleBorder.st	Thu Oct 29 16:59:43 2009 +0100
@@ -65,18 +65,49 @@
 !SimpleBorder methodsFor:'displaying'!
 
 displayOn:aGC forDisplayBox:aRectangle
-    |oldPaint|
+    |oldPaint boxLeft boxTop boxWidth boxHeight|
 
     color isNil ifTrue:[ ^ self].
 
     oldPaint := aGC paint.
     aGC paint:color.
-    aGC displayRectangle:aRectangle.
+    width == 1 ifTrue:[
+        aGC displayRectangle:aRectangle.
+    ] ifFalse:[
+        boxLeft := aRectangle left.
+        boxTop := aRectangle top.
+        boxWidth := aRectangle width.
+        boxHeight := aRectangle height.
+        aGC fillRectangleX:boxLeft y:boxTop width:boxWidth height:width.
+        aGC fillRectangleX:boxLeft y:boxTop+boxHeight-width width:boxWidth height:width.
+        aGC fillRectangleX:boxLeft y:boxTop+width width:width height:boxHeight-width-width.
+        aGC fillRectangleX:boxLeft+boxWidth-width y:boxTop+width width:width height:boxHeight-width-width.
+    ].
     aGC paint:oldPaint.
+
+    "
+     View new
+        border:(SimpleBorder width:2 color:Color red);
+        open.
+    "
+    "
+     View new
+        border:(SimpleBorder width:4 color:Color red);
+        open.
+    "
+
+    "
+     StandardSystemView new
+        extent:200@200;
+        add:(View new
+                origin:(10@10) corner:0.9@0.9;
+                border:(SimpleBorder width:4 color:Color red));
+        open.
+    "
 ! !
 
 !SimpleBorder class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/SimpleBorder.st,v 1.5 2009-10-29 15:13:32 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/SimpleBorder.st,v 1.6 2009-10-29 15:59:43 cg Exp $'
 ! !