more window stuff, still unfinished

This commit is contained in:
airstruck
2015-12-17 16:52:51 -05:00
parent f9924fb028
commit e2602348df
21 changed files with 634 additions and 151 deletions

View File

@@ -41,6 +41,7 @@
<li><a href="../widgets/status.html">status</a></li> <li><a href="../widgets/status.html">status</a></li>
<li><a href="../widgets/stepper.html">stepper</a></li> <li><a href="../widgets/stepper.html">stepper</a></li>
<li><a href="../widgets/text.html">text</a></li> <li><a href="../widgets/text.html">text</a></li>
<li><a href="../widgets/window.html">window</a></li>
</ul> </ul>
<h2>Modules</h2> <h2>Modules</h2>
<ul class="nowrap"> <ul class="nowrap">
@@ -157,7 +158,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-12-16 14:12:04 </i> <i style="float:right;">Last updated 2015-12-17 04:20:17 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@@ -41,6 +41,7 @@
<li><a href="../widgets/status.html">status</a></li> <li><a href="../widgets/status.html">status</a></li>
<li><a href="../widgets/stepper.html">stepper</a></li> <li><a href="../widgets/stepper.html">stepper</a></li>
<li><a href="../widgets/text.html">text</a></li> <li><a href="../widgets/text.html">text</a></li>
<li><a href="../widgets/window.html">window</a></li>
</ul> </ul>
<h2>Modules</h2> <h2>Modules</h2>
<ul class="nowrap"> <ul class="nowrap">
@@ -393,7 +394,7 @@ found, and focuses that widget.
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-12-16 14:12:04 </i> <i style="float:right;">Last updated 2015-12-17 04:20:17 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@@ -41,6 +41,7 @@
<li><a href="../widgets/status.html">status</a></li> <li><a href="../widgets/status.html">status</a></li>
<li><a href="../widgets/stepper.html">stepper</a></li> <li><a href="../widgets/stepper.html">stepper</a></li>
<li><a href="../widgets/text.html">text</a></li> <li><a href="../widgets/text.html">text</a></li>
<li><a href="../widgets/window.html">window</a></li>
</ul> </ul>
<h2>Modules</h2> <h2>Modules</h2>
<ul class="nowrap"> <ul class="nowrap">
@@ -870,7 +871,7 @@ This table is identical to the constructed widget.
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-12-16 14:12:04 </i> <i style="float:right;">Last updated 2015-12-17 04:20:17 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@@ -41,6 +41,7 @@
<li><a href="widgets/status.html">status</a></li> <li><a href="widgets/status.html">status</a></li>
<li><a href="widgets/stepper.html">stepper</a></li> <li><a href="widgets/stepper.html">stepper</a></li>
<li><a href="widgets/text.html">text</a></li> <li><a href="widgets/text.html">text</a></li>
<li><a href="widgets/window.html">window</a></li>
</ul> </ul>
<h2>Modules</h2> <h2>Modules</h2>
<ul class="nowrap"> <ul class="nowrap">
@@ -108,6 +109,10 @@
<td class="name" nowrap><a href="widgets/text.html">text</a></td> <td class="name" nowrap><a href="widgets/text.html">text</a></td>
<td class="summary">A text entry area.</td> <td class="summary">A text entry area.</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="widgets/window.html">window</a></td>
<td class="summary">Window widget.</td>
</tr>
</table> </table>
<h2>Modules</h2> <h2>Modules</h2>
<table class="module_list"> <table class="module_list">
@@ -136,7 +141,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-12-16 14:12:04 </i> <i style="float:right;">Last updated 2015-12-17 04:20:17 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@@ -41,6 +41,7 @@
<li><a href="../widgets/status.html">status</a></li> <li><a href="../widgets/status.html">status</a></li>
<li><a href="../widgets/stepper.html">stepper</a></li> <li><a href="../widgets/stepper.html">stepper</a></li>
<li><a href="../widgets/text.html">text</a></li> <li><a href="../widgets/text.html">text</a></li>
<li><a href="../widgets/window.html">window</a></li>
</ul> </ul>
<h2>Modules</h2> <h2>Modules</h2>
<ul class="nowrap"> <ul class="nowrap">
@@ -742,7 +743,7 @@ child widgets appear.
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-12-16 14:12:04 </i> <i style="float:right;">Last updated 2015-12-17 04:20:17 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@@ -41,6 +41,7 @@
<li><a href="../widgets/status.html">status</a></li> <li><a href="../widgets/status.html">status</a></li>
<li><a href="../widgets/stepper.html">stepper</a></li> <li><a href="../widgets/stepper.html">stepper</a></li>
<li><a href="../widgets/text.html">text</a></li> <li><a href="../widgets/text.html">text</a></li>
<li><a href="../widgets/window.html">window</a></li>
</ul> </ul>
<h2>Modules</h2> <h2>Modules</h2>
<ul class="nowrap"> <ul class="nowrap">
@@ -94,7 +95,7 @@ but themes should give buttons an appropriate appearance.</p>
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-12-16 14:12:04 </i> <i style="float:right;">Last updated 2015-12-17 04:20:17 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@@ -41,6 +41,7 @@
<li><a href="../widgets/status.html">status</a></li> <li><a href="../widgets/status.html">status</a></li>
<li><a href="../widgets/stepper.html">stepper</a></li> <li><a href="../widgets/stepper.html">stepper</a></li>
<li><a href="../widgets/text.html">text</a></li> <li><a href="../widgets/text.html">text</a></li>
<li><a href="../widgets/window.html">window</a></li>
</ul> </ul>
<h2>Modules</h2> <h2>Modules</h2>
<ul class="nowrap"> <ul class="nowrap">
@@ -79,7 +80,7 @@ standard themes, the widget's value should be indicated in some other way.</p>
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-12-16 14:12:04 </i> <i style="float:right;">Last updated 2015-12-17 04:20:17 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@@ -41,6 +41,7 @@
<li><a href="../widgets/status.html">status</a></li> <li><a href="../widgets/status.html">status</a></li>
<li><a href="../widgets/stepper.html">stepper</a></li> <li><a href="../widgets/stepper.html">stepper</a></li>
<li><a href="../widgets/text.html">text</a></li> <li><a href="../widgets/text.html">text</a></li>
<li><a href="../widgets/window.html">window</a></li>
</ul> </ul>
<h2>Modules</h2> <h2>Modules</h2>
<ul class="nowrap"> <ul class="nowrap">
@@ -75,7 +76,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-12-16 14:12:04 </i> <i style="float:right;">Last updated 2015-12-17 04:20:17 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@@ -41,6 +41,7 @@
<li><a href="../widgets/status.html">status</a></li> <li><a href="../widgets/status.html">status</a></li>
<li><a href="../widgets/stepper.html">stepper</a></li> <li><a href="../widgets/stepper.html">stepper</a></li>
<li><a href="../widgets/text.html">text</a></li> <li><a href="../widgets/text.html">text</a></li>
<li><a href="../widgets/window.html">window</a></li>
</ul> </ul>
<h2>Modules</h2> <h2>Modules</h2>
<ul class="nowrap"> <ul class="nowrap">
@@ -75,7 +76,7 @@ not be explicitly created.</p>
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-12-16 14:12:04 </i> <i style="float:right;">Last updated 2015-12-17 04:20:17 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@@ -41,6 +41,7 @@
<li><a href="../widgets/status.html">status</a></li> <li><a href="../widgets/status.html">status</a></li>
<li><a href="../widgets/stepper.html">stepper</a></li> <li><a href="../widgets/stepper.html">stepper</a></li>
<li><a href="../widgets/text.html">text</a></li> <li><a href="../widgets/text.html">text</a></li>
<li><a href="../widgets/window.html">window</a></li>
</ul> </ul>
<h2>Modules</h2> <h2>Modules</h2>
<ul class="nowrap"> <ul class="nowrap">
@@ -74,7 +75,7 @@ between 0 and 1 (inclusive) to change the width of the bar.</p>
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-12-16 14:12:04 </i> <i style="float:right;">Last updated 2015-12-17 04:20:17 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@@ -41,6 +41,7 @@
<li><a href="../widgets/status.html">status</a></li> <li><a href="../widgets/status.html">status</a></li>
<li><a href="../widgets/stepper.html">stepper</a></li> <li><a href="../widgets/stepper.html">stepper</a></li>
<li><a href="../widgets/text.html">text</a></li> <li><a href="../widgets/text.html">text</a></li>
<li><a href="../widgets/window.html">window</a></li>
</ul> </ul>
<h2>Modules</h2> <h2>Modules</h2>
<ul class="nowrap"> <ul class="nowrap">
@@ -111,7 +112,7 @@ in the same group change to <code>false</code>.
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-12-16 14:12:04 </i> <i style="float:right;">Last updated 2015-12-17 04:20:17 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@@ -41,6 +41,7 @@
<li><a href="../widgets/status.html">status</a></li> <li><a href="../widgets/status.html">status</a></li>
<li><a href="../widgets/stepper.html">stepper</a></li> <li><a href="../widgets/stepper.html">stepper</a></li>
<li><a href="../widgets/text.html">text</a></li> <li><a href="../widgets/text.html">text</a></li>
<li><a href="../widgets/window.html">window</a></li>
</ul> </ul>
<h2>Modules</h2> <h2>Modules</h2>
<ul class="nowrap"> <ul class="nowrap">
@@ -93,7 +94,7 @@ should have a specified <a href="../modules/attribute.html#width">width</a> attr
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-12-16 14:12:04 </i> <i style="float:right;">Last updated 2015-12-17 04:20:17 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@@ -41,6 +41,7 @@
<li><a href="../widgets/status.html">status</a></li> <li><a href="../widgets/status.html">status</a></li>
<li><a href="../widgets/stepper.html">stepper</a></li> <li><a href="../widgets/stepper.html">stepper</a></li>
<li><a href="../widgets/text.html">text</a></li> <li><a href="../widgets/text.html">text</a></li>
<li><a href="../widgets/window.html">window</a></li>
</ul> </ul>
<h2>Modules</h2> <h2>Modules</h2>
<ul class="nowrap"> <ul class="nowrap">
@@ -74,7 +75,7 @@ number between 0 and 1, inclusive.</p>
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-12-16 14:12:04 </i> <i style="float:right;">Last updated 2015-12-17 04:20:17 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@@ -41,6 +41,7 @@
<li><strong>status</strong></li> <li><strong>status</strong></li>
<li><a href="../widgets/stepper.html">stepper</a></li> <li><a href="../widgets/stepper.html">stepper</a></li>
<li><a href="../widgets/text.html">text</a></li> <li><a href="../widgets/text.html">text</a></li>
<li><a href="../widgets/window.html">window</a></li>
</ul> </ul>
<h2>Modules</h2> <h2>Modules</h2>
<ul class="nowrap"> <ul class="nowrap">
@@ -91,7 +92,7 @@ display status messages.</p>
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-12-16 14:12:04 </i> <i style="float:right;">Last updated 2015-12-17 04:20:17 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@@ -41,6 +41,7 @@
<li><a href="../widgets/status.html">status</a></li> <li><a href="../widgets/status.html">status</a></li>
<li><strong>stepper</strong></li> <li><strong>stepper</strong></li>
<li><a href="../widgets/text.html">text</a></li> <li><a href="../widgets/text.html">text</a></li>
<li><a href="../widgets/window.html">window</a></li>
</ul> </ul>
<h2>Modules</h2> <h2>Modules</h2>
<ul class="nowrap"> <ul class="nowrap">
@@ -124,7 +125,7 @@ item displayed in the content area.</p>
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-12-16 14:12:04 </i> <i style="float:right;">Last updated 2015-12-17 04:20:17 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@@ -41,6 +41,7 @@
<li><a href="../widgets/status.html">status</a></li> <li><a href="../widgets/status.html">status</a></li>
<li><a href="../widgets/stepper.html">stepper</a></li> <li><a href="../widgets/stepper.html">stepper</a></li>
<li><strong>text</strong></li> <li><strong>text</strong></li>
<li><a href="../widgets/window.html">window</a></li>
</ul> </ul>
<h2>Modules</h2> <h2>Modules</h2>
<ul class="nowrap"> <ul class="nowrap">
@@ -104,7 +105,7 @@
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-12-16 14:12:04 </i> <i style="float:right;">Last updated 2015-12-17 04:20:17 </i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

392
doc/widgets/window.html Normal file
View File

@@ -0,0 +1,392 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css">
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<h1>LUIGI</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Widgets</h2>
<ul class="nowrap">
<li><a href="../widgets/button.html">button</a></li>
<li><a href="../widgets/check.html">check</a></li>
<li><a href="../widgets/menu.html">menu</a></li>
<li><a href="../widgets/menu.item.html">menu.item</a></li>
<li><a href="../widgets/progress.html">progress</a></li>
<li><a href="../widgets/radio.html">radio</a></li>
<li><a href="../widgets/sash.html">sash</a></li>
<li><a href="../widgets/slider.html">slider</a></li>
<li><a href="../widgets/status.html">status</a></li>
<li><a href="../widgets/stepper.html">stepper</a></li>
<li><a href="../widgets/text.html">text</a></li>
<li><strong>window</strong></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/attribute.html">attribute</a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><a href="../classes/Event.html">Event</a></li>
<li><a href="../classes/Layout.html">Layout</a></li>
<li><a href="../classes/Widget.html">Widget</a></li>
</ul>
</div>
<div id="content">
<div id="content_top">
<h1>Widget <code>window</code></h1>
<p>Window widget.</p>
<p>Set properties of the window with this widget's attributes.
This widget should only be used as the root widget of a layout.</p>
<h3>Usage:</h3>
<ul>
<pre class="example">
<span class="comment">-- create a new window
</span><span class="keyword">local</span> window = Layout {
<span class="global">type</span> = <span class="string">'window'</span>,
icon = <span class="string">'logo.png'</span>,
text = <span class="string">'Window Example'</span>,
width = <span class="number">800</span>,
height = <span class="number">600</span>,
{ icon = <span class="string">'logo.png'</span>, text = <span class="string">'Window Example'</span>, align = <span class="string">'middle center'</span> },
{ <span class="global">type</span> = <span class="string">'panel'</span>, flow = <span class="string">'x'</span>, height = <span class="string">'auto'</span>,
{}, <span class="comment">-- spacer
</span> { <span class="global">type</span> = <span class="string">'button'</span>, id = <span class="string">'quitButton'</span>, text = <span class="string">'Quit'</span> }
}
}
<span class="comment">-- handle quit button
</span>window.quitButton:onPress(<span class="keyword">function</span> ()
<span class="global">os</span>.exit()
<span class="keyword">end</span>)
<span class="comment">-- show the window
</span>window:show()</pre>
</ul>
<h2><a href="#Special_Attributes">Special Attributes </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#maximized">maximized</a></td>
<td class="summary">Maximized.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#minimized">minimized</a></td>
<td class="summary">Minimized.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#borderless">borderless</a></td>
<td class="summary">Borderless.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#fullscreen">fullscreen</a></td>
<td class="summary">Fullscreen.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#grab">grab</a></td>
<td class="summary">Mouse grab.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#icon">icon</a></td>
<td class="summary">Window icon.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#maxwidth">maxwidth</a></td>
<td class="summary">Maximum width of the window's client area.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#maxheight">maxheight</a></td>
<td class="summary">Maximum height of the window's client area.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#minwidth">minwidth</a></td>
<td class="summary">Minimum width of the window's client area.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#minheight">minheight</a></td>
<td class="summary">Minimum height of the window's client area.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#top">top</a></td>
<td class="summary">Position of the window's top edge.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#left">left</a></td>
<td class="summary">Position of the window's left edge.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#width">width</a></td>
<td class="summary">Width of the window's content area.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#height">height</a></td>
<td class="summary">Height of the window's content area.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#title">title</a></td>
<td class="summary">Title of the window.</td>
</tr>
</table>
</div>
<h2 class="section-header "><a name="Special_Attributes"></a>Special Attributes </h2>
<dl class="function">
<dt>
<a name = "maximized"></a>
<strong>maximized</strong>
</dt>
<dd>
Maximized. Set to <code>true</code> to make the window as large as possible.
Set to <code>false</code> to restore the size and position.
</dd>
<dt>
<a name = "minimized"></a>
<strong>minimized</strong>
</dt>
<dd>
Minimized. Set to <code>true</code> to minimize the window to an iconic representation.
Set to <code>false</code> to restore the size and position.
</dd>
<dt>
<a name = "borderless"></a>
<strong>borderless</strong>
</dt>
<dd>
Borderless. Set to <code>true</code> or <code>false</code> to change the border state of the window.
You can't change the border state of a fullscreen window.
</dd>
<dt>
<a name = "fullscreen"></a>
<strong>fullscreen</strong>
</dt>
<dd>
Fullscreen. Set to <code>true</code> or <code>false</code> to change the fullscreen state
of the window.
</dd>
<dt>
<a name = "grab"></a>
<strong>grab</strong>
</dt>
<dd>
Mouse grab. Set to <code>true</code> or <code>false</code> to change the window's input grab mode.
When input is grabbed the mouse is confined to the window.</p>
<p>If the caller enables a grab while another window is currently grabbed,
the other window loses its grab in favor of the caller's window.
</dd>
<dt>
<a name = "icon"></a>
<strong>icon</strong>
</dt>
<dd>
Window icon. Should be a string containing a path to an image.
</dd>
<dt>
<a name = "maxwidth"></a>
<strong>maxwidth</strong>
</dt>
<dd>
Maximum width of the window's client area.
</dd>
<dt>
<a name = "maxheight"></a>
<strong>maxheight</strong>
</dt>
<dd>
Maximum height of the window's client area.
</dd>
<dt>
<a name = "minwidth"></a>
<strong>minwidth</strong>
</dt>
<dd>
Minimum width of the window's client area.
</dd>
<dt>
<a name = "minheight"></a>
<strong>minheight</strong>
</dt>
<dd>
Minimum height of the window's client area.
</dd>
<dt>
<a name = "top"></a>
<strong>top</strong>
</dt>
<dd>
Position of the window's top edge.
</dd>
<dt>
<a name = "left"></a>
<strong>left</strong>
</dt>
<dd>
Position of the window's left edge.
</dd>
<dt>
<a name = "width"></a>
<strong>width</strong>
</dt>
<dd>
Width of the window's content area.
</dd>
<dt>
<a name = "height"></a>
<strong>height</strong>
</dt>
<dd>
Height of the window's content area.
</dd>
<dt>
<a name = "title"></a>
<strong>title</strong>
</dt>
<dd>
Title of the window.
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-12-17 04:20:17 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,4 +1,5 @@
local Layout = require 'luigi.layout' local Layout = require 'luigi.layout'
local Backend = require 'luigi.backend'
local window = Layout { local window = Layout {
type = 'window', type = 'window',
@@ -10,9 +11,21 @@ local window = Layout {
minheight = 100, minheight = 100,
maxwidth = 640, maxwidth = 640,
maxheight = 480, maxheight = 480,
{ type = 'button', id = 'maximize', text = 'Maximize' },
{ type = 'button', id = 'minimize', text = 'Minimize' },
{ type = 'button', id = 'restore', text = 'Restore' },
} }
window.maximize:onPress(function ()
window.root.maximized = true
end)
window.minimize:onPress(function ()
window.root.minimized = true
end)
window.restore:onPress(function ()
window.root.maximized = false
end)
window:show() window:show()
require 'luigi.backend'.run() Backend.run()

View File

@@ -15,9 +15,10 @@ local IntOut = ffi.typeof 'int[1]'
local stack = {} local stack = {}
-- create window and renderer -- create window and renderer
sdl.setHint(sdl.HINT_VIDEO_ALLOW_SCREENSAVER, '1') sdl.enableScreenSaver()
local window = sdl.createWindow('', 0, 0, 800, 600, local window = sdl.createWindow('',
sdl.WINDOWPOS_CENTERED, sdl.WINDOWPOS_CENTERED, 800, 600,
sdl.WINDOW_SHOWN + sdl.WINDOW_RESIZABLE) sdl.WINDOW_SHOWN + sdl.WINDOW_RESIZABLE)
if window == nil then if window == nil then
@@ -337,22 +338,54 @@ function Backend.show (layout)
end) end)
end end
function Backend.getWindowMaximized ()
local flags = sdl.getWindowFlags(window)
return bit.band(flags, sdl.WINDOW_MAXIMIZED) ~= 0
end
function Backend.setWindowMaximized (maximized) function Backend.setWindowMaximized (maximized)
return maximized and sdl.maximizeWindow(window) or sdl.restoreWindow(window) if maximized then
sdl.maximizeWindow(window)
else
sdl.restoreWindow(window)
end
end
function Backend.getWindowMinimized ()
local flags = sdl.getWindowFlags(window)
return bit.band(flags, sdl.WINDOW_MINIMIZED) ~= 0
end end
function Backend.setWindowMinimized (minimized) function Backend.setWindowMinimized (minimized)
return minimized and sdl.minimizeWindow(window) or sdl.restoreWindow(window) if minimized then
sdl.minimizeWindow(window)
else
sdl.restoreWindow(window)
end
end
function Backend.getWindowBorderless ()
local flags = sdl.getWindowFlags(window)
return bit.band(flags, sdl.WINDOW_BORDERLESS) ~= 0
end end
function Backend.setWindowBorderless (borderless) function Backend.setWindowBorderless (borderless)
return sdl.setWindowBordered(window, not borderless) return sdl.setWindowBordered(window, not borderless)
end end
function Backend.getWindowFullscreen ()
local flags = sdl.getWindowFlags(window)
return bit.band(flags, sdl.WINDOW_FULLSCREEN) ~= 0
end
function Backend.setWindowFullscreen (fullscreen) function Backend.setWindowFullscreen (fullscreen)
return sdl.setWindowFullscreen(window, not not fullscreen) return sdl.setWindowFullscreen(window, not not fullscreen)
end end
function Backend.getWindowGrab ()
return sdl.getWindowGrab(window)
end
function Backend.setWindowGrab (grab) function Backend.setWindowGrab (grab)
return sdl.setWindowGrab(window, not not grab) return sdl.setWindowGrab(window, not not grab)
end end
@@ -366,56 +399,108 @@ function Backend.setWindowIcon (icon)
if surface == nil then if surface == nil then
error(ffi.string(sdl.getError())) error(ffi.string(sdl.getError()))
end end
sdl.setWindowIcon(window, surface) sdl.setWindowIcon(window, surface)
end end
function Backend.getWindowMaxwidth ()
local w, h = IntOut(), IntOut()
sdl.getWindowMaximumSize(window, w, h)
return w[0]
end
function Backend.setWindowMaxwidth (maxwidth) function Backend.setWindowMaxwidth (maxwidth)
local w, h = IntOut(), IntOut() local w, h = IntOut(), IntOut()
sdl.getWindowMaximumSize(window, w, h) sdl.getWindowMaximumSize(window, w, h)
sdl.setWindowMaximumSize(window, maxwidth, h[0] ~= nil and h[0] or math.huge) sdl.setWindowMaximumSize(window, maxwidth, h[0] or 16384)
end
function Backend.getWindowMaxheight ()
local w, h = IntOut(), IntOut()
sdl.getWindowMaximumSize(window, w, h)
return h[0]
end end
function Backend.setWindowMaxheight (maxheight) function Backend.setWindowMaxheight (maxheight)
local w, h = IntOut(), IntOut() local w, h = IntOut(), IntOut()
sdl.getWindowMaximumSize(window, w, h) sdl.getWindowMaximumSize(window, w, h)
sdl.setWindowMaximumSize(window, w[0] ~= nil and w[0] or math.huge, maxheight) sdl.setWindowMaximumSize(window, w[0] or 16384, maxheight)
end
function Backend.getWindowMinwidth ()
local w, h = IntOut(), IntOut()
sdl.getWindowMinimumSize(window, w, h)
return w[0]
end end
function Backend.setWindowMinwidth (minwidth) function Backend.setWindowMinwidth (minwidth)
local w, h = IntOut(), IntOut() local w, h = IntOut(), IntOut()
sdl.getWindowMinimumSize(window, w, h) sdl.getWindowMinimumSize(window, w, h)
sdl.setWindowMinimumSize(window, minwidth, h[0] ~= nil and h[0] or 0) sdl.setWindowMinimumSize(window, minwidth, h[0] or 0)
end
function Backend.getWindowMinheight ()
local w, h = IntOut(), IntOut()
sdl.getWindowMinimumSize(window, w, h)
return h[0]
end end
function Backend.setWindowMinheight (minheight) function Backend.setWindowMinheight (minheight)
local w, h = IntOut(), IntOut() local w, h = IntOut(), IntOut()
sdl.getWindowMinimumSize(window, w, h) sdl.getWindowMinimumSize(window, w, h)
sdl.setWindowMinimumSize(window, w[0] ~= nil and w[0] or 0, minheight) sdl.setWindowMinimumSize(window, w[0] or 0, minheight)
end
function Backend.getWindowTop ()
local x, y = IntOut(), IntOut()
sdl.getWindowPosition(window, x, y)
return y[0]
end end
function Backend.setWindowTop (top) function Backend.setWindowTop (top)
local x, y = IntOut(), IntOut() local x, y = IntOut(), IntOut()
sdl.getWindowPosition(window, x, y) sdl.getWindowPosition(window, x, y)
sdl.setWindowPosition(window, x[0] ~= nil and x[0] or 0, top) sdl.setWindowPosition(window, x[0] or 0, top)
end
function Backend.getWindowLeft ()
local x, y = IntOut(), IntOut()
sdl.getWindowPosition(window, x, y)
return x[0]
end end
function Backend.setWindowLeft (left) function Backend.setWindowLeft (left)
local x, y = IntOut(), IntOut() local x, y = IntOut(), IntOut()
sdl.getWindowPosition(window, x, y) sdl.getWindowPosition(window, x, y)
sdl.setWindowPosition(window, left, y[0] ~= nil and y[0] or 0) sdl.setWindowPosition(window, left, y[0] or 0)
end
function Backend.getWindowWidth ()
local w, h = IntOut(), IntOut()
sdl.getWindowSize(window, w, h)
return w[0]
end end
function Backend.setWindowWidth (width) function Backend.setWindowWidth (width)
local w, h = IntOut(), IntOut() local w, h = IntOut(), IntOut()
sdl.getWindowSize(window, w, h) sdl.getWindowSize(window, w, h)
sdl.setWindowSize(window, width, h[0] ~= nil and h[0] or 600) sdl.setWindowSize(window, width, h[0] or 600)
end
function Backend.getWindowHeight ()
local w, h = IntOut(), IntOut()
sdl.getWindowSize(window, w, h)
return h[0]
end end
function Backend.setWindowHeight (height) function Backend.setWindowHeight (height)
local w, h = IntOut(), IntOut() local w, h = IntOut(), IntOut()
sdl.getWindowSize(window, w, h) sdl.getWindowSize(window, w, h)
sdl.setWindowSize(window, w[0] ~= nil and w[0] or 800, height) sdl.setWindowSize(window, w[0] or 800, height)
end
function Backend.getWindowTitle (title)
return sdl.getWindowTitle(window)
end end
function Backend.setWindowTitle (title) function Backend.setWindowTitle (title)

View File

@@ -214,8 +214,15 @@ function Input:handleReshape (layout, width, height)
local root = layout.root local root = layout.root
root:reshape() root:reshape()
root.dimensions.width = width
root.dimensions.height = height if root.type ~= 'window' then
if not root.width then
root.dimensions.width = width
end
if not root.height then
root.dimensions.height = height
end
end
Event.Reshape:emit(layout, { target = layout }) Event.Reshape:emit(layout, { target = layout })
end end

View File

@@ -7,7 +7,7 @@ This widget should only be used as the root widget of a layout.
@usage @usage
-- create a new window -- create a new window
local window = Layout { local window = Layout {
type = 'window', type = 'window',
icon = 'logo.png', icon = 'logo.png',
text = 'Window Example', text = 'Window Example',
width = 800, width = 800,
@@ -42,244 +42,210 @@ Special Attributes
--]]-- --]]--
--[[-- --[[--
Maximized. Maximized. Set to `true` to make the window as large as possible.
Set to `false` to restore the size and position.
@attrib maximized @attrib maximized
--]]-- --]]--
local maximized
self:defineAttribute('maximized', { self:defineAttribute('maximized', {
set = function (_, value) set = function (_, value)
if not value then return end if value == nil then return end
maximized = value Backend.setWindowMaximized(value)
Backend.setWindowMaximized(maximized) end,
end, get = Backend.getWindowMaximized
get = function () return maximized end
}) })
--[[-- --[[--
Minimized. Minimized. Set to `true` to minimize the window to an iconic representation.
Set to `false` to restore the size and position.
@attrib minimized @attrib minimized
--]]-- --]]--
local minimized
self:defineAttribute('minimized', { self:defineAttribute('minimized', {
set = function (_, value) set = function (_, value)
if not value then return end if value == nil then return end
minimized = value Backend.setWindowMinimized(value)
Backend.setWindowMinimized(minimized) end,
end, get = Backend.getWindowMinimized
get = function () return minimized end
}) })
--[[-- --[[--
Borderless. Borderless. Set to `true` or `false` to change the border state of the window.
You can't change the border state of a fullscreen window.
@attrib borderless @attrib borderless
--]]-- --]]--
local borderless
self:defineAttribute('borderless', { self:defineAttribute('borderless', {
set = function (_, value) set = function (_, value)
if not value then return end if value == nil then return end
borderless = value Backend.setWindowBorderless(value)
Backend.setWindowBorderless(borderless) end,
end, get = Backend.getWindowBorderless
get = function () return borderless end
}) })
--[[-- --[[--
Fullscreen. Fullscreen. Set to `true` or `false` to change the fullscreen state
of the window.
@attrib fullscreen @attrib fullscreen
--]]-- --]]--
local fullscreen
self:defineAttribute('fullscreen', { self:defineAttribute('fullscreen', {
set = function (_, value) set = function (_, value)
if not value then return end if value == nil then return end
fullscreen = value Backend.setWindowFullscreen(value)
Backend.setWindowFullscreen(fullscreen) end,
end, get = Backend.getWindowFullscreen
get = function () return fullscreen end
}) })
--[[-- --[[--
Grab mouse. Mouse grab. Set to `true` or `false` to change the window's input grab mode.
When input is grabbed the mouse is confined to the window.
If the caller enables a grab while another window is currently grabbed,
the other window loses its grab in favor of the caller's window.
@attrib grab @attrib grab
--]]-- --]]--
local grab
self:defineAttribute('grab', { self:defineAttribute('grab', {
set = function (_, value) set = function (_, value)
if not value then return end if value == nil then return end
grab = value Backend.setWindowGrab(value)
Backend.setWindowGrab(grab) end,
end, get = Backend.getWindowGrab
get = function () return grab end
}) })
--[[-- --[[--
Icon. Window icon. Should be a string containing a path to an image.
@attrib icon @attrib icon
--]]-- --]]--
local icon local icon
self:defineAttribute('icon', { self:defineAttribute('icon', {
set = function (_, value) set = function (_, value)
if not value then return end if value == nil then return end
icon = value icon = value
Backend.setWindowIcon(icon) Backend.setWindowIcon(value)
end, end,
get = function () return icon end get = function () return icon end
}) })
self.attributes.icon = nil self.attributes.icon = nil
--[[-- --[[--
Maximum width. Maximum width of the window's client area.
@attrib maxwidth @attrib maxwidth
--]]-- --]]--
local maxwidth
self:defineAttribute('maxwidth', { self:defineAttribute('maxwidth', {
set = function (_, value) set = function (_, value)
if not value then return end if value == nil then return end
maxwidth = value Backend.setWindowMaxwidth(value)
Backend.setWindowMaxwidth(maxwidth) end,
end, get = Backend.getWindowMaxwidth
get = function () return maxwidth end
}) })
--[[-- --[[--
Maximum height. Maximum height of the window's client area.
@attrib maxheight @attrib maxheight
--]]-- --]]--
local maxheight
self:defineAttribute('maxheight', { self:defineAttribute('maxheight', {
set = function (_, value) set = function (_, value)
if not value then return end if value == nil then return end
maxheight = value Backend.setWindowMaxheight(value)
Backend.setWindowMaxheight(maxheight) end,
end, get = Backend.getWindowMaxheight
get = function () return maxheight end
}) })
--[[-- --[[--
Minimum width. Minimum width of the window's client area.
@attrib minwidth @attrib minwidth
--]]-- --]]--
local minwidth
self:defineAttribute('minwidth', { self:defineAttribute('minwidth', {
set = function (_, value) set = function (_, value)
if not value then return end if value == nil then return end
minwidth = value Backend.setWindowMinwidth(value)
Backend.setWindowMinwidth(minwidth) end,
end, get = Backend.getWindowMinwidth
get = function () return minwidth end
}) })
--[[-- --[[--
Minimum height. Minimum height of the window's client area.
@attrib minheight @attrib minheight
--]]-- --]]--
local minheight
self:defineAttribute('minheight', { self:defineAttribute('minheight', {
set = function (_, value) set = function (_, value)
if not value then return end if value == nil then return end
minheight = value Backend.setWindowMinheight(value)
Backend.setWindowMinheight(minheight) end,
end, get = Backend.getWindowMinheight
get = function () return minheight end
}) })
--[[-- --[[--
Top position. Position of the window's top edge.
@attrib top @attrib top
--]]-- --]]--
local top
self:defineAttribute('top', { self:defineAttribute('top', {
set = function (_, value) set = function (_, value)
if not value then return end if value == nil then return end
top = value Backend.setWindowTop(value)
Backend.setWindowTop(top) end,
end, get = Backend.getWindowTop
get = function () return top end
}) })
--[[-- --[[--
Left position. Position of the window's left edge.
@attrib left @attrib left
--]]-- --]]--
local left
self:defineAttribute('left', { self:defineAttribute('left', {
set = function (_, value) set = function (_, value)
if not value then return end if value == nil then return end
left = value Backend.setWindowLeft(value)
Backend.setWindowLeft(left) end,
end, get = Backend.getWindowLeft
get = function () return left end
}) })
--[[-- --[[--
Width. Width of the window's content area.
@attrib width @attrib width
--]]-- --]]--
local width
self:defineAttribute('width', { self:defineAttribute('width', {
set = function (_, value) set = function (_, value)
if not value then return end if value == nil then return end
width = value Backend.setWindowWidth(value)
Backend.setWindowWidth(width) end,
end, get = Backend.getWindowWidth
get = function () return width end
}) })
--[[-- --[[--
Height. Height of the window's content area.
@attrib height @attrib height
--]]-- --]]--
local height
self:defineAttribute('height', { self:defineAttribute('height', {
set = function (_, value) set = function (_, value)
if not value then return end if value == nil then return end
height = value Backend.setWindowHeight(value)
Backend.setWindowHeight(height) end,
end, get = Backend.getWindowHeight
get = function () return height end
}) })
--[[-- --[[--
Title. Title of the window.
@attrib title @attrib title
--]]-- --]]--
local title
self:defineAttribute('title', { self:defineAttribute('title', {
set = function (_, value) set = function (_, value)
if not value then return end if value == nil then return end
title = value Backend.setWindowTitle(value)
Backend.setWindowTitle(title) end,
end, get = Backend.getWindowTitle
get = function () return title end
}) })
--[[-- --[[--