File: classWt_1_1WLabel.html

package info (click to toggle)
witty 3.1.2-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 45,512 kB
  • ctags: 35,832
  • sloc: cpp: 69,469; ansic: 66,945; xml: 4,383; sh: 594; perl: 108; makefile: 106
file content (254 lines) | stat: -rw-r--r-- 19,255 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
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
<!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::WLabel 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&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;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&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespaceWt.html">Wt</a>::<a class="el" href="classWt_1_1WLabel.html">WLabel</a>
  </div>
</div>
<div class="contents">
<h1>Wt::WLabel Class Reference</h1><!-- doxytag: class="Wt::WLabel" --><!-- doxytag: inherits="Wt::WInteractWidget" -->A label for a form field.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;Wt/WLabel&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for Wt::WLabel:</div>
<div class="dynsection">
<p><center><img src="classWt_1_1WLabel__inherit__graph.png" border="0" usemap="#Wt_1_1WLabel__inherit__map" alt="Inheritance graph"></center>
<map name="Wt_1_1WLabel__inherit__map">
<area shape="rect" href="classWt_1_1WInteractWidget.html" title="An abstract widget that can receive user&#45;interface interaction." alt="" coords="5,229,147,256"><area shape="rect" href="classWt_1_1WWebWidget.html" title="A base class for widgets with an HTML counterpart." alt="" coords="15,155,137,181"><area shape="rect" href="classWt_1_1WWidget.html" title="The abstract base class for a user&#45;interface component." alt="" coords="28,80,124,107"><area shape="rect" href="classWt_1_1WObject.html" title="A base class for objects that participate in the signal/slot system." alt="" coords="28,5,124,32"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>

<p>
<a href="classWt_1_1WLabel-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"><a class="anchor" name="ca64fdaa3c35e2127ce3903781584c24"></a><!-- doxytag: member="Wt::WLabel::WLabel" ref="ca64fdaa3c35e2127ce3903781584c24" args="(WContainerWidget *parent=0)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WLabel.html#ca64fdaa3c35e2127ce3903781584c24">WLabel</a> (<a class="el" href="classWt_1_1WContainerWidget.html">WContainerWidget</a> *parent=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a label with empty text and optional parent. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2d42bd4a25a5a8fc9ad4896e078f64d4"></a><!-- doxytag: member="Wt::WLabel::WLabel" ref="2d42bd4a25a5a8fc9ad4896e078f64d4" args="(const WString &amp;text, WContainerWidget *parent=0)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WLabel.html#2d42bd4a25a5a8fc9ad4896e078f64d4">WLabel</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;text, <a class="el" href="classWt_1_1WContainerWidget.html">WContainerWidget</a> *parent=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a label with a given text. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a52eaf9dc8abb5f538cec01bb617c1d1"></a><!-- doxytag: member="Wt::WLabel::WLabel" ref="a52eaf9dc8abb5f538cec01bb617c1d1" args="(WImage *image, WContainerWidget *parent=0)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WLabel.html#a52eaf9dc8abb5f538cec01bb617c1d1">WLabel</a> (<a class="el" href="classWt_1_1WImage.html">WImage</a> *image, <a class="el" href="classWt_1_1WContainerWidget.html">WContainerWidget</a> *parent=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a label with an image. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1WFormWidget.html">WFormWidget</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WLabel.html#9bc62e3dad89cc51108bbaadaa47407f">buddy</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the buddy of this label.  <a href="#9bc62e3dad89cc51108bbaadaa47407f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WLabel.html#f468c613eab7d184c68fd6ae20978de5">setBuddy</a> (<a class="el" href="classWt_1_1WFormWidget.html">WFormWidget</a> *buddy)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the buddy of this label.  <a href="#f468c613eab7d184c68fd6ae20978de5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WLabel.html#d01592a750814678ef198b8aecd87ae4">setBuddy</a> (<a class="el" href="classWt_1_1Ext_1_1FormField.html">Ext::FormField</a> *buddy)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the buddy of this label.  <a href="#d01592a750814678ef198b8aecd87ae4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ad258cec78e988d24cb457500de2b8a4"></a><!-- doxytag: member="Wt::WLabel::setText" ref="ad258cec78e988d24cb457500de2b8a4" args="(const WString &amp;text)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WLabel.html#ad258cec78e988d24cb457500de2b8a4">setText</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;text)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the label text. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8d8d0acd3bac7808415de310328dd8ee"></a><!-- doxytag: member="Wt::WLabel::text" ref="8d8d0acd3bac7808415de310328dd8ee" args="() const " -->
const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WLabel.html#8d8d0acd3bac7808415de310328dd8ee">text</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the label text. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b77dd95cd3a13e19c916bb803f28a520"></a><!-- doxytag: member="Wt::WLabel::setImage" ref="b77dd95cd3a13e19c916bb803f28a520" args="(WImage *image, Side side=Left)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WLabel.html#b77dd95cd3a13e19c916bb803f28a520">setImage</a> (<a class="el" href="classWt_1_1WImage.html">WImage</a> *image, <a class="el" href="namespaceWt.html#5a6f4636bcc6ab3c075165d249b3a5a3">Side</a> side=Left)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the image. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d664977a4924cecface67bce34551ad1"></a><!-- doxytag: member="Wt::WLabel::image" ref="d664977a4924cecface67bce34551ad1" args="() const " -->
<a class="el" href="classWt_1_1WImage.html">WImage</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WLabel.html#d664977a4924cecface67bce34551ad1">image</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the image. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WLabel.html#50e413fa171f301129b39a4d4ed6d2fd">setWordWrap</a> (bool wordWrap)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Configures word wrapping.  <a href="#50e413fa171f301129b39a4d4ed6d2fd"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WLabel.html#f1cbfcf44cd42532b81de8ed754a64da">wordWrap</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns whether word wrapping is on.  <a href="#f1cbfcf44cd42532b81de8ed754a64da"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WLabel.html#fafb4849c9498834e9c8aeef19b5dcb7">propagateSetEnabled</a> (bool enabled)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Propagates that a widget was enabled or disabled through children.  <a href="#fafb4849c9498834e9c8aeef19b5dcb7"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A label for a form field. 
<p>
The label may contain an image and/or text. It acts like a proxy for giving focus to a <a class="el" href="classWt_1_1WFormWidget.html" title="An abstract widget that corresponds to an HTML form element.">WFormWidget</a>. When both an image and text are specified, the image is put to the left of the text.<p>
Usage example:<p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classWt_1_1WContainerWidget.html" title="A widget that holds and manages child widgets.">Wt::WContainerWidget</a> *w = <span class="keyword">new</span> <a class="code" href="classWt_1_1WContainerWidget.html" title="A widget that holds and manages child widgets.">Wt::WContainerWidget</a>();
 <a class="code" href="classWt_1_1WLabel.html" title="A label for a form field.">Wt::WLabel</a> *label = <span class="keyword">new</span> <a class="code" href="classWt_1_1WLabel.html" title="A label for a form field.">Wt::WLabel</a>(<span class="stringliteral">"Favourite Actress: "</span>, w);
 <a class="code" href="classWt_1_1WLineEdit.html" title="A widget that provides a single line edit.">Wt::WLineEdit</a> *edit = <span class="keyword">new</span> <a class="code" href="classWt_1_1WLineEdit.html" title="A widget that provides a single line edit.">Wt::WLineEdit</a>(<span class="stringliteral">"Renee Zellweger"</span>, w);
 label-&gt;<a class="code" href="classWt_1_1WLabel.html#f468c613eab7d184c68fd6ae20978de5" title="Sets the buddy of this label.">setBuddy</a>(edit);
</pre></div><p>
The widget corresponds to the HTML <code>&lt;label&gt;</code> tag. When no buddy is set, it is rendered using an HTML <code>&lt;span&gt;</code> or <code>&lt;div&gt;</code> to avoid click event handling misbehavior on Microsoft Internet Explorer.<p>
WLabel is an <a class="el" href="classWt_1_1WWidget.html#c78e3af143883334c82031790c87416e">inline </a> widget.<p>
<h3>CSS</h3>
<p>
This widget does not provide styling, and can be styled using inline or external CSS as appropriate. A label's text may be styled via a nested <code>&lt;span&gt;</code> element, and it's image may be styled via a nested <code>&lt;img&gt;</code> element. <hr><h2>Member Function Documentation</h2>
<a class="anchor" name="9bc62e3dad89cc51108bbaadaa47407f"></a><!-- doxytag: member="Wt::WLabel::buddy" ref="9bc62e3dad89cc51108bbaadaa47407f" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1WFormWidget.html">WFormWidget</a>* Wt::WLabel::buddy           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the buddy of this label. 
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WLabel.html#f468c613eab7d184c68fd6ae20978de5" title="Sets the buddy of this label.">setBuddy(WFormWidget *)</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="f468c613eab7d184c68fd6ae20978de5"></a><!-- doxytag: member="Wt::WLabel::setBuddy" ref="f468c613eab7d184c68fd6ae20978de5" args="(WFormWidget *buddy)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WLabel::setBuddy           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classWt_1_1WFormWidget.html">WFormWidget</a> *&nbsp;</td>
          <td class="paramname"> <em>buddy</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets the buddy of this label. 
<p>
Sets the buddy FormWidget for which this label acts as a proxy.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WFormWidget.html#82f0eaf7fb35132644b429e2b3b8930f" title="Returns the label associated with this widget.">WFormWidget::label()</a>, <a class="el" href="classWt_1_1WLabel.html#d01592a750814678ef198b8aecd87ae4" title="Sets the buddy of this label.">setBuddy(Ext::FormField *)</a>, <a class="el" href="classWt_1_1WLabel.html#9bc62e3dad89cc51108bbaadaa47407f" title="Returns the buddy of this label.">buddy()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="d01592a750814678ef198b8aecd87ae4"></a><!-- doxytag: member="Wt::WLabel::setBuddy" ref="d01592a750814678ef198b8aecd87ae4" args="(Ext::FormField *buddy)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WLabel::setBuddy           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classWt_1_1Ext_1_1FormField.html">Ext::FormField</a> *&nbsp;</td>
          <td class="paramname"> <em>buddy</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets the buddy of this label. 
<p>
Sets the buddy <a class="el" href="classWt_1_1Ext_1_1FormField.html" title="An abstract base class for form fields.">Ext::FormField</a> for which this label acts as a proxy. When using this method, the result of <a class="el" href="classWt_1_1WLabel.html#9bc62e3dad89cc51108bbaadaa47407f" title="Returns the buddy of this label.">buddy()</a> is not defined.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Ext_1_1FormField.html#eed85e4a038bb4fd6c339716fb3d3a8e" title="Return the label associate with this formfield.">Ext::FormField::label()</a>, <a class="el" href="classWt_1_1WLabel.html#f468c613eab7d184c68fd6ae20978de5" title="Sets the buddy of this label.">setBuddy(WFormWidget *)</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="50e413fa171f301129b39a4d4ed6d2fd"></a><!-- doxytag: member="Wt::WLabel::setWordWrap" ref="50e413fa171f301129b39a4d4ed6d2fd" args="(bool wordWrap)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WLabel::setWordWrap           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>wordWrap</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Configures word wrapping. 
<p>
When <code>wordWrap</code> is <code>true</code>, the widget may break lines, creating a multi-line text. When <code>wordWrap</code> is <code>false</code>, the text will displayed on a single line, unless the text contains end-of-lines (for <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480e06bb9ae9a26d13c3dcf9f20d5067885" title="Format text as plain text.">Wt::PlainText</a>) or &lt;br /&gt; tags or other block-level tags (for <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480847ab5a73b906fea275bd16877b420a4" title="Format text as XSS-safe XHTML markup&#39;ed text.">Wt::XHTMLText</a>).<p>
The default value is <code>false</code>.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WLabel.html#f1cbfcf44cd42532b81de8ed754a64da" title="Returns whether word wrapping is on.">wordWrap()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="f1cbfcf44cd42532b81de8ed754a64da"></a><!-- doxytag: member="Wt::WLabel::wordWrap" ref="f1cbfcf44cd42532b81de8ed754a64da" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Wt::WLabel::wordWrap           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns whether word wrapping is on. 
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WLabel.html#50e413fa171f301129b39a4d4ed6d2fd" title="Configures word wrapping.">setWordWrap()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="fafb4849c9498834e9c8aeef19b5dcb7"></a><!-- doxytag: member="Wt::WLabel::propagateSetEnabled" ref="fafb4849c9498834e9c8aeef19b5dcb7" args="(bool enabled)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WLabel::propagateSetEnabled           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>enabled</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Propagates that a widget was enabled or disabled through children. 
<p>
When enabling or disabling a widget, you usually also want to disable contained children. This method is called by <a class="el" href="classWt_1_1WWebWidget.html#0d73f278ece864ab5322e92ff5f6de6c" title="Sets whether the widget is disabled.">setDisabled()</a> to propagate its state to all children.<p>
You may want to reimplement this method if they wish to render differently when a widget is disabled. The default implementation will propagate the signal to all children. 
<p>Reimplemented from <a class="el" href="classWt_1_1WWebWidget.html#a9655ae1c50b9c979b6fe93f9d0064d3">Wt::WWebWidget</a>.</p>

</div>
</div><p>
</div>
<hr size="1"><address style="align: right;"><small>
Generated on Fri Mar 26 17:12:07 2010 for <a href="http://www.webtoolkit.eu/wt/">Wt</a> by&nbsp;<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>