added #displayDottedRectangle... (for win95)
--- a/GC.st Fri Sep 18 17:12:34 1998 +0200
+++ b/GC.st Fri Sep 18 17:14:46 1998 +0200
@@ -1028,6 +1028,49 @@
"Created: 8.5.1996 / 08:47:06 / cg"
!
+displayDottedRectangleX:x y:y width:w height:h
+ "draw a dotted-line rectangle
+ A general implementation is found here; deviceGC's
+ may reimplement this if directly supported by the device"
+
+ |lastX lastY x0 y0|
+
+ "/ oldStyle := lineStyle.
+ "/ self lineStyle:#dotted.
+ "/ self displayRectangleX:x y:y width:w height:h.
+ "/ self lineStyle:oldStyle.
+
+ 1 to:w-1 by:2 do:[:o |
+ lastX := x + o.
+ self displayPointX:lastX y:y.
+ ].
+ y0 := 1.
+ lastX == (x+w-1) ifTrue:[
+ y0 := 0
+ ].
+ y0 to:h-1 by:2 do:[:o |
+ lastY := y+o.
+ self displayPointX:x+w-1 y:lastY.
+ ].
+ x0 := w-2.
+ lastY == (y+h-1) ifTrue:[
+ x0:= w-1
+ ].
+ x0 to:0 by:-2 do:[:o |
+ lastX := x+o.
+ self displayPointX:lastX y:y+h-1.
+ ].
+ y0 := h-1.
+ lastX == 0 ifTrue:[
+ y0 := h-1
+ ].
+ y0 to:0 by:-2 do:[:o |
+ self displayPointX:x y:y+o.
+ ].
+
+ "Modified: / 18.9.1998 / 16:31:09 / cg"
+!
+
displayLineFromX:x0 y:y0 toX:x1 y:y1
"draw a line from x0/y0 to x1/y1"
@@ -2025,6 +2068,6 @@
!GraphicsContext class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/Attic/GC.st,v 1.68 1998-08-24 16:24:08 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/Attic/GC.st,v 1.69 1998-09-18 15:14:46 cg Exp $'
! !
GraphicsContext initialize!
--- a/GraphicsContext.st Fri Sep 18 17:12:34 1998 +0200
+++ b/GraphicsContext.st Fri Sep 18 17:14:46 1998 +0200
@@ -1028,6 +1028,49 @@
"Created: 8.5.1996 / 08:47:06 / cg"
!
+displayDottedRectangleX:x y:y width:w height:h
+ "draw a dotted-line rectangle
+ A general implementation is found here; deviceGC's
+ may reimplement this if directly supported by the device"
+
+ |lastX lastY x0 y0|
+
+ "/ oldStyle := lineStyle.
+ "/ self lineStyle:#dotted.
+ "/ self displayRectangleX:x y:y width:w height:h.
+ "/ self lineStyle:oldStyle.
+
+ 1 to:w-1 by:2 do:[:o |
+ lastX := x + o.
+ self displayPointX:lastX y:y.
+ ].
+ y0 := 1.
+ lastX == (x+w-1) ifTrue:[
+ y0 := 0
+ ].
+ y0 to:h-1 by:2 do:[:o |
+ lastY := y+o.
+ self displayPointX:x+w-1 y:lastY.
+ ].
+ x0 := w-2.
+ lastY == (y+h-1) ifTrue:[
+ x0:= w-1
+ ].
+ x0 to:0 by:-2 do:[:o |
+ lastX := x+o.
+ self displayPointX:lastX y:y+h-1.
+ ].
+ y0 := h-1.
+ lastX == 0 ifTrue:[
+ y0 := h-1
+ ].
+ y0 to:0 by:-2 do:[:o |
+ self displayPointX:x y:y+o.
+ ].
+
+ "Modified: / 18.9.1998 / 16:31:09 / cg"
+!
+
displayLineFromX:x0 y:y0 toX:x1 y:y1
"draw a line from x0/y0 to x1/y1"
@@ -2025,6 +2068,6 @@
!GraphicsContext class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/GraphicsContext.st,v 1.68 1998-08-24 16:24:08 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/GraphicsContext.st,v 1.69 1998-09-18 15:14:46 cg Exp $'
! !
GraphicsContext initialize!