FlyByHelp.st
author Claus Gittinger <cg@exept.de>
Sun, 13 Oct 2019 23:30:10 +0200
changeset 4364 511f14f879b8
parent 4360 fb60027a5f52
child 4365 025b0f16d515
permissions -rw-r--r--
#UI_ENHANCEMENT by exept class: ApplicationModel changed: #showMeHowItWorks:inAny:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4352
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
     1
"{ Encoding: utf8 }"
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
     2
1802
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     3
"
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     4
 COPYRIGHT (c) 2001 by eXept Software AG
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     5
              All Rights Reserved
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     6
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     7
 This software is furnished under a license and may be used
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
     8
 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
     9
 inclusion of the above copyright notice.   This software may not
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    10
 be provided or otherwise made available to, or used by, any
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    11
 other person.  No title to or ownership of the software is
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    12
 hereby transferred.
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    13
"
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
"{ Package: 'stx:libview2' }"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
3656
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
    16
"{ NameSpace: Smalltalk }"
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
    17
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
ActiveHelp subclass:#FlyByHelp
4360
fb60027a5f52 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4352
diff changeset
    19
	instanceVariableNames:'currentFrame currentView currentHelpView showProcess closeProcess
fb60027a5f52 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4352
diff changeset
    20
		helpTextProcess'
4119
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
    21
	classVariableNames:'MaxNumberOfLines MaxNumberOfColumns'
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
    22
	poolDictionaries:''
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
    23
	category:'Interface-Help'
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
4231
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
    26
Query subclass:#HelpKeyInsteadOfHelpTextQuery
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
    27
	instanceVariableNames:''
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
    28
	classVariableNames:''
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
    29
	poolDictionaries:''
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
    30
	privateIn:FlyByHelp
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
    31
!
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
    32
1802
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    33
!FlyByHelp class methodsFor:'documentation'!
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    34
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    35
copyright
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    36
"
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    37
 COPYRIGHT (c) 2001 by eXept Software AG
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    38
              All Rights Reserved
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    39
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    40
 This software is furnished under a license and may be used
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    41
 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
    42
 inclusion of the above copyright notice.   This software may not
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    43
 be provided or otherwise made available to, or used by, any
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    44
 other person.  No title to or ownership of the software is
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    45
 hereby transferred.
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    46
"
1893
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    47
!
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    48
4055
92c2d38634c1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4048
diff changeset
    49
documentation
92c2d38634c1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4048
diff changeset
    50
"
92c2d38634c1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4048
diff changeset
    51
    an instance of me is used to provide tooltips 
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    52
    sigh: Smalltalk was ahead of its time in the early 90's:
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    53
        initially called 'activeHelp', 
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    54
        then renamed to 'flyByHelp' 
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    55
        and is now commonly known as 'tooltip'.
4055
92c2d38634c1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4048
diff changeset
    56
92c2d38634c1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4048
diff changeset
    57
    I will watch the mouse movements via an event hook, and determine
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    58
    where the mouse pointer is. 
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    59
    Then ask the underlying view about its helpText 
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    60
    and display it in a little floating popup view.
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    61
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    62
    The tool is installed via:
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    63
        FlyByHelp start
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    64
    and possibly deactivated/uninstalled via:
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    65
        FlyByHelp stop
4055
92c2d38634c1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4048
diff changeset
    66
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    67
    There can be only one FlyByHelp at any time - the start/stop methods assure that.
4055
92c2d38634c1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4048
diff changeset
    68
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    69
    Additional features:
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    70
        if you press CTRL, the helpKey which was responsible for the helptext
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    71
        is shown instead of the full text. This helps to find out which text to modify
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    72
        in case of typing errors or missing translations.
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    73
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    74
        if you press LEFTSHIFT+RIGHTSHIFT+CTRL (in that order), a menu developper menu appears,
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
    75
        but only if Smalltalk is in the debeloper mode (i.e. not in end-user applications).
4055
92c2d38634c1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4048
diff changeset
    76
"
92c2d38634c1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4048
diff changeset
    77
!
92c2d38634c1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4048
diff changeset
    78
1893
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    79
examples
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    80
"
3220
1181c3afbb10 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3216
diff changeset
    81
    UserPreferences current toolTipShapeStyle:nil
1181c3afbb10 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3216
diff changeset
    82
    UserPreferences current toolTipShapeStyle:#cartoon
1181c3afbb10 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3216
diff changeset
    83
1893
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    84
     FlyByHelp isActive
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    85
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    86
     FlyByHelp stop
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    87
     FlyByHelp start
f369ffca3d9f *** empty log message ***
ca
parents: 1892
diff changeset
    88
"
1802
ef3539bf86b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1768
diff changeset
    89
! !
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
2692
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
    91
!FlyByHelp class methodsFor:'accessing'!
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
    92
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
    93
currentlyShownView
2846
e90ba00f9df1 changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents: 2826
diff changeset
    94
    TheOneAndOnlyHelpListener isNil ifTrue:[^ nil].
2692
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
    95
    ^ TheOneAndOnlyHelpListener currentlyShownView
2846
e90ba00f9df1 changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents: 2826
diff changeset
    96
e90ba00f9df1 changed: #currentlyShownView
Claus Gittinger <cg@exept.de>
parents: 2826
diff changeset
    97
    "Modified: / 09-06-2010 / 16:35:48 / cg"
3255
358f5696bc0d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3251
diff changeset
    98
!
358f5696bc0d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3251
diff changeset
    99
4231
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   100
helpKeyInsteadOfHelpTextQuery
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   101
    ^ HelpKeyInsteadOfHelpTextQuery
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   102
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   103
    "Created: / 22-02-2019 / 09:38:18 / Claus Gittinger"
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   104
!
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   105
3255
358f5696bc0d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3251
diff changeset
   106
maxNumberOfColumns
358f5696bc0d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3251
diff changeset
   107
    ^ MaxNumberOfColumns ? 200
358f5696bc0d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3251
diff changeset
   108
!
358f5696bc0d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3251
diff changeset
   109
358f5696bc0d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3251
diff changeset
   110
maxNumberOfLines
358f5696bc0d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3251
diff changeset
   111
    ^ MaxNumberOfLines ? 40
2692
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   112
! !
5fe75b7fb83a access to current flyBy
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   113
2684
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
   114
!FlyByHelp methodsFor:'defaults'!
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
   115
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
   116
flyByHelpTimeoutMillis
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
   117
    "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
   118
     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
   119
     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
   120
     it takes too long to parse...
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
   121
     The returned time is given in ms"
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
   122
4360
fb60027a5f52 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4352
diff changeset
   123
    ^ 100
2684
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
   124
! !
de2d170a80ef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2680
diff changeset
   125
4233
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   126
!FlyByHelp methodsFor:'developer menu'!
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   127
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   128
openDeveloperMenuFor:aView at:aPoint
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   129
    "with CTRL+SHIFT, this menu appears"
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   130
    
4322
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   131
    |topView app helpText helpKey|
4233
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   132
    
4318
ca938bab6a5d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4314
diff changeset
   133
    self hideHelp.
ca938bab6a5d #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4314
diff changeset
   134
4322
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   135
    topView := aView topView.
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   136
    app := topView application.
4308
e62f74b5bb34 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4307
diff changeset
   137
    app isNil ifTrue:[ Transcript showCR:'no app for view: %1' with:aView. ^ self ].
e62f74b5bb34 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4307
diff changeset
   138
    
4233
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   139
    app enqueueDelayedAction:[
4322
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   140
        |editor m canDefineTranslationForLabel canDefineTranslationForHelpText menuItem i  viewsApp|
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   141
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   142
        viewsApp := aView application. "/ could be different from top-app (if embedded)
4233
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   143
4290
41b4ee0f8937 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
   144
        canDefineTranslationForHelpText := lastHelpText notEmptyOrNil.
41b4ee0f8937 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
   145
        canDefineTranslationForHelpText := canDefineTranslationForHelpText or:[ (helpText := aView helpTextAt:aPoint) notEmptyOrNil].
41b4ee0f8937 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
   146
        canDefineTranslationForHelpText := canDefineTranslationForHelpText or:[ (helpText := aView helpText) notEmptyOrNil].
41b4ee0f8937 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
   147
        canDefineTranslationForHelpText := canDefineTranslationForHelpText or:[ (helpKey := aView helpKey) notNil].
41b4ee0f8937 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
   148
        canDefineTranslationForHelpText := canDefineTranslationForHelpText or:[ (helpText := app helpTextFor:aView) notEmptyOrNil ].
41b4ee0f8937 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
   149
4233
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   150
        m := Menu new.
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   151
        m addItem:(MenuItem 
4335
b2f54296fd1b #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
   152
            label:(((aView fullXPath ? 'unnamed') contractTo:120) allGray)).
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   153
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   154
        aView isMenu ifTrue:[
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   155
            menuItem := aView itemAtPoint:aPoint.
4314
23fdaa63f239 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   156
            menuItem notNil ifTrue:[
23fdaa63f239 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   157
                m addItem:(MenuItem 
4335
b2f54296fd1b #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
   158
                    label:(('MenuItem''s NameKey: ',(menuItem nameKey printString)) allGray)).
4325
aa9d2231dd43 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4324
diff changeset
   159
                m addItem:(MenuItem 
4335
b2f54296fd1b #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
   160
                    label:(('MenuItem''s Value: ',(menuItem itemValue printString contractTo:40)) allGray)).
4314
23fdaa63f239 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   161
            ]. 
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   162
        ]. 
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   163
        
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   164
        m addSeparator. 
4308
e62f74b5bb34 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4307
diff changeset
   165
        m addItem:(MenuItem 
4290
41b4ee0f8937 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
   166
            label: 'Copy Helptext'
41b4ee0f8937 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
   167
            itemValue:[
41b4ee0f8937 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
   168
                |package key |
41b4ee0f8937 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
   169
41b4ee0f8937 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
   170
                key := (lastHelpText ? helpText ? helpKey) asString string.
4322
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   171
                topView setClipboardText:key.
4290
41b4ee0f8937 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
   172
            ]
41b4ee0f8937 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
   173
            enabled:canDefineTranslationForHelpText).
41b4ee0f8937 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
   174
        m addSeparator.
41b4ee0f8937 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
   175
41b4ee0f8937 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4281
diff changeset
   176
        m addItem:(MenuItem 
4324
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   177
            label: ('Edit Resources (of %1)' bindWith:((app ? aView) class package))
4233
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   178
            itemValue:[ 
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   179
                app enqueueDelayedAction:[
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   180
                    app withWaitCursorDo:[
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   181
                        editor := Tools::InternationalLanguageTranslationEditor
4322
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   182
                                        openOnPackage:((app ? aView) class package).
4233
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   183
                        editor selectOrAddKey:(lastHelpText storeString withoutCRs).
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   184
                        Transcript showCR:'help text is: %1' with:lastHelpText storeString withoutCRs.
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   185
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   186
                    ].    
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   187
                ].    
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   188
            ]).
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   189
        m addItem:(MenuItem 
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   190
            label: 'Browse Resources'
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   191
            itemValue:[ 
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   192
                app enqueueDelayedAction:[
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   193
                    app withWaitCursorDo:[
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   194
                        FileBrowser default 
4322
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   195
                            openOn:(app class packageDirectory / 'resources').
4233
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   196
                    ].    
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   197
                ].    
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   198
            ]).
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   199
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   200
        canDefineTranslationForLabel := 
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   201
            [
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   202
                (aView isKindOf:Label) or:[aView respondsTo:#label]
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   203
            ].    
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   204
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   205
        m addItem:(MenuItem 
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   206
            label: 'Define Translation for Label...'
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   207
            itemValue:[
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   208
                |package key |
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   209
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   210
                key := aView label asString string.
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   211
                package := app class package.
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   212
                ResourcePack defineResourceFor:key package:package.
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   213
            ]
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   214
            enabled:canDefineTranslationForLabel).
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   215
        m addItem:(MenuItem 
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   216
            label: 'Define Translation for Helptext...'
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   217
            itemValue:[
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   218
                |package key |
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   219
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   220
                key := (lastHelpText ? helpText ? helpKey) asString string.
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   221
                package := app class package.
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   222
                ResourcePack defineResourceFor:key package:package.
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   223
            ]
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   224
            enabled:canDefineTranslationForHelpText).
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   225
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   226
        m addSeparator. 
4319
7c98ca2707d8 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4318
diff changeset
   227
        m addItem:(i := MenuItem 
4324
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   228
            label:('Browse Application (%1)' bindWith:(viewsApp ? app) className)
4322
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   229
            itemValue:[ SystemBrowser default openInClass:(viewsApp ? app) class]).
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   230
        i enabled:((viewsApp ? app) notNil).
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   231
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   232
        m addItem:(i := MenuItem 
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   233
            label: 'Browse Application''s helpSpec'
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   234
            itemValue:[ SystemBrowser default openInClass:(viewsApp ? app) class theMetaclass selector:#helpSpec]).
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   235
        i enabled:((viewsApp ? app) notNil and:[(viewsApp ? app) class theMetaclass includesSelector:#helpSpec]).
4319
7c98ca2707d8 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4318
diff changeset
   236
7c98ca2707d8 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4318
diff changeset
   237
        m addItem:(i := MenuItem 
4233
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   238
            label: 'UI Painter'
4322
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   239
            itemValue:[ UIPainter openOnClass:(viewsApp ? app) class andSelector:#windowSpec]).
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   240
        i enabled:((viewsApp ? app) notNil).
4233
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   241
4322
83bda4f64c02 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4320
diff changeset
   242
        viewsApp ~~ app ifTrue:[    
4233
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   243
            m addSeparator. 
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   244
            m addItem:(MenuItem 
4324
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   245
                label:('Browse Top Application (%1)' bindWith:app className)
4233
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   246
                itemValue:[ SystemBrowser default openInClass:app class]).
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   247
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   248
            m addItem:(MenuItem 
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   249
                label: 'UI Painter on Top Application'
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   250
                itemValue:[ UIPainter openOnClass:app class andSelector:#windowSpec]).
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   251
        ].
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   252
        
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   253
        m addSeparator. 
4319
7c98ca2707d8 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4318
diff changeset
   254
        m addItem:(i := MenuItem label: 'Inspect Application' itemValue:[ app inspect ]).
7c98ca2707d8 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4318
diff changeset
   255
        i enabled:(app notNil).
4324
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   256
        m addItem:(i := MenuItem label:('Inspect View (%1)' bindWith:aView className) itemValue:[ aView inspect ]).
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   257
        m addItem:(i := MenuItem label:('Inspect Model (%1)' bindWith:aView model className) itemValue:[ aView model inspect ]).
4319
7c98ca2707d8 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4318
diff changeset
   258
        i enabled:(aView model notNil).
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   259
            
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   260
        menuItem notNil ifTrue:[
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   261
            m addItem:(MenuItem label: 'Inspect Menuitem' itemValue:[ menuItem inspect ]).
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   262
        ].
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   263
        
4233
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   264
        m showAtPointer.
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   265
    ].
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   266
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   267
    "Created: / 22-02-2019 / 09:32:35 / Claus Gittinger"
4314
23fdaa63f239 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   268
    "Modified: / 21-07-2019 / 07:04:08 / Claus Gittinger"
4233
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   269
! !
7bc96946d912 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
   270
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   271
!FlyByHelp methodsFor:'event handling'!
1540
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
   272
2474
ef24105ee7a2 code cleanup (arg-names)
Claus Gittinger <cg@exept.de>
parents: 2392
diff changeset
   273
buttonMotion:buttonAndModifierState x:x y:y view:aView
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   274
    "/ DebuggingEvents := true
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   275
    "/ DebuggingEvents := false
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   276
    DebuggingEvents == true ifTrue:[
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   277
        ('%1: ==== ButtonMotion view:%2' 
4281
1629dc18017e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
   278
                bindWith:self className 
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   279
                with:aView) infoPrintCR.
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   280
    ].
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   281
2519
af89806c67e4 comment
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
   282
    aView == currentHelpView ifTrue:[
af89806c67e4 comment
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
   283
        "/ the help-bubble itself
af89806c67e4 comment
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
   284
        ^ false
af89806c67e4 comment
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
   285
    ].
af89806c67e4 comment
Claus Gittinger <cg@exept.de>
parents: 2518
diff changeset
   286
4055
92c2d38634c1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4048
diff changeset
   287
    "/ don't start tooltip, if this view is not active.
92c2d38634c1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4048
diff changeset
   288
    "/ The following line 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
   289
    "/ 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
   290
    "/      aView topView isActive ifFalse:[^ false].
2477
b009e0b51999 suppress tooltip for inactive (lower) windows
Claus Gittinger <cg@exept.de>
parents: 2474
diff changeset
   291
2474
ef24105ee7a2 code cleanup (arg-names)
Claus Gittinger <cg@exept.de>
parents: 2392
diff changeset
   292
    ^ super buttonMotion:buttonAndModifierState x:x y:y view:aView
4281
1629dc18017e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
   293
1629dc18017e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
   294
    "Modified: / 28-06-2019 / 08:43:54 / Claus Gittinger"
1540
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
   295
!
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
   296
2611
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   297
buttonPress:button x:x y:y view:aView
3198
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   298
    |prevView|
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   299
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   300
    "/ DebuggingEvents := true
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   301
    "/ DebuggingEvents := false
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   302
    DebuggingEvents == true ifTrue:[
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   303
        ('%1: ButtonPress view:%2' 
4281
1629dc18017e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
   304
                bindWith:self className 
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   305
                with:aView) infoPrintCR.
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   306
    ].
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   307
3198
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   308
    "/ hideHelp nils the currentView
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   309
    "/ 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
   310
    "/ until the mouse really leaves the view
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   311
    "/ let's call this the "do-not-show-in-this-view mode"
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   312
    prevView := currentView.
2978
4358a9302b95 changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2925
diff changeset
   313
    self hideHelp.
3198
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   314
    currentView := prevView.
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   315
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   316
    ^ false
2978
4358a9302b95 changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2925
diff changeset
   317
4358a9302b95 changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2925
diff changeset
   318
    "Modified: / 23-12-2011 / 20:37:28 / cg"
4281
1629dc18017e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
   319
    "Modified: / 28-06-2019 / 08:43:57 / Claus Gittinger"
2611
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   320
!
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   321
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   322
keyPress:key x:x y:y view:aView
4308
e62f74b5bb34 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4307
diff changeset
   323
    "care for the special keys:
e62f74b5bb34 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4307
diff changeset
   324
        Ctrl (while help is shown)
e62f74b5bb34 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4307
diff changeset
   325
        L-Shift+R-Shift+Ctrl (while nothing is shown)
e62f74b5bb34 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4307
diff changeset
   326
    "
e62f74b5bb34 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4307
diff changeset
   327
    
4226
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   328
    <resource: #keyboard (#Escape #Control #Shift)>
3216
f9312a1f2e9d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   329
4228
699d09d62316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4227
diff changeset
   330
    |prevView text|
3198
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   331
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   332
    "/ DebuggingEvents := true
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   333
    "/ DebuggingEvents := false
4307
1b0e3ba1d905 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4290
diff changeset
   334
    "/ Debugging := true.
1b0e3ba1d905 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4290
diff changeset
   335
    "/ Debugging := false.
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   336
    DebuggingEvents == true ifTrue:[
4307
1b0e3ba1d905 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4290
diff changeset
   337
        '-----' infoPrintCR.
1b0e3ba1d905 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4290
diff changeset
   338
        ('%1: KeyPress view:%2 (currentHelpView=%3)' 
4281
1629dc18017e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
   339
                bindWith:self className 
4307
1b0e3ba1d905 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4290
diff changeset
   340
                with:aView
1b0e3ba1d905 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4290
diff changeset
   341
                with:currentHelpView) infoPrintCR.
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   342
    ].
2885
a70144d85a81 changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2884
diff changeset
   343
    currentHelpView notNil ifTrue:[
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   344
        "/ Transcript show:'with help view shown: '; showCR:key.
2979
306456bdfb61 comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   345
        key == #Escape ifTrue:[
3198
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   346
            prevView := currentView.
2979
306456bdfb61 comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   347
            self hideHelp.
3198
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   348
            currentView := prevView.
4230
240c17007808 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4228
diff changeset
   349
            ^ false
2885
a70144d85a81 changed: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2884
diff changeset
   350
        ].
4228
699d09d62316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4227
diff changeset
   351
        (#(#'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[
4324
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   352
            Smalltalk isStandAloneApp ifFalse:[
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   353
                aView device shiftDown ifTrue:[
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   354
                    self openDeveloperMenuFor:aView at:x@y.
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   355
                    ^ false
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   356
                ].
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   357
            ].
4226
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   358
            "/ reopen showing the key
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   359
            "/ Transcript show:'re initialize help: '; showCR:key.
4226
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   360
            self initiateHelpFor:aView at:(x@y) now:true.
4230
240c17007808 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4228
diff changeset
   361
            ^ false
4226
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   362
        ].
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   363
        Smalltalk isStandAloneApp ifFalse:[
4352
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   364
            key == $§ ifTrue:[
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   365
                "/ generate a line suitable for the resources file (a null translation)
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   366
                "/ into the clipboard; makes it easy to add missing translations to a .rs file,
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   367
                "/ by pressing paragraph whenever you see an untranslated helptext
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   368
                text := (lastHelpText storeString withoutCRs, '    ' , lastHelpText storeString withoutCRs).
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   369
                aView setClipboardText:text.
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   370
                self hideHelp.
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   371
                ^ false
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   372
            ].
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   373
            (#(#'Shift' #'Shift_L' #'Shift_R') includes:key) ifTrue:[
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   374
                aView device ctrlDown ifTrue:[
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   375
                    self openDeveloperMenuFor:aView at:x@y
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   376
                ].
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   377
                ^ false
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   378
            ].
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   379
        ].        
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   380
        (#('Shift' #'Shift_L' #'Shift_R' ) includes:key) ifTrue:[
3216
f9312a1f2e9d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   381
            "/ do not close on those...
f9312a1f2e9d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   382
            ^ false
f9312a1f2e9d class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   383
        ].
4307
1b0e3ba1d905 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4290
diff changeset
   384
    ] ifFalse:[
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   385
        "/ Transcript show:'without help view shown: '; showCR:key.
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   386
        Smalltalk isStandAloneApp ifFalse:[
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   387
            "/ both shifts AND then ctrl...
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   388
            (#(#'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   389
                aView device leftShiftDown ifTrue:[
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   390
                    aView device rightShiftDown ifTrue:[
4324
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   391
                        self openDeveloperMenuFor:aView at:x@y.
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   392
                        ^ false
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   393
                    ].
4307
1b0e3ba1d905 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4290
diff changeset
   394
                ].
4324
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   395
            ].
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   396
            (#('Shift' #'Shift_L' #'Shift_R' ) includes:key) ifTrue:[
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   397
                aView device ctrlDown ifTrue:[
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   398
                    aView device leftShiftDown ifTrue:[
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   399
                        aView device rightShiftDown ifTrue:[
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   400
                            self openDeveloperMenuFor:aView at:x@y.
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   401
                            ^ false
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   402
                        ].
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   403
                    ].
4abfa60cfe51 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4322
diff changeset
   404
                ].
4307
1b0e3ba1d905 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4290
diff changeset
   405
            ].
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   406
        ].    
4226
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   407
    ].    
3198
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   408
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   409
    "/ hideHelp nils the currentView
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   410
    "/ 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
   411
    "/ until the mouse really leaves the view
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   412
    "/ let's call this the "do-not-show-in-this-view mode"
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   413
    prevView := currentView.
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   414
    self hideHelpIgnoringErrors.
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   415
    currentView := prevView.
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   416
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   417
    ^ false
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   418
    "/ ^ 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
   419
2979
306456bdfb61 comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   420
    "Modified (format): / 25-12-2011 / 10:25:23 / cg"
4082
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   421
    "Modified (format): / 16-04-2018 / 16:53:15 / stefan"
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   422
    "Modified: / 20-07-2019 / 08:55:01 / Claus Gittinger"
4226
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   423
!
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   424
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   425
keyRelease:key x:x y:y view:aView
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   426
    <resource: #keyboard (#Control)>
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   427
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   428
    "/ DebuggingEvents := true
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   429
    "/ DebuggingEvents := false
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   430
    DebuggingEvents == true ifTrue:[
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   431
        ('%1: KeyRelease view:%2' 
4281
1629dc18017e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
   432
                bindWith:self className 
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   433
                with:aView) infoPrintCR.
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   434
    ].
4226
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   435
    currentHelpView notNil ifTrue:[
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   436
        (#(#'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   437
            "/ reopen showing the text
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   438
            self initiateHelpFor:aView at:(x@y) now:true.
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   439
            ^ true
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   440
        ].
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   441
        (#('Shift' #'Shift_L' #'Shift_R' #'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   442
            "/ do not close on those...
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   443
            ^ false
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   444
        ].
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   445
    ].
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   446
    ^ super keyRelease:key x:x y:y view:aView
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   447
d1dcdcb20574 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4220
diff changeset
   448
    "Created: / 20-02-2019 / 11:26:19 / Claus Gittinger"
4281
1629dc18017e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
   449
    "Modified: / 28-06-2019 / 08:44:06 / Claus Gittinger"
2611
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   450
!
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   451
2521
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   452
mouseWheelMotion:state x:x y:y amount:amount deltaTime:dTime view:aView
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   453
    "/ DebuggingEvents := true
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   454
    "/ DebuggingEvents := false
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   455
    DebuggingEvents == true ifTrue:[
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   456
        ('%1: MouseWheel view:%2' 
4281
1629dc18017e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
   457
                bindWith:self className 
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   458
                with:aView) infoPrintCR.
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   459
    ].
2521
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   460
    currentHelpView notNil ifTrue:[
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   461
        self handleMouseIn:aView x:x y:y.
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   462
    ].
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   463
    ^ false
4281
1629dc18017e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
   464
1629dc18017e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
   465
    "Modified: / 28-06-2019 / 08:44:10 / Claus Gittinger"
2521
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   466
!
7e51aa294156 care for mousewheel while showing help
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   467
1540
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
   468
pointerLeave:state view:aView
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   469
    "/ DebuggingEvents := true
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   470
    "/ DebuggingEvents := false
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   471
    DebuggingEvents == true ifTrue:[
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   472
        ('%1: **** PointerLeave view:%2' 
4281
1629dc18017e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
   473
                bindWith:self className 
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   474
                with:aView) infoPrintCR.
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   475
    ].
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   476
2611
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   477
    aView == currentHelpView ifTrue:[^ true].
3198
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   478
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   479
    "/ clear the do-not-show-in-this-view mode (see keyPress)
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   480
"/     (currentHelpView isNil and:[currentView notNil]) ifTrue:[currentView := nil].
a43053b56eb3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3114
diff changeset
   481
2611
f578b9c43a6f handle escape key to close flyByHelp
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
   482
    ^ super pointerLeave:state view:aView
4281
1629dc18017e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
   483
1629dc18017e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
   484
    "Modified: / 28-06-2019 / 08:44:13 / Claus Gittinger"
1540
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
   485
! !
f6948fc36460 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1536
diff changeset
   486
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   487
!FlyByHelp methodsFor:'help texts'!
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   488
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   489
helpTextFromModel:aModel view:aView at:aPointOrNil 
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   490
    "helper: ask aModel for its helpText."
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   491
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   492
    |text|
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   493
4048
eceffed47e1c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4040
diff changeset
   494
    (aPointOrNil notNil and:[aModel respondsTo:#helpTextFor:at:]) ifTrue:[
eceffed47e1c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4040
diff changeset
   495
        text := aModel helpTextFor:aView at:aPointOrNil.
4121
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   496
        text notNil ifTrue:[
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   497
            "/ Transcript showCR:aModel.
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   498
            "/ Transcript showCR:'via model-text'; showCR:text.
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   499
            ^ text
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   500
        ].
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   501
    ].
4048
eceffed47e1c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4040
diff changeset
   502
    (aModel respondsTo:#helpTextFor:) ifTrue:[
eceffed47e1c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4040
diff changeset
   503
        text := aModel helpTextFor:aView.
4121
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   504
        text notNil ifTrue:[
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   505
            "/ Transcript showCR:aModel.
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   506
            "/ Transcript showCR:'via model-text'; showCR:text.
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   507
            ^ text
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   508
        ].
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
    ].
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   510
    ^ nil
4040
1d540ba7a1d1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3959
diff changeset
   511
1d540ba7a1d1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3959
diff changeset
   512
    "Modified: / 09-01-2018 / 17:35:26 / stefan"
4121
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   513
    "Modified: / 11-06-2018 / 09:53:40 / Claus Gittinger"
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   514
!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   515
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   516
helpTextFromView:aView at:aPointOrNil 
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   517
    "helper: ask aView for its helpText."
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   518
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   519
    |text key app|
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   520
4121
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   521
    "/ is there any view which does not understand helpTextAt: ???
4048
eceffed47e1c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4040
diff changeset
   522
    (aPointOrNil notNil and:[aView respondsTo:#helpTextAt:]) ifTrue:[
eceffed47e1c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4040
diff changeset
   523
        text := aView helpTextAt:aPointOrNil.
4121
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   524
        text notNil ifTrue:[
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   525
            "/ Transcript showCR:'via helpTextAt:'; showCR:text.
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   526
            ^ text
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   527
        ].
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   528
    ].
4121
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   529
    "/ is there any view which does not understand helpText ???
4048
eceffed47e1c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4040
diff changeset
   530
    (aView respondsTo:#helpText) ifTrue:[
eceffed47e1c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4040
diff changeset
   531
        text := aView helpText.
4121
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   532
        text notNil ifTrue:[
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   533
            "/ Transcript showCR:'via helpText'; showCR:text.
4220
3cd77e608abb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4175
diff changeset
   534
            ^ text value
4121
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   535
        ].
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   536
    ].
3804
23207b26bfee #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3803
diff changeset
   537
    "/ to be enabled in next release...
23207b26bfee #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3803
diff changeset
   538
"/    (aView superView notNil
4048
eceffed47e1c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4040
diff changeset
   539
"/    and:[aView superView respondsTo:#helpTextFor:]) ifTrue:[
eceffed47e1c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4040
diff changeset
   540
"/        text := aView superView helpTextFor:aView.
3804
23207b26bfee #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3803
diff changeset
   541
"/        text notNil ifTrue:[^ text].
23207b26bfee #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3803
diff changeset
   542
"/    ].
4121
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   543
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   544
    "/ is there any view which does not understand helpKey ???
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   545
    (aView respondsTo:#helpKey) ifTrue:[
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   546
        key := aView helpKey.
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   547
        key notNil ifTrue:[
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   548
            app := aView application.
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   549
            app isNil ifTrue:[
4175
b78ca1f5c2ee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
   550
                |topView topViewsHelpSpec|
b78ca1f5c2ee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
   551
                
3763
72a6db06eee5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3681
diff changeset
   552
                "/ special case for oldStyle Dialog subclasses.
4175
b78ca1f5c2ee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
   553
                topView := aView topView.
b78ca1f5c2ee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
   554
                (topViewsHelpSpec := topView helpSpec) notNil ifTrue:[
b78ca1f5c2ee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
   555
                    text := topViewsHelpSpec at:key ifAbsent:nil.
3763
72a6db06eee5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3681
diff changeset
   556
                    text notNil ifTrue:[
4121
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   557
                        "/ Transcript showCR:'via topViewspec+helpKey'; showCR:text.
4175
b78ca1f5c2ee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
   558
                        ^ topView resources stringWithCRs:text.
3763
72a6db06eee5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3681
diff changeset
   559
                    ].    
72a6db06eee5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3681
diff changeset
   560
                ].    
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   561
                app := Error handle:[:ex | nil] do:[ aView windowGroup mainGroup application ].
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   562
            ].
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   563
            app notNil ifTrue:[
4121
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   564
                text := app helpTextForKey:key.
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   565
                true "text notNil" ifTrue:[
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   566
                    "/ Transcript showCR:'via helpKey+helpTextForKey:'; showCR:text.
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   567
                    ^ text
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   568
                ].
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   569
            ].
4121
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   570
            text := aView resources string:key.
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   571
            true "(text notNil and:[text ~= key])" ifTrue:[
c9c15ae83c1c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
   572
                "/ Transcript showCR:'via helpKey'; showCR:text.
4110
1a4cf666aafe #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4082
diff changeset
   573
                ^ text
1a4cf666aafe #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4082
diff changeset
   574
            ]    
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   575
        ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   576
    ].
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   577
    ^ nil.
4040
1d540ba7a1d1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3959
diff changeset
   578
1d540ba7a1d1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3959
diff changeset
   579
    "Modified: / 09-01-2018 / 17:38:42 / stefan"
4111
f42780e51cc1 #REFACTORING by sr
sr
parents: 4110
diff changeset
   580
    "Modified (format): / 07-06-2018 / 09:51:41 / sr"
4220
3cd77e608abb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4175
diff changeset
   581
    "Modified: / 07-02-2019 / 19:18:39 / Claus Gittinger"
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   582
! !
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   583
4119
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   584
!FlyByHelp methodsFor:'queries'!
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   585
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   586
currentlyShownView
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   587
    ^ currentHelpView
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   588
!
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   589
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   590
toolTipFollowsMouse
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   591
    "if true, the tooltip-window moves with the pointer
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   592
     so that it stays away from (does not cover) the mouse pointer"
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   593
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   594
    ^ false
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   595
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   596
    "Modified: / 06-06-2018 / 17:37:19 / Claus Gittinger"
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   597
! !
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   598
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   599
!FlyByHelp methodsFor:'show & hide help'!
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   600
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   601
activeHelpViewForApplication:applicationOrNil text:helpText onDevice:aDevice
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   602
    applicationOrNil notNil ifTrue:[
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   603
        ^ applicationOrNil activeHelpViewFor:helpText onDevice:aDevice
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   604
    ].
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   605
    ^ ActiveHelpView for:helpText onDevice:aDevice.
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   606
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   607
    "
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   608
     (ActiveHelpView for:'Hello' onDevice:Display) open
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   609
    "
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   610
!
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   611
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   612
hideHelp
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   613
    "hide the help text"
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   614
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   615
    |p v|
4119
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   616
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   617
    "/ lastHelpText := nil.
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   618
    self stopHelpDisplayProcess.
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   619
    lastHelpText := nil.
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   620
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   621
    currentHelpView notNil ifTrue:[
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   622
        [
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   623
            (v := currentHelpView) notNil ifTrue:[
4119
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   624
                currentHelpView := nil.
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   625
                v destroy.
4119
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   626
                currentView := nil.
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   627
            ]
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   628
        ] valueUninterruptably
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   629
    ].
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   630
    
4119
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   631
    currentFrame := nil.
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   632
    (p := closeProcess) notNil ifTrue:[
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   633
        closeProcess := nil.
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   634
        p terminate.
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   635
    ]
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   636
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   637
    "Modified: / 28-06-1997 / 14:03:50 / cg"
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   638
    "Modified: / 16-04-2018 / 16:51:01 / stefan"
4313
d390ecfb7670 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4308
diff changeset
   639
    "Modified: / 20-07-2019 / 08:48:34 / Claus Gittinger"
4119
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   640
!
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   641
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   642
hideIfPointerLeft:aView
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   643
    "hide help, if the pointer is not in aView"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   644
4119
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   645
    |helpFrame whereOnScreen|
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   646
4119
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   647
    (helpFrame := currentFrame) notNil ifTrue:[
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   648
        whereOnScreen := aView graphicsDevice pointerPosition.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   649
4119
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   650
        ((helpFrame insetBy:1@1) containsPoint:whereOnScreen) ifFalse:[
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   651
            self hideHelp.
4119
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   652
        ] ifTrue:[
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   653
            pointerPositionAtShowTime notNil ifTrue:[
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   654
                (whereOnScreen dist:pointerPositionAtShowTime) > 10 ifTrue:[
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   655
                    self hideHelp.
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   656
                ].    
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   657
            ].    
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   658
        ].            
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   659
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   660
4082
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   661
    "Modified: / 28-05-1996 / 20:18:28 / cg"
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   662
    "Modified: / 16-04-2018 / 16:59:48 / stefan"
4119
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   663
    "Modified: / 08-06-2018 / 10:30:04 / Claus Gittinger"
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   664
!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   665
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   666
initiateHelpFor:aView at:aPointOrNil now:showItNow
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   667
    "ask aView for helpText, passing x/y coordinates;
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   668
     start a timeout process to display this helpText after some delay;
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   669
     Normally used internally, but can also be used by widgets to force 
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   670
     re-negotiation of the displayed helpText 
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   671
     (for example in a menu, when the selection changes)"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   672
4110
1a4cf666aafe #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4082
diff changeset
   673
    |text delayTime|
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   674
4352
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   675
    "/ Timestamp now infoPrint. ' initiate ' infoPrint. aView infoPrint. ' ' infoPrint. aPointOrNil infoPrintCR.
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   676
    Debugging ifTrue:[
4281
1629dc18017e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
   677
        ('%1: initiateHelpFor:at:now: %2' bindWith:self className with:aView) infoPrintCR.
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   678
    ].
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   679
    (self interestedIn:aView) ifFalse:[
4237
4c0ddd2ce72e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4233
diff changeset
   680
        Debugging ifTrue:[
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   681
            ('%1: not interested' bindWith:self class name) infoPrintCR
4352
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   682
        ].
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   683
        "/ showProcess notNil ifTrue:[self halt].
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   684
        "/ Timestamp now infoPrint. ' hide1 ' infoPrint. aPointOrNil infoPrintCR.
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   685
        self hideHelp.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   686
        ^ self
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   687
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   688
2680
Claus Gittinger <cg@exept.de>
parents: 2679
diff changeset
   689
    "/ 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
   690
    "/ 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
   691
    [
2826
74bd82edee5a changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   692
        Error handle:[:ex |
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   693
            ('%1: [warning]: error while asking for helpText: %2' bindWith:self class name with:ex description) errorPrintCR.
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   694
            '-------------------------' errorPrintCR.
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   695
            ex suspendedContext fullPrintAllOn:(Transcript ? Stderr).
2872
ea7e6fe01727 comment/format in: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   696
            "/ self halt.
2826
74bd82edee5a changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   697
        ] do:[
4231
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   698
            HelpKeyInsteadOfHelpTextQuery answer:(aView device ctrlDown) do:[
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   699
                text := self helpTextFor:aView at:aPointOrNil.
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   700
            ].
2826
74bd82edee5a changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   701
        ].
3656
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
   702
    ] valueWithWatchDog:[ 
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   703
        ('%1 [info]: flyBy text generation took too long' bindWith:self class name) infoPrintCR.
4352
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   704
        self hideHelp.
3656
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
   705
        ^ self 
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
   706
    ] afterMilliseconds:(self flyByHelpTimeoutMillis).
2679
552847065fb3 car not to hog the cpu by flyByHelp processing
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
   707
4110
1a4cf666aafe #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4082
diff changeset
   708
    false ifTrue:[
1a4cf666aafe #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4082
diff changeset
   709
        (text notNil and:[text isEmpty]) ifTrue:[ 
1a4cf666aafe #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4082
diff changeset
   710
            Logger warning:('empty help from: ',aView class printString)
1a4cf666aafe #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4082
diff changeset
   711
        ] ifFalse:[
1a4cf666aafe #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4082
diff changeset
   712
            text isEmptyOrNil ifTrue:[ 
1a4cf666aafe #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4082
diff changeset
   713
                Logger warning:('no help from: ',aView class printString)
1a4cf666aafe #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4082
diff changeset
   714
            ].
1a4cf666aafe #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4082
diff changeset
   715
        ].
1a4cf666aafe #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4082
diff changeset
   716
    ].
1a4cf666aafe #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4082
diff changeset
   717
    
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   718
    (lastHelpText = text and:[lastHelpWidget == aView]) ifTrue:[
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   719
        "/ Debugging := true
4237
4c0ddd2ce72e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4233
diff changeset
   720
        Debugging == true ifTrue:[
4c0ddd2ce72e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4233
diff changeset
   721
            'same text: ' infoPrint. text infoPrintCR.
4c0ddd2ce72e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4233
diff changeset
   722
        ].    
4082
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   723
        self toolTipFollowsMouse ifFalse:[
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   724
            Debugging == true ifTrue:[
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   725
                'tooltip does not follow mouse: ' infoPrint. text infoPrintCR.
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   726
            ].    
4352
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   727
            "/ Timestamp now infoPrint. ' same; keep ' infoPrint. aPointOrNil infoPrintCR.
4082
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   728
            ^ self
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   729
        ]
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   730
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   731
4352
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   732
    showProcess notNil ifTrue:[
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   733
        self stopHelpDisplayProcess.
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   734
    ].
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   735
    "/ Timestamp now infoPrint. ' hide2 ' infoPrint. aPointOrNil infoPrintCR.
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   736
    self hideHelp.
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   737
4110
1a4cf666aafe #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4082
diff changeset
   738
    ((text size > 0) or:[text notNil and:[text isString not]]) ifTrue:[
4352
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   739
        self stopHelpDisplayProcess.
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   740
        "/ Timestamp now infoPrint. ' hide3 ' infoPrint. aPointOrNil infoPrintCR.
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   741
        self hideHelp.
2778
8b91cf06a145 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
   742
        (showItNow not and:[(delayTime := self delayTime) > 0]) ifTrue:[
4352
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   743
            "/ Timestamp now infoPrint. ' start ' infoPrint. aPointOrNil infoPrintCR.
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   744
            showProcess := 
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   745
                [
2680
Claus Gittinger <cg@exept.de>
parents: 2679
diff changeset
   746
                    Delay waitForSeconds:delayTime.
2774
7894ba397774 changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
   747
                    [
3766
4d3c0206456a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   748
                        aView device notNil ifTrue:[    
4d3c0206456a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   749
                            aView device anyButtonPressed ifFalse:[
4d3c0206456a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   750
                                showProcess := nil.
4d3c0206456a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   751
                                self showHelp:text for:aView
4d3c0206456a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   752
                            ]
4d3c0206456a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3763
diff changeset
   753
                        ].
2774
7894ba397774 changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
   754
                    ] ensure:[
7894ba397774 changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
   755
                        showProcess := nil.
2680
Claus Gittinger <cg@exept.de>
parents: 2679
diff changeset
   756
                    ]
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   757
                ] forkAt:(Processor userSchedulingPriority + 1).
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   758
        ] ifFalse:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   759
            self showHelp:text for:aView
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   760
        ]
1542
f63515aab510 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1540
diff changeset
   761
    ] ifFalse:[
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   762
        Debugging == true ifTrue:[
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   763
            'empty text: ' infoPrint. text infoPrintCR.
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   764
        ].    
4352
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   765
        "/ Timestamp now infoPrint. ' hide4 ' infoPrint. aPointOrNil infoPrintCR.
1542
f63515aab510 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1540
diff changeset
   766
        self hideHelp
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   767
    ].
2872
ea7e6fe01727 comment/format in: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2848
diff changeset
   768
2901
fed697afcef8 changed: #initiateHelpFor:at:now:
Claus Gittinger <cg@exept.de>
parents: 2900
diff changeset
   769
    "Modified: / 22-03-2011 / 19:10:28 / cg"
4082
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   770
    "Modified: / 16-04-2018 / 12:20:33 / stefan"
4281
1629dc18017e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
   771
    "Modified: / 28-06-2019 / 08:44:00 / Claus Gittinger"
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   772
!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   773
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   774
showHelp:aHelpText for:view
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   775
    "show the help text for aView"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   776
3786
c628a30083c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
   777
    |wg applicationOrNil org p v device helpTextShown textLines
3334
d334c9dd9b76 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3321
diff changeset
   778
     helpViewWidth helpViewHeight usableWidth monitorBounds usableHeight
4119
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   779
     showTime cursorView pos pointerPosition|
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   780
2781
31725cdfbe43 leftover print
Claus Gittinger <cg@exept.de>
parents: 2780
diff changeset
   781
    "/ thisContext fullPrintAllOn:Transcript.
2651
7275384a60c7 care for nil windowGroup
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
   782
    (wg := view windowGroup) notNil ifTrue:[
7275384a60c7 care for nil windowGroup
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
   783
        wg isInModalLoop ifTrue:[
7275384a60c7 care for nil windowGroup
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
   784
            wg isModal ifFalse:[
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   785
                Debugging ifTrue:[ 'FlyByHelp: not modal' infoPrintCR ].
2651
7275384a60c7 care for nil windowGroup
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
   786
                ^ self
7275384a60c7 care for nil windowGroup
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
   787
            ].
2628
03a41945fb37 do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   788
        ].
03a41945fb37 do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   789
    ].
03a41945fb37 do not show flyBy help for a view,
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   790
3786
c628a30083c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
   791
    device := view graphicsDevice.
4119
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   792
    pointerPosition := device pointerPosition.
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   793
    
3418
a758dd978f99 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
   794
    "/ mouse still over that view?
4119
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   795
    cursorView := device viewFromPoint:pointerPosition.
3418
a758dd978f99 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
   796
    cursorView ~~ view ifTrue:[
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   797
        Debugging ifTrue:[ 'FlyByHelp: mouse no longer in view' infoPrintCR ].
3418
a758dd978f99 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
   798
        ^ self
a758dd978f99 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
   799
    ].
a758dd978f99 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3394
diff changeset
   800
4082
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   801
    (view == currentView and:[lastHelpText = aHelpText]) ifTrue:[
4252
ebdd626ee83b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4237
diff changeset
   802
        Debugging ifTrue:[ 'FlyByHelp: same text and widget' infoPrintCR ].
4082
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   803
        ^ self
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   804
    ].
4119
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   805
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   806
    pointerPositionAtShowTime := pointerPosition.
3228
187a4158a51a class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3220
diff changeset
   807
    lastHelpWidget := view.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   808
    lastHelpText := aHelpText.
3251
afc7d588b25b handle key press and close help.
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
   809
    helpTextShown := aHelpText.
4129
f6e152e7c328 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4121
diff changeset
   810
    
3257
382b74692cfc class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3255
diff changeset
   811
    "/ the text originator must already have generated CRs;
4114
4b0db85537e0 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4111
diff changeset
   812
    "/ 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
   813
    textLines := helpTextShown isStringCollection 
c56b665d08a7 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3675
diff changeset
   814
                    ifTrue:[helpTextShown]
3767
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   815
                    ifFalse:[ 
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   816
                        helpTextShown isString 
4129
f6e152e7c328 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4121
diff changeset
   817
                            ifTrue:[helpTextShown asCollectionOfLines asStringCollection]
3767
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   818
                            ifFalse:[nil]].
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   819
    textLines notNil ifTrue:[
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   820
        textLines size > (self class maxNumberOfLines) ifTrue:[
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   821
            textLines := (textLines copyTo:(self class maxNumberOfLines)) copyWith:'...'
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   822
        ].
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   823
        textLines := textLines collect:[:l | l contractAtEndTo:(self class maxNumberOfColumns)].
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   824
        helpTextShown := textLines asString.
3251
afc7d588b25b handle key press and close help.
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
   825
    ].
3767
d88339439fb4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3766
diff changeset
   826
    
2780
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   827
    (p := closeProcess) notNil ifTrue:[
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   828
        closeProcess := nil.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   829
        p terminate.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   830
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   831
    currentHelpView notNil ifTrue:[
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   832
        self hideHelp
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   833
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   834
3770
690e17824673 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3769
diff changeset
   835
    "/ Transcript showCR:helpTextShown storeString.
3769
09e08477457d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3767
diff changeset
   836
    helpTextShown isEmptyOrNil ifTrue:[^ self].
09e08477457d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3767
diff changeset
   837
    
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   838
    org := view originRelativeTo:nil.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   839
    currentFrame := org extent:view extent.
2848
43346e94b6ce changed: #showHelp:for:
Claus Gittinger <cg@exept.de>
parents: 2846
diff changeset
   840
    org := org + (view extent // 2).
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   841
3248
d72c8e4f7684 more control over the shape style
Claus Gittinger <cg@exept.de>
parents: 3247
diff changeset
   842
    wg notNil ifTrue:[ applicationOrNil := wg application ].
3786
c628a30083c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
   843
    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
   844
    v perform:#controllingHelpListener: with:self ifNotUnderstood:[].
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   845
2848
43346e94b6ce changed: #showHelp:for:
Claus Gittinger <cg@exept.de>
parents: 2846
diff changeset
   846
    helpViewWidth := v width.
43346e94b6ce changed: #showHelp:for:
Claus Gittinger <cg@exept.de>
parents: 2846
diff changeset
   847
    helpViewHeight := v height.
1677
dc49ab70b762 open helpView on the correcdt device
Claus Gittinger <cg@exept.de>
parents: 1657
diff changeset
   848
4082
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   849
    "https://expeccoalm.exept.de/D226383: keep the help window away from the pointer under any circumstances
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   850
     (especially when the window touches the bottom or the right edge of the screen).
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   851
     When the pointer is no longer in the current window, the help window is closed!!"
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   852
    pos := device pointerPosition.
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   853
    org := pos + (10@18).
3786
c628a30083c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
   854
    monitorBounds := device monitorBoundsAt:org.
3114
fb742db4ee12 class: FlyByHelp
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
   855
    usableWidth := monitorBounds width - 2.
3786
c628a30083c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3770
diff changeset
   856
    usableHeight := device usableHeightAt:org.
3114
fb742db4ee12 class: FlyByHelp
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
   857
fb742db4ee12 class: FlyByHelp
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
   858
    helpViewWidth > usableWidth ifTrue:[v width:(helpViewWidth := usableWidth)].    
3247
768269b26ad3 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3243
diff changeset
   859
    helpViewHeight > usableHeight ifTrue:[v height:(helpViewHeight := usableHeight)].    
3114
fb742db4ee12 class: FlyByHelp
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
   860
fb742db4ee12 class: FlyByHelp
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
   861
    (org x + helpViewWidth) > (monitorBounds left + usableWidth) ifTrue:[
4082
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   862
        org x:(monitorBounds left + usableWidth - helpViewWidth).
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   863
    ].
3114
fb742db4ee12 class: FlyByHelp
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
   864
    (org y + helpViewHeight) > (monitorBounds top + usableHeight) ifTrue:[
4082
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   865
        org y:(monitorBounds top + usableHeight - helpViewHeight).
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   866
    ].
4082
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   867
    ((org extent:v extent) containsPoint:pos) ifTrue:[
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   868
        "pointer would be in the help window (see comment above).
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   869
         Help window is at the lower right edge. Move it to the left of the pointer"
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   870
        org x:(pos x - helpViewWidth - 20).
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   871
    ].
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   872
    v origin:org.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   873
    v realize.
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   874
    currentHelpView := v.
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   875
    currentView := view.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   876
3334
d334c9dd9b76 class: FlyByHelp
Claus Gittinger <cg@exept.de>
parents: 3321
diff changeset
   877
    showTime := self showTime.
4082
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   878
    (showTime > 0) ifTrue:[
3959
63a594820146 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3804
diff changeset
   879
        p :=
63a594820146 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3804
diff changeset
   880
            [
1546
1af738601dae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1542
diff changeset
   881
                [
4082
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   882
                    Delay waitForSeconds:showTime.
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   883
                    [
2780
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   884
                        |v|
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   885
                        (v := currentHelpView) notNil ifTrue:[
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   886
                            currentHelpView := nil.
2780
82e3e1061ae7 changed:
Claus Gittinger <cg@exept.de>
parents: 2778
diff changeset
   887
                            v destroy.
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   888
                        ]
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   889
                    ] valueUninterruptably
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   890
                ] ifCurtailed:[
3959
63a594820146 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3804
diff changeset
   891
                    (p == closeProcess) ifTrue:[ closeProcess := nil ].
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   892
                ].
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   893
            ] newProcess.
3959
63a594820146 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3804
diff changeset
   894
        p priority:(Processor userSchedulingPriority + 1).
63a594820146 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3804
diff changeset
   895
        closeProcess := p.
63a594820146 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3804
diff changeset
   896
        p resume.
2392
02244f5708b7 reafctored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   897
    ].
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   898
1963
fb6663696d20 removed withCRs in showHelp:
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
   899
    "Modified: / 31-08-1995 / 19:20:45 / claus"
3959
63a594820146 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3804
diff changeset
   900
    "Modified: / 06-06-2017 / 15:06:41 / cg"
4082
f2ffa50dcf0b #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4055
diff changeset
   901
    "Modified (format): / 16-04-2018 / 17:29:10 / stefan"
4119
eaee0352efdd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4114
diff changeset
   902
    "Modified: / 08-06-2018 / 10:28:32 / Claus Gittinger"
4129
f6e152e7c328 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4121
diff changeset
   903
    "Modified (format): / 14-06-2018 / 08:29:43 / Claus Gittinger"
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   904
!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   905
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   906
stopHelpDisplayProcess
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   907
    |p|
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   908
2680
Claus Gittinger <cg@exept.de>
parents: 2679
diff changeset
   909
    (p := showProcess) notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2679
diff changeset
   910
        showProcess := nil.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   911
        p terminate.
4352
e5b15f481e1e #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4335
diff changeset
   912
        "/ Timestamp now infoPrint. ' stop' infoPrintCR.
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   913
    ].
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   914
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   915
    "Created: 28.6.1997 / 14:03:17 / cg"
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   916
! !
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   917
4231
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   918
!FlyByHelp::HelpKeyInsteadOfHelpTextQuery class methodsFor:'documentation'!
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   919
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   920
documentation
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   921
"
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   922
    kludge to force application to return the helpKey instead of the
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   923
    help text. 
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   924
    Answering true will tell the ApplicationModel to return the key.
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   925
    (see AppModel >> helpTextForKey:)
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   926
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   927
    [author:]
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   928
        Claus Gittinger
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   929
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   930
    [instance variables:]
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   931
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   932
    [class variables:]
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   933
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   934
    [see also:]
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   935
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   936
"
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   937
! !
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   938
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   939
!FlyByHelp::HelpKeyInsteadOfHelpTextQuery methodsFor:'defaults'!
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   940
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   941
defaultResumeValue
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   942
    ^ false
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   943
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   944
    "Created: / 22-02-2019 / 09:48:28 / Claus Gittinger"
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   945
! !
5542e515b2d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4230
diff changeset
   946
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   947
!FlyByHelp class methodsFor:'documentation'!
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   948
2979
306456bdfb61 comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   949
version
3656
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
   950
    ^ '$Header$'
2979
306456bdfb61 comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   951
!
306456bdfb61 comment in: #keyPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   952
2754
4c3b40eba71b changed:
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   953
version_CVS
3656
de582c82fa70 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3418
diff changeset
   954
    ^ '$Header$'
1536
fa0601a87d6e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   955
! !
3114
fb742db4ee12 class: FlyByHelp
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
   956