FlyByHelp.st
author Claus Gittinger <cg@exept.de>
Wed, 28 Jul 2010 11:57:28 +0200
changeset 2853 3c021208873a
parent 2848 43346e94b6ce
child 2872 ea7e6fe01727
permissions -rw-r--r--
changed: #actionFor: #actionFor:withValue: use MessageSend instead of block
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1802
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     1
"
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     2
 COPYRIGHT (c) 2001 by eXept Software AG
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     3
              All Rights Reserved
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     4
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     5
 This software is furnished under a license and may be used
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     6
 only in accordance with the terms of that license and with the
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     8
 be provided or otherwise made available to, or used by, any
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     9
 other person.  No title to or ownership of the software is
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    10
 hereby transferred.
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    11
"
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libview2' }"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
ActiveHelp subclass:#FlyByHelp
2680
Claus Gittinger <cg@exept.de>
parents: 2679
diff changeset
    15
	instanceVariableNames:'currentFrame currentView currentHelpView showProcess closeProcess'
1892
4c38a0c4369b *** empty log message ***
ca
parents: 1802
diff changeset
    16
	classVariableNames:''
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Interface-Help'
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
1802
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    21
!FlyByHelp class methodsFor:'documentation'!
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    22
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    23
copyright
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    24
"
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    25
 COPYRIGHT (c) 2001 by eXept Software AG
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    26
              All Rights Reserved
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    27
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    28
 This software is furnished under a license and may be used
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    29
 only in accordance with the terms of that license and with the
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    31
 be provided or otherwise made available to, or used by, any
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    32
 other person.  No title to or ownership of the software is
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    33
 hereby transferred.
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    34
"
1893
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    35
!
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    36
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    37
examples
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    38
"
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    39
     FlyByHelp isActive
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    40
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    41
     FlyByHelp stop
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    42
     FlyByHelp start
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    43
"
1802
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    44
! !
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
!FlyByHelp class methodsFor:'initialization'!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
initialize
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    "set default delay & help-display times"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
1657
447db4aae998 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1596
diff changeset
    51
    ShowTime := 10.
447db4aae998 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1596
diff changeset
    52
    DelayTime := 0.4.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    "
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
     FlyByHelp initialize
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    "
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    "Modified: 27.4.1996 / 15:07:27 / cg"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
! !
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
2692
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
    61
!FlyByHelp class methodsFor:'accessing'!
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
    62
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
    63
currentlyShownView
2846
e90ba00f9df1 changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents: 2826
diff changeset
    64
    TheOneAndOnlyHelpListener isNil ifTrue:[^ nil].
2692
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
    65
    ^ TheOneAndOnlyHelpListener currentlyShownView
2846
e90ba00f9df1 changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents: 2826
diff changeset
    66
e90ba00f9df1 changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents: 2826
diff changeset
    67
    "Modified: / 09-06-2010 / 16:35:48 / cg"
2692
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
    68
! !
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
    69
2684
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
    70
!FlyByHelp methodsFor:'defaults'!
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
    71
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
    72
flyByHelpTimeoutMillis
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
    73
    "abort flyby help text generation, if no text can be generated within that
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
    74
     time delta. This is used to abort long-lasting parsing/scanning/analysis in
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
    75
     large methods when the mouse is moved over some syntactic constructs, and
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
    76
     it takes too long to parse...
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
    77
     The returned time is given in ms"
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
    78
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
    79
    ^ 300
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
    80
! !
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
    81
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
    82
!FlyByHelp methodsFor:'event handling'!
1540
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
    83
2474
ef24105ee7a2 code cleanup (arg-names)
Claus Gittinger <cg@exept.de>
parents: 2392
diff changeset
    84
buttonMotion:buttonAndModifierState x:x y:y view:aView
2519
af89806c67e4 comment
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
    85
    aView == currentHelpView ifTrue:[
af89806c67e4 comment
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
    86
        "/ the help-bubble itself
af89806c67e4 comment
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
    87
        ^ false
af89806c67e4 comment
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
    88
    ].
af89806c67e4 comment
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
    89
2518
fc1d2b481b6e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2501
diff changeset
    90
    "/ don't start tooltip, if this view is not active
fc1d2b481b6e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2501
diff changeset
    91
    "/ aView topView isActive ifFalse:[^ false].
2477
b009e0b51999 suppress tooltip for inactive (lower) windows
Claus Gittinger <cg@exept.de>
parents: 2474
diff changeset
    92
2474
ef24105ee7a2 code cleanup (arg-names)
Claus Gittinger <cg@exept.de>
parents: 2392
diff changeset
    93
    ^ super buttonMotion:buttonAndModifierState x:x y:y view:aView
1540
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
    94
!
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
    95
2611
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
    96
buttonPress:button x:x y:y view:aView
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
    97
    aView == currentHelpView ifTrue:[
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
    98
        self hideHelp.
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
    99
        ^ true
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   100
    ].
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   101
    ^ super buttonPress:button x:x y:y view:aView
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   102
!
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   103
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   104
keyPress:key x:x y:y view:aView
2612
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   105
    aView == currentHelpView ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   106
        key == #Escape ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   107
            self hideHelp.
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   108
            ^ true
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   109
        ].
2611
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   110
    ].
2799
bc3ff9e96512 comment/format in: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2781
diff changeset
   111
    ^ super keyPress:key x:x y:y view:aView
2611
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   112
!
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   113
2521
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   114
mouseWheelMotion:state x:x y:y amount:amount deltaTime:dTime view:aView
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   115
    currentHelpView notNil ifTrue:[
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   116
        self handleMouseIn:aView x:x y:y.
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   117
    ].
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   118
    ^ false
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   119
!
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   120
1540
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
   121
pointerLeave:state view:aView
2611
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   122
    aView == currentHelpView ifTrue:[^ true].
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   123
    ^ super pointerLeave:state view:aView
1540
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
   124
! !
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
   125
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   126
!FlyByHelp methodsFor:'help texts'!
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
helpTextFromModel:aModel view:aView at:aPointOrNil 
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
    "helper: ask aModel for its helpText."
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    |text|
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
    aPointOrNil notNil ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
        (aModel respondsTo:#flyByHelpTextFor:at:) ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
            text := aModel flyByHelpTextFor:aView at:aPointOrNil.
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   136
            text notNil ifTrue:[^ text].
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
        ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    ].
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   139
    (aModel respondsTo:#flyByHelpTextFor:) ifTrue:[
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   140
        text := aModel flyByHelpTextFor:aView.
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   141
        text notNil ifTrue:[^ text].
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
    ].
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   143
    ^ nil
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
helpTextFromView:aView at:aPointOrNil 
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
    "helper: ask aView for its helpText."
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   149
    |text key app|
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
    aPointOrNil notNil ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
        (aView respondsTo:#flyByHelpTextAt:) ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
            text := aView flyByHelpTextAt:aPointOrNil.
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   154
            text notNil ifTrue:[^ text].
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
        ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
    ].
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   157
    (aView respondsTo:#flyByHelpText) ifTrue:[
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   158
        text := aView flyByHelpText.
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   159
        text notNil ifTrue:[^ text].
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   160
    ].
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   161
    (aView respondsTo:#helpKey) ifTrue:[
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   162
        key := aView helpKey.
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   163
        key notNil ifTrue:[
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   164
            app := aView application.
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   165
            app isNil ifTrue:[
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   166
                app := Error handle:[:ex | nil] do:[ aView windowGroup mainGroup application ].
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   167
            ].
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   168
            app notNil ifTrue:[
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   169
                ^ app flyByHelpTextForKey:key
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   170
            ].
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   171
            ^ aView resources string:key
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
        ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
    ].
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   174
    ^ nil.
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   175
! !
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   176
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   177
!FlyByHelp methodsFor:'private'!
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
hideIfPointerLeft:aView
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
    "hide help, if the pointer is not in aView"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
    |whereOnScreen|
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
    currentFrame notNil ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
        whereOnScreen := aView graphicsDevice pointerPosition.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
        (currentFrame notNil
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
        and:[(currentFrame insetBy:1@1) containsPoint:whereOnScreen]) ifFalse:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
            self hideHelp.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
        ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
    "Modified: 28.5.1996 / 20:18:28 / cg"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
initiateHelpFor:aView at:aPointOrNil now:showItNow
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
    "ask aView for helpText, passing x/y coordinates;
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
     start a timeout process to display this helpText after some delay;
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
     Normally used internally, but can also be used by widgets to force 
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
     re-negotiation of the displayed helpText 
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
     (for example in a menu, when the selection changes)"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
2679
552847065fb3 car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
   203
    |text delayTime now|
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
    (self interestedIn:aView) ifFalse:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
        ^ self
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
2679
552847065fb3 car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
   209
    now := Timestamp now.
552847065fb3 car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
   210
2680
Claus Gittinger <cg@exept.de>
parents: 2679
diff changeset
   211
    "/ do not allow for more than 200 ms to be spent in the
2679
552847065fb3 car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
   212
    "/ helpText gatherer (the codeView parses the code for the variable under the cursor)
552847065fb3 car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
   213
    [
2826
74bd82edee5a changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   214
        Error handle:[:ex |
74bd82edee5a changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   215
            ('error in flyByhelp: ',ex description) errorPrintCR.
74bd82edee5a changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   216
        ] do:[
74bd82edee5a changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   217
            text := self helpTextFor:aView at:aPointOrNil.
74bd82edee5a changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   218
        ].
2684
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
   219
    ] valueWithWatchDog:[ ^ self ] afterMilliseconds:(self flyByHelpTimeoutMillis).
2679
552847065fb3 car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
   220
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
    lastHelpText = text ifTrue:[
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   222
        self toolTipFollowsMouse ifFalse:[
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   223
            ^ self
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   224
        ]
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
    text size > 0 ifTrue:[
2778
8b91cf06a145 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
   228
        (showItNow not and:[(delayTime := self delayTime) > 0]) ifTrue:[
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
            self stopHelpDisplayProcess.
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   230
            showProcess := 
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   231
                [
2680
Claus Gittinger <cg@exept.de>
parents: 2679
diff changeset
   232
                    Delay waitForSeconds:delayTime.
2774
7894ba397774 changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
   233
                    [
7894ba397774 changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
   234
                        aView device anyButtonPressed ifFalse:[
2777
4cdef981fdb3 changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2774
diff changeset
   235
                            showProcess := nil.
2774
7894ba397774 changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
   236
                            self showHelp:text for:aView
7894ba397774 changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
   237
                        ]
7894ba397774 changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
   238
                    ] ensure:[
7894ba397774 changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
   239
                        showProcess := nil.
2680
Claus Gittinger <cg@exept.de>
parents: 2679
diff changeset
   240
                    ]
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   241
                ] forkAt:(Processor userSchedulingPriority + 1).
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
        ] ifFalse:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
            self showHelp:text for:aView
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
        ]
1542
f63515aab510 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1540
diff changeset
   245
    ] ifFalse:[
f63515aab510 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1540
diff changeset
   246
        self hideHelp
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
interestedIn:aView
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
    "return true, if I am interested in aView (either listeningForAll,
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
     or in my list of apps)"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
    aView isNil ifTrue:[^ false].
2495
728d6935dc5b also interestedIn: help, if a pointer moves
Claus Gittinger <cg@exept.de>
parents: 2478
diff changeset
   255
    "/ aView topView == currentHelpView ifTrue:[^ false].
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
    ^ super interestedIn:aView
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
! !
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   260
!FlyByHelp methodsFor:'queries'!
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   261
2692
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   262
currentlyShownView
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   263
    ^ currentHelpView
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   264
!
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   265
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   266
toolTipFollowsMouse
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   267
    ^ false
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   268
! !
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   269
1768
7011c938442e method category rename
Claus Gittinger <cg@exept.de>
parents: 1677
diff changeset
   270
!FlyByHelp methodsFor:'show & hide help'!
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
hideHelp
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
    "hide the help text"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
    |p|
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
1540
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
   277
    lastHelpText := nil.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
    self stopHelpDisplayProcess.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
    currentHelpView notNil ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
        [
2780
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   282
            currentHelpView notNil ifTrue:[
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   283
                currentHelpView unmap.
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   284
                currentHelpView destroy.
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   285
                currentHelpView := nil.
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   286
                currentView := nil.
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   287
            ]
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
        ] valueUninterruptably
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
    currentFrame := nil.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
    closeProcess notNil ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
        p := closeProcess. closeProcess := nil.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
        p terminate.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
    ]
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
    "Modified: 28.6.1997 / 14:03:50 / cg"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
showHelp:aHelpText for:view
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
    "show the help text for aView"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
2848
43346e94b6ce changed: #showHelp:for:
Claus Gittinger <cg@exept.de>
parents: 2846
diff changeset
   302
    |wg org p v dev helpViewWidth helpViewHeight|
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
2781
31725cdfbe43 leftover print
Claus Gittinger <cg@exept.de>
parents: 2780
diff changeset
   304
    "/ thisContext fullPrintAllOn:Transcript.
2651
7275384a60c7 care for nil windowGroup
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
   305
    (wg := view windowGroup) notNil ifTrue:[
7275384a60c7 care for nil windowGroup
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
   306
        wg isInModalLoop ifTrue:[
7275384a60c7 care for nil windowGroup
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
   307
            wg isModal ifFalse:[
7275384a60c7 care for nil windowGroup
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
   308
                ^ self
7275384a60c7 care for nil windowGroup
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
   309
            ].
2628
03a41945fb37 do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   310
        ].
03a41945fb37 do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   311
    ].
03a41945fb37 do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   312
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
    view == currentView ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
        lastHelpText = aHelpText ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
            ^ self
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
        ]
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
    lastHelpText := aHelpText.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
2780
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   321
    (p := closeProcess) notNil ifTrue:[
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   322
        closeProcess := nil.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
        p terminate.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
    currentHelpView notNil ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
        self hideHelp
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
    org := view originRelativeTo:nil.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
    currentFrame := org extent:view extent.
2848
43346e94b6ce changed: #showHelp:for:
Claus Gittinger <cg@exept.de>
parents: 2846
diff changeset
   331
    org := org + (view extent // 2).
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
1677
dc49ab70b762 open helpView on the correcdt device
Claus Gittinger <cg@exept.de>
parents: 1657
diff changeset
   333
    dev := view graphicsDevice.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
1963
fb6663696d20 removed withCRs in showHelp:
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
   335
    v := ActiveHelpView for:aHelpText onDevice:dev.
2848
43346e94b6ce changed: #showHelp:for:
Claus Gittinger <cg@exept.de>
parents: 2846
diff changeset
   336
    helpViewWidth := v width.
43346e94b6ce changed: #showHelp:for:
Claus Gittinger <cg@exept.de>
parents: 2846
diff changeset
   337
    helpViewHeight := v height.
1677
dc49ab70b762 open helpView on the correcdt device
Claus Gittinger <cg@exept.de>
parents: 1657
diff changeset
   338
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
    org := dev pointerPosition.
1657
447db4aae998 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1596
diff changeset
   340
    org := org + (0@18"24").
2848
43346e94b6ce changed: #showHelp:for:
Claus Gittinger <cg@exept.de>
parents: 2846
diff changeset
   341
    (org x + helpViewWidth) > (dev usableExtent x) ifTrue:[
43346e94b6ce changed: #showHelp:for:
Claus Gittinger <cg@exept.de>
parents: 2846
diff changeset
   342
        org := ((dev usableExtent x) - helpViewWidth - 2) @ org y
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
    ].
2848
43346e94b6ce changed: #showHelp:for:
Claus Gittinger <cg@exept.de>
parents: 2846
diff changeset
   344
    (org y + helpViewHeight) > (dev usableHeightAt:org) ifTrue:[
43346e94b6ce changed: #showHelp:for:
Claus Gittinger <cg@exept.de>
parents: 2846
diff changeset
   345
        org := org x @ ((dev usableHeightAt:org) - helpViewHeight).
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   347
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   348
    v origin:org.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
    v realize.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   350
    v enableButtonMotionEvents.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
    v enableMotionEvents.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
    currentHelpView := v.
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   353
    currentView := view.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   355
    self showTime notNil ifTrue:[
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   356
        closeProcess := [
1546
1af738601dae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1542
diff changeset
   357
                [
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   358
                    (Delay forSeconds:self showTime) wait.
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   359
                    [
2780
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   360
                        |v|
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   361
                        (v := currentHelpView) notNil ifTrue:[
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   362
                            currentHelpView := nil.
2780
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   363
                            v unmap.
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   364
                            v destroy.
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   365
                        ]
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   366
                    ] valueUninterruptably
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   367
                ] ifCurtailed:[
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   368
                    closeProcess := nil.
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   369
                ].
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   370
            ] newProcess.
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   371
        closeProcess priority:(Processor userSchedulingPriority + 1).
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   372
        closeProcess resume.
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   373
    ].
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
1963
fb6663696d20 removed withCRs in showHelp:
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
   375
    "Modified: / 31-08-1995 / 19:20:45 / claus"
2848
43346e94b6ce changed: #showHelp:for:
Claus Gittinger <cg@exept.de>
parents: 2846
diff changeset
   376
    "Modified: / 16-07-2010 / 14:33:13 / cg"
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   377
!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   378
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   379
stopHelpDisplayProcess
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   380
    |p|
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   381
2680
Claus Gittinger <cg@exept.de>
parents: 2679
diff changeset
   382
    (p := showProcess) notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2679
diff changeset
   383
        showProcess := nil.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   384
        p terminate.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   385
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   386
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   387
    "Created: 28.6.1997 / 14:03:17 / cg"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   388
! !
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   389
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   390
!FlyByHelp class methodsFor:'documentation'!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   391
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   392
version
2848
43346e94b6ce changed: #showHelp:for:
Claus Gittinger <cg@exept.de>
parents: 2846
diff changeset
   393
    ^ '$Header: /cvs/stx/stx/libview2/FlyByHelp.st,v 1.41 2010-07-16 12:34:12 cg Exp $'
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   394
!
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   395
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   396
version_CVS
2848
43346e94b6ce changed: #showHelp:for:
Claus Gittinger <cg@exept.de>
parents: 2846
diff changeset
   397
    ^ '$Header: /cvs/stx/stx/libview2/FlyByHelp.st,v 1.41 2010-07-16 12:34:12 cg Exp $'
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   398
! !
1657
447db4aae998 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1596
diff changeset
   399
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   400
FlyByHelp initialize!