[tekui-devel] tekui: MenuItem: Shortcut property moved to PopItem; PopItem: po...

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


details:   http://hg.teklib.org/tekui/rev/81e79fe4b08e
changeset: 498:81e79fe4b08e
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Wed May 14 00:02:18 2008 +0200
description:
MenuItem: Shortcut property moved to PopItem; PopItem: popitems are now only
once recursively connected (and shortcuts connected) during connectGlobal(),
mousebutton leftup handler reconstructed; Element: Application and Window are
no longer removed during disconnectGlobal() (which is ugly), to support
notification handlers of PopItems which are invisible because they were not
regularly connected

diffs (truncated from 286 to 100 lines):

diff -r 6fe4c3fcf1ae -r 81e79fe4b08e bin/demo.lua
--- a/bin/demo.lua	Tue May 13 18:16:07 2008 +0200
+++ b/bin/demo.lua	Wed May 14 00:02:18 2008 +0200
@@ -71,6 +71,7 @@ ui.Application:new
 
 		ui.Window:new
 		{
+			Direction = "vertical",
 			Width = 300,
 			Height = 300,
 			Id = "anims-window",
@@ -92,13 +93,41 @@ ui.Application:new
 			},
 			Children =
 			{
+				ui.Group:new {
+					Style = "menubar",
+					Children = {
+						ui.MenuItem:new {
+							Label = "_File",
+							Children = {
+								ui.MenuItem:new {
+									Label = "_Quit",
+									Shortcut = "x",
+									Notifications =
+									{
+										["Pressed"] =
+										{
+											[false] =
+											{
+												{
+													ui.NOTIFY_SELF, ui.NOTIFY_FUNCTION, function(self)
+														self.Application:setValue("Status", "quit")
+													end
+												}
+											}
+										}
+									},
+								},
+							},
+						},
+					}
+				},
 				ui.TabGroup:new
 				{
 					Children =
 					{
 						ui.Group:new
 						{
-							TabName = "Tunnel",
+							TabName = "_Tunnel",
 							Direction = "vertical",
 							Children =
 							{
@@ -167,7 +196,7 @@ ui.Application:new
 						},
 						ui.Group:new
 						{
-							TabName = "Boing",
+							TabName = "_Boing",
 							Direction = "vertical",
 							Children =
 							{
@@ -217,7 +246,7 @@ ui.Application:new
 						},
 						ui.Group:new
 						{
-							TabName = "Lissa",
+							TabName = "_Lissa",
 							Children =
 							{
 								ui.Lissa:new { },
diff -r 6fe4c3fcf1ae -r 81e79fe4b08e bin/tekui.lua
--- a/bin/tekui.lua	Tue May 13 18:16:07 2008 +0200
+++ b/bin/tekui.lua	Wed May 14 00:02:18 2008 +0200
@@ -40,10 +40,10 @@ ui.Application:new
 										ui.MenuItem:new { Label = "Other..." },
 									},
 								},
-								ui.MenuItem:new { Label = "Bla",
+								ui.MenuItem:new { Label = "_Bla",
 									Children = {
 										ui.MenuItem:new { Label = "Bla" },
-										ui.MenuItem:new { Label = "Blub" },
+										ui.MenuItem:new { Label = "Bl_ub" },
 										ui.MenuItem:new { Label = "Fomp" },
 									},
 								},
@@ -59,7 +59,7 @@ ui.Application:new
 								ui.Spacer:new { },
 								ui.MenuItem:new {
 									Label = "_Quit",
-									Shortcut = "Ctrl+Q",
+									Shortcut = "x",
 									Notifications =
 									{
 										["Pressed"] =
diff -r 6fe4c3fcf1ae -r 81e79fe4b08e tek/class/ui/element.lua
--- a/tek/class/ui/element.lua	Tue May 13 18:16:07 2008 +0200
+++ b/tek/class/ui/element.lua	Wed May 14 00:02:18 2008 +0200


More information about the tekui-devel mailing list