From dc20bb4220f59f32309388de0edc6ebf41ab3e35 Mon Sep 17 00:00:00 2001 From: Pixel Date: Fri, 25 Dec 2009 21:04:27 +0100 Subject: Adding struct skeleton. --- dalos-struct.lua | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 dalos-struct.lua (limited to 'dalos-struct.lua') diff --git a/dalos-struct.lua b/dalos-struct.lua new file mode 100644 index 0000000..3451319 --- /dev/null +++ b/dalos-struct.lua @@ -0,0 +1,69 @@ +dalosp.struct = { + images = { + up = iup.LoadImage "12-em-up.tga", + down = iup.LoadImage "12-em-down.tga", + cross = iup.LoadImage "12-em-cross.tga", + plus = iup.LoadImage "12-em-plus.tga", + }, + + get_settings = function (self) + end, + + configure = function (self) + self.cfg_dlg:popup() + end, + + activate = function (self) + self.actv_dlg:show() + end, + + input_change = function (self) + end, + + create = function (d, tab, settings) + tab.ninputs = 1 + tab.noutputs = 0 + tab.otype = dalos.objtype.LUA_VIEWER + tab.configure = dalosp.struct.configure + tab.activate = dalosp.struct.activate + tab.input_change = dalosp.struct.input_change + tab.get_settings = dalosp.struct.get_settings + tab.default_name = "Struct" + tab.ntype = "Struct" + + local extra = { } + if not settings then settings = {} end + + local obj = dalos.object(d, tab, extra) + + local cmx = iup.matrix {} + cmx.draw_cb = dalosp.struct.cfg_draw_cb + + obj.cfg_dlg = iup.dialog { + iup.vbox { + cmx, + iup.hbox { + iup.fill {}, + iup.button { + title = "Ok", + action = function (self) return iup.CLOSE end + }, + iup.fill {}, + }, + }, + } + + obj.cfg_dlg.mx = cmx + + local amx = iup.matrix {} + + obj.actv_dlg = iup.dialog { + amx, + } + + return obj + end, +} + +dalos.struct = dalosp.struct.create +dalos:register_obj("Struct", dalos.struct, "Programmable") -- cgit v1.2.3