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