InputView.st
author Claus Gittinger <cg@exept.de>
Thu, 06 Mar 1997 15:16:03 +0100
changeset 494 ce8c074d5e6b
parent 449 9d18c9a66b59
child 521 2937b6c596b3
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
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    65
canDrop:anObjectOrCollection
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    66
    eventReceiver notNil ifTrue:[
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    67
        ^ eventReceiver canDrop:anObjectOrCollection
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
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    71
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    72
!
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    73
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    74
drop:anObjectOrCollection at:aPoint
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    75
    eventReceiver notNil ifTrue:[
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    76
        eventReceiver drop:anObjectOrCollection at:aPoint
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    77
    ].
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    78
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    79
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    80
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    81
! !
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
    82
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    83
!InputView methodsFor:'event handling'!
3f9277473954 Initial revision
claus
parents:
diff changeset
    84
130
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    85
buttonMotion:state x:x y:y
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    86
    "redefined to forward event"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    87
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    88
    eventReceiver notNil ifTrue:[
130
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    89
	eventReceiver buttonMotion:state x:x y:y
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    90
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
    91
!
3f9277473954 Initial revision
claus
parents:
diff changeset
    92
3f9277473954 Initial revision
claus
parents:
diff changeset
    93
buttonPress:button x:x y:y
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    94
    "redefined to forward event"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
    95
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    96
    eventReceiver notNil ifTrue:[
99
claus
parents: 96
diff changeset
    97
	eventReceiver buttonPress:button x:x y:y
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    98
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
    99
!
3f9277473954 Initial revision
claus
parents:
diff changeset
   100
3f9277473954 Initial revision
claus
parents:
diff changeset
   101
buttonRelease:button x:x y:y
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   102
    "redefined to forward event"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   103
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   104
    eventReceiver notNil ifTrue:[
99
claus
parents: 96
diff changeset
   105
	eventReceiver buttonRelease:button x:x y:y
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   106
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
   107
!
3f9277473954 Initial revision
claus
parents:
diff changeset
   108
130
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   109
exposeX:x y:y width:w height:h
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   110
    "will never be received"
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   111
    ^ self
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   112
!
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   113
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   114
focusIn
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   115
    "redefined to forward event"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   116
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   117
    eventReceiver notNil ifTrue:[
99
claus
parents: 96
diff changeset
   118
	eventReceiver focusIn
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   119
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
   120
!
3f9277473954 Initial revision
claus
parents:
diff changeset
   121
3f9277473954 Initial revision
claus
parents:
diff changeset
   122
focusOut
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   123
    "redefined to forward event"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   124
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   125
    eventReceiver notNil ifTrue:[
99
claus
parents: 96
diff changeset
   126
	eventReceiver focusOut
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   127
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
   128
!
3f9277473954 Initial revision
claus
parents:
diff changeset
   129
130
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   130
keyPress:key x:x y:y
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   131
    "redefined to forward event"
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   132
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   133
    eventReceiver notNil ifTrue:[
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   134
	eventReceiver keyPress:key x:x y:y
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   135
    ]
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   136
!
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
keyRelease:key x:x y:y
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   139
    "redefined to forward event"
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   140
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   141
    eventReceiver notNil ifTrue:[
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   142
	eventReceiver keyRelease:key x:x y:y
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
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   146
pointerEnter:state x:x y:y
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   147
    "redefined to forward event"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   148
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   149
    eventReceiver notNil ifTrue:[
99
claus
parents: 96
diff changeset
   150
	eventReceiver pointerEnter:state x:x y:y
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   151
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
   152
!
3f9277473954 Initial revision
claus
parents:
diff changeset
   153
3f9277473954 Initial revision
claus
parents:
diff changeset
   154
pointerLeave:state
21
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   155
    "redefined to forward event"
66b31c91177f *** empty log message ***
claus
parents: 6
diff changeset
   156
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   157
    eventReceiver notNil ifTrue:[
99
claus
parents: 96
diff changeset
   158
	eventReceiver pointerLeave:state
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   159
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
   160
! !
130
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   161
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   162
!InputView methodsFor:'initialization'!
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   163
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   164
initialize
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   165
    super initialize.
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   166
    borderWidth := 0
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   167
! !
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   168
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   169
!InputView methodsFor:'redefined dummy'!
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
setViewBackground
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   172
    "inputviews have no background"
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   173
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   174
    ^ self
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   175
! !
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   176
449
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
   177
!InputView class methodsFor:'documentation'!
130
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   178
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   179
version
449
9d18c9a66b59 delegate drop
ca
parents: 327
diff changeset
   180
    ^ '$Header: /cvs/stx/stx/libview2/InputView.st,v 1.15 1997-02-25 13:25:19 ca Exp $'
130
ddb0e9c49fc8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   181
! !