[tekui-devel] tekui: Area, Canvas, FloatText, Frame, Image, List, Text, Tunnel...

Timm S. Mueller tmueller at neoscientists.org
Sat Apr 12 15:53:55 CEST 2008


details:   http://hg.teklib.org/tekui/rev/d0e93da1f09e
changeset: 425:d0e93da1f09e
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Sat Apr 12 15:53:09 2008 +0200
description:
Area, Canvas, FloatText, Frame, Image, List, Text, Tunnel: asmMinMax()
simplified; ScrollGroup: askMinMax() now invoked with initial zero
MaxWidth/Height; Spacer: Width/Height control keywords are now inserted during
askMinMax(); Text: default HAlign is now "center"; visual_api: nil is now
recognized in setattrs() for unsetting Min/MaxWidth/Height

diffs (truncated from 381 to 100 lines):

diff -r 59a8fc318a80 -r d0e93da1f09e tek/class/ui/area.lua
--- a/tek/class/ui/area.lua	Sat Apr 12 01:18:18 2008 +0200
+++ b/tek/class/ui/area.lua	Sat Apr 12 15:53:09 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 5.15"
+_VERSION = "Area 5.16"
 local Area = _M
 
 -------------------------------------------------------------------------------
@@ -202,21 +202,16 @@ end
 -------------------------------------------------------------------------------
 
 function Area:askMinMax(m1, m2, m3, m4)
-
-	m3 = m3 and max(min(self.MaxWidth, m3), m1)
-	m4 = m4 and max(min(self.MaxHeight, m4), m2)
-
+	m3 = max(min(self.MaxWidth, m3), m1)
+	m4 = max(min(self.MaxHeight, m4), m2)
 	local m = self.MarginAndBorder
-	m1 = (m1 or 0) + m[1] + m[3]
-	m2 = (m2 or 0) + m[2] + m[4]
-	m3 = m3 and m3 + m[1] + m[3]
-	m4 = m4 and m4 + m[2] + m[4]
-
-	local m = self.MinMax
-	m[1], m[2], m[3], m[4] = m1, m2, m3, m4
-
+	m1 = m1 + m[1] + m[3]
+	m2 = m2 + m[2] + m[4]
+	m3 = m3 + m[1] + m[3]
+	m4 = m4 + m[2] + m[4]
+	local mm = self.MinMax
+	mm[1], mm[2], mm[3], mm[4] = m1, m2, m3, m4
 	return m1, m2, m3, m4
-
 end
 
 -------------------------------------------------------------------------------
diff -r 59a8fc318a80 -r d0e93da1f09e tek/class/ui/canvas.lua
--- a/tek/class/ui/canvas.lua	Sat Apr 12 01:18:18 2008 +0200
+++ b/tek/class/ui/canvas.lua	Sat Apr 12 15:53:09 2008 +0200
@@ -20,7 +20,7 @@ local overlap = ui.Region.overlapCoords
 local overlap = ui.Region.overlapCoords
 
 module("tek.class.ui.canvas", tek.class.ui.frame)
-_VERSION = "Canvas 1.8"
+_VERSION = "Canvas 1.9"
 local Canvas = _M
 
 local DEF_CANVASAREA_MARGIN = { 0, 0, 0, 0 }
@@ -106,11 +106,11 @@ end
 
 function Canvas:askMinMax(m1, m2, m3, m4)
 	local o = self.Object
-	local c1, c2, c3, c4 = o:askMinMax(0, 0)
+	local c1, c2, c3, c4 = o:askMinMax(0, 0, 0, 0)
 	m1 = m1 + c1
 	m2 = m2 + c2
-	m3 = (m3 or c3) and (m3 or 0) + (c3 or 0)
-	m4 = (m4 or c4) and (m4 or 0) + (c4 or 0)
+	m3 = m3 + c3
+	m4 = m4 + c4
 	local s = self.ScrollGroup
 	local m1 = s.KeepMinWidth and m1 or 0
 	local m2 = s.KeepMinHeight and m2 or 0
diff -r 59a8fc318a80 -r d0e93da1f09e tek/class/ui/floattext.lua
--- a/tek/class/ui/floattext.lua	Sat Apr 12 01:18:18 2008 +0200
+++ b/tek/class/ui/floattext.lua	Sat Apr 12 15:53:09 2008 +0200
@@ -18,7 +18,7 @@ local max = math.max
 local max = math.max
 
 module("tek.class.ui.floattext", tek.class.ui.scrollgroup)
-_VERSION = "FloatText 1.7"
+_VERSION = "FloatText 1.8"
 local FloatText = _M
 
 -------------------------------------------------------------------------------
@@ -118,8 +118,8 @@ function TextArea:askMinMax(m1, m2, m3, 
 function TextArea:askMinMax(m1, m2, m3, m4)
 	m1 = m1 + self.MinWidth
 	m2 = m2 + self.FHeight
-	m3 = m3 and (m3 or 0) + self.MinWidth
-	m4 = m4 and (m4 or 0) + self.FHeight
+	m3 = ui.HUGE
+	m4 = ui.HUGE
 	return Area.askMinMax(self, m1, m2, m3, m4)
 end
 
diff -r 59a8fc318a80 -r d0e93da1f09e tek/class/ui/frame.lua
--- a/tek/class/ui/frame.lua	Sat Apr 12 01:18:18 2008 +0200
+++ b/tek/class/ui/frame.lua	Sat Apr 12 15:53:09 2008 +0200
@@ -23,7 +23,7 @@ local unpack = unpack
 local unpack = unpack
 
 module("tek.class.ui.frame", tek.class.ui.area)
-_VERSION = "Frame 1.24"


More information about the tekui-devel mailing list