OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [man/] [Form.html] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
 
2
 
3
 
4
<TITLE>tixForm - Geometry manager based on attachment rules</TITLE>
5
<Center><H2>tixForm - Geometry manager based on attachment rules</H2></Center><hr>
6
 
7
</pre><H3>SYNOPSIS</H3>
8
<P>
9
<B>tixForm<I> option arg ?arg ...?</I></B>
10
</pre><HR>
11
<P>
12
</pre><H3>DESCRIPTION</H3>
13
<P>
14
The <B>tixForm</B></I> command is used to communicate with the
15
<B>tixForm</B></I> Geometry Manager, a geometry manager that arranges the
16
geometry of the children in a parent window according to attachment
17
rules. The <B>tixForm</B></I> geometry manager is very flexible and
18
powerful; it can be used to emulate all the existing features of the
19
Tk packer and placer geometry managers (see <B>pack(n)</B></I>,
20
<B>place(n)</B></I>).
21
The <B>tixForm</B></I> command can have any of several forms,
22
depending on the <I>option</I></B> argument:
23
<DL>
24
<DT> <B>tixForm<I> slave </I></B>?<I>options</I></B>?
25
</I></B>
26
<DD> If the first argument to <B>tixForm</B></I> is a window name (any value
27
<B>tixForm configure</B></I>.
28
</DL>
29
<DL>
30
<DT> <B>tixForm check <I>master</I></B>
31
</I></B>
32
<DD> This command checks whether there is circular dependency in the
33
DEPENDENCY</B></I> below). It returns the Boolean value <B>TRUE</B></I> if it
34
discover circular dependency and <B>FALSE</B></I> otherwise.
35
</DL>
36
<DL>
37
<DT> <B>tixForm configure<I> slave </I></B>?<I>-option value ...</I></B>?
38
</I></B>
39
<DD> Sets or adjusts the attachment values of the slave window
40
according to the <I>-option value</I></B> argument pairs.
41
</DL>
42
<UL>
43
<DL>
44
<DT> <B>-b</B></I> <I>attachment</I></B>
45
</I></B>
46
<DD> Abbreviation for the <B>-bottom</B></I> option.
47
</DL>
48
<DL>
49
<DT> <B>-bottom</B></I> <I>attachment</I></B>
50
</I></B>
51
<DD> Specifies an attachment for the bottom edge of the slave window. The
52
attachment must specied according to the section <B>SPECIFYING
53
ATTACHMENTS</B></I> below.
54
</DL>
55
<DL>
56
<DT> <B>-bottomspring</B></I> <I>weight</I></B>
57
</I></B>
58
<DD> Specifies the weight of the spring at the bottom edge of the slave
59
window. See the section <B>USING SPRINGS</B></I> below.
60
</DL>
61
<DL>
62
<DT> <B>-bp</B></I> <I>value</I></B>
63
</I></B>
64
<DD> Abbreviation for the <B>-padbottom</B></I> option.
65
</DL>
66
<DL>
67
<DT> <B>-bs</B></I> <I>weight</I></B>
68
</I></B>
69
<DD> Abbreviation for the <B>-bottomspring</B></I> option.
70
</DL>
71
<DL>
72
<DT> <B>-fill</B></I> <I>master</I></B>
73
</I></B>
74
<DD> Specifies the fillings when springs are used for this widget. The
75
value must be <B>x</B></I>, <B>y</B></I>, <B>both</B></I> or <B>none</B></I>.
76
</DL>
77
<DL>
78
<DT> <B>-in</B></I> <I>master</I></B>
79
</I></B>
80
<DD> Places the slave window into the specified master window. If the slave
81
was originally in another master window, all attachment values with
82
respect to the original master window are discarded. Even if the
83
attachment values are the same as in the original master window, they
84
need to be specified again.  The <B>-in</B></I> flag, when needed, must appear
85
as the first flag after the name of the slave. Otherwise an error is
86
generated.
87
</DL>
88
<DL>
89
<DT> <B>-l</B></I> <I>attachment</I></B>
90
</I></B>
91
<DD> Abbreviation for the <B>-left</B></I> option.
92
</DL>
93
<DL>
94
<DT> <B>-left</B></I> <I>attachment</I></B>
95
</I></B>
96
<DD> Specifies an attachment for the left edge of the slave window. The
97
attachment must specied according to the section <B>SPECIFYING
98
ATTACHMENTS</B></I> below.
99
</DL>
100
<DL>
101
<DT> <B>-leftspring</B></I> <I>weight</I></B>
102
</I></B>
103
<DD> Specifies the weight of the spring at the left edge of the slave
104
window. See the section <B>USING SPRINGS</B></I> below.
105
</DL>
106
<DL>
107
<DT> <B>-lp</B></I> <I>value</I></B>
108
</I></B>
109
<DD> Abbreviation for the <B>-padleft</B></I> option.
110
</DL>
111
<DL>
112
<DT> <B>-ls</B></I> <I>weight</I></B>
113
</I></B>
114
<DD> Abbreviation for the <B>-leftspring</B></I> option.
115
</DL>
116
<DL>
117
<DT> <B>-padbottom</B></I> <I>value</I></B>
118
</I></B>
119
<DD> Specifies the amount of external padding to leave on the bottom side
120
of the slave. The <I>value</I></B> may have any of the forms acceptable to
121
<B>Tk_GetPixels(3)</B></I>.
122
</DL>
123
<DL>
124
<DT> <B>-padleft</B></I> <I>value</I></B>
125
</I></B>
126
<DD> Specifies the amount of external padding to leave on the left side of
127
the slave.
128
</DL>
129
<DL>
130
<DT> <B>-padright</B></I> <I>value</I></B>
131
</I></B>
132
<DD> Specifies the amount of external padding to leave on the right side of
133
the slave.
134
</DL>
135
<DL>
136
<DT> <B>-padtop</B></I> <I>value</I></B>
137
</I></B>
138
<DD> Specifies the amount of external padding to leave on the top side of
139
the slave.
140
</DL>
141
<DL>
142
<DT> <B>-padx</B></I> <I>value</I></B>
143
</I></B>
144
<DD> Specifies the amount of external padding to leave on both the left and
145
the right sides of the slave.
146
</DL>
147
<DL>
148
<DT> <B>-pady</B></I> <I>value</I></B>
149
</I></B>
150
<DD> Specifies the amount of external padding to leave on both the top and
151
the bottom sides of the slave.
152
</DL>
153
<DL>
154
<DT> <B>-r</B></I> <I>attachment</I></B>
155
</I></B>
156
<DD> Abbreviation for the <B>-right</B></I> option.
157
</DL>
158
<DL>
159
<DT> <B>-right</B></I> <I>attachment</I></B>
160
</I></B>
161
<DD> Specifies an attachment for the right edge of the slave window. The
162
attachment must specied according to the section <B>SPECIFYING
163
ATTACHMENTS</B></I> below.
164
</DL>
165
<DL>
166
<DT> <B>-rightspring</B></I> <I>weight</I></B>
167
</I></B>
168
<DD> Specifies the weight of the spring at the right edge of the slave
169
window. See the section <B>USING SPRINGS</B></I> below.
170
</DL>
171
<DL>
172
<DT> <B>-rp</B></I> <I>value</I></B>
173
</I></B>
174
<DD> Abbreviation for the <B>-padright</B></I> option.
175
</DL>
176
<DL>
177
<DT> <B>-rs</B></I> <I>weight</I></B>
178
</I></B>
179
<DD> Abbreviation for the <B>-rightspring</B></I> option.
180
</DL>
181
<DL>
182
<DT> <B>-t</B></I> <I>attachment</I></B>
183
</I></B>
184
<DD> Abbreviation for the <B>-top</B></I> option.
185
</DL>
186
<DL>
187
<DT> <B>-top</B></I> <I>attachment</I></B>
188
</I></B>
189
<DD> Specifies an attachment for the top edge of the slave window. The
190
attachment must specied according to the section <B>SPECIFYING
191
ATTACHMENTS</B></I> below.
192
</DL>
193
<DL>
194
<DT> <B>-topspring</B></I> <I>weight</I></B>
195
</I></B>
196
<DD> Specifies the weight of the spring at the top edge of the slave
197
window. See the section <B>USING SPRINGS</B></I> below.
198
</DL>
199
<DL>
200
<DT> <B>-tp</B></I> <I>value</I></B>
201
</I></B>
202
<DD> Abbreviation for the <B>-padtop</B></I> option.
203
</DL>
204
<DL>
205
<DT> <B>-ts</B></I> <I>weight</I></B>
206
</I></B>
207
<DD> Abbreviation for the <B>-topspring</B></I> option.
208
</DL>
209
</UL>
210
<DL>
211
<DT> <B>tixForm forget<I> slave </I></B>?<I>slave ...</I></B>?
212
</I></B>
213
<DD> Removes each of the slaves from its master and unmaps their windows.
214
The slaves will no longer be managed by tixForm. All attachment values
215
with respect to their master windows are discarded. If another slave
216
is attached to this slave, then the attachment of the other slave will
217
be changed to grid attachment based on its geometry.
218
</DL>
219
<DL>
220
<DT> <B>tixForm grid <I>master </I></B>?<I>x_size y_size</I></B>?
221
</I></B>
222
<DD> When <I>x_size</I></B> and <I>y_size</I></B> are given, this command returns the
223
number of grids of the master window in a pair of integers of the form
224
{<I>x_size y_size</I></B>}. When both <I>x_size</I></B> and <I>y_size</I></B> are
225
given, this command changes the number of horizontal and vertical
226
grids on the master window.
227
</DL>
228
<DL>
229
<DT> <B>tixForm info<I> slave</I></B> ?<I>option</I></B>?
230
</I></B>
231
<DD> Queries the attachment options of a slave window. <I>option</I></B> can be
232
any of the options accepted by the <B>tixForm configure</B></I> command. If
233
<I>option</I></B> is given, only the value of that option is returned.
234
Otherwise, this command returns a list whose elements are the current
235
configuration state of the slave given in the same <I>option-value</I></B> form
236
that might be specified to <B>tixForm configure</B></I>. The first two
237
elements in this list list are "<B>-in<I> master</I></B>" where
238
</DL>
239
<DL>
240
<DT> <B>tixForm slaves <I>master</I></B>
241
</I></B>
242
<DD> Returns a list of all of the slaves for the master window. The order
243
of the slaves in the list is the same as their order in the packing
244
order. If master has no slaves then an empty string is returned.
245
</DL>
246
<P>
247
</pre><H3>SPECIFYING ATTACHMENTS</H3>
248
One can specify an attachment for each side of a slave window managed
249
by tixForm. An attachment is specified in the the form "-<I>side</I></B>
250
{<I>anchor_point</I></B> <I>offset</I></B>}". -<I>side</I></B> can be one of
251
<B>-top</B></I>, <B>-bottom</B></I>, <B>-left</B></I> or <B>-right</B></I>.
252
<P>
253
<I>Offset</I></B> is given in screen units (i.e. any of the forms
254
acceptable to <B>Tk_GetPixels</B></I>).  A positive offset indicates
255
shifting to a position to the right or bottom of an anchor point. A
256
negative offset indicates shifting to a position to the left or top of
257
an anchor point.
258
<P>
259
<I>Anchor_point</I></B> can be given in one of the
260
following forms:
261
<UL>
262
<DL>
263
<DT> <B>Grid Attachment</B></I>
264
</I></B>
265
<DD> The master window is divided into a number of horizontal and vertical
266
grids. By default the master window is divided into 100x100 grids; the
267
number of grids can be adjusted by the <B>tixForm grid</B></I> command. A
268
grid attachment anchor point is given by a <B>%</B></I> sign followed by an
269
<B>integer</B></I> value. For example, <B>%0</B></I> spceifies the first grid
270
line (the top or left edge of the master window). <B>%100</B></I> spceifies
271
the last grid line (the bottom or right edge of the master window).
272
</DL>
273
<DL>
274
<DT> <B>Opposite Side Attachment</B></I>
275
</I></B>
276
<DD> Opposite attachment specifies an anchor point located on the
277
<B>opposite</B></I> side of another slave widget, which must be managed by
278
tixForm in the same master window. An opposite attachment anchor point
279
is given by the name of another widget. For example, "tixForm .b -top
280
{.a 0}" attaches the <B>top</B></I> side of the widget <B>\.b</B></I> to the
281
<B>bottom</B></I> of the widget <B>\.a</B></I>.
282
</DL>
283
<DL>
284
<DT> <B>Parallel Side Attachment</B></I>
285
</I></B>
286
<DD> Opposite attachment specifies an anchor point located on the
287
<B>same</B></I> side of another slave widget, which must be managed by
288
tixForm in the same master window. An parallel attachment anchor point
289
is given by the sign <B>&amp;</B></I> follwed by the name of another widget.
290
For example, "tixForm .b -top {&amp;.a 0}" attaches the <B>top</B></I> side of
291
the widget <B>\.b</B></I> to the <B>top</B></I> of the widget <B>\.a</B></I>, making
292
the <B>top</B></I> sides of these two widgets at the same vertical position
293
in their parent window.
294
</DL>
295
<DL>
296
<DT> <B>No Attachment</B></I>
297
</I></B>
298
<DD> Specifies a side of the slave to be attached to nothing, indicated by
299
the keyword <B>none</B></I>. When the <B>none</B></I> anchor point is given, the
300
offser must be zero.
301
 
302
When a side of a slave is attached to <B>{none 0}</B></I>, the position
303
of this side is calculated by the position of the other side and the
304
natural size of the slave. For example, if a the <B>left</B></I> side of a
305
widget is attached to <B>{%0 100}</B></I>, its <B>right</B></I> side attached to
306
<B>{none 0}</B></I>, and the natural size of the widget is <B>50</B></I> pixels,
307
the <B>right</B></I> side of the widget will be positioned at pixel <B>{%0
308
149}</B></I>.
309
 
310
When both <B>-top</B></I> and <B>-bottom</B></I> are attached to <B>none</B></I>,
311
then by default <B>-top</B></I> will be attached to <B>{%0 0}</B></I>. When both
312
<B>-left</B></I> and <B>-right</B></I> are attached to none, then by default
313
<B>-left</B></I> will be attached to <B>{%0 0}</B></I>.
314
</DL>
315
</UL>
316
<P>
317
Shifting effects can be achieved by specifying a non-zero offset with
318
an anchor point. In the following example, the <B>top</B></I> side of
319
widget <B>\.b</B></I> is attached to the <B>bottom</B></I> of <B>\.a</B></I>; hence <B>\.b</B></I>
320
always appears below <B>\.a</B></I>.  Also, the left edge of <B>\.b</B></I>
321
is attached to the <B>left</B></I> side of <B>\.a</B></I> with a 10
322
pixel offest.  Therefore, the <B>left</B></I> edge of <B>\.b</B></I> is always
323
<P>
324
<pre><code><code><code>
325
        tixForm .b -left {.a 10} -top {.a 0}
326
</code></code></code></pre>
327
<P>
328
<B>ABBREVIATIONS:</B></I> Certain abbreviations can be made on the
329
attachment specifications: First an offset of zero can be omitted.
330
Thus, the following two lines are equivalent:
331
<P>
332
<pre><code><code><code>
333
        tixForm .b -top {.a 0} -right {%100 0}
334
        tixForm .b -top {.a}   -right {%100}
335
</code></code></code></pre>
336
<P>
337
Also, because of the way TCL handles lists, when you omit the offset,
338
you can also leave out the braces. So you can further simplify the
339
above to:
340
<P>
341
<pre><code><code><code>
342
        tixForm .b -top .a -right %100
343
</code></code></code></pre>
344
<P>
345
In the second case, when the anchor point is omitted, the offset must
346
be given. A default anchor point is chosen according to the value of
347
the offset. If the anchor point is <B>0</B></I> or positive, the default
348
anchor point %0 is used; thus, "tixForm \.b -top 15" attaches the top
349
edge of <B>\.b</B></I> to a position 15 pixels below the top edge of the
350
master window. If the anchor point is "<B>-0</B></I>" or negative, the
351
default anchor point <B>%100</B></I> is used; thus, "tixForm \.a -right
352
-2" attaches the right edge of <B>\.a</B></I> to a position 2 pixels to
353
below shows a command with its equivalent abbreviation.
354
<P>
355
<pre><code><code><code>
356
        tixForm .b -top {%0 10} -bottom {%100 0}
357
        tixForm .b -top 10      -bottom -0
358
</code></code></code></pre>
359
<P>
360
</pre><H3>USING SPRINGS</H3>
361
To be written.
362
<P>
363
</pre><H3>ALGORITHM OF TIXFORM</H3>
364
TixForm starts with any slave in the list of slaves of the master
365
window. Then it tries to determine the position of each side of the
366
slave.
367
<P>
368
If the attachment of a side of the slave is grid attachment, the
369
position of the side is readily determined.
370
<P>
371
If the attachment of this side is <B>none</B></I>, then tixForm tries to
372
determine the position of the opposite side first, and then use the
373
position of the opposite side and the natural size of the slave to
374
determine the position of this side.
375
<P>
376
If the attachment is opposite or parallel widget attachments, then
377
tixForm tries to determine the positions of the other widget first,
378
and then use the positions of the other widget and the natural size of
379
the slave determine the position of this side. This recursive
380
algorithmis carried on until the positions of all slaves are
381
determined.
382
<P>
383
</pre><H3>CIRCULAR DEPENDENCY</H3>
384
<P>
385
The algorithm of tixForm will fail if a circular dependency exists in
386
the attachments of the slaves. For example:
387
<P>
388
<pre><code><code><code>
389
        tixForm .c -left .b
390
        tixForm .b -right .c
391
</code></code></code></pre>
392
<P>
393
In this example, the position of the left side of <B>.b</B></I> depends on
394
the right side of <B>.c</B></I>, which in turn depends on the left side of <B>.b</B></I>.
395
<P>
396
When a circular dependency is discovered during the execution of the
397
tixForm algorithm, tixForm will generate a background error and the
398
geometry of the slaves are undefined (and will be arbitrary). Notice
399
that tixForm only executes the algorithm when the specification of the
400
attachments.  Also, unlike the Motif Form manager widget, tixForm
401
defines circular dependency as "<I>dependency in the same
402
dimension</B></I>". Therefore, the following code fragment will does not
403
have circular dependency because the two widgets do not depend on each
404
other in the same dimension (<B>\.b</B></I> depends <B>.c</B></I> in the
405
horizontal dimension and <B>.c</B></I> depends on <B>.b</B></I> in the vertical
406
dimension):
407
<P>
408
<pre><code><code><code>
409
        tixForm .b -left .c
410
        tixForm .c -top .b
411
</code></code></code></pre>
412
<P>
413
</pre><H3>BUGS</H3>
414
<P>
415
Springs have not been fully implemented yet.
416
</pre><H3>KEYWORDS</H3>
417
Tix(n), Form, Geometry Management
418
<hr><i>Last modified Sun Jan 19 22:34:27 EST 1997 </i> ---
419
<i>Serial 853731299</i>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.