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