FlyByHelp.st
author Patrik Svestka <patrik.svestka@gmail.com>
Wed, 14 Nov 2018 12:13:31 +0100
branchjv
changeset 4213 8127ef0ff47d
parent 4132 7e5528572373
child 4466 3b8a4268bdcd
permissions -rw-r--r--
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present - All source *.st files are now Unicode UTF8 without BOM Files are in two groups (fileOut works this way in Smalltalk/X): - containing a unicode character have "{ Encoding: utf8 }" at the header - ASCII only are without the header
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
4132
7e5528572373 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3805
diff changeset
     3
 COPYRIGHT (c) 2016 Jan Vrany
1802
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     4
              All Rights Reserved
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     5
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     6
 This software is furnished under a license and may be used
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     7
 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
     8
 inclusion of the above copyright notice.   This software may not
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     9
 be provided or otherwise made available to, or used by, any
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    10
 other person.  No title to or ownership of the software is
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    11
 hereby transferred.
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    12
"
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"{ Package: 'stx:libview2' }"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
3656
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
    15
"{ NameSpace: Smalltalk }"
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
    16
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
ActiveHelp subclass:#FlyByHelp
2680
Claus Gittinger <cg@exept.de>
parents: 2679
diff changeset
    18
	instanceVariableNames:'currentFrame currentView currentHelpView showProcess closeProcess'
3255
358f5696bc0d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3251
diff changeset
    19
	classVariableNames:'MaxNumberOfLines MaxNumberOfColumns'
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	poolDictionaries:''
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	category:'Interface-Help'
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
1802
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    24
!FlyByHelp class methodsFor:'documentation'!
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    25
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    26
copyright
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
 COPYRIGHT (c) 2001 by eXept Software AG
4132
7e5528572373 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3805
diff changeset
    29
 COPYRIGHT (c) 2016 Jan Vrany
1802
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    30
              All Rights Reserved
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    31
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    32
 This software is furnished under a license and may be used
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    33
 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
    34
 inclusion of the above copyright notice.   This software may not
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    35
 be provided or otherwise made available to, or used by, any
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    36
 other person.  No title to or ownership of the software is
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    37
 hereby transferred.
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    38
"
1893
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    39
!
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    40
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    41
examples
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    42
"
3220
1181c3afbb10 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3216
diff changeset
    43
    UserPreferences current toolTipShapeStyle:nil
1181c3afbb10 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3216
diff changeset
    44
    UserPreferences current toolTipShapeStyle:#cartoon
1181c3afbb10 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3216
diff changeset
    45
1893
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    46
     FlyByHelp isActive
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    47
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    48
     FlyByHelp stop
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    49
     FlyByHelp start
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    50
"
1802
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    51
! !
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
2692
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
    53
!FlyByHelp class methodsFor:'accessing'!
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
    54
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
    55
currentlyShownView
2846
e90ba00f9df1 changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents: 2826
diff changeset
    56
    TheOneAndOnlyHelpListener isNil ifTrue:[^ nil].
2692
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
    57
    ^ TheOneAndOnlyHelpListener currentlyShownView
2846
e90ba00f9df1 changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents: 2826
diff changeset
    58
e90ba00f9df1 changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents: 2826
diff changeset
    59
    "Modified: / 09-06-2010 / 16:35:48 / cg"
3255
358f5696bc0d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3251
diff changeset
    60
!
358f5696bc0d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3251
diff changeset
    61
358f5696bc0d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3251
diff changeset
    62
maxNumberOfColumns
358f5696bc0d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3251
diff changeset
    63
    ^ MaxNumberOfColumns ? 200
358f5696bc0d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3251
diff changeset
    64
!
358f5696bc0d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3251
diff changeset
    65
358f5696bc0d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3251
diff changeset
    66
maxNumberOfLines
358f5696bc0d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3251
diff changeset
    67
    ^ MaxNumberOfLines ? 40
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
3243
f78b2a3470eb class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3241
diff changeset
    91
    "/ does not work, because motion events are reported for the current focus-view,
3321
e749388a10b8 class: FlyByHelp
Stefan Vogel <sv@exept.de>
parents: 3293
diff changeset
    92
    "/ which is always active. Must check after we have determined the view under the pointer
3675
c7ba11759026 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3656
diff changeset
    93
    "/      aView topView isActive ifFalse:[^ false].
2477
b009e0b51999 suppress tooltip for inactive (lower) windows
Claus Gittinger <cg@exept.de>
parents: 2474
diff changeset
    94
2474
ef24105ee7a2 code cleanup (arg-names)
Claus Gittinger <cg@exept.de>
parents: 2392
diff changeset
    95
    ^ super buttonMotion:buttonAndModifierState x:x y:y view:aView
1540
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
    96
!
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
    97
2611
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
    98
buttonPress:button x:x y:y view:aView
3198
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
    99
    |prevView|
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   100
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   101
    "/ hideHelp nils the currentView
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   102
    "/ we restore it, so the tooltip is not shown again for this view
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   103
    "/ until the mouse really leaves the view
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   104
    "/ let's call this the "do-not-show-in-this-view mode"
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   105
    prevView := currentView.
2978
4358a9302b95 changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2925
diff changeset
   106
    self hideHelp.
3198
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   107
    currentView := prevView.
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   108
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   109
    ^ false
2978
4358a9302b95 changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2925
diff changeset
   110
4358a9302b95 changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2925
diff changeset
   111
    "Modified: / 23-12-2011 / 20:37:28 / cg"
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
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   114
keyPress:key x:x y:y view:aView
3216
f9312a1f2e9d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   115
    <resource: #keyboard (#Escape)>
f9312a1f2e9d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   116
3198
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   117
    |prevView|
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   118
2885
a70144d85a81 changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2884
diff changeset
   119
    currentHelpView notNil ifTrue:[
3687
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3681 3685
diff changeset
   120
        key == $ ifTrue:[
2979
306456bdfb61 comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   121
            "/ generate a line suitable for the resources file (a null translation)
3216
f9312a1f2e9d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   122
            "/ into the clipboard; makes it easy to add missing translations to a .rs file,
f9312a1f2e9d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   123
            "/ by pressing paragrapj whenever you see an untranslated helptext
2885
a70144d85a81 changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2884
diff changeset
   124
            aView setClipboardText:(lastHelpText storeString , '    ' , lastHelpText storeString).
2612
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   125
            self hideHelp.
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   126
            ^ true
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   127
        ].
2979
306456bdfb61 comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   128
        key == #Escape ifTrue:[
3198
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   129
            prevView := currentView.
2979
306456bdfb61 comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   130
            self hideHelp.
3198
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   131
            currentView := prevView.
2979
306456bdfb61 comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   132
            ^ true
2885
a70144d85a81 changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2884
diff changeset
   133
        ].
3216
f9312a1f2e9d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   134
        (#('Shift' #'Shift_L' #'Shift_R') includes:key) ifTrue:[
f9312a1f2e9d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   135
            "/ do not close on those...
f9312a1f2e9d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   136
            ^ false
f9312a1f2e9d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   137
        ].
2611
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   138
    ].
3198
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   139
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   140
    "/ hideHelp nils the currentView
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   141
    "/ we restore it, so the tooltip is not shown again for this view
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   142
    "/ until the mouse really leaves the view
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   143
    "/ let's call this the "do-not-show-in-this-view mode"
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   144
    prevView := currentView.
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   145
    self hideHelpIgnoringErrors.
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   146
    currentView := prevView.
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   147
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   148
    ^ false
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   149
    "/ ^ super keyPress:key x:x y:y view:aView
2884
7d37f5a0719e changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   150
2979
306456bdfb61 comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   151
    "Modified (format): / 25-12-2011 / 10:25:23 / cg"
2611
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   152
!
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   153
2521
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   154
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
   155
    currentHelpView notNil ifTrue:[
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   156
        self handleMouseIn:aView x:x y:y.
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   157
    ].
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   158
    ^ false
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   159
!
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   160
1540
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
   161
pointerLeave:state view:aView
2611
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   162
    aView == currentHelpView ifTrue:[^ true].
3198
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   163
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   164
    "/ clear the do-not-show-in-this-view mode (see keyPress)
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   165
"/     (currentHelpView isNil and:[currentView notNil]) ifTrue:[currentView := nil].
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   166
2611
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   167
    ^ super pointerLeave:state view:aView
1540
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
   168
! !
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
   169
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   170
!FlyByHelp methodsFor:'help texts'!
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
helpTextFromModel:aModel view:aView at:aPointOrNil 
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
    "helper: ask aModel for its helpText."
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
    |text|
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
    aPointOrNil notNil ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
        (aModel respondsTo:#flyByHelpTextFor:at:) ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
            text := aModel flyByHelpTextFor:aView at:aPointOrNil.
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   180
            text notNil ifTrue:[^ text].
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
        ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
    ].
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   183
    (aModel respondsTo:#flyByHelpTextFor:) ifTrue:[
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   184
        text := aModel flyByHelpTextFor:aView.
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   185
        text notNil ifTrue:[^ text].
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
    ].
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   187
    ^ nil
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
helpTextFromView:aView at:aPointOrNil 
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    "helper: ask aView for its helpText."
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   193
    |text key app|
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
    aPointOrNil notNil ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
        (aView respondsTo:#flyByHelpTextAt:) ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
            text := aView flyByHelpTextAt:aPointOrNil.
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   198
            text notNil ifTrue:[^ text].
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
        ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
    ].
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   201
    (aView respondsTo:#flyByHelpText) ifTrue:[
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   202
        text := aView flyByHelpText.
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   203
        text notNil ifTrue:[^ text].
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   204
    ].
3804
23207b26bfee #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3803
diff changeset
   205
    "/ to be enabled in next release...
23207b26bfee #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3803
diff changeset
   206
"/    (aView superView notNil
23207b26bfee #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3803
diff changeset
   207
"/    and:[aView superView respondsTo:#flyByHelpTextFor:]) ifTrue:[
23207b26bfee #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3803
diff changeset
   208
"/        text := aView superView flyByHelpTextFor:aView.
23207b26bfee #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3803
diff changeset
   209
"/        text notNil ifTrue:[^ text].
23207b26bfee #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3803
diff changeset
   210
"/    ].
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   211
    (aView respondsTo:#helpKey) ifTrue:[
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   212
        key := aView helpKey.
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   213
        key notNil ifTrue:[
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   214
            app := aView application.
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   215
            app isNil ifTrue:[
3763
72a6db06eee5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3681
diff changeset
   216
                "/ special case for oldStyle Dialog subclasses.
72a6db06eee5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3681
diff changeset
   217
                aView topView flyByHelpSpec notNil ifTrue:[
72a6db06eee5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3681
diff changeset
   218
                    text := aView topView flyByHelpSpec at:key ifAbsent:nil.
72a6db06eee5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3681
diff changeset
   219
                    text notNil ifTrue:[
72a6db06eee5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3681
diff changeset
   220
                        ^ aView topView resources stringWithCRs:text.
72a6db06eee5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3681
diff changeset
   221
                    ].    
72a6db06eee5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3681
diff changeset
   222
                ].    
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   223
                app := Error handle:[:ex | nil] do:[ aView windowGroup mainGroup application ].
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   224
            ].
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   225
            app notNil ifTrue:[
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   226
                ^ app flyByHelpTextForKey:key
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   227
            ].
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   228
            ^ aView resources string:key
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
        ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
    ].
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   231
    ^ nil.
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   232
! !
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   233
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   234
!FlyByHelp methodsFor:'private'!
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
hideIfPointerLeft:aView
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
    "hide help, if the pointer is not in aView"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
    |whereOnScreen|
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
    currentFrame notNil ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
        whereOnScreen := aView graphicsDevice pointerPosition.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
        (currentFrame notNil
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
        and:[(currentFrame insetBy:1@1) containsPoint:whereOnScreen]) ifFalse:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
            self hideHelp.
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
    "Modified: 28.5.1996 / 20:18:28 / cg"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
initiateHelpFor:aView at:aPointOrNil now:showItNow
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
    "ask aView for helpText, passing x/y coordinates;
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
     start a timeout process to display this helpText after some delay;
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
     Normally used internally, but can also be used by widgets to force 
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
     re-negotiation of the displayed helpText 
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
     (for example in a menu, when the selection changes)"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
2679
552847065fb3 car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
   260
    |text delayTime now|
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
    (self interestedIn:aView) ifFalse:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
        ^ self
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
2679
552847065fb3 car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
   266
    now := Timestamp now.
552847065fb3 car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
   267
2680
Claus Gittinger <cg@exept.de>
parents: 2679
diff changeset
   268
    "/ 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
   269
    "/ 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
   270
    [
2826
74bd82edee5a changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   271
        Error handle:[:ex |
3394
d1f97f49ea4f class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3334
diff changeset
   272
            ('FlyByhelp [warning]: error while asking for helpText: ',ex description) errorPrintCR.
3675
c7ba11759026 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3656
diff changeset
   273
            Transcript showCR:'-------------------------'.
3394
d1f97f49ea4f class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3334
diff changeset
   274
            ex suspendedContext fullPrintAllOn:Transcript.
2872
ea7e6fe01727 comment/format in: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   275
            "/ self halt.
2826
74bd82edee5a changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   276
        ] do:[
74bd82edee5a changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   277
            text := self helpTextFor:aView at:aPointOrNil.
74bd82edee5a changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   278
        ].
3656
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
   279
    ] valueWithWatchDog:[ 
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
   280
        'FlyByhelp [info]: flyBy text generation took too long' infoPrintCR.
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
   281
        ^ self 
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
   282
    ] afterMilliseconds:(self flyByHelpTimeoutMillis).
2679
552847065fb3 car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
   283
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
    lastHelpText = text ifTrue:[
3228
187a4158a51a class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3220
diff changeset
   285
        lastHelpWidget == aView ifTrue:[ 
187a4158a51a class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3220
diff changeset
   286
            self toolTipFollowsMouse ifFalse:[
187a4158a51a class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3220
diff changeset
   287
                ^ self
187a4158a51a class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3220
diff changeset
   288
            ]
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   289
        ]
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
3767
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   292
    ((text size > 0) or:[text isString not]) ifTrue:[
2778
8b91cf06a145 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
   293
        (showItNow not and:[(delayTime := self delayTime) > 0]) ifTrue:[
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
            self stopHelpDisplayProcess.
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   295
            showProcess := 
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   296
                [
2680
Claus Gittinger <cg@exept.de>
parents: 2679
diff changeset
   297
                    Delay waitForSeconds:delayTime.
2774
7894ba397774 changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
   298
                    [
3766
4d3c0206456a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   299
                        aView device notNil ifTrue:[    
4d3c0206456a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   300
                            aView device anyButtonPressed ifFalse:[
4d3c0206456a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   301
                                showProcess := nil.
4d3c0206456a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   302
                                self showHelp:text for:aView
4d3c0206456a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   303
                            ]
4d3c0206456a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   304
                        ].
2774
7894ba397774 changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
   305
                    ] ensure:[
7894ba397774 changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
   306
                        showProcess := nil.
2680
Claus Gittinger <cg@exept.de>
parents: 2679
diff changeset
   307
                    ]
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   308
                ] forkAt:(Processor userSchedulingPriority + 1).
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
        ] ifFalse:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
            self showHelp:text for:aView
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
        ]
1542
f63515aab510 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1540
diff changeset
   312
    ] ifFalse:[
f63515aab510 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1540
diff changeset
   313
        self hideHelp
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
    ].
2872
ea7e6fe01727 comment/format in: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   315
2901
fed697afcef8 changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   316
    "Modified: / 22-03-2011 / 19:10:28 / cg"
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
! !
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   319
!FlyByHelp methodsFor:'queries'!
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   320
2692
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   321
currentlyShownView
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   322
    ^ currentHelpView
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   323
!
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   324
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   325
toolTipFollowsMouse
3675
c7ba11759026 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3656
diff changeset
   326
    "if true, the tooltip-window moves with the pointer
c7ba11759026 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3656
diff changeset
   327
     so that it stays away from (does not cover) the mouse pointer"
c7ba11759026 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3656
diff changeset
   328
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   329
    ^ false
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   330
! !
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   331
1768
7011c938442e method category rename
Claus Gittinger <cg@exept.de>
parents: 1677
diff changeset
   332
!FlyByHelp methodsFor:'show & hide help'!
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
3248
d72c8e4f7684 more control over the shape style
Claus Gittinger <cg@exept.de>
parents: 3247
diff changeset
   334
activeHelpViewForApplication:applicationOrNil text:helpText onDevice:aDevice
d72c8e4f7684 more control over the shape style
Claus Gittinger <cg@exept.de>
parents: 3247
diff changeset
   335
    applicationOrNil notNil ifTrue:[
d72c8e4f7684 more control over the shape style
Claus Gittinger <cg@exept.de>
parents: 3247
diff changeset
   336
        ^ applicationOrNil activeHelpViewFor:helpText onDevice:aDevice
d72c8e4f7684 more control over the shape style
Claus Gittinger <cg@exept.de>
parents: 3247
diff changeset
   337
    ].
d72c8e4f7684 more control over the shape style
Claus Gittinger <cg@exept.de>
parents: 3247
diff changeset
   338
    ^ ActiveHelpView for:helpText onDevice:aDevice.
3656
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
   339
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
   340
    "
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
   341
     (ActiveHelpView for:'Hello' onDevice:Display) open
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
   342
    "
3248
d72c8e4f7684 more control over the shape style
Claus Gittinger <cg@exept.de>
parents: 3247
diff changeset
   343
!
d72c8e4f7684 more control over the shape style
Claus Gittinger <cg@exept.de>
parents: 3247
diff changeset
   344
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
hideHelp
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
    "hide the help text"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   347
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   348
    |p|
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
3198
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   350
    "/ lastHelpText := nil.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
    self stopHelpDisplayProcess.
3685
f0724224515c Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3656
diff changeset
   352
    lastHelpText := lastHelpWidget := nil.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
    currentHelpView notNil ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   355
        [
2780
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   356
            currentHelpView notNil ifTrue:[
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   357
                currentHelpView unmap.
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   358
                currentHelpView destroy.
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   359
                currentHelpView := nil.
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   360
                currentView := nil.
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   361
            ]
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   362
        ] valueUninterruptably
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   363
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   364
    currentFrame := nil.
3198
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   365
    (p := closeProcess) notNil ifTrue:[
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   366
        closeProcess := nil.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   367
        p terminate.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   368
    ]
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   369
3685
f0724224515c Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3656
diff changeset
   370
    "Modified: / 28-06-1997 / 14:03:50 / cg"
f0724224515c Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3656
diff changeset
   371
    "Modified: / 04-05-2016 / 10:36:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   372
!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
showHelp:aHelpText for:view
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   375
    "show the help text for aView"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   376
3786
c628a30083c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
   377
    |wg applicationOrNil org p v device helpTextShown textLines
3334
d334c9dd9b76 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3321
diff changeset
   378
     helpViewWidth helpViewHeight usableWidth monitorBounds usableHeight
3418
a758dd978f99 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
   379
     showTime cursorView|
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   380
2781
31725cdfbe43 leftover print
Claus Gittinger <cg@exept.de>
parents: 2780
diff changeset
   381
    "/ thisContext fullPrintAllOn:Transcript.
2651
7275384a60c7 care for nil windowGroup
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
   382
    (wg := view windowGroup) notNil ifTrue:[
7275384a60c7 care for nil windowGroup
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
   383
        wg isInModalLoop ifTrue:[
7275384a60c7 care for nil windowGroup
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
   384
            wg isModal ifFalse:[
7275384a60c7 care for nil windowGroup
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
   385
                ^ self
7275384a60c7 care for nil windowGroup
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
   386
            ].
2628
03a41945fb37 do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   387
        ].
03a41945fb37 do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   388
    ].
03a41945fb37 do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   389
3786
c628a30083c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
   390
    device := view graphicsDevice.
c628a30083c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
   391
3418
a758dd978f99 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
   392
    "/ mouse still over that view?
3786
c628a30083c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
   393
    cursorView := device viewFromPoint:(device pointerPosition).
3418
a758dd978f99 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
   394
    cursorView ~~ view ifTrue:[
a758dd978f99 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
   395
        Debugging ifTrue:[ 'mouse no longer in view' infoPrintCR ].
a758dd978f99 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
   396
        ^ self
a758dd978f99 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
   397
    ].
a758dd978f99 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
   398
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   399
    view == currentView ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   400
        lastHelpText = aHelpText ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   401
            ^ self
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   402
        ]
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   403
    ].
3228
187a4158a51a class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3220
diff changeset
   404
    lastHelpWidget := view.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   406
    lastHelpText := aHelpText.
3251
afc7d588b25b handle key press and close help.
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
   407
    helpTextShown := aHelpText.
3257
382b74692cfc class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3255
diff changeset
   408
    "/ the text originator must already have generated CRs;
382b74692cfc class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3255
diff changeset
   409
    "/ no longer done here (otherwise, we could not generate tooltips with windows filenames in it)
3681
c56b665d08a7 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3675
diff changeset
   410
    textLines := helpTextShown isStringCollection 
c56b665d08a7 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3675
diff changeset
   411
                    ifTrue:[helpTextShown]
3767
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   412
                    ifFalse:[ 
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   413
                        helpTextShown isString 
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   414
                            ifTrue:[helpTextShown "withCRs" asCollectionOfLines asStringCollection]
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   415
                            ifFalse:[nil]].
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   416
    textLines notNil ifTrue:[
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   417
        textLines size > (self class maxNumberOfLines) ifTrue:[
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   418
            textLines := (textLines copyTo:(self class maxNumberOfLines)) copyWith:'...'
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   419
        ].
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   420
        textLines := textLines collect:[:l | l contractAtEndTo:(self class maxNumberOfColumns)].
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   421
        helpTextShown := textLines asString.
3251
afc7d588b25b handle key press and close help.
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
   422
    ].
3767
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   423
    
2780
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   424
    (p := closeProcess) notNil ifTrue:[
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   425
        closeProcess := nil.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   426
        p terminate.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   427
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   428
    currentHelpView notNil ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   429
        self hideHelp
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   430
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   431
3770
690e17824673 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3769
diff changeset
   432
    "/ Transcript showCR:helpTextShown storeString.
3769
09e08477457d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3767
diff changeset
   433
    helpTextShown isEmptyOrNil ifTrue:[^ self].
09e08477457d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3767
diff changeset
   434
    
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   435
    org := view originRelativeTo:nil.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   436
    currentFrame := org extent:view extent.
2848
43346e94b6ce changed: #showHelp:for:
Claus Gittinger <cg@exept.de>
parents: 2846
diff changeset
   437
    org := org + (view extent // 2).
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   438
3248
d72c8e4f7684 more control over the shape style
Claus Gittinger <cg@exept.de>
parents: 3247
diff changeset
   439
    wg notNil ifTrue:[ applicationOrNil := wg application ].
3786
c628a30083c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
   440
    v := self activeHelpViewForApplication:applicationOrNil text:helpTextShown onDevice:device.
3251
afc7d588b25b handle key press and close help.
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
   441
    v perform:#controllingHelpListener: with:self ifNotUnderstood:[].
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   442
2848
43346e94b6ce changed: #showHelp:for:
Claus Gittinger <cg@exept.de>
parents: 2846
diff changeset
   443
    helpViewWidth := v width.
43346e94b6ce changed: #showHelp:for:
Claus Gittinger <cg@exept.de>
parents: 2846
diff changeset
   444
    helpViewHeight := v height.
1677
dc49ab70b762 open helpView on the correcdt device
Claus Gittinger <cg@exept.de>
parents: 1657
diff changeset
   445
3786
c628a30083c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
   446
    org := device pointerPosition + (0@18"24").
c628a30083c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
   447
    monitorBounds := device monitorBoundsAt:org.
3114
fb742db4ee12 class: FlyByHelp
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
   448
    usableWidth := monitorBounds width - 2.
3786
c628a30083c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
   449
    usableHeight := device usableHeightAt:org.
3114
fb742db4ee12 class: FlyByHelp
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
   450
fb742db4ee12 class: FlyByHelp
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
   451
    helpViewWidth > usableWidth ifTrue:[v width:(helpViewWidth := usableWidth)].    
3247
768269b26ad3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3243
diff changeset
   452
    helpViewHeight > usableHeight ifTrue:[v height:(helpViewHeight := usableHeight)].    
3114
fb742db4ee12 class: FlyByHelp
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
   453
fb742db4ee12 class: FlyByHelp
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
   454
    (org x + helpViewWidth) > (monitorBounds left + usableWidth) ifTrue:[
fb742db4ee12 class: FlyByHelp
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
   455
        org := ((monitorBounds left + usableWidth - helpViewWidth) @ org y).
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   456
    ].
3114
fb742db4ee12 class: FlyByHelp
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
   457
    (org y + helpViewHeight) > (monitorBounds top + usableHeight) ifTrue:[
fb742db4ee12 class: FlyByHelp
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
   458
        org := org x @ (monitorBounds top + usableHeight - helpViewHeight).
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   461
    v origin:org.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   462
    v realize.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   463
    v enableButtonMotionEvents.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   464
    v enableMotionEvents.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   465
    currentHelpView := v.
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   466
    currentView := view.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   467
3334
d334c9dd9b76 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3321
diff changeset
   468
    showTime := self showTime.
d334c9dd9b76 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3321
diff changeset
   469
    (showTime notNil and:[showTime > 0]) ifTrue:[
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   470
        closeProcess := [
1546
1af738601dae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1542
diff changeset
   471
                [
3334
d334c9dd9b76 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3321
diff changeset
   472
                    (Delay forSeconds:showTime) wait.
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   473
                    [
2780
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   474
                        |v|
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   475
                        (v := currentHelpView) notNil ifTrue:[
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   476
                            currentHelpView := nil.
2780
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   477
                            v unmap.
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   478
                            v destroy.
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   479
                        ]
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   480
                    ] valueUninterruptably
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   481
                ] ifCurtailed:[
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   482
                    closeProcess := nil.
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   483
                ].
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   484
            ] newProcess.
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   485
        closeProcess priority:(Processor userSchedulingPriority + 1).
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   486
        closeProcess resume.
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   487
    ].
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   488
1963
fb6663696d20 removed withCRs in showHelp:
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
   489
    "Modified: / 31-08-1995 / 19:20:45 / claus"
3786
c628a30083c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
   490
    "Modified: / 17-11-2016 / 22:11:37 / cg"
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   491
!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   492
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   493
stopHelpDisplayProcess
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   494
    |p|
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   495
2680
Claus Gittinger <cg@exept.de>
parents: 2679
diff changeset
   496
    (p := showProcess) notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2679
diff changeset
   497
        showProcess := nil.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   498
        p terminate.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   499
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   500
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   501
    "Created: 28.6.1997 / 14:03:17 / cg"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   502
! !
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   503
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   504
!FlyByHelp class methodsFor:'documentation'!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   505
2979
306456bdfb61 comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   506
version
3656
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
   507
    ^ '$Header$'
2979
306456bdfb61 comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   508
!
306456bdfb61 comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   509
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   510
version_CVS
3656
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
   511
    ^ '$Header$'
3685
f0724224515c Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3656
diff changeset
   512
!
f0724224515c Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3656
diff changeset
   513
f0724224515c Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3656
diff changeset
   514
version_HG
f0724224515c Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3656
diff changeset
   515
f0724224515c Hide any active help and flush caches before saving a snapshot
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3656
diff changeset
   516
    ^ '$Changeset: <not expanded> $'
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   517
! !
3114
fb742db4ee12 class: FlyByHelp
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
   518