author | Claus Gittinger <cg@exept.de> |
Tue, 03 Sep 2013 17:23:55 +0200 | |
changeset 3228 | 187a4158a51a |
parent 3220 | 1181c3afbb10 |
child 3241 | 630689dda068 |
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 |
79 |
"/ aView topView isActive ifFalse:[^ false]. |
|
2477
b009e0b51999
suppress tooltip for inactive (lower) windows
Claus Gittinger <cg@exept.de>
parents:
2474
diff
changeset
|
80 |
|
2474 | 81 |
^ super buttonMotion:buttonAndModifierState x:x y:y view:aView |
1540 | 82 |
! |
83 |
||
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
84 |
buttonPress:button x:x y:y view:aView |
3198 | 85 |
|prevView| |
86 |
||
87 |
"/ hideHelp nils the currentView |
|
88 |
"/ we restore it, so the tooltip is not shown again for this view |
|
89 |
"/ until the mouse really leaves the view |
|
90 |
"/ let's call this the "do-not-show-in-this-view mode" |
|
91 |
prevView := currentView. |
|
2978
4358a9302b95
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2925
diff
changeset
|
92 |
self hideHelp. |
3198 | 93 |
currentView := prevView. |
94 |
||
95 |
^ false |
|
2978
4358a9302b95
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2925
diff
changeset
|
96 |
|
4358a9302b95
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2925
diff
changeset
|
97 |
"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
|
98 |
! |
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
99 |
|
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
100 |
keyPress:key x:x y:y view:aView |
3216 | 101 |
<resource: #keyboard (#Escape)> |
102 |
||
3198 | 103 |
|prevView| |
104 |
||
2885
a70144d85a81
changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2884
diff
changeset
|
105 |
currentHelpView notNil ifTrue:[ |
2925
352825e1163c
changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
106 |
key == $§ ifTrue:[ |
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
107 |
"/ generate a line suitable for the resources file (a null translation) |
3216 | 108 |
"/ into the clipboard; makes it easy to add missing translations to a .rs file, |
109 |
"/ 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
|
110 |
aView setClipboardText:(lastHelpText storeString , ' ' , lastHelpText storeString). |
2612 | 111 |
self hideHelp. |
112 |
^ true |
|
113 |
]. |
|
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
114 |
key == #Escape ifTrue:[ |
3198 | 115 |
prevView := currentView. |
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
116 |
self hideHelp. |
3198 | 117 |
currentView := prevView. |
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
118 |
^ true |
2885
a70144d85a81
changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2884
diff
changeset
|
119 |
]. |
3216 | 120 |
(#('Shift' #'Shift_L' #'Shift_R') includes:key) ifTrue:[ |
121 |
"/ do not close on those... |
|
122 |
^ false |
|
123 |
]. |
|
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
124 |
]. |
3198 | 125 |
|
126 |
"/ hideHelp nils the currentView |
|
127 |
"/ we restore it, so the tooltip is not shown again for this view |
|
128 |
"/ until the mouse really leaves the view |
|
129 |
"/ let's call this the "do-not-show-in-this-view mode" |
|
130 |
prevView := currentView. |
|
131 |
self hideHelpIgnoringErrors. |
|
132 |
currentView := prevView. |
|
133 |
||
134 |
^ false |
|
135 |
"/ ^ 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
|
136 |
|
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
137 |
"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
|
138 |
! |
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
139 |
|
2521
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
140 |
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
|
141 |
currentHelpView notNil ifTrue:[ |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
142 |
self handleMouseIn:aView x:x y:y. |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
143 |
]. |
7e51aa294156
care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
144 |
^ false |
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 |
|
1540 | 147 |
pointerLeave:state view:aView |
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
148 |
aView == currentHelpView ifTrue:[^ true]. |
3198 | 149 |
|
150 |
"/ clear the do-not-show-in-this-view mode (see keyPress) |
|
151 |
"/ (currentHelpView isNil and:[currentView notNil]) ifTrue:[currentView := nil]. |
|
152 |
||
2611
f578b9c43a6f
handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
153 |
^ super pointerLeave:state view:aView |
1540 | 154 |
! ! |
155 |
||
2392 | 156 |
!FlyByHelp methodsFor:'help texts'! |
1536 | 157 |
|
158 |
helpTextFromModel:aModel view:aView at:aPointOrNil |
|
159 |
"helper: ask aModel for its helpText." |
|
160 |
||
161 |
|text| |
|
162 |
||
163 |
aPointOrNil notNil ifTrue:[ |
|
164 |
(aModel respondsTo:#flyByHelpTextFor:at:) ifTrue:[ |
|
165 |
text := aModel flyByHelpTextFor:aView at:aPointOrNil. |
|
2754 | 166 |
text notNil ifTrue:[^ text]. |
1536 | 167 |
]. |
168 |
]. |
|
2754 | 169 |
(aModel respondsTo:#flyByHelpTextFor:) ifTrue:[ |
170 |
text := aModel flyByHelpTextFor:aView. |
|
171 |
text notNil ifTrue:[^ text]. |
|
1536 | 172 |
]. |
2754 | 173 |
^ nil |
1536 | 174 |
! |
175 |
||
176 |
helpTextFromView:aView at:aPointOrNil |
|
177 |
"helper: ask aView for its helpText." |
|
178 |
||
2754 | 179 |
|text key app| |
1536 | 180 |
|
181 |
aPointOrNil notNil ifTrue:[ |
|
182 |
(aView respondsTo:#flyByHelpTextAt:) ifTrue:[ |
|
183 |
text := aView flyByHelpTextAt:aPointOrNil. |
|
2754 | 184 |
text notNil ifTrue:[^ text]. |
1536 | 185 |
]. |
186 |
]. |
|
2754 | 187 |
(aView respondsTo:#flyByHelpText) ifTrue:[ |
188 |
text := aView flyByHelpText. |
|
189 |
text notNil ifTrue:[^ text]. |
|
190 |
]. |
|
191 |
(aView respondsTo:#helpKey) ifTrue:[ |
|
192 |
key := aView helpKey. |
|
193 |
key notNil ifTrue:[ |
|
194 |
app := aView application. |
|
195 |
app isNil ifTrue:[ |
|
196 |
app := Error handle:[:ex | nil] do:[ aView windowGroup mainGroup application ]. |
|
197 |
]. |
|
198 |
app notNil ifTrue:[ |
|
199 |
^ app flyByHelpTextForKey:key |
|
200 |
]. |
|
201 |
^ aView resources string:key |
|
1536 | 202 |
]. |
203 |
]. |
|
2754 | 204 |
^ nil. |
2392 | 205 |
! ! |
206 |
||
207 |
!FlyByHelp methodsFor:'private'! |
|
1536 | 208 |
|
209 |
hideIfPointerLeft:aView |
|
210 |
"hide help, if the pointer is not in aView" |
|
211 |
||
212 |
|whereOnScreen| |
|
213 |
||
214 |
currentFrame notNil ifTrue:[ |
|
215 |
whereOnScreen := aView graphicsDevice pointerPosition. |
|
216 |
||
217 |
(currentFrame notNil |
|
218 |
and:[(currentFrame insetBy:1@1) containsPoint:whereOnScreen]) ifFalse:[ |
|
219 |
self hideHelp. |
|
220 |
]. |
|
221 |
]. |
|
222 |
||
223 |
"Modified: 28.5.1996 / 20:18:28 / cg" |
|
224 |
! |
|
225 |
||
226 |
initiateHelpFor:aView at:aPointOrNil now:showItNow |
|
227 |
"ask aView for helpText, passing x/y coordinates; |
|
228 |
start a timeout process to display this helpText after some delay; |
|
229 |
Normally used internally, but can also be used by widgets to force |
|
230 |
re-negotiation of the displayed helpText |
|
231 |
(for example in a menu, when the selection changes)" |
|
232 |
||
2679
552847065fb3
car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents:
2651
diff
changeset
|
233 |
|text delayTime now| |
1536 | 234 |
|
235 |
(self interestedIn:aView) ifFalse:[ |
|
236 |
^ self |
|
237 |
]. |
|
238 |
||
2679
552847065fb3
car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents:
2651
diff
changeset
|
239 |
now := Timestamp now. |
552847065fb3
car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents:
2651
diff
changeset
|
240 |
|
2680 | 241 |
"/ 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
|
242 |
"/ 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
|
243 |
[ |
2826
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
244 |
Error handle:[:ex | |
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
245 |
('error in flyByhelp: ',ex description) errorPrintCR. |
2901
fed697afcef8
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2900
diff
changeset
|
246 |
"/ ex suspendedContext fullPrintAllOn:Transcript. |
2872
ea7e6fe01727
comment/format in: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2848
diff
changeset
|
247 |
"/ self halt. |
2826
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
248 |
] do:[ |
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
249 |
text := self helpTextFor:aView at:aPointOrNil. |
74bd82edee5a
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
250 |
]. |
2684 | 251 |
] 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
|
252 |
|
1536 | 253 |
lastHelpText = text ifTrue:[ |
3228 | 254 |
lastHelpWidget == aView ifTrue:[ |
255 |
self toolTipFollowsMouse ifFalse:[ |
|
256 |
^ self |
|
257 |
] |
|
2392 | 258 |
] |
1536 | 259 |
]. |
260 |
||
261 |
text size > 0 ifTrue:[ |
|
2778 | 262 |
(showItNow not and:[(delayTime := self delayTime) > 0]) ifTrue:[ |
1536 | 263 |
self stopHelpDisplayProcess. |
2392 | 264 |
showProcess := |
265 |
[ |
|
2680 | 266 |
Delay waitForSeconds:delayTime. |
2774
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
267 |
[ |
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
268 |
aView device anyButtonPressed ifFalse:[ |
2777
4cdef981fdb3
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2774
diff
changeset
|
269 |
showProcess := nil. |
2774
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
270 |
self showHelp:text for:aView |
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
271 |
] |
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
272 |
] ensure:[ |
7894ba397774
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
273 |
showProcess := nil. |
2680 | 274 |
] |
2392 | 275 |
] forkAt:(Processor userSchedulingPriority + 1). |
1536 | 276 |
] ifFalse:[ |
277 |
self showHelp:text for:aView |
|
278 |
] |
|
1542 | 279 |
] ifFalse:[ |
280 |
self hideHelp |
|
1536 | 281 |
]. |
2872
ea7e6fe01727
comment/format in: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2848
diff
changeset
|
282 |
|
2901
fed697afcef8
changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents:
2900
diff
changeset
|
283 |
"Modified: / 22-03-2011 / 19:10:28 / cg" |
1536 | 284 |
! ! |
285 |
||
2392 | 286 |
!FlyByHelp methodsFor:'queries'! |
287 |
||
2692 | 288 |
currentlyShownView |
289 |
^ currentHelpView |
|
290 |
! |
|
291 |
||
2392 | 292 |
toolTipFollowsMouse |
293 |
^ false |
|
294 |
! ! |
|
295 |
||
1768 | 296 |
!FlyByHelp methodsFor:'show & hide help'! |
1536 | 297 |
|
298 |
hideHelp |
|
299 |
"hide the help text" |
|
300 |
||
301 |
|p| |
|
302 |
||
3198 | 303 |
"/ lastHelpText := nil. |
1536 | 304 |
self stopHelpDisplayProcess. |
305 |
||
306 |
currentHelpView notNil ifTrue:[ |
|
307 |
[ |
|
2780 | 308 |
currentHelpView notNil ifTrue:[ |
309 |
currentHelpView unmap. |
|
310 |
currentHelpView destroy. |
|
311 |
currentHelpView := nil. |
|
312 |
currentView := nil. |
|
313 |
] |
|
1536 | 314 |
] valueUninterruptably |
315 |
]. |
|
316 |
currentFrame := nil. |
|
3198 | 317 |
(p := closeProcess) notNil ifTrue:[ |
318 |
closeProcess := nil. |
|
1536 | 319 |
p terminate. |
320 |
] |
|
321 |
||
322 |
"Modified: 28.6.1997 / 14:03:50 / cg" |
|
323 |
! |
|
324 |
||
325 |
showHelp:aHelpText for:view |
|
326 |
"show the help text for aView" |
|
327 |
||
3114 | 328 |
|wg org p v dev helpViewWidth helpViewHeight usableWidth monitorBounds usableHeight| |
1536 | 329 |
|
2781 | 330 |
"/ thisContext fullPrintAllOn:Transcript. |
2651 | 331 |
(wg := view windowGroup) notNil ifTrue:[ |
332 |
wg isInModalLoop ifTrue:[ |
|
333 |
wg isModal ifFalse:[ |
|
334 |
^ self |
|
335 |
]. |
|
2628
03a41945fb37
do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents:
2612
diff
changeset
|
336 |
]. |
03a41945fb37
do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents:
2612
diff
changeset
|
337 |
]. |
03a41945fb37
do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents:
2612
diff
changeset
|
338 |
|
1536 | 339 |
view == currentView ifTrue:[ |
340 |
lastHelpText = aHelpText ifTrue:[ |
|
341 |
^ self |
|
342 |
] |
|
343 |
]. |
|
3228 | 344 |
lastHelpWidget := view. |
1536 | 345 |
|
346 |
lastHelpText := aHelpText. |
|
347 |
||
2780 | 348 |
(p := closeProcess) notNil ifTrue:[ |
349 |
closeProcess := nil. |
|
1536 | 350 |
p terminate. |
351 |
]. |
|
352 |
currentHelpView notNil ifTrue:[ |
|
353 |
self hideHelp |
|
354 |
]. |
|
355 |
||
356 |
org := view originRelativeTo:nil. |
|
357 |
currentFrame := org extent:view extent. |
|
2848 | 358 |
org := org + (view extent // 2). |
1536 | 359 |
|
1677
dc49ab70b762
open helpView on the correcdt device
Claus Gittinger <cg@exept.de>
parents:
1657
diff
changeset
|
360 |
dev := view graphicsDevice. |
1536 | 361 |
|
1963
fb6663696d20
removed withCRs in showHelp:
Claus Gittinger <cg@exept.de>
parents:
1893
diff
changeset
|
362 |
v := ActiveHelpView for:aHelpText onDevice:dev. |
2848 | 363 |
helpViewWidth := v width. |
364 |
helpViewHeight := v height. |
|
1677
dc49ab70b762
open helpView on the correcdt device
Claus Gittinger <cg@exept.de>
parents:
1657
diff
changeset
|
365 |
|
3114 | 366 |
org := dev pointerPosition + (0@18"24"). |
367 |
monitorBounds := dev monitorBoundsAt:org. |
|
368 |
usableWidth := monitorBounds width - 2. |
|
369 |
usableHeight := dev usableHeightAt:org. |
|
370 |
||
371 |
helpViewWidth > usableWidth ifTrue:[v width:(helpViewWidth := usableWidth)]. |
|
372 |
helpViewHeight > usableHeight ifTrue:[v width:(helpViewHeight := usableHeight)]. |
|
373 |
||
374 |
(org x + helpViewWidth) > (monitorBounds left + usableWidth) ifTrue:[ |
|
375 |
org := ((monitorBounds left + usableWidth - helpViewWidth) @ org y). |
|
1536 | 376 |
]. |
3114 | 377 |
(org y + helpViewHeight) > (monitorBounds top + usableHeight) ifTrue:[ |
378 |
org := org x @ (monitorBounds top + usableHeight - helpViewHeight). |
|
1536 | 379 |
]. |
380 |
||
381 |
v origin:org. |
|
382 |
v realize. |
|
383 |
v enableButtonMotionEvents. |
|
384 |
v enableMotionEvents. |
|
385 |
currentHelpView := v. |
|
2392 | 386 |
currentView := view. |
1536 | 387 |
|
2392 | 388 |
self showTime notNil ifTrue:[ |
389 |
closeProcess := [ |
|
1546 | 390 |
[ |
2392 | 391 |
(Delay forSeconds:self showTime) wait. |
392 |
[ |
|
2780 | 393 |
|v| |
394 |
(v := currentHelpView) notNil ifTrue:[ |
|
2392 | 395 |
currentHelpView := nil. |
2780 | 396 |
v unmap. |
397 |
v destroy. |
|
2392 | 398 |
] |
399 |
] valueUninterruptably |
|
400 |
] ifCurtailed:[ |
|
401 |
closeProcess := nil. |
|
402 |
]. |
|
403 |
] newProcess. |
|
404 |
closeProcess priority:(Processor userSchedulingPriority + 1). |
|
405 |
closeProcess resume. |
|
406 |
]. |
|
1536 | 407 |
|
1963
fb6663696d20
removed withCRs in showHelp:
Claus Gittinger <cg@exept.de>
parents:
1893
diff
changeset
|
408 |
"Modified: / 31-08-1995 / 19:20:45 / claus" |
2848 | 409 |
"Modified: / 16-07-2010 / 14:33:13 / cg" |
1536 | 410 |
! |
411 |
||
412 |
stopHelpDisplayProcess |
|
413 |
|p| |
|
414 |
||
2680 | 415 |
(p := showProcess) notNil ifTrue:[ |
416 |
showProcess := nil. |
|
1536 | 417 |
p terminate. |
418 |
]. |
|
419 |
||
420 |
"Created: 28.6.1997 / 14:03:17 / cg" |
|
421 |
! ! |
|
422 |
||
423 |
!FlyByHelp class methodsFor:'documentation'! |
|
424 |
||
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
425 |
version |
3228 | 426 |
^ '$Header: /cvs/stx/stx/libview2/FlyByHelp.st,v 1.56 2013-09-03 15:23:55 cg Exp $' |
2979
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
427 |
! |
306456bdfb61
comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
2978
diff
changeset
|
428 |
|
2754 | 429 |
version_CVS |
3228 | 430 |
^ '$Header: /cvs/stx/stx/libview2/FlyByHelp.st,v 1.56 2013-09-03 15:23:55 cg Exp $' |
1536 | 431 |
! ! |
3114 | 432 |