author | Claus Gittinger <cg@exept.de> |
Wed, 08 Feb 2017 00:50:25 +0100 | |
changeset 3864 | 37f4e48a35e7 |
parent 3768 | d9739e1f43f5 |
child 3939 | a64b6880178b |
permissions | -rw-r--r-- |
60 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
3318 | 3 |
All Rights Reserved |
60 | 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 |
" |
|
1485 | 12 |
"{ Package: 'stx:libview2' }" |
13 |
||
3502 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
60 | 16 |
View subclass:#ActiveHelpView |
3360 | 17 |
instanceVariableNames:'myView shapeStyle controllingHelpListener' |
18 |
classVariableNames:'' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-Help' |
|
60 | 21 |
! |
22 |
||
380 | 23 |
!ActiveHelpView class methodsFor:'documentation'! |
60 | 24 |
|
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
3318 | 28 |
All Rights Reserved |
60 | 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 |
||
138 | 39 |
! |
40 |
||
41 |
documentation |
|
42 |
" |
|
635 | 43 |
a bubbleHelp view. |
233 | 44 |
|
138 | 45 |
Instances of myself show up either as a comics-like talking |
46 |
view, or as a simple square popup. This is configured via the |
|
233 | 47 |
styleSheet; the default is simple-square. |
48 |
To get the fancy comics style, add a resource 'activeHelpStyle' with |
|
49 |
a symbol-value of #cartoon. |
|
138 | 50 |
However, be aware that some servers have performance problems with |
51 |
these view-shapes (or do not support shapes at all). |
|
635 | 52 |
Therefore, the default style is a rectangular popupView. |
216 | 53 |
|
221 | 54 |
[author:] |
55 |
Claus Gittinger |
|
56 |
||
216 | 57 |
[See also:] |
58 |
ActiveHelp |
|
138 | 59 |
" |
60 | 60 |
! ! |
61 |
||
380 | 62 |
!ActiveHelpView class methodsFor:'instance creation'! |
60 | 63 |
|
64 |
for:someText |
|
635 | 65 |
"create a bubble-view for some text" |
233 | 66 |
|
1676 | 67 |
^ self for:someText onDevice:Screen current. |
68 |
||
69 |
" |
|
70 |
|v| |
|
71 |
||
72 |
v := (ActiveHelpView for:'hello world\this is an ActiveHelpView' withCRs) shapeStyle:nil. |
|
73 |
v realize. |
|
74 |
Delay waitForSeconds:2. |
|
75 |
v destroy |
|
76 |
" |
|
77 |
||
78 |
" |
|
79 |
|v| |
|
80 |
||
81 |
v := (ActiveHelpView for:'hello world\this is an ActiveHelpView' withCRs) shapeStyle:#cartoon. |
|
82 |
v realize. |
|
83 |
Delay waitForSeconds:2. |
|
84 |
v destroy |
|
85 |
" |
|
86 |
||
87 |
"Modified: 28.6.1997 / 14:24:23 / cg" |
|
88 |
! |
|
89 |
||
90 |
for:someText onDevice:aDevice |
|
91 |
"create a bubble-view for some text" |
|
92 |
||
3654 | 93 |
|helpView textView textShown| |
60 | 94 |
|
1714
85cd314f0916
Fix ActiveHelp for foreign displays
Stefan Vogel <sv@exept.de>
parents:
1676
diff
changeset
|
95 |
helpView := self onDevice:aDevice. |
3768 | 96 |
someText isString ifFalse:[ |
97 |
textView := Label onDevice:aDevice. |
|
98 |
textView logo:someText. |
|
99 |
^ (helpView withView:textView) |
|
100 |
]. |
|
101 |
||
3393 | 102 |
((someText startsWith:'<HTML>') or:[ someText startsWith:'<html>' ]) ifTrue:[ |
3313 | 103 |
textView := HTMLView onDevice:aDevice. |
104 |
textView level:0. |
|
3318 | 105 |
textView extent:(600@400). |
3313 | 106 |
textView contents:someText. |
107 |
textView preferredExtent:(textView extentOfContents + 20 min:(Display extent * 2 // 3)). |
|
3318 | 108 |
textView extent:(textView extentOfContents + 20 min:(Display extent * 2 // 3)). |
109 |
textView contents:someText. |
|
3313 | 110 |
^ helpView withView:textView |
111 |
]. |
|
3655 | 112 |
|
113 |
textShown := someText. |
|
114 |
(textShown isString) ifTrue:[ |
|
115 |
textShown := textShown withoutTrailingSeparators. |
|
116 |
]. |
|
117 |
textView := Label onDevice:aDevice. |
|
3728 | 118 |
textView font:(helpView deviceFont). |
3655 | 119 |
^ (helpView withView:textView) contents:textShown |
60 | 120 |
|
121 |
" |
|
635 | 122 |
|v| |
285 | 123 |
|
635 | 124 |
v := (ActiveHelpView for:'hello world\this is an ActiveHelpView' withCRs) shapeStyle:nil. |
125 |
v realize. |
|
126 |
Delay waitForSeconds:2. |
|
127 |
v destroy |
|
60 | 128 |
" |
233 | 129 |
|
635 | 130 |
" |
131 |
|v| |
|
132 |
||
133 |
v := (ActiveHelpView for:'hello world\this is an ActiveHelpView' withCRs) shapeStyle:#cartoon. |
|
134 |
v realize. |
|
135 |
Delay waitForSeconds:2. |
|
136 |
v destroy |
|
137 |
" |
|
138 |
||
139 |
"Modified: 28.6.1997 / 14:24:23 / cg" |
|
60 | 140 |
! |
141 |
||
142 |
with:aView |
|
233 | 143 |
"create a talking-view wrapping some other view" |
144 |
||
60 | 145 |
^ self new withView:aView |
146 |
||
147 |
" |
|
148 |
(ActiveHelpView with:(TextView new)) realize |
|
149 |
(ActiveHelpView with:(TextView new)) open |
|
150 |
(ActiveHelpView with:(Button label:'ok')) open |
|
151 |
" |
|
233 | 152 |
|
153 |
"Modified: 27.4.1996 / 15:14:18 / cg" |
|
60 | 154 |
! ! |
155 |
||
138 | 156 |
!ActiveHelpView methodsFor:'accessing'! |
157 |
||
158 |
contents:someText |
|
233 | 159 |
"set the text" |
160 |
||
138 | 161 |
(myView isKindOf:Label) ifTrue:[ |
233 | 162 |
myView label:someText asString. |
163 |
myView extent:(myView preferredExtent). |
|
138 | 164 |
] ifFalse:[ |
233 | 165 |
myView contents:someText. |
138 | 166 |
]. |
167 |
self resizeToFit |
|
168 |
||
233 | 169 |
"Modified: 27.4.1996 / 15:14:56 / cg" |
138 | 170 |
! |
60 | 171 |
|
3250
276f1af4583b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
172 |
controllingHelpListener:something |
276f1af4583b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
173 |
controllingHelpListener := something. |
276f1af4583b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
174 |
! |
276f1af4583b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
175 |
|
285 | 176 |
shapeStyle:aStyleSymbol |
3218 | 177 |
"set the shapeStyle. |
178 |
Currently, only nil and #cartoon are supported" |
|
285 | 179 |
|
180 |
shapeStyle := aStyleSymbol. |
|
3246 | 181 |
Screen current supportsArbitraryShapedViews ifFalse:[ |
182 |
shapeStyle := nil |
|
183 |
]. |
|
285 | 184 |
self resizeToFit. |
185 |
self computeShape. |
|
186 |
||
187 |
"Created: 29.5.1996 / 15:39:41 / cg" |
|
635 | 188 |
"Modified: 28.6.1997 / 14:15:22 / cg" |
285 | 189 |
! |
190 |
||
138 | 191 |
withView:aView |
233 | 192 |
"set the component view" |
193 |
||
3118 | 194 |
|fg| |
195 |
||
138 | 196 |
(aView isKindOf:Label) ifTrue:[ |
233 | 197 |
aView viewBackground:viewBackground. |
198 |
aView backgroundColor:viewBackground. |
|
3118 | 199 |
(fg := styleSheet colorAt:#'activeHelp.foregroundColor' default:nil) notNil ifTrue:[ |
200 |
aView foregroundColor:fg. |
|
201 |
]. |
|
3313 | 202 |
] ifFalse:[ |
203 |
(aView isKindOf:HTMLView) ifTrue:[ |
|
3393 | 204 |
aView scrolledView |
205 |
viewBackground:viewBackground; |
|
206 |
backgroundColor:viewBackground. |
|
3313 | 207 |
aView style viewBGColor:viewBackground. |
3393 | 208 |
"/ Transcript showCR:aView scrolledView preferredExtent. |
3313 | 209 |
]. |
138 | 210 |
]. |
211 |
self addSubView:aView. |
|
212 |
myView := aView. |
|
213 |
myView borderWidth:0 |
|
233 | 214 |
|
215 |
"Modified: 27.4.1996 / 15:16:46 / cg" |
|
138 | 216 |
! ! |
217 |
||
3250
276f1af4583b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
218 |
!ActiveHelpView methodsFor:'event handling'! |
276f1af4583b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
219 |
|
276f1af4583b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
220 |
keyPress:key x:x y:y |
276f1af4583b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
221 |
controllingHelpListener hideHelp |
276f1af4583b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
222 |
! ! |
276f1af4583b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
223 |
|
138 | 224 |
!ActiveHelpView methodsFor:'initialization'! |
225 |
||
92 | 226 |
initStyle |
380 | 227 |
"setup viewStyle specifics" |
228 |
||
725 | 229 |
<resource: #style (#'activeHelp.backgroundColor' |
230 |
#'activeHelp.borderWidth' |
|
3502 | 231 |
#'activeHelp.borderColor' |
1537 | 232 |
#'activeHelp.font' |
725 | 233 |
#'activeHelp.style')> |
285 | 234 |
|
2776
7181bb9659ae
comment/format in: #withView:
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
235 |
|bg defaultFont| |
236 | 236 |
|
92 | 237 |
super initStyle. |
238 |
||
3218 | 239 |
(shapeStyle := UserPreferences current toolTipShapeStyle) isNil ifTrue:[ |
240 |
shapeStyle := styleSheet at:#'activeHelp.style' default:nil. |
|
241 |
]. |
|
242 |
||
3360 | 243 |
defaultFont := self class defaultFont. |
244 |
defaultFont isNil ifTrue:[ |
|
245 |
defaultFont := styleSheet fontAt:#'activeHelp.font' default:nil. |
|
246 |
]. |
|
2776
7181bb9659ae
comment/format in: #withView:
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
247 |
defaultFont notNil ifTrue:[ |
7181bb9659ae
comment/format in: #withView:
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
248 |
self font:defaultFont |
1537 | 249 |
]. |
250 |
||
1583
36d82eed6873
Use #isWindowsStyle instead of comparing to style name.
Stefan Vogel <sv@exept.de>
parents:
1537
diff
changeset
|
251 |
bg := styleSheet colorAt:#'activeHelp.backgroundColor' default:nil. |
285 | 252 |
bg notNil ifTrue:[ |
253 |
viewBackground := bg |
|
254 |
] ifFalse:[ |
|
255 |
shapeStyle == #cartoon ifTrue:[ |
|
3288 | 256 |
viewBackground := self whiteColor. |
285 | 257 |
] |
258 |
]. |
|
2773
eaec2e45bd8d
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
2413
diff
changeset
|
259 |
self borderWidth:(styleSheet at:#'activeHelp.borderWidth' default:1). |
3288 | 260 |
self borderColor:(styleSheet at:#'activeHelp.borderColor' default:self blackColor). |
236 | 261 |
|
725 | 262 |
"Modified: / 26.10.1997 / 17:02:09 / cg" |
92 | 263 |
! |
264 |
||
138 | 265 |
realize |
266 |
self create. |
|
267 |
self computeShape. |
|
268 |
self enableMotionEvents. |
|
269 |
self enableButtonMotionEvents. |
|
1485 | 270 |
super realize |
60 | 271 |
! ! |
272 |
||
273 |
!ActiveHelpView methodsFor:'private'! |
|
274 |
||
275 |
computeShape |
|
233 | 276 |
"compute the shape, based upon the size of my component view" |
277 |
||
3224 | 278 |
|extent oldOrigin shapeForm borderForm y1 bw h w mirrorH mirrorV |
3316
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
279 |
p1 p2 p3 pB1 pB2 pB3 offs hEll h2 w2 w8 w78 mousePosition graphicsDevice| |
60 | 280 |
|
3316
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
281 |
(shapeStyle == #cartoon) ifFalse:[ |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
282 |
^ self. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
283 |
]. |
3625 | 284 |
graphicsDevice := device. |
3316
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
285 |
graphicsDevice supportsArbitraryShapedViews ifTrue:[ |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
286 |
extent := self extent. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
287 |
oldOrigin := self origin. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
288 |
h := extent y. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
289 |
w := extent x. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
290 |
bw := 4. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
291 |
offs := 0. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
292 |
mousePosition := graphicsDevice pointerPosition. |
60 | 293 |
|
3316
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
294 |
((mousePosition > (graphicsDevice width * (2/3))) |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
295 |
or:[ self corner x > graphicsDevice usableWidth ]) ifTrue:[ |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
296 |
mirrorH := true. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
297 |
self origin:((oldOrigin x - w) @ (self origin y)). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
298 |
offs := bw * 2. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
299 |
] ifFalse:[ |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
300 |
mirrorH := false |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
301 |
]. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
302 |
((mousePosition > (graphicsDevice height * (2/3))) |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
303 |
or:[ self corner y > graphicsDevice usableHeight ]) ifTrue:[ |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
304 |
mirrorV := true. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
305 |
self origin:(oldOrigin x @ (self origin y - h)). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
306 |
] ifFalse:[ |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
307 |
mirrorV := false |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
308 |
]. |
285 | 309 |
|
3316
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
310 |
borderForm := Form width:w height:h. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
311 |
shapeForm := Form width:w height:h. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
312 |
borderForm fill:(Color noColor). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
313 |
shapeForm fill:(Color noColor). |
635 | 314 |
|
3316
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
315 |
hEll := (h // 3 * 2). |
60 | 316 |
|
3316
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
317 |
mirrorV ifTrue:[ |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
318 |
y1 := 0. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
319 |
] ifFalse:[ |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
320 |
y1 := h // 4. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
321 |
]. |
60 | 322 |
|
3316
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
323 |
borderForm fillArcX:0 y:y1 |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
324 |
width:w height:hEll |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
325 |
from:0 angle:360. |
635 | 326 |
|
3316
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
327 |
myView origin:(width - myView width // 2) @ (y1 + ((hEll - myView height) // 2)). |
1182 | 328 |
|
3316
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
329 |
h2 := h // 2. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
330 |
w2 := w // 2. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
331 |
w8 := w // 8. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
332 |
w78 := w * 7 // 8. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
333 |
|
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
334 |
mirrorH ifTrue:[ |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
335 |
mirrorV ifTrue:[ |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
336 |
p1 := w @ h. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
337 |
p2 := (w78 @ h2). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
338 |
p3 := (w2 @ h2). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
339 |
pB1 := (w-bw) @ (h-bw). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
340 |
pB2 := ((w78 - bw) @ (h2 - bw)). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
341 |
pB3 := ((w2 + bw) @ (h2 - bw)) |
635 | 342 |
] ifFalse:[ |
3316
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
343 |
p1 := w @ 0. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
344 |
p2 := (w78 @ h2). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
345 |
p3 := (w2 @ h2). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
346 |
pB1 := (w-bw) @ bw. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
347 |
pB2 := ((w78 - bw) @ (h2 + bw)). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
348 |
pB3 := ((w2 + bw) @ (h2 + bw)) |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
349 |
] |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
350 |
] ifFalse:[ |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
351 |
mirrorV ifTrue:[ |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
352 |
p1 := 0@h. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
353 |
p2 := (w8 @ h2). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
354 |
p3 := (w2 @ h2). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
355 |
pB1 := bw@(h-bw). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
356 |
pB2 := ((w8 + bw) @ (h2 - bw)). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
357 |
pB3 := ((w2 - bw) @ (h2 - bw)). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
358 |
] ifFalse:[ |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
359 |
p1 := 0@0. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
360 |
p2 := (w8 @ h2). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
361 |
p3 := (w2 @ h2). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
362 |
pB1 := bw@bw. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
363 |
pB2 := ((w8 + bw) @ (h2 + bw)). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
364 |
pB3 := ((w2 - bw) @ (h2 + bw)). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
365 |
] |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
366 |
]. |
60 | 367 |
|
3316
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
368 |
borderForm fillPolygon:(Array with:p1 with:p2 with:p3). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
369 |
shapeForm fillPolygon:(Array with:pB1 with:pB2 with:pB3). |
60 | 370 |
|
3316
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
371 |
shapeForm lineWidth:bw. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
372 |
shapeForm paint:(Color noColor). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
373 |
shapeForm displayPolygon:(Array with:p3 with:p1 with:p2). |
60 | 374 |
|
3316
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
375 |
shapeForm paint:(Color colorId:1). |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
376 |
shapeForm fillArcX:bw y:y1 + bw |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
377 |
width:(w - (bw * 2)) height:(h // 3 * 2 - (bw * 2)) |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
378 |
from:0 angle:360. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
379 |
]. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
380 |
borderForm notNil ifTrue:[ |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
381 |
self borderShape:borderForm. |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
382 |
self viewShape:shapeForm |
cbfe39899129
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
3314
diff
changeset
|
383 |
]. |
60 | 384 |
|
1182 | 385 |
"Modified: / 5.6.1999 / 21:41:01 / cg" |
1261 | 386 |
"Modified: / 27.10.1999 / 13:45:45 / stefan" |
60 | 387 |
! |
388 |
||
389 |
resizeToFit |
|
233 | 390 |
"resize myself to make the component view fit" |
391 |
||
3223 | 392 |
|h w pref bw| |
60 | 393 |
|
285 | 394 |
pref := myView preferredExtent. |
395 |
shapeStyle == #cartoon ifTrue:[ |
|
396 |
h := pref y. |
|
397 |
w := pref x. |
|
3223 | 398 |
self extent:((w / 0.85) @ (h * 4)) rounded. |
92 | 399 |
] ifFalse:[ |
3223 | 400 |
bw := self borderWidth. |
401 |
self extent:(pref + (bw * 2)). |
|
402 |
myView origin:(bw asPoint). |
|
92 | 403 |
] |
233 | 404 |
|
635 | 405 |
"Modified: 28.6.1997 / 14:23:49 / cg" |
233 | 406 |
! ! |
407 |
||
408 |
!ActiveHelpView methodsFor:'queries'! |
|
409 |
||
410 |
isPopUpView |
|
261 | 411 |
"return true - I am a popUp type of view (no decoration, pop-to-top)" |
233 | 412 |
|
413 |
^ true |
|
414 |
||
261 | 415 |
"Modified: 12.5.1996 / 21:58:12 / cg" |
3250
276f1af4583b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
416 |
! |
276f1af4583b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
417 |
|
276f1af4583b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
418 |
wantsFocusWithButtonPress |
276f1af4583b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
419 |
^ false |
60 | 420 |
! ! |
421 |
||
380 | 422 |
!ActiveHelpView class methodsFor:'documentation'! |
60 | 423 |
|
138 | 424 |
version |
3502 | 425 |
^ '$Header$' |
2773
eaec2e45bd8d
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
2413
diff
changeset
|
426 |
! |
eaec2e45bd8d
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
2413
diff
changeset
|
427 |
|
eaec2e45bd8d
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
2413
diff
changeset
|
428 |
version_CVS |
3502 | 429 |
^ '$Header$' |
60 | 430 |
! ! |
3118 | 431 |