[tekui-devel] tekui: Canvas: Layouting caused flickering, hopefully fixed; Gad...
Timm S. Mueller
tmueller at neoscientists.org
Tue Apr 22 20:02:31 CEST 2008
details: http://hg.teklib.org/tekui/rev/1e09abb3d2fa
changeset: 441:1e09abb3d2fa
user: Timm S. Mueller <tmueller at neoscientists.org>
date: Tue Apr 22 16:44:37 2008 +0200
description:
Canvas: Layouting caused flickering, hopefully fixed; Gadget: cleanup and
cosmetic changes in setHover, setActive, setDisabled; List: added focus, an
own input handler for key events, cursor keyboard movement; Object: more
verbose assertion; ScrollGroup: setTop() and setLeft() now adjust the
respective slider positions; Window: faster input processing
diffs (truncated from 462 to 100 lines):
diff -r bc5bab348954 -r 1e09abb3d2fa tek/class/ui/canvas.lua
--- a/tek/class/ui/canvas.lua Tue Apr 22 13:36:42 2008 +0200
+++ b/tek/class/ui/canvas.lua Tue Apr 22 16:44:37 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.12"
+_VERSION = "Canvas 1.13"
local Canvas = _M
local DEF_CANVASAREA_MARGIN = { 0, 0, 0, 0 }
@@ -139,8 +139,8 @@ 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:setTop(0)
+ -- self.ScrollGroup:setLeft(0)
self.ScrollGroup:setWidth(w)
sizechanged = true
end
@@ -151,8 +151,8 @@ 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:setTop(0)
+ -- self.ScrollGroup:setLeft(0)
self.ScrollGroup:setHeight(h)
sizechanged = true
end
diff -r bc5bab348954 -r 1e09abb3d2fa tek/class/ui/gadget.lua
--- a/tek/class/ui/gadget.lua Tue Apr 22 13:36:42 2008 +0200
+++ b/tek/class/ui/gadget.lua Tue Apr 22 16:44:37 2008 +0200
@@ -20,7 +20,7 @@ local Frame = ui.Frame
local Frame = ui.Frame
module("tek.class.ui.gadget", tek.class.ui.frame)
-_VERSION = "Gadget 4.1"
+_VERSION = "Gadget 4.2"
local Gadget = _M
@@ -29,8 +29,8 @@ local Gadget = _M
-------------------------------------------------------------------------------
local DEF_IBORDERSTYLE = "none"
-local NOTIFY_HOVER = { ui.NOTIFY_SELF, "setHover" }
-local NOTIFY_ACTIVE = { ui.NOTIFY_SELF, "setActive" }
+local NOTIFY_HOVER = { ui.NOTIFY_SELF, "setHover", ui.NOTIFY_VALUE }
+local NOTIFY_ACTIVE = { ui.NOTIFY_SELF, "setActive", ui.NOTIFY_VALUE }
local NOTIFY_STATE = { ui.NOTIFY_SELF, "setState" }
local NOTIFY_DISABLED = { ui.NOTIFY_SELF, "setDisabled", ui.NOTIFY_VALUE }
@@ -107,11 +107,6 @@ end
-------------------------------------------------------------------------------
function Gadget:setHover(hover)
- if hover == nil then
- hover = self.Hover
- else
- self.Hover = hover
- end
if self.Mode == "button" then
self:setValue("Selected", self.Active and hover)
end
@@ -126,29 +121,30 @@ end
-------------------------------------------------------------------------------
function Gadget:setActive(active)
- if active == nil then
- active = self.Active
- else
- self.Active = active
- end
- local mode, selected = self.Mode, self.Selected
+ local mode, selected, dblclick = self.Mode, self.Selected
if mode == "toggle" then
if active then
self:setValue("Selected", not selected)
self:setValue("Pressed", true)
- self.Window:setDblClickElement(self)
+ dblclick = self
end
elseif mode == "touch" then
if active and not selected then
self:setValue("Selected", true)
self:setValue("Pressed", true)
- self.Window:setDblClickElement(self)
+ dblclick = self
end
elseif mode == "button" then
self:setValue("Selected", active and self.Hover)
if not selected ~= not active then
self:setValue("Pressed", active)
- self.Window:setDblClickElement(active and self)
+ dblclick = active and self
More information about the tekui-devel
mailing list