/usr/share/doc/libjuce/apiref/classModalCallbackFunction.html is in libjuce-doc 4.3.0~repack-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | <!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.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>JUCE: ModalCallbackFunction Class Reference</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>
<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 id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">JUCE
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- 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><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="classModalCallbackFunction-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">ModalCallbackFunction Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>This class provides some handy utility methods for creating <a class="el" href="classModalComponentManager_1_1Callback.html" title="Receives callbacks when a modal component is dismissed. ">ModalComponentManager::Callback</a> objects that will invoke a static function with some parameters when a modal component is dismissed.
<a href="classModalCallbackFunction.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a47c2e0f447876fabf4644d1cae159a0f"><td class="memTemplParams" colspan="2">template<typename ParamType > </td></tr>
<tr class="memitem:a47c2e0f447876fabf4644d1cae159a0f"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="classModalComponentManager_1_1Callback.html">ModalComponentManager::Callback</a> * </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classModalCallbackFunction.html#a47c2e0f447876fabf4644d1cae159a0f">create</a> (void(*functionToCall)(int, ParamType), ParamType parameterValue)</td></tr>
<tr class="memdesc:a47c2e0f447876fabf4644d1cae159a0f"><td class="mdescLeft"> </td><td class="mdescRight">This is a utility function to create a <a class="el" href="classModalComponentManager_1_1Callback.html" title="Receives callbacks when a modal component is dismissed. ">ModalComponentManager::Callback</a> that will call a static function with a parameter. <a href="#a47c2e0f447876fabf4644d1cae159a0f">More...</a><br /></td></tr>
<tr class="separator:a47c2e0f447876fabf4644d1cae159a0f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2330d0069d39bbb844ec75cb09bc7868"><td class="memTemplParams" colspan="2">template<typename ParamType1 , typename ParamType2 > </td></tr>
<tr class="memitem:a2330d0069d39bbb844ec75cb09bc7868"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="classModalComponentManager_1_1Callback.html">ModalComponentManager::Callback</a> * </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classModalCallbackFunction.html#a2330d0069d39bbb844ec75cb09bc7868">withParam</a> (void(*functionToCall)(int, ParamType1, ParamType2), ParamType1 parameterValue1, ParamType2 parameterValue2)</td></tr>
<tr class="memdesc:a2330d0069d39bbb844ec75cb09bc7868"><td class="mdescLeft"> </td><td class="mdescRight">This is a utility function to create a <a class="el" href="classModalComponentManager_1_1Callback.html" title="Receives callbacks when a modal component is dismissed. ">ModalComponentManager::Callback</a> that will call a static function with two custom parameters. <a href="#a2330d0069d39bbb844ec75cb09bc7868">More...</a><br /></td></tr>
<tr class="separator:a2330d0069d39bbb844ec75cb09bc7868"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a66fc6472aeb843617982fa7df9a83fc3"><td class="memTemplParams" colspan="2">template<class ComponentType > </td></tr>
<tr class="memitem:a66fc6472aeb843617982fa7df9a83fc3"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="classModalComponentManager_1_1Callback.html">ModalComponentManager::Callback</a> * </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classModalCallbackFunction.html#a66fc6472aeb843617982fa7df9a83fc3">forComponent</a> (void(*functionToCall)(int, ComponentType *), ComponentType *component)</td></tr>
<tr class="memdesc:a66fc6472aeb843617982fa7df9a83fc3"><td class="mdescLeft"> </td><td class="mdescRight">This is a utility function to create a <a class="el" href="classModalComponentManager_1_1Callback.html" title="Receives callbacks when a modal component is dismissed. ">ModalComponentManager::Callback</a> that will call a static function with a component. <a href="#a66fc6472aeb843617982fa7df9a83fc3">More...</a><br /></td></tr>
<tr class="separator:a66fc6472aeb843617982fa7df9a83fc3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a81ac9bb08f1700c1f5621339cae63f40"><td class="memTemplParams" colspan="2">template<class ComponentType , typename ParamType > </td></tr>
<tr class="memitem:a81ac9bb08f1700c1f5621339cae63f40"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="classModalComponentManager_1_1Callback.html">ModalComponentManager::Callback</a> * </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classModalCallbackFunction.html#a81ac9bb08f1700c1f5621339cae63f40">forComponent</a> (void(*functionToCall)(int, ComponentType *, ParamType), ComponentType *component, ParamType param)</td></tr>
<tr class="memdesc:a81ac9bb08f1700c1f5621339cae63f40"><td class="mdescLeft"> </td><td class="mdescRight">Creates a <a class="el" href="classModalComponentManager_1_1Callback.html" title="Receives callbacks when a modal component is dismissed. ">ModalComponentManager::Callback</a> that will call a static function with a component. <a href="#a81ac9bb08f1700c1f5621339cae63f40">More...</a><br /></td></tr>
<tr class="separator:a81ac9bb08f1700c1f5621339cae63f40"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This class provides some handy utility methods for creating <a class="el" href="classModalComponentManager_1_1Callback.html" title="Receives callbacks when a modal component is dismissed. ">ModalComponentManager::Callback</a> objects that will invoke a static function with some parameters when a modal component is dismissed. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a47c2e0f447876fabf4644d1cae159a0f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a47c2e0f447876fabf4644d1cae159a0f">§ </a></span>create()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<typename ParamType > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classModalComponentManager_1_1Callback.html">ModalComponentManager::Callback</a>* ModalCallbackFunction::create </td>
<td>(</td>
<td class="paramtype">void(*)(int, ParamType) </td>
<td class="paramname"><em>functionToCall</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">ParamType </td>
<td class="paramname"><em>parameterValue</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This is a utility function to create a <a class="el" href="classModalComponentManager_1_1Callback.html" title="Receives callbacks when a modal component is dismissed. ">ModalComponentManager::Callback</a> that will call a static function with a parameter. </p>
<p>The function that you supply must take two parameters - the first being an int, which is the result code that was used when the modal component was dismissed, and the second can be a custom type. Note that this custom value will be copied and stored, so it must be a primitive type or a class that provides copy-by-value semantics.</p>
<p>E.g.</p><div class="fragment"><div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> myCallbackFunction (<span class="keywordtype">int</span> modalResult, <span class="keywordtype">double</span> customValue)</div><div class="line">{</div><div class="line"> <span class="keywordflow">if</span> (modalResult == 1)</div><div class="line"> doSomethingWith (customValue);</div><div class="line">}</div><div class="line"></div><div class="line"><a class="code" href="classComponent.html">Component</a>* someKindOfComp;</div><div class="line">...</div><div class="line">someKindOfComp-><a class="code" href="classComponent.html#a0e7be8c456a663615eb389ecd10b2c04">enterModalState</a> (<a class="code" href="classModalCallbackFunction.html#a47c2e0f447876fabf4644d1cae159a0f">ModalCallbackFunction::create</a> (myCallbackFunction, 3.0));</div></div><!-- fragment --> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classModalComponentManager_1_1Callback.html" title="Receives callbacks when a modal component is dismissed. ">ModalComponentManager::Callback</a> </dd></dl>
</div>
</div>
<a id="a2330d0069d39bbb844ec75cb09bc7868"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2330d0069d39bbb844ec75cb09bc7868">§ </a></span>withParam()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<typename ParamType1 , typename ParamType2 > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classModalComponentManager_1_1Callback.html">ModalComponentManager::Callback</a>* ModalCallbackFunction::withParam </td>
<td>(</td>
<td class="paramtype">void(*)(int, ParamType1, ParamType2) </td>
<td class="paramname"><em>functionToCall</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">ParamType1 </td>
<td class="paramname"><em>parameterValue1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">ParamType2 </td>
<td class="paramname"><em>parameterValue2</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This is a utility function to create a <a class="el" href="classModalComponentManager_1_1Callback.html" title="Receives callbacks when a modal component is dismissed. ">ModalComponentManager::Callback</a> that will call a static function with two custom parameters. </p>
<p>The function that you supply must take three parameters - the first being an int, which is the result code that was used when the modal component was dismissed, and the next two are your custom types. Note that these custom values will be copied and stored, so they must be primitive types or classes that provide copy-by-value semantics.</p>
<p>E.g.</p><div class="fragment"><div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> myCallbackFunction (<span class="keywordtype">int</span> modalResult, <span class="keywordtype">double</span> customValue1, <a class="code" href="classString.html">String</a> customValue2)</div><div class="line">{</div><div class="line"> <span class="keywordflow">if</span> (modalResult == 1)</div><div class="line"> doSomethingWith (customValue1, customValue2);</div><div class="line">}</div><div class="line"></div><div class="line"><a class="code" href="classComponent.html">Component</a>* someKindOfComp;</div><div class="line">...</div><div class="line">someKindOfComp-><a class="code" href="classComponent.html#a0e7be8c456a663615eb389ecd10b2c04">enterModalState</a> (<a class="code" href="classModalCallbackFunction.html#a47c2e0f447876fabf4644d1cae159a0f">ModalCallbackFunction::create</a> (myCallbackFunction, 3.0, <a class="code" href="classString.html">String</a> (<span class="stringliteral">"xyz"</span>)));</div></div><!-- fragment --> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classModalComponentManager_1_1Callback.html" title="Receives callbacks when a modal component is dismissed. ">ModalComponentManager::Callback</a> </dd></dl>
</div>
</div>
<a id="a66fc6472aeb843617982fa7df9a83fc3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a66fc6472aeb843617982fa7df9a83fc3">§ </a></span>forComponent() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ComponentType > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classModalComponentManager_1_1Callback.html">ModalComponentManager::Callback</a>* ModalCallbackFunction::forComponent </td>
<td>(</td>
<td class="paramtype">void(*)(int, ComponentType *) </td>
<td class="paramname"><em>functionToCall</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">ComponentType * </td>
<td class="paramname"><em>component</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This is a utility function to create a <a class="el" href="classModalComponentManager_1_1Callback.html" title="Receives callbacks when a modal component is dismissed. ">ModalComponentManager::Callback</a> that will call a static function with a component. </p>
<p>The function that you supply must take two parameters - the first being an int, which is the result code that was used when the modal component was dismissed, and the second can be a <a class="el" href="classComponent.html" title="The base class for all JUCE user-interface objects. ">Component</a> class. The component will be stored as a <a class="el" href="classWeakReference.html" title="This class acts as a pointer which will automatically become null if the object to which it points is...">WeakReference</a>, so that if it gets deleted before this callback is invoked, the pointer that is passed to the function will be null.</p>
<p>E.g.</p><div class="fragment"><div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> myCallbackFunction (<span class="keywordtype">int</span> modalResult, <a class="code" href="classSlider.html">Slider</a>* mySlider)</div><div class="line">{</div><div class="line"> <span class="keywordflow">if</span> (modalResult == 1 && mySlider != <span class="keyword">nullptr</span>) <span class="comment">// (must check that mySlider isn't null in case it was deleted..)</span></div><div class="line"> mySlider-><a class="code" href="classSlider.html#a430a5c4e56b39dd622f5800f787e0822">setValue</a> (0.0);</div><div class="line">}</div><div class="line"></div><div class="line"><a class="code" href="classComponent.html">Component</a>* someKindOfComp;</div><div class="line"><a class="code" href="classSlider.html">Slider</a>* mySlider;</div><div class="line">...</div><div class="line">someKindOfComp-><a class="code" href="classComponent.html#a0e7be8c456a663615eb389ecd10b2c04">enterModalState</a> (<a class="code" href="classModalCallbackFunction.html#a66fc6472aeb843617982fa7df9a83fc3">ModalCallbackFunction::forComponent</a> (myCallbackFunction, mySlider));</div></div><!-- fragment --> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classModalComponentManager_1_1Callback.html" title="Receives callbacks when a modal component is dismissed. ">ModalComponentManager::Callback</a> </dd></dl>
<p>Referenced by <a class="el" href="classStandaloneFilterWindow.html#a43c03f9f453434a560a44011c9cd357e">StandaloneFilterWindow::buttonClicked()</a>.</p>
</div>
</div>
<a id="a81ac9bb08f1700c1f5621339cae63f40"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a81ac9bb08f1700c1f5621339cae63f40">§ </a></span>forComponent() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ComponentType , typename ParamType > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classModalComponentManager_1_1Callback.html">ModalComponentManager::Callback</a>* ModalCallbackFunction::forComponent </td>
<td>(</td>
<td class="paramtype">void(*)(int, ComponentType *, ParamType) </td>
<td class="paramname"><em>functionToCall</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">ComponentType * </td>
<td class="paramname"><em>component</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">ParamType </td>
<td class="paramname"><em>param</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a <a class="el" href="classModalComponentManager_1_1Callback.html" title="Receives callbacks when a modal component is dismissed. ">ModalComponentManager::Callback</a> that will call a static function with a component. </p>
<p>The function that you supply must take three parameters - the first being an int, which is the result code that was used when the modal component was dismissed, the second being a <a class="el" href="classComponent.html" title="The base class for all JUCE user-interface objects. ">Component</a> class, and the third being a custom type (which must be a primitive type or have copy-by-value semantics). The component will be stored as a <a class="el" href="classWeakReference.html" title="This class acts as a pointer which will automatically become null if the object to which it points is...">WeakReference</a>, so that if it gets deleted before this callback is invoked, the pointer that is passed into the function will be null.</p>
<p>E.g.</p><div class="fragment"><div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> myCallbackFunction (<span class="keywordtype">int</span> modalResult, <a class="code" href="classSlider.html">Slider</a>* mySlider, <a class="code" href="classString.html">String</a> customParam)</div><div class="line">{</div><div class="line"> <span class="keywordflow">if</span> (modalResult == 1 && mySlider != <span class="keyword">nullptr</span>) <span class="comment">// (must check that mySlider isn't null in case it was deleted..)</span></div><div class="line"> mySlider-><a class="code" href="classComponent.html#a64d1ad9a0f8f0d1757e62ac738b36b35">setName</a> (customParam);</div><div class="line">}</div><div class="line"></div><div class="line"><a class="code" href="classComponent.html">Component</a>* someKindOfComp;</div><div class="line"><a class="code" href="classSlider.html">Slider</a>* mySlider;</div><div class="line">...</div><div class="line">someKindOfComp-><a class="code" href="classComponent.html#a0e7be8c456a663615eb389ecd10b2c04">enterModalState</a> (<a class="code" href="classModalCallbackFunction.html#a66fc6472aeb843617982fa7df9a83fc3">ModalCallbackFunction::forComponent</a> (myCallbackFunction, mySlider, <a class="code" href="classString.html">String</a> (<span class="stringliteral">"hello"</span>)));</div></div><!-- fragment --> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classModalComponentManager_1_1Callback.html" title="Receives callbacks when a modal component is dismissed. ">ModalComponentManager::Callback</a> </dd></dl>
<p>References <a class="el" href="juce__PlatformDefs_8h.html#a6ab7a603bf4435c7cb286b1744366eb2">JUCE_DECLARE_NON_COPYABLE</a>, and <a class="el" href="juce__PlatformDefs_8h.html#a851b02724a8158a7f746c66b5758b3dd">JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="juce__ModalComponentManager_8h.html">juce_ModalComponentManager.h</a></li>
</ul>
</div><!-- contents -->
<hr class="footer"/>
<address class="footer"><small>All content © ROLI Ltd.</small></address><br/>
</body>
</html>
|