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 286 287 288 289 290
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Wt: Wt::Ext::ProgressDialog Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</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>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div class="navpath"><a class="el" href="namespaceWt.html">Wt</a>::<a class="el" href="namespaceWt_1_1Ext.html">Ext</a>::<a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html">ProgressDialog</a>
</div>
</div>
<div class="contents">
<h1>Wt::Ext::ProgressDialog Class Reference<br>
<small>
[<a class="el" href="group__ext.html">Ext widgets</a>]</small>
</h1><!-- doxytag: class="Wt::Ext::ProgressDialog" --><!-- doxytag: inherits="Wt::Ext::MessageBox" -->A standard dialog to inform the user of progress during a time consuming task.
<a href="#_details">More...</a>
<p>
<code>#include <Wt/Ext/ProgressDialog></code>
<p>
<div class="dynheader">
Inheritance diagram for Wt::Ext::ProgressDialog:</div>
<div class="dynsection">
<p><center><img src="classWt_1_1Ext_1_1ProgressDialog__inherit__graph.png" border="0" usemap="#Wt_1_1Ext_1_1ProgressDialog__inherit__map" alt="Inheritance graph"></center>
<map name="Wt_1_1Ext_1_1ProgressDialog__inherit__map">
<area shape="rect" href="classWt_1_1Ext_1_1MessageBox.html" title="A standard dialog for confirmation or to get simple user input." alt="" coords="11,603,160,629"><area shape="rect" href="classWt_1_1Ext_1_1Dialog.html" title="A dialog emulates a modal window that blocks the user-interface." alt="" coords="31,528,140,555"><area shape="rect" href="classWt_1_1Ext_1_1Panel.html" title="A container with a title and standard GUI elements." alt="" coords="32,453,139,480"><area shape="rect" href="classWt_1_1Ext_1_1Container.html" title="A container class which manages its contents using layout managers." alt="" coords="21,379,149,405"><area shape="rect" href="classWt_1_1Ext_1_1Component.html" title="An abstract base class for widgets that can be visually disabled." alt="" coords="16,304,155,331"><area shape="rect" href="classWt_1_1Ext_1_1Widget.html" title="An abstract base class for all Ext widgets." alt="" coords="29,229,141,256"><area shape="rect" href="classWt_1_1WWebWidget.html" title="A base class for widgets with an HTML counterpart." alt="" coords="24,155,147,181"><area shape="rect" href="classWt_1_1WWidget.html" title="The abstract base class for a user-interface component." alt="" coords="37,80,133,107"><area shape="rect" href="classWt_1_1WObject.html" title="A base class for objects that participate in the signal/slot system." alt="" coords="37,5,133,32"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
<p>
<a href="classWt_1_1Ext_1_1ProgressDialog-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#8dcabafaf4235c88cd7eee441448c615">ProgressDialog</a> (bool i18n=false)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a new progress dialog. <a href="#8dcabafaf4235c88cd7eee441448c615"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#a56cda8b6be0140160ef7f3f0a333358">ProgressDialog</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &text, const <a class="el" href="classWt_1_1WString.html">WString</a> &cancelButtonText, int minimum, int maximum, bool i18n=false)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a new progress dialog. <a href="#a56cda8b6be0140160ef7f3f0a333358"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="74d408dba39fce5fe2561218e5775f23"></a><!-- doxytag: member="Wt::Ext::ProgressDialog::setMinimum" ref="74d408dba39fce5fe2561218e5775f23" args="(int minimum)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#74d408dba39fce5fe2561218e5775f23">setMinimum</a> (int minimum)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the minimum value. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3e0e589ccd418b358840af358afab74e"></a><!-- doxytag: member="Wt::Ext::ProgressDialog::minimum" ref="3e0e589ccd418b358840af358afab74e" args="() const " -->
int </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#3e0e589ccd418b358840af358afab74e">minimum</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the minimum value. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ffbc5da9aaeff04433201c1fb0a9c942"></a><!-- doxytag: member="Wt::Ext::ProgressDialog::setMaximum" ref="ffbc5da9aaeff04433201c1fb0a9c942" args="(int maximum)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#ffbc5da9aaeff04433201c1fb0a9c942">setMaximum</a> (int maximum)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the maximum value. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8961b393b191d9a52d2e006a80ab3fce"></a><!-- doxytag: member="Wt::Ext::ProgressDialog::maximum" ref="8961b393b191d9a52d2e006a80ab3fce" args="() const " -->
int </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#8961b393b191d9a52d2e006a80ab3fce">maximum</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the maximum value. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ec47127780061076a85cb867c1669c9b"></a><!-- doxytag: member="Wt::Ext::ProgressDialog::setRange" ref="ec47127780061076a85cb867c1669c9b" args="(int minimum, int maximum)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#ec47127780061076a85cb867c1669c9b">setRange</a> (int minimum, int maximum)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Define the range. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#5d1e7ade20a3a89b52477ce9846d89c5">cancel</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Cancel the dialog. <a href="#5d1e7ade20a3a89b52477ce9846d89c5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#2c9b02eb5d639ec5d4c1214ad47cc2d9">reset</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Reset the dialog. <a href="#2c9b02eb5d639ec5d4c1214ad47cc2d9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9f57021b85bcc1dc7c1e9d820b8999d3"></a><!-- doxytag: member="Wt::Ext::ProgressDialog::setCancelButtonText" ref="9f57021b85bcc1dc7c1e9d820b8999d3" args="(const WString &text)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#9f57021b85bcc1dc7c1e9d820b8999d3">setCancelButtonText</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &text)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the text used for the cancel button. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="002c659c327ab7bab26aaa424daf4e2c"></a><!-- doxytag: member="Wt::Ext::ProgressDialog::setValue" ref="002c659c327ab7bab26aaa424daf4e2c" args="(int progress)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#002c659c327ab7bab26aaa424daf4e2c">setValue</a> (int progress)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current value (in the range from <a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#3e0e589ccd418b358840af358afab74e" title="Return the minimum value.">minimum()</a> to <a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#8961b393b191d9a52d2e006a80ab3fce" title="Return the maximum value.">maximum()</a>). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ec354c2676e811e2c354ce22f02ef1c7"></a><!-- doxytag: member="Wt::Ext::ProgressDialog::value" ref="ec354c2676e811e2c354ce22f02ef1c7" args="() const " -->
int </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#ec354c2676e811e2c354ce22f02ef1c7">value</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the current value. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#e728af17b42f24fef38014d2b6cefc97">wasCanceled</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return if the progress dialog was cancelled. <a href="#e728af17b42f24fef38014d2b6cefc97"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1Signal.html">Signal</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#c13c421f889ac475a025baed7739ea97">canceled</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Signal emitted when the user cancels the dialog. <a href="#c13c421f889ac475a025baed7739ea97"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A standard dialog to inform the user of progress during a time consuming task.
<p>
A progress bar is shown to show progress from <a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#3e0e589ccd418b358840af358afab74e" title="Return the minimum value.">minimum()</a> to <a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#8961b393b191d9a52d2e006a80ab3fce" title="Return the maximum value.">maximum()</a>, with the current value within (this range) set using <a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#002c659c327ab7bab26aaa424daf4e2c" title="Set the current value (in the range from minimum() to maximum()).">setValue()</a>. When the user cancels the dialog, the dialog is hidden and the <a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#c13c421f889ac475a025baed7739ea97" title="Signal emitted when the user cancels the dialog.">canceled()</a> signal is emitted.<p>
The progress dialog may be used in two ways.<p>
The easiest way is using a code snippet like this: <div class="fragment"><pre class="fragment"> <a class="code" href="classWt_1_1Ext_1_1ProgressDialog.html" title="A standard dialog to inform the user of progress during a time consuming task.">Wt::Ext::ProgressDialog</a> progress(<span class="stringliteral">"Converting contact details..."</span>, <span class="stringliteral">"Cancel"</span>, 0, contacts_.size());
progress.setWindowTitle(<span class="stringliteral">"Import Contacts"</span>);
<span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> i = 0; i < contacts_.size(); ++i) {
progress.setValue(i);
<a class="code" href="classWt_1_1WApplication.html#38d922da0a0d83395519f3eaab85d0f6" title="Returns the current application instance.">Wt::WApplication::instance</a>()->processEvents();
<span class="keywordflow">if</span> (!progress.wasCanceled()) {
convertContactDetails(contacts_[i]);
} <span class="keywordflow">else</span> {
<a class="code" href="classWt_1_1WWidget.html#52dcef5a385ddfa0a8c3e6c20000f181" title="Shows the widget.">Wt::Ext::MessageBox::show</a>(<span class="stringliteral">"Operation cancelled"</span>,
<span class="stringliteral">"You may import your contact details any time later."</span>, <a class="code" href="namespaceWt.html#270a5e1af09979a6559f0f39e3d93062f92b793210df9123b9be1ee11dd0d36d" title="An OK button.">Ok</a>);
<span class="keywordflow">break</span>;
}
}
</pre></div><p>
Using this approach, <a class="el" href="classWt_1_1WApplication.html#48ceb7972ef7ec0e557adf441f660f2f" title="Processes UI events.">WApplication::processEvents()</a> is used to synchronize the server and client state. This approach has the drawback that browser interactivity is limited.<p>
The more involved approach involves the use of <a class="el" href="classWt_1_1WTimer.html" title="A utility class which provides timer signals and single-shot timers.">WTimer</a> to update the progress in conjunction with a worker thread to do the actual work.<p>
<div align="center">
<img src="ExtProgressDialog-1.png" alt="ExtProgressDialog-1.png">
<p><strong>Example of a ProgressDialog</strong></p></div>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="8dcabafaf4235c88cd7eee441448c615"></a><!-- doxytag: member="Wt::Ext::ProgressDialog::ProgressDialog" ref="8dcabafaf4235c88cd7eee441448c615" args="(bool i18n=false)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Wt::Ext::ProgressDialog::ProgressDialog </td>
<td>(</td>
<td class="paramtype">bool </td>
<td class="paramname"> <em>i18n</em> = <code>false</code> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Create a new progress dialog.
<p>
Creates a new dialog, with window title 'Progress...', no message, and a Cancel button. The progress range is defined from 0 to 100.
</div>
</div><p>
<a class="anchor" name="a56cda8b6be0140160ef7f3f0a333358"></a><!-- doxytag: member="Wt::Ext::ProgressDialog::ProgressDialog" ref="a56cda8b6be0140160ef7f3f0a333358" args="(const WString &text, const WString &cancelButtonText, int minimum, int maximum, bool i18n=false)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Wt::Ext::ProgressDialog::ProgressDialog </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> & </td>
<td class="paramname"> <em>text</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> & </td>
<td class="paramname"> <em>cancelButtonText</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>minimum</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>maximum</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"> <em>i18n</em> = <code>false</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Create a new progress dialog.
<p>
Creates a new dialog, with window title 'Progress...', the given message, and a Cancel button. The progress range is defined from <em>minimum</em> to <em>maximum</em>
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="5d1e7ade20a3a89b52477ce9846d89c5"></a><!-- doxytag: member="Wt::Ext::ProgressDialog::cancel" ref="5d1e7ade20a3a89b52477ce9846d89c5" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Wt::Ext::ProgressDialog::cancel </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Cancel the dialog.
<p>
Sets the state to cancelled, and hides the dialog. Calling this method does not emit the <a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#c13c421f889ac475a025baed7739ea97">canceled</a> signal.
</div>
</div><p>
<a class="anchor" name="2c9b02eb5d639ec5d4c1214ad47cc2d9"></a><!-- doxytag: member="Wt::Ext::ProgressDialog::reset" ref="2c9b02eb5d639ec5d4c1214ad47cc2d9" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Wt::Ext::ProgressDialog::reset </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Reset the dialog.
<p>
The value is reset to the <a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#3e0e589ccd418b358840af358afab74e" title="Return the minimum value.">minimum()</a>, and the cancelled state is cleared.
</div>
</div><p>
<a class="anchor" name="e728af17b42f24fef38014d2b6cefc97"></a><!-- doxytag: member="Wt::Ext::ProgressDialog::wasCanceled" ref="e728af17b42f24fef38014d2b6cefc97" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool Wt::Ext::ProgressDialog::wasCanceled </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Return if the progress dialog was cancelled.
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#c13c421f889ac475a025baed7739ea97" title="Signal emitted when the user cancels the dialog.">canceled</a>, <a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#5d1e7ade20a3a89b52477ce9846d89c5" title="Cancel the dialog.">cancel()</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="c13c421f889ac475a025baed7739ea97"></a><!-- doxytag: member="Wt::Ext::ProgressDialog::canceled" ref="c13c421f889ac475a025baed7739ea97" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classWt_1_1Signal.html">Signal</a>& Wt::Ext::ProgressDialog::canceled </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Signal emitted when the user cancels the dialog.
<p>
When the user cancels the dialog, the dialog is hidden, and the state is set to being cancelled.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Ext_1_1ProgressDialog.html#e728af17b42f24fef38014d2b6cefc97" title="Return if the progress dialog was cancelled.">wasCanceled()</a> </dd></dl>
</div>
</div><p>
</div>
<hr size="1"><address style="align: right;"><small>
Generated on Fri Mar 26 17:12:08 2010 for <a href="http://www.webtoolkit.eu/wt/">Wt</a> by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6</small></address>
</body>
</html>
|