[tekui-devel] tekui: minor stability fix in TextInput
Timm S. Mueller
tmueller at schulze-mueller.de
Fri Nov 21 19:26:15 CET 2008
details: http://hg.teklib.org/tekui/rev/f5765f0f045f
changeset: 43:f5765f0f045f
user: Timm S. Mueller <tmueller at schulze-mueller.de>
date: Fri Nov 21 19:15:52 2008 +0100
description:
minor stability fix in TextInput
diffs (65 lines):
diff -r aee2499a02b4 -r f5765f0f045f doc/manual.html
--- a/doc/manual.html Fri Nov 21 18:54:17 2008 +0100
+++ b/doc/manual.html Fri Nov 21 19:15:52 2008 +0100
@@ -2605,7 +2605,7 @@
</p>
<hr />
</div>
- <div class="node"><h2><a name="tek.ui.class.theme" id="tek.ui.class.theme">Theme (v6.9)</a></h2>
+ <div class="node"><h2><a name="tek.ui.class.theme" id="tek.ui.class.theme">Theme (v6.10)</a></h2>
<div class="definition"><dfn>LINEAGE</dfn>
<blockquote>
<p>
@@ -4757,7 +4757,7 @@
</p>
<hr />
</div>
- <div class="node"><h2><a name="tek.ui.class.textinput" id="tek.ui.class.textinput">TextInput (v7.2)</a></h2>
+ <div class="node"><h2><a name="tek.ui.class.textinput" id="tek.ui.class.textinput">TextInput (v7.3)</a></h2>
<div class="definition"><dfn>LINEAGE</dfn>
<blockquote>
<p>
@@ -7295,7 +7295,7 @@ Class.checkDescend(Button, Area)
</pre>
<hr />
<p>
- Document generated on Thu Nov 20 22:36:09 2008
+ Document generated on Fri Nov 21 19:12:25 2008
</p>
</div>
</body>
diff -r aee2499a02b4 -r f5765f0f045f tek/ui/class/textinput.lua
--- a/tek/ui/class/textinput.lua Fri Nov 21 18:54:17 2008 +0100
+++ b/tek/ui/class/textinput.lua Fri Nov 21 19:15:52 2008 +0100
@@ -66,7 +66,7 @@ local unpack = unpack
local unpack = unpack
module("tek.ui.class.textinput", tek.ui.class.text)
-_VERSION = "TextInput 7.2"
+_VERSION = "TextInput 7.3"
-------------------------------------------------------------------------------
-- Constants & Class data:
@@ -264,13 +264,15 @@ end
function TextInput:clickMouse(x, y)
local tr, tc = self.TextRect, self.TextCursor
- local fw, fh = self.FWidth, self.FHeight
- if x >= tr[1] and x <= tr[3] and y >= tr[2] and y <= tr[4] then
- tc = floor((x - tr[1]) / fw)
- elseif x < tr[1] then
- tc = 0
- elseif x > tr[3] then
- tc = floor((tr[3] - tr[1]) / fw) + 1
+ if tr then
+ local fw = self.FWidth
+ if x >= tr[1] and x <= tr[3] and y >= tr[2] and y <= tr[4] then
+ tc = floor((x - tr[1]) / fw)
+ elseif x < tr[1] then
+ tc = 0
+ elseif x > tr[3] then
+ tc = floor((tr[3] - tr[1]) / fw) + 1
+ end
end
self:setCursor(tc)
self.BlinkTick = 0
More information about the tekui-devel
mailing list