SynchronousWindowSensor.st
author ca
Fri, 02 Aug 2002 13:55:31 +0200
changeset 3680 4c096f11e018
parent 3594 76381e75d9d2
child 3858 ecbaa5d75c70
permissions -rw-r--r--
more windowEvent types; almost clean now.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
267
5728c37ff3f6 commentary
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
2718
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
     3
	      All Rights Reserved
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
3450
4b5f22cd68e4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
    13
"{ Package: 'stx:libview' }"
4b5f22cd68e4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
    14
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
WindowSensor subclass:#SynchronousWindowSensor
730
43d9c5848424 device instVar is not needed
Claus Gittinger <cg@exept.de>
parents: 615
diff changeset
    16
	instanceVariableNames:''
598
1a2339e902d4 commentary
Claus Gittinger <cg@exept.de>
parents: 267
diff changeset
    17
	classVariableNames:''
1a2339e902d4 commentary
Claus Gittinger <cg@exept.de>
parents: 267
diff changeset
    18
	poolDictionaries:''
1a2339e902d4 commentary
Claus Gittinger <cg@exept.de>
parents: 267
diff changeset
    19
	category:'Interface-Support'
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
1243
0c33cb7f8458 hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
    22
!SynchronousWindowSensor class methodsFor:'documentation'!
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
copyright
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
267
5728c37ff3f6 commentary
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
    26
 COPYRIGHT (c) 1995 by Claus Gittinger
2718
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
    27
	      All Rights Reserved
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 This software is furnished under a license and may be used
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 only in accordance with the terms of that license and with the
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 be provided or otherwise made available to, or used by, any
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 other person.  No title to or ownership of the software is
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 hereby transferred.
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
documentation
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
    in contrast to a regular windowSensor, instances of SynchronousWindowSensor
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    do NOT put events into a queue and do NOT wakeup any windowGroup process.
266
1e234d542ef9 oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
    42
    Instead, the underlying view is notified synchronously (via a message send)
1e234d542ef9 oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
    43
    about the event.
1e234d542ef9 oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
    44
1e234d542ef9 oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
    45
    These are used for only one single situation: 
2718
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
    46
	when a modal debugger is open
266
1e234d542ef9 oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
    47
    (i.e. one that is debugging the scheduler or event-dispatcher).
267
5728c37ff3f6 commentary
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
    48
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    This debuggers windowGroup is augmented with a synchronous Sensor, in order
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    to prevent the event handling code from suspending any process 
266
1e234d542ef9 oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
    51
    (you cannot suspend the scheduler; you should not suspend the event dispatcher).
1e234d542ef9 oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
    52
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    This is pretty tricky and magic - you dont have to understand this.
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    (consider this system internal code)
267
5728c37ff3f6 commentary
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
    55
    These sensors are not used with regular views.
612
8758d0c9933e documentation
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
    56
8758d0c9933e documentation
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
    57
    [author:]
2718
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
    58
	Claus Gittinger
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
! !
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
!SynchronousWindowSensor methodsFor:'event handling'!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
    64
addDamage:aRectangle view:aView wakeup:doWakeup
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
    65
    "forward as an expose for some view"
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
    66
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
    67
    aView
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
    68
        dispatchEvent:#exposeX:y:width:height:
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
    69
        arguments:(Array with:aRectangle left 
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
    70
                         with:aRectangle top 
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
    71
                         with:aRectangle width
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
    72
                         with:aRectangle height)
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
    73
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
    74
"/    WindowEvent
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
    75
"/        sendEvent:#exposeX:y:width:height:
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
    76
"/        arguments:(Array with:aRectangle left 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
    77
"/                         with:aRectangle top 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
    78
"/                         with:aRectangle width
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
    79
"/                         with:aRectangle height)
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
    80
"/        view:aView
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
    81
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
    82
    "Modified: / 20.5.1998 / 22:55:37 / cg"
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
    83
!
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
    84
3450
4b5f22cd68e4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
    85
buttonMotion:buttonAndModifierState x:x y:y view:aView
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    "forward a button-motion for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
    88
    |buttonState ev|
3450
4b5f22cd68e4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
    89
4b5f22cd68e4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
    90
    "/ in the following, we are only interested in the buttons (i.e. mask out the modifiers)
4b5f22cd68e4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
    91
    buttonState := buttonAndModifierState bitAnd:(aView device anyButtonStateMask).
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
    93
    ev := WindowEvent buttonMotion:buttonState x:x y:y view:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
    94
    self sendEvent:ev to:aView.
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
buttonMultiPress:button x:x y:y view:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
    "forward a button-multi-press event for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   100
    |ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   102
    ev := WindowEvent buttonMultiPress:button x:x y:y view:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   103
    self sendEvent:ev to:aView.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   104
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   105
    "Created: / 24.11.1995 / 19:14:14 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   106
    "Modified: / 20.5.1998 / 22:56:07 / cg"
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
buttonPress:button x:x y:y view:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
    "forward a button-press event for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   112
    |ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   114
    ev := WindowEvent buttonPress:button x:x y:y view:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   115
    self sendEvent:ev to:aView.
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
buttonRelease:button x:x y:y view:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
    "forward a button-release event for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   121
    |ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   123
    ev := WindowEvent buttonRelease:button x:x y:y view:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   124
    self sendEvent:ev to:aView.
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
configureX:x y:y width:w height:h view:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    "forward a configure for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   130
    |ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   132
    ev := WindowEvent configureX:x y:y width:w height:h view:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   133
    aView dispatchEvent:ev
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
coveredBy:otherView view:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
    "forward a covered for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
    aView coveredBy:otherView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
    "Created: 24.11.1995 / 19:15:11 / cg"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
destroyedView:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    "forward a destroyed event for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
    aView destroyed
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
    "Created: 24.11.1995 / 19:15:22 / cg"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
exposeX:x y:y width:w height:h view:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
    "forward an expose for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
3594
76381e75d9d2 Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents: 3450
diff changeset
   155
    ignoreExposeEvents ~~ true ifTrue:[
76381e75d9d2 Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents: 3450
diff changeset
   156
        aView
76381e75d9d2 Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents: 3450
diff changeset
   157
            dispatchEvent:#exposeX:y:width:height:
76381e75d9d2 Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents: 3450
diff changeset
   158
            arguments:(Array with:x with:y with:w with:h)
76381e75d9d2 Handle lastEventQuerySignal (for exclusive debugger)
Stefan Vogel <sv@exept.de>
parents: 3450
diff changeset
   159
    ]
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   161
"/    WindowEvent
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   162
"/        sendEvent:#exposeX:y:width:height:
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   163
"/        arguments:(Array with:x with:y with:w with:h)
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   164
"/        view:aView
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   165
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   166
    "Created: / 24.11.1995 / 19:15:54 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   167
    "Modified: / 20.5.1998 / 22:56:49 / cg"
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
focusInView:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
    "forward a focusIn event for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   173
    |ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   175
    ev := WindowEvent focusInView:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   176
    aView dispatchEvent:ev
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   177
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   178
    "Created: / 24.11.1995 / 19:16:11 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   179
    "Modified: / 20.5.1998 / 22:57:04 / cg"
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
focusOutView:aView 
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
    "forward a focusOut event for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   185
    |ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   187
    ev := WindowEvent focusOutView:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   188
    aView dispatchEvent:ev
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   189
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   190
    "Created: / 24.11.1995 / 19:16:24 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   191
    "Modified: / 20.5.1998 / 22:57:16 / cg"
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
   194
graphicsExposeX:x y:y width:w height:h final:final view:aView
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
    "forward a graphic expose for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   197
    "/ this is a possible response to a scroll operation
1244
d3182558fc9d hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
   198
    "/ (if an expose is pending)
d3182558fc9d hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
   199
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
   200
    final ifTrue:[
2718
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   201
	(catchExpose includes:aView) ifTrue:[
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   202
	    gotExpose add:aView.
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   203
	]
1244
d3182558fc9d hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
   204
    ].
d3182558fc9d hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
   205
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   206
    aView
2718
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   207
	dispatchEvent:#graphicsExposeX:y:width:height:final:
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   208
	arguments:(Array with:x with:y with:w with:h with:final)
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   210
"/    WindowEvent
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   211
"/        sendEvent:#graphicsExposeX:y:width:height:final:
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   212
"/        arguments:(Array with:x with:y with:w with:h with:final)
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   213
"/        view:aView
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   214
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   215
    "Created: / 24.11.1995 / 19:16:38 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   216
    "Modified: / 20.5.1998 / 22:57:32 / cg"
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
keyPress:untranslatedKey x:x y:y view:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
    "forward a key-press event for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   222
    |xlatedKey ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
266
1e234d542ef9 oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   224
    self key:untranslatedKey state:true. 
1e234d542ef9 oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   225
2141
ed587c556c11 ask view for keyboardMap.
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
   226
    xlatedKey := aView graphicsDevice translateKey:untranslatedKey forView:aView.
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
    xlatedKey notNil ifTrue:[
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   228
        ev := WindowEvent 
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   229
                keyPress:xlatedKey
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   230
                rawKey:untranslatedKey
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   231
                hasShift:shiftDown ctrl:ctrlDown alt:altDown meta:metaDown
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   232
                button1:leftButtonDown button2:middleButtonDown button3:rightButtonDown
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   233
                x:x y:y view:aView.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   234
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   235
        self sendEvent:ev to:aView.
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
    ]
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   238
    "Created: / 24.11.1995 / 19:17:23 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   239
    "Modified: / 20.5.1998 / 22:57:52 / cg"
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
keyRelease:untranslatedKey x:x y:y view:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
    "forward a key-release event for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   245
    |xlatedKey ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
266
1e234d542ef9 oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   247
    self key:untranslatedKey state:false. 
1e234d542ef9 oops - forgot modifier key processing (altDown, shiftDown etc.)
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   248
2141
ed587c556c11 ask view for keyboardMap.
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
   249
    xlatedKey := aView graphicsDevice translateKey:untranslatedKey forView:aView.
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
    xlatedKey notNil ifTrue:[
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   251
        ev := WindowEvent
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   252
                keyRelease:xlatedKey
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   253
                rawKey:untranslatedKey
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   254
                hasShift:shiftDown ctrl:ctrlDown alt:altDown meta:metaDown
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   255
                button1:leftButtonDown button2:middleButtonDown button3:rightButtonDown
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   256
                x:x y:y view:aView.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   257
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   258
        self sendEvent:ev to:aView.
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
    ]
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   261
    "Created: / 24.11.1995 / 19:17:50 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   262
    "Modified: / 20.5.1998 / 22:58:05 / cg"
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
mappedView:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
    "forward a mapped event for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   268
    |ev|
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   269
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   270
    ev := WindowEvent mappedView:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   271
    aView dispatchEvent:ev
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
    "Created: 24.11.1995 / 19:18:01 / cg"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   276
mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime view:aView
2699
01594e76fc92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2141
diff changeset
   277
    "forward a wheel-motion for some view"
01594e76fc92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2141
diff changeset
   278
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   279
    |ev|
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   280
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   281
    ev := WindowEvent mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime view:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   282
    self sendEvent:ev to:aView.
2699
01594e76fc92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2141
diff changeset
   283
01594e76fc92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2141
diff changeset
   284
    "Created: / 21.5.1999 / 13:07:51 / cg"
01594e76fc92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2141
diff changeset
   285
!
01594e76fc92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2141
diff changeset
   286
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
noExposeView:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
    "forward a noExpose event for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
1243
0c33cb7f8458 hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   290
    catchExpose isNil ifTrue:[
2718
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   291
	'SWSensor [info]: noExpose but not catching' infoPrintCR.
1243
0c33cb7f8458 hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   292
    ].
0c33cb7f8458 hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   293
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   294
    (catchExpose includes:aView) ifTrue:[
2718
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   295
	gotExpose add:aView.
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   296
	catchExpose remove:aView.
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   297
    ].
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
    aView noExpose.
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
    "Created: 24.11.1995 / 19:18:10 / cg"
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   301
    "Modified: 29.1.1997 / 20:46:47 / cg"
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
pointerEnter:buttonState x:x y:y view:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
    "forward a pointer enter for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   307
    |ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   309
    ev := WindowEvent pointerEnter:buttonState x:x y:y view:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   310
    aView dispatchEvent:ev
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   311
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   312
    "Created: / 24.11.1995 / 19:18:20 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   313
    "Modified: / 20.5.1998 / 22:58:20 / cg"
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
pointerLeave:buttonState view:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
    "forward a pointer leave for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   319
    |ev|
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   321
    ev := WindowEvent pointerLeave:buttonState view:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   322
    aView dispatchEvent:ev
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   323
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   324
    "Created: / 24.11.1995 / 19:18:30 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 1872
diff changeset
   325
    "Modified: / 20.5.1998 / 22:58:35 / cg"
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
saveAndTerminateView:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
    "forward a saveAndTerminate event for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
    aView saveAndTerminate
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
    "Created: 24.11.1995 / 19:18:38 / cg"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   335
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
terminateView:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   337
    "forward a terminate event for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
    aView terminate
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
    "Created: 24.11.1995 / 19:18:48 / cg"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   344
unmappedView:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
    "forward an unmapped event for some view"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   347
    |ev|
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   348
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   349
    ev := WindowEvent unmappedView:aView.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   350
    aView dispatchEvent:ev
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
    "Created: 24.11.1995 / 19:18:59 / cg"
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
! !
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   355
!SynchronousWindowSensor methodsFor:'private'!
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   356
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   357
sendEvent:anEvent to:aView
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   358
    WindowGroup lastEventQuerySignal handle:[:ex|
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   359
        ex proceedWith:anEvent.
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   360
    ] do:[
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   361
        aView dispatchEvent:anEvent
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   362
    ].
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   363
! !
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   364
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   365
!SynchronousWindowSensor methodsFor:'specials'!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   366
1243
0c33cb7f8458 hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   367
catchExposeFor:aView
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   368
    "start catching noExpose events (must be done BEFORE a bitblt)."
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   369
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   370
    catchExpose notEmpty ifTrue:[
2718
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   371
	'SWSensor [warning]: already catching in catchExpose' errorPrintCR.
1243
0c33cb7f8458 hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   372
    ].
0c33cb7f8458 hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   373
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   374
    gotOtherEvent remove:aView ifAbsent:nil.
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   375
    gotExpose remove:aView ifAbsent:nil.
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   376
    catchExpose add:aView.
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   377
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   378
    "Modified: 29.1.1997 / 20:43:44 / cg"
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   379
!
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   380
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   381
waitForExposeFor:aView
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   382
    "wait until a graphicsExpose or a noExpose arrives (after a bitblt)."
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   383
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   384
    |device windowId stopPoll endPollTime|
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   385
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   386
    device := aView graphicsDevice.
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   387
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   388
    "/ this is only needed for X ...
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   389
    device scrollsAsynchronous ifTrue:[
2718
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   390
	windowId := aView id.
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   391
2718
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   392
	"/
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   393
	"/ cannot suspend, I am a synchronous-modal sensor
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   394
	"/ must poll for the event
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   395
	"/
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   396
	endPollTime := AbsoluteTime now addSeconds:10.
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   397
	stopPoll := false.
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   398
2718
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   399
	[(gotExpose includes:aView) or:[stopPoll]] whileFalse:[
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   400
	    (device exposeEventPendingFor:windowId withSync:true) ifTrue:[
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   401
		device dispatchExposeEventFor:windowId.
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   402
	    ].
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   403
	    stopPoll := (AbsoluteTime now > endPollTime).
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   404
	    Processor yield.
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   405
	].
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   406
2718
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   407
	stopPoll ifTrue:[
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   408
	    'SyncWindowSensor [warning]: lost expose event' errorPrintCR.
85d77ac33019 deltaTime arg in mouseWheelMotion
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   409
	]
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   410
    ].
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   411
1299
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   412
    catchExpose remove:aView ifAbsent:nil.
5ebe6f8165cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
   413
    gotExpose remove:aView ifAbsent:nil.
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   414
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
   415
    "Modified: 19.8.1997 / 17:25:09 / cg"
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   416
! !
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   417
1243
0c33cb7f8458 hopefully fixed the 'lost expose' bug
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   418
!SynchronousWindowSensor class methodsFor:'documentation'!
264
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   419
fc9ecf4814a0 use another (synchronous) type of sensor while in a modal debugger.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   420
version
3680
4c096f11e018 more windowEvent types;
ca
parents: 3594
diff changeset
   421
    ^ '$Header: /cvs/stx/stx/libview/SynchronousWindowSensor.st,v 1.23 2002-08-02 11:55:31 ca Exp $'
615
59b046c2e44f documentation
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   422
! !