If a mouse action is performed over a layer button and the program is currently busy with some time-consuming activity such as file operations, and the user quickly moves the mouse away after the click, it happens that in the event function the immediately read mouse position is completely wrong.
Would Hollywood's architecture allow to supply the mouse coordinates from the time the event was triggered?
Layerbutton and OnMouse... events
- airsoftsoftwair
- Posts: 5834
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Layerbutton and OnMouse... events
Yes.
Code: Select all
Function p_EventControlButton(msg)
Local mousepX=MouseX()
Local mousepY=MouseY()
- airsoftsoftwair
- Posts: 5834
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Layerbutton and OnMouse... events
Ok, I see, I think I can add support for "x" and "y" fields in the table that is passed to the event callback and set them to the mouse position at the time the event occurred. Then it should be possible to get the correct coordinates at the time of the event.
Re: Layerbutton and OnMouse... events
Great, I was hoping something like that would be possible.
- airsoftsoftwair
- Posts: 5834
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Layerbutton and OnMouse... events
Code: Select all
- New: The "OnMouseDown" and "OnMouseUp" (left, right, middle, wheel) event callbacks for the display and
for #SIMPLEBUTTON and #LAYERBUTTON will also receive the position of the mouse pointer at the time the
button was clicked/released now; the position will be in the fields "MouseX" and "MouseY" for simple and
layer buttons and in the fields "X"/"Y" for the global display event handlers