Files
discoverpixy/group__button.html
2015-06-08 11:04:50 +02:00

384 lines
54 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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>discoverpixy: Button</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">discoverpixy
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<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><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</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>
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Button<div class="ingroups"><a class="el" href="group__gui.html">Gui</a></div></div> </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Collaboration diagram for Button:</div>
<div class="dyncontent">
<center><table><tr><td><img src="group__button.png" border="0" alt="" usemap="#group____button"/>
<map name="group____button" id="group____button">
<area shape="rect" id="node1" href="group__gui.html" title="Gui" alt="" coords="5,5,48,32"/></map>
</td></tr></table></center>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html">BUTTON_STRUCT</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga0cc6f7717df9fbdc0f33efb88720a639"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__button.html#ga0cc6f7717df9fbdc0f33efb88720a639">AUTO</a>&#160;&#160;&#160;0</td></tr>
<tr class="memdesc:ga0cc6f7717df9fbdc0f33efb88720a639"><td class="mdescLeft">&#160;</td><td class="mdescRight">Use this value instead of x2, y2 in the <a class="el" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html">BUTTON_STRUCT</a> to autocalculate the button width/height. <a href="#ga0cc6f7717df9fbdc0f33efb88720a639">More...</a><br /></td></tr>
<tr class="separator:ga0cc6f7717df9fbdc0f33efb88720a639"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga2bb66de608267d70a8cc4df574cda2a2"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__button.html#ga2bb66de608267d70a8cc4df574cda2a2">BUTTON_CALLBACK</a>) (void *button)</td></tr>
<tr class="separator:ga2bb66de608267d70a8cc4df574cda2a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga64d5d2aaff2c917e5d43e7ed849607de"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__button.html#ga64d5d2aaff2c917e5d43e7ed849607de">gui_button_add</a> (<a class="el" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html">BUTTON_STRUCT</a> *button)</td></tr>
<tr class="separator:ga64d5d2aaff2c917e5d43e7ed849607de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga39e6ec07616381a15f276cd821dad4fd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__button.html#ga39e6ec07616381a15f276cd821dad4fd">gui_button_remove</a> (<a class="el" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html">BUTTON_STRUCT</a> *button)</td></tr>
<tr class="separator:ga39e6ec07616381a15f276cd821dad4fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6da1e251bad09d29fbb3b3f405689ab1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__button.html#ga6da1e251bad09d29fbb3b3f405689ab1">gui_button_redraw</a> (<a class="el" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html">BUTTON_STRUCT</a> *button)</td></tr>
<tr class="separator:ga6da1e251bad09d29fbb3b3f405689ab1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>The Button Gui-Element is a clickable, rectangular box with a label inside. When it is pressed and released you will be notified via the provided callback. </p>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="ga0cc6f7717df9fbdc0f33efb88720a639"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AUTO&#160;&#160;&#160;0</td>
</tr>
</table>
</div><div class="memdoc">
<p>Use this value instead of x2, y2 in the <a class="el" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html">BUTTON_STRUCT</a> to autocalculate the button width/height. </p>
<p>Definition at line <a class="el" href="button_8h_source.html#l00065">65</a> of file <a class="el" href="button_8h_source.html">button.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="ga2bb66de608267d70a8cc4df574cda2a2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* BUTTON_CALLBACK) (void *button)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Prototype for Event Listeners (called when the button is pressed) </p><dl class="section note"><dt>Note</dt><dd>You should NOT execute long running things in this callback nor should you update the gui. But you can call <a class="el" href="group__screen.html#gad4473a16eaf48dab405d23f5f63af3aa">gui_screen_navigate()</a> for instance. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">button</td><td>The pointer to the <a class="el" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html">BUTTON_STRUCT</a> where to corresponding Button was pressed </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="button_8h_source.html#l00049">49</a> of file <a class="el" href="button_8h_source.html">button.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga64d5d2aaff2c917e5d43e7ed849607de"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool gui_button_add </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html">BUTTON_STRUCT</a> *&#160;</td>
<td class="paramname"><em>button</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds a button. Your Callback will be called from now on, if the button was pressed </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">button</td><td>A Pointer to the preinitialized <a class="el" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html">BUTTON_STRUCT</a> </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true on success </dd></dl>
<p>Definition at line <a class="el" href="button_8c_source.html#l00133">133</a> of file <a class="el" href="button_8c_source.html">button.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;{</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="group__touch.html#gad32e5d122ec3f5f88bc6b2d9f4a629f8">touch_have_empty</a>(1)) { <span class="comment">//Check if the touch module can handle one additional area</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="comment">//Calculate width and height of the button text</span></div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> strwidth = <a class="code" href="group__tft.html#ga7e99287b1e6b844f6867c63400959ffc">tft_font_width</a>(button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adeae49dfe3584e6df726fb4167cd1cf7">font</a>) * strlen(button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#a16343090e80c4472521560f30113d96c">text</a>);</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> strheight = <a class="code" href="group__tft.html#gaea9f6a88da91949befe52cd4ed000c5d">tft_font_height</a>(button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adeae49dfe3584e6df726fb4167cd1cf7">font</a>);</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#a4026095999c2fd7a91f9bb91390647a4">hookedActions</a> = <a class="code" href="group__touch.html#ggab6037f32eebdf297a7d601a1e6c87768a70faab71fe0370791190ce15d638011d">PEN_DOWN</a>; <span class="comment">//At first we are interested in PEN_DOWN events</span></div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#a4b44f431c154678005298b0f0618cd37">callback</a> = <a class="code" href="button_8c.html#a7dca41e6afa418abaf2d471acac9b649">buttons_cb</a>; <span class="comment">//Use our own callback for the touch area events</span></div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keywordflow">if</span> (button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#ac5bc000f8954f38b7a641a485a26bae7">x2</a> == <a class="code" href="group__button.html#ga0cc6f7717df9fbdc0f33efb88720a639">AUTO</a>) { <span class="comment">//The user wants us to calculate the button width automatically</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="comment">//Use string width + half of a character width as button width</span></div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#ac5bc000f8954f38b7a641a485a26bae7">x2</a> = button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aedb5fdfe3c1d1a915b668ba7f3950753">x1</a> - 1 + strwidth + (<a class="code" href="group__tft.html#ga7e99287b1e6b844f6867c63400959ffc">tft_font_width</a>(button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adeae49dfe3584e6df726fb4167cd1cf7">font</a>) / 2);</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#ac5bc000f8954f38b7a641a485a26bae7">x2</a> - button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aedb5fdfe3c1d1a915b668ba7f3950753">x1</a> + 1) &lt; (strwidth + 2)) { <span class="comment">//the provided width is too small to fit the entire text</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">//report error</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; }</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <span class="keywordflow">if</span> (button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aa377184ba406b3f0c4ac18c935378204">y2</a> == <a class="code" href="group__button.html#ga0cc6f7717df9fbdc0f33efb88720a639">AUTO</a>) { <span class="comment">//The user wants us to calculate the button height automatically</span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="comment">//Use one and a half character heights as button height</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aa377184ba406b3f0c4ac18c935378204">y2</a> = button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#a47ada631c22a9d40348069145654f255">y1</a> - 1 + strheight + (strheight / 2);</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aa377184ba406b3f0c4ac18c935378204">y2</a> - button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#a47ada631c22a9d40348069145654f255">y1</a> + 1) &lt; (strheight + 2)) { <span class="comment">//the provided height is too small to fit the text</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; }</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <a class="code" href="group__button.html#ga6da1e251bad09d29fbb3b3f405689ab1">gui_button_redraw</a>(button); <span class="comment">//call the redraw method, which will take care of drawing the entire button</span></div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="keywordflow">return</span> <a class="code" href="group__touch.html#ga3adc36f55b7475b3f652c38c0e23d741">touch_register_area</a>(&amp;button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>); <span class="comment">//Register the touch area and receive events for this button, from now on</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; }</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">//no more touch areas left</span></div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;}</div>
<div class="ttc" id="group__tft_html_gaea9f6a88da91949befe52cd4ed000c5d"><div class="ttname"><a href="group__tft.html#gaea9f6a88da91949befe52cd4ed000c5d">tft_font_height</a></div><div class="ttdeci">uint8_t tft_font_height(uint8_t fontnum)</div><div class="ttdef"><b>Definition:</b> <a href="tft_8c_source.html#l00087">tft.c:87</a></div></div>
<div class="ttc" id="group__touch_html_ga3adc36f55b7475b3f652c38c0e23d741"><div class="ttname"><a href="group__touch.html#ga3adc36f55b7475b3f652c38c0e23d741">touch_register_area</a></div><div class="ttdeci">bool touch_register_area(TOUCH_AREA_STRUCT *area)</div><div class="ttdef"><b>Definition:</b> <a href="touch_8c_source.html#l00181">touch.c:181</a></div></div>
<div class="ttc" id="struct_b_u_t_t_o_n___s_t_r_u_c_t_html_a16343090e80c4472521560f30113d96c"><div class="ttname"><a href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#a16343090e80c4472521560f30113d96c">BUTTON_STRUCT::text</a></div><div class="ttdeci">const char * text</div><div class="ttdoc">The label of the button. </div><div class="ttdef"><b>Definition:</b> <a href="button_8h_source.html#l00061">button.h:61</a></div></div>
<div class="ttc" id="group__tft_html_ga7e99287b1e6b844f6867c63400959ffc"><div class="ttname"><a href="group__tft.html#ga7e99287b1e6b844f6867c63400959ffc">tft_font_width</a></div><div class="ttdeci">uint8_t tft_font_width(uint8_t fontnum)</div><div class="ttdef"><b>Definition:</b> <a href="tft_8c_source.html#l00092">tft.c:92</a></div></div>
<div class="ttc" id="group__button_html_ga6da1e251bad09d29fbb3b3f405689ab1"><div class="ttname"><a href="group__button.html#ga6da1e251bad09d29fbb3b3f405689ab1">gui_button_redraw</a></div><div class="ttdeci">void gui_button_redraw(BUTTON_STRUCT *button)</div><div class="ttdef"><b>Definition:</b> <a href="button_8c_source.html#l00164">button.c:164</a></div></div>
<div class="ttc" id="group__button_html_ga0cc6f7717df9fbdc0f33efb88720a639"><div class="ttname"><a href="group__button.html#ga0cc6f7717df9fbdc0f33efb88720a639">AUTO</a></div><div class="ttdeci">#define AUTO</div><div class="ttdoc">Use this value instead of x2, y2 in the BUTTON_STRUCT to autocalculate the button width/height...</div><div class="ttdef"><b>Definition:</b> <a href="button_8h_source.html#l00065">button.h:65</a></div></div>
<div class="ttc" id="group__touch_html_ggab6037f32eebdf297a7d601a1e6c87768a70faab71fe0370791190ce15d638011d"><div class="ttname"><a href="group__touch.html#ggab6037f32eebdf297a7d601a1e6c87768a70faab71fe0370791190ce15d638011d">PEN_DOWN</a></div><div class="ttdoc">Receive an event when the pen goes down inside the region. </div><div class="ttdef"><b>Definition:</b> <a href="touch_8h_source.html#l00054">touch.h:54</a></div></div>
<div class="ttc" id="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t_html_a47ada631c22a9d40348069145654f255"><div class="ttname"><a href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#a47ada631c22a9d40348069145654f255">TOUCH_AREA_STRUCT::y1</a></div><div class="ttdeci">uint16_t y1</div><div class="ttdoc">Top Left Y-Coordinate of Area. </div><div class="ttdef"><b>Definition:</b> <a href="touch_8h_source.html#l00075">touch.h:75</a></div></div>
<div class="ttc" id="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t_html_aedb5fdfe3c1d1a915b668ba7f3950753"><div class="ttname"><a href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aedb5fdfe3c1d1a915b668ba7f3950753">TOUCH_AREA_STRUCT::x1</a></div><div class="ttdeci">uint16_t x1</div><div class="ttdoc">Top Left X-Coordinate of Area. </div><div class="ttdef"><b>Definition:</b> <a href="touch_8h_source.html#l00074">touch.h:74</a></div></div>
<div class="ttc" id="struct_b_u_t_t_o_n___s_t_r_u_c_t_html_adf10d197299522577e67d366877bdd3f"><div class="ttname"><a href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">BUTTON_STRUCT::base</a></div><div class="ttdeci">TOUCH_AREA_STRUCT base</div><div class="ttdoc">Basic geometry of the button. You only need to set the x1, y1, x2, y2 members of this struct...</div><div class="ttdef"><b>Definition:</b> <a href="button_8h_source.html#l00056">button.h:56</a></div></div>
<div class="ttc" id="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t_html_aa377184ba406b3f0c4ac18c935378204"><div class="ttname"><a href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aa377184ba406b3f0c4ac18c935378204">TOUCH_AREA_STRUCT::y2</a></div><div class="ttdeci">uint16_t y2</div><div class="ttdoc">Bottom Right Y-Coordinate of Area. </div><div class="ttdef"><b>Definition:</b> <a href="touch_8h_source.html#l00077">touch.h:77</a></div></div>
<div class="ttc" id="button_8c_html_a7dca41e6afa418abaf2d471acac9b649"><div class="ttname"><a href="button_8c.html#a7dca41e6afa418abaf2d471acac9b649">buttons_cb</a></div><div class="ttdeci">void buttons_cb(void *touchArea, TOUCH_ACTION triggeredAction)</div><div class="ttdef"><b>Definition:</b> <a href="button_8c_source.html#l00092">button.c:92</a></div></div>
<div class="ttc" id="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t_html_a4b44f431c154678005298b0f0618cd37"><div class="ttname"><a href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#a4b44f431c154678005298b0f0618cd37">TOUCH_AREA_STRUCT::callback</a></div><div class="ttdeci">TOUCH_CALLBACK callback</div><div class="ttdoc">Callback which is executed when an event occurred in this Area. </div><div class="ttdef"><b>Definition:</b> <a href="touch_8h_source.html#l00078">touch.h:78</a></div></div>
<div class="ttc" id="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t_html_ac5bc000f8954f38b7a641a485a26bae7"><div class="ttname"><a href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#ac5bc000f8954f38b7a641a485a26bae7">TOUCH_AREA_STRUCT::x2</a></div><div class="ttdeci">uint16_t x2</div><div class="ttdoc">Bottom Right X-Coordinate of Area. </div><div class="ttdef"><b>Definition:</b> <a href="touch_8h_source.html#l00076">touch.h:76</a></div></div>
<div class="ttc" id="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t_html_a4026095999c2fd7a91f9bb91390647a4"><div class="ttname"><a href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#a4026095999c2fd7a91f9bb91390647a4">TOUCH_AREA_STRUCT::hookedActions</a></div><div class="ttdeci">TOUCH_ACTION hookedActions</div><div class="ttdoc">Actions to listen to. </div><div class="ttdef"><b>Definition:</b> <a href="touch_8h_source.html#l00073">touch.h:73</a></div></div>
<div class="ttc" id="group__touch_html_gad32e5d122ec3f5f88bc6b2d9f4a629f8"><div class="ttname"><a href="group__touch.html#gad32e5d122ec3f5f88bc6b2d9f4a629f8">touch_have_empty</a></div><div class="ttdeci">bool touch_have_empty(unsigned char num)</div><div class="ttdef"><b>Definition:</b> <a href="touch_8c_source.html#l00165">touch.c:165</a></div></div>
<div class="ttc" id="struct_b_u_t_t_o_n___s_t_r_u_c_t_html_adeae49dfe3584e6df726fb4167cd1cf7"><div class="ttname"><a href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adeae49dfe3584e6df726fb4167cd1cf7">BUTTON_STRUCT::font</a></div><div class="ttdeci">uint8_t font</div><div class="ttdoc">The number of the font to use. </div><div class="ttdef"><b>Definition:</b> <a href="button_8h_source.html#l00060">button.h:60</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__button_ga64d5d2aaff2c917e5d43e7ed849607de_cgraph.png" border="0" usemap="#group__button_ga64d5d2aaff2c917e5d43e7ed849607de_cgraph" alt=""/></div>
<map name="group__button_ga64d5d2aaff2c917e5d43e7ed849607de_cgraph" id="group__button_ga64d5d2aaff2c917e5d43e7ed849607de_cgraph">
<area shape="rect" id="node2" href="group__touch.html#gad32e5d122ec3f5f88bc6b2d9f4a629f8" title="touch_have_empty" alt="" coords="167,5,297,32"/><area shape="rect" id="node3" href="group__tft.html#ga7e99287b1e6b844f6867c63400959ffc" title="tft_font_width" alt="" coords="365,81,463,108"/><area shape="rect" id="node5" href="group__tft.html#gaea9f6a88da91949befe52cd4ed000c5d" title="tft_font_height" alt="" coords="363,31,465,57"/><area shape="rect" id="node7" href="button_8c.html#a7dca41e6afa418abaf2d471acac9b649" title="buttons_cb" alt="" coords="189,208,275,235"/><area shape="rect" id="node11" href="group__button.html#ga6da1e251bad09d29fbb3b3f405689ab1" title="gui_button_redraw" alt="" coords="169,157,295,184"/><area shape="rect" id="node17" href="group__touch.html#ga3adc36f55b7475b3f652c38c0e23d741" title="touch_register_area" alt="" coords="164,259,300,285"/><area shape="rect" id="node4" href="group__ll__tft.html#ga3639ec94b2239cc02b3c47a14f6637a3" title="ll_tft_font_width" alt="" coords="535,81,646,108"/><area shape="rect" id="node6" href="group__ll__tft.html#ga8dbc8b40717be527e6f1c5a2cfc72aeb" title="ll_tft_font_height" alt="" coords="533,31,649,57"/><area shape="rect" id="node8" href="button_8c.html#a05bb88dac6f60063eae2bb67dda1f4e8" title="calculate_shadows" alt="" coords="348,284,480,311"/><area shape="rect" id="node9" href="group__tft.html#ga5022f91ea04919e698a79c0c309ba6f8" title="tft_draw_line" alt="" coords="367,233,461,260"/><area shape="rect" id="node10" href="group__ll__tft.html#ga2560737bf118275e6ce728f6dce1e83f" title="ll_tft_draw_line" alt="" coords="537,284,644,311"/><area shape="rect" id="node12" href="group__tft.html#ga781855ab93845ce326dfca7c099259c6" title="tft_fill_rectangle" alt="" coords="358,132,470,159"/><area shape="rect" id="node14" href="group__tft.html#gabf54943131990b366ce6875a0e1925f6" title="tft_print_line" alt="" coords="368,183,460,209"/><area shape="rect" id="node13" href="group__ll__tft.html#ga0111ae5623214d3d466b2b24598f303f" title="ll_tft_fill_rectangle" alt="" coords="528,132,653,159"/><area shape="rect" id="node15" href="group__ll__tft.html#gaf4b0b73ab01e1dc300ae65dc0ac029b6" title="ll_tft_num_fonts" alt="" coords="534,183,647,209"/><area shape="rect" id="node16" href="group__ll__tft.html#ga408570a2b70769255924792ce189f2c1" title="ll_tft_draw_char" alt="" coords="535,233,647,260"/></map>
</div>
</p>
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__button_ga64d5d2aaff2c917e5d43e7ed849607de_icgraph.png" border="0" usemap="#group__button_ga64d5d2aaff2c917e5d43e7ed849607de_icgraph" alt=""/></div>
<map name="group__button_ga64d5d2aaff2c917e5d43e7ed849607de_icgraph" id="group__button_ga64d5d2aaff2c917e5d43e7ed849607de_icgraph">
<area shape="rect" id="node2" href="screen__filetest_8c.html#a3017cd14eca2b9e67a69e7ea559b5eaa" title="enter" alt="" coords="210,5,261,32"/><area shape="rect" id="node3" href="group__numupdown.html#gab4321e7fc0810ee30355bc7d0a3372db" title="gui_numupdown_add" alt="" coords="164,56,307,83"/><area shape="rect" id="node4" href="screen__guitest_8c.html#a3017cd14eca2b9e67a69e7ea559b5eaa" title="enter" alt="" coords="355,56,405,83"/></map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga6da1e251bad09d29fbb3b3f405689ab1"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void gui_button_redraw </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html">BUTTON_STRUCT</a> *&#160;</td>
<td class="paramname"><em>button</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Redraws the button. Call this method if you have to redraw the entire screen or if you want to draw a button on top of an image. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">button</td><td>A Pointer to the <a class="el" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html">BUTTON_STRUCT</a> </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="button_8c_source.html#l00164">164</a> of file <a class="el" href="button_8c_source.html">button.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;{</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <span class="comment">//Calculate text dimensions and shadow colors</span></div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> strwidth = <a class="code" href="group__tft.html#ga7e99287b1e6b844f6867c63400959ffc">tft_font_width</a>(button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adeae49dfe3584e6df726fb4167cd1cf7">font</a>) * strlen(button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#a16343090e80c4472521560f30113d96c">text</a>);</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> strheight = <a class="code" href="group__tft.html#gaea9f6a88da91949befe52cd4ed000c5d">tft_font_height</a>(button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adeae49dfe3584e6df726fb4167cd1cf7">font</a>);</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; uint16_t c_light, c_dark;</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <a class="code" href="button_8c.html#a05bb88dac6f60063eae2bb67dda1f4e8">calculate_shadows</a>(button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#aebb27fad2492ea7aa81895d0ede61fcf">bgcolor</a>, &amp;c_light, &amp;c_dark);</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160;</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <span class="comment">//Draw the background and the 4 lines (shadow colors)</span></div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <a class="code" href="group__tft.html#ga781855ab93845ce326dfca7c099259c6">tft_fill_rectangle</a>(button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aedb5fdfe3c1d1a915b668ba7f3950753">x1</a> + 1, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#a47ada631c22a9d40348069145654f255">y1</a> + 1, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#ac5bc000f8954f38b7a641a485a26bae7">x2</a> - 1, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aa377184ba406b3f0c4ac18c935378204">y2</a> - 1, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#aebb27fad2492ea7aa81895d0ede61fcf">bgcolor</a>);</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <a class="code" href="group__tft.html#ga5022f91ea04919e698a79c0c309ba6f8">tft_draw_line</a>(button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aedb5fdfe3c1d1a915b668ba7f3950753">x1</a> + 1, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#a47ada631c22a9d40348069145654f255">y1</a>, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#ac5bc000f8954f38b7a641a485a26bae7">x2</a> - 1, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#a47ada631c22a9d40348069145654f255">y1</a>, c_light); <span class="comment">//North</span></div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <a class="code" href="group__tft.html#ga5022f91ea04919e698a79c0c309ba6f8">tft_draw_line</a>(button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aedb5fdfe3c1d1a915b668ba7f3950753">x1</a>, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#a47ada631c22a9d40348069145654f255">y1</a> + 1, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aedb5fdfe3c1d1a915b668ba7f3950753">x1</a>, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aa377184ba406b3f0c4ac18c935378204">y2</a> - 1, c_light); <span class="comment">//West</span></div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <a class="code" href="group__tft.html#ga5022f91ea04919e698a79c0c309ba6f8">tft_draw_line</a>(button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aedb5fdfe3c1d1a915b668ba7f3950753">x1</a> + 1, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aa377184ba406b3f0c4ac18c935378204">y2</a>, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#ac5bc000f8954f38b7a641a485a26bae7">x2</a> - 1, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aa377184ba406b3f0c4ac18c935378204">y2</a>, c_dark); <span class="comment">//South</span></div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <a class="code" href="group__tft.html#ga5022f91ea04919e698a79c0c309ba6f8">tft_draw_line</a>(button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#ac5bc000f8954f38b7a641a485a26bae7">x2</a>, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#a47ada631c22a9d40348069145654f255">y1</a> + 1, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#ac5bc000f8954f38b7a641a485a26bae7">x2</a>, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aa377184ba406b3f0c4ac18c935378204">y2</a> - 1, c_dark); <span class="comment">//East</span></div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="comment">//Draw the text</span></div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <a class="code" href="group__tft.html#gabf54943131990b366ce6875a0e1925f6">tft_print_line</a>(button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aedb5fdfe3c1d1a915b668ba7f3950753">x1</a> + (button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#ac5bc000f8954f38b7a641a485a26bae7">x2</a> - button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aedb5fdfe3c1d1a915b668ba7f3950753">x1</a> + 1 - strwidth) / 2, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#a47ada631c22a9d40348069145654f255">y1</a> + (button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aa377184ba406b3f0c4ac18c935378204">y2</a> - button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">base</a>.<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#a47ada631c22a9d40348069145654f255">y1</a> + 1 - strheight) / 2, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#aaf5a5af411fa69950e0b4415c8089c8b">txtcolor</a>, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#aebb27fad2492ea7aa81895d0ede61fcf">bgcolor</a>, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adeae49dfe3584e6df726fb4167cd1cf7">font</a>, button-&gt;<a class="code" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#a16343090e80c4472521560f30113d96c">text</a>);</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;}</div>
<div class="ttc" id="group__tft_html_gaea9f6a88da91949befe52cd4ed000c5d"><div class="ttname"><a href="group__tft.html#gaea9f6a88da91949befe52cd4ed000c5d">tft_font_height</a></div><div class="ttdeci">uint8_t tft_font_height(uint8_t fontnum)</div><div class="ttdef"><b>Definition:</b> <a href="tft_8c_source.html#l00087">tft.c:87</a></div></div>
<div class="ttc" id="struct_b_u_t_t_o_n___s_t_r_u_c_t_html_a16343090e80c4472521560f30113d96c"><div class="ttname"><a href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#a16343090e80c4472521560f30113d96c">BUTTON_STRUCT::text</a></div><div class="ttdeci">const char * text</div><div class="ttdoc">The label of the button. </div><div class="ttdef"><b>Definition:</b> <a href="button_8h_source.html#l00061">button.h:61</a></div></div>
<div class="ttc" id="group__tft_html_ga7e99287b1e6b844f6867c63400959ffc"><div class="ttname"><a href="group__tft.html#ga7e99287b1e6b844f6867c63400959ffc">tft_font_width</a></div><div class="ttdeci">uint8_t tft_font_width(uint8_t fontnum)</div><div class="ttdef"><b>Definition:</b> <a href="tft_8c_source.html#l00092">tft.c:92</a></div></div>
<div class="ttc" id="struct_b_u_t_t_o_n___s_t_r_u_c_t_html_aaf5a5af411fa69950e0b4415c8089c8b"><div class="ttname"><a href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#aaf5a5af411fa69950e0b4415c8089c8b">BUTTON_STRUCT::txtcolor</a></div><div class="ttdeci">uint16_t txtcolor</div><div class="ttdoc">The 16-bit text color. </div><div class="ttdef"><b>Definition:</b> <a href="button_8h_source.html#l00059">button.h:59</a></div></div>
<div class="ttc" id="group__tft_html_ga5022f91ea04919e698a79c0c309ba6f8"><div class="ttname"><a href="group__tft.html#ga5022f91ea04919e698a79c0c309ba6f8">tft_draw_line</a></div><div class="ttdeci">void tft_draw_line(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)</div><div class="ttdef"><b>Definition:</b> <a href="tft_8c_source.html#l00050">tft.c:50</a></div></div>
<div class="ttc" id="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t_html_a47ada631c22a9d40348069145654f255"><div class="ttname"><a href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#a47ada631c22a9d40348069145654f255">TOUCH_AREA_STRUCT::y1</a></div><div class="ttdeci">uint16_t y1</div><div class="ttdoc">Top Left Y-Coordinate of Area. </div><div class="ttdef"><b>Definition:</b> <a href="touch_8h_source.html#l00075">touch.h:75</a></div></div>
<div class="ttc" id="group__tft_html_gabf54943131990b366ce6875a0e1925f6"><div class="ttname"><a href="group__tft.html#gabf54943131990b366ce6875a0e1925f6">tft_print_line</a></div><div class="ttdeci">void tft_print_line(uint16_t x, uint16_t y, uint16_t color, uint16_t bgcolor, uint8_t font, const char *text)</div><div class="ttdef"><b>Definition:</b> <a href="tft_8c_source.html#l00098">tft.c:98</a></div></div>
<div class="ttc" id="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t_html_aedb5fdfe3c1d1a915b668ba7f3950753"><div class="ttname"><a href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aedb5fdfe3c1d1a915b668ba7f3950753">TOUCH_AREA_STRUCT::x1</a></div><div class="ttdeci">uint16_t x1</div><div class="ttdoc">Top Left X-Coordinate of Area. </div><div class="ttdef"><b>Definition:</b> <a href="touch_8h_source.html#l00074">touch.h:74</a></div></div>
<div class="ttc" id="struct_b_u_t_t_o_n___s_t_r_u_c_t_html_aebb27fad2492ea7aa81895d0ede61fcf"><div class="ttname"><a href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#aebb27fad2492ea7aa81895d0ede61fcf">BUTTON_STRUCT::bgcolor</a></div><div class="ttdeci">uint16_t bgcolor</div><div class="ttdoc">The 16-bit background color of the button. </div><div class="ttdef"><b>Definition:</b> <a href="button_8h_source.html#l00057">button.h:57</a></div></div>
<div class="ttc" id="struct_b_u_t_t_o_n___s_t_r_u_c_t_html_adf10d197299522577e67d366877bdd3f"><div class="ttname"><a href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adf10d197299522577e67d366877bdd3f">BUTTON_STRUCT::base</a></div><div class="ttdeci">TOUCH_AREA_STRUCT base</div><div class="ttdoc">Basic geometry of the button. You only need to set the x1, y1, x2, y2 members of this struct...</div><div class="ttdef"><b>Definition:</b> <a href="button_8h_source.html#l00056">button.h:56</a></div></div>
<div class="ttc" id="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t_html_aa377184ba406b3f0c4ac18c935378204"><div class="ttname"><a href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#aa377184ba406b3f0c4ac18c935378204">TOUCH_AREA_STRUCT::y2</a></div><div class="ttdeci">uint16_t y2</div><div class="ttdoc">Bottom Right Y-Coordinate of Area. </div><div class="ttdef"><b>Definition:</b> <a href="touch_8h_source.html#l00077">touch.h:77</a></div></div>
<div class="ttc" id="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t_html_ac5bc000f8954f38b7a641a485a26bae7"><div class="ttname"><a href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html#ac5bc000f8954f38b7a641a485a26bae7">TOUCH_AREA_STRUCT::x2</a></div><div class="ttdeci">uint16_t x2</div><div class="ttdoc">Bottom Right X-Coordinate of Area. </div><div class="ttdef"><b>Definition:</b> <a href="touch_8h_source.html#l00076">touch.h:76</a></div></div>
<div class="ttc" id="button_8c_html_a05bb88dac6f60063eae2bb67dda1f4e8"><div class="ttname"><a href="button_8c.html#a05bb88dac6f60063eae2bb67dda1f4e8">calculate_shadows</a></div><div class="ttdeci">void calculate_shadows(uint16_t bgcolor, uint16_t *light_shadow, uint16_t *dark_shadow)</div><div class="ttdef"><b>Definition:</b> <a href="button_8c_source.html#l00034">button.c:34</a></div></div>
<div class="ttc" id="group__tft_html_ga781855ab93845ce326dfca7c099259c6"><div class="ttname"><a href="group__tft.html#ga781855ab93845ce326dfca7c099259c6">tft_fill_rectangle</a></div><div class="ttdeci">void tft_fill_rectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)</div><div class="ttdef"><b>Definition:</b> <a href="tft_8c_source.html#l00067">tft.c:67</a></div></div>
<div class="ttc" id="struct_b_u_t_t_o_n___s_t_r_u_c_t_html_adeae49dfe3584e6df726fb4167cd1cf7"><div class="ttname"><a href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html#adeae49dfe3584e6df726fb4167cd1cf7">BUTTON_STRUCT::font</a></div><div class="ttdeci">uint8_t font</div><div class="ttdoc">The number of the font to use. </div><div class="ttdef"><b>Definition:</b> <a href="button_8h_source.html#l00060">button.h:60</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__button_ga6da1e251bad09d29fbb3b3f405689ab1_cgraph.png" border="0" usemap="#group__button_ga6da1e251bad09d29fbb3b3f405689ab1_cgraph" alt=""/></div>
<map name="group__button_ga6da1e251bad09d29fbb3b3f405689ab1_cgraph" id="group__button_ga6da1e251bad09d29fbb3b3f405689ab1_cgraph">
<area shape="rect" id="node2" href="group__tft.html#ga7e99287b1e6b844f6867c63400959ffc" title="tft_font_width" alt="" coords="197,5,295,32"/><area shape="rect" id="node4" href="group__tft.html#gaea9f6a88da91949befe52cd4ed000c5d" title="tft_font_height" alt="" coords="195,107,297,133"/><area shape="rect" id="node6" href="button_8c.html#a05bb88dac6f60063eae2bb67dda1f4e8" title="calculate_shadows" alt="" coords="180,157,312,184"/><area shape="rect" id="node7" href="group__tft.html#ga781855ab93845ce326dfca7c099259c6" title="tft_fill_rectangle" alt="" coords="190,208,302,235"/><area shape="rect" id="node9" href="group__tft.html#ga5022f91ea04919e698a79c0c309ba6f8" title="tft_draw_line" alt="" coords="199,259,293,285"/><area shape="rect" id="node11" href="group__tft.html#gabf54943131990b366ce6875a0e1925f6" title="tft_print_line" alt="" coords="200,56,292,83"/><area shape="rect" id="node3" href="group__ll__tft.html#ga3639ec94b2239cc02b3c47a14f6637a3" title="ll_tft_font_width" alt="" coords="367,5,478,32"/><area shape="rect" id="node5" href="group__ll__tft.html#ga8dbc8b40717be527e6f1c5a2cfc72aeb" title="ll_tft_font_height" alt="" coords="365,157,481,184"/><area shape="rect" id="node8" href="group__ll__tft.html#ga0111ae5623214d3d466b2b24598f303f" title="ll_tft_fill_rectangle" alt="" coords="360,208,485,235"/><area shape="rect" id="node10" href="group__ll__tft.html#ga2560737bf118275e6ce728f6dce1e83f" title="ll_tft_draw_line" alt="" coords="369,259,476,285"/><area shape="rect" id="node12" href="group__ll__tft.html#gaf4b0b73ab01e1dc300ae65dc0ac029b6" title="ll_tft_num_fonts" alt="" coords="366,56,479,83"/><area shape="rect" id="node13" href="group__ll__tft.html#ga408570a2b70769255924792ce189f2c1" title="ll_tft_draw_char" alt="" coords="367,107,479,133"/></map>
</div>
</p>
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__button_ga6da1e251bad09d29fbb3b3f405689ab1_icgraph.png" border="0" usemap="#group__button_ga6da1e251bad09d29fbb3b3f405689ab1_icgraph" alt=""/></div>
<map name="group__button_ga6da1e251bad09d29fbb3b3f405689ab1_icgraph" id="group__button_ga6da1e251bad09d29fbb3b3f405689ab1_icgraph">
<area shape="rect" id="node2" href="screen__tracking_8c.html#a5e8f84ee8ff4bf827775c38ae6752509" title="update" alt="" coords="229,5,291,32"/><area shape="rect" id="node3" href="group__button.html#ga64d5d2aaff2c917e5d43e7ed849607de" title="gui_button_add" alt="" coords="205,56,315,83"/><area shape="rect" id="node7" href="group__numupdown.html#ga4ee98a6c6af451123af6c464a851c03a" title="gui_numupdown_redraw" alt="" coords="180,107,340,133"/><area shape="rect" id="node4" href="screen__filetest_8c.html#a3017cd14eca2b9e67a69e7ea559b5eaa" title="enter" alt="" coords="434,31,485,57"/><area shape="rect" id="node5" href="group__numupdown.html#gab4321e7fc0810ee30355bc7d0a3372db" title="gui_numupdown_add" alt="" coords="388,81,531,108"/><area shape="rect" id="node6" href="screen__guitest_8c.html#a3017cd14eca2b9e67a69e7ea559b5eaa" title="enter" alt="" coords="579,81,629,108"/></map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga39e6ec07616381a15f276cd821dad4fd"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void gui_button_remove </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html">BUTTON_STRUCT</a> *&#160;</td>
<td class="paramname"><em>button</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Removes the button. You will no longer receive events for this button. This function will not overdraw the region where the button was located. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">button</td><td>A Pointer to the <a class="el" href="struct_b_u_t_t_o_n___s_t_r_u_c_t.html">BUTTON_STRUCT</a> </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="button_8c_source.html#l00184">184</a> of file <a class="el" href="button_8c_source.html">button.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160;{</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="comment">//We only need to unregister the touch area, as we have not allocated anything else</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <a class="code" href="group__touch.html#gaa7d6cd569335d0ddfc9eeab479f3a0a8">touch_unregister_area</a>((<a class="code" href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html">TOUCH_AREA_STRUCT</a>*)button);</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160;}</div>
<div class="ttc" id="group__touch_html_gaa7d6cd569335d0ddfc9eeab479f3a0a8"><div class="ttname"><a href="group__touch.html#gaa7d6cd569335d0ddfc9eeab479f3a0a8">touch_unregister_area</a></div><div class="ttdeci">void touch_unregister_area(TOUCH_AREA_STRUCT *area)</div><div class="ttdef"><b>Definition:</b> <a href="touch_8c_source.html#l00195">touch.c:195</a></div></div>
<div class="ttc" id="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t_html"><div class="ttname"><a href="struct_t_o_u_c_h___a_r_e_a___s_t_r_u_c_t.html">TOUCH_AREA_STRUCT</a></div><div class="ttdef"><b>Definition:</b> <a href="touch_8h_source.html#l00072">touch.h:72</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__button_ga39e6ec07616381a15f276cd821dad4fd_cgraph.png" border="0" usemap="#group__button_ga39e6ec07616381a15f276cd821dad4fd_cgraph" alt=""/></div>
<map name="group__button_ga39e6ec07616381a15f276cd821dad4fd_cgraph" id="group__button_ga39e6ec07616381a15f276cd821dad4fd_cgraph">
<area shape="rect" id="node2" href="group__touch.html#gaa7d6cd569335d0ddfc9eeab479f3a0a8" title="touch_unregister_area" alt="" coords="184,5,335,32"/></map>
</div>
</p>
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__button_ga39e6ec07616381a15f276cd821dad4fd_icgraph.png" border="0" usemap="#group__button_ga39e6ec07616381a15f276cd821dad4fd_icgraph" alt=""/></div>
<map name="group__button_ga39e6ec07616381a15f276cd821dad4fd_icgraph" id="group__button_ga39e6ec07616381a15f276cd821dad4fd_icgraph">
<area shape="rect" id="node2" href="screen__filetest_8c.html#acd1409088e83cf2a8ba2cf96dd9b52f8" title="leave" alt="" coords="240,5,291,32"/><area shape="rect" id="node3" href="group__numupdown.html#ga9470a5c6f0ffbbda7c56e1b8a59f4b97" title="gui_numupdown_remove" alt="" coords="184,56,347,83"/><area shape="rect" id="node4" href="screen__guitest_8c.html#acd1409088e83cf2a8ba2cf96dd9b52f8" title="leave" alt="" coords="395,56,445,83"/></map>
</div>
</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Jun 8 2015 11:01:19 for discoverpixy by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>