EventListener.st
author Claus Gittinger <cg@exept.de>
Mon, 25 Jul 2011 17:31:41 +0200
changeset 2932 2121f8e38cf5
parent 2913 a3a577a77dc1
child 3036 158bdd183939
permissions -rw-r--r--
added: #resize #version_CVS
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
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
    67
    ^ '$Header: /cvs/stx/stx/libview2/EventListener.st,v 1.28 2011-06-29 17:14:28 cg Exp $'
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
123
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   122
keyPress:key x:x y:y view:aView
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   123
    "not handled here - should be redefined in a concrete subclass"
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
   124
123
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   125
    ^ false
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   126
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
   127
    "Modified: 23.4.1996 / 21:58:08 / cg"
123
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   128
!
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   129
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   130
keyRelease: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
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   133
    ^ false
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   134
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
   135
    "Modified: 23.4.1996 / 21:58:11 / cg"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   136
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   137
1178
44f1fee1b444 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
   138
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
   139
    "not handled here - can be redefined in a concrete subclass"
8c6ccf98efd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   140
8c6ccf98efd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   141
    ^ false
8c6ccf98efd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   142
8c6ccf98efd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   143
    "Modified: / 23.4.1996 / 21:57:54 / cg"
8c6ccf98efd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   144
    "Created: / 21.5.1999 / 13:07:13 / cg"
8c6ccf98efd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   145
!
8c6ccf98efd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   146
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   147
pointerEnter:state x:x y:y view:view
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   148
    "not handled here - should be redefined in a concrete subclass"
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
   149
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   150
    ^ false
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   151
213
9fac751c6499 commentary
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
   152
    "Modified: 23.4.1996 / 21:58:14 / cg"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   153
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   154
123
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   155
pointerLeave:state 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:17 / cg"
2390
67d0a61fbadf edit/list aspect methods
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   161
! !
67d0a61fbadf edit/list aspect methods
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   162
2913
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   163
!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
   164
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   165
processEvent:ev
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   166
    "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
   167
     '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
   168
     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
   169
     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
   170
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   171
    "/ subclasses may do:
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   172
    "/    |eventHasBeenProcessed|
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   173
    "/
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   174
    "/    eventHasBeenProcessed := false.
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   175
    "/    Error handle:[:ex |
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   176
    "/        ('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
   177
    "/    ] do:[
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   178
    "/        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
   179
    "/    ].
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
    ^ false
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   183
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   184
    "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
   185
! !
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   186
2390
67d0a61fbadf edit/list aspect methods
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   187
!EventListener methodsFor:'events-window creation'!
1262
9b691fdaae56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   188
9b691fdaae56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   189
postCreateView:aView
2913
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   190
    "a synthetic event:
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   191
     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
   192
1262
9b691fdaae56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   193
    ^ self
2913
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   194
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   195
    "Modified: / 29-06-2011 / 18:55:53 / cg"
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
9b691fdaae56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   198
preCreateView:aView
2913
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   199
    "a synthetic event:
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   200
     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
   201
     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
   202
1262
9b691fdaae56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   203
    ^ self
2913
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   204
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   205
    "Modified: / 29-06-2011 / 18:54:19 / cg"
2390
67d0a61fbadf edit/list aspect methods
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   206
!
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   207
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   208
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
   209
    "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
   210
     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
   211
     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
   212
     May return a new origin."
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   213
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   214
    ^ org
2913
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   215
a3a577a77dc1 change to only expect one single method to be (re)defined:
Claus Gittinger <cg@exept.de>
parents: 2687
diff changeset
   216
    "Modified: / 29-06-2011 / 18:55:23 / cg"
574
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   217
! !
a4fe01515dc1 added windowCreation hooks
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
   218
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   219
!EventListener methodsFor:'listen'!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   220
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   221
listen
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   222
    "install myself as listener"
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   223
1262
9b691fdaae56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   224
    WindowSensor addEventListener:self
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   225
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   226
    "
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   227
     |listener|
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   228
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   229
     listener := EventListener new.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   230
     listener listen.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   231
     (Delay forSeconds:20) wait.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   232
     listener unlisten
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   233
    "
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   234
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   235
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   236
unlisten
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   237
    "uninstall myself as listener"
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   238
1262
9b691fdaae56 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   239
    WindowSensor removeEventListener:self 
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   240
! !
123
39e9679c132d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   241