author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sat, 30 Sep 2017 22:41:09 +0100 | |
branch | jv |
changeset 4020 | d801dbd5cf3b |
parent 3855 | 1db7742d33ad |
permissions | -rw-r--r-- |
251 | 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:
2661
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:
2661
diff
changeset
|
15 |
|
251 | 16 |
Wrapper subclass:#GeometricWrapper |
404
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
17 |
instanceVariableNames:'foregroundColor backgroundColor' |
251 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
1789 | 20 |
category:'Compatibility-ST80-Graphics-Display Objects' |
251 | 21 |
! |
22 |
||
23 |
!GeometricWrapper class methodsFor:'documentation'! |
|
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 |
||
41 |
! |
|
42 |
||
43 |
documentation |
|
44 |
" |
|
45 |
abstract class for wrappers of geometric objects. |
|
46 |
These allows any geometric thingy to be used as a component in a view. |
|
47 |
||
254 | 48 |
(background info: geometrics are mathematical objects - they do not |
49 |
keep any color or lineStyle attributes. Wrappers add this information |
|
50 |
and can also be used as components of a view) |
|
51 |
||
265 | 52 |
Notice: |
53 |
this class was implemented using protocol information |
|
365 | 54 |
from alpha testers, from reading PD programs and |
55 |
from the Hopkins/Horan book. |
|
265 | 56 |
- it may not be complete or compatible to the corresponding ST-80 class. |
57 |
If you encounter any incompatibilities, please forward a note |
|
58 |
describing the incompatibility verbal (i.e. no code) to the ST/X team. |
|
59 |
||
251 | 60 |
[see also:] |
61 |
StrokingWrapper FillingWrapper |
|
62 |
Geometric GraphicsContext |
|
63 |
||
64 |
[author:] |
|
65 |
Claus Gittinger |
|
66 |
" |
|
67 |
||
68 |
||
69 |
||
70 |
! ! |
|
71 |
||
279 | 72 |
!GeometricWrapper methodsFor:'accessing'! |
73 |
||
404
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
74 |
backgroundColor |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
75 |
^ backgroundColor |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
76 |
! |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
77 |
|
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
78 |
backgroundColor:something |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
79 |
backgroundColor := something. |
2661 | 80 |
self invalidate. |
404
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
81 |
! |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
82 |
|
279 | 83 |
component:someComponent |
84 |
"set the wrappers component. |
|
85 |
Redefined to not set the components container - we know, those |
|
86 |
Geometrics dont know about containers." |
|
87 |
||
88 |
component := someComponent. |
|
89 |
||
90 |
"Created: 28.5.1996 / 23:02:36 / cg" |
|
91 |
"Modified: 28.5.1996 / 23:02:52 / cg" |
|
404
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
92 |
! |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
93 |
|
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
94 |
foregroundColor |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
95 |
^ foregroundColor |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
96 |
! |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
97 |
|
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
98 |
foregroundColor:something |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
99 |
foregroundColor := something. |
2661 | 100 |
self invalidate. |
279 | 101 |
! ! |
102 |
||
251 | 103 |
!GeometricWrapper methodsFor:'accessing - bounds'! |
104 |
||
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
105 |
bounds |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
106 |
"return the components bounds as default bounds" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
107 |
|
2661 | 108 |
frame notNil ifTrue:[^ frame]. |
295 | 109 |
^ component bounds rounded |
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
110 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
111 |
"Created: 5.6.1996 / 02:29:10 / cg" |
295 | 112 |
"Modified: 5.6.1996 / 20:30:50 / cg" |
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
113 |
! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
114 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
115 |
bounds:newBounds |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
116 |
"set my bounds" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
117 |
|
2661 | 118 |
frame := newBounds |
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
119 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
120 |
"Created: 5.6.1996 / 02:30:00 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
121 |
! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
122 |
|
251 | 123 |
preferredBounds |
124 |
"return the components bounds as preferredBounds" |
|
125 |
||
2661 | 126 |
^ component bounds ceiling |
251 | 127 |
! ! |
128 |
||
418 | 129 |
!GeometricWrapper methodsFor:'initialize / release'! |
130 |
||
131 |
flushCoordinateCaches |
|
642 | 132 |
"/ geometrics are not interested in that |
418 | 133 |
|
134 |
"Created: 12.2.1997 / 11:56:07 / cg" |
|
1220
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
135 |
! |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
136 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
137 |
initialize |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
138 |
foregroundColor := Color black. |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
139 |
|
418 | 140 |
! ! |
141 |
||
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
142 |
!GeometricWrapper methodsFor:'view protocol mimicri'! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
143 |
|
2661 | 144 |
destroyComponent |
145 |
"component is not a visualPart. Ignored here" |
|
146 |
! |
|
147 |
||
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
148 |
realize |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
149 |
"my container realized itself. Ignored here" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
150 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
151 |
"Created: 5.6.1996 / 02:32:39 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
152 |
! ! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
153 |
|
251 | 154 |
!GeometricWrapper class methodsFor:'documentation'! |
155 |
||
156 |
version |
|
2661 | 157 |
^ '$Header: /cvs/stx/stx/libview2/GeometricWrapper.st,v 1.13 2009-05-08 11:54:36 cg Exp $' |
251 | 158 |
! ! |
3855
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2661
diff
changeset
|
159 |