<!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>Wt examples: Popup Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Wt examples  <span id="projectnumber">3.2.3</span> </div> </td> </tr> </tbody> </table> </div> <!-- Generated by Doxygen 1.7.5.1 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</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> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="inherits.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pub-static-methods">Static Public Member Functions</a> | <a href="#pub-attribs">Public Attributes</a> | <a href="#pri-types">Private Types</a> | <a href="#pri-methods">Private Member Functions</a> | <a href="#pri-attribs">Private Attributes</a> </div> <div class="headertitle"> <div class="title">Popup Class Reference<div class="ingroups"><a class="el" href="group__javascript.html">Javascript - Wt interaction example</a></div></div> </div> </div> <div class="contents"> <!-- doxytag: class="Popup" --><!-- doxytag: inherits="Wt::WObject" --> <p>A JavaScript based popup window, encapsulating the Javascript functions alert(), confirm(), and prompt(). <a href="classPopup.html#details">More...</a></p> <p><code>#include <<a class="el" href="Popup_8h_source.html">Popup.h</a>></code></p> <div class="dynheader"> Inheritance diagram for Popup:</div> <div class="dyncontent"> <div class="center"><img src="classPopup__inherit__graph.png" border="0" usemap="#Popup_inherit__map" alt="Inheritance graph"/></div> <map name="Popup_inherit__map" id="Popup_inherit__map"> <area shape="rect" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WObject.html" title="Wt::WObject" alt="" coords="5,5,101,32"/></map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <p><a href="classPopup-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">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#a29f79258a69ee042dbf970b7883b2b97">setMessage</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> &message)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Change the message. <a href="#a29f79258a69ee042dbf970b7883b2b97"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#a97c14de0bcf9ca764b29eceb7627f14c">setDefaultValue</a> (const std::string defaultValue)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Change the default value for a prompt dialog. <a href="#a97c14de0bcf9ca764b29eceb7627f14c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#a259fd9e138e094ad5335d47f024652f7">message</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the current message. <a href="#a259fd9e138e094ad5335d47f024652f7"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const std::string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#a3069c5552a1ce6faeec9c580ae7f62ad">defaultValue</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the default value for a prompt dialog. <a href="#a3069c5552a1ce6faeec9c580ae7f62ad"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSignal.html">JSignal</a>< std::string > & </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#a3705ac1c6feedfbf737ae729ec097bab">okPressed</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Signal emitted when ok pressed. <a href="#a3705ac1c6feedfbf737ae729ec097bab"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSignal.html">JSignal</a>< void > & </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#ab99240088211d195ff0fc7fa2015c586">cancelPressed</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Signal emitted when cancel is pressed. <a href="#ab99240088211d195ff0fc7fa2015c586"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="pub-static-methods"></a> Static Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classPopup.html">Popup</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#a2ab31c6aca9d435eb734a8be24eea7b9">createConfirm</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> &message, <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WObject.html">WObject</a> *<a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WObject.html#a2af8f7ec8d3807d434e1f70d1245c6b4">parent</a>=0)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create a confirm dialog. <a href="#a2ab31c6aca9d435eb734a8be24eea7b9"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classPopup.html">Popup</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#adf73b1320baaea8d1a090d4bb3e7f3ac">createPrompt</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> &message, const std::string defaultValue, <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WObject.html">WObject</a> *<a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WObject.html#a2af8f7ec8d3807d434e1f70d1245c6b4">parent</a>=0)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create a prompt dialog with the given default value. <a href="#adf73b1320baaea8d1a090d4bb3e7f3ac"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classPopup.html">Popup</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#acae6cd51df216642043c8ced694dc7e4">createAlert</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> &message, <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WObject.html">WObject</a> *<a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WObject.html#a2af8f7ec8d3807d434e1f70d1245c6b4">parent</a>=0)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create an alert dialog. <a href="#acae6cd51df216642043c8ced694dc7e4"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="pub-attribs"></a> Public Attributes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSlot.html">JSlot</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#a4fba40d8284a8022842f523dfa6318fa">show</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Show the dialog. <a href="#a4fba40d8284a8022842f523dfa6318fa"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="pri-types"></a> Private Types</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6d">Type</a> { <a class="el" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6dacd90389c9867dc8a1b57a91ff49a64d2">Confirm</a>, <a class="el" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6da03d63ceea0186677add5d6ae5f4f6f57">Alert</a>, <a class="el" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6da664c702f59a95e937f31a9319fd3f755">Prompt</a> }</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classPopup.html" title="A JavaScript based popup window, encapsulating the Javascript functions alert(), confirm(), and prompt().">Popup</a> type. <a href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6d">More...</a><br/></td></tr> <tr><td colspan="2"><h2><a name="pri-methods"></a> Private Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#ac2340a670ddef77ae21abe256b486624">Popup</a> (<a class="el" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6d">Type</a> t, const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> &message, const std::string defaultValue, <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WObject.html">WObject</a> *<a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WObject.html#a2af8f7ec8d3807d434e1f70d1245c6b4">parent</a>)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classPopup.html" title="A JavaScript based popup window, encapsulating the Javascript functions alert(), confirm(), and prompt().">Popup</a> constructor. <a href="#ac2340a670ddef77ae21abe256b486624"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#aeff3dfbced8f5d33b383940533ea4b58">setJavaScript</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Update the javascript code. <a href="#aeff3dfbced8f5d33b383940533ea4b58"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="pri-attribs"></a> Private Attributes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSignal.html">JSignal</a>< std::string > </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#ad9472a44db701b362c0e5c883b88d430">okPressed_</a></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSignal.html">JSignal</a>< void > </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#ab58288c7138f599483478eb814966f69">cancelPressed_</a></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6d">Type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#a6fc4373c05e651c9d071cbbb3b089dfb">t_</a></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#a7e69edf1f3b9ce51b625214a2225d374">message_</a></td></tr> <tr><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classPopup.html#ab6ea80a8a874b3be156ce3bb79377392">defaultValue_</a></td></tr> </table> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>A JavaScript based popup window, encapsulating the Javascript functions alert(), confirm(), and prompt(). </p> <p>Use one of the create static methods to create a popup. This will not display the popup, until either the show slot is triggered from an event handler, or is executed using it's exec() method.</p> <p>When the user closes the popup, either the okPressed or cancelPressed signal is emitted. For a prompt dialog, the value is passed as a parameter to the okPressed signal. </p> <p>Definition at line <a class="el" href="Popup_8h_source.html#l00032">32</a> of file <a class="el" href="Popup_8h_source.html">Popup.h</a>.</p> </div><hr/><h2>Member Enumeration Documentation</h2> <a class="anchor" id="ac396e0200d1839ece9e43bb97ba38c6d"></a><!-- doxytag: member="Popup::Type" ref="ac396e0200d1839ece9e43bb97ba38c6d" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6d">Popup::Type</a><code> [private]</code></td> </tr> </table> </div> <div class="memdoc"> <p><a class="el" href="classPopup.html" title="A JavaScript based popup window, encapsulating the Javascript functions alert(), confirm(), and prompt().">Popup</a> type. </p> <dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><em><a class="anchor" id="ac396e0200d1839ece9e43bb97ba38c6dacd90389c9867dc8a1b57a91ff49a64d2"></a><!-- doxytag: member="Confirm" ref="ac396e0200d1839ece9e43bb97ba38c6dacd90389c9867dc8a1b57a91ff49a64d2" args="" -->Confirm</em> </td><td> </td></tr> <tr><td valign="top"><em><a class="anchor" id="ac396e0200d1839ece9e43bb97ba38c6da03d63ceea0186677add5d6ae5f4f6f57"></a><!-- doxytag: member="Alert" ref="ac396e0200d1839ece9e43bb97ba38c6da03d63ceea0186677add5d6ae5f4f6f57" args="" -->Alert</em> </td><td> </td></tr> <tr><td valign="top"><em><a class="anchor" id="ac396e0200d1839ece9e43bb97ba38c6da664c702f59a95e937f31a9319fd3f755"></a><!-- doxytag: member="Prompt" ref="ac396e0200d1839ece9e43bb97ba38c6da664c702f59a95e937f31a9319fd3f755" args="" -->Prompt</em> </td><td> </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="Popup_8h_source.html#l00083">83</a> of file <a class="el" href="Popup_8h_source.html">Popup.h</a>.</p> <div class="fragment"><pre class="fragment">{ <a class="code" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6dacd90389c9867dc8a1b57a91ff49a64d2">Confirm</a>, <a class="code" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6da03d63ceea0186677add5d6ae5f4f6f57">Alert</a>, <a class="code" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6da664c702f59a95e937f31a9319fd3f755">Prompt</a> }; </pre></div> </div> </div> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="ac2340a670ddef77ae21abe256b486624"></a><!-- doxytag: member="Popup::Popup" ref="ac2340a670ddef77ae21abe256b486624" args="(Type t, const WString &message, const std::string defaultValue, WObject *parent)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Popup::Popup </td> <td>(</td> <td class="paramtype"><a class="el" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6d">Type</a> </td> <td class="paramname"><em>t</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> & </td> <td class="paramname"><em>message</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string </td> <td class="paramname"><em>defaultValue</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WObject.html">WObject</a> * </td> <td class="paramname"><em>parent</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [private]</code></td> </tr> </table> </div> <div class="memdoc"> <p><a class="el" href="classPopup.html" title="A JavaScript based popup window, encapsulating the Javascript functions alert(), confirm(), and prompt().">Popup</a> constructor. </p> <p>Definition at line <a class="el" href="Popup_8C_source.html#l00012">12</a> of file <a class="el" href="Popup_8C_source.html">Popup.C</a>.</p> <div class="fragment"><pre class="fragment"> : <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WObject.html#a1da12f5d82488adcca912c596b9398ea">WObject</a>(parent), <a class="code" href="classPopup.html#ad9472a44db701b362c0e5c883b88d430">okPressed_</a>(<span class="keyword">this</span>, <span class="stringliteral">"ok"</span>), <a class="code" href="classPopup.html#ab58288c7138f599483478eb814966f69">cancelPressed_</a>(<span class="keyword">this</span>, <span class="stringliteral">"cancel"</span>), <a class="code" href="classPopup.html#a6fc4373c05e651c9d071cbbb3b089dfb">t_</a>(t), <a class="code" href="classPopup.html#a7e69edf1f3b9ce51b625214a2225d374">message_</a>(message), <a class="code" href="classPopup.html#ab6ea80a8a874b3be156ce3bb79377392">defaultValue_</a>(<a class="code" href="classPopup.html#a3069c5552a1ce6faeec9c580ae7f62ad" title="Get the default value for a prompt dialog.">defaultValue</a>) { <a class="code" href="classPopup.html#aeff3dfbced8f5d33b383940533ea4b58" title="Update the javascript code.">setJavaScript</a>(); } </pre></div> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="ab99240088211d195ff0fc7fa2015c586"></a><!-- doxytag: member="Popup::cancelPressed" ref="ab99240088211d195ff0fc7fa2015c586" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSignal.html">JSignal</a><void>& Popup::cancelPressed </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Signal emitted when cancel is pressed. </p> <p>Definition at line <a class="el" href="Popup_8h_source.html#l00078">78</a> of file <a class="el" href="Popup_8h_source.html">Popup.h</a>.</p> <div class="fragment"><pre class="fragment">{ <span class="keywordflow">return</span> <a class="code" href="classPopup.html#ab58288c7138f599483478eb814966f69">cancelPressed_</a>; } </pre></div> </div> </div> <a class="anchor" id="acae6cd51df216642043c8ced694dc7e4"></a><!-- doxytag: member="Popup::createAlert" ref="acae6cd51df216642043c8ced694dc7e4" args="(const WString &message, WObject *parent=0)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classPopup.html">Popup</a> * Popup::createAlert </td> <td>(</td> <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> & </td> <td class="paramname"><em>message</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WObject.html">WObject</a> * </td> <td class="paramname"><em>parent</em> = <code>0</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Create an alert dialog. </p> <p>Definition at line <a class="el" href="Popup_8C_source.html#l00077">77</a> of file <a class="el" href="Popup_8C_source.html">Popup.C</a>.</p> <div class="fragment"><pre class="fragment">{ <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classPopup.html#ac2340a670ddef77ae21abe256b486624" title="Popup constructor.">Popup</a>(<a class="code" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6da03d63ceea0186677add5d6ae5f4f6f57">Alert</a>, message, std::string(), parent); } </pre></div> </div> </div> <a class="anchor" id="a2ab31c6aca9d435eb734a8be24eea7b9"></a><!-- doxytag: member="Popup::createConfirm" ref="a2ab31c6aca9d435eb734a8be24eea7b9" args="(const WString &message, WObject *parent=0)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classPopup.html">Popup</a> * Popup::createConfirm </td> <td>(</td> <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> & </td> <td class="paramname"><em>message</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WObject.html">WObject</a> * </td> <td class="paramname"><em>parent</em> = <code>0</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Create a confirm dialog. </p> <p>Definition at line <a class="el" href="Popup_8C_source.html#l00072">72</a> of file <a class="el" href="Popup_8C_source.html">Popup.C</a>.</p> <div class="fragment"><pre class="fragment">{ <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classPopup.html#ac2340a670ddef77ae21abe256b486624" title="Popup constructor.">Popup</a>(<a class="code" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6dacd90389c9867dc8a1b57a91ff49a64d2">Confirm</a>, message, std::string(), parent); } </pre></div> </div> </div> <a class="anchor" id="adf73b1320baaea8d1a090d4bb3e7f3ac"></a><!-- doxytag: member="Popup::createPrompt" ref="adf73b1320baaea8d1a090d4bb3e7f3ac" args="(const WString &message, const std::string defaultValue, WObject *parent=0)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classPopup.html">Popup</a> * Popup::createPrompt </td> <td>(</td> <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> & </td> <td class="paramname"><em>message</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string </td> <td class="paramname"><em>defaultValue</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WObject.html">WObject</a> * </td> <td class="paramname"><em>parent</em> = <code>0</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Create a prompt dialog with the given default value. </p> <p>Definition at line <a class="el" href="Popup_8C_source.html#l00082">82</a> of file <a class="el" href="Popup_8C_source.html">Popup.C</a>.</p> <div class="fragment"><pre class="fragment">{ <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classPopup.html#ac2340a670ddef77ae21abe256b486624" title="Popup constructor.">Popup</a>(<a class="code" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6da664c702f59a95e937f31a9319fd3f755">Prompt</a>, message, <a class="code" href="classPopup.html#a3069c5552a1ce6faeec9c580ae7f62ad" title="Get the default value for a prompt dialog.">defaultValue</a>, parent); } </pre></div> </div> </div> <a class="anchor" id="a3069c5552a1ce6faeec9c580ae7f62ad"></a><!-- doxytag: member="Popup::defaultValue" ref="a3069c5552a1ce6faeec9c580ae7f62ad" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const std::string& Popup::defaultValue </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Get the default value for a prompt dialog. </p> <p>Definition at line <a class="el" href="Popup_8h_source.html#l00063">63</a> of file <a class="el" href="Popup_8h_source.html">Popup.h</a>.</p> <div class="fragment"><pre class="fragment">{ <span class="keywordflow">return</span> <a class="code" href="classPopup.html#ab6ea80a8a874b3be156ce3bb79377392">defaultValue_</a>; } </pre></div> </div> </div> <a class="anchor" id="a259fd9e138e094ad5335d47f024652f7"></a><!-- doxytag: member="Popup::message" ref="a259fd9e138e094ad5335d47f024652f7" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a>& Popup::message </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Get the current message. </p> <p>Definition at line <a class="el" href="Popup_8h_source.html#l00059">59</a> of file <a class="el" href="Popup_8h_source.html">Popup.h</a>.</p> <div class="fragment"><pre class="fragment">{ <span class="keywordflow">return</span> <a class="code" href="classPopup.html#a7e69edf1f3b9ce51b625214a2225d374">message_</a>; } </pre></div> </div> </div> <a class="anchor" id="a3705ac1c6feedfbf737ae729ec097bab"></a><!-- doxytag: member="Popup::okPressed" ref="a3705ac1c6feedfbf737ae729ec097bab" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSignal.html">JSignal</a><std::string>& Popup::okPressed </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Signal emitted when ok pressed. </p> <p>Definition at line <a class="el" href="Popup_8h_source.html#l00074">74</a> of file <a class="el" href="Popup_8h_source.html">Popup.h</a>.</p> <div class="fragment"><pre class="fragment">{ <span class="keywordflow">return</span> <a class="code" href="classPopup.html#ad9472a44db701b362c0e5c883b88d430">okPressed_</a>; } </pre></div> </div> </div> <a class="anchor" id="a97c14de0bcf9ca764b29eceb7627f14c"></a><!-- doxytag: member="Popup::setDefaultValue" ref="a97c14de0bcf9ca764b29eceb7627f14c" args="(const std::string defaultValue)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Popup::setDefaultValue </td> <td>(</td> <td class="paramtype">const std::string </td> <td class="paramname"><em>defaultValue</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Change the default value for a prompt dialog. </p> <p>Definition at line <a class="el" href="Popup_8C_source.html#l00066">66</a> of file <a class="el" href="Popup_8C_source.html">Popup.C</a>.</p> <div class="fragment"><pre class="fragment">{ <a class="code" href="classPopup.html#ab6ea80a8a874b3be156ce3bb79377392">defaultValue_</a> = <a class="code" href="classPopup.html#a3069c5552a1ce6faeec9c580ae7f62ad" title="Get the default value for a prompt dialog.">defaultValue</a>; <a class="code" href="classPopup.html#aeff3dfbced8f5d33b383940533ea4b58" title="Update the javascript code.">setJavaScript</a>(); } </pre></div> </div> </div> <a class="anchor" id="aeff3dfbced8f5d33b383940533ea4b58"></a><!-- doxytag: member="Popup::setJavaScript" ref="aeff3dfbced8f5d33b383940533ea4b58" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Popup::setJavaScript </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [private]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Update the javascript code. </p> <p>Definition at line <a class="el" href="Popup_8C_source.html#l00024">24</a> of file <a class="el" href="Popup_8C_source.html">Popup.C</a>.</p> <div class="fragment"><pre class="fragment">{ <span class="comment">/*</span> <span class="comment"> * Sets the JavaScript code.</span> <span class="comment"> *</span> <span class="comment"> * Notice how Wt.emit() is used to emit the okPressed or cancelPressed</span> <span class="comment"> * signal, and how arguments may be passed to it, matching the number and</span> <span class="comment"> * type of arguments in the JSignal definition.</span> <span class="comment"> */</span> <span class="keywordflow">switch</span> (<a class="code" href="classPopup.html#a6fc4373c05e651c9d071cbbb3b089dfb">t_</a>) { <span class="keywordflow">case</span> <a class="code" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6dacd90389c9867dc8a1b57a91ff49a64d2">Confirm</a>: <a class="code" href="classPopup.html#a4fba40d8284a8022842f523dfa6318fa" title="Show the dialog.">show</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSlot.html#a4e28a8ef6d2965aeaac0c5dcf587bbbb">setJavaScript</a> (<span class="stringliteral">"function(){ if (confirm('"</span> + <a class="code" href="classPopup.html#a7e69edf1f3b9ce51b625214a2225d374">message_</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html#a0b90340ac2dbacb9b4d81e92d9070066">narrow</a>() + <span class="stringliteral">"')) {"</span> + <a class="code" href="classPopup.html#ad9472a44db701b362c0e5c883b88d430">okPressed_</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSignal.html#a449dbc079722b0ed9a9fd5df43e359f0">createCall</a>(<span class="stringliteral">"''"</span>) + <span class="stringliteral">"} else {"</span> + <a class="code" href="classPopup.html#ab58288c7138f599483478eb814966f69">cancelPressed_</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSignal.html#a449dbc079722b0ed9a9fd5df43e359f0">createCall</a>() + <span class="stringliteral">"}}"</span>); <span class="keywordflow">break</span>; <span class="keywordflow">case</span> <a class="code" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6da03d63ceea0186677add5d6ae5f4f6f57">Alert</a>: <a class="code" href="classPopup.html#a4fba40d8284a8022842f523dfa6318fa" title="Show the dialog.">show</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSlot.html#a4e28a8ef6d2965aeaac0c5dcf587bbbb">setJavaScript</a> (<span class="stringliteral">"function(){ alert('"</span> + <a class="code" href="classPopup.html#a7e69edf1f3b9ce51b625214a2225d374">message_</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html#a0b90340ac2dbacb9b4d81e92d9070066">narrow</a>() + <span class="stringliteral">"');"</span> + <a class="code" href="classPopup.html#ad9472a44db701b362c0e5c883b88d430">okPressed_</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSignal.html#a449dbc079722b0ed9a9fd5df43e359f0">createCall</a>(<span class="stringliteral">"''"</span>) + <span class="stringliteral">"}"</span>); <span class="keywordflow">break</span>; <span class="keywordflow">case</span> <a class="code" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6da664c702f59a95e937f31a9319fd3f755">Prompt</a>: <a class="code" href="classPopup.html#a4fba40d8284a8022842f523dfa6318fa" title="Show the dialog.">show</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSlot.html#a4e28a8ef6d2965aeaac0c5dcf587bbbb">setJavaScript</a> (<span class="stringliteral">"function(){var n = prompt('"</span> + <a class="code" href="classPopup.html#a7e69edf1f3b9ce51b625214a2225d374">message_</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html#a0b90340ac2dbacb9b4d81e92d9070066">narrow</a>() + <span class="stringliteral">"', '"</span> + <a class="code" href="classPopup.html#ab6ea80a8a874b3be156ce3bb79377392">defaultValue_</a> + <span class="stringliteral">"');"</span> <span class="stringliteral">"if (n != null) {"</span> + <a class="code" href="classPopup.html#ad9472a44db701b362c0e5c883b88d430">okPressed_</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSignal.html#a449dbc079722b0ed9a9fd5df43e359f0">createCall</a>(<span class="stringliteral">"n"</span>) + <span class="stringliteral">"} else {"</span> + <a class="code" href="classPopup.html#ab58288c7138f599483478eb814966f69">cancelPressed_</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSignal.html#a449dbc079722b0ed9a9fd5df43e359f0">createCall</a>() + <span class="stringliteral">"}}"</span>); } } </pre></div> </div> </div> <a class="anchor" id="a29f79258a69ee042dbf970b7883b2b97"></a><!-- doxytag: member="Popup::setMessage" ref="a29f79258a69ee042dbf970b7883b2b97" args="(const WString &message)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Popup::setMessage </td> <td>(</td> <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> & </td> <td class="paramname"><em>message</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Change the message. </p> <p>Definition at line <a class="el" href="Popup_8C_source.html#l00060">60</a> of file <a class="el" href="Popup_8C_source.html">Popup.C</a>.</p> <div class="fragment"><pre class="fragment">{ <a class="code" href="classPopup.html#a7e69edf1f3b9ce51b625214a2225d374">message_</a> = <a class="code" href="classPopup.html#a259fd9e138e094ad5335d47f024652f7" title="Get the current message.">message</a>; <a class="code" href="classPopup.html#aeff3dfbced8f5d33b383940533ea4b58" title="Update the javascript code.">setJavaScript</a>(); } </pre></div> </div> </div> <hr/><h2>Member Data Documentation</h2> <a class="anchor" id="ab58288c7138f599483478eb814966f69"></a><!-- doxytag: member="Popup::cancelPressed_" ref="ab58288c7138f599483478eb814966f69" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSignal.html">JSignal</a><void> <a class="el" href="classPopup.html#ab58288c7138f599483478eb814966f69">Popup::cancelPressed_</a><code> [private]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="Popup_8h_source.html#l00091">91</a> of file <a class="el" href="Popup_8h_source.html">Popup.h</a>.</p> </div> </div> <a class="anchor" id="ab6ea80a8a874b3be156ce3bb79377392"></a><!-- doxytag: member="Popup::defaultValue_" ref="ab6ea80a8a874b3be156ce3bb79377392" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string <a class="el" href="classPopup.html#ab6ea80a8a874b3be156ce3bb79377392">Popup::defaultValue_</a><code> [private]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="Popup_8h_source.html#l00095">95</a> of file <a class="el" href="Popup_8h_source.html">Popup.h</a>.</p> </div> </div> <a class="anchor" id="a7e69edf1f3b9ce51b625214a2225d374"></a><!-- doxytag: member="Popup::message_" ref="a7e69edf1f3b9ce51b625214a2225d374" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> <a class="el" href="classPopup.html#a7e69edf1f3b9ce51b625214a2225d374">Popup::message_</a><code> [private]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="Popup_8h_source.html#l00094">94</a> of file <a class="el" href="Popup_8h_source.html">Popup.h</a>.</p> </div> </div> <a class="anchor" id="ad9472a44db701b362c0e5c883b88d430"></a><!-- doxytag: member="Popup::okPressed_" ref="ad9472a44db701b362c0e5c883b88d430" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSignal.html">JSignal</a><std::string> <a class="el" href="classPopup.html#ad9472a44db701b362c0e5c883b88d430">Popup::okPressed_</a><code> [private]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="Popup_8h_source.html#l00090">90</a> of file <a class="el" href="Popup_8h_source.html">Popup.h</a>.</p> </div> </div> <a class="anchor" id="a4fba40d8284a8022842f523dfa6318fa"></a><!-- doxytag: member="Popup::show" ref="a4fba40d8284a8022842f523dfa6318fa" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1JSlot.html">JSlot</a> <a class="el" href="classPopup.html#a4fba40d8284a8022842f523dfa6318fa">Popup::show</a></td> </tr> </table> </div> <div class="memdoc"> <p>Show the dialog. </p> <p>Use show.exec() to show the dialog, or connect the slot to an EventSignal to directly show the dialog without a server round trip. </p> <p>Definition at line <a class="el" href="Popup_8h_source.html#l00070">70</a> of file <a class="el" href="Popup_8h_source.html">Popup.h</a>.</p> </div> </div> <a class="anchor" id="a6fc4373c05e651c9d071cbbb3b089dfb"></a><!-- doxytag: member="Popup::t_" ref="a6fc4373c05e651c9d071cbbb3b089dfb" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classPopup.html#ac396e0200d1839ece9e43bb97ba38c6d">Type</a> <a class="el" href="classPopup.html#a6fc4373c05e651c9d071cbbb3b089dfb">Popup::t_</a><code> [private]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="Popup_8h_source.html#l00093">93</a> of file <a class="el" href="Popup_8h_source.html">Popup.h</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li>/home/koen/project/wt/public-git/wt/examples/javascript/<a class="el" href="Popup_8h_source.html">Popup.h</a></li> <li>/home/koen/project/wt/public-git/wt/examples/javascript/<a class="el" href="Popup_8C_source.html">Popup.C</a></li> </ul> </div> <hr size="1"><address style="text-align: right; margin: 3px"><small> Generated on Thu Nov 1 2012 for <a href="http://www.webtoolkit.eu/wt">the C++ Web Toolkit (Wt)</a> by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" border="0" style="vertical-align: middle; display: inline-block; height: 2em"></a> 1.7.5.1</small></address> </body> </html>