[tekui-devel] tekui: MinWidth/Height calculation now functional

Timm S. Mueller tmueller at neoscientists.org
Thu May 15 00:08:22 CEST 2008


details:   http://hg.teklib.org/tekui/rev/e9937b3360e6
changeset: 480:e9937b3360e6
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Sat May 10 20:30:58 2008 +0200
description:
MinWidth/Height calculation now functional

diffs (26 lines):

diff -r cc5fd381ee31 -r e9937b3360e6 tek/class/ui/window.lua
--- a/tek/class/ui/window.lua	Sat May 10 17:43:43 2008 +0200
+++ b/tek/class/ui/window.lua	Sat May 10 20:30:58 2008 +0200
@@ -26,7 +26,7 @@ local unpack = unpack
 local unpack = unpack
 
 module("tek.class.ui.window", tek.class.ui.group)
-_VERSION = "Window 2.2"
+_VERSION = "Window 2.3"
 
 -------------------------------------------------------------------------------
 --	Constants & Class data:
@@ -188,8 +188,13 @@ end
 -------------------------------------------------------------------------------
 
 function Window:getWindowDimensions()
+	local mw, mh = self.MinWidth, self.MinHeight
+	self.MinWidth, self.MinHeight = 0, 0
 	local m1, m2, m3, m4 = self:askMinMax(self.MinWidth, self.MinHeight,
 		self.MaxWidth, self.MaxHeight)
+	self.MinWidth = mw
+	self.MinHeight = mh
+	m1, m2 = max(mw, m1), max(mh, m2)
 	local x, y, w, h = self.Left, self.Top, self.Width, self.Height
 	w = type(w) == "number" and max(w, m1)
 	h = type(h) == "number" and max(h, m2)


More information about the tekui-devel mailing list