author | Patrik Svestka <patrik.svestka@gmail.com> |
Wed, 14 Nov 2018 12:13:31 +0100 | |
branch | jv |
changeset 4213 | 8127ef0ff47d |
parent 3855 | 1db7742d33ad |
permissions | -rw-r--r-- |
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 |
" |
|
1789 | 12 |
"{ Package: 'stx:libview2' }" |
13 |
||
3855
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2634
diff
changeset
|
14 |
"{ NameSpace: Smalltalk }" |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2634
diff
changeset
|
15 |
|
2634 | 16 |
StrokingOrFillingWrapper subclass:#StrokingWrapper |
17 |
instanceVariableNames:'' |
|
245 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
1789 | 20 |
category:'Compatibility-ST80-Graphics-Display Objects' |
245 | 21 |
! |
22 |
||
280 | 23 |
!StrokingWrapper class methodsFor:'documentation'! |
245 | 24 |
|
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
||
38 |
! |
|
39 |
||
40 |
documentation |
|
41 |
" |
|
280 | 42 |
a wrapper for a geometric object, which is to be drawn stroked. |
43 |
This allows any geometric thingy to be used as a component in a view. |
|
44 |
||
45 |
(background info: geometrics are mathematical objects - they do not |
|
46 |
keep any color or lineStyle attributes. Wrappers add this information |
|
47 |
and can also be used as components of a view) |
|
254 | 48 |
|
265 | 49 |
Notice: |
50 |
this class was implemented using protocol information |
|
365 | 51 |
from alpha testers, from reading PD programs and |
52 |
from the Hopkins/Horan book. |
|
265 | 53 |
- it may not be complete or compatible to the corresponding ST-80 class. |
54 |
If you encounter any incompatibilities, please forward a note |
|
55 |
describing the incompatibility verbal (i.e. no code) to the ST/X team. |
|
56 |
||
248 | 57 |
[see also:] |
280 | 58 |
FillingWrapper Geometric GraphicsContext |
248 | 59 |
|
245 | 60 |
[author:] |
61 |
Claus Gittinger |
|
62 |
" |
|
63 |
! |
|
64 |
||
65 |
examples |
|
66 |
" |
|
280 | 67 |
wrap an ellipticArc and display it |
68 |
(notice, that no automatic redraw is performed): |
|
69 |
[exBegin] |
|
70 |
|v e component| |
|
71 |
||
72 |
v := (StandardSystemView extent:250@250) openAndWait. |
|
73 |
||
74 |
e := EllipticalArc boundingBox:(10@10 corner:90@90) |
|
75 |
startAngle:0 |
|
76 |
sweepAngle:270. |
|
77 |
component := StrokingWrapper on:e. |
|
78 |
||
79 |
component displayOn:v. |
|
80 |
[exEnd] |
|
81 |
||
82 |
wrap a rectangle and an ellipticArc, |
|
83 |
and add them as components to a View |
|
84 |
(notice, that doing so makes the redraw automatic): |
|
85 |
[exBegin] |
|
86 |
|v e component| |
|
87 |
||
88 |
v := StandardSystemView extent:250@250. |
|
89 |
||
90 |
e := Rectangle origin:10@10 corner:90@90. |
|
91 |
component := FillingWrapper on:e. |
|
92 |
component foregroundColor:Color red. |
|
93 |
||
94 |
v addComponent:component. |
|
95 |
||
96 |
e := EllipticalArc boundingBox:(10@10 corner:90@90) |
|
97 |
startAngle:0 sweepAngle:360. |
|
98 |
component := StrokingWrapper on:e. |
|
99 |
component lineWidth:5. |
|
100 |
||
101 |
v addComponent:component. |
|
102 |
||
103 |
v addComponent:(Button label:'hello'). |
|
104 |
||
105 |
v open |
|
106 |
[exEnd] |
|
107 |
with lineWidth & style: |
|
108 |
(notice, that the redraw is automatic): |
|
109 |
[exBegin] |
|
110 |
|v e| |
|
111 |
||
112 |
v := StandardSystemView extent:250@250. |
|
113 |
||
114 |
e := EllipticalArc boundingBox:(10@10 corner:90@90) |
|
115 |
startAngle:0 |
|
116 |
sweepAngle:270. |
|
117 |
v addComponent:((StrokingWrapper on:e) |
|
118 |
lineWidth:5; |
|
119 |
lineStyle:#dashed; |
|
120 |
foregroundColor:(Color red)). |
|
121 |
||
122 |
e := EllipticalArc boundingBox:(30@30 corner:70@70) |
|
123 |
startAngle:90 |
|
124 |
sweepAngle:270. |
|
125 |
v addComponent:((StrokingWrapper on:e) |
|
126 |
lineWidth:5; |
|
127 |
lineStyle:#doubleDashed; |
|
128 |
foregroundColor:(Color red); |
|
129 |
backgroundColor:(Color green)). |
|
130 |
v open. |
|
131 |
[exEnd] |
|
132 |
||
133 |
scrolling: |
|
273 | 134 |
[exBegin] |
135 |
|t s v e component| |
|
136 |
||
137 |
t := StandardSystemView extent:250@200. |
|
138 |
s := HVScrollableView for:View miniScroller:true in:t. |
|
139 |
s origin:0.0@0.0 corner:1.0@1.0. |
|
140 |
v := s scrolledView. |
|
141 |
||
142 |
e := Rectangle origin:10@10 corner:90@90. |
|
143 |
component := FillingWrapper on:e. |
|
144 |
component foregroundColor:Color red. |
|
145 |
v addComponent:component. |
|
146 |
||
147 |
e := EllipticalArc boundingBox:(10@10 corner:90@90) |
|
148 |
startAngle:0 sweepAngle:360. |
|
149 |
component := StrokingWrapper on:e. |
|
150 |
component lineWidth:5. |
|
151 |
v addComponent:component. |
|
152 |
||
153 |
e := Arrow from:100@100 to:150@250. |
|
154 |
component := StrokingWrapper on:e. |
|
155 |
component lineWidth:2. |
|
156 |
v addComponent:component. |
|
157 |
||
280 | 158 |
v addComponent:(Button label:'hello'). |
273 | 159 |
|
160 |
t open |
|
161 |
[exEnd] |
|
162 |
||
245 | 163 |
" |
164 |
! ! |
|
165 |
||
280 | 166 |
!StrokingWrapper methodsFor:'displaying'! |
245 | 167 |
|
168 |
displayOn:aGC |
|
280 | 169 |
"display myself - here, display the geometric object asStroked" |
170 |
||
2634 | 171 |
self displayStrokedOn:aGC |
245 | 172 |
! ! |
173 |
||
280 | 174 |
!StrokingWrapper class methodsFor:'documentation'! |
245 | 175 |
|
176 |
version |
|
2634 | 177 |
^ '$Header: /cvs/stx/stx/libview2/StrokingWrapper.st,v 1.16 2009-05-06 07:29:41 cg Exp $' |
245 | 178 |
! ! |
3855
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2634
diff
changeset
|
179 |