[tekui-devel] tekui: Canvas: minor cleanup; Frame: added onFocus(), cleanupDis...

Timm S. Mueller tmueller at neoscientists.org
Mon Apr 28 21:33:56 CEST 2008


details:   http://hg.teklib.org/tekui/rev/5d01f2b7fae2
changeset: 451:5d01f2b7fae2
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Fri Apr 25 18:41:14 2008 +0200
description:
Canvas: minor cleanup; Frame: added onFocus(), cleanupDisplay() wasn't calling
superclass - fixed; Gadget: setHover, setActive, setDisabled renamed to
onHover, onActivate, onDisable respectively, added onHilite and onSelect
methods and a lot of documentation; List: removed Focus notification (now
merely overrides onFocus() and calls super class), added CursorLine
notification and onSetCursor(), some cleanup; Object: cyclic notification
warning is now commented out by default; PopRadioItem: removed redundant
notifications, massive cleanup, overrides onSelect(); RadioButton: removed
redundant notifications; switch() renamed to onSelect(); TextInput: removed
many notifications, implemens onFocus() and onSelect(), newly entered values
are now notified via the "Enter" attribute

diffs (truncated from 758 to 100 lines):

diff -r 9421a5a2f82e -r 5d01f2b7fae2 tek/app/ui/list.lua
--- a/tek/app/ui/list.lua	Fri Apr 25 00:10:03 2008 +0200
+++ b/tek/app/ui/list.lua	Fri Apr 25 18:41:14 2008 +0200
@@ -64,19 +64,34 @@ ui.Application:new
 					Object = ui.List:new
 					{
 						Id = "the-list",
-						List = list
+						List = list,
+						Notifications =
+						{
+							["CursorLine"] =
+							{
+								[ui.NOTIFY_ALWAYS] =
+								{
+									{
+										ui.NOTIFY_SELF, function(self, lnr)
+											self.Application:getElementById("the-input"):setValue("Label", self.List[lnr][1])
+										end, ui.NOTIFY_VALUE
+									}
+								}
+							}
+						}
 					}
 				},
 				ui.TextInput:new
 				{
+					Id = "the-input",
 					Notifications =
 					{
-						["Label"] =
+						["Enter"] =
 						{
 							[ui.NOTIFY_ALWAYS] =
 							{
 								{ "the-list", "addItem", ui.NOTIFY_VALUE },
-								{ ui.NOTIFY_SELF, "setValue", "Label", "", false }, -- do not trigger
+								{ ui.NOTIFY_SELF, "setValue", "Label", "" }, -- do not trigger
 								{ ui.NOTIFY_SELF, "setValue", "Focus", true },
 
 -- 									ui.NOTIFY_SELF, function(self, val)
diff -r 9421a5a2f82e -r 5d01f2b7fae2 tek/class/ui/canvas.lua
--- a/tek/class/ui/canvas.lua	Fri Apr 25 00:10:03 2008 +0200
+++ b/tek/class/ui/canvas.lua	Fri Apr 25 18:41:14 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.13"
+_VERSION = "Canvas 1.14"
 local Canvas = _M
 
 local DEF_CANVASAREA_MARGIN = { 0, 0, 0, 0 }
@@ -139,9 +139,7 @@ function Canvas:layout(r1, r2, r3, r4, m
 		w = max(w, mm[1])
 		w = mm[3] and min(w, mm[3]) or w
 		if w ~= self.Width then
-			-- self.ScrollGroup:setTop(0)
-			-- self.ScrollGroup:setLeft(0)
-			self.ScrollGroup:setWidth(w)
+			self.ScrollGroup:setValue("Width", w)
 			sizechanged = true
 		end
 	end
@@ -151,9 +149,7 @@ function Canvas:layout(r1, r2, r3, r4, m
 		h = max(h, mm[2])
 		h = mm[4] and min(h, mm[4]) or h
 		if h ~= self.Height then
-			-- self.ScrollGroup:setTop(0)
-			-- self.ScrollGroup:setLeft(0)
-			self.ScrollGroup:setHeight(h)
+			self.ScrollGroup:setValue("Height", h)
 			sizechanged = true
 		end
 	end
diff -r 9421a5a2f82e -r 5d01f2b7fae2 tek/class/ui/frame.lua
--- a/tek/class/ui/frame.lua	Fri Apr 25 00:10:03 2008 +0200
+++ b/tek/class/ui/frame.lua	Fri Apr 25 18:41:14 2008 +0200
@@ -23,7 +23,7 @@ local unpack = unpack
 local unpack = unpack
 
 module("tek.class.ui.frame", tek.class.ui.area)
-_VERSION = "Frame 1.25"
+_VERSION = "Frame 2.0"
 
 local Frame = _M
 
@@ -32,7 +32,7 @@ local Frame = _M
 -------------------------------------------------------------------------------
 
 local DEF_PADDING = { 1, 1, 1, 1 }
-local NOTIFY_FOCUS = { ui.NOTIFY_SELF, "setValue", "RedrawBorder", true }
+local NOTIFY_FOCUS = { ui.NOTIFY_SELF, "onFocus", ui.NOTIFY_VALUE }
 
 -------------------------------------------------------------------------------
 --	Class implementation:
@@ -110,6 +110,7 @@ end
 end
 
 function Frame:cleanupDisplay()


More information about the tekui-devel mailing list