245
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1996 by Claus Gittinger
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
|
|
14 |
|
252
|
15 |
GeometricWrapper subclass:#FillingWrapper
|
245
|
16 |
instanceVariableNames:''
|
|
17 |
classVariableNames:''
|
|
18 |
poolDictionaries:''
|
|
19 |
category:'Graphics-Display Objects'
|
|
20 |
!
|
|
21 |
|
|
22 |
!FillingWrapper class methodsFor:'documentation'!
|
|
23 |
|
|
24 |
copyright
|
|
25 |
"
|
|
26 |
COPYRIGHT (c) 1996 by Claus Gittinger
|
|
27 |
All Rights Reserved
|
|
28 |
|
|
29 |
This software is furnished under a license and may be used
|
|
30 |
only in accordance with the terms of that license and with the
|
|
31 |
inclusion of the above copyright notice. This software may not
|
|
32 |
be provided or otherwise made available to, or used by, any
|
|
33 |
other person. No title to or ownership of the software is
|
|
34 |
hereby transferred.
|
|
35 |
"
|
|
36 |
|
|
37 |
|
|
38 |
!
|
|
39 |
|
|
40 |
documentation
|
|
41 |
"
|
|
42 |
a wrapper for a geometric object, which is to be drawn filled.
|
|
43 |
This allows any geometric thingy to be used as a filled component in a view.
|
|
44 |
|
248
|
45 |
[see also:]
|
|
46 |
StrokingWrapper Geometric GraphicsContext
|
|
47 |
|
245
|
48 |
[author:]
|
|
49 |
Claus Gittinger
|
|
50 |
"
|
|
51 |
|
|
52 |
|
|
53 |
!
|
|
54 |
|
|
55 |
examples
|
|
56 |
"
|
|
57 |
[exBegin]
|
|
58 |
|v e component|
|
|
59 |
|
|
60 |
v := View extent:250@250.
|
|
61 |
|
|
62 |
e := EllipticalArc boundingBox:(10@10 corner:90@90)
|
|
63 |
startAngle:0
|
|
64 |
sweepAngle:270.
|
|
65 |
v addComponent:(StrokingWrapper on:e).
|
|
66 |
|
|
67 |
e := EllipticalArc boundingBox:(110@110 corner:190@190)
|
|
68 |
startAngle:0
|
|
69 |
sweepAngle:270.
|
|
70 |
v addComponent:(FillingWrapper on:e).
|
|
71 |
v open
|
|
72 |
[exEnd]
|
|
73 |
|
|
74 |
|
|
75 |
[exBegin]
|
|
76 |
|v e component|
|
|
77 |
|
|
78 |
v := View new.
|
|
79 |
v extent:250@250.
|
|
80 |
|
|
81 |
e := Rectangle origin:10@10 corner:90@90.
|
|
82 |
component := FillingWrapper on:e.
|
|
83 |
component foregroundColor:Color red.
|
|
84 |
|
|
85 |
v addComponent:component.
|
|
86 |
|
|
87 |
e := EllipticalArc boundingBox:(10@10 corner:90@90)
|
|
88 |
startAngle:0 sweepAngle:270.
|
|
89 |
component := StrokingWrapper on:e.
|
|
90 |
component lineWidth:5.
|
|
91 |
|
|
92 |
v addComponent:component.
|
|
93 |
|
|
94 |
v addComponent:(Button label:'hello').
|
|
95 |
|
|
96 |
v open
|
|
97 |
[exEnd]
|
|
98 |
"
|
|
99 |
|
|
100 |
! !
|
|
101 |
|
|
102 |
!FillingWrapper methodsFor:'displaying'!
|
|
103 |
|
|
104 |
displayOn:aGC
|
246
|
105 |
"display myself - here, display the geometric object asFilled"
|
|
106 |
|
245
|
107 |
|prevFg|
|
|
108 |
|
|
109 |
prevFg := aGC paint.
|
|
110 |
|
|
111 |
aGC paint:fgColor.
|
|
112 |
|
|
113 |
component displayFilledOn:aGC.
|
|
114 |
|
|
115 |
aGC paint:prevFg.
|
|
116 |
|
|
117 |
"Created: 8.5.1996 / 23:54:06 / cg"
|
246
|
118 |
"Modified: 9.5.1996 / 00:11:27 / cg"
|
245
|
119 |
! !
|
|
120 |
|
|
121 |
!FillingWrapper class methodsFor:'documentation'!
|
|
122 |
|
|
123 |
version
|
252
|
124 |
^ '$Header: /cvs/stx/stx/libview2/FillingWrapper.st,v 1.4 1996-05-09 08:31:26 cg Exp $'
|
245
|
125 |
! !
|