summaryrefslogtreecommitdiffstats
path: root/doc/html/tqstatusbar.html
blob: 5767bb1c3d2c55e0ca93df267d2ddfec99637478 (plain)
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/tqstatusbar.cpp:49 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQStatusBar 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&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;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>TQStatusBar Class Reference</h1>

<p>The TQStatusBar class provides a horizontal bar suitable for
presenting status information.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="tqstatusbar-h.html">tqstatusbar.h</a>&gt;</tt>
<p>Inherits <a href="tqwidget.html">TQWidget</a>.
<p><a href="tqstatusbar-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#TQStatusBar"><b>TQStatusBar</b></a> ( TQWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
<li class=fn>virtual <a href="#~TQStatusBar"><b>~TQStatusBar</b></a> ()</li>
<li class=fn>virtual void <a href="#addWidget"><b>addWidget</b></a> ( TQWidget&nbsp;*&nbsp;widget, int&nbsp;stretch = 0, bool&nbsp;permanent = FALSE )</li>
<li class=fn>virtual void <a href="#removeWidget"><b>removeWidget</b></a> ( TQWidget&nbsp;*&nbsp;widget )</li>
<li class=fn>void <a href="#setSizeGripEnabled"><b>setSizeGripEnabled</b></a> ( bool )</li>
<li class=fn>bool <a href="#isSizeGripEnabled"><b>isSizeGripEnabled</b></a> () const</li>
</ul>
<h2>Public Slots</h2>
<ul>
<li class=fn>void <a href="#message"><b>message</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;message )</li>
<li class=fn>void <a href="#message-2"><b>message</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;message, int&nbsp;ms )</li>
<li class=fn>void <a href="#clear"><b>clear</b></a> ()</li>
</ul>
<h2>Signals</h2>
<ul>
<li class=fn>void <a href="#messageChanged"><b>messageChanged</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;message )</li>
</ul>
<h2>Properties</h2>
<ul>
<li class=fn>bool <a href="#sizeGripEnabled-prop"><b>sizeGripEnabled</b></a>&nbsp;- whether the TQSizeGrip in the bottom right of the status bar is enabled</li>
</ul>
<h2>Protected Members</h2>
<ul>
<li class=fn>virtual void <a href="#paintEvent"><b>paintEvent</b></a> ( TQPaintEvent * )</li>
<li class=fn>void <a href="#reformat"><b>reformat</b></a> ()</li>
<li class=fn>void <a href="#hideOrShow"><b>hideOrShow</b></a> ()</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The TQStatusBar class provides a horizontal bar suitable for
presenting status information.
<p> 


<p> Each status indicator falls into one of three categories:
<p> <ul>
<li> <em>Temporary</em> - briefly occupies most of the status bar. Used
to explain tool tip texts or menu entries, for example.
<li> <em>Normal</em> - occupies part of the status bar and may be hidden
by temporary messages. Used to display the page and line
number in a word processor, for example.
<li> <em>Permanent</em> - is never hidden. Used for important mode
indications, for example, some applications put a Caps Lock
indicator in the status bar.
</ul>
<p> TQStatusBar lets you display all three types of indicators.
<p> To display a <em>temporary</em> message, call <a href="#message">message</a>() (perhaps by
connecting a suitable signal to it). To remove a temporary
message, call <a href="#clear">clear</a>(). There are two variants of message(): one
that displays the message until the next clear() or message() and
one that has a time limit:
<p> <pre>
        <a href="tqobject.html#connect">connect</a>( loader, TQ_SIGNAL(progressMessage(const <a href="tqstring.html">TQString</a>&amp;)),
                 statusBar(), TQ_SLOT(<a href="#message">message</a>(const <a href="tqstring.html">TQString</a>&amp;)) );

        statusBar()-&gt;message("Loading...");  // Initial message
        loader.loadStuff();                  // Emits progress messages
        statusBar()-&gt;message("Done.", 2000); // Final message for 2 seconds
    </pre>
 
<p> <em>Normal</em> and <em>Permanent</em> messages are displayed by creating a
small widget and then adding it to the status bar with
<a href="#addWidget">addWidget</a>(). Widgets like <a href="tqlabel.html">TQLabel</a>, <a href="ntqprogressbar.html">TQProgressBar</a> or even <a href="tqtoolbutton.html">TQToolButton</a>
are useful for adding to status bars. <a href="#removeWidget">removeWidget</a>() is used to
remove widgets.
<p> <pre>
        statusBar()-&gt;addWidget(new MyReadWriteIndication(statusBar()));
    </pre>
 
<p> By default TQStatusBar provides a <a href="tqsizegrip.html">TQSizeGrip</a> in the lower-right
corner. You can disable it with <a href="#setSizeGripEnabled">setSizeGripEnabled</a>(FALSE);
<p> <img src=tqstatusbar-m.png> <img src=tqstatusbar-w.png>
<p> <p>See also <a href="tqtoolbar.html">TQToolBar</a>, <a href="tqmainwindow.html">TQMainWindow</a>, <a href="tqlabel.html">TQLabel</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Status Bar</a>, <a href="application.html">Main Window and Related Classes</a>, and <a href="helpsystem.html">Help System</a>.

<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQStatusBar"></a>TQStatusBar::TQStatusBar ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a status bar called <em>name</em> with parent <em>parent</em> and
with a size grip.
<p> <p>See also <a href="#sizeGripEnabled-prop">sizeGripEnabled</a>.

<h3 class=fn><a name="~TQStatusBar"></a>TQStatusBar::~TQStatusBar ()<tt> [virtual]</tt>
</h3>
Destroys the status bar and frees any allocated resources and
child widgets.

<h3 class=fn>void <a name="addWidget"></a>TQStatusBar::addWidget ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;widget, int&nbsp;stretch = 0, bool&nbsp;permanent = FALSE )<tt> [virtual]</tt>
</h3>
Adds <em>widget</em> to this status bar. <em>widget</em> is reparented if it
isn't already a child of the TQStatusBar.
<p> <em>widget</em> is permanently visible if <em>permanent</em> is TRUE and may
be obscured by temporary messages if <em>permanent</em> is FALSE. The
default is FALSE.
<p> If <em>permanent</em> is TRUE, <em>widget</em> is located at the far right of
the status bar. If <em>permanent</em> is FALSE (the default), <em>widget</em>
is located just to the left of the first permanent widget.
<p> <em>stretch</em> is used to compute a suitable size for <em>widget</em> as the
status bar grows and shrinks. The default of 0 uses a minimum of
space.
<p> This function may cause some flicker.
<p> <p>See also <a href="#removeWidget">removeWidget</a>().

<h3 class=fn>void <a name="clear"></a>TQStatusBar::clear ()<tt> [slot]</tt>
</h3>
Removes any temporary message being shown.
<p> <p>See also <a href="#message">message</a>().

<h3 class=fn>void <a name="hideOrShow"></a>TQStatusBar::hideOrShow ()<tt> [protected]</tt>
</h3>
Ensures that the right widgets are visible. Used by <a href="#message">message</a>() and
<a href="#clear">clear</a>().

<h3 class=fn>bool <a name="isSizeGripEnabled"></a>TQStatusBar::isSizeGripEnabled () const
</h3><p>Returns TRUE if the <a href="tqsizegrip.html">TQSizeGrip</a> in the bottom right of the status bar is enabled; otherwise returns FALSE.
See the <a href="tqstatusbar.html#sizeGripEnabled-prop">"sizeGripEnabled"</a> property for details.
<h3 class=fn>void <a name="message"></a>TQStatusBar::message ( const&nbsp;<a href="tqstring.html">TQString</a>&nbsp;&amp;&nbsp;message )<tt> [slot]</tt>
</h3>
Hides the normal status indicators and displays <em>message</em> until
<a href="#clear">clear</a>() or another <a href="#message">message</a>() is called.
<p> <p>See also <a href="#clear">clear</a>().

<p>Example: <a href="regexptester-example.html#x2494">regexptester/regexptester.cpp</a>.
<h3 class=fn>void <a name="message-2"></a>TQStatusBar::message ( const&nbsp;<a href="tqstring.html">TQString</a>&nbsp;&amp;&nbsp;message, int&nbsp;ms )<tt> [slot]</tt>
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Hides the normal status indications and displays <em>message</em> for <em>ms</em> milli-seconds or until <a href="#clear">clear</a>() or another <a href="#message">message</a>() is called,
whichever occurs first.

<h3 class=fn>void <a name="messageChanged"></a>TQStatusBar::messageChanged ( const&nbsp;<a href="tqstring.html">TQString</a>&nbsp;&amp;&nbsp;message )<tt> [signal]</tt>
</h3>

<p> This signal is emitted when the temporary status messages
changes. <em>message</em> is the new temporary message, and is a
null-string when the message has been removed.
<p> <p>See also <a href="#message">message</a>() and <a href="#clear">clear</a>().

<h3 class=fn>void <a name="paintEvent"></a>TQStatusBar::paintEvent ( <a href="tqpaintevent.html">TQPaintEvent</a>&nbsp;* )<tt> [virtual protected]</tt>
</h3>
Shows the temporary message, if appropriate.

<p>Reimplemented from <a href="tqwidget.html#paintEvent">TQWidget</a>.
<h3 class=fn>void <a name="reformat"></a>TQStatusBar::reformat ()<tt> [protected]</tt>
</h3>
Changes the status bar's appearance to account for item changes.
Special subclasses may need this, but geometry management will
usually take care of any necessary rearrangements.

<h3 class=fn>void <a name="removeWidget"></a>TQStatusBar::removeWidget ( <a href="tqwidget.html">TQWidget</a>&nbsp;*&nbsp;widget )<tt> [virtual]</tt>
</h3>
Removes <em>widget</em> from the status bar.
<p> This function may cause some flicker.
<p> Note that <em>widget</em> is not deleted.
<p> <p>See also <a href="#addWidget">addWidget</a>().

<h3 class=fn>void <a name="setSizeGripEnabled"></a>TQStatusBar::setSizeGripEnabled ( bool )
</h3><p>Sets whether the <a href="tqsizegrip.html">TQSizeGrip</a> in the bottom right of the status bar is enabled.
See the <a href="tqstatusbar.html#sizeGripEnabled-prop">"sizeGripEnabled"</a> property for details.
<hr><h2>Property Documentation</h2>
<h3 class=fn>bool <a name="sizeGripEnabled-prop"></a>sizeGripEnabled</h3>
<p>This property holds whether the <a href="tqsizegrip.html">TQSizeGrip</a> in the bottom right of the status bar is enabled.
<p>Enables or disables the TQSizeGrip in the bottom right of the
status bar. By default, the size grip is enabled.

<p>Set this property's value with <a href="#setSizeGripEnabled">setSizeGripEnabled</a>() and get this property's value with <a href="#isSizeGripEnabled">isSizeGripEnabled</a>().
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt toolkit</a>.
Copyright &copy; 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 &copy; 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>