[tekui-devel] tekui: Area: typo in commentary; List: added keyboard qualifiers...

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


details:   http://hg.teklib.org/tekui/rev/8d23a4c37592
changeset: 442:8d23a4c37592
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Tue Apr 22 23:13:35 2008 +0200
description:
Area: typo in commentary; List: added keyboard qualifiers for cursor movement;
Object: recursive notifications are now detected and dropped, values are now
getting reinterpreted when the next notification for the same key is due, some
cleanup; ScrollGroup: removed some redundant slider state changes; Text: it is
now possible to set a label to nil/false; TextInput: recursive notification
rectified

diffs (truncated from 479 to 100 lines):

diff -r 1e09abb3d2fa -r 8d23a4c37592 tek/app/ui/list.lua
--- a/tek/app/ui/list.lua	Tue Apr 22 16:44:37 2008 +0200
+++ b/tek/app/ui/list.lua	Tue Apr 22 23:13:35 2008 +0200
@@ -3,11 +3,45 @@ require "tek.lib.debug".level = 4
 require "tek.lib.debug".level = 4
 local ui = require "tek.lib.ui"
 
-app = ui.Application:new {
-	Children = {
-		ui.Window:new {
-			Children = {
-				ui.List:new { Text = "Hallo" }
+local list = { }
+-- for i = 1, 111 do
+-- 	list[i] = { "Line " .. i .. ": The quick brown fox jumps over the lazy dog" }
+-- end
+
+ui.Application:new
+{
+	Children =
+	{
+		ui.Window:new
+		{
+			Direction = "vertical",
+			Children =
+			{
+				ui.List:new { List = list },
+				ui.TextInput:new
+				{
+					Notifications =
+					{
+						["Label"] =
+						{
+							[ui.NOTIFY_ALWAYS] =
+							{
+								{
+									ui.NOTIFY_SELF, function(self, val)
+										self:setValue("Label", "")
+									end, ui.NOTIFY_VALUE
+								}
+							}
+						}
+					}
+				},
+				ui.Group:new
+				{
+					Children =
+					{
+						ui.Text:new { Mode = "button", Width = "auto", Label = "Okay" },
+					}
+				}
 			}
 		}
 	}
diff -r 1e09abb3d2fa -r 8d23a4c37592 tek/class/ui/area.lua
--- a/tek/class/ui/area.lua	Tue Apr 22 16:44:37 2008 +0200
+++ b/tek/class/ui/area.lua	Tue Apr 22 23:13:35 2008 +0200
@@ -37,7 +37,7 @@ local floor = math.floor
 local floor = math.floor
 
 module("tek.class.ui.area", tek.class.ui.element)
-_VERSION = "Area 6.0"
+_VERSION = "Area 6.1"
 local Area = _M
 
 -------------------------------------------------------------------------------
@@ -377,7 +377,7 @@ end
 
 -------------------------------------------------------------------------------
 --	msg = area:passMsg(msg): This function filters an input message.
---	Afer processing, it is free to return the message unmodified (thus
+--	After processing, it is free to return the message unmodified (thus
 --	passing it to the next message handler), to return a copy that has
 --	certain fields modified, or to 'swallow' the message by returning
 --	'''false'''.
diff -r 1e09abb3d2fa -r 8d23a4c37592 tek/class/ui/list.lua
--- a/tek/class/ui/list.lua	Tue Apr 22 16:44:37 2008 +0200
+++ b/tek/class/ui/list.lua	Tue Apr 22 23:13:35 2008 +0200
@@ -19,7 +19,7 @@ local remove = table.remove
 local remove = table.remove
 
 module("tek.class.ui.list", tek.class.ui.scrollgroup)
-_VERSION = "List 0.16"
+_VERSION = "List 0.17"
 local List = _M
 
 -------------------------------------------------------------------------------
@@ -97,11 +97,13 @@ function ListGadget:prepare()
 	local l = { }
 	local maxw = 0
 	self.Lines = l
-	for i, line in ipairs(self.List) do
-		w, h = ui.Display:textSize(f, line[1])
-		maxw = max(maxw, w)
-		l[i] = { p[1], y, w - 1, y + h - 1, line[1] }
-		y = y + h
+	if self.List then
+		for i, line in ipairs(self.List) do
+			w, h = ui.Display:textSize(f, line[1])
+			maxw = max(maxw, w)


More information about the tekui-devel mailing list