CodeCompletionHelpView.st
author Claus Gittinger <cg@exept.de>
Mon, 20 Jan 2020 21:02:47 +0100
changeset 19422 c6ca1c3e0fd7
parent 19304 1304be6172f7
permissions -rw-r--r--
#REFACTORING by exept class: MultiViewToolApplication added: #askForFile:default:forSave:thenDo: changed: #askForFile:default:thenDo: #askForFile:thenDo: #menuSaveAllAs #menuSaveAs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2013 by Claus Gittinger
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libtool' }"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
    14
"{ NameSpace: Smalltalk }"
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
    15
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
View subclass:#CodeCompletionHelpView
19182
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
    17
	instanceVariableNames:'myView editView delayedCloseAction checkAction
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
    18
		closeOnPointerLeave pointerEntered'
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	classVariableNames:''
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	poolDictionaries:''
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	category:'Interface-Help'
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!CodeCompletionHelpView class methodsFor:'documentation'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
copyright
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 COPYRIGHT (c) 2013 by Claus Gittinger
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
              All Rights Reserved
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 This software is furnished under a license and may be used
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 only in accordance with the terms of that license and with the
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 be provided or otherwise made available to, or used by, any
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 other person.  No title to or ownership of the software is
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 hereby transferred.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
documentation
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
13479
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
    42
    used with code completion suggestions
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    [author:]
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
        Claus Gittinger
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    [See also:]
13479
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
    48
        ActiveHelp Workspace::CodeCompletionService
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
! !
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
!CodeCompletionHelpView class methodsFor:'instance creation'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
with:aView
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
    "create a talking-view wrapping some other view"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
    ^ self new withView:aView
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
    "
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
     (ActiveHelpView with:(TextView new)) realize
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
     (ActiveHelpView with:(TextView new)) open
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
     (ActiveHelpView with:(Button label:'ok')) open
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    "
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
    "Modified: 27.4.1996 / 15:14:18 / cg"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
! !
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
!CodeCompletionHelpView methodsFor:'accessing'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
19182
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
    70
closeOnPointerLeave:aBoolean
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
    71
    closeOnPointerLeave := aBoolean.
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
    72
!
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
    73
14152
b13faf727c2c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13670
diff changeset
    74
editView:aView
19181
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
    75
    "my code editor view"
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
    76
14152
b13faf727c2c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13670
diff changeset
    77
    editView := aView
b13faf727c2c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13670
diff changeset
    78
!
b13faf727c2c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13670
diff changeset
    79
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
withView:aView
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
    "set the component view"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    |fg|
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
    (aView isKindOf:Label) ifTrue:[
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
        aView viewBackground:viewBackground.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
        aView backgroundColor:viewBackground.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
        (fg := styleSheet colorAt:#'activeHelp.foregroundColor' default:nil) notNil ifTrue:[
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
            aView foregroundColor:fg.    
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
        ].
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
    ].
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
    self addSubView:aView.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
    myView := aView.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    myView borderWidth:0.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    myView origin:(0.0@0.0) corner:(1.0@1.0).
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
19182
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
    97
    self enableDelegation.
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
    98
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    "Modified: 27.4.1996 / 15:16:46 / cg"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
! !
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   102
!CodeCompletionHelpView methodsFor:'event handling'!
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   103
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   104
delayedClose
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   105
    self delayedUnmap
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   106
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   107
    "Created: / 05-08-2018 / 03:16:26 / Claus Gittinger"
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   108
!
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   109
18319
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   110
delayedDestroy
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   111
    (subViews notEmptyOrNil) ifTrue:[
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   112
        self topView destroy
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   113
    ].
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   114
    ^ true
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   115
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   116
    "Created: / 04-08-2018 / 21:25:48 / Claus Gittinger"
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   117
!
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   118
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   119
delayedUnmap
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   120
    (subViews notEmptyOrNil) ifTrue:[
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   121
        self topView unmap
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   122
    ].
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   123
    ^ true
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   124
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   125
    "Created: / 05-08-2018 / 03:12:39 / Claus Gittinger"
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   126
!
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   127
19181
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   128
focusIn
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   129
    self uninstallDelayedClose.
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   130
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   131
    "Created: / 04-08-2018 / 10:41:59 / Claus Gittinger"
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   132
    "Modified: / 05-08-2018 / 03:12:58 / Claus Gittinger"
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   133
!
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   134
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   135
focusOut
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   136
    self installDelayedClose.
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   137
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   138
    "Created: / 04-08-2018 / 10:41:59 / Claus Gittinger"
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   139
    "Modified: / 05-08-2018 / 03:12:58 / Claus Gittinger"
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   140
!
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   141
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   142
handlesButtonMotion:state inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   143
    ^ false
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   144
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   145
    "Created: / 04-08-2018 / 16:55:09 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   146
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   147
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   148
handlesButtonPress:state inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   149
    ^ false
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   150
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   151
    "Created: / 04-08-2018 / 16:55:20 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   152
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   153
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   154
handlesButtonRelease:state inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   155
    ^ false
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   156
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   157
    "Created: / 04-08-2018 / 16:55:24 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   158
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   159
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   160
handlesKeyPress:key inView:aView
19183
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   161
    ^ self realized
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   162
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   163
    "Created: / 04-08-2018 / 16:54:44 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   164
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   165
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   166
handlesKeyRelease:key inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   167
    ^ false
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   168
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   169
    "Created: / 04-08-2018 / 16:54:54 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   170
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   171
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   172
handlesPointerEnter:state inView:aView
19183
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   173
    ^ self realized
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   174
    "/ ^ true
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   175
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   176
    "Created: / 04-08-2018 / 16:55:49 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   177
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   178
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   179
handlesPointerLeave:state inView:aView
19183
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   180
    ^ self realized
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   181
    "/ ^ true
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   182
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   183
    "Created: / 04-08-2018 / 16:55:53 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   184
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   185
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   186
installDelayedClose
19181
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   187
    self uninstallDelayedClose.
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   188
    delayedCloseAction isNil ifTrue:[
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   189
        delayedCloseAction := [ self delayedClose ]. 
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   190
    ].
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   191
    Processor addTimedBlock:delayedCloseAction for:nil afterMilliseconds:750.
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   192
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   193
    "Created: / 05-08-2018 / 03:13:23 / Claus Gittinger"
18588
9790ae89ebee #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18587
diff changeset
   194
    "Modified: / 14-02-2019 / 02:16:10 / Claus Gittinger"
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   195
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   196
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   197
keyPress:key x:x y:y view:aView
18319
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   198
    key == #Escape ifTrue:[
19181
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   199
        "/ close now
18449
12de5f12886f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18320
diff changeset
   200
        self delayedClose.
12de5f12886f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18320
diff changeset
   201
        ^ true.
12de5f12886f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18320
diff changeset
   202
    ].
12de5f12886f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18320
diff changeset
   203
    ( #( CursorUp CursorDown Return ) includes:key) ifFalse:[
19181
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   204
        "/ close soon
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   205
        self installDelayedClose.
19183
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   206
        ^ false.
18449
12de5f12886f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18320
diff changeset
   207
    ].
19182
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   208
    self uninstallDelayedClose.
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   209
18319
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   210
"/    (subViews notNil and:[aView == (subViews firstIfEmpty:nil)]) ifTrue:[
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   211
"/        self topView destroy
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   212
"/    ].
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   213
    ^ false
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   214
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   215
    "Created: / 04-08-2018 / 17:00:33 / Claus Gittinger"
18449
12de5f12886f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18320
diff changeset
   216
    "Modified: / 08-10-2018 / 08:36:52 / Claus Gittinger"
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   217
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   218
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   219
pointerEnter:state x:x y:y view:view
19182
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   220
    (view isComponentOf:myView) ifTrue:[
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   221
        self uninstallDelayedClose.
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   222
        pointerEntered := true.
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   223
    ].
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   224
    ^ false
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   225
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   226
    "Created: / 04-08-2018 / 17:01:39 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   227
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   228
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   229
pointerLeave:state view:view
19182
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   230
    (view isComponentOf:myView) ifTrue:[
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   231
        closeOnPointerLeave ifTrue:[
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   232
            pointerEntered == true ifTrue:[
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   233
                pointerEntered := false.
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   234
                self installDelayedClose.
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   235
                ^ false
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   236
            ].
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   237
        ].
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   238
    ].
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   239
    ^ false
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   240
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   241
    "Created: / 04-08-2018 / 16:57:18 / Claus Gittinger"
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   242
    "Modified: / 05-08-2018 / 03:13:46 / Claus Gittinger"
19181
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   243
!
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   244
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   245
uninstallDelayedClose
19182
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   246
    closeOnPointerLeave := true.
19181
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   247
    delayedCloseAction notNil ifTrue:[
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   248
        Processor removeTimedBlock:delayedCloseAction.
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   249
    ].    
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   250
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   251
    "Created: / 05-08-2018 / 03:13:23 / Claus Gittinger"
e82136e9fd16 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 18590
diff changeset
   252
    "Modified: / 14-02-2019 / 02:16:10 / Claus Gittinger"
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   253
! !
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   254
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
!CodeCompletionHelpView methodsFor:'initialization'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
19183
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   257
checkForClosedOrRaisedEditor
19271
6f1bf7640de4 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19254
diff changeset
   258
    |a p wg|
18590
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   259
    
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   260
    (a := checkAction) notNil ifTrue:[
19271
6f1bf7640de4 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19254
diff changeset
   261
        "/ Transcript showCR:editView.
6f1bf7640de4 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19254
diff changeset
   262
        "/ Transcript showCR:editView topView.
18590
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   263
        (editView isNil
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   264
          or:[editView realized not
19254
547d4afd197d #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19233
diff changeset
   265
          or:[editView isReallyShown not
19232
504e09dc1b67 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19209
diff changeset
   266
          or:[editView topView shown not
19271
6f1bf7640de4 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19254
diff changeset
   267
          or:[(wg := editView windowGroup) isNil
6f1bf7640de4 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19254
diff changeset
   268
          or:[(p := wg process) isNil
19232
504e09dc1b67 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19209
diff changeset
   269
          or:[p isDead
19271
6f1bf7640de4 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19254
diff changeset
   270
          or:[wg anyViewHasFocus not
6f1bf7640de4 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19254
diff changeset
   271
        ]]]]]]]) ifTrue:[
18590
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   272
            self pushEvent:#closeRequest.
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   273
            checkAction := nil.
19183
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   274
        ] ifFalse:[
19232
504e09dc1b67 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19209
diff changeset
   275
            "/ Transcript showCR:'raising...'.
19271
6f1bf7640de4 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19254
diff changeset
   276
            "/ self inspect.
19183
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   277
            self raise.
18590
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   278
            Processor addTimedBlock:a for:nil afterSeconds:5.
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   279
        ]
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   280
    ]
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   281
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   282
    "Created: / 14-02-2019 / 15:33:26 / Claus Gittinger"
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   283
!
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   284
19182
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   285
enableDelegation
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   286
    |helpMenuView|
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   287
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   288
    myView notNil ifTrue:[
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   289
        myView isScrollWrapper ifTrue:[
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   290
            helpMenuView := myView scrolledView
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   291
        ] ifFalse:[
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   292
            helpMenuView := myView
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   293
        ].
19209
81a98529b987 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19183
diff changeset
   294
        helpMenuView notNil ifTrue:[
81a98529b987 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19183
diff changeset
   295
            helpMenuView delegate:self.
81a98529b987 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19183
diff changeset
   296
            helpMenuView enableEnterLeaveEvents.
81a98529b987 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19183
diff changeset
   297
            helpMenuView enableMotionEvents.
81a98529b987 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19183
diff changeset
   298
            helpMenuView enableButtonMotionEvents.
81a98529b987 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19183
diff changeset
   299
            helpMenuView enableFocusEvents.
81a98529b987 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19183
diff changeset
   300
        ].
19182
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   301
    ].
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   302
!
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   303
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
initStyle
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
    "setup viewStyle specifics"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
13670
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   307
    <resource: #style (
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   308
                       "/ #'activeHelp.backgroundColor'
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
                       #'activeHelp.borderWidth'
13670
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   310
                       "/ #'activeHelp.font'
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   311
                       )>
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
    |defaultFont|
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
    super initStyle.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
13670
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   317
"/    defaultFont := styleSheet fontAt:#'activeHelp.font' default:nil.
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   318
"/    defaultFont notNil ifTrue:[
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   319
"/        self font:defaultFont
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   320
"/    ].
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
    self borderWidth:(styleSheet at:#'activeHelp.borderWidth' default:1).
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
    "Modified: / 26.10.1997 / 17:02:09 / cg"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
19182
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   327
initialize
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   328
    super initialize.
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   329
    closeOnPointerLeave := true.
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   330
    pointerEntered := false.
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   331
!
7ffb45030b04 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 19181
diff changeset
   332
19183
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   333
mapped
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   334
    super mapped.
18590
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   335
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   336
    "/ install a watcher to check for the editView being still present
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   337
    "/ from time to time.
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   338
    "/ this prevents leftover completion views in case the editView is destroyed
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   339
    "/ and forgets to tell me...
19183
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   340
    checkAction := [self checkForClosedOrRaisedEditor].
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   341
    Processor addTimedBlock:checkAction for:nil afterSeconds:2.
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   342
!
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   343
19232
504e09dc1b67 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19209
diff changeset
   344
raise
504e09dc1b67 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19209
diff changeset
   345
    super raise
504e09dc1b67 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19209
diff changeset
   346
504e09dc1b67 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19209
diff changeset
   347
    "Modified: / 14-02-2019 / 15:34:17 / Claus Gittinger"
504e09dc1b67 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19209
diff changeset
   348
!
504e09dc1b67 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19209
diff changeset
   349
19183
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   350
realize
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   351
    self create.
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   352
    "/ self computeShape.
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   353
    self enableDelegation.
18590
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   354
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   355
    super realize
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   356
18590
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   357
    "Modified: / 14-02-2019 / 15:34:17 / Claus Gittinger"
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   358
!
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   359
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   360
release
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   361
    |a|
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   362
    
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   363
    (a := checkAction) notNil ifTrue:[
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   364
        checkAction := nil.
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   365
        Processor removeTimedBlock:a.
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   366
    ].
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   367
    super release.
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   368
b6158d4015f0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18588
diff changeset
   369
    "Created: / 14-02-2019 / 15:35:32 / Claus Gittinger"
19183
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   370
!
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   371
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   372
unmapped
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   373
    Processor removeTimedBlock:checkAction.
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   374
    super unmapped.
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   375
6eaf31e148a9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 19182
diff changeset
   376
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   377
! !
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   378
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   379
!CodeCompletionHelpView methodsFor:'private'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   380
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   381
resizeToFit
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   382
    "resize myself to make the component view fit"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   383
13448
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   384
    |pref bw|
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   385
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   386
    pref := myView preferredExtent.
13670
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   387
    myView extent:pref.
13448
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   388
    bw := self borderWidth.
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   389
    self extent:(pref + (bw * 2)).
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   390
    myView origin:(bw asPoint).
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   391
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   392
    "Modified: 28.6.1997 / 14:23:49 / cg"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   393
! !
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   394
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   395
!CodeCompletionHelpView methodsFor:'queries'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   396
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   397
isPopUpView
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   398
    "return true - I am a popUp type of view (no decoration, pop-to-top)"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   399
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   400
    ^ true
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   401
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   402
    "Modified: 12.5.1996 / 21:58:12 / cg"
13448
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   403
!
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   404
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   405
wantsFocusWithButtonPress
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   406
    "DEFINITELY not, because if we do so,
13476
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   407
     the editView looses focus on click, and sends me to hell in its lost focus handling!!
13448
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   408
     So I will be terminated by a buttonPress, before I get a chance to handle the buttonRelease
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   409
     (in which I fire my action)"
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   410
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   411
    ^ false
13476
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   412
!
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   413
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   414
wantsFocusWithPointerEnter
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   415
    "DEFINITELY not, because if we do so,
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   416
     the editView looses focus on entry, and sends me to hell in its lost focus handling!!
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   417
     So I will be terminated by a motion"
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   418
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   419
    ^ false
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   420
! !
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   421
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   422
!CodeCompletionHelpView class methodsFor:'documentation'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   423
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   424
version
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   425
    ^ '$Header$'
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   426
!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   427
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   428
version_CVS
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   429
    ^ '$Header$'
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   430
! !
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   431