1
0
mirror of https://github.com/taigrr/arduinolibs synced 2025-01-18 04:33:12 -08:00
arduinolibs/classTextField.html
Rhys Weatherley ac10b9ed5e Update docs
2012-06-01 14:29:31 +10:00

276 lines
17 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>ArduinoLibs: TextField Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">ArduinoLibs</div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">TextField Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="TextField" --><!-- doxytag: inherits="Field" -->
<p><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> that displays a read-only text value.
<a href="classTextField.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="TextField_8h_source.html">TextField.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for TextField:</div>
<div class="dyncontent">
<div class="center">
<img src="classTextField.png" usemap="#TextField_map" alt=""/>
<map id="TextField_map" name="TextField_map">
<area href="classField.html" title="Manages a single data input/output field within a Form." alt="Field" shape="rect" coords="0,0,63,24"/>
</map>
</div></div>
<p><a href="classTextField-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTextField.html#a5108741ab147b2cd5a399fefbe0a2382">TextField</a> (const String &amp;label)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new text field with a specific <em>label</em>. <a href="#a5108741ab147b2cd5a399fefbe0a2382"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTextField.html#a24096a344d9161b2c99ce724ec2ee93c">TextField</a> (<a class="el" href="classForm.html">Form</a> &amp;form, const String &amp;label, const String &amp;value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new text field with a specific <em>label</em> and <em>value</em> attaches it to a <em>form</em>. <a href="#a24096a344d9161b2c99ce724ec2ee93c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTextField.html#aa78f1354f9240b64fabd6f996e312f32">enterField</a> (bool reverse)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enters the field due to form navigation. <a href="#aa78f1354f9240b64fabd6f996e312f32"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const String &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTextField.html#a124764b6fc7c19aaf683f72cd42636b1">value</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the text value that is currently displayed by this field. <a href="#a124764b6fc7c19aaf683f72cd42636b1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTextField.html#a24b98c5bb744331bf0a5facc8ea9c033">setValue</a> (const String &amp;value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the text <em>value</em> that is displayed by this field. <a href="#a24b98c5bb744331bf0a5facc8ea9c033"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> that displays a read-only text value. </p>
<p>This following example displays a text field with the label "Form example" and a <a class="el" href="classTextField.html#a124764b6fc7c19aaf683f72cd42636b1" title="Returns the text value that is currently displayed by this field.">value()</a> of "v1.0".</p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> mainForm(lcd);
<a class="code" href="classTextField.html" title="Field that displays a read-only text value.">TextField</a> welcomeField(mainForm, <span class="stringliteral">&quot;Form example&quot;</span>, <span class="stringliteral">&quot;v1.0&quot;</span>);
</pre></div><div class="image">
<img src="FormText.png" alt="FormText.png"/>
</div>
<p>As well as static messages, <a class="el" href="classTextField.html" title="Field that displays a read-only text value.">TextField</a> can be used to display read-only information that is computed at runtime:</p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classTextField.html" title="Field that displays a read-only text value.">TextField</a> timeField(mainForm, <span class="stringliteral">&quot;Time since reset&quot;</span>, <span class="stringliteral">&quot;0&quot;</span>);
<span class="keywordtype">void</span> loop() {
timeField.setValue(millis() / 1000);
mainForm.dispatch(lcd.<a class="code" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">getButton</a>());
}
</pre></div><p>For writable fields, use <a class="el" href="classBoolField.html" title="Field that manages the input of a boolean value.">BoolField</a>, <a class="el" href="classIntField.html" title="Field that manages the input of an integer value.">IntField</a>, or <a class="el" href="classTimeField.html" title="Field that manages the display and editing of a time value.">TimeField</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> </dd></dl>
<p>Definition at line <a class="el" href="TextField_8h_source.html#l00028">28</a> of file <a class="el" href="TextField_8h_source.html">TextField.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a5108741ab147b2cd5a399fefbe0a2382"></a><!-- doxytag: member="TextField::TextField" ref="a5108741ab147b2cd5a399fefbe0a2382" args="(const String &amp;label)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">TextField::TextField </td>
<td>(</td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>label</em></td><td>)</td>
<td><code> [explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a new text field with a specific <em>label</em>. </p>
<p>The field is initially not associated with a <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a>. The field can be added to a form later using <a class="el" href="classForm.html#a5cb056ace428e75e321610555bfecac7" title="Adds field to this form.">Form::addField()</a>.</p>
<p>The initial <a class="el" href="classTextField.html#a124764b6fc7c19aaf683f72cd42636b1" title="Returns the text value that is currently displayed by this field.">value()</a> will be the empty string.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a5cb056ace428e75e321610555bfecac7" title="Adds field to this form.">Form::addField()</a> </dd></dl>
<p>Definition at line <a class="el" href="TextField_8cpp_source.html#l00066">66</a> of file <a class="el" href="TextField_8cpp_source.html">TextField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a24096a344d9161b2c99ce724ec2ee93c"></a><!-- doxytag: member="TextField::TextField" ref="a24096a344d9161b2c99ce724ec2ee93c" args="(Form &amp;form, const String &amp;label, const String &amp;value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">TextField::TextField </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classForm.html">Form</a> &amp;&#160;</td>
<td class="paramname"><em>form</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>label</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a new text field with a specific <em>label</em> and <em>value</em> attaches it to a <em>form</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classTextField.html#a124764b6fc7c19aaf683f72cd42636b1" title="Returns the text value that is currently displayed by this field.">value()</a> </dd></dl>
<p>Definition at line <a class="el" href="TextField_8cpp_source.html#l00077">77</a> of file <a class="el" href="TextField_8cpp_source.html">TextField.cpp</a>.</p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aa78f1354f9240b64fabd6f996e312f32"></a><!-- doxytag: member="TextField::enterField" ref="aa78f1354f9240b64fabd6f996e312f32" args="(bool reverse)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void TextField::enterField </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>reverse</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Enters the field due to form navigation. </p>
<p>This function is typically called when the user presses Left and Right buttons to navigate to the field. If <em>reverse</em> is true, then navigation was due to the Left button being pressed.</p>
<p>This function can assume that the display has been cleared and the cursor is positioned at (0, 0).</p>
<p>The default implementation prints the <a class="el" href="classField.html#aaa861ef917130c989a955bc75c683afe" title="Returns the label to display in the first line of this field.">label()</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classField.html#ad6805c75ee1e62f8cd8bd550c4530c07" title="Exits the field due to form navigation.">exitField()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classField.html#aa032bbeacb405c56546cb56fbbee94f5">Field</a>.</p>
<p>Definition at line <a class="el" href="TextField_8cpp_source.html#l00083">83</a> of file <a class="el" href="TextField_8cpp_source.html">TextField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a24b98c5bb744331bf0a5facc8ea9c033"></a><!-- doxytag: member="TextField::setValue" ref="a24b98c5bb744331bf0a5facc8ea9c033" args="(const String &amp;value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void TextField::setValue </td>
<td>(</td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the text <em>value</em> that is displayed by this field. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classTextField.html#a124764b6fc7c19aaf683f72cd42636b1" title="Returns the text value that is currently displayed by this field.">value()</a> </dd></dl>
<p>Definition at line <a class="el" href="TextField_8cpp_source.html#l00102">102</a> of file <a class="el" href="TextField_8cpp_source.html">TextField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a124764b6fc7c19aaf683f72cd42636b1"></a><!-- doxytag: member="TextField::value" ref="a124764b6fc7c19aaf683f72cd42636b1" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const String &amp; TextField::value </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the text value that is currently displayed by this field. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classTextField.html#a24b98c5bb744331bf0a5facc8ea9c033" title="Sets the text value that is displayed by this field.">setValue()</a> </dd></dl>
<p>Definition at line <a class="el" href="TextField_8h_source.html#l00035">35</a> of file <a class="el" href="TextField_8h_source.html">TextField.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="TextField_8h_source.html">TextField.h</a></li>
<li><a class="el" href="TextField_8cpp_source.html">TextField.cpp</a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 1 2012 14:29:18 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>