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

Subversion Repositories or1k

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

powered by: WebSVN 2.1.0

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