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