FlyByHelp.st
changeset 4055 92c2d38634c1
parent 4048 eceffed47e1c
child 4082 f2ffa50dcf0b
equal deleted inserted replaced
4054:6ddcaca12fee 4055:92c2d38634c1
    34  other person.  No title to or ownership of the software is
    34  other person.  No title to or ownership of the software is
    35  hereby transferred.
    35  hereby transferred.
    36 "
    36 "
    37 !
    37 !
    38 
    38 
       
    39 documentation
       
    40 "
       
    41     an instance of me is used to provide tooltips 
       
    42     (sigh: smalltalk was ahead of its time in the early 90's:
       
    43      initially called 'activeHelp', then renamed to 'flyByHelp' 
       
    44      and now commonly known as tooltip).
       
    45 
       
    46     I will watch the mouse movements via an event hook, and determine
       
    47     where the mouse pointer is. Then ask the underlying view about its
       
    48     helpText and display it in a little floating popup view.
       
    49 
       
    50     The hool is installed via:
       
    51      FlyByHelp start
       
    52     and possibly deactivated/uninstalled via:
       
    53      FlyByHelp stop
       
    54 
       
    55     There can be only one FlyByHelp at any time - the start/stop methods
       
    56     assure that.
       
    57 "
       
    58 !
       
    59 
    39 examples
    60 examples
    40 "
    61 "
    41     UserPreferences current toolTipShapeStyle:nil
    62     UserPreferences current toolTipShapeStyle:nil
    42     UserPreferences current toolTipShapeStyle:#cartoon
    63     UserPreferences current toolTipShapeStyle:#cartoon
    43 
    64 
    83     aView == currentHelpView ifTrue:[
   104     aView == currentHelpView ifTrue:[
    84         "/ the help-bubble itself
   105         "/ the help-bubble itself
    85         ^ false
   106         ^ false
    86     ].
   107     ].
    87 
   108 
    88     "/ don't start tooltip, if this view is not active
   109     "/ don't start tooltip, if this view is not active.
    89     "/ does not work, because motion events are reported for the current focus-view,
   110     "/ The following line does not work, because motion events are reported for the current focus-view,
    90     "/ which is always active. Must check after we have determined the view under the pointer
   111     "/ which is always active. Must check after we have determined the view under the pointer
    91     "/      aView topView isActive ifFalse:[^ false].
   112     "/      aView topView isActive ifFalse:[^ false].
    92 
   113 
    93     ^ super buttonMotion:buttonAndModifierState x:x y:y view:aView
   114     ^ super buttonMotion:buttonAndModifierState x:x y:y view:aView
    94 !
   115 !