dlangui/docs/layouts.html

125 lines
4.3 KiB
HTML

<html><head>
<META http-equiv="content-type" content="text/html; charset=utf-8">
<title>dlangui.widgets.layouts</title>
</head><body>
<h1>dlangui.widgets.layouts</h1>
<!-- Generated by Ddoc from src/dlangui/widgets/layouts.d -->
DLANGUI library.
<br><br>
This module contains common <u>layouts</u> implementations.
<br><br>
Layouts are similar to the same in Android.
<br><br>
LinearLayout - either VerticalLayout or HorizontalLayout.
VerticalLayout - just LinearLayout with orientation=Orientation.Vertical
HorizontalLayout - just LinearLayout with orientation=Orientation.Vertical
FrameLayout - children occupy the same place, usually one one is visible at a time
TableLayout - children aligned into rows and columns
<br><br>
<br><br>
<b>Synopsis:</b><br>
<pre class="d_code"><font color=blue>import</font> dlangui.widgets.<u>layouts</u>;
</pre>
<br><br>
<b>License:</b><br>
Boost License 1.0
<br><br>
<b>Authors:</b><br>
Vadim Lopatin, coolreader.org@gmail.com<br><br>
<dl><dt><big><a name="LayoutItem"></a>struct <u>LayoutItem</u>;
</big></dt>
<dd>helper for layouts<br><br>
<dl><dt><big><a name="LayoutItem.set"></a>void <u>set</u>(Widget <i>widget</i>, Orientation <i>orientation</i>);
</big></dt>
<dd>sets item for <i>widget</i><br><br>
</dd>
<dt><big><a name="LayoutItem.measure"></a>void <u>measure</u>(int <i>parentWidth</i>, int <i>parentHeight</i>);
</big></dt>
<dd>set item and <u>measure</u> it<br><br>
</dd>
</dl>
</dd>
<dt><big><a name="LayoutItems"></a>class <u>LayoutItems</u>;
</big></dt>
<dd>helper class for layouts<br><br>
<dl><dt><big><a name="LayoutItems.measure"></a>Point <u>measure</u>(int <i>parentWidth</i>, int <i>parentHeight</i>);
</big></dt>
<dd>fill widget layout list with Visible or Invisible items, <u>measure</u> them<br><br>
</dd>
<dt><big><a name="LayoutItems.setWidgets"></a>void <u>setWidgets</u>(ref WidgetList <i>widgets</i>);
</big></dt>
<dd>fill widget layout list with Visible or Invisible items, measure them<br><br>
</dd>
</dl>
</dd>
<dt><big><a name="FrameLayout"></a>class <u>FrameLayout</u>: dlangui.widgets.widget.WidgetGroup;
</big></dt>
<dd>place all children into same place (usually, only one child should be visible at a time)<br><br>
<dl><dt><big><a name="FrameLayout.measure"></a>void <u>measure</u>(int <i>parentWidth</i>, int <i>parentHeight</i>);
</big></dt>
<dd>Measure widget according to desired width and height constraints. (Step 1 of two phase layout).<br><br>
</dd>
<dt><big><a name="FrameLayout.layout"></a>void <u>layout</u>(Rect <i>rc</i>);
</big></dt>
<dd>Set widget rectangle to specified value and <u>layout</u> widget contents. (Step 2 of two phase <u>layout</u>).<br><br>
</dd>
<dt><big><a name="FrameLayout.onDraw"></a>void <u>onDraw</u>(DrawBuf <i>buf</i>);
</big></dt>
<dd>Draw widget at its position to buffer<br><br>
</dd>
<dt><big><a name="FrameLayout.showChild"></a>bool <u>showChild</u>(string <i>ID</i>, Visibility <i>otherChildrenVisibility</i> = Visibility.Invisible, bool <i>updateFocus</i> = false);
</big></dt>
<dd>make one of children (with specified <i>ID</i>) visible, for the rest, set visibility to <i>otherChildrenVisibility</i><br><br>
</dd>
</dl>
</dd>
<dt><big><a name="TableLayout"></a>class <u>TableLayout</u>: dlangui.widgets.widget.WidgetGroup;
</big></dt>
<dd>layout children as table with rows and columns<br><br>
<dl><dt><big><a name="TableLayout.colCount"></a>@property int <u>colCount</u>();
</big></dt>
<dd>number of columns<br><br>
</dd>
<dt><big><a name="TableLayout.measure"></a>void <u>measure</u>(int <i>parentWidth</i>, int <i>parentHeight</i>);
</big></dt>
<dd>Measure widget according to desired width and height constraints. (Step 1 of two phase layout).<br><br>
</dd>
<dt><big><a name="TableLayout.layout"></a>void <u>layout</u>(Rect <i>rc</i>);
</big></dt>
<dd>Set widget rectangle to specified value and <u>layout</u> widget contents. (Step 2 of two phase <u>layout</u>).<br><br>
</dd>
<dt><big><a name="TableLayout.onDraw"></a>void <u>onDraw</u>(DrawBuf <i>buf</i>);
</big></dt>
<dd>Draw widget at its position to buffer<br><br>
</dd>
</dl>
</dd>
</dl>
<hr><small>Page generated by <a href="http://dlang.org/ddoc.html">Ddoc</a>. Vadim Lopatin, 2014
</small>
</body></html>