I'm trying to find out the issue with mouse events in the listview dotnet control and pressing escape.
At the bottom, is the code.
If you block out all the
on lv <eventname>'s, then there's no error.
The only way to remove the error and keep the code is to add this:
on lv KeyUp e do (
if e.keyvalue == 27 do lv.dispose()
--print (e.keyvalue as string + " - Escape KeyUp")
)Which isn't ideal.
Here's the full code, just run it and hit escape a few times for the JIT error to appear:
try(destroyDialog lvRol)catch()
clearListener()
rollout lvRol "ItemMouseHover - Help Required" height:300 width:500
(
-- functions
local _lvInit, _lvPopulateList, _lvAddColumns, _lvIsFormReadyToFocus
dotNetControl lv "system.windows.forms.listView" height:(lvRol.height) width:(lvRol.width-1) pos:[0,0]
fn _lvInit lvArg = (
lvArg.view = (dotNetClass "system.windows.forms.view").details
lvArg.FullRowSelect = true
lvArg.MultiSelect = true
)
fn _lvPopulateList lvArg = (
rows = #()
for x in objects do (
li = dotNetObject "System.Windows.Forms.ListViewItem" x.name
li.tag = dotnetmxsvalue x
li.subitems.add ((classOf x) as string)
li.subitems.add (((x.wireColor) as point3) as string)
append rows li
)
lvArg.items.addRange rows
)
fn _lvAddColumns lvArg columnsAr = (
w = (lvArg.width/columnsAr.count)-1
for x in columnsAr do (
lvArg.columns.add x w
)
)
on lv MouseCaptureChanged do (print "MouseCaptureChanged")
on lv MouseClick do (print "MouseClick")
on lv MouseDoubleClick do (print "MouseDoubleClick")
on lv MouseDown do (print "MouseDown")
on lv MouseEnter do (print "MouseEnter")
on lv MouseHover do (print "MouseHover")
on lv MouseLeave do (print "MouseLeave")
on lv MouseMove do (print "MouseMove")
on lv MouseUp do (print "MouseUp")
on lv MouseWheel do (print "MouseWheel")
on lvRol open do (
_lvInit lv
_lvAddColumns lv #("Object", "Class", "Wire Color")
_lvPopulateList lv
)
)
createDialog lvRol
By 3dwannab · 2019-08-22