|
Class: WindowEvent
Object
|
+--Message
|
+--MessageSend
|
+--Event
|
+--WindowEvent
|
+--WidgetEvent
|
+--WindowEvent::ApplicationEvent
|
+--WindowEvent::ClientEvent
|
+--WindowEvent::ConfigureEvent
|
+--WindowEvent::DamageEvent
|
+--WindowEvent::InputEvent
|
+--WindowEvent::MessageSendEvent
|
+--WindowEvent::NewDamageEvent
|
+--WindowEvent::SelectionEvent
|
+--WindowEvent::TerminateEvent
|
+--WindowEvent::VisibilityChangeEvent
|
+--WindowEvent::WidgetSelectionEvent
|
+--WindowEvent::WindowMapUnmapEvent
- Package:
- stx:libview
- Category:
- Interface-Support-UI
- Version:
- rev:
1.133
date: 2023/06/02 09:04:54
- user: cg
- file: WindowEvent.st directory: libview
- module: stx stc-classLibrary: libview
Instances of WindowEvent are created for every event coming from the graphics device.
Usually, they are enqueued by the event dispatcher process into
a sensor's input queue, and dequeued & processed by a windowGroup process
in its event loop.
WindowEvents hold the event type and additional information (such as key,
x/y coordinates etc). Also, windowEvents know how to send themself to some
destination. To provide a common (single) place where event dispatching is
implemented, this forwarding is done by a class method here (i.e. not by the
window group itself).
The algorithm for event dispatching is:
- if the destination view has a keyboard focus set,
AND the event is a keyboard event,
THEN recursively invoke the event dispatching method,
sending the event to the focus view (or its delegate, as below)
- if the destination view has a delegate,
AND its a keyboard, button or pointer event,
AND the delegate is interested in that event
(i.e. implements & responds to #handlesXXX with true)
THEN send the event to the delegate, passing the original view
as additional argument
- if the view has a nonNil controller,
AND its a key, button or pointer event,
THEN send the event to the controller
- otherwise send the event to the view
If the view has a non-nil transformation, the event is sent as a
#deviceXXX message, passing device coordinates. Typically, subclasses
of view do not redefine this method and the inherited default method
translates these device coordinates into logical coordinates and resends
an XXX message.
If the view has no transformation, the XXX message is directly sent here.
For example, a 'buttonPress:button x:x y:y' event leads to sending of
'aView deviceButtonPress:button x:x y:y' which resends
'aView buttonPress:button x:(x-logical) y:(y-logical)'
This allows views which are interested in deviceCoordinates to get them
(by redefining #deviceXXX) and other views to transparently get & use
logical coordinates.
Therefore, for a delegated keyPress messages, the flow is:
sendEvent
view has delegate
------> ask delegate via 'handlesKeyPress:key inView:view'
<------ returns true
------> 'delegate keyPress:key x:x y:y view:view'
-----> delegate does whatever it wants to do
(typically sends the event to some other view)
for an undelegated message:
sendEvent
view has delegate
------> ask delegate via 'handlesKeyPress:key inView:view'
<------ returns false
view has controller
------> 'controller keyPress:key x:x y:y'
view has no controller
view has transformation
----> 'view deviceKeyPress:key x:x y:y'
inverse transform x/y
----> 'self keyPress:key x:xLogical y:yLogical'
view has no transformation
----> 'view keyPress:key x:x y:y'
copyrightCOPYRIGHT (c) 1993 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.
class access
-
buttonMotionEvent
-
-
buttonPressEvent
-
-
buttonReleaseEvent
-
constants
-
dropType_directory
-
-
dropType_file
-
-
dropType_files
-
-
dropType_text
-
instance creation
-
buttonMotion: buttonAndModifierState x: x y: y view: aView
-
-
buttonMultiPress: button x: x y: y view: aView
-
-
buttonPress: button x: x y: y view: aView
-
-
buttonRelease: button x: x y: y view: aView
-
-
clientMessageEvent: type format: format eventData: data view: aView
-
this one is only used with X-Windows
-
configureX: x y: y width: w height: h view: aView
-
-
copyDataEvent: parameter eventData: data view: aView
-
this one is only used with Win32
-
coveredBy: coveringSiblingView view: coveredView
-
-
createWindow: view x: x y: y width: w height: h
-
-
damageFor: aView rectangle: aRectangle
-
create and return a new damage Event for aRectangle
in aView
-
destroyedView: aView
-
-
dropFiles: files view: view position: dropPositionOrNil handle: dropHandleOrNil
-
-
dropMessage: dropTypeSymbol data: dropValue view: aView position: positionOrNil handle: dropHandleOrNil
-
-
focusInView: aView
-
-
focusOutView: aView
-
-
hotkeyWithId: aHotkeyId rawKey: keyWithModifier view: aView
-
-
keyPress: key rawKey: untranslatedKey hasShift: shiftDown ctrl: ctrlDown alt: altDown meta: metaDown button1: leftButtonDown button2: middleButtonDown button3: rightButtonDown x: x y: y view: aView
-
-
keyPress: key x: x y: y view: aView
-
-
keyRelease: key rawKey: untranslatedKey hasShift: shiftDown ctrl: ctrlDown alt: altDown meta: metaDown button1: leftButtonDown button2: middleButtonDown button3: rightButtonDown x: x y: y view: aView
-
-
keyRelease: key x: x y: y view: aView
-
-
keyboardFocus: arg view: aView
-
-
mappedView: aView
-
Modified (format): / 28-10-2022 / 12:50:47 / Stefan Vogel
-
messageSend: receiver selector: aSelector arguments: arguments
-
create and return a new messageSend for sending
aSelector-message with arguments to receiver.
Usually, these are placed into the eventQueue, to ensure synchronized operation of change-update notifications
-
mouseWheelMotion: state x: x y: y amount: amount deltaTime: deltaTime view: aView
-
-
nativeWidgetCommand: command arguments: argVector view: aView
-
-
newDamageFor: aView
-
create and return a new damage Event for aView
-
pasteFromClipBoard: something view: aView
-
-
pointerEnter: state x: x y: y view: aView
-
-
pointerLeave: state view: aView
-
-
postViewCreateNotification: aView
-
-
preViewCreateNotification: aView
-
-
propertyChange: view property: propertyId state: aSymbol time: time
-
-
saveAndTerminateView: aView
-
-
terminateView: aView
-
-
trayAction: event arguments: argVector view: aView
-
-
unmappedView: aView
-
Modified (format): / 28-10-2022 / 12:51:28 / Stefan Vogel
-
visibilityOf: aView changedTo: how
-
instance creation-basic
-
for: aView type: aSymbol
-
create and return a new windowEvent for sending
aSymbol-message with no arguments to aView
-
for: aView type: aSymbol arguments: argArray
-
create and return a new windowEvent for sending
aSymbol-message with arguments to aView
-
new
-
Modified (format): / 31-08-2012 / 19:44:41 / cg
Compatibility-VW
-
redButtonPressed
-
accessing
-
consumed
-
return the value of the instance variable 'consumed' (automatically generated)
-
consumed: aBoolean
-
set the value of the instance variable 'consumed' (automatically generated)
-
delegatedFrom
-
return the value of the instance variable 'delegatedFrom' (automatically generated)
-
delegatedFrom: someOne
-
set the value of the instance variable 'delegatedFrom' (automatically generated)
-
key
-
return the key - nil is returned here.
This is redefined in KeyboardEvent.
-
mousePoint
-
the x/y coordinate - if any.
nil returned for all but button- and keyEvents
-
rectangle
-
return the damage rectangle
-
type
-
return the type of the event
-
view
-
return the view, for which the event is for
-
view: aView
-
set the view, for which the event is for
-
x
-
the x coordinate - if any.
nil returned for all but button- and keyEvents
-
x: ignoredInteger
-
set the x coordinate - ignored here.
only for button- and keyEvents
-
y
-
the y coordinate - if any.
nil returned for all but button- and keyEvents
-
y: ignoredInteger
-
set the y coordinate - ignored here.
only for button- and keyEvents
dispatching
-
dispatchTo: anObject
-
send this event to anObject
-
dispatchWithViewArgumentTo: anObject
-
send this event to anObject, and pass an additional view argument
printing & storing
-
displayOn: aGCOrStream
-
Compatibility
append a printed desription on some stream (Dolphin, Squeak)
OR:
display the receiver in a graphicsContext at 0@0 (ST80).
This method allows for any object to be displayed in some view
(although the fallBack is to display its printString ...)
private-accessing
-
for: aView type: aSymbol
-
set the instance variables of the event
-
for: aView type: aSymbol arguments: argArray
-
set the instance variables of the event
queries
-
hasAlt
-
return true, if this is a keyboard event, with ALT pressed
-
hasCtrl
-
return true, if this is a keyboard event, with CTRL pressed
-
hasMeta
-
return true, if this is a keyboard event, with META pressed
-
hasShift
-
return true, if this is a keyboard event, with SHIFT pressed
-
targetView
-
return the view which will eventually handle the event;
for most events, this is the same as the view, for which the event was
originally generated.
Except, if an explicit focus has been assigned (i.e. tabbed into a component),
AND the event is a keyboard event. In this case, the targetView might be different.
Notice: this method might return nil, for synthetic (app-related) or display screen related
events
testing
-
isApplicationEvent
-
return true, if this event is application related (i.e. not for a particular view)
-
isButtonEvent
-
return true, if this event is a button event
-
isButtonMotionEvent
-
return true, if this event is a buttonMotion event
-
isButtonMultiPressEvent
-
return true, if this event is a buttonMulti-Press event
-
isButtonPressEvent
-
return true, if this event is a buttonPress event
-
isButtonReleaseEvent
-
return true, if this event is a buttonPress event
-
isConfigureEvent
-
return true, if this is a window geometry change event
-
isCreateWindowEvent
-
return true, if this event is a CreateWindow event
-
isDamage
-
return true, if this is a damage event
-
isDamageForView: aView
-
return true, if this is a damage event for a View
-
isDelegatedToFocusView
-
return true, if this event will be forwarded to a focusView.
-
isFocusEvent
-
return true, if this event is a focusIn/focusOut event
-
isFocusInEvent
-
return true, if this event is a focusIn event
-
isFocusOutEvent
-
return true, if this event is a focusOut event
-
isHotKeyEvent
-
return true, if this event is a hotkey event
-
isInputEvent
-
return true, if this event is an input (pointer, key or button) event
-
isKeyEvent
-
return true, if this event is a keyboard event
-
isKeyPressEvent
-
return true, if this event is a keyboard press event
-
isKeyReleaseEvent
-
return true, if this event is a keyboard release event
-
isKeyboardFocusEvent
-
return true, if this event is a keyboard focus event
-
isMapEvent
-
return true, if this is a map event
-
isMessageSendEvent
-
return true, if this event is a general messageSend event
-
isMouseWheelEvent
-
-
isPointerEnterEvent
-
return true, if this event is a pointer-enter event
-
isPointerEnterLeaveEvent
-
return true, if this event is a pointer-enter/leave event
-
isPointerLeaveEvent
-
return true, if this event is a pointer-leave event
-
isPropertyChangeEvent
-
return true, if this event is a CreateWindow event
-
isTerminateEvent
-
-
isTrayEvent
-
return true, if this is an event from the tray (WIN32 only, for now)
-
isUnmapEvent
-
return true, if this is an unmap event
-
isUserEvent
-
return true, if this event is a user event (i.e. mouse, keyboard or button)
ApplicationEvent
ButtonEvent
ButtonMotionEvent
ButtonMultiPressEvent
ButtonPressEvent
ButtonReleaseEvent
ClientEvent
ConfigureEvent
DamageEvent
DropEvent
EnterLeaveEvent
FocusEvent
HotKeyEvent
InputEvent
KeyPressEvent
KeyReleaseEvent
KeyboardEvent
KeyboardFocusEvent
MessageSendEvent
MouseWheelMotionEvent
NativeWidgetCommandEvent
NewDamageEvent
SelectionClearEvent
SelectionEvent
TerminateEvent
TrayActionEvent
VisibilityChangeEvent
WidgetSelectionEvent
WindowMapUnmapEvent
|