diff options
author | Pixel <pixel@nobis-crew.org> | 2009-12-30 01:43:22 +0100 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2009-12-30 01:55:36 +0100 |
commit | 162ddadae30f2a8fade8e99bcd8e55a00407edf8 (patch) | |
tree | 76badfca38f6f398d86df7e483cbdce30236e897 | |
parent | 57a3540010861f78bb86d493f084a2f4dd52169c (diff) |
Moving apply_template and gen_template to a more common place.
-rw-r--r-- | dalos-luafilter.lua | 4 | ||||
-rw-r--r-- | dalos-struct.lua | 4 | ||||
-rw-r--r-- | dalos.lua | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/dalos-luafilter.lua b/dalos-luafilter.lua index 297441e..312aff7 100644 --- a/dalos-luafilter.lua +++ b/dalos-luafilter.lua @@ -146,6 +146,8 @@ end tab.default_name = "Lua Filter" tab.get_settings = dalosp.luafilter.get_settings tab.ntype = "Lua Filter" + tab.gen_template = dalosp.luafilter.gen_template + tab.apply_template = dalosp.luafilter.apply_template local extra = { localenv = {} } extra.code = settings and settings.code if not extra.code or extra.code == "" then extra.code = dalosp.luafilter.default_code end @@ -158,8 +160,6 @@ end obj.load_code = dalosp.luafilter.load_code obj.run_in_localenv = dalosp.luafilter.run_in_localenv - obj.gen_template = dalosp.luafilter.gen_template - obj.apply_template = dalosp.luafilter.apply_template obj:load_code(extra.code) return obj diff --git a/dalos-struct.lua b/dalos-struct.lua index d66e02a..5f157ef 100644 --- a/dalos-struct.lua +++ b/dalos-struct.lua @@ -462,6 +462,8 @@ dalosp.struct = { tab.activate = dalosp.struct.activate tab.input_change = dalosp.struct.input_change tab.get_settings = dalosp.struct.get_settings + tab.gen_template = dalosp.struct.gen_template + tab.apply_template = dalosp.struct.apply_template tab.draw = function (self, cv, x, y, w, h) dalosp.object.default_draw(self, cv, x, y, w, h) end @@ -483,8 +485,6 @@ dalosp.struct = { obj.cacheoffset = dalosp.struct.cacheoffset obj.isunique = dalosp.struct.isunique obj.getunique = dalosp.struct.getunique - obj.gen_template = dalosp.struct.gen_template - obj.apply_template = dalosp.struct.apply_template obj.get_field_value = dalosp.struct.get_field_value obj.update_values = dalosp.struct.update_values obj.read_value = dalosp.struct.read_value @@ -953,6 +953,7 @@ dalosp.object = { end, save_template = function (self, template) + if not template then template = self:gen_template() end local dlg = iup.filedlg { dialogtype = "Save", filter = "*.dtpl", @@ -1013,6 +1014,8 @@ dalosp.object = { load_template = dalosp.object.load_template, use_template = dalosp.object.use_template, auto_template = dalosp.object.auto_template, + apply_template = tab.apply_template, + gen_template = tab.gen_template, dcanvas = dcanvas, } |