[tekui-devel] tekui: The main job of Group:askMinMax() is now implemented in L...
hg-notify at neoscientists.org
hg-notify at neoscientists.org
Tue Feb 5 02:46:00 CET 2008
details: http://hg.teklib.org/tekui/rev/c31245d1e798
changeset: 344:c31245d1e798
user: Timm S. Mueller <tmueller at neoscientists.org>
date: Sun Jan 27 15:03:04 2008 +0100
description:
The main job of Group:askMinMax() is now implemented in Layout:askMinMax();
Layouter optimized using numeric indexes; improved documentation, minor
bugfixes and cleanup
diffs (truncated from 457 to 100 lines):
diff -r 4eec5851a14a -r c31245d1e798 tek/app/ui/imagetest.lua
--- a/tek/app/ui/imagetest.lua Sun Jan 27 13:07:47 2008 +0100
+++ b/tek/app/ui/imagetest.lua Sun Jan 27 15:03:04 2008 +0100
@@ -101,7 +101,7 @@ function imgbutton:draw()
local x1 = self.Rect[3] - self.PaddingAndBorder[3]
local y1 = self.Rect[4] - self.PaddingAndBorder[4]
- self.img:layout { x0, y0, x1, y1 }
+ self.img:layout(x0, y0, x1, y1)
self.img:draw(bgpen)
local b = self:getIBorder()
diff -r 4eec5851a14a -r c31245d1e798 tek/class/ui/area.lua
--- a/tek/class/ui/area.lua Sun Jan 27 13:07:47 2008 +0100
+++ b/tek/class/ui/area.lua Sun Jan 27 15:03:04 2008 +0100
@@ -141,8 +141,8 @@ end
-------------------------------------------------------------------------------
-- changed = area:layout(rect[, markdamage]): Layouts the element into the
-- specified rectangle. If the element's (or any of its childrens')
--- coordinates change, returns '''true''' and marks the element as
--- dirty, unless the optional boolean {{markdamage}} is set to '''false'''.
+-- coordinates change, returns '''true''' and marks the element as damaged,
+-- unless the optional boolean {{markdamage}} is set to '''false'''.
-------------------------------------------------------------------------------
function Area:layout(x0, y0, x1, y1, markdamage)
@@ -195,9 +195,8 @@ end
-------------------------------------------------------------------------------
-- area:markDamage(r1, r2, r3, r4): If the element overlaps with the
--- specified rectangle, marks it as dirty. Note: If rendering the element
--- is very expensive, this method can be overridden to track intra-area
--- damages.
+-- rectangle, marks it as damaged. Note: If rendering the element is very
+-- expensive, this method can be overridden to track intra-area damages.
-------------------------------------------------------------------------------
function Area:markDamage(r1, r2, r3, r4)
@@ -240,7 +239,7 @@ end
-------------------------------------------------------------------------------
-- area:refresh(): Redraws the element (and all possible children) if they
--- are marked as dirty.
+-- are marked as damaged.
-------------------------------------------------------------------------------
function Area:refresh()
diff -r 4eec5851a14a -r c31245d1e798 tek/class/ui/frame.lua
--- a/tek/class/ui/frame.lua Sun Jan 27 13:07:47 2008 +0100
+++ b/tek/class/ui/frame.lua Sun Jan 27 15:03:04 2008 +0100
@@ -221,7 +221,7 @@ end
end
-------------------------------------------------------------------------------
--- refresh(): Redraws the element if dirty, including borders.
+-- refresh(): Redraws the element if damaged, including borders.
-------------------------------------------------------------------------------
function Frame:refresh()
@@ -239,7 +239,7 @@ function Frame:getElementByXY(x, y)
function Frame:getElementByXY(x, y)
local b = self:getBorder()
local r = self.Rect
- return b and
+ return b and r[1] and
x >= r[1] - b[1] and x <= r[3] + b[3] and
y >= r[2] - b[2] and y <= r[4] + b[4] and self
end
diff -r 4eec5851a14a -r c31245d1e798 tek/class/ui/group.lua
--- a/tek/class/ui/group.lua Sun Jan 27 13:07:47 2008 +0100
+++ b/tek/class/ui/group.lua Sun Jan 27 15:03:04 2008 +0100
@@ -65,7 +65,7 @@ end
function Group.newRegularGroup(class, self)
self = Frame.new(class, self)
- self.Layouter = self.Layouter or ui.loadClass("layout", "default"):new()
+ self.Layout = self.Layout or ui.loadClass("layout", "default"):new()
self.Weights = { }
self:calcWeights()
return self
@@ -336,7 +336,7 @@ end
end
-------------------------------------------------------------------------------
--- refresh: traverse tree, redraw if dirty
+-- refresh: traverse tree, redraw if damaged
-------------------------------------------------------------------------------
function Group:refresh()
@@ -434,7 +434,7 @@ end
end
-------------------------------------------------------------------------------
--- askMinMax: returns minx, miny, maxx, maxy
+-- askMinMax: returns minx, miny[, maxx[, maxy]]
-------------------------------------------------------------------------------
function Group:askMinMax()
@@ -443,76 +443,21 @@ function Group:askMinMax()
return getMinMax(self.TabElement)
More information about the tekui-devel
mailing list