14 "{ Package: 'stx:libtool' }" |
14 "{ Package: 'stx:libtool' }" |
15 |
15 |
16 "{ NameSpace: Smalltalk }" |
16 "{ NameSpace: Smalltalk }" |
17 |
17 |
18 View subclass:#CodeCompletionHelpView |
18 View subclass:#CodeCompletionHelpView |
19 instanceVariableNames:'myView editView delayedCloseAction checkAction' |
19 instanceVariableNames:'myView editView delayedCloseAction checkAction |
|
20 closeOnPointerLeave pointerEntered' |
20 classVariableNames:'' |
21 classVariableNames:'' |
21 poolDictionaries:'' |
22 poolDictionaries:'' |
22 category:'Interface-Help' |
23 category:'Interface-Help' |
23 ! |
24 ! |
24 |
25 |
196 ( #( CursorUp CursorDown Return ) includes:key) ifFalse:[ |
203 ( #( CursorUp CursorDown Return ) includes:key) ifFalse:[ |
197 "/ close soon |
204 "/ close soon |
198 self installDelayedClose. |
205 self installDelayedClose. |
199 ^ true. |
206 ^ true. |
200 ]. |
207 ]. |
201 |
208 self uninstallDelayedClose. |
|
209 |
202 "/ (subViews notNil and:[aView == (subViews firstIfEmpty:nil)]) ifTrue:[ |
210 "/ (subViews notNil and:[aView == (subViews firstIfEmpty:nil)]) ifTrue:[ |
203 "/ self topView destroy |
211 "/ self topView destroy |
204 "/ ]. |
212 "/ ]. |
205 ^ false |
213 ^ false |
206 |
214 |
207 "Created: / 04-08-2018 / 17:00:33 / Claus Gittinger" |
215 "Created: / 04-08-2018 / 17:00:33 / Claus Gittinger" |
208 "Modified: / 08-10-2018 / 08:36:52 / Claus Gittinger" |
216 "Modified: / 08-10-2018 / 08:36:52 / Claus Gittinger" |
209 ! |
217 ! |
210 |
218 |
211 pointerEnter:state x:x y:y view:view |
219 pointerEnter:state x:x y:y view:view |
212 self uninstallDelayedClose. |
220 (view isComponentOf:myView) ifTrue:[ |
|
221 self uninstallDelayedClose. |
|
222 pointerEntered := true. |
|
223 ]. |
213 ^ false |
224 ^ false |
214 |
225 |
215 "Created: / 04-08-2018 / 17:01:39 / Claus Gittinger" |
226 "Created: / 04-08-2018 / 17:01:39 / Claus Gittinger" |
216 ! |
227 ! |
217 |
228 |
218 pointerLeave:state view:view |
229 pointerLeave:state view:view |
219 self installDelayedClose. |
230 (view isComponentOf:myView) ifTrue:[ |
|
231 closeOnPointerLeave ifTrue:[ |
|
232 pointerEntered == true ifTrue:[ |
|
233 pointerEntered := false. |
|
234 self installDelayedClose. |
|
235 ^ false |
|
236 ]. |
|
237 ]. |
|
238 self halt. |
|
239 ]. |
220 ^ false |
240 ^ false |
221 |
241 |
222 "Created: / 04-08-2018 / 16:57:18 / Claus Gittinger" |
242 "Created: / 04-08-2018 / 16:57:18 / Claus Gittinger" |
223 "Modified: / 05-08-2018 / 03:13:46 / Claus Gittinger" |
243 "Modified: / 05-08-2018 / 03:13:46 / Claus Gittinger" |
224 ! |
244 ! |
225 |
245 |
226 uninstallDelayedClose |
246 uninstallDelayedClose |
|
247 closeOnPointerLeave := true. |
227 delayedCloseAction notNil ifTrue:[ |
248 delayedCloseAction notNil ifTrue:[ |
228 Processor removeTimedBlock:delayedCloseAction. |
249 Processor removeTimedBlock:delayedCloseAction. |
229 ]. |
250 ]. |
230 |
251 |
231 "Created: / 05-08-2018 / 03:13:23 / Claus Gittinger" |
252 "Created: / 05-08-2018 / 03:13:23 / Claus Gittinger" |
251 ] |
272 ] |
252 |
273 |
253 "Created: / 14-02-2019 / 15:33:26 / Claus Gittinger" |
274 "Created: / 14-02-2019 / 15:33:26 / Claus Gittinger" |
254 ! |
275 ! |
255 |
276 |
|
277 enableDelegation |
|
278 |helpMenuView| |
|
279 |
|
280 myView notNil ifTrue:[ |
|
281 myView isScrollWrapper ifTrue:[ |
|
282 helpMenuView := myView scrolledView |
|
283 ] ifFalse:[ |
|
284 helpMenuView := myView |
|
285 ]. |
|
286 helpMenuView delegate:self. |
|
287 helpMenuView enableEnterLeaveEvents. |
|
288 helpMenuView enableMotionEvents. |
|
289 helpMenuView enableButtonMotionEvents. |
|
290 helpMenuView enableFocusEvents. |
|
291 ]. |
|
292 ! |
|
293 |
256 initStyle |
294 initStyle |
257 "setup viewStyle specifics" |
295 "setup viewStyle specifics" |
258 |
296 |
259 <resource: #style ( |
297 <resource: #style ( |
260 "/ #'activeHelp.backgroundColor' |
298 "/ #'activeHelp.backgroundColor' |
274 self borderWidth:(styleSheet at:#'activeHelp.borderWidth' default:1). |
312 self borderWidth:(styleSheet at:#'activeHelp.borderWidth' default:1). |
275 |
313 |
276 "Modified: / 26.10.1997 / 17:02:09 / cg" |
314 "Modified: / 26.10.1997 / 17:02:09 / cg" |
277 ! |
315 ! |
278 |
316 |
|
317 initialize |
|
318 super initialize. |
|
319 closeOnPointerLeave := true. |
|
320 pointerEntered := false. |
|
321 ! |
|
322 |
279 realize |
323 realize |
280 self create. |
324 self create. |
281 "/ self computeShape. |
325 "/ self computeShape. |
282 self enableMotionEvents. |
326 self enableDelegation. |
283 self enableButtonMotionEvents. |
|
284 self enableFocusEvents. |
|
285 self subViews do:[:eachView | |
|
286 eachView delegate:self. |
|
287 ]. |
|
288 |
327 |
289 "/ install a watcher to check for the editView being still present |
328 "/ install a watcher to check for the editView being still present |
290 "/ from time to time. |
329 "/ from time to time. |
291 "/ this prevents leftover completion views in case the editView is destroyed |
330 "/ this prevents leftover completion views in case the editView is destroyed |
292 "/ and forgets to tell me... |
331 "/ and forgets to tell me... |