[tekui-devel] tekui: rethinkLayout()'s parameter now indicates whether to caus...

Timm S. Mueller tmueller at neoscientists.org
Thu Feb 7 02:23:41 CET 2008


details:   http://hg.teklib.org/tekui/rev/affe522f62cb
changeset: 359:affe522f62cb
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Thu Feb 07 01:14:05 2008 +0100
description:
rethinkLayout()'s parameter now indicates whether to cause damage, not to
refrain from causing damage; improved refreshing of tabs

diffs (truncated from 180 to 100 lines):

diff -r 7539e6af4947 -r affe522f62cb tek/app/ui/dynamic.lua
--- a/tek/app/ui/dynamic.lua	Wed Feb 06 01:43:02 2008 +0100
+++ b/tek/app/ui/dynamic.lua	Thu Feb 07 01:14:05 2008 +0100
@@ -129,9 +129,9 @@ ui.application:new
 						val = math.floor(val / 3000)
 						local e = self.Application:getElementById("hallo")
 						e.Border = { val, val, val, val }
-						e:rethinkLayout()
+						e:rethinkLayout(true)
 						self.Border = { val, val, val, val }
-						self:rethinkLayout()
+						self:rethinkLayout(true)
 					end,
 				},
 			},
diff -r 7539e6af4947 -r affe522f62cb tek/app/ui/tekui.lua
--- a/tek/app/ui/tekui.lua	Wed Feb 06 01:43:02 2008 +0100
+++ b/tek/app/ui/tekui.lua	Thu Feb 07 01:14:05 2008 +0100
@@ -257,7 +257,7 @@ ui.application:new
 														ui.Slider:new {
 															StepX = 0x10000 / 32,
 															HFreedom = true,
-															Position = { 0x10000 * 8 / 32, 0, 0x10000 * 9 / 32, 0 },
+															Position = { 0x10000 * 8 / 16, 0, 0x10000 * 9 / 16, 0 },
 															Notifications = {
 																["XPosition"] = {
 																	[ui.NOTIFY_ALWAYS] = {
diff -r 7539e6af4947 -r affe522f62cb tek/class/ui/area.lua
--- a/tek/class/ui/area.lua	Wed Feb 06 01:43:02 2008 +0100
+++ b/tek/class/ui/area.lua	Thu Feb 07 01:14:05 2008 +0100
@@ -30,7 +30,7 @@ local floor = math.floor
 local floor = math.floor
 
 module("tek.class.ui.area", tek.class.ui.element)
-_VERSION = "Area 4.2"
+_VERSION = "Area 4.3"
 local Area = _M
 
 -------------------------------------------------------------------------------
@@ -104,19 +104,19 @@ end
 end
 
 -------------------------------------------------------------------------------
---	area:rethinkLayout([nodamage]): This method causes a relayout of the
+--	area:rethinkLayout(damage): This method causes a relayout of the
 --	element and the group in which the element resides. While the request
---	bubbles up to the topmost element (the Window), the optional argument
---	{{nodamage}} (a boolean) is used to avoid unconditionally marking
---	parent groups as damaged, thus allowing them to be repainted only if
---	their layout actually changes due to modifications in their children.
--------------------------------------------------------------------------------
-
-function Area:rethinkLayout(nodamage)
+--	bubbles up to the topmost element (the Window), the argument {{damage}}
+--	(a boolean) is used to avoid unconditionally marking parent groups as
+--	damaged, thus allowing them to be repainted only if their layout
+--	actually changed due to modifications in their children.
+-------------------------------------------------------------------------------
+
+function Area:rethinkLayout(damage)
 	self:calcOffsets()
-	self.Window:addLayoutGroup(self.Parent, not nodamage)
+	self.Window:addLayoutGroup(self.Parent, damage)
 	-- this causes the rethink to bubble up until it reaches the window:
-	self.Parent:rethinkLayout(true) -- cause no more damage
+	self.Parent:rethinkLayout(false) -- cause no more damage
 end
 
 -------------------------------------------------------------------------------
@@ -127,7 +127,7 @@ function Area:setWeight(w)
 function Area:setWeight(w)
 	self.Weight = tonumber(w)
 	self.Parent:calcWeights()
-	self:rethinkLayout()
+	self:rethinkLayout(true)
 end
 
 -------------------------------------------------------------------------------
diff -r 7539e6af4947 -r affe522f62cb tek/class/ui/group.lua
--- a/tek/class/ui/group.lua	Wed Feb 06 01:43:02 2008 +0100
+++ b/tek/class/ui/group.lua	Thu Feb 07 01:14:05 2008 +0100
@@ -20,7 +20,7 @@ local unpack = unpack
 local unpack = unpack
 
 module("tek.class.ui.group", tek.class.ui.frame)
-_VERSION = "Group 1.11"
+_VERSION = "Group 1.12"
 local Group = _M
 
 -------------------------------------------------------------------------------
@@ -106,7 +106,7 @@ function Group.newTabGroup(class, self)
 				self.TabNumber = i
 				self.TabElement = self.Children[i]
 				self.TabElement.Rect = { unpack(self.Rect) }
-				self.TabElement:rethinkLayout()
+				self.TabElement.Parent:rethinkLayout(2)
 			end,
 		}
 	end
@@ -286,7 +286,7 @@ function Group:addMember(child, pos)


More information about the tekui-devel mailing list