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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/tqlistbox.cpp:160 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQListBoxItem Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">Home</font></a>
| <a href="classes.html">
<font color="#004faf">All Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQListBoxItem Class Reference</h1>
<p>The TQListBoxItem class is the base class of all list box items.
<a href="#details">More...</a>
<p><tt>#include <<a href="tqlistbox-h.html">tqlistbox.h</a>></tt>
<p>Inherited by <a href="tqlistboxtext.html">TQListBoxText</a> and <a href="tqlistboxpixmap.html">TQListBoxPixmap</a>.
<p><a href="tqlistboxitem-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#TQListBoxItem"><b>TQListBoxItem</b></a> ( TQListBox * listbox = 0 )</li>
<li class=fn><a href="#TQListBoxItem-2"><b>TQListBoxItem</b></a> ( TQListBox * listbox, TQListBoxItem * after )</li>
<li class=fn>virtual <a href="#~TQListBoxItem"><b>~TQListBoxItem</b></a> ()</li>
<li class=fn>virtual TQString <a href="#text"><b>text</b></a> () const</li>
<li class=fn>virtual const TQPixmap * <a href="#pixmap"><b>pixmap</b></a> () const</li>
<li class=fn>virtual int <a href="#height"><b>height</b></a> ( const TQListBox * lb ) const</li>
<li class=fn>virtual int <a href="#width"><b>width</b></a> ( const TQListBox * lb ) const</li>
<li class=fn>bool <a href="#isSelected"><b>isSelected</b></a> () const</li>
<li class=fn>bool <a href="#isCurrent"><b>isCurrent</b></a> () const</li>
<li class=fn>bool selected () const <em>(obsolete)</em></li>
<li class=fn>bool current () const <em>(obsolete)</em></li>
<li class=fn>TQListBox * <a href="#listBox"><b>listBox</b></a> () const</li>
<li class=fn>void <a href="#setSelectable"><b>setSelectable</b></a> ( bool b )</li>
<li class=fn>bool <a href="#isSelectable"><b>isSelectable</b></a> () const</li>
<li class=fn>TQListBoxItem * <a href="#next"><b>next</b></a> () const</li>
<li class=fn>TQListBoxItem * <a href="#prev"><b>prev</b></a> () const</li>
<li class=fn>virtual int <a href="#rtti"><b>rtti</b></a> () const</li>
</ul>
<h2>Protected Members</h2>
<ul>
<li class=fn>virtual void <a href="#paint"><b>paint</b></a> ( TQPainter * p ) = 0</li>
<li class=fn>virtual void <a href="#setText"><b>setText</b></a> ( const TQString & text )</li>
<li class=fn>void <a href="#setCustomHighlighting"><b>setCustomHighlighting</b></a> ( bool b )</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
The TQListBoxItem class is the base class of all list box items.
<p> This class is an abstract base class used for all list box items.
If you need to insert customized items into a <a href="tqlistbox.html">TQListBox</a> you must
inherit this class and reimplement <a href="#paint">paint</a>(), <a href="#height">height</a>() and <a href="#width">width</a>().
<p> <p>See also <a href="tqlistbox.html">TQListBox</a>.
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQListBoxItem"></a>TQListBoxItem::TQListBoxItem ( <a href="tqlistbox.html">TQListBox</a> * listbox = 0 )
</h3>
Constructs an empty list box item in the list box <em>listbox</em>.
<h3 class=fn><a name="TQListBoxItem-2"></a>TQListBoxItem::TQListBoxItem ( <a href="tqlistbox.html">TQListBox</a> * listbox, <a href="tqlistboxitem.html">TQListBoxItem</a> * after )
</h3>
Constructs an empty list box item in the list box <em>listbox</em> and
inserts it after the item <em>after</em> or at the beginning if <em>after</em>
is 0.
<h3 class=fn><a name="~TQListBoxItem"></a>TQListBoxItem::~TQListBoxItem ()<tt> [virtual]</tt>
</h3>
Destroys the list box item.
<h3 class=fn>bool <a name="current"></a>TQListBoxItem::current () const
</h3>
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p>
<h3 class=fn>int <a name="height"></a>TQListBoxItem::height ( const <a href="tqlistbox.html">TQListBox</a> * lb ) const<tt> [virtual]</tt>
</h3>
<p> Implement this function to return the height of your item. The <em>lb</em> parameter is the same as <a href="#listBox">listBox</a>() and is provided for
convenience and compatibility.
<p> The default implementation returns
<a href="ntqapplication.html#globalStrut">TQApplication::globalStrut</a>()'s height.
<p> <p>See also <a href="#paint">paint</a>() and <a href="#width">width</a>().
<p>Reimplemented in <a href="tqlistboxtext.html#height">TQListBoxText</a> and <a href="tqlistboxpixmap.html#height">TQListBoxPixmap</a>.
<h3 class=fn>bool <a name="isCurrent"></a>TQListBoxItem::isCurrent () const
</h3>
Returns TRUE if the item is the current item; otherwise returns
FALSE.
<p> <p>See also <a href="tqlistbox.html#currentItem-prop">TQListBox::currentItem</a>, <a href="tqlistbox.html#item">TQListBox::item</a>(), and <a href="#isSelected">isSelected</a>().
<h3 class=fn>bool <a name="isSelectable"></a>TQListBoxItem::isSelectable () const
</h3>
Returns TRUE if this item is selectable (the default); otherwise
returns FALSE.
<p> <p>See also <a href="#setSelectable">setSelectable</a>().
<h3 class=fn>bool <a name="isSelected"></a>TQListBoxItem::isSelected () const
</h3>
<p> Returns TRUE if the item is selected; otherwise returns FALSE.
<p> <p>See also <a href="tqlistbox.html#isSelected">TQListBox::isSelected</a>() and <a href="#isCurrent">isCurrent</a>().
<p>Example: <a href="listboxcombo-example.html#x1409">listboxcombo/listboxcombo.cpp</a>.
<h3 class=fn><a href="tqlistbox.html">TQListBox</a> * <a name="listBox"></a>TQListBoxItem::listBox () const
</h3>
Returns a pointer to the list box containing this item.
<h3 class=fn><a href="tqlistboxitem.html">TQListBoxItem</a> * <a name="next"></a>TQListBoxItem::next () const
</h3>
Returns the item that comes after this in the list box. If this is
the last item, 0 is returned.
<p> <p>See also <a href="#prev">prev</a>().
<h3 class=fn>void <a name="paint"></a>TQListBoxItem::paint ( <a href="tqpainter.html">TQPainter</a> * p )<tt> [pure virtual protected]</tt>
</h3>
<p> Implement this function to draw your item. The painter, <em>p</em>, is
already open for painting.
<p> <p>See also <a href="#height">height</a>() and <a href="#width">width</a>().
<p>Example: <a href="listboxcombo-example.html#x1410">listboxcombo/listboxcombo.cpp</a>.
<p>Reimplemented in <a href="tqlistboxtext.html#paint">TQListBoxText</a> and <a href="tqlistboxpixmap.html#paint">TQListBoxPixmap</a>.
<h3 class=fn>const <a href="tqpixmap.html">TQPixmap</a> * <a name="pixmap"></a>TQListBoxItem::pixmap () const<tt> [virtual]</tt>
</h3>
Returns the pixmap associated with the item, or 0 if there isn't
one.
<p> The default implementation returns 0.
<p>Example: <a href="listboxcombo-example.html#x1411">listboxcombo/listboxcombo.cpp</a>.
<p>Reimplemented in <a href="tqlistboxpixmap.html#pixmap">TQListBoxPixmap</a>.
<h3 class=fn><a href="tqlistboxitem.html">TQListBoxItem</a> * <a name="prev"></a>TQListBoxItem::prev () const
</h3>
Returns the item which comes before this in the list box. If this
is the first item, 0 is returned.
<p> <p>See also <a href="#next">next</a>().
<h3 class=fn>int <a name="rtti"></a>TQListBoxItem::rtti () const<tt> [virtual]</tt>
</h3>
Returns 0.
<p> Make your derived classes return their own values for <a href="#rtti">rtti</a>(), and
you can distinguish between listbox items. You should use values
greater than 1000 preferably a large random number, to allow for
extensions to this class.
<h3 class=fn>bool <a name="selected"></a>TQListBoxItem::selected () const
</h3>
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p>
<h3 class=fn>void <a name="setCustomHighlighting"></a>TQListBoxItem::setCustomHighlighting ( bool b )<tt> [protected]</tt>
</h3>
Defines whether the list box item is responsible for drawing
itself in a highlighted state when being selected.
<p> If <em>b</em> is FALSE (the default), the list box will draw some
default highlight indicator before calling <a href="#paint">paint</a>().
<p> <p>See also <a href="#selected">selected</a>() and <a href="#paint">paint</a>().
<h3 class=fn>void <a name="setSelectable"></a>TQListBoxItem::setSelectable ( bool b )
</h3>
If <em>b</em> is TRUE (the default) then this item can be selected by
the user; otherwise this item cannot be selected by the user.
<p> <p>See also <a href="#isSelectable">isSelectable</a>().
<h3 class=fn>void <a name="setText"></a>TQListBoxItem::setText ( const <a href="tqstring.html">TQString</a> & text )<tt> [virtual protected]</tt>
</h3>
<p> Sets the text of the TQListBoxItem to <em>text</em>. This <em>text</em> is also
used for sorting. The text is not shown unless explicitly drawn in
<a href="#paint">paint</a>().
<p> <p>See also <a href="#text">text</a>().
<h3 class=fn><a href="tqstring.html">TQString</a> <a name="text"></a>TQListBoxItem::text () const<tt> [virtual]</tt>
</h3>
Returns the text of the item. This text is also used for sorting.
<p> <p>See also <a href="#setText">setText</a>().
<p>Example: <a href="listboxcombo-example.html#x1412">listboxcombo/listboxcombo.cpp</a>.
<h3 class=fn>int <a name="width"></a>TQListBoxItem::width ( const <a href="tqlistbox.html">TQListBox</a> * lb ) const<tt> [virtual]</tt>
</h3>
<p> Reimplement this function to return the width of your item. The <em>lb</em> parameter is the same as <a href="#listBox">listBox</a>() and is provided for
convenience and compatibility.
<p> The default implementation returns
<a href="ntqapplication.html#globalStrut">TQApplication::globalStrut</a>()'s width.
<p> <p>See also <a href="#paint">paint</a>() and <a href="#height">height</a>().
<p>Reimplemented in <a href="tqlistboxtext.html#width">TQListBoxText</a> and <a href="tqlistboxpixmap.html#width">TQListBoxPixmap</a>.
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt toolkit</a>.
Copyright © 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright © 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>
|