summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2009-12-25 21:04:27 +0100
committerPixel <pixel@nobis-crew.org>2009-12-25 21:15:32 +0100
commitdc20bb4220f59f32309388de0edc6ebf41ab3e35 (patch)
tree26b1f9d28005fb511750bb15ad166ae11eab4e9f
parentc267d9769c2bf5fd56684b51b7e90f1d7093614c (diff)
Adding struct skeleton.
-rw-r--r--dalos-struct.lua69
-rw-r--r--dalos.lua1
2 files changed, 70 insertions, 0 deletions
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")
diff --git a/dalos.lua b/dalos.lua
index bd0e2a7..9846f72 100644
--- a/dalos.lua
+++ b/dalos.lua
@@ -1028,6 +1028,7 @@ load "dalos-input.lua"
load "dalos-tee.lua"
load "dalos-buffer.lua"
load "dalos-luafilter.lua"
+load "dalos-struct.lua"
----------------