EventListener.st
author Claus Gittinger <cg@exept.de>
Sun, 23 Nov 2014 14:42:46 +0100
changeset 3398 27762e2393d8
parent 3036 158bdd183939
child 3661 c340d371658a
permissions -rw-r--r--
class: MIMETypeIconLibrary added: #flushIcons comment/format in: #fileTypeIconKeyFor:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
     1
"
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
77
claus
parents: 60
diff changeset
     3
	      All Rights Reserved
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
     4
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    11
"
1424
3198d7d846be catch errors when processing events;
tm
parents: 1271
diff changeset
    12
"{ Package: 'stx:libview2' }"
3198d7d846be catch errors when processing events;
tm
parents: 1271
diff changeset
    13
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    14
Object subclass:#EventListener
212
874afdeb380a commentary
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
    15
	instanceVariableNames:''
874afdeb380a commentary
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
    16
	classVariableNames:''
874afdeb380a commentary
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
    17
	poolDictionaries:''
2687
9d0bae89d82f category change
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
    18
	category:'Interface-Support-UI'
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    19
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    20
1173
8c6ccf98efd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
    21
!EventListener class methodsFor:'documentation'!
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    22
123
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    23
copyright
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    24
"
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    25
 COPYRIGHT (c) 1995 by Claus Gittinger
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    26
	      All Rights Reserved
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    27
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    28
 This software is furnished under a license and may be used
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    29
 only in accordance with the terms of that license and with the
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    31
 be provided or otherwise made available to, or used by, any
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    32
 other person.  No title to or ownership of the software is
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    33
 hereby transferred.
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    34
"
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    35
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    36
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    37
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    38
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    39
documentation
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    40
"
98
claus
parents: 96
diff changeset
    41
    abstract class for event listeners. EventListeners can be used to intercept
claus
parents: 96
diff changeset
    42
    incoming events (keyboard & mouse) directly from a sensor, or even
claus
parents: 96
diff changeset
    43
    for a complete display device.
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    44
    A concrete application is the bubble help, which tracks entering/leaving
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    45
    views, and pops up some help message. 
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    46
    See concrete code in ActiveHelp.
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    47
98
claus
parents: 96
diff changeset
    48
    For each intercepted event, a corresponding method is called for in instances
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    49
    of myself - these MUST return true, if the event is to be ignored (i.e.
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    50
    assumed to be processed and consumed by the reader, 
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    51
    and MUST return false, if the normal event procedure should be performed. 
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    52
    Since this is an abstract class,
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    53
    all of my intercept methods return false. 
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    54
    They are meant to be redefined in concrete subclasses.
212
874afdeb380a commentary
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
    55
874afdeb380a commentary
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
    56
    [see also:]
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    57
	WindowSensor WindowEvent WindowGroup
222
c51b06f6bf9a documentation
Claus Gittinger <cg@exept.de>
parents: 213
diff changeset
    58
c51b06f6bf9a documentation
Claus Gittinger <cg@exept.de>
parents: 213
diff changeset
    59
    [author:]
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    60
	Claus Gittinger
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    61
"
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    62
! !
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    63
2913
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
    64
!EventListener class methodsFor:'others'!
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
    65
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
    66
version_CVS
3036
158bdd183939 Support of hotkey events
ab
parents: 2913
diff changeset
    67
    ^ '$Header: /cvs/stx/stx/libview2/EventListener.st,v 1.29 2012-11-27 17:44:36 ab Exp $'
2913
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
    68
! !
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
    69
2390
67d0a61fbadf edit/list aspect methods
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
    70
!EventListener methodsFor:'event handling'!
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    71
2476
7fa9e8576594 changed #buttonMotion:x:y:view:
Claus Gittinger <cg@exept.de>
parents: 2390
diff changeset
    72
buttonMotion:buttonAndModifierState x:x y:y view:aView
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    73
    "not handled here - should be redefined in a concrete subclass"
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    74
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    75
    ^ false
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    76
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    77
    "Modified: 23.4.1996 / 21:57:54 / cg"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    78
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    79
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    80
buttonMultiPress:button x:x y:y view:aView
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    81
    "not handled here - should be redefined in a concrete subclass"
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    82
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    83
    ^ false
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    84
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    85
    "Modified: 23.4.1996 / 21:57:58 / cg"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    86
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    87
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    88
buttonPress:button x:x y:y view:aView
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    89
    "not handled here - should be redefined in a concrete subclass"
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    90
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    91
    ^ false
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    92
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    93
    "Modified: 23.4.1996 / 21:58:01 / cg"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    94
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    95
123
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    96
buttonRelease:button x:x y:y view:aView
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    97
    "not handled here - should be redefined in a concrete subclass"
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    98
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    99
    ^ false
123
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   100
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
   101
    "Modified: 23.4.1996 / 21:58:03 / cg"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   102
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   103
2516
d088b12a7948 add #focusInView:
fm
parents: 2476
diff changeset
   104
focusInView:aView
d088b12a7948 add #focusInView:
fm
parents: 2476
diff changeset
   105
    "not handled here - should be redefined in a concrete subclass"
d088b12a7948 add #focusInView:
fm
parents: 2476
diff changeset
   106
d088b12a7948 add #focusInView:
fm
parents: 2476
diff changeset
   107
    ^ false
d088b12a7948 add #focusInView:
fm
parents: 2476
diff changeset
   108
!
d088b12a7948 add #focusInView:
fm
parents: 2476
diff changeset
   109
d088b12a7948 add #focusInView:
fm
parents: 2476
diff changeset
   110
focusOutView:aView
d088b12a7948 add #focusInView:
fm
parents: 2476
diff changeset
   111
    "not handled here - should be redefined in a concrete subclass"
d088b12a7948 add #focusInView:
fm
parents: 2476
diff changeset
   112
d088b12a7948 add #focusInView:
fm
parents: 2476
diff changeset
   113
    ^ false
d088b12a7948 add #focusInView:
fm
parents: 2476
diff changeset
   114
!
d088b12a7948 add #focusInView:
fm
parents: 2476
diff changeset
   115
1424
3198d7d846be catch errors when processing events;
tm
parents: 1271
diff changeset
   116
hasKeyboardFocus:aBoolean view:aView
3198d7d846be catch errors when processing events;
tm
parents: 1271
diff changeset
   117
    "not handled here - should be redefined in a concrete subclass"
3198d7d846be catch errors when processing events;
tm
parents: 1271
diff changeset
   118
3198d7d846be catch errors when processing events;
tm
parents: 1271
diff changeset
   119
    ^ false
3198d7d846be catch errors when processing events;
tm
parents: 1271
diff changeset
   120
!
3198d7d846be catch errors when processing events;
tm
parents: 1271
diff changeset
   121
3036
158bdd183939 Support of hotkey events
ab
parents: 2913
diff changeset
   122
hotkeyWithId:aHotKeyId rawKey:theRawKey view: aView
158bdd183939 Support of hotkey events
ab
parents: 2913
diff changeset
   123
    "not handled here - should be redefined in a concrete subclass"
158bdd183939 Support of hotkey events
ab
parents: 2913
diff changeset
   124
158bdd183939 Support of hotkey events
ab
parents: 2913
diff changeset
   125
    ^ false
158bdd183939 Support of hotkey events
ab
parents: 2913
diff changeset
   126
158bdd183939 Support of hotkey events
ab
parents: 2913
diff changeset
   127
    "Modified: 23.4.1996 / 21:57:54 / cg"
158bdd183939 Support of hotkey events
ab
parents: 2913
diff changeset
   128
!
158bdd183939 Support of hotkey events
ab
parents: 2913
diff changeset
   129
123
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   130
keyPress:key x:x y:y view:aView
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   131
    "not handled here - should be redefined in a concrete subclass"
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
   132
123
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   133
    ^ false
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   134
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
   135
    "Modified: 23.4.1996 / 21:58:08 / cg"
123
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   136
!
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   137
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   138
keyRelease:key x:x y:y view:aView
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   139
    "not handled here - should be redefined in a concrete subclass"
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
   140
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   141
    ^ false
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   142
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
   143
    "Modified: 23.4.1996 / 21:58:11 / cg"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   144
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   145
1178
44f1fee1b444 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   146
mouseWheelMotion:state x:x y:y amount:amount deltaTime:dTime view:aView
1173
8c6ccf98efd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   147
    "not handled here - can be redefined in a concrete subclass"
8c6ccf98efd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   148
8c6ccf98efd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   149
    ^ false
8c6ccf98efd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   150
8c6ccf98efd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   151
    "Modified: / 23.4.1996 / 21:57:54 / cg"
8c6ccf98efd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   152
    "Created: / 21.5.1999 / 13:07:13 / cg"
8c6ccf98efd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   153
!
8c6ccf98efd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   154
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   155
pointerEnter:state x:x y:y view:view
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   156
    "not handled here - should be redefined in a concrete subclass"
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
   157
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   158
    ^ false
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   159
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
   160
    "Modified: 23.4.1996 / 21:58:14 / cg"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   161
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   162
123
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   163
pointerLeave:state view:view
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   164
    "not handled here - should be redefined in a concrete subclass"
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
   165
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   166
    ^ false
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   167
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
   168
    "Modified: 23.4.1996 / 21:58:17 / cg"
2390
67d0a61fbadf edit/list aspect methods
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   169
! !
67d0a61fbadf edit/list aspect methods
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   170
2913
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   171
!EventListener methodsFor:'event handling-basic'!
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   172
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   173
processEvent:ev
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   174
    "process an event; if true is returned, the event is considered to be
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   175
     'eaten' by the listener, and not passed to the view.
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   176
     If false is returned, the event is processed as usual.
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   177
     Here, the event is dispatched into one of the button*/key* etc. methods"
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   178
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   179
    "/ subclasses may do:
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   180
    "/    |eventHasBeenProcessed|
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   181
    "/
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   182
    "/    eventHasBeenProcessed := false.
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   183
    "/    Error handle:[:ex |
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   184
    "/        ('Listener [info]: error while processing event: ' , ex description) infoPrintCR.
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   185
    "/    ] do:[
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   186
    "/        eventHasBeenProcessed := ev dispatchWithViewArgumentTo:self
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   187
    "/    ].
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   188
    "/    ^ eventHasBeenProcessed
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   189
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   190
    ^ false
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   191
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   192
    "Modified: / 29-06-2011 / 19:13:18 / cg"
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   193
! !
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   194
2390
67d0a61fbadf edit/list aspect methods
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   195
!EventListener methodsFor:'events-window creation'!
1262
9b691fdaae56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   196
9b691fdaae56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   197
postCreateView:aView
2913
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   198
    "a synthetic event:
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   199
     some view was created"
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   200
1262
9b691fdaae56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   201
    ^ self
2913
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   202
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   203
    "Modified: / 29-06-2011 / 18:55:53 / cg"
1262
9b691fdaae56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   204
!
9b691fdaae56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   205
9b691fdaae56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   206
preCreateView:aView
2913
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   207
    "a synthetic event:
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   208
     some view is about to be created;
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   209
     gives me a chance to intercept and change size, origin, color, etc."
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   210
1262
9b691fdaae56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   211
    ^ self
2913
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   212
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   213
    "Modified: / 29-06-2011 / 18:54:19 / cg"
2390
67d0a61fbadf edit/list aspect methods
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   214
!
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   215
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   216
preCreateView:aView origin:org
2913
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   217
    "Obsolete now - the system will now send a preCreateView: event (without origin arg).
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   218
     not really an event:
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   219
     invoked right before a view is about to be physically created.
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   220
     May return a new origin."
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   221
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   222
    ^ org
2913
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   223
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   224
    "Modified: / 29-06-2011 / 18:55:23 / cg"
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   225
! !
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   226
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   227
!EventListener methodsFor:'listen'!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   228
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   229
listen
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   230
    "install myself as listener"
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   231
1262
9b691fdaae56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   232
    WindowSensor addEventListener:self
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   233
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   234
    "
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   235
     |listener|
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   236
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   237
     listener := EventListener new.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   238
     listener listen.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   239
     (Delay forSeconds:20) wait.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   240
     listener unlisten
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   241
    "
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   242
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   243
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   244
unlisten
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   245
    "uninstall myself as listener"
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   246
1262
9b691fdaae56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   247
    WindowSensor removeEventListener:self 
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   248
! !
123
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   249