|
Class: EventListener
Object
|
+--EventListener
|
+--ActiveHelp
|
+--PluggableEventListener
|
+--ScreenLock
- Package:
- stx:libview2
- Category:
- Interface-Support-UI
- Version:
- rev:
1.30
date: 2016/05/04 19:08:49
- user: cg
- file: EventListener.st directory: libview2
- module: stx stc-classLibrary: libview2
- Author:
- Claus Gittinger
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.
WindowSensor
WindowEvent
WindowGroup
event handling
-
buttonMotion: buttonAndModifierState x: x y: y view: aView
-
not handled here - should be redefined in a concrete subclass
-
buttonMultiPress: button x: x y: y view: aView
-
not handled here - should be redefined in a concrete subclass
-
buttonPress: button x: x y: y view: aView
-
not handled here - should be redefined in a concrete subclass
-
buttonRelease: button x: x y: y view: aView
-
not handled here - should be redefined in a concrete subclass
-
focusInView: aView
-
not handled here - should be redefined in a concrete subclass
-
focusOutView: aView
-
not handled here - should be redefined in a concrete subclass
-
hasKeyboardFocus: aBoolean view: aView
-
not handled here - should be redefined in a concrete subclass
-
hotkeyWithId: aHotKeyId rawKey: theRawKey view: aView
-
not handled here - should be redefined in a concrete subclass
-
keyPress: key x: x y: y view: aView
-
not handled here - should be redefined in a concrete subclass
-
keyRelease: key x: x y: y view: aView
-
not handled here - should be redefined in a concrete subclass
-
mouseWheelMotion: state x: x y: y amount: amount deltaTime: dTime view: aView
-
not handled here - can be redefined in a concrete subclass
-
pointerEnter: state x: x y: y view: view
-
not handled here - should be redefined in a concrete subclass
-
pointerLeave: state view: view
-
not handled here - should be redefined in a concrete subclass
event handling-basic
-
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
-
postCreateView: aView
-
a synthetic event:
some view was created
-
preCreateView: aView
-
a synthetic event:
some view is about to be created;
gives me a chance to intercept and change size, origin, color, etc.
-
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
-
listen
-
install myself as listener
-
unlisten
-
uninstall myself as listener
|