summaryrefslogtreecommitdiffstats
path: root/doc/html/qdockarea.html
blob: c27333f2649e872f824a18ed2e7fbde78bee7307 (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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<!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/qdockarea.cpp:450 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQDockArea 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>TQDockArea Class Reference</h1>

<p>The TQDockArea class manages and lays out TQDockWindows.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qdockarea-h.html">qdockarea.h</a>&gt;</tt>
<p>Inherits <a href="qwidget.html">TQWidget</a>.
<p><a href="qdockarea-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn>enum <a href="#HandlePosition-enum"><b>HandlePosition</b></a> { Normal, Reverse }</li>
<li class=fn><a href="#TQDockArea"><b>TQDockArea</b></a> ( Orientation&nbsp;o, HandlePosition&nbsp;h = Normal, TQWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
<li class=fn><a href="#~TQDockArea"><b>~TQDockArea</b></a> ()</li>
<li class=fn>void <a href="#moveDockWindow-2"><b>moveDockWindow</b></a> ( TQDockWindow&nbsp;*&nbsp;w, const&nbsp;TQPoint&nbsp;&amp;&nbsp;p, const&nbsp;TQRect&nbsp;&amp;&nbsp;r, bool&nbsp;swap )</li>
<li class=fn>void <a href="#removeDockWindow"><b>removeDockWindow</b></a> ( TQDockWindow&nbsp;*&nbsp;w, bool&nbsp;makeFloating, bool&nbsp;swap, bool&nbsp;fixNewLines = TRUE )</li>
<li class=fn>void <a href="#moveDockWindow"><b>moveDockWindow</b></a> ( TQDockWindow&nbsp;*&nbsp;w, int&nbsp;index = -1 )</li>
<li class=fn>bool <a href="#hasDockWindow"><b>hasDockWindow</b></a> ( TQDockWindow&nbsp;*&nbsp;w, int&nbsp;*&nbsp;index = 0 )</li>
<li class=fn>Orientation <a href="#orientation"><b>orientation</b></a> () const</li>
<li class=fn>HandlePosition <a href="#handlePosition"><b>handlePosition</b></a> () const</li>
<li class=fn>bool <a href="#isEmpty"><b>isEmpty</b></a> () const</li>
<li class=fn>int <a href="#count"><b>count</b></a> () const</li>
<li class=fn>TQPtrList&lt;TQDockWindow&gt; <a href="#dockWindowList"><b>dockWindowList</b></a> () const</li>
<li class=fn>bool <a href="#isDockWindowAccepted"><b>isDockWindowAccepted</b></a> ( TQDockWindow&nbsp;*&nbsp;dw )</li>
<li class=fn>void <a href="#setAcceptDockWindow"><b>setAcceptDockWindow</b></a> ( TQDockWindow&nbsp;*&nbsp;dw, bool&nbsp;accept )</li>
</ul>
<h2>Public Slots</h2>
<ul>
<li class=fn>void <a href="#lineUp"><b>lineUp</b></a> ( bool&nbsp;keepNewLines )</li>
</ul>
<h2>Properties</h2>
<ul>
<li class=fn>int <a href="#count-prop"><b>count</b></a>&nbsp;- the number of dock windows in the dock area &nbsp;<em>(read only)</em></li>
<li class=fn>bool <a href="#empty-prop"><b>empty</b></a>&nbsp;- whether the dock area is empty &nbsp;<em>(read only)</em></li>
<li class=fn>HandlePosition <a href="#handlePosition-prop"><b>handlePosition</b></a>&nbsp;- where the dock window splitter handle is placed in the dock area &nbsp;<em>(read only)</em></li>
<li class=fn>Orientation <a href="#orientation-prop"><b>orientation</b></a>&nbsp;- the dock area's orientation &nbsp;<em>(read only)</em></li>
</ul>
<h2>Related Functions</h2>
<ul>
<li class=fn>TQTextStream &amp; <a href="#operator-lt-lt"><b>operator&lt;&lt;</b></a> ( TQTextStream&nbsp;&amp;&nbsp;ts, const&nbsp;TQDockArea&nbsp;&amp;&nbsp;dockArea )</li>
<li class=fn>TQTextStream &amp; <a href="#operator-gt-gt"><b>operator&gt;&gt;</b></a> ( TQTextStream&nbsp;&amp;&nbsp;ts, TQDockArea&nbsp;&amp;&nbsp;dockArea )</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The TQDockArea class manages and lays out TQDockWindows.
<p> 
<p> A TQDockArea is a container which manages a list of
<a href="qdockwindow.html">TQDockWindow</a>s which it lays out within its area. In cooperation
with the <a href="qdockwindow.html">TQDockWindow</a>s it is responsible for the docking and
undocking of <a href="qdockwindow.html">TQDockWindow</a>s and moving them inside the dock
area. TQDockAreas also handle the wrapping of <a href="qdockwindow.html">TQDockWindow</a>s to
fill the available space as compactly as possible. TQDockAreas can
contain TQToolBars since <a href="qtoolbar.html">TQToolBar</a> is a <a href="qdockwindow.html">TQDockWindow</a> subclass.
<p> <a href="qmainwindow.html">TQMainWindow</a> contains four TQDockAreas which you can use for your
TQToolBars and TQDockWindows, so in most situations you do not need
to use the TQDockArea class directly. Although TQMainWindow contains
support for its own dock areas it isn't convenient for adding new
TQDockAreas. If you need to create your own dock areas we suggest
that you create a subclass of <a href="qwidget.html">TQWidget</a> and add your TQDockAreas to
your subclass.
<p> <center><img src="qmainwindow-qdockareas.png" alt="TQMainWindow's TQDockAreas"></center> 
<p> <a name="lines"></a>
<em>Lines</em>. TQDockArea uses the concept of lines. A line is a
horizontal region which may contain dock windows side-by-side. A
dock area may have room for more than one line. When dock windows
are docked into a dock area they are usually added at the right
hand side of the top-most line that has room (unless manually
placed by the user). When users move dock windows they may leave
empty lines or gaps in non-empty lines. Dock windows can be lined
up to minimize wasted space using the <a href="#lineUp">lineUp</a>() function.
<p> The TQDockArea class maintains a position list of all its child
dock windows. Dock windows are added to a dock area from position
0 onwards. Dock windows are laid out sequentially in position
order from left to right, and in the case of multiple lines of
dock windows, from top to bottom. If a dock window is floated it
still retains its position since this is where the window will
return if the user double clicks its caption. A dock window's
position can be determined with <a href="#hasDockWindow">hasDockWindow</a>(). The position can
be changed with <a href="#moveDockWindow">moveDockWindow</a>().
<p> To dock or undock a dock window use <a href="qdockwindow.html#dock">TQDockWindow::dock</a>() and
<a href="qdockwindow.html#undock">TQDockWindow::undock</a>() respectively. If you want to control which
dock windows can dock in a dock area use <a href="#setAcceptDockWindow">setAcceptDockWindow</a>(). To
see if a dock area contains a particular dock window use
<a href="#hasDockWindow">hasDockWindow</a>(); to see how many dock windows a dock area
contains use <a href="#count">count</a>().
<p> The streaming operators can write the positions of the dock
windows in the dock area to a <a href="qtextstream.html">TQTextStream</a>. The positions can be
read back later to restore the saved positions.
<p> Save the positions to a TQTextStream:
<pre>
    ts &lt;&lt; *myDockArea;
    </pre>
 
<p> Restore the positions from a TQTextStream:
<pre>
    ts &gt;&gt; *myDockArea;
    </pre>
 
<p>See also <a href="application.html">Main Window and Related Classes</a>.

<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="HandlePosition-enum"></a>TQDockArea::HandlePosition</h3>

<p> A dock window has two kinds of handles, the dock window handle
used for dragging the dock window, and the splitter handle used to
resize the dock window in relation to other dock windows using a
splitter. (The splitter handle is only visible for docked
windows.)
<p> This enum specifies where the dock window splitter handle is
placed in the dock area.
<ul>
<li><tt>TQDockArea::Normal</tt> - The splitter handles of dock windows are placed at
the right or bottom.
<li><tt>TQDockArea::Reverse</tt> - The splitter handles of dock windows are placed at
the left or top.
</ul>
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQDockArea"></a>TQDockArea::TQDockArea ( <a href="qt.html#Orientation-enum">Orientation</a>&nbsp;o, <a href="qdockarea.html#HandlePosition-enum">HandlePosition</a>&nbsp;h = Normal, <a href="qwidget.html">TQWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a TQDockArea with orientation <em>o</em>, HandlePosition <em>h</em>,
parent <em>parent</em> and called <em>name</em>.

<h3 class=fn><a name="~TQDockArea"></a>TQDockArea::~TQDockArea ()
</h3>
Destroys the dock area and all the dock windows docked in the dock
area.
<p> Does not affect any floating dock windows or dock windows in other
dock areas, even if they first appeared in this dock area.
Floating dock windows are effectively top level windows and are
not child windows of the dock area. When a floating dock window is
docked (dragged into a dock area) its parent becomes the dock
area.

<h3 class=fn>int <a name="count"></a>TQDockArea::count () const
</h3><p>Returns the number of dock windows in the dock area.
See the <a href="qdockarea.html#count-prop">"count"</a> property for details.
<h3 class=fn><a href="qptrlist.html">TQPtrList</a>&lt;TQDockWindow&gt; <a name="dockWindowList"></a>TQDockArea::dockWindowList () const
</h3>
Returns a list of the dock windows in the dock area.

<h3 class=fn><a href="qdockarea.html#HandlePosition-enum">HandlePosition</a> <a name="handlePosition"></a>TQDockArea::handlePosition () const
</h3><p>Returns where the dock window splitter handle is placed in the dock area.
See the <a href="qdockarea.html#handlePosition-prop">"handlePosition"</a> property for details.
<h3 class=fn>bool <a name="hasDockWindow"></a>TQDockArea::hasDockWindow ( <a href="qdockwindow.html">TQDockWindow</a>&nbsp;*&nbsp;w, int&nbsp;*&nbsp;index = 0 )
</h3>
Returns TRUE if the dock area contains the dock window <em>w</em>;
otherwise returns FALSE. If <em>index</em> is not 0 it will be set as
follows: if the dock area contains the dock window <em>*index</em> is
set to <em>w</em>'s index position; otherwise <em>*index</em> is set to -1.

<h3 class=fn>bool <a name="isDockWindowAccepted"></a>TQDockArea::isDockWindowAccepted ( <a href="qdockwindow.html">TQDockWindow</a>&nbsp;*&nbsp;dw )
</h3>
Returns TRUE if dock window <em>dw</em> could be docked into the dock
area; otherwise returns FALSE.
<p> <p>See also <a href="#setAcceptDockWindow">setAcceptDockWindow</a>().

<h3 class=fn>bool <a name="isEmpty"></a>TQDockArea::isEmpty () const
</h3><p>Returns TRUE if the dock area is empty; otherwise returns FALSE.
See the <a href="qdockarea.html#empty-prop">"empty"</a> property for details.
<h3 class=fn>void <a name="lineUp"></a>TQDockArea::lineUp ( bool&nbsp;keepNewLines )<tt> [slot]</tt>
</h3>
Lines up the dock windows in this dock area to minimize wasted
space. If <em>keepNewLines</em> is TRUE, only space within lines is
cleaned up. If <em>keepNewLines</em> is FALSE the number of lines might
be changed.

<h3 class=fn>void <a name="moveDockWindow"></a>TQDockArea::moveDockWindow ( <a href="qdockwindow.html">TQDockWindow</a>&nbsp;*&nbsp;w, int&nbsp;index = -1 )
</h3>
Moves the <a href="qdockwindow.html">TQDockWindow</a> <em>w</em> within the dock area. If <em>w</em> is not
already docked in this area, <em>w</em> is docked first. If <em>index</em> is
-1 or larger than the number of docked widgets, <em>w</em> is appended
at the end, otherwise it is inserted at the position <em>index</em>.

<h3 class=fn>void <a name="moveDockWindow-2"></a>TQDockArea::moveDockWindow ( <a href="qdockwindow.html">TQDockWindow</a>&nbsp;*&nbsp;w, const&nbsp;<a href="qpoint.html">TQPoint</a>&nbsp;&amp;&nbsp;p, const&nbsp;<a href="qrect.html">TQRect</a>&nbsp;&amp;&nbsp;r, bool&nbsp;swap )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Moves the dock window <em>w</em> inside the dock area where <em>p</em> is the
new position (in global screen coordinates), <em>r</em> is the suggested
rectangle of the dock window and <em>swap</em> specifies whether or not
the orientation of the docked widget needs to be changed.
<p> This function is used internally by <a href="qdockwindow.html">TQDockWindow</a>. You shouldn't
need to call it yourself.

<h3 class=fn><a href="qt.html#Orientation-enum">Orientation</a> <a name="orientation"></a>TQDockArea::orientation () const
</h3><p>Returns the dock area's orientation.
See the <a href="qdockarea.html#orientation-prop">"orientation"</a> property for details.
<h3 class=fn>void <a name="removeDockWindow"></a>TQDockArea::removeDockWindow ( <a href="qdockwindow.html">TQDockWindow</a>&nbsp;*&nbsp;w, bool&nbsp;makeFloating, bool&nbsp;swap, bool&nbsp;fixNewLines = TRUE )
</h3>
Removes the dock window <em>w</em> from the dock area. If <em>makeFloating</em> is TRUE, <em>w</em> gets floated, and if <em>swap</em> is TRUE,
the orientation of <em>w</em> gets swapped. If <em>fixNewLines</em> is TRUE
(the default) newlines in the area will be fixed.
<p> You should never need to call this function yourself. Use
<a href="qdockwindow.html#dock">TQDockWindow::dock</a>() and <a href="qdockwindow.html#undock">TQDockWindow::undock</a>() instead.

<h3 class=fn>void <a name="setAcceptDockWindow"></a>TQDockArea::setAcceptDockWindow ( <a href="qdockwindow.html">TQDockWindow</a>&nbsp;*&nbsp;dw, bool&nbsp;accept )
</h3>
If <em>accept</em> is TRUE, dock window <em>dw</em> can be docked in the dock
area. If <em>accept</em> is FALSE, dock window <em>dw</em> cannot be docked in
the dock area.
<p> <p>See also <a href="#isDockWindowAccepted">isDockWindowAccepted</a>().

<hr><h2>Property Documentation</h2>
<h3 class=fn>int <a name="count-prop"></a>count</h3>
<p>This property holds the number of dock windows in the dock area.
<p>
<p>Get this property's value with <a href="#count">count</a>().
<h3 class=fn>bool <a name="empty-prop"></a>empty</h3>
<p>This property holds whether the dock area is empty.
<p>
<p>Get this property's value with <a href="#isEmpty">isEmpty</a>().
<h3 class=fn><a href="qdockarea.html#HandlePosition-enum">HandlePosition</a> <a name="handlePosition-prop"></a>handlePosition</h3>
<p>This property holds where the dock window splitter handle is placed in the dock area.
<p>The default position is <a href="#HandlePosition-enum">Normal</a>.

<p>Get this property's value with <a href="#handlePosition">handlePosition</a>().
<h3 class=fn><a href="qt.html#Orientation-enum">Orientation</a> <a name="orientation-prop"></a>orientation</h3>
<p>This property holds the dock area's orientation.
<p>There is no default value; the orientation is specified in the
constructor.

<p>Get this property's value with <a href="#orientation">orientation</a>().
<hr><h2>Related Functions</h2>
<h3 class=fn><a href="qtextstream.html">TQTextStream</a>&nbsp;&amp; <a name="operator-lt-lt"></a>operator&lt;&lt; ( <a href="qtextstream.html">TQTextStream</a>&nbsp;&amp;&nbsp;ts, const&nbsp;<a href="qdockarea.html">TQDockArea</a>&nbsp;&amp;&nbsp;dockArea )
</h3>

<p> Writes the layout of the dock windows in dock area <em>dockArea</em> to
the text stream <em>ts</em>.
<p> <p>See also <a href="#operator-gt-gt">operator&gt;&gt;</a>().

<h3 class=fn><a href="qtextstream.html">TQTextStream</a>&nbsp;&amp; <a name="operator-gt-gt"></a>operator&gt;&gt; ( <a href="qtextstream.html">TQTextStream</a>&nbsp;&amp;&nbsp;ts, <a href="qdockarea.html">TQDockArea</a>&nbsp;&amp;&nbsp;dockArea )
</h3>

<p> Reads the layout description of the dock windows in dock area <em>dockArea</em> from the text stream <em>ts</em> and restores it. The layout
description must have been previously written by the <a href="#operator-lt-lt">operator&lt;&lt;</a>()
function.
<p> <p>See also <a href="#operator-lt-lt">operator&lt;&lt;</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>