author | Claus Gittinger <cg@exept.de> |
Fri, 26 Jul 2019 12:09:15 +0200 | |
changeset 4319 | 7c98ca2707d8 |
parent 4318 | ca938bab6a5d |
child 4320 | 1019a6f5ce79 |
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 |
||
3656 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
1536 | 16 |
ActiveHelp subclass:#FlyByHelp |
4119 | 17 |
instanceVariableNames:'currentFrame currentView currentHelpView showProcess closeProcess' |
18 |
classVariableNames:'MaxNumberOfLines MaxNumberOfColumns' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-Help' |
|
1536 | 21 |
! |
22 |
||
4231 | 23 |
Query subclass:#HelpKeyInsteadOfHelpTextQuery |
24 |
instanceVariableNames:'' |
|
25 |
classVariableNames:'' |
|
26 |
poolDictionaries:'' |
|
27 |
privateIn:FlyByHelp |
|
28 |
! |
|
29 |
||
1802 | 30 |
!FlyByHelp class methodsFor:'documentation'! |
31 |
||
32 |
copyright |
|
33 |
" |
|
34 |
COPYRIGHT (c) 2001 by eXept Software AG |
|
35 |
All Rights Reserved |
|
36 |
||
37 |
This software is furnished under a license and may be used |
|
38 |
only in accordance with the terms of that license and with the |
|
39 |
inclusion of the above copyright notice. This software may not |
|
40 |
be provided or otherwise made available to, or used by, any |
|
41 |
other person. No title to or ownership of the software is |
|
42 |
hereby transferred. |
|
43 |
" |
|
1893 | 44 |
! |
45 |
||
4055 | 46 |
documentation |
47 |
" |
|
48 |
an instance of me is used to provide tooltips |
|
4313 | 49 |
sigh: Smalltalk was ahead of its time in the early 90's: |
50 |
initially called 'activeHelp', |
|
51 |
then renamed to 'flyByHelp' |
|
52 |
and is now commonly known as 'tooltip'. |
|
4055 | 53 |
|
54 |
I will watch the mouse movements via an event hook, and determine |
|
4313 | 55 |
where the mouse pointer is. |
56 |
Then ask the underlying view about its helpText |
|
57 |
and display it in a little floating popup view. |
|
58 |
||
59 |
The tool is installed via: |
|
60 |
FlyByHelp start |
|
61 |
and possibly deactivated/uninstalled via: |
|
62 |
FlyByHelp stop |
|
4055 | 63 |
|
4313 | 64 |
There can be only one FlyByHelp at any time - the start/stop methods assure that. |
4055 | 65 |
|
4313 | 66 |
Additional features: |
67 |
if you press CTRL, the helpKey which was responsible for the helptext |
|
68 |
is shown instead of the full text. This helps to find out which text to modify |
|
69 |
in case of typing errors or missing translations. |
|
70 |
||
71 |
if you press LEFTSHIFT+RIGHTSHIFT+CTRL (in that order), a menu developper menu appears, |
|
72 |
but only if Smalltalk is in the debeloper mode (i.e. not in end-user applications). |
|
4055 | 73 |
" |
74 |
! |
|
75 |
||
1893 | 76 |
examples |
77 |
" |
|
3220 | 78 |
UserPreferences current toolTipShapeStyle:nil |
79 |
UserPreferences current toolTipShapeStyle:#cartoon |
|
80 |
||
1893 | 81 |
FlyByHelp isActive |
82 |
||
83 |
FlyByHelp stop |
|
84 |
FlyByHelp start |
|
85 |
" |
|
1802 | 86 |
! ! |
1536 | 87 |
|
2692 | 88 |
!FlyByHelp class methodsFor:'accessing'! |
89 |
||
90 |
currentlyShownView |
|
2846
e90ba00f9df1
changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents:
2826
diff
changeset
|
91 |
TheOneAndOnlyHelpListener isNil ifTrue:[^ nil]. |
2692 | 92 |
^ TheOneAndOnlyHelpListener currentlyShownView |
2846
e90ba00f9df1
changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents:
2826
diff
changeset
|
93 |
|
e90ba00f9df1
changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents:
2826
diff
changeset
|
94 |
"Modified: / 09-06-2010 / 16:35:48 / cg" |
3255 | 95 |
! |
96 |
||
4231 | 97 |
helpKeyInsteadOfHelpTextQuery |
98 |
^ HelpKeyInsteadOfHelpTextQuery |
|
99 |
||
100 |
"Created: / 22-02-2019 / 09:38:18 / Claus Gittinger" |
|
101 |
! |
|
102 |
||
3255 | 103 |
maxNumberOfColumns |
104 |
^ MaxNumberOfColumns ? 200 |
|
105 |
! |
|
106 |
||
107 |
maxNumberOfLines |
|
108 |
^ MaxNumberOfLines ? 40 |
|
2692 | 109 |
! ! |
110 |
||
2684 | 111 |
!FlyByHelp methodsFor:'defaults'! |
112 |
||
113 |
flyByHelpTimeoutMillis |
|
114 |
"abort flyby help text generation, if no text can be generated within that |
|
115 |
time delta. This is used to abort long-lasting parsing/scanning/analysis in |
|
116 |
large methods when the mouse is moved over some syntactic constructs, and |
|
117 |
it takes too long to parse... |
|
118 |
The returned time is given in ms" |
|
119 |
||
120 |
^ 300 |
|
121 |
! ! |
|
122 |
||
4233 | 123 |
!FlyByHelp methodsFor:'developer menu'! |
124 |
||
125 |
openDeveloperMenuFor:aView at:aPoint |
|
126 |
"with CTRL+SHIFT, this menu appears" |
|
127 |
||
128 |
|app helpText helpKey| |
|
129 |
||
4318 | 130 |
self hideHelp. |
131 |
||
4233 | 132 |
app := aView topView application. |
4308 | 133 |
app isNil ifTrue:[ Transcript showCR:'no app for view: %1' with:aView. ^ self ]. |
134 |
||
4233 | 135 |
app enqueueDelayedAction:[ |
4319 | 136 |
|editor m canDefineTranslationForLabel canDefineTranslationForHelpText menuItem i| |
4233 | 137 |
|
4290 | 138 |
canDefineTranslationForHelpText := lastHelpText notEmptyOrNil. |
139 |
canDefineTranslationForHelpText := canDefineTranslationForHelpText or:[ (helpText := aView helpTextAt:aPoint) notEmptyOrNil]. |
|
140 |
canDefineTranslationForHelpText := canDefineTranslationForHelpText or:[ (helpText := aView helpText) notEmptyOrNil]. |
|
141 |
canDefineTranslationForHelpText := canDefineTranslationForHelpText or:[ (helpKey := aView helpKey) notNil]. |
|
142 |
canDefineTranslationForHelpText := canDefineTranslationForHelpText or:[ (helpText := app helpTextFor:aView) notEmptyOrNil ]. |
|
143 |
||
4233 | 144 |
m := Menu new. |
145 |
m addItem:(MenuItem |
|
4313 | 146 |
label:(((aView fullName ? 'unnamed')) withColor:Color grey)). |
147 |
||
148 |
aView isMenu ifTrue:[ |
|
149 |
menuItem := aView itemAtPoint:aPoint. |
|
4314 | 150 |
menuItem notNil ifTrue:[ |
151 |
m addItem:(MenuItem |
|
152 |
label:(('MenuItem''s NameKey: ',(menuItem nameKey printString)) withColor:Color grey)). |
|
153 |
]. |
|
4313 | 154 |
]. |
155 |
||
156 |
m addSeparator. |
|
4308 | 157 |
m addItem:(MenuItem |
4290 | 158 |
label: 'Copy Helptext' |
159 |
itemValue:[ |
|
160 |
|package key | |
|
161 |
||
162 |
key := (lastHelpText ? helpText ? helpKey) asString string. |
|
163 |
aView topView setClipboardText:key. |
|
164 |
] |
|
165 |
enabled:canDefineTranslationForHelpText). |
|
166 |
m addSeparator. |
|
167 |
||
168 |
m addItem:(MenuItem |
|
4233 | 169 |
label: 'Edit Resources' |
170 |
itemValue:[ |
|
171 |
app enqueueDelayedAction:[ |
|
172 |
app withWaitCursorDo:[ |
|
173 |
editor := Tools::InternationalLanguageTranslationEditor |
|
174 |
openOnPackage:((aView topView application ? aView) class package). |
|
175 |
editor selectOrAddKey:(lastHelpText storeString withoutCRs). |
|
176 |
Transcript showCR:'help text is: %1' with:lastHelpText storeString withoutCRs. |
|
177 |
||
178 |
]. |
|
179 |
]. |
|
180 |
]). |
|
181 |
m addItem:(MenuItem |
|
182 |
label: 'Browse Resources' |
|
183 |
itemValue:[ |
|
184 |
app enqueueDelayedAction:[ |
|
185 |
app withWaitCursorDo:[ |
|
186 |
FileBrowser default |
|
187 |
openOn:(app class projectDefinitionClass |
|
188 |
packageDirectory / 'resources'). |
|
189 |
]. |
|
190 |
]. |
|
191 |
]). |
|
192 |
||
193 |
canDefineTranslationForLabel := |
|
194 |
[ |
|
195 |
(aView isKindOf:Label) or:[aView respondsTo:#label] |
|
196 |
]. |
|
197 |
||
198 |
m addItem:(MenuItem |
|
199 |
label: 'Define Translation for Label...' |
|
200 |
itemValue:[ |
|
201 |
|package key | |
|
202 |
||
203 |
key := aView label asString string. |
|
204 |
package := app class package. |
|
205 |
ResourcePack defineResourceFor:key package:package. |
|
206 |
] |
|
207 |
enabled:canDefineTranslationForLabel). |
|
208 |
m addItem:(MenuItem |
|
209 |
label: 'Define Translation for Helptext...' |
|
210 |
itemValue:[ |
|
211 |
|package key | |
|
212 |
||
213 |
key := (lastHelpText ? helpText ? helpKey) asString string. |
|
214 |
package := app class package. |
|
215 |
ResourcePack defineResourceFor:key package:package. |
|
216 |
] |
|
217 |
enabled:canDefineTranslationForHelpText). |
|
218 |
||
219 |
m addSeparator. |
|
4319 | 220 |
m addItem:(i := MenuItem |
4233 | 221 |
label: 'Browse Application' |
222 |
itemValue:[ SystemBrowser default openInClass:aView application class]). |
|
4319 | 223 |
i enabled:(aView application notNil). |
224 |
||
225 |
m addItem:(i := MenuItem |
|
4233 | 226 |
label: 'UI Painter' |
227 |
itemValue:[ UIPainter openOnClass:aView application class andSelector:#windowSpec]). |
|
4319 | 228 |
i enabled:(aView application notNil). |
4233 | 229 |
|
230 |
aView application ~~ app ifTrue:[ |
|
231 |
m addSeparator. |
|
232 |
m addItem:(MenuItem |
|
233 |
label: 'Browse Top Application' |
|
234 |
itemValue:[ SystemBrowser default openInClass:app class]). |
|
235 |
||
236 |
m addItem:(MenuItem |
|
237 |
label: 'UI Painter on Top Application' |
|
238 |
itemValue:[ UIPainter openOnClass:app class andSelector:#windowSpec]). |
|
239 |
]. |
|
240 |
||
4313 | 241 |
m addSeparator. |
4319 | 242 |
m addItem:(i := MenuItem label: 'Inspect Application' itemValue:[ app inspect ]). |
243 |
i enabled:(app notNil). |
|
244 |
m addItem:(i := MenuItem label: 'Inspect View' itemValue:[ aView inspect ]). |
|
245 |
m addItem:(i := MenuItem label: 'Inspect Model' itemValue:[ aView model inspect ]). |
|
246 |
i enabled:(aView model notNil). |
|
4313 | 247 |
|
248 |
menuItem notNil ifTrue:[ |
|
249 |
m addItem:(MenuItem label: 'Inspect Menuitem' itemValue:[ menuItem inspect ]). |
|
250 |
]. |
|
251 |
||
4233 | 252 |
m showAtPointer. |
253 |
]. |
|
254 |
||
255 |
"Created: / 22-02-2019 / 09:32:35 / Claus Gittinger" |
|
4314 | 256 |
"Modified: / 21-07-2019 / 07:04:08 / Claus Gittinger" |
4233 | 257 |
! ! |
258 |
||
2392 | 259 |
!FlyByHelp methodsFor:'event handling'! |
1540 | 260 |
|
2474 | 261 |
buttonMotion:buttonAndModifierState x:x y:y view:aView |
4252 | 262 |
"/ DebuggingEvents := true |
263 |
"/ DebuggingEvents := false |
|
264 |
DebuggingEvents == true ifTrue:[ |
|
265 |
('%1: ==== ButtonMotion view:%2' |
|
4281 | 266 |
bindWith:self className |
4252 | 267 |
with:aView) infoPrintCR. |
268 |
]. |
|
269 |
||
2519 | 270 |
aView == currentHelpView ifTrue:[ |
271 |
"/ the help-bubble itself |
|
272 |
^ false |
|
273 |
]. |
|
274 |
||
4055 | 275 |
"/ don't start tooltip, if this view is not active. |
276 |
"/ The following line does not work, because motion events are reported for the current focus-view, |
|
3321 | 277 |
"/ which is always active. Must check after we have determined the view under the pointer |
3675 | 278 |
"/ aView topView isActive ifFalse:[^ false]. |
2477
b009e0b51999
suppress tooltip for inactive (lower) windows
Claus Gittinger <cg@exept.de>
parents:
2474
diff
changeset
|
279 |
|
2474 | 280 |
^ super buttonMotion:buttonAndModifierState x:x y:y view:aView |
4281 | 281 |
|
282 |
"Modified: / 28-06-2019 / 08:43:54 / Claus Gittinger" |
|
1540 | 283 |
! |
284 |
||
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
285 |
buttonPress:button x:x y:y view:aView |
3198 | 286 |
|prevView| |
287 |
||
4252 | 288 |
"/ DebuggingEvents := true |
289 |
"/ DebuggingEvents := false |
|
290 |
DebuggingEvents == true ifTrue:[ |
|
291 |
('%1: ButtonPress view:%2' |
|
4281 | 292 |
bindWith:self className |
4252 | 293 |
with:aView) infoPrintCR. |
294 |
]. |
|
295 |
||
3198 | 296 |
"/ hideHelp nils the currentView |
297 |
"/ we restore it, so the tooltip is not shown again for this view |
|
298 |
"/ until the mouse really leaves the view |
|
299 |
"/ let's call this the "do-not-show-in-this-view mode" |
|
300 |
prevView := currentView. |
|
2978
4358a9302b95
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2925
diff
changeset
|
301 |
self hideHelp. |
3198 | 302 |
currentView := prevView. |
303 |
||
304 |
^ false |
|
2978
4358a9302b95
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2925
diff
changeset
|
305 |
|
4358a9302b95
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2925
diff
changeset
|
306 |
"Modified: / 23-12-2011 / 20:37:28 / cg" |
4281 | 307 |
"Modified: / 28-06-2019 / 08:43:57 / Claus Gittinger" |
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
308 |
! |
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
309 |
|
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
310 |
keyPress:key x:x y:y view:aView |
4308 | 311 |
"care for the special keys: |
312 |
Ctrl (while help is shown) |
|
313 |
L-Shift+R-Shift+Ctrl (while nothing is shown) |
|
314 |
" |
|
315 |
||
4226 | 316 |
<resource: #keyboard (#Escape #Control #Shift)> |
3216 | 317 |
|
4228 | 318 |
|prevView text| |
3198 | 319 |
|
4252 | 320 |
"/ DebuggingEvents := true |
321 |
"/ DebuggingEvents := false |
|
4307 | 322 |
"/ Debugging := true. |
323 |
"/ Debugging := false. |
|
4252 | 324 |
DebuggingEvents == true ifTrue:[ |
4307 | 325 |
'-----' infoPrintCR. |
326 |
('%1: KeyPress view:%2 (currentHelpView=%3)' |
|
4281 | 327 |
bindWith:self className |
4307 | 328 |
with:aView |
329 |
with:currentHelpView) infoPrintCR. |
|
4252 | 330 |
]. |
2885
a70144d85a81
changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2884
diff
changeset
|
331 |
currentHelpView notNil ifTrue:[ |
4313 | 332 |
"/ Transcript show:'with help view shown: '; showCR:key. |
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
333 |
key == #Escape ifTrue:[ |
3198 | 334 |
prevView := currentView. |
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
335 |
self hideHelp. |
3198 | 336 |
currentView := prevView. |
4230 | 337 |
^ false |
2885
a70144d85a81
changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2884
diff
changeset
|
338 |
]. |
4228 | 339 |
(#(#'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[ |
4226 | 340 |
"/ reopen showing the key |
4313 | 341 |
"/ Transcript show:'re initialize help: '; showCR:key. |
4226 | 342 |
self initiateHelpFor:aView at:(x@y) now:true. |
4230 | 343 |
^ false |
4226 | 344 |
]. |
4313 | 345 |
Smalltalk isStandAloneApp ifFalse:[ |
4318 | 346 |
key == $§ ifTrue:[ |
4313 | 347 |
"/ generate a line suitable for the resources file (a null translation) |
348 |
"/ into the clipboard; makes it easy to add missing translations to a .rs file, |
|
349 |
"/ by pressing paragraph whenever you see an untranslated helptext |
|
350 |
text := (lastHelpText storeString withoutCRs, ' ' , lastHelpText storeString withoutCRs). |
|
351 |
aView setClipboardText:text. |
|
352 |
self hideHelp. |
|
353 |
^ false |
|
354 |
]. |
|
355 |
(#(#'Shift' #'Shift_L' #'Shift_R') includes:key) ifTrue:[ |
|
356 |
aView device ctrlDown ifTrue:[ |
|
357 |
self openDeveloperMenuFor:aView at:x@y |
|
358 |
]. |
|
359 |
^ false |
|
360 |
]. |
|
361 |
]. |
|
362 |
(#('Shift' #'Shift_L' #'Shift_R' ) includes:key) ifTrue:[ |
|
3216 | 363 |
"/ do not close on those... |
364 |
^ false |
|
365 |
]. |
|
4307 | 366 |
] ifFalse:[ |
4313 | 367 |
"/ Transcript show:'without help view shown: '; showCR:key. |
368 |
Smalltalk isStandAloneApp ifFalse:[ |
|
369 |
"/ both shifts AND then ctrl... |
|
370 |
(#(#'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[ |
|
371 |
aView device leftShiftDown ifTrue:[ |
|
372 |
aView device rightShiftDown ifTrue:[ |
|
373 |
self openDeveloperMenuFor:aView at:x@y |
|
374 |
]. |
|
4307 | 375 |
]. |
4313 | 376 |
^ false |
4307 | 377 |
]. |
4313 | 378 |
]. |
4226 | 379 |
]. |
3198 | 380 |
|
381 |
"/ hideHelp nils the currentView |
|
382 |
"/ we restore it, so the tooltip is not shown again for this view |
|
383 |
"/ until the mouse really leaves the view |
|
384 |
"/ let's call this the "do-not-show-in-this-view mode" |
|
385 |
prevView := currentView. |
|
386 |
self hideHelpIgnoringErrors. |
|
387 |
currentView := prevView. |
|
388 |
||
389 |
^ false |
|
390 |
"/ ^ 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
|
391 |
|
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
392 |
"Modified (format): / 25-12-2011 / 10:25:23 / cg" |
4082 | 393 |
"Modified (format): / 16-04-2018 / 16:53:15 / stefan" |
4313 | 394 |
"Modified: / 20-07-2019 / 08:55:01 / Claus Gittinger" |
4226 | 395 |
! |
396 |
||
397 |
keyRelease:key x:x y:y view:aView |
|
398 |
<resource: #keyboard (#Control)> |
|
399 |
||
4252 | 400 |
"/ DebuggingEvents := true |
401 |
"/ DebuggingEvents := false |
|
402 |
DebuggingEvents == true ifTrue:[ |
|
403 |
('%1: KeyRelease view:%2' |
|
4281 | 404 |
bindWith:self className |
4252 | 405 |
with:aView) infoPrintCR. |
406 |
]. |
|
4226 | 407 |
currentHelpView notNil ifTrue:[ |
408 |
(#(#'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[ |
|
409 |
"/ reopen showing the text |
|
410 |
self initiateHelpFor:aView at:(x@y) now:true. |
|
411 |
^ true |
|
412 |
]. |
|
413 |
(#('Shift' #'Shift_L' #'Shift_R' #'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[ |
|
414 |
"/ do not close on those... |
|
415 |
^ false |
|
416 |
]. |
|
417 |
]. |
|
418 |
^ super keyRelease:key x:x y:y view:aView |
|
419 |
||
420 |
"Created: / 20-02-2019 / 11:26:19 / Claus Gittinger" |
|
4281 | 421 |
"Modified: / 28-06-2019 / 08:44:06 / Claus Gittinger" |
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
422 |
! |
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
423 |
|
2521
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
424 |
mouseWheelMotion:state x:x y:y amount:amount deltaTime:dTime view:aView |
4252 | 425 |
"/ DebuggingEvents := true |
426 |
"/ DebuggingEvents := false |
|
427 |
DebuggingEvents == true ifTrue:[ |
|
428 |
('%1: MouseWheel view:%2' |
|
4281 | 429 |
bindWith:self className |
4252 | 430 |
with:aView) infoPrintCR. |
431 |
]. |
|
2521
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
432 |
currentHelpView notNil ifTrue:[ |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
433 |
self handleMouseIn:aView x:x y:y. |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
434 |
]. |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
435 |
^ false |
4281 | 436 |
|
437 |
"Modified: / 28-06-2019 / 08:44:10 / Claus Gittinger" |
|
2521
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
438 |
! |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
439 |
|
1540 | 440 |
pointerLeave:state view:aView |
4252 | 441 |
"/ DebuggingEvents := true |
442 |
"/ DebuggingEvents := false |
|
443 |
DebuggingEvents == true ifTrue:[ |
|
444 |
('%1: **** PointerLeave view:%2' |
|
4281 | 445 |
bindWith:self className |
4252 | 446 |
with:aView) infoPrintCR. |
447 |
]. |
|
448 |
||
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
449 |
aView == currentHelpView ifTrue:[^ true]. |
3198 | 450 |
|
451 |
"/ clear the do-not-show-in-this-view mode (see keyPress) |
|
452 |
"/ (currentHelpView isNil and:[currentView notNil]) ifTrue:[currentView := nil]. |
|
453 |
||
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
454 |
^ super pointerLeave:state view:aView |
4281 | 455 |
|
456 |
"Modified: / 28-06-2019 / 08:44:13 / Claus Gittinger" |
|
1540 | 457 |
! ! |
458 |
||
2392 | 459 |
!FlyByHelp methodsFor:'help texts'! |
1536 | 460 |
|
461 |
helpTextFromModel:aModel view:aView at:aPointOrNil |
|
462 |
"helper: ask aModel for its helpText." |
|
463 |
||
464 |
|text| |
|
465 |
||
4048 | 466 |
(aPointOrNil notNil and:[aModel respondsTo:#helpTextFor:at:]) ifTrue:[ |
467 |
text := aModel helpTextFor:aView at:aPointOrNil. |
|
4121 | 468 |
text notNil ifTrue:[ |
469 |
"/ Transcript showCR:aModel. |
|
470 |
"/ Transcript showCR:'via model-text'; showCR:text. |
|
471 |
^ text |
|
472 |
]. |
|
1536 | 473 |
]. |
4048 | 474 |
(aModel respondsTo:#helpTextFor:) ifTrue:[ |
475 |
text := aModel helpTextFor:aView. |
|
4121 | 476 |
text notNil ifTrue:[ |
477 |
"/ Transcript showCR:aModel. |
|
478 |
"/ Transcript showCR:'via model-text'; showCR:text. |
|
479 |
^ text |
|
480 |
]. |
|
1536 | 481 |
]. |
2754 | 482 |
^ nil |
4040 | 483 |
|
484 |
"Modified: / 09-01-2018 / 17:35:26 / stefan" |
|
4121 | 485 |
"Modified: / 11-06-2018 / 09:53:40 / Claus Gittinger" |
1536 | 486 |
! |
487 |
||
488 |
helpTextFromView:aView at:aPointOrNil |
|
489 |
"helper: ask aView for its helpText." |
|
490 |
||
2754 | 491 |
|text key app| |
1536 | 492 |
|
4121 | 493 |
"/ is there any view which does not understand helpTextAt: ??? |
4048 | 494 |
(aPointOrNil notNil and:[aView respondsTo:#helpTextAt:]) ifTrue:[ |
495 |
text := aView helpTextAt:aPointOrNil. |
|
4121 | 496 |
text notNil ifTrue:[ |
497 |
"/ Transcript showCR:'via helpTextAt:'; showCR:text. |
|
498 |
^ text |
|
499 |
]. |
|
1536 | 500 |
]. |
4121 | 501 |
"/ is there any view which does not understand helpText ??? |
4048 | 502 |
(aView respondsTo:#helpText) ifTrue:[ |
503 |
text := aView helpText. |
|
4121 | 504 |
text notNil ifTrue:[ |
505 |
"/ Transcript showCR:'via helpText'; showCR:text. |
|
4220 | 506 |
^ text value |
4121 | 507 |
]. |
2754 | 508 |
]. |
3804 | 509 |
"/ to be enabled in next release... |
510 |
"/ (aView superView notNil |
|
4048 | 511 |
"/ and:[aView superView respondsTo:#helpTextFor:]) ifTrue:[ |
512 |
"/ text := aView superView helpTextFor:aView. |
|
3804 | 513 |
"/ text notNil ifTrue:[^ text]. |
514 |
"/ ]. |
|
4121 | 515 |
|
516 |
"/ is there any view which does not understand helpKey ??? |
|
2754 | 517 |
(aView respondsTo:#helpKey) ifTrue:[ |
518 |
key := aView helpKey. |
|
519 |
key notNil ifTrue:[ |
|
520 |
app := aView application. |
|
521 |
app isNil ifTrue:[ |
|
4175 | 522 |
|topView topViewsHelpSpec| |
523 |
||
3763 | 524 |
"/ special case for oldStyle Dialog subclasses. |
4175 | 525 |
topView := aView topView. |
526 |
(topViewsHelpSpec := topView helpSpec) notNil ifTrue:[ |
|
527 |
text := topViewsHelpSpec at:key ifAbsent:nil. |
|
3763 | 528 |
text notNil ifTrue:[ |
4121 | 529 |
"/ Transcript showCR:'via topViewspec+helpKey'; showCR:text. |
4175 | 530 |
^ topView resources stringWithCRs:text. |
3763 | 531 |
]. |
532 |
]. |
|
2754 | 533 |
app := Error handle:[:ex | nil] do:[ aView windowGroup mainGroup application ]. |
534 |
]. |
|
535 |
app notNil ifTrue:[ |
|
4121 | 536 |
text := app helpTextForKey:key. |
537 |
true "text notNil" ifTrue:[ |
|
538 |
"/ Transcript showCR:'via helpKey+helpTextForKey:'; showCR:text. |
|
539 |
^ text |
|
540 |
]. |
|
2754 | 541 |
]. |
4121 | 542 |
text := aView resources string:key. |
543 |
true "(text notNil and:[text ~= key])" ifTrue:[ |
|
544 |
"/ Transcript showCR:'via helpKey'; showCR:text. |
|
4110 | 545 |
^ text |
546 |
] |
|
1536 | 547 |
]. |
548 |
]. |
|
2754 | 549 |
^ nil. |
4040 | 550 |
|
551 |
"Modified: / 09-01-2018 / 17:38:42 / stefan" |
|
4111 | 552 |
"Modified (format): / 07-06-2018 / 09:51:41 / sr" |
4220 | 553 |
"Modified: / 07-02-2019 / 19:18:39 / Claus Gittinger" |
2392 | 554 |
! ! |
555 |
||
4119 | 556 |
!FlyByHelp methodsFor:'queries'! |
557 |
||
558 |
currentlyShownView |
|
559 |
^ currentHelpView |
|
560 |
! |
|
561 |
||
562 |
toolTipFollowsMouse |
|
563 |
"if true, the tooltip-window moves with the pointer |
|
564 |
so that it stays away from (does not cover) the mouse pointer" |
|
565 |
||
566 |
^ false |
|
567 |
||
568 |
"Modified: / 06-06-2018 / 17:37:19 / Claus Gittinger" |
|
569 |
! ! |
|
570 |
||
571 |
!FlyByHelp methodsFor:'show & hide help'! |
|
572 |
||
573 |
activeHelpViewForApplication:applicationOrNil text:helpText onDevice:aDevice |
|
574 |
applicationOrNil notNil ifTrue:[ |
|
575 |
^ applicationOrNil activeHelpViewFor:helpText onDevice:aDevice |
|
576 |
]. |
|
577 |
^ ActiveHelpView for:helpText onDevice:aDevice. |
|
578 |
||
579 |
" |
|
580 |
(ActiveHelpView for:'Hello' onDevice:Display) open |
|
581 |
" |
|
582 |
! |
|
583 |
||
584 |
hideHelp |
|
585 |
"hide the help text" |
|
586 |
||
4313 | 587 |
|p v| |
4119 | 588 |
|
589 |
"/ lastHelpText := nil. |
|
590 |
self stopHelpDisplayProcess. |
|
591 |
lastHelpText := nil. |
|
592 |
||
593 |
currentHelpView notNil ifTrue:[ |
|
594 |
[ |
|
4313 | 595 |
(v := currentHelpView) notNil ifTrue:[ |
4119 | 596 |
currentHelpView := nil. |
4313 | 597 |
v destroy. |
4119 | 598 |
currentView := nil. |
599 |
] |
|
600 |
] valueUninterruptably |
|
601 |
]. |
|
4313 | 602 |
|
4119 | 603 |
currentFrame := nil. |
604 |
(p := closeProcess) notNil ifTrue:[ |
|
605 |
closeProcess := nil. |
|
606 |
p terminate. |
|
607 |
] |
|
608 |
||
609 |
"Modified: / 28-06-1997 / 14:03:50 / cg" |
|
610 |
"Modified: / 16-04-2018 / 16:51:01 / stefan" |
|
4313 | 611 |
"Modified: / 20-07-2019 / 08:48:34 / Claus Gittinger" |
4119 | 612 |
! |
1536 | 613 |
|
614 |
hideIfPointerLeft:aView |
|
615 |
"hide help, if the pointer is not in aView" |
|
616 |
||
4119 | 617 |
|helpFrame whereOnScreen| |
1536 | 618 |
|
4119 | 619 |
(helpFrame := currentFrame) notNil ifTrue:[ |
1536 | 620 |
whereOnScreen := aView graphicsDevice pointerPosition. |
621 |
||
4119 | 622 |
((helpFrame insetBy:1@1) containsPoint:whereOnScreen) ifFalse:[ |
1536 | 623 |
self hideHelp. |
4119 | 624 |
] ifTrue:[ |
625 |
pointerPositionAtShowTime notNil ifTrue:[ |
|
626 |
(whereOnScreen dist:pointerPositionAtShowTime) > 10 ifTrue:[ |
|
627 |
self hideHelp. |
|
628 |
]. |
|
629 |
]. |
|
630 |
]. |
|
1536 | 631 |
]. |
632 |
||
4082 | 633 |
"Modified: / 28-05-1996 / 20:18:28 / cg" |
634 |
"Modified: / 16-04-2018 / 16:59:48 / stefan" |
|
4119 | 635 |
"Modified: / 08-06-2018 / 10:30:04 / Claus Gittinger" |
1536 | 636 |
! |
637 |
||
638 |
initiateHelpFor:aView at:aPointOrNil now:showItNow |
|
639 |
"ask aView for helpText, passing x/y coordinates; |
|
640 |
start a timeout process to display this helpText after some delay; |
|
641 |
Normally used internally, but can also be used by widgets to force |
|
642 |
re-negotiation of the displayed helpText |
|
643 |
(for example in a menu, when the selection changes)" |
|
644 |
||
4110 | 645 |
|text delayTime| |
1536 | 646 |
|
4252 | 647 |
Debugging ifTrue:[ |
4281 | 648 |
('%1: initiateHelpFor:at:now: %2' bindWith:self className with:aView) infoPrintCR. |
4252 | 649 |
]. |
1536 | 650 |
(self interestedIn:aView) ifFalse:[ |
4237 | 651 |
Debugging ifTrue:[ |
4252 | 652 |
('%1: not interested' bindWith:self class name) infoPrintCR |
4237 | 653 |
]. |
1536 | 654 |
^ self |
655 |
]. |
|
656 |
||
2680 | 657 |
"/ 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
|
658 |
"/ 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
|
659 |
[ |
2826
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
660 |
Error handle:[:ex | |
4252 | 661 |
('%1: [warning]: error while asking for helpText: %2' bindWith:self class name with:ex description) errorPrintCR. |
662 |
'-------------------------' errorPrintCR. |
|
663 |
ex suspendedContext fullPrintAllOn:(Transcript ? Stderr). |
|
2872
ea7e6fe01727
comment/format in: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2848
diff
changeset
|
664 |
"/ self halt. |
2826
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
665 |
] do:[ |
4231 | 666 |
HelpKeyInsteadOfHelpTextQuery answer:(aView device ctrlDown) do:[ |
667 |
text := self helpTextFor:aView at:aPointOrNil. |
|
668 |
]. |
|
2826
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
669 |
]. |
3656 | 670 |
] valueWithWatchDog:[ |
4252 | 671 |
('%1 [info]: flyBy text generation took too long' bindWith:self class name) infoPrintCR. |
3656 | 672 |
^ self |
673 |
] afterMilliseconds:(self flyByHelpTimeoutMillis). |
|
2679
552847065fb3
car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents:
2651
diff
changeset
|
674 |
|
4110 | 675 |
false ifTrue:[ |
676 |
(text notNil and:[text isEmpty]) ifTrue:[ |
|
677 |
Logger warning:('empty help from: ',aView class printString) |
|
678 |
] ifFalse:[ |
|
679 |
text isEmptyOrNil ifTrue:[ |
|
680 |
Logger warning:('no help from: ',aView class printString) |
|
681 |
]. |
|
682 |
]. |
|
683 |
]. |
|
684 |
||
4252 | 685 |
(lastHelpText = text and:[lastHelpWidget == aView]) ifTrue:[ |
686 |
"/ Debugging := true |
|
4237 | 687 |
Debugging == true ifTrue:[ |
688 |
'same text: ' infoPrint. text infoPrintCR. |
|
689 |
]. |
|
4082 | 690 |
self toolTipFollowsMouse ifFalse:[ |
4252 | 691 |
Debugging == true ifTrue:[ |
692 |
'tooltip does not follow mouse: ' infoPrint. text infoPrintCR. |
|
693 |
]. |
|
4082 | 694 |
^ self |
2392 | 695 |
] |
1536 | 696 |
]. |
697 |
||
4110 | 698 |
((text size > 0) or:[text notNil and:[text isString not]]) ifTrue:[ |
2778 | 699 |
(showItNow not and:[(delayTime := self delayTime) > 0]) ifTrue:[ |
1536 | 700 |
self stopHelpDisplayProcess. |
2392 | 701 |
showProcess := |
702 |
[ |
|
2680 | 703 |
Delay waitForSeconds:delayTime. |
2774
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
704 |
[ |
3766 | 705 |
aView device notNil ifTrue:[ |
706 |
aView device anyButtonPressed ifFalse:[ |
|
707 |
showProcess := nil. |
|
708 |
self showHelp:text for:aView |
|
709 |
] |
|
710 |
]. |
|
2774
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
711 |
] ensure:[ |
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
712 |
showProcess := nil. |
2680 | 713 |
] |
2392 | 714 |
] forkAt:(Processor userSchedulingPriority + 1). |
1536 | 715 |
] ifFalse:[ |
716 |
self showHelp:text for:aView |
|
717 |
] |
|
1542 | 718 |
] ifFalse:[ |
4252 | 719 |
Debugging == true ifTrue:[ |
720 |
'empty text: ' infoPrint. text infoPrintCR. |
|
721 |
]. |
|
1542 | 722 |
self hideHelp |
1536 | 723 |
]. |
2872
ea7e6fe01727
comment/format in: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2848
diff
changeset
|
724 |
|
2901
fed697afcef8
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2900
diff
changeset
|
725 |
"Modified: / 22-03-2011 / 19:10:28 / cg" |
4082 | 726 |
"Modified: / 16-04-2018 / 12:20:33 / stefan" |
4281 | 727 |
"Modified: / 28-06-2019 / 08:44:00 / Claus Gittinger" |
1536 | 728 |
! |
729 |
||
730 |
showHelp:aHelpText for:view |
|
731 |
"show the help text for aView" |
|
732 |
||
3786 | 733 |
|wg applicationOrNil org p v device helpTextShown textLines |
3334 | 734 |
helpViewWidth helpViewHeight usableWidth monitorBounds usableHeight |
4119 | 735 |
showTime cursorView pos pointerPosition| |
1536 | 736 |
|
2781 | 737 |
"/ thisContext fullPrintAllOn:Transcript. |
2651 | 738 |
(wg := view windowGroup) notNil ifTrue:[ |
739 |
wg isInModalLoop ifTrue:[ |
|
740 |
wg isModal ifFalse:[ |
|
4252 | 741 |
Debugging ifTrue:[ 'FlyByHelp: not modal' infoPrintCR ]. |
2651 | 742 |
^ self |
743 |
]. |
|
2628
03a41945fb37
do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents:
2612
diff
changeset
|
744 |
]. |
03a41945fb37
do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents:
2612
diff
changeset
|
745 |
]. |
03a41945fb37
do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents:
2612
diff
changeset
|
746 |
|
3786 | 747 |
device := view graphicsDevice. |
4119 | 748 |
pointerPosition := device pointerPosition. |
749 |
||
3418 | 750 |
"/ mouse still over that view? |
4119 | 751 |
cursorView := device viewFromPoint:pointerPosition. |
3418 | 752 |
cursorView ~~ view ifTrue:[ |
4252 | 753 |
Debugging ifTrue:[ 'FlyByHelp: mouse no longer in view' infoPrintCR ]. |
3418 | 754 |
^ self |
755 |
]. |
|
756 |
||
4082 | 757 |
(view == currentView and:[lastHelpText = aHelpText]) ifTrue:[ |
4252 | 758 |
Debugging ifTrue:[ 'FlyByHelp: same text and widget' infoPrintCR ]. |
4082 | 759 |
^ self |
1536 | 760 |
]. |
4119 | 761 |
|
762 |
pointerPositionAtShowTime := pointerPosition. |
|
3228 | 763 |
lastHelpWidget := view. |
1536 | 764 |
lastHelpText := aHelpText. |
3251
afc7d588b25b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3248
diff
changeset
|
765 |
helpTextShown := aHelpText. |
4129 | 766 |
|
3257 | 767 |
"/ the text originator must already have generated CRs; |
4114 | 768 |
"/ no longer done here (otherwise, we could not generate tooltips with Windows filenames in it) |
3681 | 769 |
textLines := helpTextShown isStringCollection |
770 |
ifTrue:[helpTextShown] |
|
3767 | 771 |
ifFalse:[ |
772 |
helpTextShown isString |
|
4129 | 773 |
ifTrue:[helpTextShown asCollectionOfLines asStringCollection] |
3767 | 774 |
ifFalse:[nil]]. |
775 |
textLines notNil ifTrue:[ |
|
776 |
textLines size > (self class maxNumberOfLines) ifTrue:[ |
|
777 |
textLines := (textLines copyTo:(self class maxNumberOfLines)) copyWith:'...' |
|
778 |
]. |
|
779 |
textLines := textLines collect:[:l | l contractAtEndTo:(self class maxNumberOfColumns)]. |
|
780 |
helpTextShown := textLines asString. |
|
3251
afc7d588b25b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3248
diff
changeset
|
781 |
]. |
3767 | 782 |
|
2780 | 783 |
(p := closeProcess) notNil ifTrue:[ |
784 |
closeProcess := nil. |
|
1536 | 785 |
p terminate. |
786 |
]. |
|
787 |
currentHelpView notNil ifTrue:[ |
|
788 |
self hideHelp |
|
789 |
]. |
|
790 |
||
3770 | 791 |
"/ Transcript showCR:helpTextShown storeString. |
3769 | 792 |
helpTextShown isEmptyOrNil ifTrue:[^ self]. |
793 |
||
1536 | 794 |
org := view originRelativeTo:nil. |
795 |
currentFrame := org extent:view extent. |
|
2848 | 796 |
org := org + (view extent // 2). |
1536 | 797 |
|
3248
d72c8e4f7684
more control over the shape style
Claus Gittinger <cg@exept.de>
parents:
3247
diff
changeset
|
798 |
wg notNil ifTrue:[ applicationOrNil := wg application ]. |
3786 | 799 |
v := self activeHelpViewForApplication:applicationOrNil text:helpTextShown onDevice:device. |
3251
afc7d588b25b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3248
diff
changeset
|
800 |
v perform:#controllingHelpListener: with:self ifNotUnderstood:[]. |
1536 | 801 |
|
2848 | 802 |
helpViewWidth := v width. |
803 |
helpViewHeight := v height. |
|
1677
dc49ab70b762
open helpView on the correcdt device
Claus Gittinger <cg@exept.de>
parents:
1657
diff
changeset
|
804 |
|
4082 | 805 |
"https://expeccoalm.exept.de/D226383: keep the help window away from the pointer under any circumstances |
806 |
(especially when the window touches the bottom or the right edge of the screen). |
|
807 |
When the pointer is no longer in the current window, the help window is closed!!" |
|
808 |
pos := device pointerPosition. |
|
809 |
org := pos + (10@18). |
|
3786 | 810 |
monitorBounds := device monitorBoundsAt:org. |
3114 | 811 |
usableWidth := monitorBounds width - 2. |
3786 | 812 |
usableHeight := device usableHeightAt:org. |
3114 | 813 |
|
814 |
helpViewWidth > usableWidth ifTrue:[v width:(helpViewWidth := usableWidth)]. |
|
3247 | 815 |
helpViewHeight > usableHeight ifTrue:[v height:(helpViewHeight := usableHeight)]. |
3114 | 816 |
|
817 |
(org x + helpViewWidth) > (monitorBounds left + usableWidth) ifTrue:[ |
|
4082 | 818 |
org x:(monitorBounds left + usableWidth - helpViewWidth). |
1536 | 819 |
]. |
3114 | 820 |
(org y + helpViewHeight) > (monitorBounds top + usableHeight) ifTrue:[ |
4082 | 821 |
org y:(monitorBounds top + usableHeight - helpViewHeight). |
1536 | 822 |
]. |
4082 | 823 |
((org extent:v extent) containsPoint:pos) ifTrue:[ |
824 |
"pointer would be in the help window (see comment above). |
|
825 |
Help window is at the lower right edge. Move it to the left of the pointer" |
|
826 |
org x:(pos x - helpViewWidth - 20). |
|
827 |
]. |
|
1536 | 828 |
v origin:org. |
829 |
v realize. |
|
830 |
currentHelpView := v. |
|
2392 | 831 |
currentView := view. |
1536 | 832 |
|
3334 | 833 |
showTime := self showTime. |
4082 | 834 |
(showTime > 0) ifTrue:[ |
3959 | 835 |
p := |
836 |
[ |
|
1546 | 837 |
[ |
4082 | 838 |
Delay waitForSeconds:showTime. |
2392 | 839 |
[ |
2780 | 840 |
|v| |
841 |
(v := currentHelpView) notNil ifTrue:[ |
|
2392 | 842 |
currentHelpView := nil. |
2780 | 843 |
v destroy. |
2392 | 844 |
] |
845 |
] valueUninterruptably |
|
846 |
] ifCurtailed:[ |
|
3959 | 847 |
(p == closeProcess) ifTrue:[ closeProcess := nil ]. |
2392 | 848 |
]. |
849 |
] newProcess. |
|
3959 | 850 |
p priority:(Processor userSchedulingPriority + 1). |
851 |
closeProcess := p. |
|
852 |
p resume. |
|
2392 | 853 |
]. |
1536 | 854 |
|
1963
fb6663696d20
removed withCRs in showHelp:
Claus Gittinger <cg@exept.de>
parents:
1893
diff
changeset
|
855 |
"Modified: / 31-08-1995 / 19:20:45 / claus" |
3959 | 856 |
"Modified: / 06-06-2017 / 15:06:41 / cg" |
4082 | 857 |
"Modified (format): / 16-04-2018 / 17:29:10 / stefan" |
4119 | 858 |
"Modified: / 08-06-2018 / 10:28:32 / Claus Gittinger" |
4129 | 859 |
"Modified (format): / 14-06-2018 / 08:29:43 / Claus Gittinger" |
1536 | 860 |
! |
861 |
||
862 |
stopHelpDisplayProcess |
|
863 |
|p| |
|
864 |
||
2680 | 865 |
(p := showProcess) notNil ifTrue:[ |
866 |
showProcess := nil. |
|
1536 | 867 |
p terminate. |
868 |
]. |
|
869 |
||
870 |
"Created: 28.6.1997 / 14:03:17 / cg" |
|
871 |
! ! |
|
872 |
||
4231 | 873 |
!FlyByHelp::HelpKeyInsteadOfHelpTextQuery class methodsFor:'documentation'! |
874 |
||
875 |
documentation |
|
876 |
" |
|
877 |
kludge to force application to return the helpKey instead of the |
|
878 |
help text. |
|
879 |
Answering true will tell the ApplicationModel to return the key. |
|
880 |
(see AppModel >> helpTextForKey:) |
|
881 |
||
882 |
[author:] |
|
883 |
Claus Gittinger |
|
884 |
||
885 |
[instance variables:] |
|
886 |
||
887 |
[class variables:] |
|
888 |
||
889 |
[see also:] |
|
890 |
||
891 |
" |
|
892 |
! ! |
|
893 |
||
894 |
!FlyByHelp::HelpKeyInsteadOfHelpTextQuery methodsFor:'defaults'! |
|
895 |
||
896 |
defaultResumeValue |
|
897 |
^ false |
|
898 |
||
899 |
"Created: / 22-02-2019 / 09:48:28 / Claus Gittinger" |
|
900 |
! ! |
|
901 |
||
1536 | 902 |
!FlyByHelp class methodsFor:'documentation'! |
903 |
||
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
904 |
version |
3656 | 905 |
^ '$Header$' |
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
906 |
! |
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
907 |
|
2754 | 908 |
version_CVS |
3656 | 909 |
^ '$Header$' |
1536 | 910 |
! ! |
3114 | 911 |