[tekui-devel] tekui: TextInput:askMinMax(): minsize is now 2 fixed-width chara...

Timm S. Mueller tmueller at neoscientists.org
Wed Apr 30 12:26:27 CEST 2008


details:   http://hg.teklib.org/tekui/rev/441bb61b64c1
changeset: 461:441bb61b64c1
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Tue Apr 29 23:20:41 2008 +0200
description:
TextInput:askMinMax(): minsize is now 2 fixed-width characters; Text:
setLabel() renamed to onSetLabel(), examples now use setValue("Label");
config: TDEBUG-define was passed incorrectly; visual.h, display_x11: added
timsg_KeyCode for an UTF8-representation, minor cleanup; visual_api: extra
argument msg[7] now contains UTF-8 representation of keyup/keydown event

diffs (truncated from 295 to 100 lines):

diff -r cb045c833946 -r 441bb61b64c1 bin/list.lua
--- a/bin/list.lua	Tue Apr 29 16:40:49 2008 +0200
+++ b/bin/list.lua	Tue Apr 29 23:20:41 2008 +0200
@@ -77,6 +77,17 @@ ui.Application:new
 										end, ui.NOTIFY_VALUE
 									}
 								}
+							},
+							["DblClick"] =
+							{
+								[true] =
+								{
+									{
+										ui.NOTIFY_SELF, function(self)
+											print "Hallo!"
+										end,
+									}
+								}
 							}
 						}
 					}
@@ -107,7 +118,24 @@ ui.Application:new
 				{
 					Children =
 					{
-						ui.Text:new { Mode = "button", Width = "auto", Label = "Okay" },
+						ui.Text:new { Mode = "button", Width = "auto", Label = "New" },
+						ui.Text:new { Mode = "button", Width = "auto", Label = "Delete",
+							Notifications =
+							{
+								["Pressed"] =
+								{
+									[false] =
+									{
+										{
+											ui.NOTIFY_SELF, function(self)
+
+												print("delete")
+											end, ui.NOTIFY_VALUE
+										}
+									}
+								}
+							}
+						}
 					}
 				}
 			}
diff -r cb045c833946 -r 441bb61b64c1 bin/sudoku.lua
--- a/bin/sudoku.lua	Tue Apr 29 16:40:49 2008 +0200
+++ b/bin/sudoku.lua	Tue Apr 29 23:20:41 2008 +0200
@@ -125,7 +125,7 @@ function sudokubutton:onRelease()
 		if n >= 10 then
 			n = nil
 		end
-		self:setLabel(n and tostring(n))
+		self:setValue("Label", n and tostring(n))
 		self.Application:modify()
 	end
 end
diff -r cb045c833946 -r 441bb61b64c1 bin/weight.lua
--- a/bin/weight.lua	Tue Apr 29 16:40:49 2008 +0200
+++ b/bin/weight.lua	Tue Apr 29 23:20:41 2008 +0200
@@ -6,7 +6,7 @@ local mybutton = ui.text:newClass()
 local mybutton = ui.text:newClass()
 
 function mybutton:draw()
-	self:setLabel(tostring(self.Rect[3] - self.Rect[1] + 1))
+	self:setValue("Label", tostring(self.Rect[3] - self.Rect[1] + 1))
 	ui.text.draw(self)
 end
 
diff -r cb045c833946 -r 441bb61b64c1 config
--- a/config	Tue Apr 29 16:40:49 2008 +0200
+++ b/config	Tue Apr 29 23:20:41 2008 +0200
@@ -37,7 +37,7 @@ OBJDIR = build/$(PLATFORM)
 #------------------------------------------------------------------------------
 
 CC = gcc
-DEBUG = -g -TDEBUG=10
+DEBUG = -g -DTDEBUG=10
 WARN = -Wall -Wno-unused-parameter
 OPT = -O2
 INCL = -I. -Iinclude -I$(INCDIR)
diff -r cb045c833946 -r 441bb61b64c1 include/tek/mod/visual.h
--- a/include/tek/mod/visual.h	Tue Apr 29 16:40:49 2008 +0200
+++ b/include/tek/mod/visual.h	Tue Apr 29 23:20:41 2008 +0200
@@ -169,6 +169,8 @@ typedef struct TInputMessage
 	TINT timsg_MouseX, timsg_MouseY;
 	/* Damage rect: */
 	TINT timsg_X, timsg_Y, timsg_Width, timsg_Height;
+	/* UTF-8 representation of keycode: */
+	unsigned char timsg_KeyCode[8];
 
 	/* more fields may follow in the future. Do not use
 	** sizeof(TIMSG); if necessary use TGetSize(imsg) */
diff -r cb045c833946 -r 441bb61b64c1 src/display_x11/display_x11_inst.c
--- a/src/display_x11/display_x11_inst.c	Tue Apr 29 16:40:49 2008 +0200
+++ b/src/display_x11/display_x11_inst.c	Tue Apr 29 23:20:41 2008 +0200
@@ -605,7 +605,8 @@ static TBOOL processkey(TMOD_X11 *mod, V
 		}


More information about the tekui-devel mailing list