CodeCompletionHelpView.st
author Claus Gittinger <cg@exept.de>
Sat, 04 Aug 2018 17:03:05 +0200
changeset 18316 3d8bed1ef0a6
parent 18315 e66798f7c928
child 18319 7625bc676f9c
permissions -rw-r--r--
#BUGFIX by cg ensure that view is not left staying around
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
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
    19
	instanceVariableNames:'myView editView delayedDestroyAction'
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
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
    97
focusOut
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
    98
    self topView destroy
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
    99
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   100
    "Created: / 04-08-2018 / 10:41:59 / Claus Gittinger"
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   101
!
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   102
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   103
handlesButtonMotion:state inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   104
    ^ false
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   105
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   106
    "Created: / 04-08-2018 / 16:55:09 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   107
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   108
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   109
handlesButtonPress:state inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   110
    ^ false
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   111
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   112
    "Created: / 04-08-2018 / 16:55:20 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   113
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   114
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   115
handlesButtonRelease:state inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   116
    ^ false
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   117
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   118
    "Created: / 04-08-2018 / 16:55:24 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   119
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   120
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   121
handlesKeyPress:key inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   122
    ^ true
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   123
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   124
    "Created: / 04-08-2018 / 16:54:44 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   125
!
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   126
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   127
handlesKeyRelease:key inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   128
    ^ false
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   129
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   130
    "Created: / 04-08-2018 / 16:54:54 / Claus Gittinger"
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
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   133
handlesPointerEnter:state inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   134
    ^ true
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   135
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   136
    "Created: / 04-08-2018 / 16:55:49 / Claus Gittinger"
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
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   139
handlesPointerLeave:state inView:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   140
    ^ true
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   141
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   142
    "Created: / 04-08-2018 / 16:55:53 / Claus Gittinger"
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
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   145
keyPress:key x:x y:y
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   146
    self topView destroy
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   147
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   148
    "Created: / 04-08-2018 / 10:40:43 / Claus Gittinger"
18316
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
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   151
keyPress:key x:x y:y view:aView
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   152
    aView == (subViews firstIfEmpty:nil) ifTrue:[
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   153
        self topView destroy
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
    ^ true
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 / 17:00:33 / 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
pointerEnter:state x:x y:y view:view
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   161
    delayedDestroyAction notNil ifTrue:[
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   162
        Processor removeTimedBlock:delayedDestroyAction.
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
    ^ false
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
    "Created: / 04-08-2018 / 17:01:39 / Claus Gittinger"
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   167
!
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
pointerLeave:state view:view
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   170
    delayedDestroyAction notNil ifTrue:[
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   171
        Processor removeTimedBlock:delayedDestroyAction.
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   172
    ].    
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   173
    delayedDestroyAction := [ self topView destroy ]. 
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   174
    Processor addTimedBlock:delayedDestroyAction after:0.5.
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   175
    ^ false
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   176
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   177
    "Created: / 04-08-2018 / 16:57:18 / Claus Gittinger"
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   178
! !
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   179
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
!CodeCompletionHelpView methodsFor:'initialization'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
initStyle
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
    "setup viewStyle specifics"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
13670
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   185
    <resource: #style (
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   186
                       "/ #'activeHelp.backgroundColor'
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
                       #'activeHelp.borderWidth'
13670
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   188
                       "/ #'activeHelp.font'
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   189
                       )>
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    |defaultFont|
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
    super initStyle.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
13670
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   195
"/    defaultFont := styleSheet fontAt:#'activeHelp.font' default:nil.
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   196
"/    defaultFont notNil ifTrue:[
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   197
"/        self font:defaultFont
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   198
"/    ].
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
    self borderWidth:(styleSheet at:#'activeHelp.borderWidth' default:1).
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
    "Modified: / 26.10.1997 / 17:02:09 / cg"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
realize
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
    self create.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
    "/ self computeShape.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
    self enableMotionEvents.
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
    self enableButtonMotionEvents.
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   210
    self enableFocusEvents.
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   211
    self subViews do:[:eachView |
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   212
        eachView delegate:self.
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   213
    ].
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
    super realize
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   215
18316
3d8bed1ef0a6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18315
diff changeset
   216
    "Modified: / 04-08-2018 / 16:53:13 / Claus Gittinger"
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
! !
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
!CodeCompletionHelpView methodsFor:'private'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
resizeToFit
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
    "resize myself to make the component view fit"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
13448
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   224
    |pref bw|
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
    pref := myView preferredExtent.
13670
43d2d7c37e61 class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13479
diff changeset
   227
    myView extent:pref.
13448
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   228
    bw := self borderWidth.
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   229
    self extent:(pref + (bw * 2)).
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   230
    myView origin:(bw asPoint).
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
    "Modified: 28.6.1997 / 14:23:49 / cg"
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
! !
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
!CodeCompletionHelpView methodsFor:'queries'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
isPopUpView
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
    "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
   239
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
    ^ true
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
    "Modified: 12.5.1996 / 21:58:12 / cg"
13448
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   243
!
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   244
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   245
wantsFocusWithButtonPress
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   246
    "DEFINITELY not, because if we do so,
13476
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   247
     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
   248
     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
   249
     (in which I fire my action)"
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   250
8f3c88862f5a class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 12908
diff changeset
   251
    ^ false
13476
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   252
!
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   253
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   254
wantsFocusWithPointerEnter
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   255
    "DEFINITELY not, because if we do so,
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   256
     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
   257
     So I will be terminated by a motion"
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   258
9e09d2a0bf7c class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents: 13448
diff changeset
   259
    ^ false
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
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
!CodeCompletionHelpView class methodsFor:'documentation'!
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
version
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   265
    ^ '$Header$'
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
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
version_CVS
18315
e66798f7c928 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 14152
diff changeset
   269
    ^ '$Header$'
12908
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
! !
a46f2cc73003 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271