Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.event

Class EM_MOUSE_EVENT


Direct ancestors

EM_EVENT

Known direct descendants

EM_MOUSEBUTTON_EVENT, EM_MOUSEMOTION_EVENT

Features

Invariants

indexing

description

Ancestor class for all mouse events.

date

$Date: 2005/10/23 16:37:09 $

revision

$Revision: 1.9 $

deferred class

EM_MOUSE_EVENT

inherit

EM_EVENT

feature -- Initialization

make (a_pointer: POINTER)

--

-- (From EM_EVENT)

require
a_pointer_not_null: a_pointer /= Default_pointer

feature -- Access

proportional_position: EM_VECTOR_2D

-- Mouse pointer position in possibly transformed coordinates
-- inside the publishing container object.

screen_x: INTEGER

-- X-coordinate of pointer on screen
-- where the mouse event has occured

screen_y: INTEGER

-- Y-Coordinate of pointer position on screen
-- where the mouse event has occured

x: INTEGER

-- X-coordinate of pointer position
-- where the mouse event has occured
-- This is a relative coordinate if used with widgets, otherwise
-- it's the same as screen_x

y: INTEGER

-- Y-Coordinate of pointer position
-- where the mouse event has occured
-- This is a relative coordinate if used with widgets, otherwise
-- it's the same as screen_y

feature -- Status report

button_state: INTEGER

-- Mouse button state specifying which mouse buttons
-- are currently pressed
-- (see button_state_xxx_flag features for possible flag values)

button_state_left: BOOLEAN

-- Is left mouse button currently down?

button_state_middle: BOOLEAN

-- Is middle mouse button currently down?

button_state_right: BOOLEAN

-- Is right mouse button currently down?

caught: BOOLEAN

-- Has Current event already been caught?
-- This means that somebody handled the event
-- and it should not be published any further.

-- (From EM_EVENT)

feature -- Status setting

set_caught (a_bool: BOOLEAN)

-- Set caught to a_bool.
-- One should call set_caught with True
-- when Current should not be published any further.

-- (From EM_EVENT)

ensure
caught_set: caught = a_bool

feature -- Element change

set_coordinates (a_x: like x; a_y: like y)

-- Set the relative mouse coordinates to a_x a_y

set_proportional_position (a_position: like proportional_position)

-- Set proportional_position to a_position.

require
a_position_not_void: a_position /= Void
ensure
proportional_position_set: proportional_position = a_position

feature -- Queries

type: INTEGER

-- Event type
-- (see EM_CONSTANTS for possible values).

-- (From EM_EVENT)

invariant

proportional_position_not_void: proportional_position /= Void

-- From EM_EVENT
sdl_event_not_void: sdl_event /= Void

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end