author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 30 May 2018 09:37:07 +0100 | |
branch | jv |
changeset 4132 | 7e5528572373 |
parent 3798 | 85687906ec72 |
permissions | -rw-r--r-- |
59 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
4132 | 3 |
COPYRIGHT (c) 2016 Jan Vrany |
59 | 4 |
All Rights Reserved |
5 |
||
6 |
This software is furnished under a license and may be used |
|
7 |
only in accordance with the terms of that license and with the |
|
8 |
inclusion of the above copyright notice. This software may not |
|
9 |
be provided or otherwise made available to, or used by, any |
|
10 |
other person. No title to or ownership of the software is |
|
11 |
hereby transferred. |
|
12 |
" |
|
1502 | 13 |
"{ Package: 'stx:libview2' }" |
14 |
||
3447 | 15 |
"{ NameSpace: Smalltalk }" |
16 |
||
59 | 17 |
EventListener subclass:#ActiveHelp |
3227 | 18 |
instanceVariableNames:'lastHelpText listeningForAll applicationsOrTopViewsWithHelp |
19 |
lastHelpWidget' |
|
2975 | 20 |
classVariableNames:'Debugging' |
216 | 21 |
poolDictionaries:'' |
22 |
category:'Interface-Help' |
|
59 | 23 |
! |
24 |
||
1892 | 25 |
ActiveHelp class instanceVariableNames:'DelayTime ShowTime TheOneAndOnlyHelpListener' |
26 |
||
27 |
" |
|
28 |
No other class instance variables are inherited by this class. |
|
29 |
" |
|
30 |
! |
|
31 |
||
338
071f92621e3b
oops - catching the terminateSignal is no good idea
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
32 |
!ActiveHelp class methodsFor:'documentation'! |
59 | 33 |
|
138 | 34 |
copyright |
35 |
" |
|
36 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
4132 | 37 |
COPYRIGHT (c) 2016 Jan Vrany |
138 | 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) |
73 |
or the topView, if its a derived class of StandardSystemView. |
|
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. |
|
230 |
! ! |
|
231 |
||
2975 | 232 |
!ActiveHelp class methodsFor:'accessing'! |
233 |
||
234 |
debugging |
|
3320 | 235 |
^ Debugging |
2975 | 236 |
|
237 |
"Modified: / 22-12-2011 / 10:46:30 / cg" |
|
238 |
! |
|
239 |
||
240 |
debugging:something |
|
241 |
Debugging := something. |
|
242 |
||
243 |
" |
|
244 |
self debugging:true |
|
245 |
self debugging:false |
|
246 |
" |
|
247 |
||
248 |
"Modified (comment): / 22-12-2011 / 10:43:32 / cg" |
|
249 |
! ! |
|
250 |
||
633 | 251 |
!ActiveHelp class methodsFor:'queries'! |
100 | 252 |
|
632
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
253 |
currentHelpListener |
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
254 |
"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
|
255 |
|
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
256 |
^ TheOneAndOnlyHelpListener |
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
257 |
|
3395 | 258 |
" |
259 |
ActiveHelp currentHelpListener |
|
260 |
FlyByHelp currentHelpListener |
|
261 |
" |
|
262 |
||
632
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
263 |
"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
|
264 |
! |
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
265 |
|
1892 | 266 |
delayTime |
2391 | 267 |
^ DelayTime ? 0.4 |
1892 | 268 |
! |
269 |
||
233 | 270 |
isActive |
271 |
"return true, if activeHelp is turned on" |
|
272 |
||
3347
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
273 |
TheOneAndOnlyHelpListener notNil ifTrue:[ |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
274 |
((WindowSensor eventListeners ? #()) includesIdentical:TheOneAndOnlyHelpListener) ifTrue:[ |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
275 |
^ true |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
276 |
]. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
277 |
TheOneAndOnlyHelpListener := nil. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
278 |
]. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
279 |
^ false. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
280 |
|
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
281 |
" |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
282 |
FlyByHelp isActive |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
283 |
" |
233 | 284 |
|
285 |
"Modified: 27.4.1996 / 15:07:57 / cg" |
|
1892 | 286 |
! |
287 |
||
288 |
showTime |
|
2879 | 289 |
"set the number of seconds, a help messages is to be shown. |
3447 | 290 |
The default is 45 seconds. |
3333 | 291 |
0 means: show forever (i.e. until mouse is moved)" |
2879 | 292 |
|
3447 | 293 |
^ ShowTime ? 45 |
2879 | 294 |
|
295 |
"Modified: / 10-11-2010 / 12:29:44 / cg" |
|
633 | 296 |
! ! |
297 |
||
3685
f0724224515c
Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3507
diff
changeset
|
298 |
!ActiveHelp class methodsFor:'snapshots'! |
f0724224515c
Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3507
diff
changeset
|
299 |
|
f0724224515c
Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3507
diff
changeset
|
300 |
preSnapshot |
f0724224515c
Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3507
diff
changeset
|
301 |
"Sent by ObjectMemory to all classes, before a snapshot is written." |
f0724224515c
Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3507
diff
changeset
|
302 |
|
f0724224515c
Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3507
diff
changeset
|
303 |
TheOneAndOnlyHelpListener notNil ifTrue:[ |
f0724224515c
Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3507
diff
changeset
|
304 |
TheOneAndOnlyHelpListener hideHelp |
f0724224515c
Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3507
diff
changeset
|
305 |
]. |
f0724224515c
Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3507
diff
changeset
|
306 |
|
f0724224515c
Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3507
diff
changeset
|
307 |
"Created: / 04-05-2016 / 10:33:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
f0724224515c
Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3507
diff
changeset
|
308 |
! ! |
f0724224515c
Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3507
diff
changeset
|
309 |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
310 |
!ActiveHelp class methodsFor:'start & stop'! |
59 | 311 |
|
312 |
start |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
313 |
"start activeHelp for all apps" |
233 | 314 |
|
2391 | 315 |
TheOneAndOnlyHelpListener notNil ifTrue:[ |
316 |
TheOneAndOnlyHelpListener stop. |
|
317 |
TheOneAndOnlyHelpListener := nil. |
|
318 |
]. |
|
319 |
||
59 | 320 |
TheOneAndOnlyHelpListener isNil ifTrue:[ |
233 | 321 |
TheOneAndOnlyHelpListener := self new. |
59 | 322 |
]. |
2391 | 323 |
TheOneAndOnlyHelpListener start. |
324 |
^ TheOneAndOnlyHelpListener |
|
59 | 325 |
|
326 |
" |
|
327 |
ActiveHelp start |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
328 |
FlyByHelp start |
59 | 329 |
" |
233 | 330 |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
331 |
"Modified: / 26.10.1997 / 23:16:54 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
332 |
! |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
333 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
334 |
startFor:anApplicationOrTopView |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
335 |
"start activeHelp for a single app" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
336 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
337 |
TheOneAndOnlyHelpListener isNil ifTrue:[ |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
338 |
TheOneAndOnlyHelpListener := self new. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
339 |
]. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
340 |
TheOneAndOnlyHelpListener listenFor:anApplicationOrTopView |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
341 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
342 |
"Modified: / 26.10.1997 / 23:17:05 / cg" |
59 | 343 |
! |
344 |
||
345 |
stop |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
346 |
"stop activeHelp for all (except for individual apps)" |
233 | 347 |
|
59 | 348 |
TheOneAndOnlyHelpListener notNil ifTrue:[ |
2391 | 349 |
TheOneAndOnlyHelpListener stop. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
350 |
TheOneAndOnlyHelpListener := nil. |
59 | 351 |
]. |
352 |
||
353 |
" |
|
354 |
ActiveHelp stop |
|
1543 | 355 |
FlyByHelp stop |
59 | 356 |
" |
233 | 357 |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
358 |
"Modified: / 26.10.1997 / 23:18:58 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
359 |
! |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
360 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
361 |
stopFor:anAppOrTopView |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
362 |
"stop activeHelp for a single app" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
363 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
364 |
TheOneAndOnlyHelpListener notNil ifTrue:[ |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
365 |
TheOneAndOnlyHelpListener unlistenFor:anAppOrTopView. |
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 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
368 |
"Modified: / 26.10.1997 / 23:12:55 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
369 |
"Created: / 26.10.1997 / 23:18:41 / cg" |
138 | 370 |
! ! |
371 |
||
338
071f92621e3b
oops - catching the terminateSignal is no good idea
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
372 |
!ActiveHelp class methodsFor:'times'! |
138 | 373 |
|
374 |
delayTime:numberOfSeconds |
|
375 |
"set the delay (the time, the cursor has to be in the view |
|
376 |
before help is shown). The default is 2 seconds." |
|
377 |
||
378 |
DelayTime := numberOfSeconds |
|
379 |
||
380 |
" |
|
381 |
ActiveHelp delayTime:0.5 |
|
382 |
ActiveHelp delayTime:2 |
|
383 |
ActiveHelp delayTime:10 |
|
384 |
" |
|
59 | 385 |
! |
386 |
||
138 | 387 |
showTime:numberOfSeconds |
388 |
"set the number of seconds, a help messages is to be shown. |
|
3333 | 389 |
The default is 30 seconds. |
390 |
0 means: show forever (i.e. until mouse is moved)" |
|
138 | 391 |
|
392 |
ShowTime := numberOfSeconds |
|
393 |
||
394 |
" |
|
395 |
ActiveHelp showTime:10 |
|
396 |
ActiveHelp showTime:99999 |
|
397 |
ActiveHelp showTime:30 |
|
398 |
" |
|
2879 | 399 |
|
400 |
"Modified: / 10-11-2010 / 12:29:40 / cg" |
|
138 | 401 |
! ! |
402 |
||
2391 | 403 |
!ActiveHelp methodsFor:'event handling'! |
138 | 404 |
|
2473 | 405 |
buttonMotion:buttonAndModifierState x:x y:y view:aView |
1657 | 406 |
"handle motion events - prepare to show help" |
233 | 407 |
|
2782 | 408 |
|realViewUnderCursor realP| |
409 |
||
2473 | 410 |
buttonAndModifierState == 0 ifTrue:[ |
2783
cb3420e40ed1
changed: #buttonMotion:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2782
diff
changeset
|
411 |
"/ realViewUnderCursor := aView device viewFromPoint:(aView pointerPosition). |
cb3420e40ed1
changed: #buttonMotion:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2782
diff
changeset
|
412 |
"/ 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
|
413 |
"/ self handleMouseIn:realViewUnderCursor x:realP x y:realP y. |
3292 | 414 |
Debugging ifTrue:['motion' infoPrintCR]. |
2783
cb3420e40ed1
changed: #buttonMotion:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2782
diff
changeset
|
415 |
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
|
416 |
]. |
138 | 417 |
^ false |
418 |
! |
|
419 |
||
1591 | 420 |
keyPress:key x:x y:y view:view |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
421 |
"unconditionally hide the help view" |
233 | 422 |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
423 |
self hideHelpIgnoringErrors. |
138 | 424 |
^ false |
233 | 425 |
|
426 |
"Modified: 27.4.1996 / 15:09:57 / cg" |
|
138 | 427 |
! |
428 |
||
429 |
pointerEnter:state x:x y:y view:aView |
|
1657 | 430 |
"handle pointer entering a view; prepare to show help" |
233 | 431 |
|
1948
33eb423a6fd3
only act when no mouse-button is pressed
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
432 |
state == 0 ifTrue:[ |
33eb423a6fd3
only act when no mouse-button is pressed
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
433 |
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
|
434 |
]. |
1657 | 435 |
^ false |
138 | 436 |
! |
437 |
||
2371
4ab6c8c7bc03
flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
438 |
pointerLeave:state view:aView |
233 | 439 |
"handle pointer leaving a view; hide help text" |
440 |
||
2371
4ab6c8c7bc03
flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
441 |
|sensor| |
4ab6c8c7bc03
flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
442 |
|
4ab6c8c7bc03
flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
443 |
sensor := aView sensor. |
4ab6c8c7bc03
flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
444 |
sensor notNil ifTrue:[ |
4ab6c8c7bc03
flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
445 |
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
|
446 |
]. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
447 |
self hideHelpIgnoringErrors. |
138 | 448 |
^ false |
2914
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
449 |
! |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
450 |
|
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
451 |
processEvent:ev |
3292 | 452 |
Debugging ifTrue:[ |
3507 | 453 |
'event: ' infoPrint. ev class nameWithoutPrefix infoPrint. |
454 |
' view:' infoPrint. ev view infoPrintCR. |
|
3292 | 455 |
]. |
2914
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
456 |
(ev isPointerEnterLeaveEvent |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
457 |
or:[ ev isButtonEvent |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
458 |
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
|
459 |
^ ev dispatchWithViewArgumentTo:self |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
460 |
]. |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
461 |
^ false |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
462 |
|
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
463 |
"Created: / 29-06-2011 / 18:22:43 / cg" |
59 | 464 |
! ! |
465 |
||
2391 | 466 |
!ActiveHelp methodsFor:'help texts'! |
59 | 467 |
|
2130 | 468 |
helpTextFor:aView at:aDevicePointOrNil |
233 | 469 |
"retrieve helptext for aView as a string; |
3790 | 470 |
walk along the view's superView chain, |
100 | 471 |
asking models and views encountered while walking. |
472 |
The first one who understands and returns a nonNil answer to the |
|
233 | 473 |
#helpTextFor:at: or #helpTextFor: message ends this search and the |
100 | 474 |
returned string is returned." |
475 |
||
2130 | 476 |
|model app1 app2 text v sv topView domainPointOrNil| |
59 | 477 |
|
2130 | 478 |
aView transformation notNil ifTrue:[ |
479 |
domainPointOrNil := aView transformation applyInverseTo:aDevicePointOrNil. |
|
480 |
] ifFalse:[ |
|
481 |
domainPointOrNil := aDevicePointOrNil. |
|
482 |
]. |
|
483 |
||
3665 | 484 |
"/ done below |
485 |
"/ text := self helpTextFromView:aView at:domainPointOrNil. |
|
486 |
"/ text notNil ifTrue:[ ^ text ]. |
|
2076 | 487 |
|
1549
1b5274878f87
care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents:
1543
diff
changeset
|
488 |
((aView respondsTo:#application) |
1b5274878f87
care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents:
1543
diff
changeset
|
489 |
and:[ (app1 := aView application) notNil ]) ifTrue:[ |
2130 | 490 |
text := self helpTextFromModel:app1 view:aView at:domainPointOrNil. |
1549
1b5274878f87
care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents:
1543
diff
changeset
|
491 |
text notNil ifTrue:[ ^ text ]. |
1b5274878f87
care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents:
1543
diff
changeset
|
492 |
] ifFalse:[ |
1b5274878f87
care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents:
1543
diff
changeset
|
493 |
"/ old style (i.e. StandardSystemView ...) |
1b5274878f87
care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents:
1543
diff
changeset
|
494 |
topView := aView topView. |
3664 | 495 |
text := self helpTextFromModel:topView view:aView at:domainPointOrNil. |
496 |
text notNil ifTrue:[ ^ text ]. |
|
59 | 497 |
]. |
1549
1b5274878f87
care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents:
1543
diff
changeset
|
498 |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
499 |
(model := aView model) notNil ifTrue:[ |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
500 |
model ~~ app1 ifTrue:[ |
2130 | 501 |
text := self helpTextFromModel:model view:aView at:domainPointOrNil. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
502 |
text notNil ifTrue:[ ^ text ]. |
1502 | 503 |
]. |
1011
53514f2c18a7
also ask for helpTextAt:, when a motionEvent arrives.
Claus Gittinger <cg@exept.de>
parents:
728
diff
changeset
|
504 |
]. |
2130 | 505 |
text := self helpTextFromView:aView at:domainPointOrNil. |
3664 | 506 |
text notNil ifTrue:[ |
507 |
^ text |
|
508 |
]. |
|
59 | 509 |
|
510 |
"walk up the chain - maybe someone knows about its subview ..." |
|
511 |
v := aView. |
|
1502 | 512 |
[ |
513 |
(sv := v container) notNil |
|
514 |
] whileTrue:[ |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
515 |
(model := sv model) notNil ifTrue:[ |
2130 | 516 |
text := self helpTextFromModel:model view:aView at:domainPointOrNil. |
1502 | 517 |
text notNil ifTrue:[ ^ text ]. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
518 |
]. |
3665 | 519 |
"/ maybe the topView knows something about a higher-up widget... |
520 |
text := self helpTextFromModel:topView view:sv at:domainPointOrNil. |
|
521 |
text notNil ifTrue:[ ^ text ]. |
|
522 |
||
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
523 |
text := self helpTextFromView:sv at:nil. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
524 |
text notNil ifTrue:[ ^ text ]. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
525 |
v := sv |
602 | 526 |
]. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
527 |
|
100 | 528 |
(v notNil and:[v respondsTo:#application]) ifTrue:[ |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
529 |
(app2 := v application) notNil ifTrue:[ |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
530 |
(app2 ~~ app1) ifTrue:[ |
2130 | 531 |
text := self helpTextFromModel:app2 view:aView at:domainPointOrNil. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
532 |
text notNil ifTrue:[ ^ text ]. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
533 |
] |
233 | 534 |
] |
100 | 535 |
]. |
536 |
(v notNil and:[v respondsTo:#model]) ifTrue:[ |
|
233 | 537 |
(model := v model) notNil ifTrue:[ |
2130 | 538 |
text := self helpTextFromModel:model view:aView at:domainPointOrNil. |
1502 | 539 |
text notNil ifTrue:[ ^ text ]. |
233 | 540 |
] |
100 | 541 |
]. |
59 | 542 |
^ nil |
100 | 543 |
|
728 | 544 |
"Modified: / 31.8.1995 / 20:38:00 / claus" |
1011
53514f2c18a7
also ask for helpTextAt:, when a motionEvent arrives.
Claus Gittinger <cg@exept.de>
parents:
728
diff
changeset
|
545 |
"Modified: / 28.7.1998 / 01:47:27 / cg" |
100 | 546 |
! |
547 |
||
3664 | 548 |
helpTextFromModel:aModelOrTopView view:aView at:aPointOrNil |
1502 | 549 |
"helper: ask aModel for its helpText." |
550 |
||
3664 | 551 |
|text| |
1502 | 552 |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
553 |
aPointOrNil notNil ifTrue:[ |
3664 | 554 |
(aModelOrTopView respondsTo:#helpTextFor:at:) ifTrue:[ |
555 |
text := aModelOrTopView helpTextFor:aView at:aPointOrNil. |
|
2076 | 556 |
text notNil ifTrue:[^ text]. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
557 |
]. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
558 |
]. |
3664 | 559 |
(aModelOrTopView respondsTo:#helpTextFor:) ifTrue:[ |
560 |
text := aModelOrTopView helpTextFor:aView. |
|
561 |
text notNil ifTrue:[^ text]. |
|
1502 | 562 |
]. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
563 |
^ text |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
564 |
! |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
565 |
|
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
566 |
helpTextFromView:aView at:aPointOrNil |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
567 |
"helper: ask aView for its helpText." |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
568 |
|
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
569 |
|text| |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
570 |
|
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
571 |
aPointOrNil notNil ifTrue:[ |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
572 |
(aView respondsTo:#helpTextAt:) ifTrue:[ |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
573 |
text := aView helpTextAt:aPointOrNil. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
574 |
]. |
1502 | 575 |
]. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
576 |
text isNil ifTrue:[ |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
577 |
(aView respondsTo:#helpText) ifTrue:[ |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
578 |
text := aView helpText. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
579 |
]. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
580 |
]. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
581 |
^ text. |
2391 | 582 |
! ! |
583 |
||
584 |
!ActiveHelp methodsFor:'private'! |
|
1502 | 585 |
|
2914
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
586 |
handleMouseIn:aView x:x y:y |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
587 |
"handle motion events - if the mousepointer left the |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
588 |
previous helped view, hide the help" |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
589 |
|
3292 | 590 |
Debugging ifTrue:['mouse in' infoPrintCR]. |
591 |
(self interestedIn:aView) ifFalse:[ |
|
3347
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
592 |
Debugging ifTrue:['not interested 0' infoPrintCR]. |
3292 | 593 |
^ self |
594 |
]. |
|
2914
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
595 |
|
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
596 |
Error handle:[:ex | |
3320 | 597 |
InfoPrinting == true ifTrue:[ |
598 |
'---------------------' infoPrintCR. |
|
599 |
ex description infoPrintCR. |
|
600 |
ex suspendedContext fullPrintAll. |
|
601 |
]. |
|
2914
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
602 |
] do:[ |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
603 |
|sensor| |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
604 |
|
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
605 |
"/ self stopHelpDisplayProcess. |
3292 | 606 |
Debugging ifTrue:['hideIf' infoPrintCR]. |
2914
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
607 |
self hideIfPointerLeft:aView. |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
608 |
|
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
609 |
"/ check again, in case the stop/hide changed something... |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
610 |
(self interestedIn:aView) ifFalse:[ |
3292 | 611 |
Debugging ifTrue:['not interested2' infoPrintCR]. |
2914
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
612 |
^ self |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
613 |
]. |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
614 |
|
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
615 |
"/ if there is a sensor, let the view do it itself (in its process) |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
616 |
(self targetViewInitiatesHelpViaSensor |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
617 |
and:[ (sensor := aView sensor) notNil ]) |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
618 |
ifTrue:[ |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
619 |
sensor flushEventsFor:self withType:#initiateHelpFor:at:. |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
620 |
sensor |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
621 |
pushUserEvent:#initiateHelpFor:at: for:self |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
622 |
withArguments:(Array with:aView with:(x @ y)). |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
623 |
] ifFalse:[ |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
624 |
self initiateHelpFor:aView at:(x @ y). |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
625 |
] |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
626 |
]. |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
627 |
! |
18cff2d0daff
change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents:
2879
diff
changeset
|
628 |
|
138 | 629 |
hideIfPointerLeft:aView |
233 | 630 |
"hide help, if the pointer is not in aView" |
138 | 631 |
! |
632 |
||
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
633 |
interestedIn:aView |
1033
3a56ba930052
care for nil view passed to #interestedIn.
Claus Gittinger <cg@exept.de>
parents:
1019
diff
changeset
|
634 |
"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
|
635 |
or in my list of apps)" |
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
636 |
|
3347
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
637 |
|app aViewsTopView device deviceFocusView| |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
638 |
|
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
639 |
aView isNil ifTrue:[ |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
640 |
Debugging ifTrue:['nil view' infoPrintCR]. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
641 |
^ false |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
642 |
]. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
643 |
|
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
644 |
"/ applicationsOrTopViewsWithHelp isEmptyOrNil ifTrue:[ |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
645 |
"/ Debugging ifTrue:['no apps' infoPrintCR]. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
646 |
"/ ^ false |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
647 |
"/ ]. |
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
648 |
|
3347
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
649 |
aViewsTopView := aView topView. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
650 |
|
3348 | 651 |
UserPreferences current onlyShowTooltipsForActiveWindow ifTrue:[ |
3417 | 652 |
aViewsTopView isActive ifFalse:[ |
653 |
Debugging ifTrue:[ 'topview inactive' infoPrintCR]. |
|
654 |
^ false |
|
655 |
]. |
|
656 |
||
3348 | 657 |
"/ if none of the view's components has focus... |
658 |
(device := aViewsTopView graphicsDevice) notNil ifTrue:[ |
|
659 |
(deviceFocusView := device focusView) notNil ifTrue:[ |
|
660 |
deviceFocusView topView ~~ aViewsTopView ifTrue:[ |
|
661 |
"/ 'for inactive ' infoPrint. aView infoPrintCR. |
|
662 |
Debugging ifTrue:['inactive topView' infoPrintCR]. |
|
663 |
^ false |
|
664 |
]. |
|
3347
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
665 |
]. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
666 |
]. |
f314814a3105
do not show help for inactive (background) views.
Claus Gittinger <cg@exept.de>
parents:
3333
diff
changeset
|
667 |
]. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
668 |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
669 |
listeningForAll == true ifTrue:[^ true]. |
1033
3a56ba930052
care for nil view passed to #interestedIn.
Claus Gittinger <cg@exept.de>
parents:
1019
diff
changeset
|
670 |
|
3395 | 671 |
applicationsOrTopViewsWithHelp isNil ifTrue:[ |
672 |
applicationsOrTopViewsWithHelp := WeakIdentitySet new. |
|
673 |
]. |
|
1106 | 674 |
(applicationsOrTopViewsWithHelp includesIdentical:aViewsTopView) ifTrue:[^ true]. |
675 |
app := aViewsTopView application. |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
676 |
app notNil ifTrue:[ |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
677 |
(applicationsOrTopViewsWithHelp includesIdentical:app) ifTrue:[^ true] |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
678 |
]. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
679 |
^ false |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
680 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
681 |
"Created: / 26.10.1997 / 23:28:52 / cg" |
1033
3a56ba930052
care for nil view passed to #interestedIn.
Claus Gittinger <cg@exept.de>
parents:
1019
diff
changeset
|
682 |
"Modified: / 8.8.1998 / 13:36:19 / cg" |
2782 | 683 |
! |
684 |
||
685 |
targetViewInitiatesHelpViaSensor |
|
686 |
"true if the target view is asked to show the help via the sensor; |
|
687 |
false, if I do it myself synchronously." |
|
688 |
||
689 |
^ true |
|
59 | 690 |
! ! |
691 |
||
2391 | 692 |
!ActiveHelp methodsFor:'queries'! |
693 |
||
694 |
delayTime |
|
695 |
^ self class delayTime |
|
696 |
! |
|
697 |
||
698 |
showTime |
|
3333 | 699 |
"how long shall the help be shown; |
700 |
0 means: forever (until user moves the mouse); |
|
701 |
>0 means that number of seconds" |
|
702 |
||
2391 | 703 |
^ self class showTime |
704 |
! ! |
|
705 |
||
1768 | 706 |
!ActiveHelp methodsFor:'show & hide help'! |
59 | 707 |
|
708 |
hideHelp |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
709 |
"hide the help text - nothing done here" |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
710 |
! |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
711 |
|
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
712 |
hideHelpIgnoringErrors |
233 | 713 |
"hide the help text" |
714 |
||
1713
bc8a1d16e60f
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
1657
diff
changeset
|
715 |
Error handle:[:ex | |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
716 |
ex description infoPrintCR. |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
717 |
ex return |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
718 |
] do:[ |
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
719 |
self hideHelp. |
59 | 720 |
]. |
721 |
! |
|
722 |
||
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
723 |
initiateHelpFor:aView at:aPointOrNil |
634 | 724 |
"ask aView for helpText, passing x/y coordinates; |
725 |
start a timeout process to display this helpText after some delay; |
|
726 |
Normally used internally, but can also be used by widgets to force |
|
727 |
re-negotiation of the displayed helpText |
|
728 |
(for example in a menu, when the selection changes)" |
|
729 |
||
1657 | 730 |
self initiateHelpFor:aView at:aPointOrNil now:false |
637
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
731 |
|
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
732 |
"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
|
733 |
! |
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
734 |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
735 |
initiateHelpFor:aView at:aPointOrNil now:showItNow |
637
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
736 |
"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
|
737 |
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
|
738 |
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
|
739 |
re-negotiation of the displayed helpText |
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
740 |
(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
|
741 |
|
696 | 742 |
|text top app| |
634 | 743 |
|
1143 | 744 |
(self interestedIn:aView) ifFalse:[ |
745 |
^ self |
|
746 |
]. |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
747 |
|
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
748 |
text := self helpTextFor:aView at:aPointOrNil. |
637
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
749 |
lastHelpText = text ifTrue:[ |
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
750 |
^ self |
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
751 |
]. |
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
752 |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
753 |
"/ let application show the help |
728 | 754 |
"/ (i.e. in its own information area) |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
755 |
"/ nil-text is also passed down, to give it a chance |
728 | 756 |
"/ to clean its infoDisplay. |
637
8be64da7d932
views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
757 |
|
728 | 758 |
top := aView topView. |
759 |
(app := aView application) notNil ifTrue:[ |
|
1019
862f095da4ac
#showHelp:for: renamed to #showActiveHelp:for:
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
760 |
(app showActiveHelp:text for:aView) ifTrue:[ |
728 | 761 |
lastHelpText := text. |
632
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
762 |
] |
844b1aaf3eeb
provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents:
602
diff
changeset
|
763 |
]. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
764 |
! |
59 | 765 |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
766 |
stopHelpDisplayProcess |
59 | 767 |
! ! |
768 |
||
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
769 |
!ActiveHelp methodsFor:'start & stop'! |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
770 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
771 |
listenFor:anAppOrTopView |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
772 |
"start listening" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
773 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
774 |
applicationsOrTopViewsWithHelp isNil ifTrue:[ |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
775 |
applicationsOrTopViewsWithHelp := WeakIdentitySet new. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
776 |
]. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
777 |
applicationsOrTopViewsWithHelp add:anAppOrTopView. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
778 |
super listen. |
639 | 779 |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
780 |
"Created: / 26.10.1997 / 23:20:47 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
781 |
"Modified: / 26.10.1997 / 23:21:10 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
782 |
! |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
783 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
784 |
listenForAll |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
785 |
"start listening" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
786 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
787 |
listeningForAll := true. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
788 |
super listen. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
789 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
790 |
"Modified: / 28.6.1997 / 15:07:02 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
791 |
"Created: / 26.10.1997 / 23:19:30 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
792 |
! |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
793 |
|
2391 | 794 |
start |
795 |
self listenForAll |
|
796 |
! |
|
797 |
||
798 |
stop |
|
799 |
self unlistenAll |
|
800 |
! |
|
801 |
||
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
802 |
unlistenAll |
639 | 803 |
"stop listening" |
804 |
||
805 |
self hideHelp. |
|
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
806 |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
807 |
listeningForAll := false. |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
808 |
applicationsOrTopViewsWithHelp size == 0 ifTrue:[ |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
809 |
self unlisten. |
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
810 |
] |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
811 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
812 |
"Created: / 26.10.1997 / 23:14:17 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
813 |
"Modified: / 26.10.1997 / 23:23:04 / cg" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
814 |
! |
639 | 815 |
|
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
816 |
unlistenFor:anApp |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
817 |
"stop listening for an app" |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
818 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
819 |
self hideHelp. |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
820 |
|
1543 | 821 |
applicationsOrTopViewsWithHelp isNil ifFalse:[ |
822 |
applicationsOrTopViewsWithHelp remove:anApp ifAbsent:nil. |
|
823 |
]. |
|
726 | 824 |
listeningForAll == true ifFalse:[ |
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
825 |
applicationsOrTopViewsWithHelp size == 0 ifTrue:[ |
1535
a9fcabccabb3
separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
826 |
self unlisten. |
719
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
827 |
] |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
828 |
] |
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
829 |
|
17fba5c2a167
allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents:
696
diff
changeset
|
830 |
"Created: / 26.10.1997 / 23:22:42 / cg" |
726 | 831 |
"Modified: / 29.10.1997 / 15:48:34 / cg" |
639 | 832 |
! ! |
833 |
||
338
071f92621e3b
oops - catching the terminateSignal is no good idea
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
834 |
!ActiveHelp class methodsFor:'documentation'! |
138 | 835 |
|
3665 | 836 |
version |
837 |
^ '$Header$' |
|
838 |
! |
|
839 |
||
2779
b608ded19ff2
changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents:
2688
diff
changeset
|
840 |
version_CVS |
3507 | 841 |
^ '$Header$' |
138 | 842 |
! ! |
3197 | 843 |
|
3320 | 844 |
|
845 |
ActiveHelp initialize! |