ActiveHelp.st
changeset 3347 f314814a3105
parent 3333 66ff26772ee3
child 3348 b6e8252970c2
equal deleted inserted replaced
3346:c27be735c63a 3347:f314814a3105
   258 !
   258 !
   259 
   259 
   260 isActive
   260 isActive
   261     "return true, if activeHelp is turned on"
   261     "return true, if activeHelp is turned on"
   262 
   262 
   263     ^ TheOneAndOnlyHelpListener notNil
   263     TheOneAndOnlyHelpListener notNil ifTrue:[
       
   264         ((WindowSensor eventListeners ? #()) includesIdentical:TheOneAndOnlyHelpListener) ifTrue:[
       
   265             ^ true
       
   266         ].
       
   267         TheOneAndOnlyHelpListener := nil.
       
   268     ].
       
   269     ^ false.
       
   270 
       
   271     "
       
   272      FlyByHelp isActive
       
   273     "
   264 
   274 
   265     "Modified: 27.4.1996 / 15:07:57 / cg"
   275     "Modified: 27.4.1996 / 15:07:57 / cg"
   266 !
   276 !
   267 
   277 
   268 showTime
   278 showTime
   559             'topview inactive' infoPrintCR
   569             'topview inactive' infoPrintCR
   560         ].
   570         ].
   561         ^ self
   571         ^ self
   562     ].
   572     ].
   563     (self interestedIn:aView) ifFalse:[
   573     (self interestedIn:aView) ifFalse:[
   564         Debugging ifTrue:['not interested' infoPrintCR].
   574         Debugging ifTrue:['not interested 0' infoPrintCR].
   565         ^ self
   575         ^ self
   566     ].
   576     ].
   567 
   577 
   568     Error handle:[:ex |
   578     Error handle:[:ex |
   569         InfoPrinting == true ifTrue:[
   579         InfoPrinting == true ifTrue:[
   604 
   614 
   605 interestedIn:aView
   615 interestedIn:aView
   606     "return true, if I am interested in aView (either listeningForAll,
   616     "return true, if I am interested in aView (either listeningForAll,
   607      or in my list of apps)"
   617      or in my list of apps)"
   608 
   618 
   609     |app aViewsTopView|
   619     |app aViewsTopView device deviceFocusView|
   610 
   620 
   611     aView isNil ifTrue:[^ false].
   621     aView isNil ifTrue:[
       
   622         Debugging ifTrue:['nil view' infoPrintCR].
       
   623         ^ false
       
   624     ].
       
   625 
       
   626 "/    applicationsOrTopViewsWithHelp isEmptyOrNil ifTrue:[
       
   627 "/        Debugging ifTrue:['no apps' infoPrintCR].
       
   628 "/        ^ false
       
   629 "/    ].
       
   630 
       
   631     aViewsTopView := aView topView.
       
   632 
       
   633     "/ if none of the view's components has focus...
       
   634     (device := aViewsTopView graphicsDevice) notNil ifTrue:[
       
   635         (deviceFocusView := device focusView) notNil ifTrue:[
       
   636             deviceFocusView topView ~~ aViewsTopView ifTrue:[
       
   637                 "/ 'for inactive ' infoPrint. aView infoPrintCR.
       
   638                 Debugging ifTrue:['inactive topView' infoPrintCR].
       
   639                 ^ false
       
   640             ].
       
   641         ].
       
   642     ].
   612 
   643 
   613     listeningForAll == true ifTrue:[^ true].
   644     listeningForAll == true ifTrue:[^ true].
   614     applicationsOrTopViewsWithHelp isEmptyOrNil ifTrue:[^ false].
   645 
   615 
       
   616     aViewsTopView := aView topView.
       
   617     (applicationsOrTopViewsWithHelp includesIdentical:aViewsTopView) ifTrue:[^ true].
   646     (applicationsOrTopViewsWithHelp includesIdentical:aViewsTopView) ifTrue:[^ true].
   618     app := aViewsTopView application.
   647     app := aViewsTopView application.
   619     app notNil ifTrue:[
   648     app notNil ifTrue:[
   620         (applicationsOrTopViewsWithHelp includesIdentical:app) ifTrue:[^ true]
   649         (applicationsOrTopViewsWithHelp includesIdentical:app) ifTrue:[^ true]
   621     ].
   650     ].
   775 ! !
   804 ! !
   776 
   805 
   777 !ActiveHelp class methodsFor:'documentation'!
   806 !ActiveHelp class methodsFor:'documentation'!
   778 
   807 
   779 version_CVS
   808 version_CVS
   780     ^ '$Header: /cvs/stx/stx/libview2/ActiveHelp.st,v 1.78 2014-05-16 07:49:59 cg Exp $'
   809     ^ '$Header: /cvs/stx/stx/libview2/ActiveHelp.st,v 1.79 2014-06-14 12:27:57 cg Exp $'
   781 ! !
   810 ! !
   782 
   811 
   783 
   812 
   784 ActiveHelp initialize!
   813 ActiveHelp initialize!