author | Claus Gittinger <cg@exept.de> |
Thu, 12 Sep 2013 10:30:14 +0200 | |
changeset 3243 | f78b2a3470eb |
parent 3241 | 630689dda068 |
child 3247 | 768269b26ad3 |
permissions | -rw-r--r-- |
1802 | 1 |
" |
2 |
COPYRIGHT (c) 2001 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
1536 | 12 |
"{ Package: 'stx:libview2' }" |
13 |
||
14 |
ActiveHelp subclass:#FlyByHelp |
|
2680 | 15 |
instanceVariableNames:'currentFrame currentView currentHelpView showProcess closeProcess' |
1892 | 16 |
classVariableNames:'' |
1536 | 17 |
poolDictionaries:'' |
18 |
category:'Interface-Help' |
|
19 |
! |
|
20 |
||
1802 | 21 |
!FlyByHelp class methodsFor:'documentation'! |
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 2001 by eXept Software AG |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
1893 | 35 |
! |
36 |
||
37 |
examples |
|
38 |
" |
|
3220 | 39 |
UserPreferences current toolTipShapeStyle:nil |
40 |
UserPreferences current toolTipShapeStyle:#cartoon |
|
41 |
||
1893 | 42 |
FlyByHelp isActive |
43 |
||
44 |
FlyByHelp stop |
|
45 |
FlyByHelp start |
|
46 |
" |
|
1802 | 47 |
! ! |
1536 | 48 |
|
2692 | 49 |
!FlyByHelp class methodsFor:'accessing'! |
50 |
||
51 |
currentlyShownView |
|
2846
e90ba00f9df1
changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents:
2826
diff
changeset
|
52 |
TheOneAndOnlyHelpListener isNil ifTrue:[^ nil]. |
2692 | 53 |
^ TheOneAndOnlyHelpListener currentlyShownView |
2846
e90ba00f9df1
changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents:
2826
diff
changeset
|
54 |
|
e90ba00f9df1
changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents:
2826
diff
changeset
|
55 |
"Modified: / 09-06-2010 / 16:35:48 / cg" |
2692 | 56 |
! ! |
57 |
||
2684 | 58 |
!FlyByHelp methodsFor:'defaults'! |
59 |
||
60 |
flyByHelpTimeoutMillis |
|
61 |
"abort flyby help text generation, if no text can be generated within that |
|
62 |
time delta. This is used to abort long-lasting parsing/scanning/analysis in |
|
63 |
large methods when the mouse is moved over some syntactic constructs, and |
|
64 |
it takes too long to parse... |
|
65 |
The returned time is given in ms" |
|
66 |
||
67 |
^ 300 |
|
68 |
! ! |
|
69 |
||
2392 | 70 |
!FlyByHelp methodsFor:'event handling'! |
1540 | 71 |
|
2474 | 72 |
buttonMotion:buttonAndModifierState x:x y:y view:aView |
2519 | 73 |
aView == currentHelpView ifTrue:[ |
74 |
"/ the help-bubble itself |
|
75 |
^ false |
|
76 |
]. |
|
77 |
||
2518 | 78 |
"/ don't start tooltip, if this view is not active |
3243 | 79 |
"/ does not work, because motion events are reported for the current focus-view, |
80 |
"/ which is always actve. Must check after we have determined the view under the pointer |
|
2518 | 81 |
"/ aView topView isActive ifFalse:[^ false]. |
2477
b009e0b51999
suppress tooltip for inactive (lower) windows
Claus Gittinger <cg@exept.de>
parents:
2474
diff
changeset
|
82 |
|
2474 | 83 |
^ super buttonMotion:buttonAndModifierState x:x y:y view:aView |
1540 | 84 |
! |
85 |
||
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
86 |
buttonPress:button x:x y:y view:aView |
3198 | 87 |
|prevView| |
88 |
||
89 |
"/ hideHelp nils the currentView |
|
90 |
"/ we restore it, so the tooltip is not shown again for this view |
|
91 |
"/ until the mouse really leaves the view |
|
92 |
"/ let's call this the "do-not-show-in-this-view mode" |
|
93 |
prevView := currentView. |
|
2978
4358a9302b95
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2925
diff
changeset
|
94 |
self hideHelp. |
3198 | 95 |
currentView := prevView. |
96 |
||
97 |
^ false |
|
2978
4358a9302b95
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2925
diff
changeset
|
98 |
|
4358a9302b95
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2925
diff
changeset
|
99 |
"Modified: / 23-12-2011 / 20:37:28 / cg" |
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
100 |
! |
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
101 |
|
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
102 |
keyPress:key x:x y:y view:aView |
3216 | 103 |
<resource: #keyboard (#Escape)> |
104 |
||
3198 | 105 |
|prevView| |
106 |
||
2885
a70144d85a81
changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2884
diff
changeset
|
107 |
currentHelpView notNil ifTrue:[ |
2925
352825e1163c
changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
108 |
key == $§ ifTrue:[ |
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
109 |
"/ generate a line suitable for the resources file (a null translation) |
3216 | 110 |
"/ into the clipboard; makes it easy to add missing translations to a .rs file, |
111 |
"/ by pressing paragrapj whenever you see an untranslated helptext |
|
2885
a70144d85a81
changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2884
diff
changeset
|
112 |
aView setClipboardText:(lastHelpText storeString , ' ' , lastHelpText storeString). |
2612 | 113 |
self hideHelp. |
114 |
^ true |
|
115 |
]. |
|
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
116 |
key == #Escape ifTrue:[ |
3198 | 117 |
prevView := currentView. |
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
118 |
self hideHelp. |
3198 | 119 |
currentView := prevView. |
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
120 |
^ true |
2885
a70144d85a81
changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2884
diff
changeset
|
121 |
]. |
3216 | 122 |
(#('Shift' #'Shift_L' #'Shift_R') includes:key) ifTrue:[ |
123 |
"/ do not close on those... |
|
124 |
^ false |
|
125 |
]. |
|
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
126 |
]. |
3198 | 127 |
|
128 |
"/ hideHelp nils the currentView |
|
129 |
"/ we restore it, so the tooltip is not shown again for this view |
|
130 |
"/ until the mouse really leaves the view |
|
131 |
"/ let's call this the "do-not-show-in-this-view mode" |
|
132 |
prevView := currentView. |
|
133 |
self hideHelpIgnoringErrors. |
|
134 |
currentView := prevView. |
|
135 |
||
136 |
^ false |
|
137 |
"/ ^ super keyPress:key x:x y:y view:aView |
|
2884
7d37f5a0719e
changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2878
diff
changeset
|
138 |
|
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
139 |
"Modified (format): / 25-12-2011 / 10:25:23 / cg" |
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
140 |
! |
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
141 |
|
2521
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
142 |
mouseWheelMotion:state x:x y:y amount:amount deltaTime:dTime view:aView |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
143 |
currentHelpView notNil ifTrue:[ |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
144 |
self handleMouseIn:aView x:x y:y. |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
145 |
]. |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
146 |
^ false |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
147 |
! |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
148 |
|
1540 | 149 |
pointerLeave:state view:aView |
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
150 |
aView == currentHelpView ifTrue:[^ true]. |
3198 | 151 |
|
152 |
"/ clear the do-not-show-in-this-view mode (see keyPress) |
|
153 |
"/ (currentHelpView isNil and:[currentView notNil]) ifTrue:[currentView := nil]. |
|
154 |
||
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
155 |
^ super pointerLeave:state view:aView |
1540 | 156 |
! ! |
157 |
||
2392 | 158 |
!FlyByHelp methodsFor:'help texts'! |
1536 | 159 |
|
160 |
helpTextFromModel:aModel view:aView at:aPointOrNil |
|
161 |
"helper: ask aModel for its helpText." |
|
162 |
||
163 |
|text| |
|
164 |
||
165 |
aPointOrNil notNil ifTrue:[ |
|
166 |
(aModel respondsTo:#flyByHelpTextFor:at:) ifTrue:[ |
|
167 |
text := aModel flyByHelpTextFor:aView at:aPointOrNil. |
|
2754 | 168 |
text notNil ifTrue:[^ text]. |
1536 | 169 |
]. |
170 |
]. |
|
2754 | 171 |
(aModel respondsTo:#flyByHelpTextFor:) ifTrue:[ |
172 |
text := aModel flyByHelpTextFor:aView. |
|
173 |
text notNil ifTrue:[^ text]. |
|
1536 | 174 |
]. |
2754 | 175 |
^ nil |
1536 | 176 |
! |
177 |
||
178 |
helpTextFromView:aView at:aPointOrNil |
|
179 |
"helper: ask aView for its helpText." |
|
180 |
||
2754 | 181 |
|text key app| |
1536 | 182 |
|
183 |
aPointOrNil notNil ifTrue:[ |
|
184 |
(aView respondsTo:#flyByHelpTextAt:) ifTrue:[ |
|
185 |
text := aView flyByHelpTextAt:aPointOrNil. |
|
2754 | 186 |
text notNil ifTrue:[^ text]. |
1536 | 187 |
]. |
188 |
]. |
|
2754 | 189 |
(aView respondsTo:#flyByHelpText) ifTrue:[ |
190 |
text := aView flyByHelpText. |
|
191 |
text notNil ifTrue:[^ text]. |
|
192 |
]. |
|
193 |
(aView respondsTo:#helpKey) ifTrue:[ |
|
194 |
key := aView helpKey. |
|
195 |
key notNil ifTrue:[ |
|
196 |
app := aView application. |
|
197 |
app isNil ifTrue:[ |
|
198 |
app := Error handle:[:ex | nil] do:[ aView windowGroup mainGroup application ]. |
|
199 |
]. |
|
200 |
app notNil ifTrue:[ |
|
201 |
^ app flyByHelpTextForKey:key |
|
202 |
]. |
|
203 |
^ aView resources string:key |
|
1536 | 204 |
]. |
205 |
]. |
|
2754 | 206 |
^ nil. |
2392 | 207 |
! ! |
208 |
||
209 |
!FlyByHelp methodsFor:'private'! |
|
1536 | 210 |
|
211 |
hideIfPointerLeft:aView |
|
212 |
"hide help, if the pointer is not in aView" |
|
213 |
||
214 |
|whereOnScreen| |
|
215 |
||
216 |
currentFrame notNil ifTrue:[ |
|
217 |
whereOnScreen := aView graphicsDevice pointerPosition. |
|
218 |
||
219 |
(currentFrame notNil |
|
220 |
and:[(currentFrame insetBy:1@1) containsPoint:whereOnScreen]) ifFalse:[ |
|
221 |
self hideHelp. |
|
222 |
]. |
|
223 |
]. |
|
224 |
||
225 |
"Modified: 28.5.1996 / 20:18:28 / cg" |
|
226 |
! |
|
227 |
||
228 |
initiateHelpFor:aView at:aPointOrNil now:showItNow |
|
229 |
"ask aView for helpText, passing x/y coordinates; |
|
230 |
start a timeout process to display this helpText after some delay; |
|
231 |
Normally used internally, but can also be used by widgets to force |
|
232 |
re-negotiation of the displayed helpText |
|
233 |
(for example in a menu, when the selection changes)" |
|
234 |
||
2679
552847065fb3
car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents:
2651
diff
changeset
|
235 |
|text delayTime now| |
1536 | 236 |
|
237 |
(self interestedIn:aView) ifFalse:[ |
|
238 |
^ self |
|
239 |
]. |
|
240 |
||
2679
552847065fb3
car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents:
2651
diff
changeset
|
241 |
now := Timestamp now. |
552847065fb3
car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents:
2651
diff
changeset
|
242 |
|
2680 | 243 |
"/ do not allow for more than 200 ms to be spent in the |
2679
552847065fb3
car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents:
2651
diff
changeset
|
244 |
"/ helpText gatherer (the codeView parses the code for the variable under the cursor) |
552847065fb3
car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents:
2651
diff
changeset
|
245 |
[ |
2826
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
246 |
Error handle:[:ex | |
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
247 |
('error in flyByhelp: ',ex description) errorPrintCR. |
2901
fed697afcef8
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2900
diff
changeset
|
248 |
"/ ex suspendedContext fullPrintAllOn:Transcript. |
2872
ea7e6fe01727
comment/format in: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2848
diff
changeset
|
249 |
"/ self halt. |
2826
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
250 |
] do:[ |
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
251 |
text := self helpTextFor:aView at:aPointOrNil. |
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
252 |
]. |
2684 | 253 |
] valueWithWatchDog:[ ^ self ] afterMilliseconds:(self flyByHelpTimeoutMillis). |
2679
552847065fb3
car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents:
2651
diff
changeset
|
254 |
|
1536 | 255 |
lastHelpText = text ifTrue:[ |
3228 | 256 |
lastHelpWidget == aView ifTrue:[ |
257 |
self toolTipFollowsMouse ifFalse:[ |
|
258 |
^ self |
|
259 |
] |
|
2392 | 260 |
] |
1536 | 261 |
]. |
262 |
||
263 |
text size > 0 ifTrue:[ |
|
2778 | 264 |
(showItNow not and:[(delayTime := self delayTime) > 0]) ifTrue:[ |
1536 | 265 |
self stopHelpDisplayProcess. |
2392 | 266 |
showProcess := |
267 |
[ |
|
2680 | 268 |
Delay waitForSeconds:delayTime. |
2774
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
269 |
[ |
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
270 |
aView device anyButtonPressed ifFalse:[ |
2777
4cdef981fdb3
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2774
diff
changeset
|
271 |
showProcess := nil. |
2774
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
272 |
self showHelp:text for:aView |
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
273 |
] |
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
274 |
] ensure:[ |
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
275 |
showProcess := nil. |
2680 | 276 |
] |
2392 | 277 |
] forkAt:(Processor userSchedulingPriority + 1). |
1536 | 278 |
] ifFalse:[ |
279 |
self showHelp:text for:aView |
|
280 |
] |
|
1542 | 281 |
] ifFalse:[ |
282 |
self hideHelp |
|
1536 | 283 |
]. |
2872
ea7e6fe01727
comment/format in: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2848
diff
changeset
|
284 |
|
2901
fed697afcef8
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2900
diff
changeset
|
285 |
"Modified: / 22-03-2011 / 19:10:28 / cg" |
1536 | 286 |
! ! |
287 |
||
2392 | 288 |
!FlyByHelp methodsFor:'queries'! |
289 |
||
2692 | 290 |
currentlyShownView |
291 |
^ currentHelpView |
|
292 |
! |
|
293 |
||
2392 | 294 |
toolTipFollowsMouse |
295 |
^ false |
|
296 |
! ! |
|
297 |
||
1768 | 298 |
!FlyByHelp methodsFor:'show & hide help'! |
1536 | 299 |
|
300 |
hideHelp |
|
301 |
"hide the help text" |
|
302 |
||
303 |
|p| |
|
304 |
||
3198 | 305 |
"/ lastHelpText := nil. |
1536 | 306 |
self stopHelpDisplayProcess. |
307 |
||
308 |
currentHelpView notNil ifTrue:[ |
|
309 |
[ |
|
2780 | 310 |
currentHelpView notNil ifTrue:[ |
311 |
currentHelpView unmap. |
|
312 |
currentHelpView destroy. |
|
313 |
currentHelpView := nil. |
|
314 |
currentView := nil. |
|
315 |
] |
|
1536 | 316 |
] valueUninterruptably |
317 |
]. |
|
318 |
currentFrame := nil. |
|
3198 | 319 |
(p := closeProcess) notNil ifTrue:[ |
320 |
closeProcess := nil. |
|
1536 | 321 |
p terminate. |
322 |
] |
|
323 |
||
324 |
"Modified: 28.6.1997 / 14:03:50 / cg" |
|
325 |
! |
|
326 |
||
327 |
showHelp:aHelpText for:view |
|
328 |
"show the help text for aView" |
|
329 |
||
3114 | 330 |
|wg org p v dev helpViewWidth helpViewHeight usableWidth monitorBounds usableHeight| |
1536 | 331 |
|
2781 | 332 |
"/ thisContext fullPrintAllOn:Transcript. |
2651 | 333 |
(wg := view windowGroup) notNil ifTrue:[ |
334 |
wg isInModalLoop ifTrue:[ |
|
335 |
wg isModal ifFalse:[ |
|
336 |
^ self |
|
337 |
]. |
|
2628
03a41945fb37
do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents:
2612
diff
changeset
|
338 |
]. |
03a41945fb37
do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents:
2612
diff
changeset
|
339 |
]. |
03a41945fb37
do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents:
2612
diff
changeset
|
340 |
|
1536 | 341 |
view == currentView ifTrue:[ |
342 |
lastHelpText = aHelpText ifTrue:[ |
|
343 |
^ self |
|
344 |
] |
|
345 |
]. |
|
3228 | 346 |
lastHelpWidget := view. |
1536 | 347 |
|
348 |
lastHelpText := aHelpText. |
|
349 |
||
2780 | 350 |
(p := closeProcess) notNil ifTrue:[ |
351 |
closeProcess := nil. |
|
1536 | 352 |
p terminate. |
353 |
]. |
|
354 |
currentHelpView notNil ifTrue:[ |
|
355 |
self hideHelp |
|
356 |
]. |
|
357 |
||
358 |
org := view originRelativeTo:nil. |
|
359 |
currentFrame := org extent:view extent. |
|
2848 | 360 |
org := org + (view extent // 2). |
1536 | 361 |
|
1677
dc49ab70b762
open helpView on the correcdt device
Claus Gittinger <cg@exept.de>
parents:
1657
diff
changeset
|
362 |
dev := view graphicsDevice. |
1536 | 363 |
|
3241 | 364 |
(wg notNil and:[wg application notNil]) ifTrue:[ |
365 |
v := wg application activeHelpViewFor:aHelpText onDevice:dev |
|
366 |
] ifFalse:[ |
|
367 |
v := ActiveHelpView for:aHelpText onDevice:dev. |
|
368 |
]. |
|
2848 | 369 |
helpViewWidth := v width. |
370 |
helpViewHeight := v height. |
|
1677
dc49ab70b762
open helpView on the correcdt device
Claus Gittinger <cg@exept.de>
parents:
1657
diff
changeset
|
371 |
|
3114 | 372 |
org := dev pointerPosition + (0@18"24"). |
373 |
monitorBounds := dev monitorBoundsAt:org. |
|
374 |
usableWidth := monitorBounds width - 2. |
|
375 |
usableHeight := dev usableHeightAt:org. |
|
376 |
||
377 |
helpViewWidth > usableWidth ifTrue:[v width:(helpViewWidth := usableWidth)]. |
|
378 |
helpViewHeight > usableHeight ifTrue:[v width:(helpViewHeight := usableHeight)]. |
|
379 |
||
380 |
(org x + helpViewWidth) > (monitorBounds left + usableWidth) ifTrue:[ |
|
381 |
org := ((monitorBounds left + usableWidth - helpViewWidth) @ org y). |
|
1536 | 382 |
]. |
3114 | 383 |
(org y + helpViewHeight) > (monitorBounds top + usableHeight) ifTrue:[ |
384 |
org := org x @ (monitorBounds top + usableHeight - helpViewHeight). |
|
1536 | 385 |
]. |
386 |
||
387 |
v origin:org. |
|
388 |
v realize. |
|
389 |
v enableButtonMotionEvents. |
|
390 |
v enableMotionEvents. |
|
391 |
currentHelpView := v. |
|
2392 | 392 |
currentView := view. |
1536 | 393 |
|
2392 | 394 |
self showTime notNil ifTrue:[ |
395 |
closeProcess := [ |
|
1546 | 396 |
[ |
2392 | 397 |
(Delay forSeconds:self showTime) wait. |
398 |
[ |
|
2780 | 399 |
|v| |
400 |
(v := currentHelpView) notNil ifTrue:[ |
|
2392 | 401 |
currentHelpView := nil. |
2780 | 402 |
v unmap. |
403 |
v destroy. |
|
2392 | 404 |
] |
405 |
] valueUninterruptably |
|
406 |
] ifCurtailed:[ |
|
407 |
closeProcess := nil. |
|
408 |
]. |
|
409 |
] newProcess. |
|
410 |
closeProcess priority:(Processor userSchedulingPriority + 1). |
|
411 |
closeProcess resume. |
|
412 |
]. |
|
1536 | 413 |
|
1963
fb6663696d20
removed withCRs in showHelp:
Claus Gittinger <cg@exept.de>
parents:
1893
diff
changeset
|
414 |
"Modified: / 31-08-1995 / 19:20:45 / claus" |
2848 | 415 |
"Modified: / 16-07-2010 / 14:33:13 / cg" |
1536 | 416 |
! |
417 |
||
418 |
stopHelpDisplayProcess |
|
419 |
|p| |
|
420 |
||
2680 | 421 |
(p := showProcess) notNil ifTrue:[ |
422 |
showProcess := nil. |
|
1536 | 423 |
p terminate. |
424 |
]. |
|
425 |
||
426 |
"Created: 28.6.1997 / 14:03:17 / cg" |
|
427 |
! ! |
|
428 |
||
429 |
!FlyByHelp class methodsFor:'documentation'! |
|
430 |
||
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
431 |
version |
3243 | 432 |
^ '$Header: /cvs/stx/stx/libview2/FlyByHelp.st,v 1.58 2013-09-12 08:30:14 cg Exp $' |
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
433 |
! |
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
434 |
|
2754 | 435 |
version_CVS |
3243 | 436 |
^ '$Header: /cvs/stx/stx/libview2/FlyByHelp.st,v 1.58 2013-09-12 08:30:14 cg Exp $' |
1536 | 437 |
! ! |
3114 | 438 |