[tekui-devel] tekui: MenuItem: KeyCode and Shortcut are now different categories
Timm S. Mueller
tmueller at neoscientists.org
Thu May 15 00:08:37 CEST 2008
details: http://hg.teklib.org/tekui/rev/6fe4c3fcf1ae
changeset: 497:6fe4c3fcf1ae
user: Timm S. Mueller <tmueller at neoscientists.org>
date: Tue May 13 18:16:07 2008 +0200
description:
MenuItem: KeyCode and Shortcut are now different categories
diffs (47 lines):
diff -r 8aaf1a2e841d -r 6fe4c3fcf1ae bin/tekui.lua
--- a/bin/tekui.lua Tue May 13 18:08:58 2008 +0200
+++ b/bin/tekui.lua Tue May 13 18:16:07 2008 +0200
@@ -51,15 +51,15 @@ ui.Application:new
ui.MenuItem:new { Label = "Save..." },
ui.MenuItem:new { Label = "Save as" },
ui.Spacer:new { },
- ui.MenuItem:new { Label = "Reload" },
+ ui.MenuItem:new { Label = "_Reload" },
ui.MenuItem:new { Label = "Print" },
ui.Spacer:new { },
ui.MenuItem:new { Label = "Close" },
- ui.MenuItem:new { Label = "Close all", KeyCode = "Shift+Ctrl+Q" },
+ ui.MenuItem:new { Label = "Close all", Shortcut = "Shift+Ctrl+Q" },
ui.Spacer:new { },
ui.MenuItem:new {
- Label = "Quit",
- KeyCode = "Ctrl+Q",
+ Label = "_Quit",
+ Shortcut = "Ctrl+Q",
Notifications =
{
["Pressed"] =
diff -r 8aaf1a2e841d -r 6fe4c3fcf1ae tek/class/ui/menuitem.lua
--- a/tek/class/ui/menuitem.lua Tue May 13 18:08:58 2008 +0200
+++ b/tek/class/ui/menuitem.lua Tue May 13 18:16:07 2008 +0200
@@ -58,7 +58,7 @@ function MenuItem.init(self)
else
self.Mode = "button"
end
- self.KeyCode = self.KeyCode or false
+ self.Shortcut = self.Shortcut or false
self.TextHAlign = "left"
return PopItem.init(self)
end
@@ -99,9 +99,9 @@ function MenuItem:setupDisplay(display,
if PopItem.setupDisplay(self, display, drawable) then
self:setTextRecord(1, self.Label, self.FontSpec, "left")
- if self.KeyCode and self.Parent.Style ~= "menubar" and
+ if self.Shortcut and self.Parent.Style ~= "menubar" and
not self.Children then
- self:setTextRecord(2, self.KeyCode, self.FontSpec, "left")
+ self:setTextRecord(2, self.Shortcut, self.FontSpec, "left")
end
return true
end
More information about the tekui-devel
mailing list