ActiveHelp.st
author Claus Gittinger <cg@exept.de>
Wed, 22 Sep 2010 14:21:41 +0200
changeset 2867 b745ee0a04ac
parent 2783 cb3420e40ed1
child 2879 9f0f872a8f60
permissions -rw-r--r--
comment/format
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
     1
"
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
     3
	      All Rights Reserved
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
     4
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
    11
"
1502
487b55dc68c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    12
"{ Package: 'stx:libview2' }"
487b55dc68c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    13
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
    14
EventListener subclass:#ActiveHelp
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
    15
	instanceVariableNames:'lastHelpText listeningForAll applicationsOrTopViewsWithHelp'
1892
4c38a0c4369b *** empty log message ***
ca
parents: 1768
diff changeset
    16
	classVariableNames:''
216
a5f97668e99a commentary
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    17
	poolDictionaries:''
a5f97668e99a commentary
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    18
	category:'Interface-Help'
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
    19
!
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
    20
1892
4c38a0c4369b *** empty log message ***
ca
parents: 1768
diff changeset
    21
ActiveHelp class instanceVariableNames:'DelayTime ShowTime TheOneAndOnlyHelpListener'
4c38a0c4369b *** empty log message ***
ca
parents: 1768
diff changeset
    22
4c38a0c4369b *** empty log message ***
ca
parents: 1768
diff changeset
    23
"
4c38a0c4369b *** empty log message ***
ca
parents: 1768
diff changeset
    24
 No other class instance variables are inherited by this class.
4c38a0c4369b *** empty log message ***
ca
parents: 1768
diff changeset
    25
"
4c38a0c4369b *** empty log message ***
ca
parents: 1768
diff changeset
    26
!
4c38a0c4369b *** empty log message ***
ca
parents: 1768
diff changeset
    27
338
071f92621e3b oops - catching the terminateSignal is no good idea
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
    28
!ActiveHelp class methodsFor:'documentation'!
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
    29
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    30
copyright
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    31
"
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    32
 COPYRIGHT (c) 1995 by Claus Gittinger
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    33
	      All Rights Reserved
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    34
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    35
 This software is furnished under a license and may be used
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    36
 only in accordance with the terms of that license and with the
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    37
 inclusion of the above copyright notice.   This software may not
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    38
 be provided or otherwise made available to, or used by, any
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    39
 other person.  No title to or ownership of the software is
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    40
 hereby transferred.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    41
"
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    42
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
    43
!
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
    44
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
    45
documentation
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
    46
"
98
claus
parents: 97
diff changeset
    47
    The active help listener.
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
    48
98
claus
parents: 97
diff changeset
    49
    The one and only instance of myself intercepts incoming mouse & keyboard 
claus
parents: 97
diff changeset
    50
    events for the display device, being especially interested in view-enter/
636
446b52f2c603 comments
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
    51
    leave events. When such an event arrives, it asks the corresponding view
98
claus
parents: 97
diff changeset
    52
    or its model for a help message and display it via an ActiveHelpView.
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
    53
    (actually, the view is first asked if it would like to display it itself
636
446b52f2c603 comments
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
    54
     - for example, in some information-view).
446b52f2c603 comments
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
    55
446b52f2c603 comments
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
    56
    The query for the helpText is repeated along the views superView chain, 
446b52f2c603 comments
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
    57
    until any model or view returns a nonNil answer for the #helpTextFor:at 
446b52f2c603 comments
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
    58
    or #helpTextFor message.
100
claus
parents: 98
diff changeset
    59
98
claus
parents: 97
diff changeset
    60
    All I need for automatic help is some model/view/applicationModel along
claus
parents: 97
diff changeset
    61
    the superview chain of the entered component, which responds to the
claus
parents: 97
diff changeset
    62
    #helpTextFor: message with a non-nil (string-) answer.
claus
parents: 97
diff changeset
    63
    I close down the help view after a while, if a key is pressed or the mouse
claus
parents: 97
diff changeset
    64
    moved to another view.
100
claus
parents: 98
diff changeset
    65
claus
parents: 98
diff changeset
    66
    Who should provide the helpText:
claus
parents: 98
diff changeset
    67
221
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    68
        the best place is the application object (an instance of ApplicationModel)
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    69
        or the topView, if its a derived class of StandardSystemView.
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    70
        This should know about its components and return the string
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    71
        when asked via #helpTextFor:aComponent.
330
d7ce98930ad3 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 297
diff changeset
    72
        See examples in FileBrowser, Launcher etc.
100
claus
parents: 98
diff changeset
    73
claus
parents: 98
diff changeset
    74
    Be aware, that for applicationModels, there must be a link from the
claus
parents: 98
diff changeset
    75
    topView to this applicationModel 
claus
parents: 98
diff changeset
    76
    (set via: aTopView application:anApplicationModel)
claus
parents: 98
diff changeset
    77
    otherwise, the helpManager has no means of finding the application which
claus
parents: 98
diff changeset
    78
    corresponds to a view.
claus
parents: 98
diff changeset
    79
claus
parents: 98
diff changeset
    80
    Who should display the helpText:
claus
parents: 98
diff changeset
    81
221
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    82
        by default, the helpListener opens a little popup view, which displays the
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    83
        returned help message. However, a nice trick which can be used by applications
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    84
        is to create an infoLabel as a subview of the topFrame (a la windows)
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    85
        and display the text right in the #helpTextFor: method. To cheat the
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    86
        help listener, this method should then return nil, to keep it silent.
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    87
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    88
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
    89
    Usage:
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
    90
        If help is to be shown for all views (as enabled by the launchers help menu),
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
    91
        use 'ActiveHelp start' and 'ActiveHelp stop'.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
    92
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
    93
        Individual apps may enable/disable active help for themself by:
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
    94
        'ActiveHelp startFor:app' or 'ActiveHelp stopFor:app', passing either
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
    95
        the topView or the topViews application as argument.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
    96
        This is usually done by applications which want to show contextHelp in
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
    97
        some infoView.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
    98
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
    99
        
221
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   100
    [author:]
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   101
        Claus Gittinger
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   102
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   103
    [start with:]
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   104
        ActiveHelp start
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   105
        ActiveHelp stop
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   106
221
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   107
    [See also:]
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   108
        ActiveHelpView
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   109
        WindowGroup WindowEvent
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   110
        ApplicationModel StandardSystemView
100
claus
parents: 98
diff changeset
   111
"
claus
parents: 98
diff changeset
   112
!
claus
parents: 98
diff changeset
   113
claus
parents: 98
diff changeset
   114
examples
claus
parents: 98
diff changeset
   115
"
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   116
  Active Help for a single view
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   117
  or app (whatever the global settings are):
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   118
  Can be initiated by an app when its opened.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   119
                                                                        [exBegin]
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   120
        |app top myAppClass|
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   121
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   122
        Class withoutUpdatingChangesDo:[
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   123
            myAppClass := ApplicationModel 
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   124
                            subclass:#'Demos::DemoApp'
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   125
                            instanceVariableNames:''
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   126
                            classVariableNames:''
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   127
                            poolDictionaries:''
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   128
                            category:'demos'.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   129
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   130
            myAppClass 
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   131
                compile:'helpTextFor:aView    Transcript showCR:''hello''. ^ ''this is some helpText'''.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   132
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   133
        ].
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   134
        app := myAppClass new.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   135
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   136
        top := StandardSystemView new.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   137
        top extent:300@100.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   138
        top application:app.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   139
        top open.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   140
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   141
        ActiveHelp startFor:app.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   142
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   143
        Class withoutUpdatingChangesDo:[
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   144
            myAppClass removeFromSystem
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   145
        ]
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   146
                                                                        [exEnd]
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   147
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   148
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   149
  Active Help (for all views):
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   150
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   151
    (make certain that activeHelp is turned on ...
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   152
     ... otherwise, you will see nothing)
100
claus
parents: 98
diff changeset
   153
claus
parents: 98
diff changeset
   154
    the following example uses a Plug as a model replacement.
claus
parents: 98
diff changeset
   155
    In concrete application, you would create a method to implement the helpText
claus
parents: 98
diff changeset
   156
    query message.
227
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   157
                                                                        [exBegin]
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   158
        |app top button1 button2|
100
claus
parents: 98
diff changeset
   159
227
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   160
        app := Plug new.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   161
        app respondTo:#helpTextFor:
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   162
                 with:[:view | 
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   163
                               view == button1 ifTrue:[
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   164
                                 'this is button1'
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   165
                               ] ifFalse:[
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   166
                                 view == button2 ifTrue:[
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   167
                                   'some help for button2'
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   168
                                 ] ifFalse:[
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   169
                                   nil
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   170
                                 ]
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   171
                               ]
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   172
                      ].
100
claus
parents: 98
diff changeset
   173
227
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   174
        top := StandardSystemView new.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   175
        top extent:300@100.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   176
        button1 := Button label:'b1' in:top.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   177
        button1 origin:0.0@0.0 corner:0.5@30. 
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   178
        button2 := Button label:'b2' in:top.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   179
        button2 origin:0.5@0.0 corner:1.0@30.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   180
        top model:app. '<-- normally this would be: top application:app'.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   181
        top open
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   182
                                                                        [exEnd]
100
claus
parents: 98
diff changeset
   183
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   184
    (make certain that activeHelp is turned on ...
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   185
     ... otherwise, you will see nothing)
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   186
227
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   187
    alternatively, display of the helpMessage in a local, private view:
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   188
                                                                        [exBegin]
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   189
        |app top button1 button2 infoView|
100
claus
parents: 98
diff changeset
   190
227
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   191
        app := Plug new.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   192
        app respondTo:#helpTextFor:
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   193
                 with:[:view | infoView label:'info ...'.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   194
                               view == button1 ifTrue:[
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   195
                                 infoView label:'this is button1'
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   196
                               ].
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   197
                               view == button2 ifTrue:[
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   198
                                 infoView label:'some help for button2'
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   199
                               ].
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   200
                               nil
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   201
                      ].
100
claus
parents: 98
diff changeset
   202
227
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   203
        top := StandardSystemView new.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   204
        top extent:300@100.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   205
        button1 := Button label:'b1' in:top.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   206
        button1 origin:0.0@0.0 corner:0.5@30. 
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   207
        button2 := Button label:'b2' in:top.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   208
        button2 origin:0.5@0.0 corner:1.0@30.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   209
        infoView := Label label:'info ...' in:top.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   210
        infoView level:-1; origin:0.0@1.0 corner:1.0@1.0.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   211
        infoView topInset:(infoView preferredExtent y negated - 3);
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   212
                 leftInset:3; 
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   213
                 rightInset:3; 
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   214
                 bottomInset:3;
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   215
                 adjust:#left.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   216
        top model:app. '<-- normally this would be: top application:app'.
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   217
        top open
3f18af678ac9 examples for docViewer
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   218
                                                                        [exEnd]
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   219
"
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   220
! !
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   221
338
071f92621e3b oops - catching the terminateSignal is no good idea
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   222
!ActiveHelp class methodsFor:'initialization'!
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   223
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   224
initialize
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   225
    "set default delay & help-display times"
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   226
1657
447db4aae998 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1591
diff changeset
   227
    ShowTime := 10.
447db4aae998 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1591
diff changeset
   228
    DelayTime := 0.4.
92
claus
parents: 59
diff changeset
   229
claus
parents: 59
diff changeset
   230
    "
claus
parents: 59
diff changeset
   231
     ActiveHelp initialize
claus
parents: 59
diff changeset
   232
    "
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   234
    "Modified: 27.4.1996 / 15:07:27 / cg"
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   235
! !
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   236
633
5d162347fac8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   237
!ActiveHelp class methodsFor:'queries'!
100
claus
parents: 98
diff changeset
   238
632
844b1aaf3eeb provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   239
currentHelpListener
844b1aaf3eeb provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   240
    "return the activeHelp listener if activeHelp is turned on, nil otherwise"
844b1aaf3eeb provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   241
844b1aaf3eeb provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   242
    ^ TheOneAndOnlyHelpListener
844b1aaf3eeb provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   243
844b1aaf3eeb provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   244
    "Created: 28.6.1997 / 13:59:44 / cg"
844b1aaf3eeb provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   245
!
844b1aaf3eeb provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   246
1892
4c38a0c4369b *** empty log message ***
ca
parents: 1768
diff changeset
   247
delayTime
2391
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   248
    ^ DelayTime ? 0.4
1892
4c38a0c4369b *** empty log message ***
ca
parents: 1768
diff changeset
   249
!
4c38a0c4369b *** empty log message ***
ca
parents: 1768
diff changeset
   250
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   251
isActive
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   252
    "return true, if activeHelp is turned on"
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   253
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   254
    ^ TheOneAndOnlyHelpListener notNil
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   255
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   256
    "Modified: 27.4.1996 / 15:07:57 / cg"
1892
4c38a0c4369b *** empty log message ***
ca
parents: 1768
diff changeset
   257
!
4c38a0c4369b *** empty log message ***
ca
parents: 1768
diff changeset
   258
4c38a0c4369b *** empty log message ***
ca
parents: 1768
diff changeset
   259
showTime
2391
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   260
    ^ ShowTime ? 10
633
5d162347fac8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   261
! !
5d162347fac8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   262
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   263
!ActiveHelp class methodsFor:'start & stop'!
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   264
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   265
start
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   266
    "start activeHelp for all apps"
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   267
2391
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   268
    TheOneAndOnlyHelpListener notNil ifTrue:[
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   269
        TheOneAndOnlyHelpListener stop.    
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   270
        TheOneAndOnlyHelpListener := nil.    
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   271
    ].
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   272
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   273
    TheOneAndOnlyHelpListener isNil ifTrue:[
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   274
        TheOneAndOnlyHelpListener := self new.
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   275
    ].
2391
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   276
    TheOneAndOnlyHelpListener start.
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   277
    ^ TheOneAndOnlyHelpListener
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   278
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   279
    "
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   280
     ActiveHelp start
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   281
     FlyByHelp start
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   282
    "
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   283
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   284
    "Modified: / 26.10.1997 / 23:16:54 / cg"
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   285
!
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   286
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   287
startFor:anApplicationOrTopView
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   288
    "start activeHelp for a single app"
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   289
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   290
    TheOneAndOnlyHelpListener isNil ifTrue:[
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   291
        TheOneAndOnlyHelpListener := self new.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   292
    ].
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   293
    TheOneAndOnlyHelpListener listenFor:anApplicationOrTopView
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   294
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   295
    "Modified: / 26.10.1997 / 23:17:05 / cg"
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   296
!
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   297
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   298
stop
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   299
    "stop activeHelp for all (except for individual apps)"
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   300
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   301
    TheOneAndOnlyHelpListener notNil ifTrue:[
2391
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   302
        TheOneAndOnlyHelpListener stop.
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   303
        TheOneAndOnlyHelpListener := nil.
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   304
    ].
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   305
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   306
    "
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   307
     ActiveHelp stop
1543
95c5048dd99a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1541
diff changeset
   308
     FlyByHelp stop
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   309
    "
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   310
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   311
    "Modified: / 26.10.1997 / 23:18:58 / cg"
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   312
!
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   313
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   314
stopFor:anAppOrTopView
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   315
    "stop activeHelp for a single app"
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   316
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   317
    TheOneAndOnlyHelpListener notNil ifTrue:[
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   318
        TheOneAndOnlyHelpListener unlistenFor:anAppOrTopView.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   319
    ].
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   320
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   321
    "Modified: / 26.10.1997 / 23:12:55 / cg"
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   322
    "Created: / 26.10.1997 / 23:18:41 / cg"
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   323
! !
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   324
338
071f92621e3b oops - catching the terminateSignal is no good idea
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   325
!ActiveHelp class methodsFor:'times'!
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   326
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   327
delayTime:numberOfSeconds
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   328
    "set the delay (the time, the cursor has to be in the view
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   329
     before help is shown). The default is 2 seconds."
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   330
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   331
    DelayTime := numberOfSeconds
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   332
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   333
    "
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   334
     ActiveHelp delayTime:0.5
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   335
     ActiveHelp delayTime:2
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   336
     ActiveHelp delayTime:10
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   337
    "
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   338
!
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   339
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   340
showTime:numberOfSeconds
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   341
    "set the number of seconds, a help messages is to be shown.
2391
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   342
     The default is 10 seconds."
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   343
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   344
    ShowTime := numberOfSeconds
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   345
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   346
    "
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   347
     ActiveHelp showTime:10
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   348
     ActiveHelp showTime:99999 
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   349
     ActiveHelp showTime:30
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   350
    "
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   351
! !
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   352
2391
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   353
!ActiveHelp methodsFor:'event handling'!
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   354
2473
66754ea64440 code cleanup (arg-names)
Claus Gittinger <cg@exept.de>
parents: 2391
diff changeset
   355
buttonMotion:buttonAndModifierState x:x y:y view:aView
1657
447db4aae998 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1591
diff changeset
   356
    "handle motion events - prepare to show help"
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   357
2782
79eb7b58118e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
   358
    |realViewUnderCursor realP|
79eb7b58118e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
   359
2473
66754ea64440 code cleanup (arg-names)
Claus Gittinger <cg@exept.de>
parents: 2391
diff changeset
   360
    buttonAndModifierState == 0 ifTrue:[
2783
cb3420e40ed1 changed: #buttonMotion:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2782
diff changeset
   361
"/        realViewUnderCursor := aView device viewFromPoint:(aView pointerPosition).
cb3420e40ed1 changed: #buttonMotion:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2782
diff changeset
   362
"/        realP := aView device translatePoint:(x@y) fromView:aView toView:realViewUnderCursor.
cb3420e40ed1 changed: #buttonMotion:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2782
diff changeset
   363
"/        self handleMouseIn:realViewUnderCursor x:realP x y:realP y.
cb3420e40ed1 changed: #buttonMotion:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2782
diff changeset
   364
        self handleMouseIn:aView x:x y:y.
1948
33eb423a6fd3 only act when no mouse-button is pressed
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
   365
    ].
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   366
    ^ false
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   367
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   368
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   369
buttonPress:state x:x y:y view:view
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   370
    "unconditionally hide the help view"
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   371
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   372
    self hideHelpIgnoringErrors.
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   373
    ^ false
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   374
1011
53514f2c18a7 also ask for helpTextAt:, when a motionEvent arrives.
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   375
    "Modified: / 28.7.1998 / 02:52:00 / cg"
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   376
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   377
2688
733df1ff38b5 category change
Claus Gittinger <cg@exept.de>
parents: 2685
diff changeset
   378
handleMouseIn:aView x:x y:y
733df1ff38b5 category change
Claus Gittinger <cg@exept.de>
parents: 2685
diff changeset
   379
    "handle motion events - if the mousepointer left the 
733df1ff38b5 category change
Claus Gittinger <cg@exept.de>
parents: 2685
diff changeset
   380
     previous helped view, hide the help"
733df1ff38b5 category change
Claus Gittinger <cg@exept.de>
parents: 2685
diff changeset
   381
2779
b608ded19ff2 changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   382
    (self interestedIn:aView) ifFalse:[^ self].
b608ded19ff2 changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   383
2688
733df1ff38b5 category change
Claus Gittinger <cg@exept.de>
parents: 2685
diff changeset
   384
    Error handle:[:ex |
2779
b608ded19ff2 changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   385
        '---------------------' infoPrintCR.
2688
733df1ff38b5 category change
Claus Gittinger <cg@exept.de>
parents: 2685
diff changeset
   386
        ex description infoPrintCR.
733df1ff38b5 category change
Claus Gittinger <cg@exept.de>
parents: 2685
diff changeset
   387
        ex suspendedContext fullPrintAll.
733df1ff38b5 category change
Claus Gittinger <cg@exept.de>
parents: 2685
diff changeset
   388
        ex return
733df1ff38b5 category change
Claus Gittinger <cg@exept.de>
parents: 2685
diff changeset
   389
    ] do:[
733df1ff38b5 category change
Claus Gittinger <cg@exept.de>
parents: 2685
diff changeset
   390
        |sensor|
733df1ff38b5 category change
Claus Gittinger <cg@exept.de>
parents: 2685
diff changeset
   391
2779
b608ded19ff2 changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   392
"/        self stopHelpDisplayProcess.
b608ded19ff2 changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   393
        self hideIfPointerLeft:aView.
2688
733df1ff38b5 category change
Claus Gittinger <cg@exept.de>
parents: 2685
diff changeset
   394
2779
b608ded19ff2 changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   395
        "/ check again, in case the stop/hide changed something...
b608ded19ff2 changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   396
        (self interestedIn:aView) ifFalse:[
b608ded19ff2 changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   397
            ^ self
b608ded19ff2 changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   398
        ].
2688
733df1ff38b5 category change
Claus Gittinger <cg@exept.de>
parents: 2685
diff changeset
   399
2779
b608ded19ff2 changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   400
        "/ if there is a sensor, let the view do it itself (in its process)
2782
79eb7b58118e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
   401
        (self targetViewInitiatesHelpViaSensor
79eb7b58118e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
   402
        and:[ (sensor := aView sensor) notNil ])
79eb7b58118e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
   403
        ifTrue:[
79eb7b58118e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
   404
            sensor flushEventsFor:self withType:#initiateHelpFor:at:.
79eb7b58118e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
   405
            sensor 
79eb7b58118e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
   406
                pushUserEvent:#initiateHelpFor:at: for:self 
79eb7b58118e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
   407
                withArguments:(Array with:aView with:(x @ y)).
2779
b608ded19ff2 changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   408
        ] ifFalse:[
b608ded19ff2 changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   409
            self initiateHelpFor:aView at:(x @ y).
b608ded19ff2 changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   410
        ]
2688
733df1ff38b5 category change
Claus Gittinger <cg@exept.de>
parents: 2685
diff changeset
   411
    ].
733df1ff38b5 category change
Claus Gittinger <cg@exept.de>
parents: 2685
diff changeset
   412
!
733df1ff38b5 category change
Claus Gittinger <cg@exept.de>
parents: 2685
diff changeset
   413
1591
4e75531ffacf checkin from browser
tm
parents: 1549
diff changeset
   414
keyPress:key x:x y:y view:view
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   415
    "unconditionally hide the help view"
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   416
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   417
    self hideHelpIgnoringErrors.
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   418
    ^ false
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   419
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   420
    "Modified: 27.4.1996 / 15:09:57 / cg"
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   421
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   422
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   423
pointerEnter:state x:x y:y view:aView
1657
447db4aae998 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1591
diff changeset
   424
    "handle pointer entering a view; prepare to show help"
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   425
1948
33eb423a6fd3 only act when no mouse-button is pressed
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
   426
    state == 0 ifTrue:[
33eb423a6fd3 only act when no mouse-button is pressed
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
   427
        self handleMouseIn:aView x:x y:y.
33eb423a6fd3 only act when no mouse-button is pressed
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
   428
    ].    
1657
447db4aae998 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1591
diff changeset
   429
    ^ false
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   430
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   431
2371
4ab6c8c7bc03 flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents: 2130
diff changeset
   432
pointerLeave:state view:aView
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   433
    "handle pointer leaving a view; hide help text"
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   434
2371
4ab6c8c7bc03 flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents: 2130
diff changeset
   435
    |sensor|
4ab6c8c7bc03 flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents: 2130
diff changeset
   436
4ab6c8c7bc03 flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents: 2130
diff changeset
   437
    sensor := aView sensor.
4ab6c8c7bc03 flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents: 2130
diff changeset
   438
    sensor notNil ifTrue:[
4ab6c8c7bc03 flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents: 2130
diff changeset
   439
        sensor flushEventsFor:self withType:#initiateHelpFor:at:.
4ab6c8c7bc03 flush enqueued help-activation event when we leave a view
Claus Gittinger <cg@exept.de>
parents: 2130
diff changeset
   440
    ].
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   441
    self hideHelpIgnoringErrors.
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   442
    ^ false
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   443
! !
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   444
2391
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   445
!ActiveHelp methodsFor:'help texts'!
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   446
2130
31edece2051b care for transformations.
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   447
helpTextFor:aView at:aDevicePointOrNil 
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   448
    "retrieve helptext for aView as a string; 
100
claus
parents: 98
diff changeset
   449
     walk along the views superView chain,
claus
parents: 98
diff changeset
   450
     asking models and views encountered while walking.
claus
parents: 98
diff changeset
   451
     The first one who understands and returns a nonNil answer to the
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   452
     #helpTextFor:at: or #helpTextFor: message ends this search and the
100
claus
parents: 98
diff changeset
   453
     returned string is returned."
claus
parents: 98
diff changeset
   454
2130
31edece2051b care for transformations.
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   455
    |model app1 app2 text v sv topView domainPointOrNil|
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   456
2130
31edece2051b care for transformations.
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   457
    aView transformation notNil ifTrue:[
31edece2051b care for transformations.
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   458
        domainPointOrNil := aView transformation applyInverseTo:aDevicePointOrNil.
31edece2051b care for transformations.
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   459
    ] ifFalse:[
31edece2051b care for transformations.
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   460
        domainPointOrNil := aDevicePointOrNil.
31edece2051b care for transformations.
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   461
    ].
31edece2051b care for transformations.
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   462
31edece2051b care for transformations.
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   463
    text := self helpTextFromView:aView at:domainPointOrNil.
2076
5a9d0932133b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   464
    text notNil ifTrue:[ ^ text ].
5a9d0932133b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   465
1549
1b5274878f87 care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents: 1543
diff changeset
   466
    ((aView respondsTo:#application)
1b5274878f87 care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents: 1543
diff changeset
   467
    and:[ (app1 := aView application) notNil ]) ifTrue:[
2130
31edece2051b care for transformations.
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   468
        text := self helpTextFromModel:app1 view:aView at:domainPointOrNil.
1549
1b5274878f87 care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents: 1543
diff changeset
   469
        text notNil ifTrue:[ ^ text ].
1b5274878f87 care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents: 1543
diff changeset
   470
    ] ifFalse:[
1b5274878f87 care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents: 1543
diff changeset
   471
        "/ old style (i.e. StandardSystemView ...)
1b5274878f87 care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents: 1543
diff changeset
   472
        topView := aView topView.
1b5274878f87 care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents: 1543
diff changeset
   473
        (topView notNil and:[topView ~~ aView]) ifTrue:[
2130
31edece2051b care for transformations.
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   474
            text := self helpTextFromModel:topView view:aView at:domainPointOrNil.
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   475
            text notNil ifTrue:[ ^ text ].
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   476
        ]
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   477
    ].
1549
1b5274878f87 care for oldStyle views (StdSysViews)
Claus Gittinger <cg@exept.de>
parents: 1543
diff changeset
   478
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   479
    (model := aView model) notNil ifTrue:[
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   480
        model ~~ app1 ifTrue:[
2130
31edece2051b care for transformations.
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   481
            text := self helpTextFromModel:model view:aView at:domainPointOrNil.
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   482
            text notNil ifTrue:[ ^ text ].
1502
487b55dc68c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   483
        ].
1011
53514f2c18a7 also ask for helpTextAt:, when a motionEvent arrives.
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   484
    ].
2130
31edece2051b care for transformations.
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   485
    text := self helpTextFromView:aView at:domainPointOrNil.
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   486
    text notNil ifTrue:[ ^ text ].
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   487
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   488
    "walk up the chain - maybe someone knows about its subview ..."
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   489
    v := aView.
1502
487b55dc68c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   490
    [
487b55dc68c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   491
        (sv := v container) notNil
487b55dc68c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   492
    ] whileTrue:[
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   493
        (model := sv model) notNil ifTrue:[
2130
31edece2051b care for transformations.
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   494
            text := self helpTextFromModel:model view:aView at:domainPointOrNil.
1502
487b55dc68c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   495
            text notNil ifTrue:[ ^ text ].
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   496
        ].
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   497
        text := self helpTextFromView:sv at:nil.
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   498
        text notNil ifTrue:[ ^ text ].
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   499
        v := sv
602
b1ac53a44327 application and help
ca
parents: 596
diff changeset
   500
    ].
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   501
100
claus
parents: 98
diff changeset
   502
    (v notNil and:[v respondsTo:#application]) ifTrue:[
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   503
        (app2 := v application) notNil ifTrue:[
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   504
            (app2 ~~ app1) ifTrue:[
2130
31edece2051b care for transformations.
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   505
                text := self helpTextFromModel:app2 view:aView at:domainPointOrNil.
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   506
                text notNil ifTrue:[ ^ text ].
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   507
            ]
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   508
        ]
100
claus
parents: 98
diff changeset
   509
    ].
claus
parents: 98
diff changeset
   510
    (v notNil and:[v respondsTo:#model]) ifTrue:[
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   511
        (model := v model) notNil ifTrue:[
2130
31edece2051b care for transformations.
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   512
            text := self helpTextFromModel:model view:aView at:domainPointOrNil.
1502
487b55dc68c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   513
            text notNil ifTrue:[ ^ text ].
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   514
        ]
100
claus
parents: 98
diff changeset
   515
    ].
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   516
    ^ nil
100
claus
parents: 98
diff changeset
   517
728
9f417e396d4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
   518
    "Modified: / 31.8.1995 / 20:38:00 / claus"
1011
53514f2c18a7 also ask for helpTextAt:, when a motionEvent arrives.
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   519
    "Modified: / 28.7.1998 / 01:47:27 / cg"
100
claus
parents: 98
diff changeset
   520
!
claus
parents: 98
diff changeset
   521
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   522
helpTextFromModel:aModel view:aView at:aPointOrNil 
1502
487b55dc68c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   523
    "helper: ask aModel for its helpText."
487b55dc68c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   524
1996
5b82d14ebe97 *** empty log message ***
ca
parents: 1957
diff changeset
   525
    |text text2|
1502
487b55dc68c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   526
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   527
    aPointOrNil notNil ifTrue:[
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   528
        (aModel respondsTo:#helpTextFor:at:) ifTrue:[
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   529
            text := aModel helpTextFor:aView at:aPointOrNil.
2076
5a9d0932133b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   530
            text notNil ifTrue:[^ text].
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   531
        ].
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   532
    ].
2076
5a9d0932133b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   533
    (aModel respondsTo:#helpTextFor:) ifTrue:[
5a9d0932133b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   534
        text := aModel helpTextFor:aView.
2685
9b6fd90dc9e2 changed #helpTextFromModel:view:at:
Claus Gittinger <cg@exept.de>
parents: 2473
diff changeset
   535
        "/ cg: I dont understand this...
9b6fd90dc9e2 changed #helpTextFromModel:view:at:
Claus Gittinger <cg@exept.de>
parents: 2473
diff changeset
   536
"/        text notNil ifTrue:[
9b6fd90dc9e2 changed #helpTextFromModel:view:at:
Claus Gittinger <cg@exept.de>
parents: 2473
diff changeset
   537
"/            text2 := self helpTextFromView:aView at:aPointOrNil.
9b6fd90dc9e2 changed #helpTextFromModel:view:at:
Claus Gittinger <cg@exept.de>
parents: 2473
diff changeset
   538
"/            text2 notNil ifTrue:[ ^ text2 ].
9b6fd90dc9e2 changed #helpTextFromModel:view:at:
Claus Gittinger <cg@exept.de>
parents: 2473
diff changeset
   539
"/        ].
1502
487b55dc68c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   540
    ].
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   541
    ^ text
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   542
!
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   543
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   544
helpTextFromView:aView at:aPointOrNil 
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   545
    "helper: ask aView for its helpText."
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   546
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   547
    |text|
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   548
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   549
    aPointOrNil notNil ifTrue:[
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   550
        (aView respondsTo:#helpTextAt:) ifTrue:[
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   551
            text := aView helpTextAt:aPointOrNil.
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   552
        ].
1502
487b55dc68c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   553
    ].
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   554
    text isNil ifTrue:[
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   555
        (aView respondsTo:#helpText) ifTrue:[
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   556
            text := aView helpText.
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   557
        ].
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   558
    ].
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   559
    ^ text.
2391
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   560
! !
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   561
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   562
!ActiveHelp methodsFor:'private'!
1502
487b55dc68c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   563
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   564
hideIfPointerLeft:aView
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   565
    "hide help, if the pointer is not in aView"
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   566
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   567
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   568
interestedIn:aView
1033
3a56ba930052 care for nil view passed to #interestedIn.
Claus Gittinger <cg@exept.de>
parents: 1019
diff changeset
   569
    "return true, if I am interested in aView (either listeningForAll,
3a56ba930052 care for nil view passed to #interestedIn.
Claus Gittinger <cg@exept.de>
parents: 1019
diff changeset
   570
     or in my list of apps)"
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   571
1106
414b7cfe57b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
   572
    |app aViewsTopView|
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   573
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   574
    aView isNil ifTrue:[^ false].
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   575
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   576
    listeningForAll == true ifTrue:[^ true].
1957
6b2c4df57d49 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1948
diff changeset
   577
    applicationsOrTopViewsWithHelp isEmptyOrNil ifTrue:[^ false].
1033
3a56ba930052 care for nil view passed to #interestedIn.
Claus Gittinger <cg@exept.de>
parents: 1019
diff changeset
   578
1106
414b7cfe57b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
   579
    aViewsTopView := aView topView.
414b7cfe57b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
   580
    (applicationsOrTopViewsWithHelp includesIdentical:aViewsTopView) ifTrue:[^ true].
414b7cfe57b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
   581
    app := aViewsTopView application.
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   582
    app notNil ifTrue:[
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   583
        (applicationsOrTopViewsWithHelp includesIdentical:app) ifTrue:[^ true]
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   584
    ].
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   585
    ^ false
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   586
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   587
    "Created: / 26.10.1997 / 23:28:52 / cg"
1033
3a56ba930052 care for nil view passed to #interestedIn.
Claus Gittinger <cg@exept.de>
parents: 1019
diff changeset
   588
    "Modified: / 8.8.1998 / 13:36:19 / cg"
2782
79eb7b58118e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
   589
!
79eb7b58118e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
   590
79eb7b58118e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
   591
targetViewInitiatesHelpViaSensor
79eb7b58118e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
   592
    "true if the target view is asked to show the help via the sensor;
79eb7b58118e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
   593
     false, if I do it myself synchronously."
79eb7b58118e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
   594
79eb7b58118e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
   595
    ^ true
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   596
! !
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   597
2391
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   598
!ActiveHelp methodsFor:'queries'!
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   599
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   600
delayTime
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   601
    ^ self class delayTime
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   602
!
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   603
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   604
showTime
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   605
    ^ self class showTime
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   606
! !
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   607
1768
7011c938442e method category rename
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
   608
!ActiveHelp methodsFor:'show & hide help'!
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   609
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   610
hideHelp
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   611
    "hide the help text - nothing done here"
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   612
!
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   613
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   614
hideHelpIgnoringErrors
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   615
    "hide the help text"
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 227
diff changeset
   616
1713
bc8a1d16e60f Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 1657
diff changeset
   617
    Error handle:[:ex |
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   618
        ex description infoPrintCR.
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   619
        ex return
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   620
    ] do:[
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   621
        self hideHelp.
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   622
    ].
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   623
!
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   624
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   625
initiateHelpFor:aView at:aPointOrNil
634
1d88f55984a2 comments
Claus Gittinger <cg@exept.de>
parents: 633
diff changeset
   626
    "ask aView for helpText, passing x/y coordinates;
1d88f55984a2 comments
Claus Gittinger <cg@exept.de>
parents: 633
diff changeset
   627
     start a timeout process to display this helpText after some delay;
1d88f55984a2 comments
Claus Gittinger <cg@exept.de>
parents: 633
diff changeset
   628
     Normally used internally, but can also be used by widgets to force 
1d88f55984a2 comments
Claus Gittinger <cg@exept.de>
parents: 633
diff changeset
   629
     re-negotiation of the displayed helpText 
1d88f55984a2 comments
Claus Gittinger <cg@exept.de>
parents: 633
diff changeset
   630
     (for example in a menu, when the selection changes)"
1d88f55984a2 comments
Claus Gittinger <cg@exept.de>
parents: 633
diff changeset
   631
1657
447db4aae998 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1591
diff changeset
   632
    self initiateHelpFor:aView at:aPointOrNil now:false
637
8be64da7d932 views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   633
8be64da7d932 views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   634
    "Modified: 28.6.1997 / 14:45:57 / cg"
8be64da7d932 views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   635
!
8be64da7d932 views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   636
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   637
initiateHelpFor:aView at:aPointOrNil now:showItNow
637
8be64da7d932 views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   638
    "ask aView for helpText, passing x/y coordinates;
8be64da7d932 views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   639
     start a timeout process to display this helpText after some delay;
8be64da7d932 views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   640
     Normally used internally, but can also be used by widgets to force 
8be64da7d932 views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   641
     re-negotiation of the displayed helpText 
8be64da7d932 views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   642
     (for example in a menu, when the selection changes)"
8be64da7d932 views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   643
696
a49928754789 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 639
diff changeset
   644
    |text top app|
634
1d88f55984a2 comments
Claus Gittinger <cg@exept.de>
parents: 633
diff changeset
   645
1143
5706310407e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1142
diff changeset
   646
    (self interestedIn:aView) ifFalse:[
5706310407e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1142
diff changeset
   647
        ^ self
5706310407e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1142
diff changeset
   648
    ].
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   649
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   650
    text := self helpTextFor:aView at:aPointOrNil.
637
8be64da7d932 views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   651
    lastHelpText = text ifTrue:[
8be64da7d932 views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   652
        ^ self
8be64da7d932 views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   653
    ].
8be64da7d932 views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   654
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   655
    "/ let application show the help
728
9f417e396d4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
   656
    "/ (i.e. in its own information area)
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   657
    "/ nil-text is also passed down, to give it a chance
728
9f417e396d4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
   658
    "/ to clean its infoDisplay.
637
8be64da7d932 views own help display is done immediately.
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   659
728
9f417e396d4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
   660
    top := aView topView.
9f417e396d4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
   661
    (app := aView application) notNil ifTrue:[
1019
862f095da4ac #showHelp:for: renamed to #showActiveHelp:for:
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   662
        (app showActiveHelp:text for:aView) ifTrue:[
728
9f417e396d4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
   663
            lastHelpText := text.
632
844b1aaf3eeb provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   664
        ]
844b1aaf3eeb provide access to the current activeHelp instance
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   665
    ].
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   666
!
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   667
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   668
stopHelpDisplayProcess
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   669
! !
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   670
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   671
!ActiveHelp methodsFor:'start & stop'!
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   672
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   673
listenFor:anAppOrTopView
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   674
    "start listening"
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   675
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   676
    applicationsOrTopViewsWithHelp isNil ifTrue:[
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   677
        applicationsOrTopViewsWithHelp := WeakIdentitySet new.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   678
    ].
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   679
    applicationsOrTopViewsWithHelp add:anAppOrTopView.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   680
    super listen.
639
0b1de8703593 fixed unlisten
Claus Gittinger <cg@exept.de>
parents: 638
diff changeset
   681
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   682
    "Created: / 26.10.1997 / 23:20:47 / cg"
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   683
    "Modified: / 26.10.1997 / 23:21:10 / cg"
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   684
!
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   685
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   686
listenForAll
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   687
    "start listening"
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   688
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   689
    listeningForAll := true.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   690
    super listen.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   691
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   692
    "Modified: / 28.6.1997 / 15:07:02 / cg"
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   693
    "Created: / 26.10.1997 / 23:19:30 / cg"
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   694
!
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   695
2391
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   696
start
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   697
    self listenForAll
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   698
!
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   699
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   700
stop
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   701
    self unlistenAll
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   702
!
f6af9239e999 reafctored
Claus Gittinger <cg@exept.de>
parents: 2371
diff changeset
   703
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   704
unlistenAll
639
0b1de8703593 fixed unlisten
Claus Gittinger <cg@exept.de>
parents: 638
diff changeset
   705
    "stop listening"
0b1de8703593 fixed unlisten
Claus Gittinger <cg@exept.de>
parents: 638
diff changeset
   706
0b1de8703593 fixed unlisten
Claus Gittinger <cg@exept.de>
parents: 638
diff changeset
   707
    self hideHelp.
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   708
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   709
    listeningForAll := false.
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   710
    applicationsOrTopViewsWithHelp size == 0 ifTrue:[
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   711
        self unlisten.
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   712
    ]
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   713
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   714
    "Created: / 26.10.1997 / 23:14:17 / cg"
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   715
    "Modified: / 26.10.1997 / 23:23:04 / cg"
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   716
!
639
0b1de8703593 fixed unlisten
Claus Gittinger <cg@exept.de>
parents: 638
diff changeset
   717
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   718
unlistenFor:anApp
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   719
    "stop listening for an app"
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   720
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   721
    self hideHelp.
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   722
1543
95c5048dd99a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1541
diff changeset
   723
    applicationsOrTopViewsWithHelp isNil ifFalse:[
95c5048dd99a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1541
diff changeset
   724
        applicationsOrTopViewsWithHelp remove:anApp ifAbsent:nil.
95c5048dd99a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1541
diff changeset
   725
    ].
726
cdab756aebe4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   726
    listeningForAll == true ifFalse:[
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   727
        applicationsOrTopViewsWithHelp size == 0 ifTrue:[
1535
a9fcabccabb3 separated into flyByHelp and activeHelp
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
   728
            self unlisten.
719
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   729
        ]
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   730
    ]
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   731
17fba5c2a167 allow applications to start activeHelp for
Claus Gittinger <cg@exept.de>
parents: 696
diff changeset
   732
    "Created: / 26.10.1997 / 23:22:42 / cg"
726
cdab756aebe4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   733
    "Modified: / 29.10.1997 / 15:48:34 / cg"
639
0b1de8703593 fixed unlisten
Claus Gittinger <cg@exept.de>
parents: 638
diff changeset
   734
! !
0b1de8703593 fixed unlisten
Claus Gittinger <cg@exept.de>
parents: 638
diff changeset
   735
338
071f92621e3b oops - catching the terminateSignal is no good idea
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   736
!ActiveHelp class methodsFor:'documentation'!
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   737
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   738
version
2783
cb3420e40ed1 changed: #buttonMotion:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2782
diff changeset
   739
    ^ '$Header: /cvs/stx/stx/libview2/ActiveHelp.st,v 1.66 2009-11-04 11:56:46 cg Exp $'
2779
b608ded19ff2 changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   740
!
b608ded19ff2 changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   741
b608ded19ff2 changed: #handleMouseIn:x:y:
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   742
version_CVS
2783
cb3420e40ed1 changed: #buttonMotion:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2782
diff changeset
   743
    ^ '$Header: /cvs/stx/stx/libview2/ActiveHelp.st,v 1.66 2009-11-04 11:56:46 cg Exp $'
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   744
! !
1657
447db4aae998 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1591
diff changeset
   745
59
98a4d38cfc96 Initial revision
claus
parents:
diff changeset
   746
ActiveHelp initialize!