Panel:onHover(x, y, buttons)event
This event is fired when the user moves the mouse pointer over the Panel.
Parameters
x
The horizontal position of the mouse in the Panel's client area.
y
The vertical position of the mouse in the Panel's client area.
buttons
A table which fields indicates if mouse buttons or special keys have been pressed during the move :
"left":trueif left mouse button is pressed,falseotherwise"right":trueif right mouse button is pressed,falseotherwise"middle":trueif middle mouse button is pressed,falseotherwise"control":trueif the CONTROL key is pressed,falseotherwise"shift":trueif the SHIFT mouse button is pressed,falseotherwise
Return value
The event returns no value.Example
--! luart-extensions
import ui
-- create a fixed Window
local win = ui.Window("Panel:onHover() event sample", "fixed", 320, 200)
-- create a Panel
local panel = ui.Panel(win, 0, 0, 100, 100)
panel.bgcolor = 0xF0A000
panel.cursor = "cross"
panel:center()
function panel:onHover(x, y, buttons)
win:status("Mouse is inside Panel at "..x..", "..y, buttons.left and "LEFT button" or "", buttons.right and "RIGHT button" or "", buttons.middle and "MIDDLE button" or "")
end
win:status("")
await win:showasync()