InputView.st
author Claus Gittinger <cg@exept.de>
Sat, 19 Jun 1999 00:52:33 +0200
changeset 1190 91cf6653901e
parent 1185 522d9c84f0a9
child 1241 414114cfc5cc
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
3f9277473954 Initial revision
claus
parents:
diff changeset
     1
"
6
4ac87e6bf82f *** empty log message ***
claus
parents: 5
diff changeset
     2
 COPYRIGHT (c) 1990 by Claus Gittinger
99
claus
parents: 96
diff changeset
     3
	      All Rights Reserved
0
3f9277473954 Initial revision
claus
parents:
diff changeset
     4
3f9277473954 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
3f9277473954 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
3f9277473954 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
3f9277473954 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
3f9277473954 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
3f9277473954 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
3f9277473954 Initial revision
claus
parents:
diff changeset
    11
"
3f9277473954 Initial revision
claus
parents:
diff changeset
    12
65
claus
parents: 23
diff changeset
    13
SimpleView subclass:#InputView
225
7c62c2ffb363 documentation
Claus Gittinger <cg@exept.de>
parents: 130
diff changeset
    14
	instanceVariableNames:'eventReceiver'
7c62c2ffb363 documentation
Claus Gittinger <cg@exept.de>
parents: 130
diff changeset
    15
	classVariableNames:''
7c62c2ffb363 documentation
Claus Gittinger <cg@exept.de>
parents: 130
diff changeset
    16
	poolDictionaries:''
235
236f3222fa88 class category changes
Claus Gittinger <cg@exept.de>
parents: 225
diff changeset
    17
	category:'Views-Special'
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    18
!
3f9277473954 Initial revision
claus
parents:
diff changeset
    19
449
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    20
!InputView class methodsFor:'documentation'!
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    22
copyright
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    23
"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    24
 COPYRIGHT (c) 1990 by Claus Gittinger
99
claus
parents: 96
diff changeset
    25
	      All Rights Reserved
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    26
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    27
 This software is furnished under a license and may be used
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    28
 only in accordance with the terms of that license and with the
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    30
 be provided or otherwise made available to, or used by, any
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    31
 other person.  No title to or ownership of the software is
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    32
 hereby transferred.
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    33
"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    34
!
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    35
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    36
documentation
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    37
"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    38
    a view for input only - forwarding all events to another object.
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    39
    This kind of view can be used to be laid ontop of another view to catch all
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    40
    input. (Interface builder)
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    41
    NOTICE: the event forwarding is a leftover from times when not delegation mechanism
225
7c62c2ffb363 documentation
Claus Gittinger <cg@exept.de>
parents: 130
diff changeset
    42
            existed - it will vanish - use delegates for new code.
7c62c2ffb363 documentation
Claus Gittinger <cg@exept.de>
parents: 130
diff changeset
    43
7c62c2ffb363 documentation
Claus Gittinger <cg@exept.de>
parents: 130
diff changeset
    44
    [author:]
7c62c2ffb363 documentation
Claus Gittinger <cg@exept.de>
parents: 130
diff changeset
    45
        Claus Gittinger
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    46
"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    47
! !
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    48
130
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    49
!InputView methodsFor:'accessing'!
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    50
130
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    51
eventReceiver:aView
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    52
    eventReceiver := aView
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    53
!
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    54
286
b7f2e2aefae1 renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    55
isInputOnly
b7f2e2aefae1 renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    56
    "yes, this is a transparent input-only view"
b7f2e2aefae1 renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    57
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    58
    ^ true
286
b7f2e2aefae1 renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    59
b7f2e2aefae1 renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    60
    "Created: 1.6.1996 / 13:22:31 / cg"
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    61
! !
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    62
449
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    63
!InputView methodsFor:'drag & drop'!
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    64
521
2937b6c596b3 drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
    65
canDrop:aCollectionOfDropObjects
449
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    66
    eventReceiver notNil ifTrue:[
521
2937b6c596b3 drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
    67
        ^ eventReceiver canDrop:aCollectionOfDropObjects
449
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    68
    ].
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    69
    ^ false
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    70
521
2937b6c596b3 drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
    71
    "Modified: 11.4.1997 / 12:42:06 / cg"
449
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    72
!
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    73
521
2937b6c596b3 drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
    74
drop:aCollectionOfDropObjects at:aPoint
449
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    75
    eventReceiver notNil ifTrue:[
521
2937b6c596b3 drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
    76
        eventReceiver drop:aCollectionOfDropObjects at:aPoint
449
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    77
    ].
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    78
521
2937b6c596b3 drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
    79
    "Modified: 11.4.1997 / 12:43:41 / cg"
449
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    80
! !
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    81
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    82
!InputView methodsFor:'event handling'!
3f9277473954 Initial revision
claus
parents:
diff changeset
    83
130
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    84
buttonMotion:state x:x y:y
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    85
    "redefined to forward event"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    86
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    87
    eventReceiver notNil ifTrue:[
1185
522d9c84f0a9 fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
    88
        eventReceiver buttonMotion:state x:x y:y
522d9c84f0a9 fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
    89
    ] ifFalse:[
522d9c84f0a9 fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
    90
        super buttonMotion:state x:x y:y
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    91
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
    92
!
3f9277473954 Initial revision
claus
parents:
diff changeset
    93
3f9277473954 Initial revision
claus
parents:
diff changeset
    94
buttonPress:button x:x y:y
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    95
    "redefined to forward event"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    96
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    97
    eventReceiver notNil ifTrue:[
1185
522d9c84f0a9 fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
    98
        eventReceiver buttonPress:button x:x y:y
522d9c84f0a9 fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
    99
    ] ifFalse:[
522d9c84f0a9 fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
   100
        super buttonPress:button x:x y:y
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   101
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
   102
!
3f9277473954 Initial revision
claus
parents:
diff changeset
   103
3f9277473954 Initial revision
claus
parents:
diff changeset
   104
buttonRelease:button x:x y:y
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   105
    "redefined to forward event"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   106
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   107
    eventReceiver notNil ifTrue:[
1185
522d9c84f0a9 fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
   108
        eventReceiver buttonRelease:button x:x y:y
522d9c84f0a9 fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
   109
    ] ifFalse:[
522d9c84f0a9 fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
   110
        super buttonRelease:button x:x y:y
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   111
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
   112
!
3f9277473954 Initial revision
claus
parents:
diff changeset
   113
130
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   114
exposeX:x y:y width:w height:h
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   115
    "will never be received"
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   116
    ^ self
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   117
!
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   118
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   119
focusIn
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   120
    "redefined to forward event"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   121
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   122
    eventReceiver notNil ifTrue:[
99
claus
parents: 96
diff changeset
   123
	eventReceiver focusIn
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   124
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
   125
!
3f9277473954 Initial revision
claus
parents:
diff changeset
   126
3f9277473954 Initial revision
claus
parents:
diff changeset
   127
focusOut
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   128
    "redefined to forward event"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   129
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   130
    eventReceiver notNil ifTrue:[
99
claus
parents: 96
diff changeset
   131
	eventReceiver focusOut
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   132
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
   133
!
3f9277473954 Initial revision
claus
parents:
diff changeset
   134
130
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   135
keyPress:key x:x y:y
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   136
    "redefined to forward event"
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   137
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   138
    eventReceiver notNil ifTrue:[
1185
522d9c84f0a9 fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
   139
        eventReceiver keyPress:key x:x y:y
522d9c84f0a9 fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
   140
    ] ifFalse:[
522d9c84f0a9 fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
   141
        super keyPress:key x:x y:y
130
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   142
    ]
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   143
!
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   144
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   145
keyRelease:key x:x y:y
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   146
    "redefined to forward event"
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   147
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   148
    eventReceiver notNil ifTrue:[
1185
522d9c84f0a9 fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
   149
        eventReceiver keyRelease:key x:x y:y
522d9c84f0a9 fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
   150
    ] ifFalse:[
522d9c84f0a9 fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
   151
        super keyRelease:key x:x y:y
130
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   152
    ]
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   153
!
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   154
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   155
pointerEnter:state x:x y:y
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   156
    "redefined to forward event"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   157
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   158
    eventReceiver notNil ifTrue:[
99
claus
parents: 96
diff changeset
   159
	eventReceiver pointerEnter:state x:x y:y
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   160
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
   161
!
3f9277473954 Initial revision
claus
parents:
diff changeset
   162
3f9277473954 Initial revision
claus
parents:
diff changeset
   163
pointerLeave:state
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   164
    "redefined to forward event"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   165
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   166
    eventReceiver notNil ifTrue:[
99
claus
parents: 96
diff changeset
   167
	eventReceiver pointerLeave:state
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   168
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
   169
! !
130
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   170
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   171
!InputView methodsFor:'initialization'!
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   172
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   173
initialize
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   174
    super initialize.
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   175
    borderWidth := 0
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   176
! !
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   177
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   178
!InputView methodsFor:'redefined dummy'!
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   179
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   180
setViewBackground
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   181
    "inputviews have no background"
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   182
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   183
    ^ self
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   184
! !
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   185
449
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
   186
!InputView class methodsFor:'documentation'!
130
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   187
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   188
version
1185
522d9c84f0a9 fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
   189
    ^ '$Header: /cvs/stx/stx/libview2/InputView.st,v 1.17 1999-06-05 22:13:26 cg Exp $'
130
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   190
! !