-
Notifications
You must be signed in to change notification settings - Fork 2
MouseEvent
The MouseEvent is used to pass mouse events to Sheets.
Extends Event
Event creation is handled internally by Application.
MouseEvent( Event enum event, number x, number y, number button, boolean within = true )within is whether the event is within the bounds of the parent object of the one handling the event.
MouseEvent.x - number
The relative X position of the event.
MouseEvent.y - number
The relative Y position of the event.
MouseEvent.button - number
The button of the event.
MouseEvent.within - boolean
Whether the event is within the bounds of the parent object to the one handling the event.
boolean within = MouseEvent:isWithinArea( number x, number y, number width, number height )Returns whether the event is within the area given. Note that, as mouse events are localised, to check if the event is within a Sheet, x and y should both be 0. Also note, this doesn't take the within parameter into account. That must be done manually.
MouseEvent e = MouseEvent:clone( number x, number y, boolean within )Returns a cloned event, with modified coordinates and within state, which can be passed to children. within should be whether the event is within the bounds of the object cloning the event.
local within = event:isWithinArea( 0, 0, self.width, self.height )
for i = #children, 1, -1 do
children[i]:handle( event:clone( children[i].x, children[i].y, within ) )
end- Exception
- DynamicValueException
- ExpressionException
- IncorrectConstructorException
- IncorrectParameterException
- ParserException
- ResourceLoadException
- ThreadRuntimeException