[tekui-devel] tekui: FloatText improved

hg-notify at neoscientists.org hg-notify at neoscientists.org
Tue Feb 5 02:46:02 CET 2008


details:   http://hg.teklib.org/tekui/rev/8e58bd850d67
changeset: 355:8e58bd850d67
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Mon Feb 04 20:15:01 2008 +0100
description:
FloatText improved

diffs (truncated from 221 to 100 lines):

diff -r 526c98a52048 -r 8e58bd850d67 tek/app/ui/floattext.lua
--- a/tek/app/ui/floattext.lua	Mon Feb 04 04:51:19 2008 +0100
+++ b/tek/app/ui/floattext.lua	Mon Feb 04 20:15:01 2008 +0100
@@ -10,8 +10,8 @@ ui.Application:new {
 		ui.Window:new {
 			Children = {
 				ui.FloatText:new {
-					FloatText = [[ Hello.  My Handle is The Cuisinart Blade, (I have since changed it) most people called me C.B., just as another nickname.  I got into computers because I always had a knack for Games, Programs, Etc...  I loved the feel of the keyboard as I typed, espically around Midnight, when School was only 7 hours away. That Dickhead in your 1st hour waiting to pick on you at the stroke of the clock.  What little that he knew. I Loved the feeling of flying through the 'Net, talking to the other Hackers like me, always trying to impress one another. They came in all fashions of Handles: The Ax Murderer, Psycho, The Hacker Kid, Phobia, Etc...the list is nearly endless.  And each with an utterly unique personality, so far advanced from the Morons we all remember at high school.  I loved talking to these "Wanderers of the Wunderland" so much, I would call all over the united states just to do that. I remember back in 1988, 9600 was almost as uncommon as the newest modems of today.  I loved to suck down that Jolt, turn on the overhead light in the basement, and hack until morning. Then goto school to have that enormus football jock try to scare me into submission. I will admit that, yes, he did scare me.  But what a fool he was, thinking that pure brawn was power.  Knowledge IS power.  I never did good in High School.  Knowledge is not there, it was in the 'Net!  THAT was where I was a King.  That was where I was a God.  ANYONE who has truely roamed the 'Net or been in that type of world could tell you that, (Right, King Blotto?) hands down. I loved running home, or taking the bus, right into my basement!  Homework?  Bah!  What a waste of time it was, compared to the thrill of Hacking?  Homework was little more than review.  I sat down and got onto my Computer and began to type. I called a rather large BBS in which, Hackers frequented. Nowadays they are considered "Wandering" Boards.  They appear to wander because they change phone numbers all the time. Anyway, I called up my favorite Pirate BBS and went onto Multi- nodal chat to talk to the others about their exploits.  Some of them had told me of their abilities to smash entire phone networks, others had told me of their A-Typical grade changes, (Yawn)  But most of all I loved to brag.  The unwritten rule in being a hacker, you're nothing unless you have something to brag about.  At the time, I didn't, so I decided to get a name in the computer Hacking Club and do just that: Hack. At first I wondered where I should go, what I should do. I had no idea where to begin.  I had been all over the world in the 'Net, and nothing to show for it, other than just knowing of everyone, or everything.  I needed more.  That is the answer to everything in the mind of a Hacker, the NEED to know. I decided to try something small. That night, my friend, (who I will call Dr.Antristo) and I, called up another Pirate BBS and Downloaded the number of a rather prominent business, (at the time) and decided to call. Our biggest fear was being traced, so we got togther and built what is nowadays almost routine, (from what I hear) a BOX. I made the call and found myself looking into a Menu System, that asked for a NAME, and Security ID.  I had no idea about any security ID, or anyone who worked there, so I decided to Hang up and try in a day or 2, AFTER I did some "Checking Up" on their Company. ]],
-				}
+					Text = [[ Hello.  My Handle is The Cuisinart Blade, (I have since changed it) most people called me C.B., just as another nickname.  I got into computers because I always had a knack for Games, Programs, Etc...  I loved the feel of the keyboard as I typed, espically around Midnight, when School was only 7 hours away. That Dickhead in your 1st hour waiting to pick on you at the stroke of the clock.  What little that he knew. I Loved the feeling of flying through the 'Net, talking to the other Hackers like me, always trying to impress one another. They came in all fashions of Handles: The Ax Murderer, Psycho, The Hacker Kid, Phobia, Etc...the list is nearly endless.  And each with an utterly unique personality, so far advanced from the Morons we all remember at high school.  I loved talking to these "Wanderers of the Wunderland" so much, I would call all over the united states just to do that. I remember back in 1988, 9600 was almost as uncommon as the newest modems of today.  I loved to suck down that Jolt, turn on the overhead light in the basement, and hack until morning. Then goto school to have that enormus football jock try to scare me into submission. I will admit that, yes, he did scare me.  But what a fool he was, thinking that pure brawn was power.  Knowledge IS power.  I never did good in High School.  Knowledge is not there, it was in the 'Net!  THAT was where I was a King.  That was where I was a God.  ANYONE who has truely roamed the 'Net or been in that type of world could tell you that, (Right, King Blotto?) hands down. I loved running home, or taking the bus, right into my basement!  Homework?  Bah!  What a waste of time it was, compared to the thrill of Hacking?  Homework was little more than review.  I sat down and got onto my Computer and began to type. I called a rather large BBS in which, Hackers frequented. Nowadays they are considered "Wandering" Boards.  They appear to wander because they change phone numbers all the time. Anyway, I called up my favorite Pirate BBS and went onto Multi- nodal chat to talk to the others about their exploits.  Some of them had told me of their abilities to smash entire phone networks, others had told me of their A-Typical grade changes, (Yawn)  But most of all I loved to brag.  The unwritten rule in being a hacker, you're nothing unless you have something to brag about.  At the time, I didn't, so I decided to get a name in the computer Hacking Club and do just that: Hack. At first I wondered where I should go, what I should do. I had no idea where to begin.  I had been all over the world in the 'Net, and nothing to show for it, other than just knowing of everyone, or everything.  I needed more.  That is the answer to everything in the mind of a Hacker, the NEED to know. I decided to try something small. That night, my friend, (who I will call Dr.Antristo) and I, called up another Pirate BBS and Downloaded the number of a rather prominent business, (at the time) and decided to call. Our biggest fear was being traced, so we got togther and built what is nowadays almost routine, (from what I hear) a BOX. I made the call and found myself looking into a Menu System, that asked for a NAME, and Security ID.  I had no idea about any security ID, or anyone who worked there, so I decided to Hang up and try in a day or 2, AFTER I did some "Checking Up" on their Company. ]],
+				},
 			}
 		}
 	}
diff -r 526c98a52048 -r 8e58bd850d67 tek/app/ui/tekui.lua
--- a/tek/app/ui/tekui.lua	Mon Feb 04 04:51:19 2008 +0100
+++ b/tek/app/ui/tekui.lua	Mon Feb 04 20:15:01 2008 +0100
@@ -275,7 +275,7 @@ ui.application:new
 							},
 						},
 						ui.handle:new { HMax = false },
-						ui.FloatText:new { },
+						ui.FloatText:new { Text = [[ Hello.  My Handle is The Cuisinart Blade, (I have since changed it) most people called me C.B., just as another nickname.  I got into computers because I always had a knack for Games, Programs, Etc... ]], },
 						ui.handle:new { HMax = false },
 						ui.listview:new
 						{
diff -r 526c98a52048 -r 8e58bd850d67 tek/class/ui/floattext.lua
--- a/tek/class/ui/floattext.lua	Mon Feb 04 04:51:19 2008 +0100
+++ b/tek/class/ui/floattext.lua	Mon Feb 04 20:15:01 2008 +0100
@@ -13,6 +13,7 @@ local ScrollGroup = ui.ScrollGroup
 local ScrollGroup = ui.ScrollGroup
 local Canvas = ui.Canvas
 
+local assert = assert
 local unpack = unpack
 local overlap = ui.Region.overlapCoords
 local insert = table.insert
@@ -22,7 +23,7 @@ local ipairs = ipairs
 local ipairs = ipairs
 
 module("tek.class.ui.floattext", tek.class.ui.scrollgroup)
-_VERSION = "FloatText 0.2"
+_VERSION = "FloatText 0.3"
 local FloatText = _M
 
 -------------------------------------------------------------------------------
@@ -40,6 +41,12 @@ function TextCanvas:layout(r1, r2, r3, r
 	local w = r3 - r1 + 1 - self.MarginAndBorder[1] - self.MarginAndBorder[3]
 	self.ScrollGroup:setWidth(w)
 	return Canvas.layout(self, r1, r2, r3, r4, markdamage)
+end
+
+function TextCanvas:relayout(e, r1, r2, r3, r4)
+	if Canvas.relayout(self, e, r1, r2, r3, r4) then
+		return true
+	end
 end
 
 -------------------------------------------------------------------------------
@@ -74,26 +81,28 @@ function TextArea:draw(bgpen)
 function TextArea:draw(bgpen)
 
 	local d = self.Drawable
-	bgpen = bgpen or d.Pens[ui.PEN_AREABACK]
+	local pens = d.Pens
+	bgpen = bgpen or pens[ui.PEN_AREABACK]
+	local fgpen = pens[ui.PEN_BUTTONTEXT]
 	d:setFont(self.Font)
 
 	-- repaint intra-area damagerects:
 
 	local dr = self.DamageRegion
 	if dr then
-		local pens = d.Pens
 		for _, r in dr:getRects() do
 			local r1, r2, r3, r4 = dr:getRect(r)
 			d:fillRect(r1, r2, r3, r4, bgpen)
-			for i = 1, #self.Text do
-				local t = self.Text[i]
+			for i = 1, #self.Lines do
+				local t = self.Lines[i]
 				local a1, a2, a3, a4 = overlap(r1, r2, r3, r4, t[1], t[2], t[3], t[4])
 				if a1 then
 					d:pushClipRect(a1, a2, a3, a4)
-					d:drawText(t[1], t[2], t.Text, pens[ui.PEN_BUTTONTEXT])
+					d:drawText(t[1], t[2], t[5], fgpen)
 					d:popClipRect()
 				end
 			end
+
 		end
 		self.DamageRegion = false
 	end
@@ -107,40 +116,52 @@ function TextArea:layoutText(x, y, width
 	local fh = self.FHeight
 	local tw
 
-	for word in self.FloatText:gmatch("[^%s]+") do
+	for word in self.Text:gmatch("[^%s]+") do
 		insert(line, word)


More information about the tekui-devel mailing list