[tekui-devel] tekui: Area, Frame, Gadget: Great deal of commentary added, clea...

Timm S. Mueller tmueller at neoscientists.org
Tue Apr 1 15:36:30 CEST 2008


details:   http://hg.teklib.org/tekui/rev/7572b1f8c60c
changeset: 401:7572b1f8c60c
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Mon Mar 31 22:43:49 2008 +0200
description:
Area, Frame, Gadget: Great deal of commentary added, cleanup, Focus, Hilite,
Selected, Disabled or now defined in Area (but still handled elsewhere)

diffs (truncated from 173 to 100 lines):

diff -r b10f76c7c79a -r 7572b1f8c60c tek/class/ui/area.lua
--- a/tek/class/ui/area.lua	Mon Mar 31 22:15:11 2008 +0200
+++ b/tek/class/ui/area.lua	Mon Mar 31 22:43:49 2008 +0200
@@ -34,7 +34,7 @@ local floor = math.floor
 local floor = math.floor
 
 module("tek.class.ui.area", tek.class.ui.element)
-_VERSION = "Area 5.7"
+_VERSION = "Area 5.8"
 local Area = _M
 
 -------------------------------------------------------------------------------
@@ -49,26 +49,49 @@ local NOTIFY_WEIGHT = { ui.NOTIFY_SELF, 
 -------------------------------------------------------------------------------
 
 function Area.init(self)
+	-- Element's background properties (color, pattern...):
 	self.Background = false
+	-- Region to collect damages to this element:
 	self.DamageRegion = false
+	-- Disabled state of the element (defined, but not handled by Area):
+	self.Disabled = self.Disabled or false
+	-- The Display this element is connected to:
 	self.Display = false
+	-- The Drawable this element is connected to:
 	self.Drawable = false
+	-- Focus state of the element (defined, but not handled by Area):
+	self.Focus = false
+	-- Horizontal alignment in group (0 = left, 1 = center, 2 = right)
 	self.HAlign = self.HAlign or 0
+	-- Hilite state of the element (defined, but not handled by Area):
+	self.Hilite = false
+	-- Margin offsets of the element:
 	self.Margin = self.Margin or false
+	-- Combined margin and border offsets of the element:
 	self.MarginAndBorder = { }
+	-- Maximum height of the element:
 	self.MaxHeight = self.MaxHeight or false
+	-- Maximum width of the element:
 	self.MaxWidth = self.MaxWidth or false
+	-- Calculated minimum/maximum sizes of the element:
 	self.MinMax = { }
-	self.Rect = false
+	-- The layouted rectangle of the element on the display:
+	self.Rect = { }
+	-- Indicates whether the element needs to be redrawn:
 	self.Redraw = false
+	-- Selected state of the element (defined, but not handled by Area):
+	self.Selected = self.Selected or false
+	-- Boolean to indicate whether intra-area damages are to be collected:
 	self.TrackDamage = self.TrackDamage or false
+	-- Vertical alignment in group (0 = top, 1 = center, 2 = right)
 	self.VAlign = self.VAlign or 0
+	-- Weight of the element, in relation to its siblings in the same group:
 	self.Weight = self.Weight or false
 	return Element.init(self)
 end
 
 function Area.new(class, self)
-	return Element.new(class, init(self or { }))
+	return Element.new(class, Area.init(self or { }))
 end
 
 -------------------------------------------------------------------------------
@@ -99,7 +122,6 @@ end
 
 function Area:setupDisplay(display, drawable)
 	self.Margin = self.Margin or display.Theme.AreaMargin or DEF_MARGIN
-	self.Rect = { }
 	self.Display = display
 	self.Drawable = drawable
 	self.DamageRegion = false
@@ -118,7 +140,6 @@ function Area:cleanupDisplay()
 	self.DamageRegion = false
 	self.Drawable = false
 	self.Display = false
-	self.Rect = false
 end
 
 -------------------------------------------------------------------------------
diff -r b10f76c7c79a -r 7572b1f8c60c tek/class/ui/frame.lua
--- a/tek/class/ui/frame.lua	Mon Mar 31 22:15:11 2008 +0200
+++ b/tek/class/ui/frame.lua	Mon Mar 31 22:43:49 2008 +0200
@@ -21,7 +21,7 @@ local max = math.max
 local max = math.max
 
 module("tek.class.ui.frame", tek.class.ui.area)
-_VERSION = "Frame 1.17"
+_VERSION = "Frame 1.18"
 
 local Frame = _M
 
@@ -38,23 +38,27 @@ local NOTIFY_FOCUS = { ui.NOTIFY_SELF, "
 -------------------------------------------------------------------------------
 
 function Frame.init(self)
+	-- Outer border offsets of the element:
 	self.Border = self.Border or false
+	-- Region describing the outer border:
 	self.BorderRegion = false


More information about the tekui-devel mailing list