--- a/SimpleBorder.st Sat Oct 24 12:07:52 2009 +0200
+++ b/SimpleBorder.st Sat Oct 24 12:07:55 2009 +0200
@@ -1,7 +1,7 @@
"
COPYRIGHT (c) 1997 by eXept Software AG
COPYRIGHT (c) 2009 by eXept Software AG
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -13,7 +13,7 @@
"{ Package: 'stx:libview' }"
AbstractBorder subclass:#SimpleBorder
- instanceVariableNames:'color width'
+ instanceVariableNames:'color'
classVariableNames:''
poolDictionaries:''
category:'Graphics-Support'
@@ -25,7 +25,7 @@
"
COPYRIGHT (c) 1997 by eXept Software AG
COPYRIGHT (c) 2009 by eXept Software AG
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -38,7 +38,7 @@
documentation
"
- extracted from Border.
+ a simple border, where all four sides are drawn in the same solid color
[author:]
Claus Gittinger
@@ -47,58 +47,31 @@
!SimpleBorder methodsFor:'accessing'!
-bottom
- ^ width
-!
-
-bottomColor
- ^ color
-!
-
-left
- ^ width
-!
-
-leftColor
- ^ color
-!
-
-right
- ^ width
-!
-
-rightColor
+color
^ color
!
-setBorderColor:newColor
- "set all four colors"
-
- color := newColor
-!
-
-setBorderWidth:newBorderWidth
- "set all four widths"
+color:aColor
+ "set the width"
- width := newBorderWidth
-!
-
-top
- ^ width
-!
-
-topColor
- ^ color
+ color := aColor
! !
-!SimpleBorder methodsFor:'queries'!
+!SimpleBorder methodsFor:'displaying'!
+
+displayOn:aGC forDisplayBox:aRectangle
+ |oldPaint|
-allSidesEqual:aSmallInteger
- ^ width == aSmallInteger
+ color isNil ifTrue:[^ self].
+
+ oldPaint := aGC paint.
+ aGC paint:color.
+ aGC displayRectangle:aRectangle.
+ aGC paint:oldPaint.
! !
!SimpleBorder class methodsFor:'documentation'!
version_CVS
- ^ '$Header: /cvs/stx/stx/libview/SimpleBorder.st,v 1.2 2009-10-23 15:23:52 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/SimpleBorder.st,v 1.3 2009-10-24 10:07:55 cg Exp $'
! !