[tekui-devel] tekui: added

Timm S. Mueller tmueller at neoscientists.org
Fri May 9 14:26:19 CEST 2008


details:   http://hg.teklib.org/tekui/rev/55368ea2c2de
changeset: 469:55368ea2c2de
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Tue May 06 19:20:28 2008 +0200
description:
added

diffs (43 lines):

diff -r 5f3b608c59ea -r 55368ea2c2de tek/class/ui/border/cursor.lua
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tek/class/ui/border/cursor.lua	Tue May 06 19:20:28 2008 +0200
@@ -0,0 +1,39 @@
+
+--
+--	tek.class.ui.border.cursor
+--	Written by Timm S. Mueller <tmueller at schulze-mueller.de>
+--	See copyright notice in COPYRIGHT
+--
+
+local ui = require "tek.lib.ui"
+local unpack = unpack
+
+module("tek.class.ui.border.cursor", tek.class.ui.border)
+_VERSION = "CursorBorder 2.0"
+
+-------------------------------------------------------------------------------
+--	Constants & Class data:
+-------------------------------------------------------------------------------
+
+local DEF_BORDER = { 1, 1, 1, 1 }
+
+-------------------------------------------------------------------------------
+--	Class implementation:
+-------------------------------------------------------------------------------
+
+local CursorBorder = _M
+
+function CursorBorder:getBorder(element, border)
+	return unpack(border or
+		element.Display.Theme.BorderCursorBorderBorder or DEF_BORDER)
+end
+
+function CursorBorder:draw(element, border, r1, r2, r3, r4)
+	local b1, b2, b3, b4 = self:getBorder(element, border)
+	local d = element.Drawable
+	local p1 = d.Pens[ui.PEN_SHINE]
+	d:fillRect(r1 - b1, r2 - b2, r3 + b3, r2 - 1, p1)
+	d:fillRect(r3 + 1, r2, r3 + b3, r4 + b4, p1)
+	d:fillRect(r1 - b1, r4 + 1, r3 + b3, r4 + b4, p1)
+	d:fillRect(r1 - b1, r2, r1 - 1, r4, p1)
+end


More information about the tekui-devel mailing list