CodeCompletionHelpView.st
author Claus Gittinger <cg@exept.de>
Thu, 14 Feb 2019 02:20:13 +0100
changeset 18588 9790ae89ebee
parent 18587 dc3e84f464fc
child 18590 b6158d4015f0
permissions -rw-r--r--
#FEATURE by cg class: CodeCompletionHelpView changed: #installDelayedClose
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
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
    17
	instanceVariableNames:'myView editView delayedCloseAction'
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	category:'Interface-Help'
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!CodeCompletionHelpView class methodsFor:'documentation'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
copyright
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
 COPYRIGHT (c) 2013 by Claus Gittinger
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
              All Rights Reserved
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 This software is furnished under a license and may be used
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 only in accordance with the terms of that license and with the
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 be provided or otherwise made available to, or used by, any
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 other person.  No title to or ownership of the software is
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 hereby transferred.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
"
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
documentation
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
13479
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
    41
    used with code completion suggestions
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    [author:]
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
        Claus Gittinger
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    [See also:]
13479
Claus Gittinger <cg@exept.de>
parents: 13476
diff changeset
    47
        ActiveHelp Workspace::CodeCompletionService
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
"
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
!CodeCompletionHelpView class methodsFor:'instance creation'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
with:aView
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    "create a talking-view wrapping some other view"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    ^ self new withView:aView
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    "
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
     (ActiveHelpView with:(TextView new)) realize
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
     (ActiveHelpView with:(TextView new)) open
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
     (ActiveHelpView with:(Button label:'ok')) open
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    "
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    "Modified: 27.4.1996 / 15:14:18 / cg"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
! !
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
!CodeCompletionHelpView methodsFor:'accessing'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
14152
b13faf727c2c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13670
diff changeset
    69
editView:aView
b13faf727c2c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13670
diff changeset
    70
    editView := aView
b13faf727c2c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13670
diff changeset
    71
!
b13faf727c2c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13670
diff changeset
    72
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
withView:aView
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    "set the component view"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    |fg|
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
    (aView isKindOf:Label) ifTrue:[
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
        aView viewBackground:viewBackground.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
        aView backgroundColor:viewBackground.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
        (fg := styleSheet colorAt:#'activeHelp.foregroundColor' default:nil) notNil ifTrue:[
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
            aView foregroundColor:fg.    
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
        ].
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
    ].
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
    self addSubView:aView.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    myView := aView.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    myView borderWidth:0.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
    myView origin:(0.0@0.0) corner:(1.0@1.0).
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
    "Modified: 27.4.1996 / 15:16:46 / cg"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
! !
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
    93
!CodeCompletionHelpView methodsFor:'event handling'!
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
    94
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
    95
delayedClose
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
    96
    self delayedUnmap
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
    97
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
    98
    "Created: / 05-08-2018 / 03:16:26 / Claus Gittinger"
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
    99
!
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   100
18319
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   101
delayedDestroy
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   102
    (subViews notEmptyOrNil) ifTrue:[
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   103
        self topView destroy
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   104
    ].
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   105
    ^ true
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   106
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   107
    "Created: / 04-08-2018 / 21:25:48 / Claus Gittinger"
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   108
!
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   109
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   110
delayedUnmap
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   111
    (subViews notEmptyOrNil) ifTrue:[
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   112
        self topView unmap
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   113
    ].
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   114
    ^ true
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   115
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   116
    "Created: / 05-08-2018 / 03:12:39 / Claus Gittinger"
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   117
!
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   118
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   119
focusOut
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   120
    self installDelayedClose.
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   121
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   122
    "Created: / 04-08-2018 / 10:41:59 / Claus Gittinger"
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   123
    "Modified: / 05-08-2018 / 03:12:58 / Claus Gittinger"
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   124
!
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   125
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   126
handlesButtonMotion:state inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   127
    ^ false
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   128
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   129
    "Created: / 04-08-2018 / 16:55:09 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   130
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   131
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   132
handlesButtonPress:state inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   133
    ^ false
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   134
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   135
    "Created: / 04-08-2018 / 16:55:20 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   136
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   137
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   138
handlesButtonRelease:state inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   139
    ^ false
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   140
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   141
    "Created: / 04-08-2018 / 16:55:24 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   142
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   143
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   144
handlesKeyPress:key inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   145
    ^ true
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
    "Created: / 04-08-2018 / 16:54:44 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   148
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   149
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   150
handlesKeyRelease:key inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   151
    ^ false
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
    "Created: / 04-08-2018 / 16:54:54 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   154
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   155
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   156
handlesPointerEnter:state inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   157
    ^ true
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
    "Created: / 04-08-2018 / 16:55:49 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   160
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   161
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   162
handlesPointerLeave:state inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   163
    ^ true
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
    "Created: / 04-08-2018 / 16:55:53 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   166
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   167
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   168
installDelayedClose
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   169
    delayedCloseAction notNil ifTrue:[
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   170
        Processor removeTimedBlock:delayedCloseAction.
18319
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   171
    ].    
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   172
    delayedCloseAction := [ self delayedClose ]. 
18588
9790ae89ebee #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18587
diff changeset
   173
    Processor addTimedBlock:delayedCloseAction for:nil afterMilliseconds:500.
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   174
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   175
    "Created: / 05-08-2018 / 03:13:23 / Claus Gittinger"
18588
9790ae89ebee #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18587
diff changeset
   176
    "Modified: / 14-02-2019 / 02:16:10 / Claus Gittinger"
18316
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
keyPress:key x:x y:y view:aView
18319
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   180
    key == #Escape ifTrue:[
18449
12de5f12886f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18320
diff changeset
   181
        self delayedClose.
12de5f12886f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18320
diff changeset
   182
        ^ true.
12de5f12886f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18320
diff changeset
   183
    ].
12de5f12886f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18320
diff changeset
   184
    ( #( CursorUp CursorDown Return ) includes:key) ifFalse:[
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   185
        self installDelayedClose.
18319
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   186
        ^ true.
18449
12de5f12886f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18320
diff changeset
   187
    ].
12de5f12886f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18320
diff changeset
   188
    
18319
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   189
"/    (subViews notNil and:[aView == (subViews firstIfEmpty:nil)]) ifTrue:[
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   190
"/        self topView destroy
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   191
"/    ].
7625bc676f9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18316
diff changeset
   192
    ^ false
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   193
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   194
    "Created: / 04-08-2018 / 17:00:33 / Claus Gittinger"
18449
12de5f12886f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18320
diff changeset
   195
    "Modified: / 08-10-2018 / 08:36:52 / Claus Gittinger"
18316
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
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   198
pointerEnter:state x:x y:y view:view
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   199
    delayedCloseAction notNil ifTrue:[
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   200
        Processor removeTimedBlock:delayedCloseAction.
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   201
    ].    
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   202
    ^ false
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   203
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   204
    "Created: / 04-08-2018 / 17:01:39 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   205
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   206
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   207
pointerLeave:state view:view
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   208
    self installDelayedClose.
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   209
    ^ false
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   210
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   211
    "Created: / 04-08-2018 / 16:57:18 / Claus Gittinger"
18320
1a44eee484b2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18319
diff changeset
   212
    "Modified: / 05-08-2018 / 03:13:46 / Claus Gittinger"
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   213
! !
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   214
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
!CodeCompletionHelpView methodsFor:'initialization'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
initStyle
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
    "setup viewStyle specifics"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
13670
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   220
    <resource: #style (
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   221
                       "/ #'activeHelp.backgroundColor'
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
                       #'activeHelp.borderWidth'
13670
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   223
                       "/ #'activeHelp.font'
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   224
                       )>
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
    |defaultFont|
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
    super initStyle.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
13670
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   230
"/    defaultFont := styleSheet fontAt:#'activeHelp.font' default:nil.
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   231
"/    defaultFont notNil ifTrue:[
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   232
"/        self font:defaultFont
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   233
"/    ].
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
    self borderWidth:(styleSheet at:#'activeHelp.borderWidth' default:1).
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
    "Modified: / 26.10.1997 / 17:02:09 / cg"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
realize
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
    self create.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
    "/ self computeShape.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
    self enableMotionEvents.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
    self enableButtonMotionEvents.
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   245
    self enableFocusEvents.
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   246
    self subViews do:[:eachView |
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   247
        eachView delegate:self.
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   248
    ].
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
    super realize
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   250
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   251
    "Modified: / 04-08-2018 / 16:53:13 / Claus Gittinger"
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
! !
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
!CodeCompletionHelpView methodsFor:'private'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
resizeToFit
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
    "resize myself to make the component view fit"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
13448
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   259
    |pref bw|
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
    pref := myView preferredExtent.
13670
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   262
    myView extent:pref.
13448
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   263
    bw := self borderWidth.
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   264
    self extent:(pref + (bw * 2)).
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   265
    myView origin:(bw asPoint).
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
    "Modified: 28.6.1997 / 14:23:49 / cg"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
! !
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
!CodeCompletionHelpView methodsFor:'queries'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
isPopUpView
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
    "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
   274
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
    ^ true
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
    "Modified: 12.5.1996 / 21:58:12 / cg"
13448
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   278
!
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   279
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   280
wantsFocusWithButtonPress
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   281
    "DEFINITELY not, because if we do so,
13476
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   282
     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
   283
     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
   284
     (in which I fire my action)"
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   285
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   286
    ^ false
13476
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   287
!
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   288
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   289
wantsFocusWithPointerEnter
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   290
    "DEFINITELY not, because if we do so,
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   291
     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
   292
     So I will be terminated by a motion"
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   293
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   294
    ^ false
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
! !
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
!CodeCompletionHelpView class methodsFor:'documentation'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
version
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   300
    ^ '$Header$'
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
version_CVS
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   304
    ^ '$Header$'
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
! !
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306