author | Claus Gittinger <cg@exept.de> |
Thu, 25 Jul 2019 16:59:05 +0200 | |
changeset 4318 | ca938bab6a5d |
parent 4314 | 23fdaa63f239 |
child 4319 | 7c98ca2707d8 |
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:[ |
4313 | 136 |
|editor m canDefineTranslationForLabel canDefineTranslationForHelpText menuItem| |
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. |
|
220 |
m addItem:(MenuItem |
|
221 |
label: 'Browse Application' |
|
222 |
itemValue:[ SystemBrowser default openInClass:aView application class]). |
|
223 |
||
224 |
m addItem:(MenuItem |
|
225 |
label: 'UI Painter' |
|
226 |
itemValue:[ UIPainter openOnClass:aView application class andSelector:#windowSpec]). |
|
227 |
||
228 |
aView application ~~ app ifTrue:[ |
|
229 |
m addSeparator. |
|
230 |
m addItem:(MenuItem |
|
231 |
label: 'Browse Top Application' |
|
232 |
itemValue:[ SystemBrowser default openInClass:app class]). |
|
233 |
||
234 |
m addItem:(MenuItem |
|
235 |
label: 'UI Painter on Top Application' |
|
236 |
itemValue:[ UIPainter openOnClass:app class andSelector:#windowSpec]). |
|
237 |
]. |
|
238 |
||
4313 | 239 |
m addSeparator. |
240 |
m addItem:(MenuItem label: 'Inspect Application' itemValue:[ app inspect ]). |
|
241 |
m addItem:(MenuItem label: 'Inspect View' itemValue:[ aView inspect ]). |
|
242 |
||
243 |
menuItem notNil ifTrue:[ |
|
244 |
m addItem:(MenuItem label: 'Inspect Menuitem' itemValue:[ menuItem inspect ]). |
|
245 |
]. |
|
246 |
||
4233 | 247 |
m showAtPointer. |
248 |
]. |
|
249 |
||
250 |
"Created: / 22-02-2019 / 09:32:35 / Claus Gittinger" |
|
4314 | 251 |
"Modified: / 21-07-2019 / 07:04:08 / Claus Gittinger" |
4233 | 252 |
! ! |
253 |
||
2392 | 254 |
!FlyByHelp methodsFor:'event handling'! |
1540 | 255 |
|
2474 | 256 |
buttonMotion:buttonAndModifierState x:x y:y view:aView |
4252 | 257 |
"/ DebuggingEvents := true |
258 |
"/ DebuggingEvents := false |
|
259 |
DebuggingEvents == true ifTrue:[ |
|
260 |
('%1: ==== ButtonMotion view:%2' |
|
4281 | 261 |
bindWith:self className |
4252 | 262 |
with:aView) infoPrintCR. |
263 |
]. |
|
264 |
||
2519 | 265 |
aView == currentHelpView ifTrue:[ |
266 |
"/ the help-bubble itself |
|
267 |
^ false |
|
268 |
]. |
|
269 |
||
4055 | 270 |
"/ don't start tooltip, if this view is not active. |
271 |
"/ The following line does not work, because motion events are reported for the current focus-view, |
|
3321 | 272 |
"/ which is always active. Must check after we have determined the view under the pointer |
3675 | 273 |
"/ aView topView isActive ifFalse:[^ false]. |
2477
b009e0b51999
suppress tooltip for inactive (lower) windows
Claus Gittinger <cg@exept.de>
parents:
2474
diff
changeset
|
274 |
|
2474 | 275 |
^ super buttonMotion:buttonAndModifierState x:x y:y view:aView |
4281 | 276 |
|
277 |
"Modified: / 28-06-2019 / 08:43:54 / Claus Gittinger" |
|
1540 | 278 |
! |
279 |
||
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
280 |
buttonPress:button x:x y:y view:aView |
3198 | 281 |
|prevView| |
282 |
||
4252 | 283 |
"/ DebuggingEvents := true |
284 |
"/ DebuggingEvents := false |
|
285 |
DebuggingEvents == true ifTrue:[ |
|
286 |
('%1: ButtonPress view:%2' |
|
4281 | 287 |
bindWith:self className |
4252 | 288 |
with:aView) infoPrintCR. |
289 |
]. |
|
290 |
||
3198 | 291 |
"/ hideHelp nils the currentView |
292 |
"/ we restore it, so the tooltip is not shown again for this view |
|
293 |
"/ until the mouse really leaves the view |
|
294 |
"/ let's call this the "do-not-show-in-this-view mode" |
|
295 |
prevView := currentView. |
|
2978
4358a9302b95
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2925
diff
changeset
|
296 |
self hideHelp. |
3198 | 297 |
currentView := prevView. |
298 |
||
299 |
^ false |
|
2978
4358a9302b95
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2925
diff
changeset
|
300 |
|
4358a9302b95
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2925
diff
changeset
|
301 |
"Modified: / 23-12-2011 / 20:37:28 / cg" |
4281 | 302 |
"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
|
303 |
! |
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
304 |
|
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
305 |
keyPress:key x:x y:y view:aView |
4308 | 306 |
"care for the special keys: |
307 |
Ctrl (while help is shown) |
|
308 |
L-Shift+R-Shift+Ctrl (while nothing is shown) |
|
309 |
" |
|
310 |
||
4226 | 311 |
<resource: #keyboard (#Escape #Control #Shift)> |
3216 | 312 |
|
4228 | 313 |
|prevView text| |
3198 | 314 |
|
4252 | 315 |
"/ DebuggingEvents := true |
316 |
"/ DebuggingEvents := false |
|
4307 | 317 |
"/ Debugging := true. |
318 |
"/ Debugging := false. |
|
4252 | 319 |
DebuggingEvents == true ifTrue:[ |
4307 | 320 |
'-----' infoPrintCR. |
321 |
('%1: KeyPress view:%2 (currentHelpView=%3)' |
|
4281 | 322 |
bindWith:self className |
4307 | 323 |
with:aView |
324 |
with:currentHelpView) infoPrintCR. |
|
4252 | 325 |
]. |
2885
a70144d85a81
changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2884
diff
changeset
|
326 |
currentHelpView notNil ifTrue:[ |
4313 | 327 |
"/ 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
|
328 |
key == #Escape ifTrue:[ |
3198 | 329 |
prevView := currentView. |
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
330 |
self hideHelp. |
3198 | 331 |
currentView := prevView. |
4230 | 332 |
^ false |
2885
a70144d85a81
changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2884
diff
changeset
|
333 |
]. |
4228 | 334 |
(#(#'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[ |
4226 | 335 |
"/ reopen showing the key |
4313 | 336 |
"/ Transcript show:'re initialize help: '; showCR:key. |
4226 | 337 |
self initiateHelpFor:aView at:(x@y) now:true. |
4230 | 338 |
^ false |
4226 | 339 |
]. |
4313 | 340 |
Smalltalk isStandAloneApp ifFalse:[ |
4318 | 341 |
key == $§ ifTrue:[ |
4313 | 342 |
"/ generate a line suitable for the resources file (a null translation) |
343 |
"/ into the clipboard; makes it easy to add missing translations to a .rs file, |
|
344 |
"/ by pressing paragraph whenever you see an untranslated helptext |
|
345 |
text := (lastHelpText storeString withoutCRs, ' ' , lastHelpText storeString withoutCRs). |
|
346 |
aView setClipboardText:text. |
|
347 |
self hideHelp. |
|
348 |
^ false |
|
349 |
]. |
|
350 |
(#(#'Shift' #'Shift_L' #'Shift_R') includes:key) ifTrue:[ |
|
351 |
aView device ctrlDown ifTrue:[ |
|
352 |
self openDeveloperMenuFor:aView at:x@y |
|
353 |
]. |
|
354 |
^ false |
|
355 |
]. |
|
356 |
]. |
|
357 |
(#('Shift' #'Shift_L' #'Shift_R' ) includes:key) ifTrue:[ |
|
3216 | 358 |
"/ do not close on those... |
359 |
^ false |
|
360 |
]. |
|
4307 | 361 |
] ifFalse:[ |
4313 | 362 |
"/ Transcript show:'without help view shown: '; showCR:key. |
363 |
Smalltalk isStandAloneApp ifFalse:[ |
|
364 |
"/ both shifts AND then ctrl... |
|
365 |
(#(#'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[ |
|
366 |
aView device leftShiftDown ifTrue:[ |
|
367 |
aView device rightShiftDown ifTrue:[ |
|
368 |
self openDeveloperMenuFor:aView at:x@y |
|
369 |
]. |
|
4307 | 370 |
]. |
4313 | 371 |
^ false |
4307 | 372 |
]. |
4313 | 373 |
]. |
4226 | 374 |
]. |
3198 | 375 |
|
376 |
"/ hideHelp nils the currentView |
|
377 |
"/ we restore it, so the tooltip is not shown again for this view |
|
378 |
"/ until the mouse really leaves the view |
|
379 |
"/ let's call this the "do-not-show-in-this-view mode" |
|
380 |
prevView := currentView. |
|
381 |
self hideHelpIgnoringErrors. |
|
382 |
currentView := prevView. |
|
383 |
||
384 |
^ false |
|
385 |
"/ ^ 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
|
386 |
|
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
387 |
"Modified (format): / 25-12-2011 / 10:25:23 / cg" |
4082 | 388 |
"Modified (format): / 16-04-2018 / 16:53:15 / stefan" |
4313 | 389 |
"Modified: / 20-07-2019 / 08:55:01 / Claus Gittinger" |
4226 | 390 |
! |
391 |
||
392 |
keyRelease:key x:x y:y view:aView |
|
393 |
<resource: #keyboard (#Control)> |
|
394 |
||
4252 | 395 |
"/ DebuggingEvents := true |
396 |
"/ DebuggingEvents := false |
|
397 |
DebuggingEvents == true ifTrue:[ |
|
398 |
('%1: KeyRelease view:%2' |
|
4281 | 399 |
bindWith:self className |
4252 | 400 |
with:aView) infoPrintCR. |
401 |
]. |
|
4226 | 402 |
currentHelpView notNil ifTrue:[ |
403 |
(#(#'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[ |
|
404 |
"/ reopen showing the text |
|
405 |
self initiateHelpFor:aView at:(x@y) now:true. |
|
406 |
^ true |
|
407 |
]. |
|
408 |
(#('Shift' #'Shift_L' #'Shift_R' #'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[ |
|
409 |
"/ do not close on those... |
|
410 |
^ false |
|
411 |
]. |
|
412 |
]. |
|
413 |
^ super keyRelease:key x:x y:y view:aView |
|
414 |
||
415 |
"Created: / 20-02-2019 / 11:26:19 / Claus Gittinger" |
|
4281 | 416 |
"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
|
417 |
! |
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
418 |
|
2521
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
419 |
mouseWheelMotion:state x:x y:y amount:amount deltaTime:dTime view:aView |
4252 | 420 |
"/ DebuggingEvents := true |
421 |
"/ DebuggingEvents := false |
|
422 |
DebuggingEvents == true ifTrue:[ |
|
423 |
('%1: MouseWheel view:%2' |
|
4281 | 424 |
bindWith:self className |
4252 | 425 |
with:aView) infoPrintCR. |
426 |
]. |
|
2521
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
427 |
currentHelpView notNil ifTrue:[ |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
428 |
self handleMouseIn:aView x:x y:y. |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
429 |
]. |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
430 |
^ false |
4281 | 431 |
|
432 |
"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
|
433 |
! |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
434 |
|
1540 | 435 |
pointerLeave:state view:aView |
4252 | 436 |
"/ DebuggingEvents := true |
437 |
"/ DebuggingEvents := false |
|
438 |
DebuggingEvents == true ifTrue:[ |
|
439 |
('%1: **** PointerLeave view:%2' |
|
4281 | 440 |
bindWith:self className |
4252 | 441 |
with:aView) infoPrintCR. |
442 |
]. |
|
443 |
||
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
444 |
aView == currentHelpView ifTrue:[^ true]. |
3198 | 445 |
|
446 |
"/ clear the do-not-show-in-this-view mode (see keyPress) |
|
447 |
"/ (currentHelpView isNil and:[currentView notNil]) ifTrue:[currentView := nil]. |
|
448 |
||
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
449 |
^ super pointerLeave:state view:aView |
4281 | 450 |
|
451 |
"Modified: / 28-06-2019 / 08:44:13 / Claus Gittinger" |
|
1540 | 452 |
! ! |
453 |
||
2392 | 454 |
!FlyByHelp methodsFor:'help texts'! |
1536 | 455 |
|
456 |
helpTextFromModel:aModel view:aView at:aPointOrNil |
|
457 |
"helper: ask aModel for its helpText." |
|
458 |
||
459 |
|text| |
|
460 |
||
4048 | 461 |
(aPointOrNil notNil and:[aModel respondsTo:#helpTextFor:at:]) ifTrue:[ |
462 |
text := aModel helpTextFor:aView at:aPointOrNil. |
|
4121 | 463 |
text notNil ifTrue:[ |
464 |
"/ Transcript showCR:aModel. |
|
465 |
"/ Transcript showCR:'via model-text'; showCR:text. |
|
466 |
^ text |
|
467 |
]. |
|
1536 | 468 |
]. |
4048 | 469 |
(aModel respondsTo:#helpTextFor:) ifTrue:[ |
470 |
text := aModel helpTextFor:aView. |
|
4121 | 471 |
text notNil ifTrue:[ |
472 |
"/ Transcript showCR:aModel. |
|
473 |
"/ Transcript showCR:'via model-text'; showCR:text. |
|
474 |
^ text |
|
475 |
]. |
|
1536 | 476 |
]. |
2754 | 477 |
^ nil |
4040 | 478 |
|
479 |
"Modified: / 09-01-2018 / 17:35:26 / stefan" |
|
4121 | 480 |
"Modified: / 11-06-2018 / 09:53:40 / Claus Gittinger" |
1536 | 481 |
! |
482 |
||
483 |
helpTextFromView:aView at:aPointOrNil |
|
484 |
"helper: ask aView for its helpText." |
|
485 |
||
2754 | 486 |
|text key app| |
1536 | 487 |
|
4121 | 488 |
"/ is there any view which does not understand helpTextAt: ??? |
4048 | 489 |
(aPointOrNil notNil and:[aView respondsTo:#helpTextAt:]) ifTrue:[ |
490 |
text := aView helpTextAt:aPointOrNil. |
|
4121 | 491 |
text notNil ifTrue:[ |
492 |
"/ Transcript showCR:'via helpTextAt:'; showCR:text. |
|
493 |
^ text |
|
494 |
]. |
|
1536 | 495 |
]. |
4121 | 496 |
"/ is there any view which does not understand helpText ??? |
4048 | 497 |
(aView respondsTo:#helpText) ifTrue:[ |
498 |
text := aView helpText. |
|
4121 | 499 |
text notNil ifTrue:[ |
500 |
"/ Transcript showCR:'via helpText'; showCR:text. |
|
4220 | 501 |
^ text value |
4121 | 502 |
]. |
2754 | 503 |
]. |
3804 | 504 |
"/ to be enabled in next release... |
505 |
"/ (aView superView notNil |
|
4048 | 506 |
"/ and:[aView superView respondsTo:#helpTextFor:]) ifTrue:[ |
507 |
"/ text := aView superView helpTextFor:aView. |
|
3804 | 508 |
"/ text notNil ifTrue:[^ text]. |
509 |
"/ ]. |
|
4121 | 510 |
|
511 |
"/ is there any view which does not understand helpKey ??? |
|
2754 | 512 |
(aView respondsTo:#helpKey) ifTrue:[ |
513 |
key := aView helpKey. |
|
514 |
key notNil ifTrue:[ |
|
515 |
app := aView application. |
|
516 |
app isNil ifTrue:[ |
|
4175 | 517 |
|topView topViewsHelpSpec| |
518 |
||
3763 | 519 |
"/ special case for oldStyle Dialog subclasses. |
4175 | 520 |
topView := aView topView. |
521 |
(topViewsHelpSpec := topView helpSpec) notNil ifTrue:[ |
|
522 |
text := topViewsHelpSpec at:key ifAbsent:nil. |
|
3763 | 523 |
text notNil ifTrue:[ |
4121 | 524 |
"/ Transcript showCR:'via topViewspec+helpKey'; showCR:text. |
4175 | 525 |
^ topView resources stringWithCRs:text. |
3763 | 526 |
]. |
527 |
]. |
|
2754 | 528 |
app := Error handle:[:ex | nil] do:[ aView windowGroup mainGroup application ]. |
529 |
]. |
|
530 |
app notNil ifTrue:[ |
|
4121 | 531 |
text := app helpTextForKey:key. |
532 |
true "text notNil" ifTrue:[ |
|
533 |
"/ Transcript showCR:'via helpKey+helpTextForKey:'; showCR:text. |
|
534 |
^ text |
|
535 |
]. |
|
2754 | 536 |
]. |
4121 | 537 |
text := aView resources string:key. |
538 |
true "(text notNil and:[text ~= key])" ifTrue:[ |
|
539 |
"/ Transcript showCR:'via helpKey'; showCR:text. |
|
4110 | 540 |
^ text |
541 |
] |
|
1536 | 542 |
]. |
543 |
]. |
|
2754 | 544 |
^ nil. |
4040 | 545 |
|
546 |
"Modified: / 09-01-2018 / 17:38:42 / stefan" |
|
4111 | 547 |
"Modified (format): / 07-06-2018 / 09:51:41 / sr" |
4220 | 548 |
"Modified: / 07-02-2019 / 19:18:39 / Claus Gittinger" |
2392 | 549 |
! ! |
550 |
||
4119 | 551 |
!FlyByHelp methodsFor:'queries'! |
552 |
||
553 |
currentlyShownView |
|
554 |
^ currentHelpView |
|
555 |
! |
|
556 |
||
557 |
toolTipFollowsMouse |
|
558 |
"if true, the tooltip-window moves with the pointer |
|
559 |
so that it stays away from (does not cover) the mouse pointer" |
|
560 |
||
561 |
^ false |
|
562 |
||
563 |
"Modified: / 06-06-2018 / 17:37:19 / Claus Gittinger" |
|
564 |
! ! |
|
565 |
||
566 |
!FlyByHelp methodsFor:'show & hide help'! |
|
567 |
||
568 |
activeHelpViewForApplication:applicationOrNil text:helpText onDevice:aDevice |
|
569 |
applicationOrNil notNil ifTrue:[ |
|
570 |
^ applicationOrNil activeHelpViewFor:helpText onDevice:aDevice |
|
571 |
]. |
|
572 |
^ ActiveHelpView for:helpText onDevice:aDevice. |
|
573 |
||
574 |
" |
|
575 |
(ActiveHelpView for:'Hello' onDevice:Display) open |
|
576 |
" |
|
577 |
! |
|
578 |
||
579 |
hideHelp |
|
580 |
"hide the help text" |
|
581 |
||
4313 | 582 |
|p v| |
4119 | 583 |
|
584 |
"/ lastHelpText := nil. |
|
585 |
self stopHelpDisplayProcess. |
|
586 |
lastHelpText := nil. |
|
587 |
||
588 |
currentHelpView notNil ifTrue:[ |
|
589 |
[ |
|
4313 | 590 |
(v := currentHelpView) notNil ifTrue:[ |
4119 | 591 |
currentHelpView := nil. |
4313 | 592 |
v destroy. |
4119 | 593 |
currentView := nil. |
594 |
] |
|
595 |
] valueUninterruptably |
|
596 |
]. |
|
4313 | 597 |
|
4119 | 598 |
currentFrame := nil. |
599 |
(p := closeProcess) notNil ifTrue:[ |
|
600 |
closeProcess := nil. |
|
601 |
p terminate. |
|
602 |
] |
|
603 |
||
604 |
"Modified: / 28-06-1997 / 14:03:50 / cg" |
|
605 |
"Modified: / 16-04-2018 / 16:51:01 / stefan" |
|
4313 | 606 |
"Modified: / 20-07-2019 / 08:48:34 / Claus Gittinger" |
4119 | 607 |
! |
1536 | 608 |
|
609 |
hideIfPointerLeft:aView |
|
610 |
"hide help, if the pointer is not in aView" |
|
611 |
||
4119 | 612 |
|helpFrame whereOnScreen| |
1536 | 613 |
|
4119 | 614 |
(helpFrame := currentFrame) notNil ifTrue:[ |
1536 | 615 |
whereOnScreen := aView graphicsDevice pointerPosition. |
616 |
||
4119 | 617 |
((helpFrame insetBy:1@1) containsPoint:whereOnScreen) ifFalse:[ |
1536 | 618 |
self hideHelp. |
4119 | 619 |
] ifTrue:[ |
620 |
pointerPositionAtShowTime notNil ifTrue:[ |
|
621 |
(whereOnScreen dist:pointerPositionAtShowTime) > 10 ifTrue:[ |
|
622 |
self hideHelp. |
|
623 |
]. |
|
624 |
]. |
|
625 |
]. |
|
1536 | 626 |
]. |
627 |
||
4082 | 628 |
"Modified: / 28-05-1996 / 20:18:28 / cg" |
629 |
"Modified: / 16-04-2018 / 16:59:48 / stefan" |
|
4119 | 630 |
"Modified: / 08-06-2018 / 10:30:04 / Claus Gittinger" |
1536 | 631 |
! |
632 |
||
633 |
initiateHelpFor:aView at:aPointOrNil now:showItNow |
|
634 |
"ask aView for helpText, passing x/y coordinates; |
|
635 |
start a timeout process to display this helpText after some delay; |
|
636 |
Normally used internally, but can also be used by widgets to force |
|
637 |
re-negotiation of the displayed helpText |
|
638 |
(for example in a menu, when the selection changes)" |
|
639 |
||
4110 | 640 |
|text delayTime| |
1536 | 641 |
|
4252 | 642 |
Debugging ifTrue:[ |
4281 | 643 |
('%1: initiateHelpFor:at:now: %2' bindWith:self className with:aView) infoPrintCR. |
4252 | 644 |
]. |
1536 | 645 |
(self interestedIn:aView) ifFalse:[ |
4237 | 646 |
Debugging ifTrue:[ |
4252 | 647 |
('%1: not interested' bindWith:self class name) infoPrintCR |
4237 | 648 |
]. |
1536 | 649 |
^ self |
650 |
]. |
|
651 |
||
2680 | 652 |
"/ 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
|
653 |
"/ 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
|
654 |
[ |
2826
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
655 |
Error handle:[:ex | |
4252 | 656 |
('%1: [warning]: error while asking for helpText: %2' bindWith:self class name with:ex description) errorPrintCR. |
657 |
'-------------------------' errorPrintCR. |
|
658 |
ex suspendedContext fullPrintAllOn:(Transcript ? Stderr). |
|
2872
ea7e6fe01727
comment/format in: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2848
diff
changeset
|
659 |
"/ self halt. |
2826
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
660 |
] do:[ |
4231 | 661 |
HelpKeyInsteadOfHelpTextQuery answer:(aView device ctrlDown) do:[ |
662 |
text := self helpTextFor:aView at:aPointOrNil. |
|
663 |
]. |
|
2826
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
664 |
]. |
3656 | 665 |
] valueWithWatchDog:[ |
4252 | 666 |
('%1 [info]: flyBy text generation took too long' bindWith:self class name) infoPrintCR. |
3656 | 667 |
^ self |
668 |
] afterMilliseconds:(self flyByHelpTimeoutMillis). |
|
2679
552847065fb3
car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents:
2651
diff
changeset
|
669 |
|
4110 | 670 |
false ifTrue:[ |
671 |
(text notNil and:[text isEmpty]) ifTrue:[ |
|
672 |
Logger warning:('empty help from: ',aView class printString) |
|
673 |
] ifFalse:[ |
|
674 |
text isEmptyOrNil ifTrue:[ |
|
675 |
Logger warning:('no help from: ',aView class printString) |
|
676 |
]. |
|
677 |
]. |
|
678 |
]. |
|
679 |
||
4252 | 680 |
(lastHelpText = text and:[lastHelpWidget == aView]) ifTrue:[ |
681 |
"/ Debugging := true |
|
4237 | 682 |
Debugging == true ifTrue:[ |
683 |
'same text: ' infoPrint. text infoPrintCR. |
|
684 |
]. |
|
4082 | 685 |
self toolTipFollowsMouse ifFalse:[ |
4252 | 686 |
Debugging == true ifTrue:[ |
687 |
'tooltip does not follow mouse: ' infoPrint. text infoPrintCR. |
|
688 |
]. |
|
4082 | 689 |
^ self |
2392 | 690 |
] |
1536 | 691 |
]. |
692 |
||
4110 | 693 |
((text size > 0) or:[text notNil and:[text isString not]]) ifTrue:[ |
2778 | 694 |
(showItNow not and:[(delayTime := self delayTime) > 0]) ifTrue:[ |
1536 | 695 |
self stopHelpDisplayProcess. |
2392 | 696 |
showProcess := |
697 |
[ |
|
2680 | 698 |
Delay waitForSeconds:delayTime. |
2774
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
699 |
[ |
3766 | 700 |
aView device notNil ifTrue:[ |
701 |
aView device anyButtonPressed ifFalse:[ |
|
702 |
showProcess := nil. |
|
703 |
self showHelp:text for:aView |
|
704 |
] |
|
705 |
]. |
|
2774
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
706 |
] ensure:[ |
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
707 |
showProcess := nil. |
2680 | 708 |
] |
2392 | 709 |
] forkAt:(Processor userSchedulingPriority + 1). |
1536 | 710 |
] ifFalse:[ |
711 |
self showHelp:text for:aView |
|
712 |
] |
|
1542 | 713 |
] ifFalse:[ |
4252 | 714 |
Debugging == true ifTrue:[ |
715 |
'empty text: ' infoPrint. text infoPrintCR. |
|
716 |
]. |
|
1542 | 717 |
self hideHelp |
1536 | 718 |
]. |
2872
ea7e6fe01727
comment/format in: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2848
diff
changeset
|
719 |
|
2901
fed697afcef8
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2900
diff
changeset
|
720 |
"Modified: / 22-03-2011 / 19:10:28 / cg" |
4082 | 721 |
"Modified: / 16-04-2018 / 12:20:33 / stefan" |
4281 | 722 |
"Modified: / 28-06-2019 / 08:44:00 / Claus Gittinger" |
1536 | 723 |
! |
724 |
||
725 |
showHelp:aHelpText for:view |
|
726 |
"show the help text for aView" |
|
727 |
||
3786 | 728 |
|wg applicationOrNil org p v device helpTextShown textLines |
3334 | 729 |
helpViewWidth helpViewHeight usableWidth monitorBounds usableHeight |
4119 | 730 |
showTime cursorView pos pointerPosition| |
1536 | 731 |
|
2781 | 732 |
"/ thisContext fullPrintAllOn:Transcript. |
2651 | 733 |
(wg := view windowGroup) notNil ifTrue:[ |
734 |
wg isInModalLoop ifTrue:[ |
|
735 |
wg isModal ifFalse:[ |
|
4252 | 736 |
Debugging ifTrue:[ 'FlyByHelp: not modal' infoPrintCR ]. |
2651 | 737 |
^ self |
738 |
]. |
|
2628
03a41945fb37
do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents:
2612
diff
changeset
|
739 |
]. |
03a41945fb37
do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents:
2612
diff
changeset
|
740 |
]. |
03a41945fb37
do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents:
2612
diff
changeset
|
741 |
|
3786 | 742 |
device := view graphicsDevice. |
4119 | 743 |
pointerPosition := device pointerPosition. |
744 |
||
3418 | 745 |
"/ mouse still over that view? |
4119 | 746 |
cursorView := device viewFromPoint:pointerPosition. |
3418 | 747 |
cursorView ~~ view ifTrue:[ |
4252 | 748 |
Debugging ifTrue:[ 'FlyByHelp: mouse no longer in view' infoPrintCR ]. |
3418 | 749 |
^ self |
750 |
]. |
|
751 |
||
4082 | 752 |
(view == currentView and:[lastHelpText = aHelpText]) ifTrue:[ |
4252 | 753 |
Debugging ifTrue:[ 'FlyByHelp: same text and widget' infoPrintCR ]. |
4082 | 754 |
^ self |
1536 | 755 |
]. |
4119 | 756 |
|
757 |
pointerPositionAtShowTime := pointerPosition. |
|
3228 | 758 |
lastHelpWidget := view. |
1536 | 759 |
lastHelpText := aHelpText. |
3251
afc7d588b25b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3248
diff
changeset
|
760 |
helpTextShown := aHelpText. |
4129 | 761 |
|
3257 | 762 |
"/ the text originator must already have generated CRs; |
4114 | 763 |
"/ no longer done here (otherwise, we could not generate tooltips with Windows filenames in it) |
3681 | 764 |
textLines := helpTextShown isStringCollection |
765 |
ifTrue:[helpTextShown] |
|
3767 | 766 |
ifFalse:[ |
767 |
helpTextShown isString |
|
4129 | 768 |
ifTrue:[helpTextShown asCollectionOfLines asStringCollection] |
3767 | 769 |
ifFalse:[nil]]. |
770 |
textLines notNil ifTrue:[ |
|
771 |
textLines size > (self class maxNumberOfLines) ifTrue:[ |
|
772 |
textLines := (textLines copyTo:(self class maxNumberOfLines)) copyWith:'...' |
|
773 |
]. |
|
774 |
textLines := textLines collect:[:l | l contractAtEndTo:(self class maxNumberOfColumns)]. |
|
775 |
helpTextShown := textLines asString. |
|
3251
afc7d588b25b
handle key press and close help.
Claus Gittinger <cg@exept.de>
parents:
3248
diff
changeset
|
776 |
]. |
3767 | 777 |
|
2780 | 778 |
(p := closeProcess) notNil ifTrue:[ |
779 |
closeProcess := nil. |
|
1536 | 780 |
p terminate. |
781 |
]. |
|
782 |
currentHelpView notNil ifTrue:[ |
|
783 |
self hideHelp |
|
784 |
]. |
|
785 |
||
3770 | 786 |
"/ Transcript showCR:helpTextShown storeString. |
3769 | 787 |
helpTextShown isEmptyOrNil ifTrue:[^ self]. |
788 |
||
1536 | 789 |
org := view originRelativeTo:nil. |
790 |
currentFrame := org extent:view extent. |
|
2848 | 791 |
org := org + (view extent // 2). |
1536 | 792 |
|
3248
d72c8e4f7684
more control over the shape style
Claus Gittinger <cg@exept.de>
parents:
3247
diff
changeset
|
793 |
wg notNil ifTrue:[ applicationOrNil := wg application ]. |
3786 | 794 |
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
|
795 |
v perform:#controllingHelpListener: with:self ifNotUnderstood:[]. |
1536 | 796 |
|
2848 | 797 |
helpViewWidth := v width. |
798 |
helpViewHeight := v height. |
|
1677
dc49ab70b762
open helpView on the correcdt device
Claus Gittinger <cg@exept.de>
parents:
1657
diff
changeset
|
799 |
|
4082 | 800 |
"https://expeccoalm.exept.de/D226383: keep the help window away from the pointer under any circumstances |
801 |
(especially when the window touches the bottom or the right edge of the screen). |
|
802 |
When the pointer is no longer in the current window, the help window is closed!!" |
|
803 |
pos := device pointerPosition. |
|
804 |
org := pos + (10@18). |
|
3786 | 805 |
monitorBounds := device monitorBoundsAt:org. |
3114 | 806 |
usableWidth := monitorBounds width - 2. |
3786 | 807 |
usableHeight := device usableHeightAt:org. |
3114 | 808 |
|
809 |
helpViewWidth > usableWidth ifTrue:[v width:(helpViewWidth := usableWidth)]. |
|
3247 | 810 |
helpViewHeight > usableHeight ifTrue:[v height:(helpViewHeight := usableHeight)]. |
3114 | 811 |
|
812 |
(org x + helpViewWidth) > (monitorBounds left + usableWidth) ifTrue:[ |
|
4082 | 813 |
org x:(monitorBounds left + usableWidth - helpViewWidth). |
1536 | 814 |
]. |
3114 | 815 |
(org y + helpViewHeight) > (monitorBounds top + usableHeight) ifTrue:[ |
4082 | 816 |
org y:(monitorBounds top + usableHeight - helpViewHeight). |
1536 | 817 |
]. |
4082 | 818 |
((org extent:v extent) containsPoint:pos) ifTrue:[ |
819 |
"pointer would be in the help window (see comment above). |
|
820 |
Help window is at the lower right edge. Move it to the left of the pointer" |
|
821 |
org x:(pos x - helpViewWidth - 20). |
|
822 |
]. |
|
1536 | 823 |
v origin:org. |
824 |
v realize. |
|
825 |
currentHelpView := v. |
|
2392 | 826 |
currentView := view. |
1536 | 827 |
|
3334 | 828 |
showTime := self showTime. |
4082 | 829 |
(showTime > 0) ifTrue:[ |
3959 | 830 |
p := |
831 |
[ |
|
1546 | 832 |
[ |
4082 | 833 |
Delay waitForSeconds:showTime. |
2392 | 834 |
[ |
2780 | 835 |
|v| |
836 |
(v := currentHelpView) notNil ifTrue:[ |
|
2392 | 837 |
currentHelpView := nil. |
2780 | 838 |
v destroy. |
2392 | 839 |
] |
840 |
] valueUninterruptably |
|
841 |
] ifCurtailed:[ |
|
3959 | 842 |
(p == closeProcess) ifTrue:[ closeProcess := nil ]. |
2392 | 843 |
]. |
844 |
] newProcess. |
|
3959 | 845 |
p priority:(Processor userSchedulingPriority + 1). |
846 |
closeProcess := p. |
|
847 |
p resume. |
|
2392 | 848 |
]. |
1536 | 849 |
|
1963
fb6663696d20
removed withCRs in showHelp:
Claus Gittinger <cg@exept.de>
parents:
1893
diff
changeset
|
850 |
"Modified: / 31-08-1995 / 19:20:45 / claus" |
3959 | 851 |
"Modified: / 06-06-2017 / 15:06:41 / cg" |
4082 | 852 |
"Modified (format): / 16-04-2018 / 17:29:10 / stefan" |
4119 | 853 |
"Modified: / 08-06-2018 / 10:28:32 / Claus Gittinger" |
4129 | 854 |
"Modified (format): / 14-06-2018 / 08:29:43 / Claus Gittinger" |
1536 | 855 |
! |
856 |
||
857 |
stopHelpDisplayProcess |
|
858 |
|p| |
|
859 |
||
2680 | 860 |
(p := showProcess) notNil ifTrue:[ |
861 |
showProcess := nil. |
|
1536 | 862 |
p terminate. |
863 |
]. |
|
864 |
||
865 |
"Created: 28.6.1997 / 14:03:17 / cg" |
|
866 |
! ! |
|
867 |
||
4231 | 868 |
!FlyByHelp::HelpKeyInsteadOfHelpTextQuery class methodsFor:'documentation'! |
869 |
||
870 |
documentation |
|
871 |
" |
|
872 |
kludge to force application to return the helpKey instead of the |
|
873 |
help text. |
|
874 |
Answering true will tell the ApplicationModel to return the key. |
|
875 |
(see AppModel >> helpTextForKey:) |
|
876 |
||
877 |
[author:] |
|
878 |
Claus Gittinger |
|
879 |
||
880 |
[instance variables:] |
|
881 |
||
882 |
[class variables:] |
|
883 |
||
884 |
[see also:] |
|
885 |
||
886 |
" |
|
887 |
! ! |
|
888 |
||
889 |
!FlyByHelp::HelpKeyInsteadOfHelpTextQuery methodsFor:'defaults'! |
|
890 |
||
891 |
defaultResumeValue |
|
892 |
^ false |
|
893 |
||
894 |
"Created: / 22-02-2019 / 09:48:28 / Claus Gittinger" |
|
895 |
! ! |
|
896 |
||
1536 | 897 |
!FlyByHelp class methodsFor:'documentation'! |
898 |
||
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
899 |
version |
3656 | 900 |
^ '$Header$' |
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
901 |
! |
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
902 |
|
2754 | 903 |
version_CVS |
3656 | 904 |
^ '$Header$' |
1536 | 905 |
! ! |
3114 | 906 |