I'm do testing on button + hotspot, and I've got problem.
I use mouseover + cancelmouse over be the test tools.
if the mouseover function use "hotspot_id", it will apply to all hotspot, but what if I only want it apply to specific hotspot? am I able to make 2 function, 1 for "hs1" and 1 for "hs2", but seems it don't work, or make 2 different function name recall to that hotspot? I just want a simply way to write it, thanks.
----------------------------------------------------------
Case:
--Mouseover button 1, color "maroon" -> "red"
--Mouseover button 2, color "maroon" -> "blue"
--button 1
WindowRectOp (win, miniwin.rect_fill, 50, 50, 100, 100,
ColourNameToRGB("maroon")) -- filled
--button 2
WindowRectOp (win, miniwin.rect_fill, 50, 150, 100, 200,
ColourNameToRGB("maroon")) -- filled
--mouseover function
function mouseover (flags, hs1)
WindowRectOp (win, miniwin.rect_fill, 50, 50, 100, 100,
ColourNameToRGB("red")) -- filled
Redraw ()
end -- mouseover
function mouseover (flags, hs2)
WindowRectOp (win, miniwin.rect_fill, 50, 150, 100, 200,
ColourNameToRGB("blue")) -- filled
Redraw ()
end -- mouseover
--Cancelmouse function
function cancelmouseover (flags, hs1)
WindowRectOp (win, miniwin.rect_fill, 50, 50, 100, 100,
ColourNameToRGB("maroon")) -- filled
Redraw ()
end -- cancelmouseover
function cancelmouseover (flags, hs2)
WindowRectOp (win, miniwin.rect_fill, 50, 150, 100, 200,
ColourNameToRGB("maroon")) -- filled
Redraw ()
end -- cancelmouseover
--hotspot for button 1
WindowAddHotspot(win, "hs1",
50, 50, 100, 100, -- rectangle
"mouseover",
"cancelmouseover",
"mousedown",
"cancelmousedown",
"mouseup",
"Drag it!", -- tooltip text
miniwin.cursor_hand, 0) -- hand cursor
--hotspot for button 2
WindowAddHotspot(win, "hs2",
50, 150, 100, 200, -- rectangle
"mouseover",
"cancelmouseover",
"mousedown",
"cancelmousedown",
"mouseup",
"Drag it! 2", -- tooltip text
miniwin.cursor_hand, 0) -- hand cursor
-------------------------------------------------------- |