From dd4d0d5131f3cd079ec052a058c7f2ad19130348 Mon Sep 17 00:00:00 2001 From: Pixel Date: Mon, 28 Dec 2009 14:05:16 +0100 Subject: Adding textviewer, and doing a few minor tweaks. --- dalos.lua | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'dalos.lua') diff --git a/dalos.lua b/dalos.lua index a6517d3..e7c02bd 100644 --- a/dalos.lua +++ b/dalos.lua @@ -724,11 +724,11 @@ dalosp.menu = { create = function (canvas, tab) local item_new = iup.item { title = "New" } item_new.action = dalosp.menu.action_new - local item_load = iup.item { title = "Load" } + local item_load = iup.item { title = "Load workspace" } item_load.action = dalosp.menu.action_load - local item_save = iup.item { title = "Save" } + local item_save = iup.item { title = "Save workspace" } item_save.action = dalosp.menu.action_save - local item_import = iup.item { title = "Import" } + local item_import = iup.item { title = "Import Lua file" } item_import.action = dalosp.menu.action_import local item_reload = iup.item { title = "Reload all" } item_reload.action = dalosp.menu.action_reload @@ -818,8 +818,7 @@ dalosp.menu = { } dalosp.object = { - use_template = function (self) - local templates = dalosp.luafilter.templates + use_template = function (self, templates) local ttpllst = {} for n, v in pairs(templates) do table.insert(ttpllst, n) @@ -840,7 +839,15 @@ dalosp.object = { end local s, tind = iup.GetParam("Use Template", nil, "Template: %i" .. tpllst .. "\n", 0) if not s then return iup.DEFAULT end - self:apply_template(dalosp.luafilter.templates[ttpllst[tind]]) + self:apply_template(templates[ttpllst[tind]]) + end, + + auto_template = function (self, templates, name) + for n, v in pairs(templates) do + if n == name then + self:apply_template(v) + end + end end, load_template = function (self) @@ -1004,6 +1011,7 @@ dalosp.object = { save_template = dalosp.object.save_template, load_template = dalosp.object.load_template, use_template = dalosp.object.use_template, + auto_template = dalosp.object.auto_template, dcanvas = dcanvas, } @@ -1078,6 +1086,7 @@ load "dalos-tee.lua" load "dalos-buffer.lua" load "dalos-luafilter.lua" load "dalos-struct.lua" +load "dalos-textview.lua" ---------------- -- cgit v1.2.3