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.
198 lines
12 KiB
198 lines
12 KiB
13 years ago
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||
5 months ago
|
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/tqtoolbar.cpp:210 -->
|
||
13 years ago
|
<html>
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||
|
<title>TQToolBar 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>TQToolBar Class Reference</h1>
|
||
|
|
||
|
<p>The TQToolBar class provides a movable panel containing
|
||
|
widgets such as tool buttons.
|
||
|
<a href="#details">More...</a>
|
||
5 months ago
|
<p><tt>#include <<a href="tqtoolbar-h.html">tqtoolbar.h</a>></tt>
|
||
13 years ago
|
<p>Inherits <a href="ntqdockwindow.html">TQDockWindow</a>.
|
||
5 months ago
|
<p><a href="tqtoolbar-members.html">List of all member functions.</a>
|
||
13 years ago
|
<h2>Public Members</h2>
|
||
|
<ul>
|
||
|
<li class=fn>TQToolBar ( const TQString & label, TQMainWindow *, ToolBarDock = DockTop, bool newLine = FALSE, const char * name = 0 ) <em>(obsolete)</em></li>
|
||
|
<li class=fn><a href="#TQToolBar-2"><b>TQToolBar</b></a> ( const TQString & label, TQMainWindow * mainWindow, TQWidget * parent, bool newLine = FALSE, const char * name = 0, WFlags f = 0 )</li>
|
||
|
<li class=fn><a href="#TQToolBar-3"><b>TQToolBar</b></a> ( TQMainWindow * parent = 0, const char * name = 0 )</li>
|
||
|
<li class=fn>void <a href="#addSeparator"><b>addSeparator</b></a> ()</li>
|
||
|
<li class=fn>TQMainWindow * <a href="#mainWindow"><b>mainWindow</b></a> () const</li>
|
||
|
<li class=fn>virtual void <a href="#setStretchableWidget"><b>setStretchableWidget</b></a> ( TQWidget * w )</li>
|
||
|
<li class=fn>virtual void <a href="#setLabel"><b>setLabel</b></a> ( const TQString & )</li>
|
||
|
<li class=fn>TQString <a href="#label"><b>label</b></a> () const</li>
|
||
|
<li class=fn>virtual void <a href="#clear"><b>clear</b></a> ()</li>
|
||
|
</ul>
|
||
|
<h2>Properties</h2>
|
||
|
<ul>
|
||
|
<li class=fn>TQString <a href="#label-prop"><b>label</b></a> - the toolbar's label</li>
|
||
|
</ul>
|
||
|
<hr><a name="details"></a><h2>Detailed Description</h2>
|
||
|
|
||
|
|
||
|
The TQToolBar class provides a movable panel containing
|
||
|
widgets such as tool buttons.
|
||
|
<p>
|
||
|
|
||
|
<p> A toolbar is a panel that contains a set of controls, usually
|
||
12 years ago
|
represented by small icons. It's purpose is to provide quick
|
||
13 years ago
|
access to frequently used commands or options. Within a
|
||
5 months ago
|
<a href="tqmainwindow.html">TQMainWindow</a> the user can drag toolbars within and between the
|
||
13 years ago
|
<a href="ntqdockarea.html">dock areas</a>. Toolbars can also be dragged
|
||
13 years ago
|
out of any dock area to float freely as top-level windows.
|
||
13 years ago
|
<p> TQToolBar is a specialization of <a href="ntqdockwindow.html">TQDockWindow</a>, and so provides all
|
||
13 years ago
|
the functionality of a TQDockWindow.
|
||
|
<p> To use TQToolBar you simply create a TQToolBar as a child of a
|
||
5 months ago
|
TQMainWindow, create a number of <a href="tqtoolbutton.html">TQToolButton</a> widgets (or other
|
||
13 years ago
|
widgets) in left to right (or top to bottom) order and call
|
||
|
<a href="#addSeparator">addSeparator</a>() when you want a separator. When a toolbar is
|
||
|
floated the caption used is the label given in the constructor
|
||
|
call. This can be changed with <a href="#setLabel">setLabel</a>().
|
||
|
<p>
|
||
|
|
||
|
<pre> TQToolBar * fileTools = new TQToolBar( this, "file operations" );
|
||
|
fileTools-><a href="#setLabel">setLabel</a>( "File Operations" );
|
||
5 months ago
|
fileOpenAction-><a href="tqaction.html#addTo">addTo</a>( fileTools );
|
||
|
fileSaveAction-><a href="tqaction.html#addTo">addTo</a>( fileTools );
|
||
13 years ago
|
</pre>
|
||
|
<p> This extract from the <a href="simple-application-example.html">application/application.cpp</a> example shows
|
||
5 months ago
|
the creation of a new toolbar as a child of a <a href="tqmainwindow.html">TQMainWindow</a> and
|
||
13 years ago
|
adding two TQActions.
|
||
|
<p> You may use most widgets within a toolbar, with TQToolButton and
|
||
13 years ago
|
<a href="ntqcombobox.html">TQComboBox</a> being the most common.
|
||
13 years ago
|
<p> If you create a new widget on an already visible TQToolBar, this
|
||
6 months ago
|
widget will automatically become visible without needing a <a href="tqwidget.html#show">show</a>()
|
||
13 years ago
|
call. (This differs from every other TQt widget container. We
|
||
|
recommend calling show() anyway since we hope to fix this anomaly
|
||
|
in a future release.)
|
||
13 years ago
|
<p> TQToolBars, like TQDockWindows, are located in <a href="ntqdockarea.html">TQDockArea</a>s or
|
||
13 years ago
|
float as top-level windows. TQMainWindow provides four TQDockAreas
|
||
|
(top, left, right and bottom). When you create a new toolbar (as
|
||
|
in the example above) as a child of a TQMainWindow the toolbar will
|
||
|
be added to the top dock area. You can move it to another dock
|
||
5 months ago
|
area (or float it) by calling <a href="tqmainwindow.html#moveDockWindow">TQMainWindow::moveDockWindow</a>(). TQDock
|
||
13 years ago
|
areas lay out their windows in <a href="ntqdockarea.html#lines">Lines</a>.
|
||
13 years ago
|
<p> If the main window is resized so that the area occupied by the
|
||
|
toolbar is too small to show all its widgets a little arrow button
|
||
|
(which looks like a right-pointing chevron, '»') will appear
|
||
|
at the right or bottom of the toolbar depending on its
|
||
|
orientation. Clicking this button pops up a menu that shows the
|
||
|
'overflowing' items. TQToolButtons are represented in the menu using
|
||
13 years ago
|
their textLabel property, other <a href="ntqbutton.html">TQButton</a> subclasses are represented
|
||
13 years ago
|
using their text property, and TQComboBoxes are represented as submenus,
|
||
|
with the caption text being used in the submenu item.
|
||
|
<p> Usually a toolbar will get precisely the space it needs. However,
|
||
13 years ago
|
with <a href="ntqdockwindow.html#setHorizontalStretchable">setHorizontalStretchable</a>(), <a href="ntqdockwindow.html#setVerticalStretchable">setVerticalStretchable</a>() or
|
||
13 years ago
|
<a href="#setStretchableWidget">setStretchableWidget</a>() you can tell the main window to expand the
|
||
|
toolbar to fill all available space in the specified orientation.
|
||
|
<p> The toolbar arranges its buttons either horizontally or vertically
|
||
13 years ago
|
(see <a href="ntqdockwindow.html#orientation">orientation</a>() for details). Generally, <a href="ntqdockarea.html">TQDockArea</a> will set the
|
||
13 years ago
|
orientation correctly for you, but you can set it yourself with
|
||
13 years ago
|
<a href="ntqdockwindow.html#setOrientation">setOrientation</a>() and track any changes by connecting to the
|
||
|
<a href="ntqdockwindow.html#orientationChanged">orientationChanged</a>() signal.
|
||
13 years ago
|
<p> You can use the <a href="#clear">clear</a>() method to remove all items from a toolbar.
|
||
|
<p> <center><img src="qdockwindow.png" alt="Toolbar (dock window)"></center> <blockquote><p align="center"><em> A floating TQToolbar (dock window)
|
||
|
</em></p>
|
||
5 months ago
|
</blockquote><p> <p>See also <a href="tqtoolbutton.html">TQToolButton</a>, <a href="tqmainwindow.html">TQMainWindow</a>, <a href="http://www.iarchitect.com/visual.htm">Parts of Isys on Visual Design</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Tool Bar</a>, and <a href="application.html">Main Window and Related Classes</a>.
|
||
13 years ago
|
|
||
|
<hr><h2>Member Function Documentation</h2>
|
||
5 months ago
|
<h3 class=fn><a name="TQToolBar"></a>TQToolBar::TQToolBar ( const <a href="tqstring.html">TQString</a> & label, <a href="tqmainwindow.html">TQMainWindow</a> *, ToolBarDock = DockTop, bool newLine = FALSE, const char * name = 0 )
|
||
13 years ago
|
</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>
|
||
5 months ago
|
<h3 class=fn><a name="TQToolBar-2"></a>TQToolBar::TQToolBar ( const <a href="tqstring.html">TQString</a> & label, <a href="tqmainwindow.html">TQMainWindow</a> * mainWindow, <a href="tqwidget.html">TQWidget</a> * parent, bool newLine = FALSE, const char * name = 0, WFlags f = 0 )
|
||
13 years ago
|
</h3>
|
||
|
Constructs an empty horizontal toolbar.
|
||
|
<p> The toolbar is called <em>name</em> and is a child of <em>parent</em> and is
|
||
|
managed by <em>mainWindow</em>. The <em>label</em> and <em>newLine</em> parameters
|
||
5 months ago
|
are passed straight to <a href="tqmainwindow.html#addDockWindow">TQMainWindow::addDockWindow</a>(). <em>name</em> and
|
||
13 years ago
|
the widget flags <em>f</em> are passed on to the <a href="ntqdockwindow.html">TQDockWindow</a> constructor.
|
||
13 years ago
|
<p> Use this constructor if you want to create torn-off (undocked,
|
||
5 months ago
|
floating) toolbars or toolbars in the <a href="tqstatusbar.html">status
|
||
13 years ago
|
bar</a>.
|
||
|
|
||
5 months ago
|
<h3 class=fn><a name="TQToolBar-3"></a>TQToolBar::TQToolBar ( <a href="tqmainwindow.html">TQMainWindow</a> * parent = 0, const char * name = 0 )
|
||
13 years ago
|
</h3>
|
||
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
||
|
<p> Constructs an empty toolbar called <em>name</em>, with parent <em>parent</em>,
|
||
|
in its <em>parent</em>'s top dock area, without any label and without
|
||
12 years ago
|
requiring a newline.
|
||
13 years ago
|
|
||
|
<h3 class=fn>void <a name="addSeparator"></a>TQToolBar::addSeparator ()
|
||
|
</h3>
|
||
|
Adds a separator to the right/bottom of the toolbar.
|
||
|
|
||
|
<p>Examples: <a href="canvas-chart-example.html#x2894">chart/chartform.cpp</a>, <a href="fileiconview-example.html#x895">fileiconview/mainwindow.cpp</a>, <a href="helpviewer-example.html#x1033">helpviewer/helpwindow.cpp</a>, <a href="qfd-example.html#x2010">qfd/fontdisplayer.cpp</a>, and <a href="scribble-example.html#x943">scribble/scribble.cpp</a>.
|
||
|
<h3 class=fn>void <a name="clear"></a>TQToolBar::clear ()<tt> [virtual]</tt>
|
||
|
</h3>
|
||
|
Deletes all the toolbar's child widgets.
|
||
|
|
||
6 months ago
|
<h3 class=fn><a href="tqstring.html">TQString</a> <a name="label"></a>TQToolBar::label () const
|
||
13 years ago
|
</h3><p>Returns the toolbar's label.
|
||
5 months ago
|
See the <a href="tqtoolbar.html#label-prop">"label"</a> property for details.
|
||
|
<h3 class=fn><a href="tqmainwindow.html">TQMainWindow</a> * <a name="mainWindow"></a>TQToolBar::mainWindow () const
|
||
13 years ago
|
</h3>
|
||
5 months ago
|
Returns a pointer to the <a href="tqmainwindow.html">TQMainWindow</a> which manages this toolbar.
|
||
13 years ago
|
|
||
6 months ago
|
<h3 class=fn>void <a name="setLabel"></a>TQToolBar::setLabel ( const <a href="tqstring.html">TQString</a> & )<tt> [virtual]</tt>
|
||
13 years ago
|
</h3><p>Sets the toolbar's label.
|
||
5 months ago
|
See the <a href="tqtoolbar.html#label-prop">"label"</a> property for details.
|
||
6 months ago
|
<h3 class=fn>void <a name="setStretchableWidget"></a>TQToolBar::setStretchableWidget ( <a href="tqwidget.html">TQWidget</a> * w )<tt> [virtual]</tt>
|
||
13 years ago
|
</h3>
|
||
|
Sets the widget <em>w</em> to be expanded if this toolbar is requested
|
||
|
to stretch.
|
||
5 months ago
|
<p> The request to stretch might occur because <a href="tqmainwindow.html">TQMainWindow</a>
|
||
13 years ago
|
right-justifies the dock area the toolbar is in, or because this
|
||
13 years ago
|
toolbar's <a href="ntqdockwindow.html#isVerticalStretchable">isVerticalStretchable</a>() or <a href="ntqdockwindow.html#isHorizontalStretchable">isHorizontalStretchable</a>() is
|
||
13 years ago
|
set to TRUE.
|
||
|
<p> If you call this function and the toolbar is not yet stretchable,
|
||
|
setStretchable() is called.
|
||
5 months ago
|
<p> <p>See also <a href="tqmainwindow.html#rightJustification-prop">TQMainWindow::rightJustification</a>, <a href="ntqdockwindow.html#setVerticalStretchable">setVerticalStretchable</a>(), and <a href="ntqdockwindow.html#setHorizontalStretchable">setHorizontalStretchable</a>().
|
||
13 years ago
|
|
||
|
<p>Examples: <a href="fileiconview-example.html#x896">fileiconview/mainwindow.cpp</a> and <a href="helpviewer-example.html#x1034">helpviewer/helpwindow.cpp</a>.
|
||
|
<hr><h2>Property Documentation</h2>
|
||
6 months ago
|
<h3 class=fn><a href="tqstring.html">TQString</a> <a name="label-prop"></a>label</h3>
|
||
13 years ago
|
<p>This property holds the toolbar's label.
|
||
|
<p>If the toolbar is floated the label becomes the toolbar window's
|
||
|
caption. There is no default label text.
|
||
|
|
||
|
<p>Set this property's value with <a href="#setLabel">setLabel</a>() and get this property's value with <a href="#label">label</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>
|