You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/html/ntqstatusbar.html

218 lines
12 KiB

<!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/qstatusbar.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="qstatusbar-h.html">ntqstatusbar.h</a>&gt;</tt>
<p>Inherits <a href="ntqwidget.html">TQWidget</a>.
<p><a href="qstatusbar-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="ntqobject.html#connect">connect</a>( loader, TQ_SIGNAL(progressMessage(const <a href="ntqstring.html">TQString</a>&amp;)),
statusBar(), TQ_SLOT(<a href="#message">message</a>(const <a href="ntqstring.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="ntqlabel.html">TQLabel</a>, <a href="ntqprogressbar.html">TQProgressBar</a> or even <a href="ntqtoolbutton.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="ntqsizegrip.html">TQSizeGrip</a> in the lower-right
corner. You can disable it with <a href="#setSizeGripEnabled">setSizeGripEnabled</a>(FALSE);
<p> <img src=qstatusbar-m.png> <img src=qstatusbar-w.png>
<p> <p>See also <a href="ntqtoolbar.html">TQToolBar</a>, <a href="ntqmainwindow.html">TQMainWindow</a>, <a href="ntqlabel.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="ntqwidget.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="ntqwidget.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="ntqsizegrip.html">TQSizeGrip</a> in the bottom right of the status bar is enabled; otherwise returns FALSE.
See the <a href="ntqstatusbar.html#sizeGripEnabled-prop">"sizeGripEnabled"</a> property for details.
<h3 class=fn>void <a name="message"></a>TQStatusBar::message ( const&nbsp;<a href="ntqstring.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="ntqstring.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="ntqstring.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="qpaintevent.html">TQPaintEvent</a>&nbsp;* )<tt> [virtual protected]</tt>
</h3>
Shows the temporary message, if appropriate.
<p>Reimplemented from <a href="ntqwidget.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="ntqwidget.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="ntqsizegrip.html">TQSizeGrip</a> in the bottom right of the status bar is enabled.
See the <a href="ntqstatusbar.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="ntqsizegrip.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>