[tekui-devel] tekui: canFocus() renamed to checkFocus(); Active and RelVerify ...

Timm S. Mueller tmueller at neoscientists.org
Wed Mar 19 18:40:56 CET 2008


details:   http://hg.teklib.org/tekui/rev/bc7358845305
changeset: 367:bc7358845305
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Sun Mar 16 20:48:23 2008 +0100
description:
canFocus() renamed to checkFocus(); Active and RelVerify attributes and
notifications removed; Toggle attribute is now implemented in Gadget instead
of Button; Slider, TextInput: onPress, onHold notifications are now
initialized statically; TextInput: interval notification was broken, fixed;
PopItem: cosmetic changes; Window: removed setHilite-, setActive-,
setFocusElement notifications, added tracking of pressed keys

diffs (truncated from 644 to 100 lines):

diff -r 24e3b312e68c -r bc7358845305 tek/class/ui/area.lua
--- a/tek/class/ui/area.lua	Sun Mar 16 14:04:13 2008 +0100
+++ b/tek/class/ui/area.lua	Sun Mar 16 20:48:23 2008 +0100
@@ -356,8 +356,8 @@ end
 end
 
 -------------------------------------------------------------------------------
---	canFocus(): Returns true if the element can receive the focus.
--------------------------------------------------------------------------------
-
-function Area:canFocus()
-end
+--	checkFocus(): Returns true if the element can receive the focus.
+-------------------------------------------------------------------------------
+
+function Area:checkFocus()
+end
diff -r 24e3b312e68c -r bc7358845305 tek/class/ui/border/button.lua
--- a/tek/class/ui/border/button.lua	Sun Mar 16 14:04:13 2008 +0100
+++ b/tek/class/ui/border/button.lua	Sun Mar 16 20:48:23 2008 +0100
@@ -32,7 +32,7 @@ function Button:draw(element, border, re
 	local r1, r2, r3, r4 = unpack(rect or element.Rect)
 	local d = element.Drawable
 	local p1, p2
-	if element.Active or element.Selected then
+	if element.Selected then
 		p1, p2 = d.Pens[ui.PEN_HALFSHADOW], d.Pens[ui.PEN_HALFSHINE]
 	else
 		p1, p2 = d.Pens[ui.PEN_HALFSHINE], d.Pens[ui.PEN_HALFSHADOW]
diff -r 24e3b312e68c -r bc7358845305 tek/class/ui/border/hilite.lua
--- a/tek/class/ui/border/hilite.lua	Sun Mar 16 14:04:13 2008 +0100
+++ b/tek/class/ui/border/hilite.lua	Sun Mar 16 20:48:23 2008 +0100
@@ -32,7 +32,7 @@ function Hilite:draw(element, border, re
 	local r1, r2, r3, r4 = unpack(rect or element.Rect)
 	local d = element.Drawable
 	local p1, p2
-	if element.Hilite or element.Active or element.Selected then
+	if element.Hilite or element.Selected then
 		p1, p2 = d.Pens[ui.PEN_HALFSHADOW], d.Pens[ui.PEN_HALFSHADOW]
 	else
 		p1, p2 = d.Pens[ui.PEN_WINDOWBACK], d.Pens[ui.PEN_WINDOWBACK]
diff -r 24e3b312e68c -r bc7358845305 tek/class/ui/button.lua
--- a/tek/class/ui/button.lua	Sun Mar 16 14:04:13 2008 +0100
+++ b/tek/class/ui/button.lua	Sun Mar 16 20:48:23 2008 +0100
@@ -4,7 +4,7 @@
 --	Written by Timm S. Mueller <tmueller at schulze-mueller.de>
 --	See copyright notice in COPYRIGHT
 --
---	implements text label and toggle mode
+--	implements label/image
 --
 
 local ui = require "tek.lib.ui"
@@ -13,7 +13,7 @@ local TextArea = ui.TextArea
 local TextArea = ui.TextArea
 
 module("tek.class.ui.button", tek.class.ui.gadget)
-_VERSION = "Button 2.0"
+_VERSION = "Button 3.0"
 
 -------------------------------------------------------------------------------
 --	Constants & Class data:
@@ -22,7 +22,6 @@ _VERSION = "Button 2.0"
 -- local DEF_FONTSPEC = nil -- use textarea default font
 
 local NOTIFY_REDRAW = { ui.NOTIFY_SELF, "setValue", "Redraw", true }
-local NOTIFY_TOGGLESELECT = { ui.NOTIFY_SELF, "setSelected" }
 local NOTIFY_SETLABEL = { ui.NOTIFY_SELF, "setLabel", ui.NOTIFY_VALUE }
 
 -------------------------------------------------------------------------------
@@ -48,10 +47,6 @@ function Button:connectGlobal(app, windo
 	Gadget.connectGlobal(self, app, window)
 	self.TextArea:connectGlobal(app, window)
 	self:addNotify("Label", ui.NOTIFY_ALWAYS, NOTIFY_SETLABEL)
-	if self.Toggle then
-		self:addNotify("Pressed", true, NOTIFY_TOGGLESELECT)
-		self:addNotify("Selected", ui.NOTIFY_ALWAYS, NOTIFY_REDRAW)
-	end
 end
 
 -------------------------------------------------------------------------------
@@ -59,10 +54,6 @@ end
 -------------------------------------------------------------------------------
 
 function Button:disconnectGlobal()
-	if self.Toggle then
-		self:remNotify("Selected", ui.NOTIFY_ALWAYS, NOTIFY_REDRAW)
-		self:remNotify("Pressed", true, NOTIFY_TOGGLESELECT)
-	end
 	self:remNotify("Label", ui.NOTIFY_ALWAYS, NOTIFY_SETLABEL)
 	self.TextArea:disconnectGlobal()
 	Gadget.disconnectGlobal(self)
@@ -73,8 +64,7 @@ end
 -------------------------------------------------------------------------------
 
 function Button:setupDisplay(display, drawable)
-	self.FontSpec = self.FontSpec or display.Theme.ButtonFontSpec or
-		DEF_FONTSPEC
+	self.FontSpec = self.FontSpec or display.Theme.ButtonFontSpec or DEF_FONTSPEC
 	-- this will take care of opening our font:


More information about the tekui-devel mailing list