lazarus-ccr/components/nvidia-widgets/doc/nvwidgets/uicontext.dobutton.html
blaszijk 8fd729e3a8 fixed source paths, added nvbasepath unit documentation
added relative paths to crop_images.bat


git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2238 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2012-01-06 21:45:31 +00:00

100 lines
4.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>UIContext.doButton</title>
<link rel="stylesheet" href="../fpdoc.css" type="text/css">
</head>
<body>
<table class="bar" width="100%" border="0" cellpadding="4" cellspacing="0">
<tr>
<td><b>[<a href="../nvwidgets/index.html">Overview</a>][<a href="../nvwidgets/index-2.html">Constants</a>][<a href="../nvwidgets/index-3.html">Types</a>][<a href="../nvwidgets/index-4.html">Classes</a>][<a href="../nvwidgets/index-5.html">Procedures and functions</a>][<a href="../nvwidgets/index-8.html">Index</a>]</b></td>
<td align="right"><span class="bartitle">Reference for unit 'nvWidgets' (<a href="../index.html">#nvidia-widgets</a>)</span></td>
</tr>
</table>
<h1>UIContext.doButton</h1>
<p>UI method for rendering and processing a push button</p>
<h2>Declaration</h2>
<p>Source position: line 0</p>
<table cellpadding="0" cellspacing="0">
<tr>
<td><p><tt><span class="code"> <span class="kw">function</span> <a href="../nvwidgets/uicontext.html">UIContext</a><span class="sym">.</span>doButton<span class="sym">(</span></span></tt></p></td>
</tr>
<tr>
<td><p><tt><span class="code">&nbsp;&nbsp;<span class="kw">const </span>r<span class="sym">: </span><a href="../nvwidgets/rect.html">Rect</a><span class="sym">;</span></span></tt></p></td>
</tr>
<tr>
<td><p><tt><span class="code">&nbsp;&nbsp;<span class="kw">const </span>Text<span class="sym">: </span><span class="sym">;</span></span></tt></p></td>
</tr>
<tr>
<td><p><tt><span class="code">&nbsp;&nbsp;<span class="kw">var </span>state<span class="sym">: </span>Boolean<span class="sym">;</span></span></tt></p></td>
</tr>
<tr>
<td><p><tt><span class="code">&nbsp;&nbsp;style<span class="sym">: </span>Integer <span class="sym">=</span> <span class="num">0</span></span></tt></p></td>
</tr>
<tr>
<td><p><tt><span class="code"><span class="sym">):</span>Boolean<span class="sym">;</span><br><br><span class="kw">function</span> <a href="../nvwidgets/uicontext.html">UIContext</a><span class="sym">.</span>doButton<span class="sym">(</span></span></tt></p></td>
</tr>
<tr>
<td><p><tt><span class="code">&nbsp;&nbsp;<span class="kw">const </span>r<span class="sym">: </span><a href="../nvwidgets/rect.html">Rect</a><span class="sym">;</span></span></tt></p></td>
</tr>
<tr>
<td><p><tt><span class="code">&nbsp;&nbsp;<span class="kw">const </span>Text<span class="sym">: </span></span></tt></p></td>
</tr>
<tr>
<td><p><tt><span class="code"><span class="sym">):</span>Boolean<span class="sym">;</span></span></tt></p></td>
</tr>
</table>
<h2>Arguments</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><p><tt><span class="code">r</span></tt></p></td>
<td><p>&nbsp;&nbsp;</p></td>
<td><p class="cmt">optionally provides a location and size for the button</p></td>
</tr>
<tr>
<td valign="top"><p><tt><span class="code">Text</span></tt></p></td>
<td><p>&nbsp;&nbsp;</p></td>
<td><p class="cmt">text to display on the button</p></td>
</tr>
<tr>
<td valign="top"><p><tt><span class="code">state</span></tt></p></td>
<td><p>&nbsp;&nbsp;</p></td>
<td><p class="cmt">whether the button is depressed</p></td>
</tr>
<tr>
<td valign="top"><p><tt><span class="code">style</span></tt></p></td>
<td><p>&nbsp;&nbsp;</p></td>
<td><p class="cmt">optional style flag to modify the look</p></td>
</tr>
</table>
<h2>Arguments</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><p><tt><span class="code">r</span></tt></p></td>
<td><p>&nbsp;&nbsp;</p></td>
<td><p class="cmt">optionally provides a location and size for the button</p></td>
</tr>
<tr>
<td valign="top"><p><tt><span class="code">Text</span></tt></p></td>
<td><p>&nbsp;&nbsp;</p></td>
<td><p class="cmt">text to display on the button</p></td>
</tr>
</table>
<h2>Description</h2>
<p>The button method does only take a text and state variable. This variable is modified if the button is pressed or depressed. When a state change occurs the method function returns <var>True</var>.</p>
<img alt="" src="../images/button.png">
<p>Example code how to implement a button</p>
<pre>none<span class="sym">.</span>Rect<span class="sym">(</span><span class="num">0</span><span class="sym">,</span> <span class="num">0</span><span class="sym">)</span><span class="sym">;</span>
ui<span class="sym">.</span>beginGroup<span class="sym">(</span>GroupFlags_GrowDownFromRight<span class="sym">)</span><span class="sym">;</span>
<span class="kw">if</span> ui<span class="sym">.</span>doButton<span class="sym">(</span>none<span class="sym">,</span> <span class="str">'Apply'</span><span class="sym">)</span> <span class="kw">then</span>
<span class="kw">begin</span>
<span class="cmt">//code to apply your changes</span>
<span class="kw">end</span><span class="sym">;</span>
ui<span class="sym">.</span>endGroup<span class="sym">;</span>
</pre>
</body>
</html>