File: classWt_1_1WCheckBox.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 (186 lines) | stat: -rw-r--r-- 15,070 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
<!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::WCheckBox 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_1WCheckBox.html">WCheckBox</a>
  </div>
</div>
<div class="contents">
<h1>Wt::WCheckBox Class Reference</h1><!-- doxytag: class="Wt::WCheckBox" --><!-- doxytag: inherits="Wt::WAbstractToggleButton" -->A user control that represents a check box.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;Wt/WCheckBox&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for Wt::WCheckBox:</div>
<div class="dynsection">
<p><center><img src="classWt_1_1WCheckBox__inherit__graph.png" border="0" usemap="#Wt_1_1WCheckBox__inherit__map" alt="Inheritance graph"></center>
<map name="Wt_1_1WCheckBox__inherit__map">
<area shape="rect" href="classWt_1_1WAbstractToggleButton.html" title="An abstract base class for radio buttons and check boxes." alt="" coords="5,379,187,405"><area shape="rect" href="classWt_1_1WFormWidget.html" title="An abstract widget that corresponds to an HTML form element." alt="" coords="32,304,160,331"><area shape="rect" href="classWt_1_1WInteractWidget.html" title="An abstract widget that can receive user&#45;interface interaction." alt="" coords="25,229,167,256"><area shape="rect" href="classWt_1_1WWebWidget.html" title="A base class for widgets with an HTML counterpart." alt="" coords="35,155,157,181"><area shape="rect" href="classWt_1_1WWidget.html" title="The abstract base class for a user&#45;interface component." alt="" coords="48,80,144,107"><area shape="rect" href="classWt_1_1WObject.html" title="A base class for objects that participate in the signal/slot system." alt="" coords="48,5,144,32"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>

<p>
<a href="classWt_1_1WCheckBox-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="6277263fb7405d39bd6d6124e56fbb5c"></a><!-- doxytag: member="Wt::WCheckBox::WCheckBox" ref="6277263fb7405d39bd6d6124e56fbb5c" args="(WContainerWidget *parent=0)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WCheckBox.html#6277263fb7405d39bd6d6124e56fbb5c">WCheckBox</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 checkbox with empty label. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="16025c975c9586c89e548875df811c6a"></a><!-- doxytag: member="Wt::WCheckBox::WCheckBox" ref="16025c975c9586c89e548875df811c6a" args="(const WString &amp;text, WContainerWidget *parent=0)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WCheckBox.html#16025c975c9586c89e548875df811c6a">WCheckBox</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 checkbox with given label. <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_1WCheckBox.html#aa80606e36bfd34a73f6b58dc6cac926">setTristate</a> (bool tristate=true)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Makes a tristate checkbox.  <a href="#aa80606e36bfd34a73f6b58dc6cac926"></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_1WCheckBox.html#e7c6da01de803c9fd88564e3ef2cbf13">isTristate</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns whether the checkbox is tristate.  <a href="#e7c6da01de803c9fd88564e3ef2cbf13"></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_1WCheckBox.html#293d15f49d36587b55a04216322083d8">setCheckState</a> (<a class="el" href="namespaceWt.html#59dae4dad2967d1d0f9b765f468442fb">CheckState</a> state)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the check state.  <a href="#293d15f49d36587b55a04216322083d8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespaceWt.html#59dae4dad2967d1d0f9b765f468442fb">CheckState</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WCheckBox.html#eae048fe7066d5c69a5dfa6498231132">checkState</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the check state.  <a href="#eae048fe7066d5c69a5dfa6498231132"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A user control that represents a check box. 
<p>
By default, a checkbox can have two states: <a class="el" href="namespaceWt.html#59dae4dad2967d1d0f9b765f468442fbbc1a90642e7fc65241f70c11e9f90210" title="Checked.">Wt::Checked</a> or <a class="el" href="namespaceWt.html#59dae4dad2967d1d0f9b765f468442fbd5dca88ed5fa2185a98cc1f4c686cd9c" title="Unchecked.">Wt::Unchecked</a>, which can be inspected using <a class="el" href="classWt_1_1WAbstractToggleButton.html#bd40ce7a6c4b4e924c9097015f4971ea" title="Returns the button state.">isChecked()</a>, and set using <a class="el" href="classWt_1_1WAbstractToggleButton.html#2b4ab0746beb381276ff7fcf0bde93c8" title="Checks the button.">setChecked()</a>.<p>
A checkbox may also provide a third state, <a class="el" href="namespaceWt.html#59dae4dad2967d1d0f9b765f468442fb276bb5f9da28be5fc0685d7a5cc2296b" title="Partially checked (for a tri-state checkbox).">Wt::PartiallyChecked</a>, which is useful to indicate that it is neither checked or unchecked. Wt will use native browser support for this HTML5 extension when available (Safari and MS IE), and use an image-based workaround otherwise. You may enable support for the third state using <a class="el" href="classWt_1_1WCheckBox.html#aa80606e36bfd34a73f6b58dc6cac926" title="Makes a tristate checkbox.">setTristate()</a>, and use <a class="el" href="classWt_1_1WCheckBox.html#293d15f49d36587b55a04216322083d8" title="Sets the check state.">setCheckState()</a> and <a class="el" href="classWt_1_1WCheckBox.html#eae048fe7066d5c69a5dfa6498231132" title="Returns the check state.">checkState()</a> to read all three states.<p>
A label is added as a sibling of the checkbox to the same parent.<p>
Usage example:<p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classWt_1_1WGroupBox.html" title="A widget which group widgets into a frame with a title.">Wt::WGroupBox</a> *box = <span class="keyword">new</span> <a class="code" href="classWt_1_1WGroupBox.html" title="A widget which group widgets into a frame with a title.">Wt::WGroupBox</a>(<span class="stringliteral">"In-flight options"</span>);

 <a class="code" href="classWt_1_1WCheckBox.html" title="A user control that represents a check box.">Wt::WCheckBox</a> *w1 = <span class="keyword">new</span> <a class="code" href="classWt_1_1WCheckBox.html" title="A user control that represents a check box.">Wt::WCheckBox</a>(<span class="stringliteral">"Vegetarian diet"</span>, box);
 box-&gt;<a class="code" href="classWt_1_1WContainerWidget.html#2cfe66d9b62940f889e99538a9f478d2" title="Adds a child widget to this container.">addWidget</a>(<span class="keyword">new</span> WBreak());
 <a class="code" href="classWt_1_1WCheckBox.html" title="A user control that represents a check box.">Wt::WCheckBox</a> *w2 = <span class="keyword">new</span> <a class="code" href="classWt_1_1WCheckBox.html" title="A user control that represents a check box.">Wt::WCheckBox</a>(<span class="stringliteral">"WIFI access"</span>, box);
 box-&gt;<a class="code" href="classWt_1_1WContainerWidget.html#2cfe66d9b62940f889e99538a9f478d2" title="Adds a child widget to this container.">addWidget</a>(<span class="keyword">new</span> WBreak());
 <a class="code" href="classWt_1_1WCheckBox.html" title="A user control that represents a check box.">Wt::WCheckBox</a> *w3 = <span class="keyword">new</span> <a class="code" href="classWt_1_1WCheckBox.html" title="A user control that represents a check box.">Wt::WCheckBox</a>(<span class="stringliteral">"AC plug"</span>, box);

 w1-&gt;<a class="code" href="classWt_1_1WAbstractToggleButton.html#6838c9a37f3e9e3c466e9f48bde55e62" title="Sets the button state.">setChecked</a>(<span class="keyword">false</span>);
 w2-&gt;<a class="code" href="classWt_1_1WAbstractToggleButton.html#6838c9a37f3e9e3c466e9f48bde55e62" title="Sets the button state.">setChecked</a>(<span class="keyword">true</span>);
 w3-&gt;<a class="code" href="classWt_1_1WAbstractToggleButton.html#6838c9a37f3e9e3c466e9f48bde55e62" title="Sets the button state.">setChecked</a>(<span class="keyword">true</span>);
</pre></div><p>
WCheckBox is an <a class="el" href="classWt_1_1WWidget.html#c78e3af143883334c82031790c87416e">inline </a> widget.<p>
<h3>CSS</h3>
<p>
This widget corresponds to the HTML <code>&lt;input type="checkbox"&gt;</code> tag. Depending on whether a text is included, it may be nested in a <code>&lt;span&gt;</code> tag which also includes a rendered <a class="el" href="classWt_1_1WLabel.html" title="A label for a form field.">WLabel</a>. This widget does not provide styling, and can be styled using inline or external CSS as appropriate.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WAbstractToggleButton.html" title="An abstract base class for radio buttons and check boxes.">WAbstractToggleButton</a> </dd></dl>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="aa80606e36bfd34a73f6b58dc6cac926"></a><!-- doxytag: member="Wt::WCheckBox::setTristate" ref="aa80606e36bfd34a73f6b58dc6cac926" args="(bool tristate=true)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WCheckBox::setTristate           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>tristate</em> = <code>true</code>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Makes a tristate checkbox. 
<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>You should enable tristate functionality right after construction and this cannot be modified later. </dd></dl>

</div>
</div><p>
<a class="anchor" name="e7c6da01de803c9fd88564e3ef2cbf13"></a><!-- doxytag: member="Wt::WCheckBox::isTristate" ref="e7c6da01de803c9fd88564e3ef2cbf13" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Wt::WCheckBox::isTristate           </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 whether the checkbox is tristate. 
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WCheckBox.html#aa80606e36bfd34a73f6b58dc6cac926" title="Makes a tristate checkbox.">setTristate()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="293d15f49d36587b55a04216322083d8"></a><!-- doxytag: member="Wt::WCheckBox::setCheckState" ref="293d15f49d36587b55a04216322083d8" args="(CheckState state)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WCheckBox::setCheckState           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceWt.html#59dae4dad2967d1d0f9b765f468442fb">CheckState</a>&nbsp;</td>
          <td class="paramname"> <em>state</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets the check state. 
<p>
Unless it is a tri-state checkbox, only <a class="el" href="namespaceWt.html#59dae4dad2967d1d0f9b765f468442fbbc1a90642e7fc65241f70c11e9f90210" title="Checked.">Wt::Checked</a> and <a class="el" href="namespaceWt.html#59dae4dad2967d1d0f9b765f468442fbd5dca88ed5fa2185a98cc1f4c686cd9c" title="Unchecked.">Wt::Unchecked</a> are valid states. 
<p>Reimplemented from <a class="el" href="classWt_1_1WAbstractToggleButton.html">Wt::WAbstractToggleButton</a>.</p>

</div>
</div><p>
<a class="anchor" name="eae048fe7066d5c69a5dfa6498231132"></a><!-- doxytag: member="Wt::WCheckBox::checkState" ref="eae048fe7066d5c69a5dfa6498231132" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceWt.html#59dae4dad2967d1d0f9b765f468442fb">CheckState</a> Wt::WCheckBox::checkState           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the check state. 
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WCheckBox.html#293d15f49d36587b55a04216322083d8" title="Sets the check state.">setCheckState()</a>, <a class="el" href="classWt_1_1WAbstractToggleButton.html#bd40ce7a6c4b4e924c9097015f4971ea" title="Returns the button state.">isChecked()</a> </dd></dl>

</div>
</div><p>
</div>
<hr size="1"><address style="align: right;"><small>
Generated on Fri Mar 26 17:12:06 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>