[tekui-devel] tekui: Canvas, ScrollGroup, FloatText, ListView: Canvas properti...

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

details:   http://hg.teklib.org/tekui/rev/7b5f26c9356d
changeset: 481:7b5f26c9356d
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Sat May 10 22:47:31 2008 +0200
Canvas, ScrollGroup, FloatText, ListView: Canvas properties renamed to

diffs (truncated from 575 to 100 lines):

diff -r e9937b3360e6 -r 7b5f26c9356d bin/alignment.lua
--- a/bin/alignment.lua	Sat May 10 20:30:58 2008 +0200
+++ b/bin/alignment.lua	Sat May 10 22:47:31 2008 +0200
@@ -11,8 +11,6 @@ ui.Application:new
 			Direction = "vertical",
-			MaxWidth = 700,
-			MaxHeight = 700,
 			Title = "Alignment Demo",
 			Children =
diff -r e9937b3360e6 -r 7b5f26c9356d bin/floattext.lua
--- a/bin/floattext.lua	Sat May 10 20:30:58 2008 +0200
+++ b/bin/floattext.lua	Sat May 10 22:47:31 2008 +0200
@@ -12,6 +12,7 @@ ui.Application:new {
 				ui.ScrollGroup:new {
 					VSliderMode = "on",
 					AutoWidth = true,
+					KeepMinWidth = true,
 					Object =
 					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...  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 e9937b3360e6 -r 7b5f26c9356d tek/class/ui/canvas.lua
--- a/tek/class/ui/canvas.lua	Sat May 10 20:30:58 2008 +0200
+++ b/tek/class/ui/canvas.lua	Sat May 10 22:47:31 2008 +0200
@@ -20,7 +20,7 @@ local overlap = ui.Region.overlapCoords
 local overlap = ui.Region.overlapCoords
 module("tek.class.ui.canvas", tek.class.ui.frame)
-_VERSION = "Canvas 1.14"
+_VERSION = "Canvas 2.0"
 local Canvas = _M
 local DEF_CANVASAREA_MARGIN = { 0, 0, 0, 0 }
@@ -32,10 +32,10 @@ local DEF_CANVASAREA_BORDERSTYLE = "rece
 function Canvas.init(self)
-	self.Left = self.Left or 0
-	self.Top = self.Top or 0
-	self.Width = self.Width or 0
-	self.Height = self.Height or 0
+	self.CanvasLeft = self.CanvasLeft or 0
+	self.CanvasTop = self.CanvasTop or 0
+	self.CanvasWidth = self.CanvasWidth or 0
+	self.CanvasHeight = self.CanvasHeight or 0
 	self.ScrollGroup = false
 	self.UnusedRegion = false
 	self.TempMsg = { }
@@ -114,8 +114,8 @@ function Canvas:askMinMax(m1, m2, m3, m4
 	local s = self.ScrollGroup
 	local m1 = s.KeepMinWidth and m1 or 0
 	local m2 = s.KeepMinHeight and m2 or 0
-	local m3 = s.MaxWidth and max(s.MaxWidth, m1) or self.Width
-	local m4 = s.MaxHeight and max(s.MaxHeight, m2) or self.Height
+	local m3 = s.MaxWidth and max(s.MaxWidth, m1) or self.CanvasWidth
+	local m4 = s.MaxHeight and max(s.MaxHeight, m2) or self.CanvasHeight
 	return Frame.askMinMax(self, m1, m2, m3, m4)
@@ -138,8 +138,8 @@ function Canvas:layout(r1, r2, r3, r4, m
 		assert(mm[1], self.Object:getClassName())
 		w = max(w, mm[1])
 		w = mm[3] and min(w, mm[3]) or w
-		if w ~= self.Width then
-			self.ScrollGroup:setValue("Width", w)
+		if w ~= self.CanvasWidth then
+			self.ScrollGroup:setValue("CanvasWidth", w)
 			sizechanged = true
@@ -148,8 +148,8 @@ function Canvas:layout(r1, r2, r3, r4, m
 		local h = r4 - r2 + 1 - m[2] - m[4]
 		h = max(h, mm[2])
 		h = mm[4] and min(h, mm[4]) or h
-		if h ~= self.Height then
-			self.ScrollGroup:setValue("Height", h)
+		if h ~= self.CanvasHeight then
+			self.ScrollGroup:setValue("CanvasHeight", h)
 			sizechanged = true
@@ -158,16 +158,16 @@ function Canvas:layout(r1, r2, r3, r4, m
 	-- TODO: break out if they don't settle in?
 	local iw, ih
-		iw, ih = self.Width, self.Height
+		iw, ih = self.CanvasWidth, self.CanvasHeight
 		self.Object:layout(0, 0, iw - 1, ih - 1, sizechanged)
 		sizechanged = true
-	until self.Width == iw and self.Height == ih
+	until self.CanvasWidth == iw and self.CanvasHeight == ih
 	-- propagate intra-area damages calculated in Frame.layout to child object:
 	local dr = self.DamageRegion
 	if dr and markdamage ~= false then
-		local sx = self.Left - r[1]
-		local sy = self.Top - r[2]
+		local sx = self.CanvasLeft - r[1]

More information about the tekui-devel mailing list