eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'EventListener':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: EventListener


Inheritance:

   Object
   |
   +--EventListener
      |
      +--ActiveHelp
      |
      +--PluggableEventListener
      |
      +--ScreenLock

Package:
stx:libview2
Category:
Interface-Support-UI
Version:
rev: 1.31 date: 2022/10/11 16:24:59
user: cg
file: EventListener.st directory: libview2
module: stx stc-classLibrary: libview2

Description:


abstract class for event listeners. EventListeners can be used to intercept
incoming events (keyboard & mouse) directly from a sensor, or even
for a complete display device.
A concrete application is the bubble help, which tracks entering/leaving
views, and pops up some help message. 
See concrete code in ActiveHelp.

For each intercepted event, a corresponding method is called for in instances
of myself - these MUST return true, if the event is to be ignored (i.e.
assumed to be processed and consumed by the reader, 
and MUST return false, if the normal event procedure should be performed. 
Since this is an abstract class,
all of my intercept methods return false. 
They are meant to be redefined in concrete subclasses.

copyright

COPYRIGHT (c) 1995 by Claus Gittinger All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Instance protocol:

event handling
o  buttonMotion: buttonAndModifierState x: x y: y view: aView
not handled here - should be redefined in a concrete subclass

o  buttonMultiPress: button x: x y: y view: aView
not handled here - should be redefined in a concrete subclass

o  buttonPress: button x: x y: y view: aView
not handled here - should be redefined in a concrete subclass

o  buttonRelease: button x: x y: y view: aView
not handled here - should be redefined in a concrete subclass

o  focusInView: aView
not handled here - should be redefined in a concrete subclass

o  focusOutView: aView
not handled here - should be redefined in a concrete subclass

o  hasKeyboardFocus: aBoolean view: aView
not handled here - should be redefined in a concrete subclass

o  hotkeyWithId: aHotKeyId rawKey: theRawKey view: aView
not handled here - should be redefined in a concrete subclass

o  keyPress: key x: x y: y view: aView
not handled here - should be redefined in a concrete subclass

o  keyRelease: key x: x y: y view: aView
not handled here - should be redefined in a concrete subclass

o  mouseWheelMotion: state x: x y: y amount: amount deltaTime: dTime view: aView
not handled here - can be redefined in a concrete subclass

o  pointerEnter: state x: x y: y view: view
not handled here - should be redefined in a concrete subclass

o  pointerLeave: state view: view
not handled here - should be redefined in a concrete subclass

event handling-basic
o  processEvent: ev
process an event; if true is returned, the event is considered to be
'eaten' by the listener, and not passed to the view.
If false is returned, the event is processed as usual.
Here, the event is dispatched into one of the button*/key* etc. methods

events-window creation
o  postCreateView: aView
a synthetic event:
some view was created

o  preCreateView: aView
a synthetic event:
some view is about to be created;
gives me a chance to intercept and change size, origin, color, etc.

o  preCreateView: aView origin: org
Obsolete now - the system will now send a preCreateView: event (without origin arg).
not really an event:
invoked right before a view is about to be physically created.
May return a new origin.

listen
o  listen
install myself as listener

Usage example(s):

     |listener|

     listener := EventListener new.
     listener listen.
     (Delay forSeconds:20) wait.
     listener unlisten

o  unlisten
uninstall myself as listener



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Thu, 21 Nov 2024 17:13:57 GMT