iup-stack/iup/srclua5/ctrl/matrixex.lua

42 lines
1.1 KiB
Lua
Raw Permalink Normal View History

2023-02-20 16:44:45 +00:00
------------------------------------------------------------------------------
-- MatrixEx class
------------------------------------------------------------------------------
local ctrl = {
nick = "matrixex",
parent = iup.WIDGET,
creation = "",
funcname = "MatrixEx",
subdir = "ctrl",
callback = {
action_cb = "nnnns", -- must repeat this callback because of its non-exclusive name
mousemove_cb = "nn", -- must repeat this callback because of its non-exclusive name
pastesize_cb = "nn",
busy_cb = "nns",
numericgetvalue_cb = {"nn", ret = "d"},
numericsetvalue_cb = "nnd",
sortcolumncompare_cb = "nnn",
menucontext_cb = "inn",
menucontextclose_cb = "inn",
},
include = "iupcontrols.h",
}
function ctrl.createElement(class, param)
return iup.MatrixEx(param.action)
end
function ctrl.setcell(ih, l, c, val)
iup.SetAttributeId2(ih,"",l,c,val)
end
function ctrl.getcell(ih, l, c)
return iup.GetAttributeId2(ih,"",l,c)
end
-- Defined in C
ctrl.SetFormula = iup.MatrixSetFormula
ctrl.SetDynamic = iup.MatrixSetDynamic
iup.RegisterWidget(ctrl)
iup.SetClass(ctrl, "iupWidget")