File: classHelloApplication.html

package info (click to toggle)
witty 3.2.1-2%2Bdeb7u1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 70,436 kB
  • sloc: cpp: 117,095; ansic: 77,999; xml: 7,564; sh: 1,037; perl: 208; makefile: 144; java: 86; sql: 14
file content (211 lines) | stat: -rw-r--r-- 14,758 bytes parent folder | download
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
<!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: HelloApplication 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
   &#160;<span id="projectnumber">3.2.1</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&#160;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&#160;List</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a>  </div>
  <div class="headertitle">
<div class="title">HelloApplication Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="HelloApplication" --><!-- doxytag: inherits="Wt::WApplication" --><div class="dynheader">
Inheritance diagram for HelloApplication:</div>
<div class="dyncontent">
<div class="center"><img src="classHelloApplication__inherit__graph.png" border="0" usemap="#HelloApplication_inherit__map" alt="Inheritance graph"/></div>
<map name="HelloApplication_inherit__map" id="HelloApplication_inherit__map">
<area shape="rect" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WApplication.html" title="Wt::WApplication" alt="" coords="5,80,128,107"/><area shape="rect" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WObject.html" title="Wt::WObject" alt="" coords="19,5,115,32"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="classHelloApplication-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHelloApplication.html#af8cfe75959bce2e4fba80a46f009c4a6">HelloApplication</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WEnvironment.html">WEnvironment</a> &amp;env)</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">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHelloApplication.html#a94de3317a1e6e45964a3dfa9aacef9f9">greet</a> ()</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_1WLineEdit.html">WLineEdit</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHelloApplication.html#a223a6b0ae8f592504528d044b932d4d6">nameEdit_</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WText.html">WText</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHelloApplication.html#a060ca5306a0289f4097ff6f83755cbad">greeting_</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="hello_8C_source.html#l00023">23</a> of file <a class="el" href="hello_8C_source.html">hello.C</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="af8cfe75959bce2e4fba80a46f009c4a6"></a><!-- doxytag: member="HelloApplication::HelloApplication" ref="af8cfe75959bce2e4fba80a46f009c4a6" args="(const WEnvironment &amp;env)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">HelloApplication::HelloApplication </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WEnvironment.html">WEnvironment</a> &amp;&#160;</td>
          <td class="paramname"><em>env</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="hello_8C_source.html#l00041">41</a> of file <a class="el" href="hello_8C_source.html">hello.C</a>.</p>
<div class="fragment"><pre class="fragment">  : <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WApplication.html#ae29a843f4d50159b17abfa9503c389db">WApplication</a>(env)
{
  <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WApplication.html#a71a3f7da5abb9a76df94fab69ba61670">setTitle</a>(<span class="stringliteral">&quot;Hello world&quot;</span>);                               <span class="comment">// application title</span>

  <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WApplication.html#a17e118a04d962459484a12989a80bc05">root</a>()-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html#a2cfe66d9b62940f889e99538a9f478d2">addWidget</a>(<span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WText.html">WText</a>(<span class="stringliteral">&quot;Your name, please ? &quot;</span>));  <span class="comment">// show some text</span>
  <a class="code" href="classHelloApplication.html#a223a6b0ae8f592504528d044b932d4d6">nameEdit_</a> = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WLineEdit.html">WLineEdit</a>(<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WApplication.html#a17e118a04d962459484a12989a80bc05">root</a>());                     <span class="comment">// allow text input</span>
  <a class="code" href="classHelloApplication.html#a223a6b0ae8f592504528d044b932d4d6">nameEdit_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WFormWidget.html#afe33f5c3658ddbd08fec9f6c203c578b">setFocus</a>();                                 <span class="comment">// give focus</span>

  <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WPushButton.html">WPushButton</a> *button
    = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WPushButton.html">WPushButton</a>(<span class="stringliteral">&quot;Greet me.&quot;</span>, <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WApplication.html#a17e118a04d962459484a12989a80bc05">root</a>());              <span class="comment">// create a button</span>
  button-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWebWidget.html#a9795c18e926b26b97fcbabc62a1dd4e3">setMargin</a>(5, Left);                            <span class="comment">// add 5 pixels margin</span>

  <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WApplication.html#a17e118a04d962459484a12989a80bc05">root</a>()-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html#a2cfe66d9b62940f889e99538a9f478d2">addWidget</a>(<span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WBreak.html">WBreak</a>());                       <span class="comment">// insert a line break</span>

  <a class="code" href="classHelloApplication.html#a060ca5306a0289f4097ff6f83755cbad">greeting_</a> = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WText.html">WText</a>(<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WApplication.html#a17e118a04d962459484a12989a80bc05">root</a>());                         <span class="comment">// empty text</span>

  <span class="comment">/*</span>
<span class="comment">   * Connect signals with slots</span>
<span class="comment">   *</span>
<span class="comment">   * - simple Wt-way</span>
<span class="comment">   */</span>
  button-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WInteractWidget.html#ae11e050cce0d4a8f742afa3ef92bfe8c">clicked</a>().connect(<span class="keyword">this</span>, &amp;<a class="code" href="classHelloApplication.html#a94de3317a1e6e45964a3dfa9aacef9f9">HelloApplication::greet</a>);

  <span class="comment">/*</span>
<span class="comment">   * - using an arbitrary function object (binding values with boost::bind())</span>
<span class="comment">   */</span>
  <a class="code" href="classHelloApplication.html#a223a6b0ae8f592504528d044b932d4d6">nameEdit_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WInteractWidget.html#a38f06d1ad95e7599b055f49931236c10">enterPressed</a>().<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1EventSignal.html#a36896f54a4db342af24efa6e9d703455">connect</a>
    (boost::bind(&amp;<a class="code" href="classHelloApplication.html#a94de3317a1e6e45964a3dfa9aacef9f9">HelloApplication::greet</a>, <span class="keyword">this</span>));

  <span class="comment">/*</span>
<span class="comment">   * - using a c++0x lambda:</span>
<span class="comment">   */</span>
  <span class="comment">// b-&gt;clicked().connect(std::bind([=]() { </span>
  <span class="comment">//       greeting_-&gt;setText(&quot;Hello there, &quot; + nameEdit_-&gt;text());</span>
  <span class="comment">// }));</span>
}
</pre></div>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a94de3317a1e6e45964a3dfa9aacef9f9"></a><!-- doxytag: member="HelloApplication::greet" ref="a94de3317a1e6e45964a3dfa9aacef9f9" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void HelloApplication::greet </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="hello_8C_source.html#l00079">79</a> of file <a class="el" href="hello_8C_source.html">hello.C</a>.</p>
<div class="fragment"><pre class="fragment">{
  <span class="comment">/*</span>
<span class="comment">   * Update the text, using text input into the nameEdit_ field.</span>
<span class="comment">   */</span>
  <a class="code" href="classHelloApplication.html#a060ca5306a0289f4097ff6f83755cbad">greeting_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WText.html#a2f788aa524d51b3962642c9f565e66e6">setText</a>(<span class="stringliteral">&quot;Hello there, &quot;</span> + <a class="code" href="classHelloApplication.html#a223a6b0ae8f592504528d044b932d4d6">nameEdit_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WLineEdit.html#ac74b58779cb635898cac13e81d8b0c7a">text</a>());
}
</pre></div>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a060ca5306a0289f4097ff6f83755cbad"></a><!-- doxytag: member="HelloApplication::greeting_" ref="a060ca5306a0289f4097ff6f83755cbad" 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_1WText.html">WText</a>* <a class="el" href="classHelloApplication.html#a060ca5306a0289f4097ff6f83755cbad">HelloApplication::greeting_</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="hello_8C_source.html#l00030">30</a> of file <a class="el" href="hello_8C_source.html">hello.C</a>.</p>

</div>
</div>
<a class="anchor" id="a223a6b0ae8f592504528d044b932d4d6"></a><!-- doxytag: member="HelloApplication::nameEdit_" ref="a223a6b0ae8f592504528d044b932d4d6" 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_1WLineEdit.html">WLineEdit</a>* <a class="el" href="classHelloApplication.html#a223a6b0ae8f592504528d044b932d4d6">HelloApplication::nameEdit_</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="hello_8C_source.html#l00029">29</a> of file <a class="el" href="hello_8C_source.html">hello.C</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>/home/koen/project/wt/public-git/wt/examples/hello/<a class="el" href="hello_8C_source.html">hello.C</a></li>
</ul>
</div>
<hr size="1"><address style="text-align: right; margin: 3px"><small>
Generated on Fri Mar 30 2012 for <a href="http://www.webtoolkit.eu/wt">the
C++ Web Toolkit (Wt)</a> by&nbsp;<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>