[tekui-devel] tekui: Group: removed unused locals; Object: lowered verbosity; ...

Timm S. Mueller tmueller at neoscientists.org
Fri Apr 25 00:10:45 CEST 2008


details:   http://hg.teklib.org/tekui/rev/9421a5a2f82e
changeset: 450:9421a5a2f82e
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Fri Apr 25 00:10:03 2008 +0200
description:
Group: removed unused locals; Object: lowered verbosity; PopupWindow: added

diffs (truncated from 137 to 100 lines):

diff -r b8850a6b669f -r 9421a5a2f82e tek/class/ui/group.lua
--- a/tek/class/ui/group.lua	Thu Apr 24 23:15:58 2008 +0200
+++ b/tek/class/ui/group.lua	Fri Apr 25 00:10:03 2008 +0200
@@ -13,15 +13,11 @@ local assert = assert
 local assert = assert
 local floor = math.floor
 local ipairs = ipairs
-local min = math.min
-local max = math.max
-local setmetatable = setmetatable
 local tostring = tostring
 local type = type
-local unpack = unpack
 
 module("tek.class.ui.group", tek.class.ui.gadget)
-_VERSION = "Group 6.3"
+_VERSION = "Group 6.4"
 local Group = _M
 
 -------------------------------------------------------------------------------
diff -r b8850a6b669f -r 9421a5a2f82e tek/class/ui/object.lua
--- a/tek/class/ui/object.lua	Thu Apr 24 23:15:58 2008 +0200
+++ b/tek/class/ui/object.lua	Fri Apr 25 00:10:03 2008 +0200
@@ -32,7 +32,7 @@ local unpack = unpack
 local unpack = unpack
 
 module("tek.class.ui.object", tek.class)
-_VERSION = "Object 5.2"
+_VERSION = "Object 5.3"
 local Object = _M
 
 -------------------------------------------------------------------------------
@@ -102,7 +102,7 @@ function Object:doNotify(n, key)
 
 				n[0] = n[0] or { }
 				if n[0][dest] then
-					db.warn("dropping cyclic notification %s:%s(%s)",
+					db.info("dropping cyclic notification %s:%s(%s)",
 						dest:getClassName(), n[2], a[3])
 				else
 					n[0][dest] = true
diff -r b8850a6b669f -r 9421a5a2f82e tek/class/ui/popupwindow.lua
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tek/class/ui/popupwindow.lua	Fri Apr 25 00:10:03 2008 +0200
@@ -0,0 +1,92 @@
+
+--
+--	tek.class.ui.popupwindow
+--	Written by Timm S. Mueller <tmueller at schulze-mueller.de>
+--	See copyright notice in COPYRIGHT
+--
+
+local ui = require "tek.lib.ui"
+local db = require "tek.lib.debug"
+local Window = ui.Window
+local ipairs = ipairs
+local max = math.max
+
+module("tek.class.ui.popupwindow", tek.class.ui.window)
+_VERSION = "PopupWindow 1.0"
+
+local PopupWindow = _M
+
+-------------------------------------------------------------------------------
+--	Constants and class data:
+-------------------------------------------------------------------------------
+
+local DEF_POPUPMARGIN = { 0, 0, 0, 0 }
+local DEF_SHORTCUT_XOFFS = 20
+local MSG_MOUSEOVER = ui.MSG_MOUSEOVER
+local MSG_INTERVAL = ui.MSG_INTERVAL
+
+-------------------------------------------------------------------------------
+--	PopupWindow class:
+-------------------------------------------------------------------------------
+
+function PopupWindow.init(self)
+	self.BackPen = self.BackPen or ui.PEN_MENUBACK
+	self.BeginPopupTicks = 0
+	self.Border = self.Border or false
+	self.BorderStyle = self.BorderStyle or "socket"
+	self.DelayedBeginPopup = false
+	self.DelayedEndPopup = false
+	self.Margin = self.Margin or DEF_POPUPMARGIN
+	self.MaxWidth = self.MaxWidth or 0
+	self.MaxHeight = self.MaxHeight or 0
+	self.Padding = self.Padding or false
+	return Window.init(self)
+end
+
+function PopupWindow:setupDisplay(display)
+	if Window.setupDisplay(self, display) then
+		-- determine width of menuitems in group:
+		local maxw = 0
+		for _, e in ipairs(self.Children) do
+			if e:checkDescend(ui.MenuItem) then
+				maxw = max(maxw, e:getTextSize())
+			end
+		end
+		for _, e in ipairs(self.Children) do


More information about the tekui-devel mailing list