author | Stefan Vogel <sv@exept.de> |
Sat, 10 Aug 2013 13:10:37 +0200 | |
changeset 3211 | 6d43ccc9adc4 |
parent 3198 | a43053b56eb3 |
child 3216 | f9312a1f2e9d |
permissions | -rw-r--r-- |
1802 | 1 |
" |
2 |
COPYRIGHT (c) 2001 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
1536 | 12 |
"{ Package: 'stx:libview2' }" |
13 |
||
14 |
ActiveHelp subclass:#FlyByHelp |
|
2680 | 15 |
instanceVariableNames:'currentFrame currentView currentHelpView showProcess closeProcess' |
1892 | 16 |
classVariableNames:'' |
1536 | 17 |
poolDictionaries:'' |
18 |
category:'Interface-Help' |
|
19 |
! |
|
20 |
||
1802 | 21 |
!FlyByHelp class methodsFor:'documentation'! |
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 2001 by eXept Software AG |
|
26 |
All Rights Reserved |
|
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 |
" |
|
1893 | 35 |
! |
36 |
||
37 |
examples |
|
38 |
" |
|
39 |
FlyByHelp isActive |
|
40 |
||
41 |
FlyByHelp stop |
|
42 |
FlyByHelp start |
|
43 |
" |
|
1802 | 44 |
! ! |
1536 | 45 |
|
2692 | 46 |
!FlyByHelp class methodsFor:'accessing'! |
47 |
||
48 |
currentlyShownView |
|
2846
e90ba00f9df1
changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents:
2826
diff
changeset
|
49 |
TheOneAndOnlyHelpListener isNil ifTrue:[^ nil]. |
2692 | 50 |
^ TheOneAndOnlyHelpListener currentlyShownView |
2846
e90ba00f9df1
changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents:
2826
diff
changeset
|
51 |
|
e90ba00f9df1
changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents:
2826
diff
changeset
|
52 |
"Modified: / 09-06-2010 / 16:35:48 / cg" |
2692 | 53 |
! ! |
54 |
||
2684 | 55 |
!FlyByHelp methodsFor:'defaults'! |
56 |
||
57 |
flyByHelpTimeoutMillis |
|
58 |
"abort flyby help text generation, if no text can be generated within that |
|
59 |
time delta. This is used to abort long-lasting parsing/scanning/analysis in |
|
60 |
large methods when the mouse is moved over some syntactic constructs, and |
|
61 |
it takes too long to parse... |
|
62 |
The returned time is given in ms" |
|
63 |
||
64 |
^ 300 |
|
65 |
! ! |
|
66 |
||
2392 | 67 |
!FlyByHelp methodsFor:'event handling'! |
1540 | 68 |
|
2474 | 69 |
buttonMotion:buttonAndModifierState x:x y:y view:aView |
2519 | 70 |
aView == currentHelpView ifTrue:[ |
71 |
"/ the help-bubble itself |
|
72 |
^ false |
|
73 |
]. |
|
74 |
||
2518 | 75 |
"/ don't start tooltip, if this view is not active |
76 |
"/ aView topView isActive ifFalse:[^ false]. |
|
2477
b009e0b51999
suppress tooltip for inactive (lower) windows
Claus Gittinger <cg@exept.de>
parents:
2474
diff
changeset
|
77 |
|
2474 | 78 |
^ super buttonMotion:buttonAndModifierState x:x y:y view:aView |
1540 | 79 |
! |
80 |
||
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
81 |
buttonPress:button x:x y:y view:aView |
3198 | 82 |
|prevView| |
83 |
||
84 |
"/ hideHelp nils the currentView |
|
85 |
"/ we restore it, so the tooltip is not shown again for this view |
|
86 |
"/ until the mouse really leaves the view |
|
87 |
"/ let's call this the "do-not-show-in-this-view mode" |
|
88 |
prevView := currentView. |
|
2978
4358a9302b95
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2925
diff
changeset
|
89 |
self hideHelp. |
3198 | 90 |
currentView := prevView. |
91 |
||
92 |
^ false |
|
2978
4358a9302b95
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2925
diff
changeset
|
93 |
|
4358a9302b95
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2925
diff
changeset
|
94 |
"Modified: / 23-12-2011 / 20:37:28 / cg" |
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
95 |
! |
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
96 |
|
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
97 |
keyPress:key x:x y:y view:aView |
3198 | 98 |
|prevView| |
99 |
||
2885
a70144d85a81
changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2884
diff
changeset
|
100 |
currentHelpView notNil ifTrue:[ |
2925
352825e1163c
changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
101 |
key == $§ ifTrue:[ |
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
102 |
"/ generate a line suitable for the resources file (a null translation) |
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
103 |
"/ into the clipboard; makes it easy to add missing translations to a .rs file. |
2885
a70144d85a81
changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2884
diff
changeset
|
104 |
aView setClipboardText:(lastHelpText storeString , ' ' , lastHelpText storeString). |
2612 | 105 |
self hideHelp. |
106 |
^ true |
|
107 |
]. |
|
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
108 |
key == #Escape ifTrue:[ |
3198 | 109 |
prevView := currentView. |
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
110 |
self hideHelp. |
3198 | 111 |
currentView := prevView. |
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
112 |
^ true |
2885
a70144d85a81
changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2884
diff
changeset
|
113 |
]. |
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
114 |
]. |
3198 | 115 |
|
116 |
"/ hideHelp nils the currentView |
|
117 |
"/ we restore it, so the tooltip is not shown again for this view |
|
118 |
"/ until the mouse really leaves the view |
|
119 |
"/ let's call this the "do-not-show-in-this-view mode" |
|
120 |
prevView := currentView. |
|
121 |
self hideHelpIgnoringErrors. |
|
122 |
currentView := prevView. |
|
123 |
||
124 |
^ false |
|
125 |
"/ ^ super keyPress:key x:x y:y view:aView |
|
2884
7d37f5a0719e
changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2878
diff
changeset
|
126 |
|
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
127 |
"Modified (format): / 25-12-2011 / 10:25:23 / cg" |
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
128 |
! |
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
129 |
|
2521
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
130 |
mouseWheelMotion:state x:x y:y amount:amount deltaTime:dTime view:aView |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
131 |
currentHelpView notNil ifTrue:[ |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
132 |
self handleMouseIn:aView x:x y:y. |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
133 |
]. |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
134 |
^ false |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
135 |
! |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
136 |
|
1540 | 137 |
pointerLeave:state view:aView |
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
138 |
aView == currentHelpView ifTrue:[^ true]. |
3198 | 139 |
|
140 |
"/ clear the do-not-show-in-this-view mode (see keyPress) |
|
141 |
"/ (currentHelpView isNil and:[currentView notNil]) ifTrue:[currentView := nil]. |
|
142 |
||
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
143 |
^ super pointerLeave:state view:aView |
1540 | 144 |
! ! |
145 |
||
2392 | 146 |
!FlyByHelp methodsFor:'help texts'! |
1536 | 147 |
|
148 |
helpTextFromModel:aModel view:aView at:aPointOrNil |
|
149 |
"helper: ask aModel for its helpText." |
|
150 |
||
151 |
|text| |
|
152 |
||
153 |
aPointOrNil notNil ifTrue:[ |
|
154 |
(aModel respondsTo:#flyByHelpTextFor:at:) ifTrue:[ |
|
155 |
text := aModel flyByHelpTextFor:aView at:aPointOrNil. |
|
2754 | 156 |
text notNil ifTrue:[^ text]. |
1536 | 157 |
]. |
158 |
]. |
|
2754 | 159 |
(aModel respondsTo:#flyByHelpTextFor:) ifTrue:[ |
160 |
text := aModel flyByHelpTextFor:aView. |
|
161 |
text notNil ifTrue:[^ text]. |
|
1536 | 162 |
]. |
2754 | 163 |
^ nil |
1536 | 164 |
! |
165 |
||
166 |
helpTextFromView:aView at:aPointOrNil |
|
167 |
"helper: ask aView for its helpText." |
|
168 |
||
2754 | 169 |
|text key app| |
1536 | 170 |
|
171 |
aPointOrNil notNil ifTrue:[ |
|
172 |
(aView respondsTo:#flyByHelpTextAt:) ifTrue:[ |
|
173 |
text := aView flyByHelpTextAt:aPointOrNil. |
|
2754 | 174 |
text notNil ifTrue:[^ text]. |
1536 | 175 |
]. |
176 |
]. |
|
2754 | 177 |
(aView respondsTo:#flyByHelpText) ifTrue:[ |
178 |
text := aView flyByHelpText. |
|
179 |
text notNil ifTrue:[^ text]. |
|
180 |
]. |
|
181 |
(aView respondsTo:#helpKey) ifTrue:[ |
|
182 |
key := aView helpKey. |
|
183 |
key notNil ifTrue:[ |
|
184 |
app := aView application. |
|
185 |
app isNil ifTrue:[ |
|
186 |
app := Error handle:[:ex | nil] do:[ aView windowGroup mainGroup application ]. |
|
187 |
]. |
|
188 |
app notNil ifTrue:[ |
|
189 |
^ app flyByHelpTextForKey:key |
|
190 |
]. |
|
191 |
^ aView resources string:key |
|
1536 | 192 |
]. |
193 |
]. |
|
2754 | 194 |
^ nil. |
2392 | 195 |
! ! |
196 |
||
197 |
!FlyByHelp methodsFor:'private'! |
|
1536 | 198 |
|
199 |
hideIfPointerLeft:aView |
|
200 |
"hide help, if the pointer is not in aView" |
|
201 |
||
202 |
|whereOnScreen| |
|
203 |
||
204 |
currentFrame notNil ifTrue:[ |
|
205 |
whereOnScreen := aView graphicsDevice pointerPosition. |
|
206 |
||
207 |
(currentFrame notNil |
|
208 |
and:[(currentFrame insetBy:1@1) containsPoint:whereOnScreen]) ifFalse:[ |
|
209 |
self hideHelp. |
|
210 |
]. |
|
211 |
]. |
|
212 |
||
213 |
"Modified: 28.5.1996 / 20:18:28 / cg" |
|
214 |
! |
|
215 |
||
216 |
initiateHelpFor:aView at:aPointOrNil now:showItNow |
|
217 |
"ask aView for helpText, passing x/y coordinates; |
|
218 |
start a timeout process to display this helpText after some delay; |
|
219 |
Normally used internally, but can also be used by widgets to force |
|
220 |
re-negotiation of the displayed helpText |
|
221 |
(for example in a menu, when the selection changes)" |
|
222 |
||
2679
552847065fb3
car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents:
2651
diff
changeset
|
223 |
|text delayTime now| |
1536 | 224 |
|
225 |
(self interestedIn:aView) ifFalse:[ |
|
226 |
^ self |
|
227 |
]. |
|
228 |
||
2679
552847065fb3
car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents:
2651
diff
changeset
|
229 |
now := Timestamp now. |
552847065fb3
car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents:
2651
diff
changeset
|
230 |
|
2680 | 231 |
"/ do not allow for more than 200 ms to be spent in the |
2679
552847065fb3
car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents:
2651
diff
changeset
|
232 |
"/ helpText gatherer (the codeView parses the code for the variable under the cursor) |
552847065fb3
car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents:
2651
diff
changeset
|
233 |
[ |
2826
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
234 |
Error handle:[:ex | |
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
235 |
('error in flyByhelp: ',ex description) errorPrintCR. |
2901
fed697afcef8
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2900
diff
changeset
|
236 |
"/ ex suspendedContext fullPrintAllOn:Transcript. |
2872
ea7e6fe01727
comment/format in: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2848
diff
changeset
|
237 |
"/ self halt. |
2826
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
238 |
] do:[ |
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
239 |
text := self helpTextFor:aView at:aPointOrNil. |
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
240 |
]. |
2684 | 241 |
] valueWithWatchDog:[ ^ self ] afterMilliseconds:(self flyByHelpTimeoutMillis). |
2679
552847065fb3
car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents:
2651
diff
changeset
|
242 |
|
1536 | 243 |
lastHelpText = text ifTrue:[ |
2392 | 244 |
self toolTipFollowsMouse ifFalse:[ |
245 |
^ self |
|
246 |
] |
|
1536 | 247 |
]. |
248 |
||
249 |
text size > 0 ifTrue:[ |
|
2778 | 250 |
(showItNow not and:[(delayTime := self delayTime) > 0]) ifTrue:[ |
1536 | 251 |
self stopHelpDisplayProcess. |
2392 | 252 |
showProcess := |
253 |
[ |
|
2680 | 254 |
Delay waitForSeconds:delayTime. |
2774
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
255 |
[ |
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
256 |
aView device anyButtonPressed ifFalse:[ |
2777
4cdef981fdb3
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2774
diff
changeset
|
257 |
showProcess := nil. |
2774
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
258 |
self showHelp:text for:aView |
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
259 |
] |
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
260 |
] ensure:[ |
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
261 |
showProcess := nil. |
2680 | 262 |
] |
2392 | 263 |
] forkAt:(Processor userSchedulingPriority + 1). |
1536 | 264 |
] ifFalse:[ |
265 |
self showHelp:text for:aView |
|
266 |
] |
|
1542 | 267 |
] ifFalse:[ |
268 |
self hideHelp |
|
1536 | 269 |
]. |
2872
ea7e6fe01727
comment/format in: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2848
diff
changeset
|
270 |
|
2901
fed697afcef8
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2900
diff
changeset
|
271 |
"Modified: / 22-03-2011 / 19:10:28 / cg" |
1536 | 272 |
! ! |
273 |
||
2392 | 274 |
!FlyByHelp methodsFor:'queries'! |
275 |
||
2692 | 276 |
currentlyShownView |
277 |
^ currentHelpView |
|
278 |
! |
|
279 |
||
2392 | 280 |
toolTipFollowsMouse |
281 |
^ false |
|
282 |
! ! |
|
283 |
||
1768 | 284 |
!FlyByHelp methodsFor:'show & hide help'! |
1536 | 285 |
|
286 |
hideHelp |
|
287 |
"hide the help text" |
|
288 |
||
289 |
|p| |
|
290 |
||
3198 | 291 |
"/ lastHelpText := nil. |
1536 | 292 |
self stopHelpDisplayProcess. |
293 |
||
294 |
currentHelpView notNil ifTrue:[ |
|
295 |
[ |
|
2780 | 296 |
currentHelpView notNil ifTrue:[ |
297 |
currentHelpView unmap. |
|
298 |
currentHelpView destroy. |
|
299 |
currentHelpView := nil. |
|
300 |
currentView := nil. |
|
301 |
] |
|
1536 | 302 |
] valueUninterruptably |
303 |
]. |
|
304 |
currentFrame := nil. |
|
3198 | 305 |
(p := closeProcess) notNil ifTrue:[ |
306 |
closeProcess := nil. |
|
1536 | 307 |
p terminate. |
308 |
] |
|
309 |
||
310 |
"Modified: 28.6.1997 / 14:03:50 / cg" |
|
311 |
! |
|
312 |
||
313 |
showHelp:aHelpText for:view |
|
314 |
"show the help text for aView" |
|
315 |
||
3114 | 316 |
|wg org p v dev helpViewWidth helpViewHeight usableWidth monitorBounds usableHeight| |
1536 | 317 |
|
2781 | 318 |
"/ thisContext fullPrintAllOn:Transcript. |
2651 | 319 |
(wg := view windowGroup) notNil ifTrue:[ |
320 |
wg isInModalLoop ifTrue:[ |
|
321 |
wg isModal ifFalse:[ |
|
322 |
^ self |
|
323 |
]. |
|
2628
03a41945fb37
do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents:
2612
diff
changeset
|
324 |
]. |
03a41945fb37
do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents:
2612
diff
changeset
|
325 |
]. |
03a41945fb37
do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents:
2612
diff
changeset
|
326 |
|
1536 | 327 |
view == currentView ifTrue:[ |
328 |
lastHelpText = aHelpText ifTrue:[ |
|
329 |
^ self |
|
330 |
] |
|
331 |
]. |
|
332 |
||
333 |
lastHelpText := aHelpText. |
|
334 |
||
2780 | 335 |
(p := closeProcess) notNil ifTrue:[ |
336 |
closeProcess := nil. |
|
1536 | 337 |
p terminate. |
338 |
]. |
|
339 |
currentHelpView notNil ifTrue:[ |
|
340 |
self hideHelp |
|
341 |
]. |
|
342 |
||
343 |
org := view originRelativeTo:nil. |
|
344 |
currentFrame := org extent:view extent. |
|
2848 | 345 |
org := org + (view extent // 2). |
1536 | 346 |
|
1677
dc49ab70b762
open helpView on the correcdt device
Claus Gittinger <cg@exept.de>
parents:
1657
diff
changeset
|
347 |
dev := view graphicsDevice. |
1536 | 348 |
|
1963
fb6663696d20
removed withCRs in showHelp:
Claus Gittinger <cg@exept.de>
parents:
1893
diff
changeset
|
349 |
v := ActiveHelpView for:aHelpText onDevice:dev. |
2848 | 350 |
helpViewWidth := v width. |
351 |
helpViewHeight := v height. |
|
1677
dc49ab70b762
open helpView on the correcdt device
Claus Gittinger <cg@exept.de>
parents:
1657
diff
changeset
|
352 |
|
3114 | 353 |
org := dev pointerPosition + (0@18"24"). |
354 |
monitorBounds := dev monitorBoundsAt:org. |
|
355 |
usableWidth := monitorBounds width - 2. |
|
356 |
usableHeight := dev usableHeightAt:org. |
|
357 |
||
358 |
helpViewWidth > usableWidth ifTrue:[v width:(helpViewWidth := usableWidth)]. |
|
359 |
helpViewHeight > usableHeight ifTrue:[v width:(helpViewHeight := usableHeight)]. |
|
360 |
||
361 |
(org x + helpViewWidth) > (monitorBounds left + usableWidth) ifTrue:[ |
|
362 |
org := ((monitorBounds left + usableWidth - helpViewWidth) @ org y). |
|
1536 | 363 |
]. |
3114 | 364 |
(org y + helpViewHeight) > (monitorBounds top + usableHeight) ifTrue:[ |
365 |
org := org x @ (monitorBounds top + usableHeight - helpViewHeight). |
|
1536 | 366 |
]. |
367 |
||
368 |
v origin:org. |
|
369 |
v realize. |
|
370 |
v enableButtonMotionEvents. |
|
371 |
v enableMotionEvents. |
|
372 |
currentHelpView := v. |
|
2392 | 373 |
currentView := view. |
1536 | 374 |
|
2392 | 375 |
self showTime notNil ifTrue:[ |
376 |
closeProcess := [ |
|
1546 | 377 |
[ |
2392 | 378 |
(Delay forSeconds:self showTime) wait. |
379 |
[ |
|
2780 | 380 |
|v| |
381 |
(v := currentHelpView) notNil ifTrue:[ |
|
2392 | 382 |
currentHelpView := nil. |
2780 | 383 |
v unmap. |
384 |
v destroy. |
|
2392 | 385 |
] |
386 |
] valueUninterruptably |
|
387 |
] ifCurtailed:[ |
|
388 |
closeProcess := nil. |
|
389 |
]. |
|
390 |
] newProcess. |
|
391 |
closeProcess priority:(Processor userSchedulingPriority + 1). |
|
392 |
closeProcess resume. |
|
393 |
]. |
|
1536 | 394 |
|
1963
fb6663696d20
removed withCRs in showHelp:
Claus Gittinger <cg@exept.de>
parents:
1893
diff
changeset
|
395 |
"Modified: / 31-08-1995 / 19:20:45 / claus" |
2848 | 396 |
"Modified: / 16-07-2010 / 14:33:13 / cg" |
1536 | 397 |
! |
398 |
||
399 |
stopHelpDisplayProcess |
|
400 |
|p| |
|
401 |
||
2680 | 402 |
(p := showProcess) notNil ifTrue:[ |
403 |
showProcess := nil. |
|
1536 | 404 |
p terminate. |
405 |
]. |
|
406 |
||
407 |
"Created: 28.6.1997 / 14:03:17 / cg" |
|
408 |
! ! |
|
409 |
||
410 |
!FlyByHelp class methodsFor:'documentation'! |
|
411 |
||
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
412 |
version |
3198 | 413 |
^ '$Header: /cvs/stx/stx/libview2/FlyByHelp.st,v 1.53 2013-07-22 09:16:49 cg Exp $' |
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
414 |
! |
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
415 |
|
2754 | 416 |
version_CVS |
3198 | 417 |
^ '$Header: /cvs/stx/stx/libview2/FlyByHelp.st,v 1.53 2013-07-22 09:16:49 cg Exp $' |
1536 | 418 |
! ! |
3114 | 419 |