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