[tekui-devel] tekui: PopRadioItem image added; cleanup
Timm S. Mueller
tmueller at neoscientists.org
Wed Mar 5 23:02:30 CET 2008
details: http://hg.teklib.org/tekui/rev/1784dc30f1fb
changeset: 363:1784dc30f1fb
user: Timm S. Mueller <tmueller at neoscientists.org>
date: Mon Feb 11 07:38:45 2008 +0100
description:
PopRadioItem image added; cleanup
diffs (81 lines):
diff -r 985657f8a746 -r 1784dc30f1fb tek/class/ui/popradioitem.lua
--- a/tek/class/ui/popradioitem.lua Sun Feb 10 21:53:38 2008 +0100
+++ b/tek/class/ui/popradioitem.lua Mon Feb 11 07:38:45 2008 +0100
@@ -1,3 +1,4 @@
+
--
-- tek.class.ui.popradioitem
-- Written by Timm S. Mueller <tmueller at schulze-mueller.de>
@@ -29,7 +30,31 @@ PopImage = VectorImage:new
Coords = { -2, 1, 2, 1, 0, -1 },
Primitives = { { 0x1000, 3, Points = { 1, 2, 3 },
Pen = ui.PEN_BUTTONTEXT } },
- MinMax = { -3, -3, 3, 3 },
+ MinMax = { -4, -4, 4, 4 },
+ }
+}
+
+CheckImage1 = VectorImage:new
+{
+ ImageData =
+ {
+ Coords = { },
+ Primitives = { },
+ MinMax = { -5, 5, 5, -5 }
+ }
+}
+
+CheckImage2 = VectorImage:new
+{
+ ImageData =
+ {
+ Coords = { -3,1, -5,-1, -1,-5, 5,3, 3,5, -1,-1 },
+ Primitives = {
+ { 0x2000, 6,
+ Points = { 6, 1, 2, 3, 4, 5 },
+ Pen = ui.PEN_BUTTONTEXT },
+ },
+ MinMax = { -9, -9, 9, 9 }
}
}
@@ -37,6 +62,10 @@ PopImage = VectorImage:new
-- local DEF_PADDING = { 0, 0, 0, 0 }
local DEF_BORDERSTYLE = "" -- none
local DEF_IBORDERSTYLE = "" -- none
+
+local NOTIFY_ONPRESS = { ui.NOTIFY_SELF, "setSelected", ui.NOTIFY_VALUE }
+local NOTIFY_ONSELECT = { ui.NOTIFY_SELF, "setValue", "Redraw", true }
+local NOTIFY_ONRELEASE = { ui.NOTIFY_SELF, "setSelected", true }
-------------------------------------------------------------------------------
-- PopRadioItem class:
@@ -48,10 +77,9 @@ function PopRadioItem.new(class, self)
self = self or { }
if self.Children then
self.Image = self.Image or PopImage
--- self.ImageMinHeight = 12
else
- self.Image = self.Image or CheckMark.CheckImage1
- self.AltImage = self.AltImage or CheckMark.CheckImage2
+ self.Image = self.Image or CheckImage1
+ self.AltImage = self.AltImage or CheckImage2
end
self.Toggle = true
self = PopItem.new(class, self)
@@ -123,15 +151,6 @@ end
-- connectGlobal:
-------------------------------------------------------------------------------
-local NOTIFY_ONPRESS = { ui.NOTIFY_SELF, "setSelected", ui.NOTIFY_VALUE }
-local NOTIFY_ONSELECT = { ui.NOTIFY_SELF, "setValue", "Redraw", true }
-local NOTIFY_ONRELEASE = { ui.NOTIFY_SELF, "setSelected", true }
--- local NOTIFY_ONRELEASE = { ui.NOTIFY_SELF, "selectItem" }
--- function PopRadioItem:selectItem()
--- self:setSelected(true)
--- self:
--- end
-
function PopRadioItem:connectGlobal(app, window)
if not self.Children then
-- NOTIFY_ONRELEASE must be connected prior to adding the notifications
More information about the tekui-devel
mailing list