eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'WindowEvent':

Home

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

Class: WindowEvent


Inheritance:

   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::WindowMapUnmapEvent

Package:
stx:libview
Category:
Interface-Support-UI
Version:
rev: 1.113 date: 2018/03/16 11:13:48
user: stefan
file: WindowEvent.st directory: libview
module: stx stc-classLibrary: libview
Author:
Claus Gittinger

Description:


Instances of WindowEvent are created for every event coming from the graphics device. 
Usually, they are enqueued by the event dispatcher process into
a sensors 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'


Related information:

    WindowGroup
    WindowSensor
    DeviceWorkstation
    View
    KeyboardMap
    KeyboardForwarder
    EventListener

Class protocol:

constants
o  dropType_directory

o  dropType_file

o  dropType_files

o  dropType_text

instance creation
o  buttonMotion: buttonAndModifierState x: x y: y view: aView

o  buttonMultiPress: button x: x y: y view: aView

o  buttonPress: button x: x y: y view: aView

o  buttonRelease: button x: x y: y view: aView

o  clientMessageEvent: type format: format eventData: data view: aView
this one is only used with X-Windows

o  configureX: x y: y width: w height: h view: aView

o  copyDataEvent: parameter eventData: data view: aView
this one is only used with Win32

o  coveredBy: coveringSiblingView view: coveredView

o  createWindow: view x: x y: y width: w height: h

o  damageFor: aView rectangle: aRectangle
create and return a new damage Event for aRectangle
in aView

o  destroyedView: aView

o  dropFiles: files view: view position: dropPositionOrNil handle: dropHandleOrNil

o  dropMessage: dropTypeSymbol data: dropValue view: aView position: positionOrNil handle: dropHandleOrNil

o  focusInView: aView

o  focusOutView: aView

o  hotkeyWithId: aHotkeyId rawKey: keyWithModifier view: aView

o  keyPress: key rawKey: untranslatedKey hasShift: shiftDown ctrl: ctrlDown alt: altDown meta: metaDown button1: leftButtonDown button2: middleButtonDown button3: rightButtonDown x: x y: y view: aView

o  keyPress: key x: x y: y view: aView

o  keyRelease: key rawKey: untranslatedKey hasShift: shiftDown ctrl: ctrlDown alt: altDown meta: metaDown button1: leftButtonDown button2: middleButtonDown button3: rightButtonDown x: x y: y view: aView

o  keyRelease: key x: x y: y view: aView

o  keyboardFocus: arg view: aView

o  mappedView: aView

o  messageSend: receiver selector: aSelector arguments: arguments

o  mouseWheelMotion: state x: x y: y amount: amount deltaTime: deltaTime view: aView

o  nativeWidgetCommand: command arguments: argVector view: aView

o  newDamageFor: aView
create and return a new damage Event for aView

o  pasteFromClipBoard: something view: aView

o  pointerEnter: state x: x y: y view: aView

o  pointerLeave: state view: aView

o  postViewCreateNotification: aView

o  preViewCreateNotification: aView

o  propertyChange: view property: propertyId state: aSymbol time: time

o  saveAndTerminateView: aView

o  terminateView: aView

o  trayAction: event arguments: argVector view: aView

o  unmappedView: aView

o  visibilityOf: aView changedTo: how

instance creation-basic
o  for: aView type: aSymbol
create and return a new windowEvent for sending
aSymbol-message with no arguments to aView

o  for: aView type: aSymbol arguments: argArray
create and return a new windowEvent for sending
aSymbol-message with arguments to aView

o  new
Modified (format): / 31-08-2012 / 19:44:41 / cg


Instance protocol:

accessing
o  consumed
return the value of the instance variable 'consumed' (automatically generated)

o  consumed: aBoolean
set the value of the instance variable 'consumed' (automatically generated)

o  delegatedFrom
return the value of the instance variable 'delegatedFrom' (automatically generated)

o  delegatedFrom: something
set the value of the instance variable 'delegatedFrom' (automatically generated)

o  key
return the key - nil is returned here.
This is redefined in KeyboardEvent.

o  rectangle
return the damage rectangle

o  type
return the type of the event

o  view
return the view, for which the event is for

o  view: aView
set the view, for which the event is for

o  x
the x coordinate - if any.
nil returned for all but button- and keyEvents

o  x: ignoredInteger
set the x coordinate - ignored here.
only for button- and keyEvents

o  y
the y coordinate - if any.
nil returned for all but button- and keyEvents

o  y: ignoredInteger
set the y coordinate - ignored here.
only for button- and keyEvents

dispatching
o  dispatchTo: anObject
send this event to anObject

o  dispatchWithViewArgumentTo: anObject
send this event to anObject, and pass an additional view argument

printing & storing
o  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
o  for: aView type: aSymbol
set the instance variables of the event

o  for: aView type: aSymbol arguments: argArray
set the instance variables of the event

queries
o  hasAlt
return true, if this is a keyboard event, with ALT pressed

o  hasCtrl
return true, if this is a keyboard event, with CTRL pressed

o  hasMeta
return true, if this is a keyboard event, with META pressed

o  hasShift
return true, if this is a keyboard event, with SHIFT pressed

o  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
o  isApplicationEvent
return true, if this event is application related (i.e. not for a particular view)

o  isButtonEvent
return true, if this event is a button event

o  isButtonMotionEvent
return true, if this event is a buttonMotion event

o  isButtonMultiPressEvent
return true, if this event is a buttonMulti-Press event

o  isButtonPressEvent
return true, if this event is a buttonPress event

o  isButtonReleaseEvent
return true, if this event is a buttonPress event

o  isConfigureEvent
return true, if this is a window geometry change event

o  isCreateWindowEvent
return true, if this event is a CreateWindow event

o  isDamage
return true, if this is a damage event

o  isDamageForView: aView
return true, if this is a damage event for a View

o  isDelegatedToFocusView
return true, if this event will be forwarded to a focusView.

o  isFocusEvent
return true, if this event is a focusIn/focusOut event

o  isFocusInEvent
return true, if this event is a focusIn event

o  isFocusOutEvent
return true, if this event is a focusOut event

o  isHotKeyEvent
return true, if this event is a hotkey event

o  isInputEvent
return true, if this event is an input (pointer, key or button) event

o  isKeyEvent
return true, if this event is a keyboard event

o  isKeyPressEvent
return true, if this event is a keyboard press event

o  isKeyReleaseEvent
return true, if this event is a keyboard release event

o  isKeyboardFocusEvent
return true, if this event is a keyboard focus event

o  isMapEvent
return true, if this is a map event

o  isMessageSendEvent
return true, if this event is a general messageSend event

o  isMouseWheelEvent

o  isPointerEnterEvent
return true, if this event is a pointer-enter event

o  isPointerEnterLeaveEvent
return true, if this event is a pointer-enter/leave event

o  isPointerLeaveEvent
return true, if this event is a pointer-leave event

o  isPropertyChangeEvent
return true, if this event is a CreateWindow event

o  isTerminateEvent

o  isTrayEvent
return true, if this is an event from the tray (WIN32 only, for now)

o  isUnmapEvent
return true, if this is an unmap event

o  isUserEvent
return true, if this event is a user event (i.e. mouse, keyboard or button)


Private classes:

    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
    WindowMapUnmapEvent


ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Sun, 18 Nov 2018 08:39:32 GMT