equal
deleted
inserted
replaced
1043 |
1043 |
1044 ^ 0@0 |
1044 ^ 0@0 |
1045 ! |
1045 ! |
1046 |
1046 |
1047 whiteColor |
1047 whiteColor |
|
1048 "return the white color on this device. |
|
1049 This is the same as 'Color white on:self device', but much faster." |
|
1050 |
1048 ^ device whiteColor |
1051 ^ device whiteColor |
1049 ! ! |
1052 ! ! |
1050 |
1053 |
1051 !GraphicsContext methodsFor:'accessing-transformation'! |
1054 !GraphicsContext methodsFor:'accessing-transformation'! |
1052 |
1055 |
2121 shadow:self blackColor light:self whiteColor |
2124 shadow:self blackColor light:self whiteColor |
2122 halfShadow:nil halfLight:nil |
2125 halfShadow:nil halfLight:nil |
2123 style:nil |
2126 style:nil |
2124 ! |
2127 ! |
2125 |
2128 |
2126 drawEdgesForX:x y:y width:w height:h level:l |
2129 drawEdgesForX:x y:y width:w height:h level:lvl |
2127 shadow:shadowColor light:lightColor |
2130 shadow:shadowColor light:lightColor |
2128 halfShadow:halfShadowColor halfLight:halfLightColor |
2131 halfShadow:halfShadowColor halfLight:halfLightColor |
2129 style:edgeStyle |
2132 style:edgeStyle |
2130 |
2133 |
2131 "draw 3D edges into a rectangle" |
2134 "draw 3D edges into a rectangle" |
2136 b |
2139 b |
2137 xi "{ Class: SmallInteger }" |
2140 xi "{ Class: SmallInteger }" |
2138 yi "{ Class: SmallInteger }" |
2141 yi "{ Class: SmallInteger }" |
2139 run paint| |
2142 run paint| |
2140 |
2143 |
2141 count := l. |
2144 count := lvl. |
2142 (count < 0) ifTrue:[ |
2145 (count < 0) ifTrue:[ |
2143 topLeftFg := shadowColor. |
2146 topLeftFg := shadowColor. |
2144 botRightFg := lightColor. |
2147 botRightFg := lightColor. |
2145 topLeftHalfFg := halfShadowColor. |
2148 topLeftHalfFg := halfShadowColor. |
2146 botRightHalfFg := halfLightColor. |
2149 botRightHalfFg := halfLightColor. |
2183 " |
2186 " |
2184 self paint:topLeftFg. |
2187 self paint:topLeftFg. |
2185 self displayDeviceLineFromX:x y:y toX:r y:y. |
2188 self displayDeviceLineFromX:x y:y toX:r y:y. |
2186 self displayDeviceLineFromX:x y:y toX:x y:b |
2189 self displayDeviceLineFromX:x y:y toX:x y:b |
2187 " |
2190 " |
2188 (l > 1) ifTrue:[ |
2191 (lvl > 1) ifTrue:[ |
2189 edgeStyle == #softWin95 ifTrue:[ |
2192 edgeStyle == #softWin95 ifTrue:[ |
2190 self paint:(Color veryLightGrey). |
2193 self paint:(Color veryLightGray). |
2191 ] ifFalse:[ |
2194 ] ifFalse:[ |
2192 (l > 2 and:[edgeStyle == #soft]) ifTrue:[ |
2195 (lvl > 2 and:[edgeStyle == #soft]) ifTrue:[ |
2193 self paint:(device blackColor). |
2196 self paint:(device blackColor). |
2194 ] ifFalse:[ |
2197 ] ifFalse:[ |
2195 self paint:halfLightColor. |
2198 self paint:halfLightColor. |
2196 ] |
2199 ] |
2197 ]. |
2200 ]. |
2226 self displayDeviceLineFromX:run y:yi-1 toX:run y:b. "right" |
2229 self displayDeviceLineFromX:run y:yi-1 toX:run y:b. "right" |
2227 xi := xi + 1. |
2230 xi := xi + 1. |
2228 yi := yi + 1 |
2231 yi := yi + 1 |
2229 ]. |
2232 ]. |
2230 ((edgeStyle == #soft or:[edgeStyle == #softWin95]) |
2233 ((edgeStyle == #soft or:[edgeStyle == #softWin95]) |
2231 and:[l > 1]) ifTrue:[ |
2234 and:[lvl > 1]) ifTrue:[ |
2232 self paint:(device blackColor) "shadowColor". |
2235 self paint:(device blackColor) "shadowColor". |
2233 self displayDeviceLineFromX:x y:b toX:r y:b. |
2236 self displayDeviceLineFromX:x y:b toX:r y:b. |
2234 self displayDeviceLineFromX:r y:y toX:r y:b |
2237 self displayDeviceLineFromX:r y:y toX:r y:b |
2235 ]. |
2238 ]. |
2236 |
2239 |
2519 ! ! |
2522 ! ! |
2520 |
2523 |
2521 !GraphicsContext class methodsFor:'documentation'! |
2524 !GraphicsContext class methodsFor:'documentation'! |
2522 |
2525 |
2523 version |
2526 version |
2524 ^ '$Header: /cvs/stx/stx/libview/GraphicsContext.st,v 1.136 2014-04-12 11:35:51 cg Exp $' |
2527 ^ '$Header: /cvs/stx/stx/libview/GraphicsContext.st,v 1.137 2014-07-08 21:21:04 cg Exp $' |
2525 ! |
2528 ! |
2526 |
2529 |
2527 version_CVS |
2530 version_CVS |
2528 ^ '$Header: /cvs/stx/stx/libview/GraphicsContext.st,v 1.136 2014-04-12 11:35:51 cg Exp $' |
2531 ^ '$Header: /cvs/stx/stx/libview/GraphicsContext.st,v 1.137 2014-07-08 21:21:04 cg Exp $' |
2529 ! ! |
2532 ! ! |
2530 |
2533 |
2531 |
2534 |
2532 GraphicsContext initialize! |
2535 GraphicsContext initialize! |