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