author | Claus Gittinger <cg@exept.de> |
Thu, 28 Mar 2019 09:19:31 +0100 | |
changeset 4250 | e40bbfdb6fdb |
parent 4238 | 3fe58167fbff |
child 4251 | 159146f89764 |
permissions | -rw-r--r-- |
4225 | 1 |
"{ Encoding: utf8 }" |
2 |
||
59 | 3 |
" |
4 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
1502 | 14 |
"{ Package: 'stx:libview2' }" |
15 |
||
3447 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
59 | 18 |
EventListener subclass:#ActiveHelp |
3227 | 19 |
instanceVariableNames:'lastHelpText listeningForAll applicationsOrTopViewsWithHelp |
4118 | 20 |
lastHelpWidget lastPointerPosition pointerPositionAtShowTime' |
4134 | 21 |
classVariableNames:'Debugging DebuggingHelpText DebuggingEvents' |
216 | 22 |
poolDictionaries:'' |
23 |
category:'Interface-Help' |
|
59 | 24 |
! |
25 |
||
1892 | 26 |
ActiveHelp class instanceVariableNames:'DelayTime ShowTime TheOneAndOnlyHelpListener' |
27 |
||
28 |
" |
|
29 |
No other class instance variables are inherited by this class. |
|
30 |
" |
|
31 |
! |
|
32 |
||
338
071f92621e3b
oops - catching the terminateSignal is no good idea
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
33 |
!ActiveHelp class methodsFor:'documentation'! |
59 | 34 |
|
138 | 35 |
copyright |
36 |
" |
|
37 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
38 |
All Rights Reserved |
|
39 |
||
40 |
This software is furnished under a license and may be used |
|
41 |
only in accordance with the terms of that license and with the |
|
42 |
inclusion of the above copyright notice. This software may not |
|
43 |
be provided or otherwise made available to, or used by, any |
|
44 |
other person. No title to or ownership of the software is |
|
45 |
hereby transferred. |
|
46 |
" |
|
47 |
||
59 | 48 |
! |
49 |
||
50 |
documentation |
|
51 |
" |
|
3664 | 52 |
The active help (tooltip) listener. |
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
53 |
|
98 | 54 |
The one and only instance of myself intercepts incoming mouse & keyboard |
55 |
events for the display device, being especially interested in view-enter/ |
|
636 | 56 |
leave events. When such an event arrives, it asks the corresponding view |
3219 | 57 |
or its model for a help message and displays it via an ActiveHelpView. |
58 |
Actually, the view is first asked if it would like to display it itself |
|
59 |
- for example, in some information-view at the bottom of its main window. |
|
636 | 60 |
|
3664 | 61 |
The query for the helpText is repeated along the view's superView chain, |
62 |
until any model or view returns a nonNil answer for the |
|
63 |
#helpTextFor:<aSubView> at:<position> or #helpTextFor:<aSubView> message. |
|
100 | 64 |
|
98 | 65 |
All I need for automatic help is some model/view/applicationModel along |
66 |
the superview chain of the entered component, which responds to the |
|
67 |
#helpTextFor: message with a non-nil (string-) answer. |
|
68 |
I close down the help view after a while, if a key is pressed or the mouse |
|
69 |
moved to another view. |
|
100 | 70 |
|
71 |
Who should provide the helpText: |
|
221 | 72 |
the best place is the application object (an instance of ApplicationModel) |
3884 | 73 |
or the topView, if it's a derived class of StandardSystemView. |
221 | 74 |
This should know about its components and return the string |
3664 | 75 |
when asked via #helpTextFor:<aSubView>. |
330
d7ce98930ad3
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
297
diff
changeset
|
76 |
See examples in FileBrowser, Launcher etc. |
100 | 77 |
|
78 |
Be aware, that for applicationModels, there must be a link from the |
|
79 |
topView to this applicationModel |
|
80 |
(set via: aTopView application:anApplicationModel) |
|
81 |
otherwise, the helpManager has no means of finding the application which |
|
82 |
corresponds to a view. |
|
83 |
||
84 |
Who should display the helpText: |
|
221 | 85 |
by default, the helpListener opens a little popup view, which displays the |
86 |
returned help message. However, a nice trick which can be used by applications |
|
87 |
is to create an infoLabel as a subview of the topFrame (a la windows) |
|
88 |
and display the text right in the #helpTextFor: method. To cheat the |
|
89 |
help listener, this method should then return nil, to keep it silent. |
|
90 |
||
91 |
||
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
92 |
Usage: |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
93 |
If help is to be shown for all views (as enabled by the launchers help menu), |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
94 |
use 'ActiveHelp start' and 'ActiveHelp stop'. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
95 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
96 |
Individual apps may enable/disable active help for themself by: |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
97 |
'ActiveHelp startFor:app' or 'ActiveHelp stopFor:app', passing either |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
98 |
the topView or the topViews application as argument. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
99 |
This is usually done by applications which want to show contextHelp in |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
100 |
some infoView. |
3664 | 101 |
Late note: thsi is no longer recommended - one such mouse watcher process is |
102 |
good enough for all views. |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
103 |
|
221 | 104 |
[author:] |
105 |
Claus Gittinger |
|
106 |
||
233 | 107 |
[start with:] |
108 |
ActiveHelp start |
|
109 |
ActiveHelp stop |
|
110 |
||
221 | 111 |
[See also:] |
233 | 112 |
ActiveHelpView |
113 |
WindowGroup WindowEvent |
|
114 |
ApplicationModel StandardSystemView |
|
100 | 115 |
" |
116 |
! |
|
117 |
||
118 |
examples |
|
119 |
" |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
120 |
Active Help for a single view |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
121 |
or app (whatever the global settings are): |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
122 |
Can be initiated by an app when its opened. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
123 |
[exBegin] |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
124 |
|app top myAppClass| |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
125 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
126 |
Class withoutUpdatingChangesDo:[ |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
127 |
myAppClass := ApplicationModel |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
128 |
subclass:#'Demos::DemoApp' |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
129 |
instanceVariableNames:'' |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
130 |
classVariableNames:'' |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
131 |
poolDictionaries:'' |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
132 |
category:'demos'. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
133 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
134 |
myAppClass |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
135 |
compile:'helpTextFor:aView Transcript showCR:''hello''. ^ ''this is some helpText'''. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
136 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
137 |
]. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
138 |
app := myAppClass new. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
139 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
140 |
top := StandardSystemView new. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
141 |
top extent:300@100. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
142 |
top application:app. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
143 |
top open. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
144 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
145 |
ActiveHelp startFor:app. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
146 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
147 |
Class withoutUpdatingChangesDo:[ |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
148 |
myAppClass removeFromSystem |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
149 |
] |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
150 |
[exEnd] |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
151 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
152 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
153 |
Active Help (for all views): |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
154 |
|
233 | 155 |
(make certain that activeHelp is turned on ... |
156 |
... otherwise, you will see nothing) |
|
100 | 157 |
|
158 |
the following example uses a Plug as a model replacement. |
|
159 |
In concrete application, you would create a method to implement the helpText |
|
160 |
query message. |
|
227 | 161 |
[exBegin] |
162 |
|app top button1 button2| |
|
100 | 163 |
|
227 | 164 |
app := Plug new. |
165 |
app respondTo:#helpTextFor: |
|
166 |
with:[:view | |
|
167 |
view == button1 ifTrue:[ |
|
168 |
'this is button1' |
|
169 |
] ifFalse:[ |
|
170 |
view == button2 ifTrue:[ |
|
171 |
'some help for button2' |
|
172 |
] ifFalse:[ |
|
173 |
nil |
|
174 |
] |
|
175 |
] |
|
176 |
]. |
|
100 | 177 |
|
227 | 178 |
top := StandardSystemView new. |
179 |
top extent:300@100. |
|
180 |
button1 := Button label:'b1' in:top. |
|
181 |
button1 origin:0.0@0.0 corner:0.5@30. |
|
182 |
button2 := Button label:'b2' in:top. |
|
183 |
button2 origin:0.5@0.0 corner:1.0@30. |
|
184 |
top model:app. '<-- normally this would be: top application:app'. |
|
185 |
top open |
|
186 |
[exEnd] |
|
100 | 187 |
|
233 | 188 |
(make certain that activeHelp is turned on ... |
189 |
... otherwise, you will see nothing) |
|
190 |
||
227 | 191 |
alternatively, display of the helpMessage in a local, private view: |
192 |
[exBegin] |
|
193 |
|app top button1 button2 infoView| |
|
100 | 194 |
|
227 | 195 |
app := Plug new. |
196 |
app respondTo:#helpTextFor: |
|
197 |
with:[:view | infoView label:'info ...'. |
|
198 |
view == button1 ifTrue:[ |
|
199 |
infoView label:'this is button1' |
|
200 |
]. |
|
201 |
view == button2 ifTrue:[ |
|
202 |
infoView label:'some help for button2' |
|
203 |
]. |
|
204 |
nil |
|
205 |
]. |
|
100 | 206 |
|
227 | 207 |
top := StandardSystemView new. |
208 |
top extent:300@100. |
|
209 |
button1 := Button label:'b1' in:top. |
|
210 |
button1 origin:0.0@0.0 corner:0.5@30. |
|
211 |
button2 := Button label:'b2' in:top. |
|
212 |
button2 origin:0.5@0.0 corner:1.0@30. |
|
213 |
infoView := Label label:'info ...' in:top. |
|
214 |
infoView level:-1; origin:0.0@1.0 corner:1.0@1.0. |
|
215 |
infoView topInset:(infoView preferredExtent y negated - 3); |
|
216 |
leftInset:3; |
|
217 |
rightInset:3; |
|
218 |
bottomInset:3; |
|
219 |
adjust:#left. |
|
220 |
top model:app. '<-- normally this would be: top application:app'. |
|
221 |
top open |
|
222 |
[exEnd] |
|
59 | 223 |
" |
224 |
! ! |
|
225 |
||
3320 | 226 |
!ActiveHelp class methodsFor:'initialization'! |
227 |
||
228 |
initialize |
|
229 |
Debugging := false. |
|
4134 | 230 |
DebuggingEvents := false. |
4122 | 231 |
DebuggingHelpText := false. |
232 |
||
4134 | 233 |
"Modified: / 19-06-2018 / 12:53:36 / Claus Gittinger" |
3320 | 234 |
! ! |
235 |
||
2975 | 236 |
!ActiveHelp class methodsFor:'accessing'! |
237 |
||
238 |
debugging |
|
4122 | 239 |
^ Debugging ? false |
2975 | 240 |
|
241 |
"Modified: / 22-12-2011 / 10:46:30 / cg" |
|
4122 | 242 |
"Modified: / 11-06-2018 / 10:27:40 / Claus Gittinger" |
2975 | 243 |
! |
244 |
||
4122 | 245 |
debugging:aBoolean |
246 |
Debugging := aBoolean. |
|
2975 | 247 |
|
248 |
" |
|
249 |
self debugging:true |
|
250 |
self debugging:false |
|
251 |
" |
|
252 |
||
253 |
"Modified (comment): / 22-12-2011 / 10:43:32 / cg" |
|
4122 | 254 |
"Modified (format): / 11-06-2018 / 10:30:30 / Claus Gittinger" |
255 |
! |
|
256 |
||
257 |
debuggingHelpText |
|
258 |
^ DebuggingHelpText ? false |
|
259 |
||
260 |
"Created: / 11-06-2018 / 10:30:10 / Claus Gittinger" |
|
261 |
! |
|
262 |
||
263 |
debuggingHelpText:aBoolean |
|
264 |
DebuggingHelpText := aBoolean. |
|
265 |
||
266 |
" |
|
267 |
self debuggingHelpText:true |
|
268 |
self debuggingHelpText:false |
|
269 |
" |
|
270 |
||
271 |
"Created: / 11-06-2018 / 10:30:24 / Claus Gittinger" |
|
4235 | 272 |
! |
273 |
||
274 |
singleton |
|
275 |
^ TheOneAndOnlyHelpListener |
|
276 |
||
277 |
"Created: / 27-02-2019 / 11:06:32 / Claus Gittinger" |
|
2975 | 278 |
! ! |
279 |
||
633 | 280 |
!ActiveHelp class methodsFor:'queries'! |
100 | 281 |
|
632
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
282 |
currentHelpListener |
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
283 |
"return the activeHelp listener if activeHelp is turned on, nil otherwise" |
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
284 |
|
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
285 |
^ TheOneAndOnlyHelpListener |
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
286 |
|
3395 | 287 |
" |
288 |
ActiveHelp currentHelpListener |
|
289 |
FlyByHelp currentHelpListener |
|
290 |
" |
|
291 |
||
632
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
292 |
"Created: 28.6.1997 / 13:59:44 / cg" |
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
293 |
! |
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
294 |
|
1892 | 295 |
delayTime |
2391 | 296 |
^ DelayTime ? 0.4 |
1892 | 297 |
! |
298 |
||
233 | 299 |
isActive |
300 |
"return true, if activeHelp is turned on" |
|
301 |
||
3347
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
302 |
TheOneAndOnlyHelpListener notNil ifTrue:[ |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
303 |
((WindowSensor eventListeners ? #()) includesIdentical:TheOneAndOnlyHelpListener) ifTrue:[ |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
304 |
^ true |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
305 |
]. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
306 |
TheOneAndOnlyHelpListener := nil. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
307 |
]. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
308 |
^ false. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
309 |
|
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
310 |
" |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
311 |
FlyByHelp isActive |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
312 |
" |
233 | 313 |
|
314 |
"Modified: 27.4.1996 / 15:07:57 / cg" |
|
1892 | 315 |
! |
316 |
||
317 |
showTime |
|
2879 | 318 |
"set the number of seconds, a help messages is to be shown. |
3447 | 319 |
The default is 45 seconds. |
3333 | 320 |
0 means: show forever (i.e. until mouse is moved)" |
2879 | 321 |
|
3447 | 322 |
^ ShowTime ? 45 |
2879 | 323 |
|
324 |
"Modified: / 10-11-2010 / 12:29:44 / cg" |
|
633 | 325 |
! ! |
326 |
||
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
327 |
!ActiveHelp class methodsFor:'start & stop'! |
59 | 328 |
|
4235 | 329 |
initiateHelp |
330 |
"determine where the mouse pointer is located, |
|
331 |
and start showing a tooltip for it. |
|
4236 | 332 |
This can be called to force update of the tooltip, |
4235 | 333 |
in case a widget has changed its mind |
334 |
(typically: an undo menu button function might wonna do this, |
|
335 |
to show changed info)" |
|
336 |
||
4236 | 337 |
self isActive ifTrue:[ |
4235 | 338 |
TheOneAndOnlyHelpListener initiateHelp |
339 |
]. |
|
340 |
||
341 |
"Created: / 27-02-2019 / 11:08:54 / Claus Gittinger" |
|
4236 | 342 |
"Modified (comment): / 27-02-2019 / 15:56:17 / Claus Gittinger" |
4235 | 343 |
! |
344 |
||
59 | 345 |
start |
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
346 |
"start activeHelp for all apps" |
233 | 347 |
|
2391 | 348 |
TheOneAndOnlyHelpListener notNil ifTrue:[ |
349 |
TheOneAndOnlyHelpListener stop. |
|
350 |
TheOneAndOnlyHelpListener := nil. |
|
351 |
]. |
|
352 |
||
59 | 353 |
TheOneAndOnlyHelpListener isNil ifTrue:[ |
233 | 354 |
TheOneAndOnlyHelpListener := self new. |
59 | 355 |
]. |
2391 | 356 |
TheOneAndOnlyHelpListener start. |
357 |
^ TheOneAndOnlyHelpListener |
|
59 | 358 |
|
359 |
" |
|
360 |
ActiveHelp start |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
361 |
FlyByHelp start |
59 | 362 |
" |
233 | 363 |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
364 |
"Modified: / 26.10.1997 / 23:16:54 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
365 |
! |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
366 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
367 |
startFor:anApplicationOrTopView |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
368 |
"start activeHelp for a single app" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
369 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
370 |
TheOneAndOnlyHelpListener isNil ifTrue:[ |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
371 |
TheOneAndOnlyHelpListener := self new. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
372 |
]. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
373 |
TheOneAndOnlyHelpListener listenFor:anApplicationOrTopView |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
374 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
375 |
"Modified: / 26.10.1997 / 23:17:05 / cg" |
59 | 376 |
! |
377 |
||
378 |
stop |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
379 |
"stop activeHelp for all (except for individual apps)" |
233 | 380 |
|
59 | 381 |
TheOneAndOnlyHelpListener notNil ifTrue:[ |
2391 | 382 |
TheOneAndOnlyHelpListener stop. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
383 |
TheOneAndOnlyHelpListener := nil. |
59 | 384 |
]. |
385 |
||
386 |
" |
|
387 |
ActiveHelp stop |
|
1543 | 388 |
FlyByHelp stop |
59 | 389 |
" |
233 | 390 |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
391 |
"Modified: / 26.10.1997 / 23:18:58 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
392 |
! |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
393 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
394 |
stopFor:anAppOrTopView |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
395 |
"stop activeHelp for a single app" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
396 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
397 |
TheOneAndOnlyHelpListener notNil ifTrue:[ |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
398 |
TheOneAndOnlyHelpListener unlistenFor:anAppOrTopView. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
399 |
]. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
400 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
401 |
"Modified: / 26.10.1997 / 23:12:55 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
402 |
"Created: / 26.10.1997 / 23:18:41 / cg" |
138 | 403 |
! ! |
404 |
||
338
071f92621e3b
oops - catching the terminateSignal is no good idea
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
405 |
!ActiveHelp class methodsFor:'times'! |
138 | 406 |
|
407 |
delayTime:numberOfSeconds |
|
408 |
"set the delay (the time, the cursor has to be in the view |
|
409 |
before help is shown). The default is 2 seconds." |
|
410 |
||
411 |
DelayTime := numberOfSeconds |
|
412 |
||
413 |
" |
|
414 |
ActiveHelp delayTime:0.5 |
|
415 |
ActiveHelp delayTime:2 |
|
416 |
ActiveHelp delayTime:10 |
|
417 |
" |
|
59 | 418 |
! |
419 |
||
138 | 420 |
showTime:numberOfSeconds |
421 |
"set the number of seconds, a help messages is to be shown. |
|
3333 | 422 |
The default is 30 seconds. |
423 |
0 means: show forever (i.e. until mouse is moved)" |
|
138 | 424 |
|
425 |
ShowTime := numberOfSeconds |
|
426 |
||
427 |
" |
|
428 |
ActiveHelp showTime:10 |
|
429 |
ActiveHelp showTime:99999 |
|
430 |
ActiveHelp showTime:30 |
|
431 |
" |
|
2879 | 432 |
|
433 |
"Modified: / 10-11-2010 / 12:29:40 / cg" |
|
138 | 434 |
! ! |
435 |
||
2391 | 436 |
!ActiveHelp methodsFor:'event handling'! |
138 | 437 |
|
2473 | 438 |
buttonMotion:buttonAndModifierState x:x y:y view:aView |
1657 | 439 |
"handle motion events - prepare to show help" |
233 | 440 |
|
2782 | 441 |
|realViewUnderCursor realP| |
442 |
||
4153 | 443 |
"/ Debugging := true |
2473 | 444 |
buttonAndModifierState == 0 ifTrue:[ |
2783
cb3420e40ed1
changed: #buttonMotion:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2782
diff
changeset
|
445 |
"/ realViewUnderCursor := aView device viewFromPoint:(aView pointerPosition). |
cb3420e40ed1
changed: #buttonMotion:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2782
diff
changeset
|
446 |
"/ realP := aView device translatePoint:(x@y) fromView:aView toView:realViewUnderCursor. |
cb3420e40ed1
changed: #buttonMotion:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2782
diff
changeset
|
447 |
"/ self handleMouseIn:realViewUnderCursor x:realP x y:realP y. |
4235 | 448 |
Debugging ifTrue:[('motion %2@%3 in %1' bindWith:aView with:x with:y) infoPrintCR]. |
2783
cb3420e40ed1
changed: #buttonMotion:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2782
diff
changeset
|
449 |
self handleMouseIn:aView x:x y:y. |
1948
33eb423a6fd3
only act when no mouse-button is pressed
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
450 |
]. |
138 | 451 |
^ false |
4122 | 452 |
|
4235 | 453 |
"Modified: / 27-02-2019 / 15:49:03 / Claus Gittinger" |
138 | 454 |
! |
455 |
||
4123 | 456 |
handleMouseIn:aView x:x y:y |
457 |
"handle motion events - if the mousepointer left the |
|
458 |
previous helped view, hide the help" |
|
459 |
||
4134 | 460 |
"/ Debugging := true. |
461 |
"/ Debugging := false. |
|
4123 | 462 |
Debugging ifTrue:['mouse in' infoPrintCR]. |
463 |
(self interestedIn:aView) ifFalse:[ |
|
4134 | 464 |
Debugging ifTrue:[Timestamp now infoPrint. ' - not interested 0' infoPrintCR]. |
4123 | 465 |
^ self |
466 |
]. |
|
467 |
||
468 |
Error handle:[:ex | |
|
469 |
InfoPrinting == true ifTrue:[ |
|
470 |
'---------------------' infoPrintCR. |
|
471 |
ex description infoPrintCR. |
|
472 |
ex suspendedContext fullPrintAll. |
|
473 |
]. |
|
474 |
] do:[ |
|
475 |
|sensor| |
|
476 |
||
477 |
"/ self stopHelpDisplayProcess. |
|
478 |
Debugging ifTrue:['hideIf' infoPrintCR]. |
|
479 |
self hideIfPointerLeft:aView. |
|
480 |
||
481 |
"/ check again, in case the stop/hide changed something... |
|
482 |
(self interestedIn:aView) ifFalse:[ |
|
483 |
Debugging ifTrue:['not interested2' infoPrintCR]. |
|
484 |
^ self |
|
485 |
]. |
|
486 |
||
487 |
"/ if there is a sensor, let the view do it itself (in its process) |
|
488 |
(self targetViewInitiatesHelpViaSensor |
|
489 |
and:[ (sensor := aView sensor) notNil ]) |
|
490 |
ifTrue:[ |
|
4153 | 491 |
Debugging ifTrue:['target shows help' infoPrintCR]. |
4123 | 492 |
sensor flushEventsFor:self withType:#initiateHelpFor:at:. |
493 |
sensor |
|
494 |
pushUserEvent:#initiateHelpFor:at: for:self |
|
495 |
withArguments:(Array with:aView with:(x @ y)). |
|
496 |
] ifFalse:[ |
|
4153 | 497 |
Debugging ifTrue:['I show help' infoPrintCR]. |
4123 | 498 |
self initiateHelpFor:aView at:(x @ y). |
499 |
] |
|
500 |
]. |
|
501 |
||
4153 | 502 |
"Modified: / 02-08-2018 / 16:17:34 / Claus Gittinger" |
4123 | 503 |
! |
504 |
||
1591 | 505 |
keyPress:key x:x y:y view:view |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
506 |
"unconditionally hide the help view" |
233 | 507 |
|
4153 | 508 |
Debugging ifTrue:['key press: ' infoPrint. key infoPrintCR]. |
509 |
key == #Help ifTrue:[ |
|
510 |
self initiateHelpFor:view at:(x @ y). |
|
511 |
^ true. |
|
512 |
]. |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
513 |
self hideHelpIgnoringErrors. |
138 | 514 |
^ false |
233 | 515 |
|
4153 | 516 |
"Modified: / 27-04-1996 / 15:09:57 / cg" |
517 |
"Modified: / 02-08-2018 / 16:50:25 / Claus Gittinger" |
|
518 |
! |
|
519 |
||
520 |
keyRelease:key x:x y:y view:view |
|
521 |
"unconditionally hide the help view" |
|
522 |
||
523 |
Debugging ifTrue:['key release: ' infoPrint. key infoPrintCR]. |
|
4225 | 524 |
|
525 |
"/ key == #Help ifTrue:[ |
|
526 |
"/ ]. |
|
4153 | 527 |
self hideHelpIgnoringErrors. |
528 |
^ false |
|
529 |
||
530 |
"Created: / 02-08-2018 / 16:16:19 / Claus Gittinger" |
|
4225 | 531 |
"Modified: / 20-02-2019 / 11:32:31 / Claus Gittinger" |
138 | 532 |
! |
533 |
||
534 |
pointerEnter:state x:x y:y view:aView |
|
1657 | 535 |
"handle pointer entering a view; prepare to show help" |
233 | 536 |
|
1948
33eb423a6fd3
only act when no mouse-button is pressed
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
537 |
state == 0 ifTrue:[ |
33eb423a6fd3
only act when no mouse-button is pressed
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
538 |
self handleMouseIn:aView x:x y:y. |
33eb423a6fd3
only act when no mouse-button is pressed
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
539 |
]. |
1657 | 540 |
^ false |
138 | 541 |
! |
542 |
||
2371
4ab6c8c7bc03
flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
543 |
pointerLeave:state view:aView |
233 | 544 |
"handle pointer leaving a view; hide help text" |
545 |
||
2371
4ab6c8c7bc03
flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
546 |
|sensor| |
4ab6c8c7bc03
flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
547 |
|
4ab6c8c7bc03
flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
548 |
sensor := aView sensor. |
4ab6c8c7bc03
flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
549 |
sensor notNil ifTrue:[ |
4ab6c8c7bc03
flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
550 |
sensor flushEventsFor:self withType:#initiateHelpFor:at:. |
4ab6c8c7bc03
flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
551 |
]. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
552 |
self hideHelpIgnoringErrors. |
138 | 553 |
^ false |
2914
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
554 |
! |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
555 |
|
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
556 |
processEvent:ev |
4134 | 557 |
DebuggingEvents == true ifTrue:[ |
3507 | 558 |
'event: ' infoPrint. ev class nameWithoutPrefix infoPrint. |
559 |
' view:' infoPrint. ev view infoPrintCR. |
|
3292 | 560 |
]. |
2914
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
561 |
(ev isPointerEnterLeaveEvent |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
562 |
or:[ ev isButtonEvent |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
563 |
or:[ ev isKeyEvent ]]) ifTrue:[ |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
564 |
^ ev dispatchWithViewArgumentTo:self |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
565 |
]. |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
566 |
^ false |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
567 |
|
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
568 |
"Created: / 29-06-2011 / 18:22:43 / cg" |
4134 | 569 |
"Modified: / 19-06-2018 / 12:53:28 / Claus Gittinger" |
59 | 570 |
! ! |
571 |
||
2391 | 572 |
!ActiveHelp methodsFor:'help texts'! |
59 | 573 |
|
2130 | 574 |
helpTextFor:aView at:aDevicePointOrNil |
233 | 575 |
"retrieve helptext for aView as a string; |
3790 | 576 |
walk along the view's superView chain, |
100 | 577 |
asking models and views encountered while walking. |
578 |
The first one who understands and returns a nonNil answer to the |
|
233 | 579 |
#helpTextFor:at: or #helpTextFor: message ends this search and the |
100 | 580 |
returned string is returned." |
581 |
||
2130 | 582 |
|model app1 app2 text v sv topView domainPointOrNil| |
59 | 583 |
|
2130 | 584 |
aView transformation notNil ifTrue:[ |
585 |
domainPointOrNil := aView transformation applyInverseTo:aDevicePointOrNil. |
|
586 |
] ifFalse:[ |
|
587 |
domainPointOrNil := aDevicePointOrNil. |
|
588 |
]. |
|
589 |
||
3665 | 590 |
"/ done below |
591 |
"/ text := self helpTextFromView:aView at:domainPointOrNil. |
|
592 |
"/ text notNil ifTrue:[ ^ text ]. |
|
2076 | 593 |
|
1549
1b5274878f87
care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents:
1543
diff
changeset
|
594 |
((aView respondsTo:#application) |
1b5274878f87
care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents:
1543
diff
changeset
|
595 |
and:[ (app1 := aView application) notNil ]) ifTrue:[ |
2130 | 596 |
text := self helpTextFromModel:app1 view:aView at:domainPointOrNil. |
1549
1b5274878f87
care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents:
1543
diff
changeset
|
597 |
text notNil ifTrue:[ ^ text ]. |
1b5274878f87
care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents:
1543
diff
changeset
|
598 |
] ifFalse:[ |
1b5274878f87
care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents:
1543
diff
changeset
|
599 |
"/ old style (i.e. StandardSystemView ...) |
1b5274878f87
care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents:
1543
diff
changeset
|
600 |
topView := aView topView. |
3664 | 601 |
text := self helpTextFromModel:topView view:aView at:domainPointOrNil. |
602 |
text notNil ifTrue:[ ^ text ]. |
|
59 | 603 |
]. |
1549
1b5274878f87
care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents:
1543
diff
changeset
|
604 |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
605 |
(model := aView model) notNil ifTrue:[ |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
606 |
model ~~ app1 ifTrue:[ |
2130 | 607 |
text := self helpTextFromModel:model view:aView at:domainPointOrNil. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
608 |
text notNil ifTrue:[ ^ text ]. |
1502 | 609 |
]. |
1011
53514f2c18a7
also ask for helpTextAt:, when a motionEvent arrives.
Claus Gittinger <cg@exept.de>
parents:
728
diff
changeset
|
610 |
]. |
2130 | 611 |
text := self helpTextFromView:aView at:domainPointOrNil. |
3664 | 612 |
text notNil ifTrue:[ |
613 |
^ text |
|
614 |
]. |
|
59 | 615 |
|
616 |
"walk up the chain - maybe someone knows about its subview ..." |
|
617 |
v := aView. |
|
1502 | 618 |
[ |
619 |
(sv := v container) notNil |
|
620 |
] whileTrue:[ |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
621 |
(model := sv model) notNil ifTrue:[ |
2130 | 622 |
text := self helpTextFromModel:model view:aView at:domainPointOrNil. |
1502 | 623 |
text notNil ifTrue:[ ^ text ]. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
624 |
]. |
3665 | 625 |
"/ maybe the topView knows something about a higher-up widget... |
626 |
text := self helpTextFromModel:topView view:sv at:domainPointOrNil. |
|
627 |
text notNil ifTrue:[ ^ text ]. |
|
628 |
||
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
629 |
text := self helpTextFromView:sv at:nil. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
630 |
text notNil ifTrue:[ ^ text ]. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
631 |
v := sv |
602 | 632 |
]. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
633 |
|
4038 | 634 |
v notNil ifTrue:[ |
635 |
((v respondsTo:#application) and:[(app2 := v application) notNil]) ifTrue:[ |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
636 |
(app2 ~~ app1) ifTrue:[ |
2130 | 637 |
text := self helpTextFromModel:app2 view:aView at:domainPointOrNil. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
638 |
text notNil ifTrue:[ ^ text ]. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
639 |
] |
4038 | 640 |
]. |
641 |
((v respondsTo:#model) and:[(model := v model) notNil]) ifTrue:[ |
|
2130 | 642 |
text := self helpTextFromModel:model view:aView at:domainPointOrNil. |
1502 | 643 |
text notNil ifTrue:[ ^ text ]. |
4038 | 644 |
]. |
100 | 645 |
]. |
59 | 646 |
^ nil |
100 | 647 |
|
4038 | 648 |
"Modified: / 31-08-1995 / 20:38:00 / claus" |
649 |
"Modified: / 28-07-1998 / 01:47:27 / cg" |
|
650 |
"Modified: / 09-01-2018 / 16:46:37 / stefan" |
|
100 | 651 |
! |
652 |
||
3664 | 653 |
helpTextFromModel:aModelOrTopView view:aView at:aPointOrNil |
1502 | 654 |
"helper: ask aModel for its helpText." |
655 |
||
3664 | 656 |
|text| |
1502 | 657 |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
658 |
aPointOrNil notNil ifTrue:[ |
3664 | 659 |
(aModelOrTopView respondsTo:#helpTextFor:at:) ifTrue:[ |
660 |
text := aModelOrTopView helpTextFor:aView at:aPointOrNil. |
|
2076 | 661 |
text notNil ifTrue:[^ text]. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
662 |
]. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
663 |
]. |
3664 | 664 |
(aModelOrTopView respondsTo:#helpTextFor:) ifTrue:[ |
665 |
text := aModelOrTopView helpTextFor:aView. |
|
666 |
text notNil ifTrue:[^ text]. |
|
1502 | 667 |
]. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
668 |
^ text |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
669 |
! |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
670 |
|
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
671 |
helpTextFromView:aView at:aPointOrNil |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
672 |
"helper: ask aView for its helpText." |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
673 |
|
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
674 |
|text| |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
675 |
|
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
676 |
aPointOrNil notNil ifTrue:[ |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
677 |
(aView respondsTo:#helpTextAt:) ifTrue:[ |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
678 |
text := aView helpTextAt:aPointOrNil. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
679 |
]. |
1502 | 680 |
]. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
681 |
text isNil ifTrue:[ |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
682 |
(aView respondsTo:#helpText) ifTrue:[ |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
683 |
text := aView helpText. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
684 |
]. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
685 |
]. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
686 |
^ text. |
2391 | 687 |
! ! |
688 |
||
689 |
!ActiveHelp methodsFor:'private'! |
|
1502 | 690 |
|
138 | 691 |
hideIfPointerLeft:aView |
233 | 692 |
"hide help, if the pointer is not in aView" |
138 | 693 |
! |
694 |
||
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
695 |
interestedIn:aView |
1033
3a56ba930052
care for nil view passed to #interestedIn.
Claus Gittinger <cg@exept.de>
parents:
1019
diff
changeset
|
696 |
"return true, if I am interested in aView (either listeningForAll, |
3a56ba930052
care for nil view passed to #interestedIn.
Claus Gittinger <cg@exept.de>
parents:
1019
diff
changeset
|
697 |
or in my list of apps)" |
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
698 |
|
3347
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
699 |
|app aViewsTopView device deviceFocusView| |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
700 |
|
4167 | 701 |
"/ Debugging := true |
702 |
"/ Debugging := false |
|
3347
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
703 |
aView isNil ifTrue:[ |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
704 |
Debugging ifTrue:['nil view' infoPrintCR]. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
705 |
^ false |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
706 |
]. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
707 |
|
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
708 |
"/ applicationsOrTopViewsWithHelp isEmptyOrNil ifTrue:[ |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
709 |
"/ Debugging ifTrue:['no apps' infoPrintCR]. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
710 |
"/ ^ false |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
711 |
"/ ]. |
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
712 |
|
3347
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
713 |
aViewsTopView := aView topView. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
714 |
|
3348 | 715 |
UserPreferences current onlyShowTooltipsForActiveWindow ifTrue:[ |
4167 | 716 |
Debugging ifTrue:[ |
4235 | 717 |
('TopView: %1 focus: %2 active: %3' |
718 |
bindWith:aViewsTopView |
|
719 |
with:aViewsTopView graphicsDevice focusView |
|
720 |
with:aViewsTopView isActive) infoPrintCR. |
|
4167 | 721 |
]. |
4134 | 722 |
aViewsTopView isActive ifFalse:[ |
723 |
Debugging ifTrue:[ |
|
724 |
|graphicsDevice focusVw| |
|
725 |
||
726 |
'topview inactive' infoPrintCR. |
|
727 |
graphicsDevice := aViewsTopView graphicsDevice. |
|
728 |
graphicsDevice notNil ifTrue:[ |
|
729 |
focusVw := graphicsDevice focusView. |
|
730 |
'focusView: ' infoPrint. focusVw infoPrintCR. |
|
731 |
focusVw notNil ifTrue:[ |
|
732 |
'wGroup: ' infoPrint. focusVw windowGroup infoPrintCR. |
|
733 |
] |
|
734 |
] |
|
735 |
]. |
|
3417 | 736 |
^ false |
737 |
]. |
|
738 |
||
3348 | 739 |
"/ if none of the view's components has focus... |
740 |
(device := aViewsTopView graphicsDevice) notNil ifTrue:[ |
|
741 |
(deviceFocusView := device focusView) notNil ifTrue:[ |
|
742 |
deviceFocusView topView ~~ aViewsTopView ifTrue:[ |
|
743 |
"/ 'for inactive ' infoPrint. aView infoPrintCR. |
|
744 |
Debugging ifTrue:['inactive topView' infoPrintCR]. |
|
745 |
^ false |
|
746 |
]. |
|
3347
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
747 |
]. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
748 |
]. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
749 |
]. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
750 |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
751 |
listeningForAll == true ifTrue:[^ true]. |
1033
3a56ba930052
care for nil view passed to #interestedIn.
Claus Gittinger <cg@exept.de>
parents:
1019
diff
changeset
|
752 |
|
3395 | 753 |
applicationsOrTopViewsWithHelp isNil ifTrue:[ |
754 |
applicationsOrTopViewsWithHelp := WeakIdentitySet new. |
|
755 |
]. |
|
1106 | 756 |
(applicationsOrTopViewsWithHelp includesIdentical:aViewsTopView) ifTrue:[^ true]. |
757 |
app := aViewsTopView application. |
|
4134 | 758 |
app isNil ifTrue:[ |
759 |
Debugging ifTrue:['no app' infoPrintCR]. |
|
760 |
^ false. |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
761 |
]. |
4134 | 762 |
(applicationsOrTopViewsWithHelp includesIdentical:app) ifTrue:[^ true]. |
763 |
Debugging ifTrue:['not in list of apps I am interested in' infoPrintCR]. |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
764 |
^ false |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
765 |
|
4134 | 766 |
"Created: / 26-10-1997 / 23:28:52 / cg" |
767 |
"Modified: / 08-08-1998 / 13:36:19 / cg" |
|
4235 | 768 |
"Modified: / 27-02-2019 / 11:25:58 / Claus Gittinger" |
2782 | 769 |
! |
770 |
||
771 |
targetViewInitiatesHelpViaSensor |
|
772 |
"true if the target view is asked to show the help via the sensor; |
|
773 |
false, if I do it myself synchronously." |
|
774 |
||
775 |
^ true |
|
59 | 776 |
! ! |
777 |
||
2391 | 778 |
!ActiveHelp methodsFor:'queries'! |
779 |
||
780 |
delayTime |
|
781 |
^ self class delayTime |
|
782 |
! |
|
783 |
||
784 |
showTime |
|
3333 | 785 |
"how long shall the help be shown; |
786 |
0 means: forever (until user moves the mouse); |
|
787 |
>0 means that number of seconds" |
|
788 |
||
2391 | 789 |
^ self class showTime |
790 |
! ! |
|
791 |
||
1768 | 792 |
!ActiveHelp methodsFor:'show & hide help'! |
59 | 793 |
|
794 |
hideHelp |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
795 |
"hide the help text - nothing done here" |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
796 |
! |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
797 |
|
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
798 |
hideHelpIgnoringErrors |
233 | 799 |
"hide the help text" |
800 |
||
1713
bc8a1d16e60f
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
1657
diff
changeset
|
801 |
Error handle:[:ex | |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
802 |
ex description infoPrintCR. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
803 |
ex return |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
804 |
] do:[ |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
805 |
self hideHelp. |
59 | 806 |
]. |
807 |
! |
|
808 |
||
4235 | 809 |
initiateHelp |
810 |
"determine where the mouse pointer is located, |
|
811 |
and start showing a tooltip for it right now. |
|
4238 | 812 |
This can be called to force update of the tooltip, |
4235 | 813 |
in case a widget has changed its mind |
814 |
(typically: an undo menu button function might wonna do this, |
|
815 |
to show changed info)" |
|
816 |
||
817 |
|screenPos view| |
|
4250 | 818 |
|
819 |
"/ Debugging := false. |
|
820 |
"/ Debugging := true. |
|
4235 | 821 |
screenPos := Display pointerPosition. |
822 |
Debugging == true ifTrue:[ |
|
823 |
'----------------' infoPrintCR. |
|
824 |
'pos: ' infoPrint. screenPos infoPrintCR. |
|
825 |
]. |
|
826 |
view := Display viewFromPoint:screenPos. |
|
827 |
Debugging == true ifTrue:[ |
|
828 |
'view: ' infoPrint. view infoPrintCR. |
|
829 |
]. |
|
830 |
view notNil ifTrue:[ |
|
831 |
self initiateHelpFor:view. |
|
832 |
]. |
|
833 |
||
834 |
"Created: / 27-02-2019 / 11:09:41 / Claus Gittinger" |
|
4238 | 835 |
"Modified (comment): / 27-02-2019 / 15:57:12 / Claus Gittinger" |
4235 | 836 |
! |
837 |
||
838 |
initiateHelpFor:aView |
|
839 |
"start showing a tooltip for aView right now. |
|
840 |
This can be called to force update of the tooltip, |
|
841 |
in case a widget has changed its mind |
|
842 |
(typically: an undo menu button function might wonna do this, |
|
843 |
to show changed info)" |
|
844 |
||
845 |
|screenPos relativePos| |
|
846 |
||
847 |
screenPos := Display pointerPosition. |
|
848 |
Debugging == true ifTrue:[ |
|
849 |
'pos: ' infoPrint. screenPos infoPrintCR. |
|
850 |
]. |
|
851 |
aView notNil ifTrue:[ |
|
852 |
relativePos := Display translatePoint:screenPos fromView:nil toView:aView. |
|
853 |
Debugging == true ifTrue:[ |
|
854 |
'relativePos: ' infoPrint. relativePos infoPrintCR. |
|
855 |
]. |
|
856 |
self initiateHelpFor:aView at:relativePos |
|
857 |
]. |
|
858 |
||
859 |
"Created: / 27-02-2019 / 13:59:44 / Claus Gittinger" |
|
860 |
"Modified: / 27-02-2019 / 15:52:07 / Claus Gittinger" |
|
861 |
! |
|
862 |
||
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
863 |
initiateHelpFor:aView at:aPointOrNil |
634 | 864 |
"ask aView for helpText, passing x/y coordinates; |
865 |
start a timeout process to display this helpText after some delay; |
|
866 |
Normally used internally, but can also be used by widgets to force |
|
867 |
re-negotiation of the displayed helpText |
|
868 |
(for example in a menu, when the selection changes)" |
|
869 |
||
4061 | 870 |
"/ ActiveHelp stop |
4060 | 871 |
self class isActive ifFalse:[^ self]. |
872 |
||
4058 | 873 |
"/ in standalone apps, it is better to simply not show the help |
874 |
Error,BreakPointInterrupt handle:[:ex | |
|
875 |
Smalltalk isStandAloneApp ifFalse:[ex reject]. |
|
876 |
] do:[ |
|
877 |
self initiateHelpFor:aView at:aPointOrNil now:false |
|
878 |
]. |
|
637
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
879 |
|
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
880 |
"Modified: 28.6.1997 / 14:45:57 / cg" |
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
881 |
! |
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
882 |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
883 |
initiateHelpFor:aView at:aPointOrNil now:showItNow |
637
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
884 |
"ask aView for helpText, passing x/y coordinates; |
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
885 |
start a timeout process to display this helpText after some delay; |
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
886 |
Normally used internally, but can also be used by widgets to force |
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
887 |
re-negotiation of the displayed helpText |
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
888 |
(for example in a menu, when the selection changes)" |
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
889 |
|
696 | 890 |
|text top app| |
634 | 891 |
|
4235 | 892 |
Debugging == true ifTrue:[ |
893 |
'initiate help for: ' infoPrint. aView infoPrintCR. |
|
894 |
]. |
|
1143 | 895 |
(self interestedIn:aView) ifFalse:[ |
896 |
^ self |
|
897 |
]. |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
898 |
|
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
899 |
text := self helpTextFor:aView at:aPointOrNil. |
637
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
900 |
lastHelpText = text ifTrue:[ |
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
901 |
^ self |
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
902 |
]. |
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
903 |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
904 |
"/ let application show the help |
728 | 905 |
"/ (i.e. in its own information area) |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
906 |
"/ nil-text is also passed down, to give it a chance |
728 | 907 |
"/ to clean its infoDisplay. |
637
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
908 |
|
728 | 909 |
top := aView topView. |
910 |
(app := aView application) notNil ifTrue:[ |
|
1019
862f095da4ac
#showHelp:for: renamed to #showActiveHelp:for:
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
911 |
(app showActiveHelp:text for:aView) ifTrue:[ |
728 | 912 |
lastHelpText := text. |
632
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
913 |
] |
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
914 |
]. |
4235 | 915 |
|
916 |
"Modified: / 27-02-2019 / 11:15:48 / Claus Gittinger" |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
917 |
! |
59 | 918 |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
919 |
stopHelpDisplayProcess |
59 | 920 |
! ! |
921 |
||
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
922 |
!ActiveHelp methodsFor:'start & stop'! |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
923 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
924 |
listenFor:anAppOrTopView |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
925 |
"start listening" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
926 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
927 |
applicationsOrTopViewsWithHelp isNil ifTrue:[ |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
928 |
applicationsOrTopViewsWithHelp := WeakIdentitySet new. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
929 |
]. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
930 |
applicationsOrTopViewsWithHelp add:anAppOrTopView. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
931 |
super listen. |
639 | 932 |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
933 |
"Created: / 26.10.1997 / 23:20:47 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
934 |
"Modified: / 26.10.1997 / 23:21:10 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
935 |
! |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
936 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
937 |
listenForAll |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
938 |
"start listening" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
939 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
940 |
listeningForAll := true. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
941 |
super listen. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
942 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
943 |
"Modified: / 28.6.1997 / 15:07:02 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
944 |
"Created: / 26.10.1997 / 23:19:30 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
945 |
! |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
946 |
|
2391 | 947 |
start |
948 |
self listenForAll |
|
949 |
! |
|
950 |
||
951 |
stop |
|
952 |
self unlistenAll |
|
953 |
! |
|
954 |
||
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
955 |
unlistenAll |
639 | 956 |
"stop listening" |
957 |
||
958 |
self hideHelp. |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
959 |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
960 |
listeningForAll := false. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
961 |
applicationsOrTopViewsWithHelp size == 0 ifTrue:[ |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
962 |
self unlisten. |
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
963 |
] |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
964 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
965 |
"Created: / 26.10.1997 / 23:14:17 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
966 |
"Modified: / 26.10.1997 / 23:23:04 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
967 |
! |
639 | 968 |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
969 |
unlistenFor:anApp |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
970 |
"stop listening for an app" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
971 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
972 |
self hideHelp. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
973 |
|
1543 | 974 |
applicationsOrTopViewsWithHelp isNil ifFalse:[ |
975 |
applicationsOrTopViewsWithHelp remove:anApp ifAbsent:nil. |
|
976 |
]. |
|
726 | 977 |
listeningForAll == true ifFalse:[ |
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
978 |
applicationsOrTopViewsWithHelp size == 0 ifTrue:[ |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
979 |
self unlisten. |
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
980 |
] |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
981 |
] |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
982 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
983 |
"Created: / 26.10.1997 / 23:22:42 / cg" |
726 | 984 |
"Modified: / 29.10.1997 / 15:48:34 / cg" |
639 | 985 |
! ! |
986 |
||
338
071f92621e3b
oops - catching the terminateSignal is no good idea
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
987 |
!ActiveHelp class methodsFor:'documentation'! |
138 | 988 |
|
3665 | 989 |
version |
990 |
^ '$Header$' |
|
991 |
! |
|
992 |
||
2779
b608ded19ff2
changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
993 |
version_CVS |
3507 | 994 |
^ '$Header$' |
138 | 995 |
! ! |
3197 | 996 |
|
3320 | 997 |
|
998 |
ActiveHelp initialize! |