[tekui-devel] tekui: Group, PopRadioItem, ScrollGroup: initialization bugs fix...
Timm S. Mueller
tmueller at neoscientists.org
Fri Apr 25 00:10:44 CEST 2008
details: http://hg.teklib.org/tekui/rev/023787202473
changeset: 448:023787202473
user: Timm S. Mueller <tmueller at neoscientists.org>
date: Thu Apr 24 22:22:20 2008 +0200
description:
Group, PopRadioItem, ScrollGroup: initialization bugs fixed; PopItem, Window:
externalized PopupWindow; Spacer: cleanup
diffs (truncated from 267 to 100 lines):
diff -r 8a7552fe1775 -r 023787202473 tek/class/ui/group.lua
--- a/tek/class/ui/group.lua Thu Apr 24 19:42:10 2008 +0200
+++ b/tek/class/ui/group.lua Thu Apr 24 22:22:20 2008 +0200
@@ -21,7 +21,7 @@ local unpack = unpack
local unpack = unpack
module("tek.class.ui.group", tek.class.ui.gadget)
-_VERSION = "Group 6.1"
+_VERSION = "Group 6.2"
local Group = _M
-------------------------------------------------------------------------------
@@ -90,7 +90,7 @@ end
end
function Group.newRegularGroup(class, self)
- self = Gadget.new(class, Group.init(self or { }))
+ self = Gadget.new(class, self)
self:calcWeights()
return self
end
@@ -358,7 +358,7 @@ end
end
function Group:remMember(child)
- assert(child.Parent == self) -- TODO: doesn't work if child is listview, ...
+ assert(child.Parent == self)
if child == self.Window.FocusElement then
self.Window:setFocusElement()
end
diff -r 8a7552fe1775 -r 023787202473 tek/class/ui/popitem.lua
--- a/tek/class/ui/popitem.lua Thu Apr 24 19:42:10 2008 +0200
+++ b/tek/class/ui/popitem.lua Thu Apr 24 22:22:20 2008 +0200
@@ -13,20 +13,14 @@ local max = math.max
local max = math.max
module("tek.class.ui.popitem", tek.class.ui.text)
-_VERSION = "PopItem 1.25"
+_VERSION = "PopItem 1.26"
-------------------------------------------------------------------------------
-- Constants and class data:
-------------------------------------------------------------------------------
-local DEF_POPUPMARGIN = { 0, 0, 0, 0 }
-local DEF_POPUPBORDERSTYLE = "socket"
local DEF_POPUPFADEINDELAY = 6
local DEF_POPUPFADEOUTDELAY = 10
-local DEF_BORDERSTYLE = "" -- none
-local DEF_IBORDERSTYLE = "" -- none
-local DEF_CHILDRENBORDERSTYLE = "socket"
-local DEF_CHILDRENIBORDERSTYLE = "button"
local NOTIFY_SUBMENU = { ui.NOTIFY_SELF, "submenu", ui.NOTIFY_VALUE }
local NOTIFY_ONRELEASE = { ui.NOTIFY_SELF, "releasePopup" }
@@ -35,75 +29,6 @@ local NOTIFY_ONRELEASEITEM = { ui.NOTIFY
local NOTIFY_ONRELEASEITEM = { ui.NOTIFY_SELF, "setValue", "Pressed", false }
-------------------------------------------------------------------------------
--- PopupWindow class:
--------------------------------------------------------------------------------
-
-local PopupWindow = Window:newClass { _NAME = "_popupwindow" }
-
-function PopupWindow.init(self)
- self = self or { }
- self.Direction = "vertical"
- self.BackPen = self.BackPen or ui.PEN_MENUBACK
- self.Margin = self.Margin or DEF_POPUPMARGIN
- self.Border = self.Border or false
- self.Padding = self.Padding or false
- self.BorderStyle = self.BorderStyle or DEF_POPUPBORDERSTYLE
- self.MaxWidth = 0
- self.MaxHeight = 0
- self.Children = self.Children or false
- self.BeginPopupTicks = 0
- return Window.init(self)
-end
-
-function PopupWindow:passMsg(msg)
- if msg[2] == ui.MSG_MOUSEOVER then
- if msg[3] == 0 then
- if self.DelayedEndPopup then
- self:setHiliteElement(self.DelayedEndPopup)
- self.DelayedEndPopup = false
- end
- end
- -- do not pass control back to window msg handler:
- return false
- elseif msg[2] == ui.MSG_INTERVAL then
- self.BeginPopupTicks = self.BeginPopupTicks - 1
- if self.BeginPopupTicks < 0 then
- if self.DelayedBeginPopup then
- if not self.DelayedBeginPopup.PopupWindow then
- self.DelayedBeginPopup:beginPopup()
- end
- self.DelayedBeginPopup = false
- elseif self.DelayedEndPopup then
- if self.DelayedEndPopup.PopupWindow then
- self.DelayedEndPopup:endPopup()
More information about the tekui-devel
mailing list