(MUSHclient v4.43)
I am writing a test case for my CharacterGrid widget type, and I'm using three of the hotspot callbacks. While two of them work great - mouseup and mouseover - the third, cancelmouseover, doesn't appear to be executing at all. However I am perfectly able to get its name from WindowHotspotInfo and execute it directly [1].
Here is the relevant snippet of code that I used:
This uses my under-development widget framework [2]. The per-cell .hotspot entry maps directly to a WindowAddHotspot() call, and I can verify that there are no typos or mistakes in the code along the way [1]. (There was a typo in my passing of cancelmousedown fields, but it was unrelated and I fixed it.)
I jumped into my copy of the MUSHclient source, and it appears to me that there are two problems surrounding cancelmouseover. Firstly, it appears to only even be considered if the mouse leaves the miniwindow, not the hotspot [3]. Further, even then it doesn't appear to move past a "did we mouseover this hotspot" check.
[1] This code works as expected, calling the nominated cancelmouseover function.
[2] http://github.com/Twisol/MUSHclient-MWidget
[3] The relevant MUSHclient source code begins at line 6393 in mushview.cpp, method CMUSHView::Mouse_Move_MiniWindow.
I am writing a test case for my CharacterGrid widget type, and I'm using three of the hotspot callbacks. While two of them work great - mouseup and mouseover - the third, cancelmouseover, doesn't appear to be executing at all. However I am perfectly able to get its name from WindowHotspotInfo and execute it directly [1].
Here is the relevant snippet of code that I used:
CellFromHotspot = function(id)
local _, _, x, y = string.find(id, "-h%((%d+),(%d+)%)")
return grid:Cell(tonumber(x), tonumber(y))
end
CellBlur = function(flags, id)
local cell = CellFromHotspot(id)
cell.backcolor = 0xFFFFFF
grid:Draw(true)
end
OnPluginInstall = function()
grid = CharacterGrid.new(3, 3)
grid:Anchor(12)
grid:Font(TICTACTOE_FONT, 15)
grid.backcolor = 0xFFFFFF
for y = 1, 3 do
for x = 1, 3 do
grid:Cell(x, y).hotspot = {
mouseup = "CellClick",
mouseover = "CellFocus",
cancelmouseover = "CellBlur",
}
end
end
end
This uses my under-development widget framework [2]. The per-cell .hotspot entry maps directly to a WindowAddHotspot() call, and I can verify that there are no typos or mistakes in the code along the way [1]. (There was a typo in my passing of cancelmousedown fields, but it was unrelated and I fixed it.)
I jumped into my copy of the MUSHclient source, and it appears to me that there are two problems surrounding cancelmouseover. Firstly, it appears to only even be considered if the mouse leaves the miniwindow, not the hotspot [3]. Further, even then it doesn't appear to move past a "did we mouseover this hotspot" check.
[1] This code works as expected, calling the nominated cancelmouseover function.
name = "03829336f30e9f2dcace86e9:w1"
hotspot = "03829336f30e9f2dcace86e9:w1-h(2,2)"
_G[WindowHotspotInfo(name, hotspot, 6)](0, hotspot)
[2] http://github.com/Twisol/MUSHclient-MWidget
[3] The relevant MUSHclient source code begins at line 6393 in mushview.cpp, method CMUSHView::Mouse_Move_MiniWindow.