[tekui-devel] tekui: dded PopRadioItem; cosmetic changes in Window and PopItem...

Timm S. Mueller tmueller at neoscientists.org
Wed Mar 5 23:02:30 CET 2008


details:   http://hg.teklib.org/tekui/rev/a6625a0c1cdd
changeset: 361:a6625a0c1cdd
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Fri Feb 08 03:58:19 2008 +0100
description:
dded PopRadioItem; cosmetic changes in Window and PopItem; removed
preparePopupItem() from Spacer and PopupItem; PopItem now uses "PopupBase"
instead of "Parent" as a marker for anchoring itself to the GUI hierarchy;
CheckMark: getBgPen() overridden, some cleanup; FloatText:layout() now saves
some unnecessary recalculations; "Blank" border now falls back to a default
pen in parentless elements

diffs (truncated from 415 to 100 lines):

diff -r 473bbc0d7bb9 -r a6625a0c1cdd tek/class/ui/border/blank.lua
--- a/tek/class/ui/border/blank.lua	Thu Feb 07 02:22:27 2008 +0100
+++ b/tek/class/ui/border/blank.lua	Fri Feb 08 03:58:19 2008 +0100
@@ -9,7 +9,7 @@ local unpack = unpack
 local unpack = unpack
 
 module("tek.class.ui.border.blank", tek.class.ui.border)
-_VERSION = "BlankBorder 1.0"
+_VERSION = "BlankBorder 1.1"
 
 -------------------------------------------------------------------------------
 --	Constants & Class data:
@@ -36,7 +36,8 @@ function Blank:draw(element, border, rec
 	if element.Focus then
 		p1, p2 = d.Pens[ui.PEN_FOCUSSHINE], d.Pens[ui.PEN_FOCUSSHADOW]
 	else
-		p1 = element.Parent:getBgPen()
+		p1 = element.Parent and element.Parent:getBgPen() or
+			d.Pens[ui.PEN_AREABACK]
 		p2 = p1
 	end
 
diff -r 473bbc0d7bb9 -r a6625a0c1cdd tek/class/ui/checkmark.lua
--- a/tek/class/ui/checkmark.lua	Thu Feb 07 02:22:27 2008 +0100
+++ b/tek/class/ui/checkmark.lua	Fri Feb 08 03:58:19 2008 +0100
@@ -14,7 +14,7 @@ local max = math.max
 local max = math.max
 
 module("tek.class.ui.checkmark", tek.class.ui.button)
-_VERSION = "CheckMark 0.1"
+_VERSION = "CheckMark 0.2"
 
 -------------------------------------------------------------------------------
 --	Constants & Class data:
@@ -112,6 +112,7 @@ end
 -------------------------------------------------------------------------------
 
 function CheckMark:getHiliteByXY(x, y)
+	-- hiliting disabled
 end
 
 -------------------------------------------------------------------------------
@@ -134,6 +135,20 @@ end
 end
 
 -------------------------------------------------------------------------------
+--	getBgPen:
+-------------------------------------------------------------------------------
+
+function CheckMark:getBgPen()
+	if self.Hilite then
+		return self.Drawable.Pens[ui.PEN_BUTTONOVER]
+	elseif self.Disabled then
+		return self.Drawable.Pens[ui.PEN_BUTTONDISABLED]
+	elseif self.Parent then
+		return self.Parent:getBgPen()
+	end
+end
+
+-------------------------------------------------------------------------------
 --	draw:
 -------------------------------------------------------------------------------
 
@@ -141,7 +156,7 @@ function CheckMark:draw()
 
 	local d = self.Drawable
 
-	ui.Frame.draw(self, self.Parent:getBgPen())
+	ui.Frame.draw(self, self:getBgPen())
 
 	local ew = self.Rect[3] - self.Rect[1] - self.PaddingAndBorder[3] -
 		self.PaddingAndBorder[1] + 1
@@ -161,9 +176,11 @@ function CheckMark:draw()
 	local img = self.Selected and self.AltImage or self.Image
 	img:draw(d, { x, y, x + iw - 1, y + ih - 1 })
 
-	x = x0 + iw
-	y = y0 + floor((eh - th) / 2)
-	d:setFont(self.TextArea.Font)
-	d:drawText(x, y, self.TextArea.Label, d.Pens[ui.PEN_BUTTONTEXT])
+	if self.TextArea.Label then
+		x = x0 + iw
+		y = y0 + floor((eh - th) / 2)
+		d:setFont(self.TextArea.Font)
+		d:drawText(x, y, self.TextArea.Label, d.Pens[ui.PEN_BUTTONTEXT])
+	end
 
 end
diff -r 473bbc0d7bb9 -r a6625a0c1cdd tek/class/ui/floattext.lua
--- a/tek/class/ui/floattext.lua	Thu Feb 07 02:22:27 2008 +0100
+++ b/tek/class/ui/floattext.lua	Fri Feb 08 03:58:19 2008 +0100
@@ -22,7 +22,7 @@ local ipairs = ipairs
 local ipairs = ipairs
 
 module("tek.class.ui.floattext", tek.class.ui.scrollgroup)
-_VERSION = "FloatText 0.4"
+_VERSION = "FloatText 0.5"
 local FloatText = _M
 
 -------------------------------------------------------------------------------


More information about the tekui-devel mailing list