added #displayDottedRectangle... (for win95)
authorClaus Gittinger <cg@exept.de>
Fri, 18 Sep 1998 17:14:46 +0200
changeset 2354 2755d3d1addd
parent 2353 e04098201f7c
child 2355 1ae8b3b10037
added #displayDottedRectangle... (for win95)
GC.st
GraphicsContext.st
--- 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!