[tekui-devel] tekui: ui: Added extractKeyCode(); Application, DirList: file re...

Timm S. Mueller tmueller at schulze-mueller.de
Tue Sep 9 01:17:15 CEST 2008


details:   http://hg.teklib.org/tekui/rev/93d71ccb86a4
changeset: 14:93d71ccb86a4
user:      Timm S. Mueller <tmueller at schulze-mueller.de>
date:      Tue Sep 09 01:09:10 2008 +0200
description:
ui: Added extractKeyCode(); Application, DirList: file requester localized;
PageGroup, PopItem: cleanup; PopList: onSelectEntry() handler now updates text
in base item; Theme, internal.css: small changes in default style sheet;
PageGroup: onSetPageNumber() handler added

diffs (truncated from 1716 to 100 lines):

diff -r 43783e408b62 -r 93d71ccb86a4 bin/filereq.lua
--- a/bin/filereq.lua	Sat Sep 06 12:43:59 2008 +0200
+++ b/bin/filereq.lua	Tue Sep 09 01:09:10 2008 +0200
@@ -2,13 +2,20 @@
 
 local ui = require "tek.ui"
 
+local APP_ID = "tekui-demo"
+local VENDOR = "schulze-mueller.de"
+
+local L = ui.getLocale(APP_ID, VENDOR)
+
 app = ui.Application:new
 {
+	ApplicationId = APP_ID,
+	VendorDomain = VENDOR,
 	Children =
 	{
 		ui.Window:new
 		{
-			Title = "File Request",
+			Title = L.FILE_REQUEST,
 			Orientation = "vertical",
 			Children =
 			{
@@ -20,7 +27,7 @@ app = ui.Application:new
 					{
 						ui.Text:new
 						{
-							Text = "_Path:",
+							Text = L.PATH,
 							Width = "auto",
 							Class = "caption",
 							HAlign = "right",
@@ -29,11 +36,11 @@ app = ui.Application:new
 						{
 							Id = "pathfield",
 							Text = "/home",
-							KeyCode = "p",
+							KeyCode = ui.extractKeyCode(L.PATH),
 						},
 						ui.Text:new
 						{
-							Text = "Selected:",
+							Text = L.SELECTED,
 							Width = "auto",
 							Class = "caption",
 							HAlign = "right",
@@ -44,7 +51,7 @@ app = ui.Application:new
 						},
 						ui.Text:new
 						{
-							Text = "Status:",
+							Text = L.STATUS,
 							Width = "auto",
 							Class = "caption",
 							HAlign = "right",
@@ -56,7 +63,7 @@ app = ui.Application:new
 						},
 						ui.Text:new
 						{
-							Text = "_Multiselect:",
+							Text = L.MULTISELECT,
 							Width = "auto",
 							Class = "caption",
 							HAlign = "right",
@@ -64,14 +71,14 @@ app = ui.Application:new
 						ui.CheckMark:new
 						{
 							Id = "multiselect",
-							KeyCode = "m",
+							KeyCode = ui.extractKeyCode(L.MULTISELECT),
 							VAlign = "center",
 						},
 					}
 				},
 				ui.Text:new
 				{
-					Text = "_Choose File...",
+					Text = L.CHOOSE_FILE,
 					Class = "button",
 					Mode = "button",
 					Width = "auto",
@@ -89,12 +96,14 @@ app = ui.Application:new
 									local status, path, select = self:requestFile
 									{
 										Path = pathfield.Text,
-										SelectMode = self:getElementById("multiselect").Selected and "multi" or "single"
+										SelectMode = self:getElementById("multiselect").Selected and
+											"multi" or "single"
 									}
 									statusfield:setValue("Text", status)
 									if status == "selected" then
 										pathfield:setValue("Text", path)
-										self:getElementById("filefield"):setValue("Text", table.concat(select, ", "))
+										self:getElementById("filefield"):setValue("Text",
+											table.concat(select, ", "))
 									end
 								end }
 							}


More information about the tekui-devel mailing list