[tekui-devel] tekui: List: now based on Gadget instead of Area, added cursor p...

Timm S. Mueller tmueller at neoscientists.org
Fri Apr 18 02:51:53 CEST 2008


details:   http://hg.teklib.org/tekui/rev/12ce6c00340c
changeset: 432:12ce6c00340c
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Wed Apr 16 16:00:37 2008 +0200
description:
List: now based on Gadget instead of Area, added cursor positioning by mouse;
Window:getFilteredMessage() added, removed individual last messages, added
LastMessages list; PopItem, Slider: now using Window:getFilteredMessage(); UI:
renamed MSGTYPE_ name prefix to MSG_

diffs (truncated from 572 to 100 lines):

diff -r 1ff1022feb56 -r 12ce6c00340c tek/class/ui/area.lua
--- a/tek/class/ui/area.lua	Wed Apr 16 09:58:25 2008 +0200
+++ b/tek/class/ui/area.lua	Wed Apr 16 16:00:37 2008 +0200
@@ -37,7 +37,7 @@ local floor = math.floor
 local floor = math.floor
 
 module("tek.class.ui.area", tek.class.ui.element)
-_VERSION = "Area 5.16"
+_VERSION = "Area 5.17"
 local Area = _M
 
 -------------------------------------------------------------------------------
@@ -359,7 +359,8 @@ end
 -------------------------------------------------------------------------------
 
 function Area:refresh()
-	if self.Redraw and self.Rect[1] then -- TODO
+-- 	if self.Redraw and self.Rect[1] then -- TODO
+	if self.Redraw then
 		self:draw()
 		self.Redraw = false
 	end
diff -r 1ff1022feb56 -r 12ce6c00340c tek/class/ui/list.lua
--- a/tek/class/ui/list.lua	Wed Apr 16 09:58:25 2008 +0200
+++ b/tek/class/ui/list.lua	Wed Apr 16 16:00:37 2008 +0200
@@ -7,7 +7,7 @@
 
 local db = require "tek.lib.debug"
 local ui = require "tek.lib.ui"
-local Area = ui.Area
+local Gadget = ui.Gadget
 local ScrollGroup = ui.ScrollGroup
 
 local assert = assert
@@ -20,33 +20,44 @@ local max = math.max
 local max = math.max
 
 module("tek.class.ui.list", tek.class.ui.scrollgroup)
-_VERSION = "List 0.11"
+_VERSION = "List 0.12"
 local List = _M
 
 -------------------------------------------------------------------------------
---	ListArea:
--------------------------------------------------------------------------------
-
-local DEF_ListArea_MARGIN = { 0, 0, 0, 0 }
-
-local ListArea = Area:newClass { _NAME = "_listarea" }
-
-function ListArea.init(self)
+--	ListGadget:
+-------------------------------------------------------------------------------
+
+local DEF_NULL = { 0, 0, 0, 0 }
+
+local ListGadget = Gadget:newClass { _NAME = "_listgadget" }
+
+function ListGadget.init(self)
 	self.TrackDamage = self.TrackDamage or true
-	self.Margin = DEF_ListArea_MARGIN
+
+	self.Margin = DEF_NULL
+	self.Border = DEF_NULL
+	self.IBorder = DEF_NULL
+	self.Padding = DEF_NULL
+	self.BorderStyle = false
+	self.IBorderStyle = false
+
+	self.Mode = "button"
+
 	self.Lines = false
 	self.Height = false
+
+	self.CursorLine = self.CursorLine or 0
 
 	self.FontSpec = false
 	self.Font = false
 	self.FWidth = false
 	self.FHeight = false
 
-	return Area.init(self)
-end
-
-function ListArea:setupDisplay(display, drawable)
-	if Area.setupDisplay(self, display, drawable) then
+	return Gadget.init(self)
+end
+
+function ListGadget:setupDisplay(display, drawable)
+	if Gadget.setupDisplay(self, display, drawable) then
 		self.Font = display:openFont(self.FontSpec)
 		self.FWidth, self.FHeight = ui.Display:textSize(self.Font, "W")
 		self:prepare()
@@ -54,21 +65,21 @@ function ListArea:setupDisplay(display, 
 	end
 end
 
-function ListArea:cleanupDisplay()
+function ListGadget:cleanupDisplay()


More information about the tekui-devel mailing list