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