[tekui-devel] tekui: Text: FontSpec is no longer part of a TextRecord; Display...

Timm S. Mueller tmueller at neoscientists.org
Tue Apr 15 21:59:01 CEST 2008


details:   http://hg.teklib.org/tekui/rev/e1e5ed2d583b
changeset: 429:e1e5ed2d583b
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Tue Apr 15 18:35:59 2008 +0200
description:
Text: FontSpec is no longer part of a TextRecord; Display: Font opening is
slightly more robust

diffs (truncated from 414 to 100 lines):

diff -r 7b9991e94753 -r e1e5ed2d583b tek/app/ui/sudoku.lua
--- a/tek/app/ui/sudoku.lua	Tue Apr 15 10:27:29 2008 +0200
+++ b/tek/app/ui/sudoku.lua	Tue Apr 15 18:35:59 2008 +0200
@@ -149,7 +149,8 @@ end
 
 function sudokubutton:setupDisplay(display, drawable)
 	if ui.Text.setupDisplay(self, display, drawable) then
-		self.MinWidth = ui.Display:textSize(self.Font, "W")
+		local tr = self.TextRecords
+		self.MinWidth = ui.Display:textSize(tr[1][2], "W")
 		return true
 	end
 end
diff -r 7b9991e94753 -r e1e5ed2d583b tek/app/ui/tekui.lua
--- a/tek/app/ui/tekui.lua	Tue Apr 15 10:27:29 2008 +0200
+++ b/tek/app/ui/tekui.lua	Tue Apr 15 18:35:59 2008 +0200
@@ -117,7 +117,7 @@ ui.application:new
 								ui.menuitem:new { Label = "Print" },
 								ui.spacer:new { },
 								ui.menuitem:new { Label = "Close" },
-								ui.menuitem:new { Label = "Close all" },
+								ui.menuitem:new { Label = "Close all", Shortcut = "Shift+Ctrl+Q" },
 								ui.spacer:new { },
 								ui.menuitem:new {
 									Label = "Quit",
@@ -159,7 +159,6 @@ ui.application:new
 				{
 					Height = "auto",
 					Width = "auto",
-					Legend = "Dynamic",
 					Children =
 					{
 						ui.text:new
@@ -380,7 +379,7 @@ ui.application:new
 							},
 						},
 						ui.text:new { Mode = "button", Label = "Open", VAlign = "center", Width = "auto" },
-						ui.text:new { Label = "Hallo", VAlign = "center" },
+						ui.text:new { Label = "Hello\nWorld", TextVAlign = "top" },
 						ui.text:new
 						{
 							Width = "auto",
diff -r 7b9991e94753 -r e1e5ed2d583b tek/class/ui/display.lua
--- a/tek/class/ui/display.lua	Tue Apr 15 10:27:29 2008 +0200
+++ b/tek/class/ui/display.lua	Tue Apr 15 18:35:59 2008 +0200
@@ -11,7 +11,7 @@ local tonumber = tonumber
 local tonumber = tonumber
 
 module("tek.class.ui.display", tek.class.ui.object)
-_VERSION = "Display 2.4"
+_VERSION = "Display 2.5"
 
 -------------------------------------------------------------------------------
 --	Class implementation:
@@ -38,6 +38,7 @@ end
 -------------------------------------------------------------------------------
 
 function Display:openFont(fname)
+	fname = fname or ""
 	if not self.FontCache[fname] then
 		local name, size = fname:match("^([^:]*):?(%d*)$")
 		if self.Theme.DefFonts[name] then
diff -r 7b9991e94753 -r e1e5ed2d583b tek/class/ui/floattext.lua
--- a/tek/class/ui/floattext.lua	Tue Apr 15 10:27:29 2008 +0200
+++ b/tek/class/ui/floattext.lua	Tue Apr 15 18:35:59 2008 +0200
@@ -18,7 +18,7 @@ local max = math.max
 local max = math.max
 
 module("tek.class.ui.floattext", tek.class.ui.scrollgroup)
-_VERSION = "FloatText 1.8"
+_VERSION = "FloatText 1.9"
 local FloatText = _M
 
 -------------------------------------------------------------------------------
@@ -36,7 +36,7 @@ function TextArea.init(self)
 	self.Height = false
 	self.Lines = false
 	self.TrackDamage = self.TrackDamage or true
-	self.FontSpec = ""
+	self.FontSpec = false
 	self.Margin = DEF_TEXTAREA_MARGIN
 	self.WordLengths = false
 	self.WordSpacing = false
@@ -45,7 +45,7 @@ end
 
 function TextArea:setupDisplay(display, drawable)
 	if Area.setupDisplay(self, display, drawable) then
-		self.Font = display:openFont(self.FontSpec or "")
+		self.Font = display:openFont(self.FontSpec)
 		self.FWidth, self.FHeight = ui.Display:textSize(self.Font, "W")
 		self:prepareText()
 		return true
diff -r 7b9991e94753 -r e1e5ed2d583b tek/class/ui/group.lua
--- a/tek/class/ui/group.lua	Tue Apr 15 10:27:29 2008 +0200
+++ b/tek/class/ui/group.lua	Tue Apr 15 18:35:59 2008 +0200
@@ -21,7 +21,7 @@ local unpack = unpack
 local unpack = unpack
 
 module("tek.class.ui.group", tek.class.ui.gadget)
-_VERSION = "Group 5.1"


More information about the tekui-devel mailing list