next node: WinFontMetrics,
prev node: WinCanvas,
up to node: Subsystem Opal Windows


WinEvent

This structure provides events. An event represents a raw interaction with the program, either issued by the user or generated by the environment. Events can be bound to views, items of views, to windows or to the entire application, such that a command is excuted whenever the event occures.

Signature of WinEvent

List of Import References :
See BOOL
See BTUnion
See Char
See Com
See DENOTATION
See Int
See Nat
See Option
See Real
See Seq
See Set
See String
See Void
See WinConfig
See WinInternal
See WinTclTk

SIGNATURE WinEvent

$Date: 2010-09-30 18:24:17 +0200 (Do, 30. Sep 2010) $ ($Revision: 616 $)

IMPORT  Nat                     ONLY    nat
        Char                    ONLY    char
        Void                    ONLY    void
        Seq[denotation]         ONLY    seq
        Com[void]               ONLY    com

IMPORT  WinConfig               ONLY    point:SORT
        WinInternal             ONLY    wconfig:SORT config:SORT

Type of Events

Events are constructed from basic events such as key("A"), augmented by modifiers such as in double-meta-button(1) and combined to sequences such as in (control-key("C")) ++ key("c").

TYPE event ==
    configure expose destroy reparent map unmap visibility
    enter leave motion focusIn focusOut 
    someButtonPress   buttonPress(no: nat) 
    someButtonRelease buttonRelease(no: nat) 
    someKeyPress   keyPress(keysym: denotation) 
    someKeyRelease keyRelease(keysym: denotation) 
    - (modifier: modifier, event: event)
    ++(left: event, right: event)

FUN button              : nat -> event          -- buttonPress
FUN key                 : denotation -> event   -- keyPress

TYPE modifier ==
    control shift lock meta alt button(no: nat) double triple

FUN C                   : modifier              -- control
FUN S                   : modifier              -- shift
FUN M                   : modifier              -- meta

The number in button-events specifys the button number (starting with 1), the denotation in key-events the name of a window server's keysymbol. The modifiers double and triple indicate the repetition of the given event in a short time.

When an event occures, additional to the events definition, information such as the current mouse position and the pressed keysymbol is generated.

TYPE eventInfo ==
    pointInfo   (event: event, point: point)
    buttonInfo  (event: event, point: point, button: nat)
    keyInfo     (event: event, point: point, keysym: denotation, 
                 keycode: nat, keychar: char)
    noInfo      (event: event)

The pointInfo is associated with the enter, leave and motion events. The buttonInfo is associated with the button and the keyInfo with the key events. All other events have the information noInfo associated.

The point associated with the a motion or button event is measured relatively to the view which receives the event.

Event Bindings

An event may be bound to a view or item, to a window or to the entire application. Each time the event occures, the given command is executed.

FUN  bind : event ** (eventInfo -> com[void]) -> config
FUN  bind : event ** (eventInfo -> com[void]) -> wconfig
FUN  bind : event ** (eventInfo -> com[void]) -> com[void]


next node: WinFontMetrics,
prev node: WinCanvas,
up to node: Subsystem Opal Windows