[tekui-devel] tekui: Application: added easyRequest(), multiple modal windows ...

Timm S. Mueller tmueller at schulze-mueller.de
Wed Oct 8 01:43:51 CEST 2008


details:   http://hg.teklib.org/tekui/rev/a8765b5a6b1b
changeset: 25:a8765b5a6b1b
user:      Timm S. Mueller <tmueller at schulze-mueller.de>
date:      Wed Oct 08 00:53:52 2008 +0200
description:
Application: added easyRequest(), multiple modal windows are now supported;
DirList: no longer reactivates selection in its DoubleClick handler;
ListGadget: added DoubleClick handler to handle reactivation, fixed more
problems in selection input handling; Window: improved stability

diffs (truncated from 449 to 100 lines):

diff -r becff9f87925 -r a8765b5a6b1b bin/demo.lua
--- a/bin/demo.lua	Tue Oct 07 01:08:48 2008 +0200
+++ b/bin/demo.lua	Wed Oct 08 00:53:52 2008 +0200
@@ -68,6 +68,16 @@ end
 -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 --	Application:
 -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+local QuitNotification =
+{
+	ui.NOTIFY_APPLICATION, ui.NOTIFY_COROUTINE, function(self)
+		if self:easyRequest(false, L.CONFIRM_QUIT_APPLICATION,
+			L.QUIT, L.CANCEL) == 1 then
+			self:setValue("Status", "quit")
+		end
+	end
+}
 
 app = ui.Application:new
 {
@@ -483,9 +493,7 @@ app = ui.Application:new
 										{
 											[false] =
 											{
-												{
-													ui.NOTIFY_APPLICATION, "setValue", "Status", "quit"
-												}
+												QuitNotification
 											},
 										},
 									},
diff -r becff9f87925 -r a8765b5a6b1b doc/manual.html
--- a/doc/manual.html	Tue Oct 07 01:08:48 2008 +0200
+++ b/doc/manual.html	Wed Oct 08 00:53:52 2008 +0200
@@ -419,7 +419,7 @@
 			</p>
 			<hr />
 		</div>
-		<div class="node"><h2><a name="tek.ui.class.dirlist" id="tek.ui.class.dirlist">DirList (v8.1)</a></h2>
+		<div class="node"><h2><a name="tek.ui.class.dirlist" id="tek.ui.class.dirlist">DirList (v8.2)</a></h2>
 			<div class="definition"><dfn>LINEAGE</dfn>
 				<blockquote>
 					<p>
@@ -624,7 +624,7 @@
 			</p>
 			<hr />
 		</div>
-		<div class="node"><h2><a name="tek.ui.class.application" id="tek.ui.class.application">Application (v7.1)</a></h2>
+		<div class="node"><h2><a name="tek.ui.class.application" id="tek.ui.class.application">Application (v8.0)</a></h2>
 			<div class="definition"><dfn>LINEAGE</dfn>
 				<blockquote>
 					<p>
@@ -766,6 +766,9 @@
 							<a href="#Application:connect"><code>Application:connect()</code></a> - connects children recursively
 						</li>
 						<li style="list-style-type: none">
+							<a href="#Application:easyRequest"><code>Application:easyRequest()</code></a> - opens a message box
+						</li>
+						<li style="list-style-type: none">
 							<a href="#Application:getElementById"><code>Application:getElementById()</code></a> - returns an element by Id
 						</li>
 						<li style="list-style-type: none">
@@ -879,6 +882,19 @@
 				&quot;cancelled&quot;. If the status is &quot;selected&quot;, the second return value is
 				the path where the requester was left, and the third value is a table
 				of the items that were selected.
+				Note: The caller of this function must be running in a coroutine
+				(see <a href="#Application:addCoroutine"><code>Application:addCoroutine()</code></a>).
+			</p>
+			<hr />
+		</div>
+		<div class="node"><h3><a name="Application:easyRequest" id="Application:easyRequest"><code>selected = Application:easyRequest(title, text, buttontext1[, ...])</code></a></h3>
+			<p>
+				Show requester. <code>title</code> will be displayed as the window title; if this
+				argument is <strong>false</strong>, the application's <code>ProgramName</code> will be used
+				for the title. <code>text</code> (which may contain line breaks) will be used as
+				the requester's body. Buttons are ordered from left to right. The first
+				button has the number 1. If the window is closed using the Escape key
+				or close button, the return value will be <code>false</code>.
 				Note: The caller of this function must be running in a coroutine
 				(see <a href="#Application:addCoroutine"><code>Application:addCoroutine()</code></a>).
 			</p>
@@ -4341,7 +4357,7 @@
 			</p>
 			<hr />
 		</div>
-		<div class="node"><h2><a name="tek.ui.class.listgadget" id="tek.ui.class.listgadget">ListGadget (v13.4)</a></h2>
+		<div class="node"><h2><a name="tek.ui.class.listgadget" id="tek.ui.class.listgadget">ListGadget (v13.5)</a></h2>
 			<div class="definition"><dfn>LINEAGE</dfn>
 				<blockquote>
 					<p>
@@ -4823,7 +4839,7 @@
 			</p>
 			<hr />
 		</div>
-		<div class="node"><h2><a name="tek.ui.class.window" id="tek.ui.class.window">Window (v7.4)</a></h2>
+		<div class="node"><h2><a name="tek.ui.class.window" id="tek.ui.class.window">Window (v7.5)</a></h2>
 			<div class="definition"><dfn>LINEAGE</dfn>
 				<blockquote>
 					<p>


More information about the tekui-devel mailing list