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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [man/] [Form.html] - Rev 1765

Compare with Previous | Blame | View Log

 
 
 
<TITLE>tixForm - Geometry manager based on attachment rules</TITLE>
<Center><H2>tixForm - Geometry manager based on attachment rules</H2></Center><hr>
 
</pre><H3>SYNOPSIS</H3>
<P>
<B>tixForm<I> option arg ?arg ...?</I></B>
</pre><HR>
<P>
</pre><H3>DESCRIPTION</H3>
<P>
The <B>tixForm</B></I> command is used to communicate with the
<B>tixForm</B></I> Geometry Manager, a geometry manager that arranges the
geometry of the children in a parent window according to attachment
rules. The <B>tixForm</B></I> geometry manager is very flexible and
powerful; it can be used to emulate all the existing features of the
Tk packer and placer geometry managers (see <B>pack(n)</B></I>,
<B>place(n)</B></I>).
The <B>tixForm</B></I> command can have any of several forms,
depending on the <I>option</I></B> argument:
<DL>
<DT> <B>tixForm<I> slave </I></B>?<I>options</I></B>?
</I></B>
<DD> If the first argument to <B>tixForm</B></I> is a window name (any value
<B>tixForm configure</B></I>.
</DL>
<DL>
<DT> <B>tixForm check <I>master</I></B>
</I></B>
<DD> This command checks whether there is circular dependency in the
DEPENDENCY</B></I> below). It returns the Boolean value <B>TRUE</B></I> if it
discover circular dependency and <B>FALSE</B></I> otherwise.
</DL>
<DL>
<DT> <B>tixForm configure<I> slave </I></B>?<I>-option value ...</I></B>?
</I></B>
<DD> Sets or adjusts the attachment values of the slave window
according to the <I>-option value</I></B> argument pairs. 
</DL>
<UL>
<DL>
<DT> <B>-b</B></I> <I>attachment</I></B>
</I></B>
<DD> Abbreviation for the <B>-bottom</B></I> option.
</DL>
<DL>
<DT> <B>-bottom</B></I> <I>attachment</I></B>
</I></B>
<DD> Specifies an attachment for the bottom edge of the slave window. The
attachment must specied according to the section <B>SPECIFYING
ATTACHMENTS</B></I> below.
</DL>
<DL>
<DT> <B>-bottomspring</B></I> <I>weight</I></B>
</I></B>
<DD> Specifies the weight of the spring at the bottom edge of the slave
window. See the section <B>USING SPRINGS</B></I> below.
</DL>
<DL>
<DT> <B>-bp</B></I> <I>value</I></B>
</I></B>
<DD> Abbreviation for the <B>-padbottom</B></I> option.
</DL>
<DL>
<DT> <B>-bs</B></I> <I>weight</I></B>
</I></B>
<DD> Abbreviation for the <B>-bottomspring</B></I> option.
</DL>
<DL>
<DT> <B>-fill</B></I> <I>master</I></B>
</I></B>
<DD> Specifies the fillings when springs are used for this widget. The
value must be <B>x</B></I>, <B>y</B></I>, <B>both</B></I> or <B>none</B></I>.
</DL>
<DL>
<DT> <B>-in</B></I> <I>master</I></B>
</I></B>
<DD> Places the slave window into the specified master window. If the slave
was originally in another master window, all attachment values with
respect to the original master window are discarded. Even if the
attachment values are the same as in the original master window, they
need to be specified again.  The <B>-in</B></I> flag, when needed, must appear
as the first flag after the name of the slave. Otherwise an error is
generated.
</DL>
<DL>
<DT> <B>-l</B></I> <I>attachment</I></B>
</I></B>
<DD> Abbreviation for the <B>-left</B></I> option.
</DL>
<DL>
<DT> <B>-left</B></I> <I>attachment</I></B>
</I></B>
<DD> Specifies an attachment for the left edge of the slave window. The
attachment must specied according to the section <B>SPECIFYING
ATTACHMENTS</B></I> below.
</DL>
<DL>
<DT> <B>-leftspring</B></I> <I>weight</I></B>
</I></B>
<DD> Specifies the weight of the spring at the left edge of the slave
window. See the section <B>USING SPRINGS</B></I> below.
</DL>
<DL>
<DT> <B>-lp</B></I> <I>value</I></B>
</I></B>
<DD> Abbreviation for the <B>-padleft</B></I> option.
</DL>
<DL>
<DT> <B>-ls</B></I> <I>weight</I></B>
</I></B>
<DD> Abbreviation for the <B>-leftspring</B></I> option.
</DL>
<DL>
<DT> <B>-padbottom</B></I> <I>value</I></B>
</I></B>
<DD> Specifies the amount of external padding to leave on the bottom side
of the slave. The <I>value</I></B> may have any of the forms acceptable to
<B>Tk_GetPixels(3)</B></I>.
</DL>
<DL>
<DT> <B>-padleft</B></I> <I>value</I></B>
</I></B>
<DD> Specifies the amount of external padding to leave on the left side of
the slave.
</DL>
<DL>
<DT> <B>-padright</B></I> <I>value</I></B>
</I></B>
<DD> Specifies the amount of external padding to leave on the right side of
the slave.
</DL>
<DL>
<DT> <B>-padtop</B></I> <I>value</I></B>
</I></B>
<DD> Specifies the amount of external padding to leave on the top side of
the slave.
</DL>
<DL>
<DT> <B>-padx</B></I> <I>value</I></B>
</I></B>
<DD> Specifies the amount of external padding to leave on both the left and
the right sides of the slave.
</DL>
<DL>
<DT> <B>-pady</B></I> <I>value</I></B>
</I></B>
<DD> Specifies the amount of external padding to leave on both the top and
the bottom sides of the slave.
</DL>
<DL>
<DT> <B>-r</B></I> <I>attachment</I></B>
</I></B>
<DD> Abbreviation for the <B>-right</B></I> option.
</DL>
<DL>
<DT> <B>-right</B></I> <I>attachment</I></B>
</I></B>
<DD> Specifies an attachment for the right edge of the slave window. The
attachment must specied according to the section <B>SPECIFYING
ATTACHMENTS</B></I> below.
</DL>
<DL>
<DT> <B>-rightspring</B></I> <I>weight</I></B>
</I></B>
<DD> Specifies the weight of the spring at the right edge of the slave
window. See the section <B>USING SPRINGS</B></I> below.
</DL>
<DL>
<DT> <B>-rp</B></I> <I>value</I></B>
</I></B>
<DD> Abbreviation for the <B>-padright</B></I> option.
</DL>
<DL>
<DT> <B>-rs</B></I> <I>weight</I></B>
</I></B>
<DD> Abbreviation for the <B>-rightspring</B></I> option.
</DL>
<DL>
<DT> <B>-t</B></I> <I>attachment</I></B>
</I></B>
<DD> Abbreviation for the <B>-top</B></I> option.
</DL>
<DL>
<DT> <B>-top</B></I> <I>attachment</I></B>
</I></B>
<DD> Specifies an attachment for the top edge of the slave window. The
attachment must specied according to the section <B>SPECIFYING
ATTACHMENTS</B></I> below.
</DL>
<DL>
<DT> <B>-topspring</B></I> <I>weight</I></B>
</I></B>
<DD> Specifies the weight of the spring at the top edge of the slave
window. See the section <B>USING SPRINGS</B></I> below.
</DL>
<DL>
<DT> <B>-tp</B></I> <I>value</I></B>
</I></B>
<DD> Abbreviation for the <B>-padtop</B></I> option.
</DL>
<DL>
<DT> <B>-ts</B></I> <I>weight</I></B>
</I></B>
<DD> Abbreviation for the <B>-topspring</B></I> option.
</DL>
</UL>
<DL>
<DT> <B>tixForm forget<I> slave </I></B>?<I>slave ...</I></B>?
</I></B>
<DD> Removes each of the slaves from its master and unmaps their windows.
The slaves will no longer be managed by tixForm. All attachment values
with respect to their master windows are discarded. If another slave
is attached to this slave, then the attachment of the other slave will
be changed to grid attachment based on its geometry.
</DL>
<DL>
<DT> <B>tixForm grid <I>master </I></B>?<I>x_size y_size</I></B>?
</I></B>
<DD> When <I>x_size</I></B> and <I>y_size</I></B> are given, this command returns the
number of grids of the master window in a pair of integers of the form
{<I>x_size y_size</I></B>}. When both <I>x_size</I></B> and <I>y_size</I></B> are
given, this command changes the number of horizontal and vertical
grids on the master window.
</DL>
<DL>
<DT> <B>tixForm info<I> slave</I></B> ?<I>option</I></B>?
</I></B>
<DD> Queries the attachment options of a slave window. <I>option</I></B> can be
any of the options accepted by the <B>tixForm configure</B></I> command. If
<I>option</I></B> is given, only the value of that option is returned.
Otherwise, this command returns a list whose elements are the current
configuration state of the slave given in the same <I>option-value</I></B> form
that might be specified to <B>tixForm configure</B></I>. The first two
elements in this list list are "<B>-in<I> master</I></B>" where
</DL>
<DL>
<DT> <B>tixForm slaves <I>master</I></B>
</I></B>
<DD> Returns a list of all of the slaves for the master window. The order
of the slaves in the list is the same as their order in the packing
order. If master has no slaves then an empty string is returned.
</DL>
<P>
</pre><H3>SPECIFYING ATTACHMENTS</H3>
One can specify an attachment for each side of a slave window managed
by tixForm. An attachment is specified in the the form "-<I>side</I></B>
{<I>anchor_point</I></B> <I>offset</I></B>}". -<I>side</I></B> can be one of
<B>-top</B></I>, <B>-bottom</B></I>, <B>-left</B></I> or <B>-right</B></I>.
<P>
<I>Offset</I></B> is given in screen units (i.e. any of the forms
acceptable to <B>Tk_GetPixels</B></I>).  A positive offset indicates
shifting to a position to the right or bottom of an anchor point. A
negative offset indicates shifting to a position to the left or top of
an anchor point.
<P>
<I>Anchor_point</I></B> can be given in one of the
following forms:
<UL>
<DL>
<DT> <B>Grid Attachment</B></I>
</I></B>
<DD> The master window is divided into a number of horizontal and vertical
grids. By default the master window is divided into 100x100 grids; the
number of grids can be adjusted by the <B>tixForm grid</B></I> command. A
grid attachment anchor point is given by a <B>%</B></I> sign followed by an
<B>integer</B></I> value. For example, <B>%0</B></I> spceifies the first grid
line (the top or left edge of the master window). <B>%100</B></I> spceifies
the last grid line (the bottom or right edge of the master window). 
</DL>
<DL>
<DT> <B>Opposite Side Attachment</B></I>
</I></B>
<DD> Opposite attachment specifies an anchor point located on the
<B>opposite</B></I> side of another slave widget, which must be managed by
tixForm in the same master window. An opposite attachment anchor point
is given by the name of another widget. For example, "tixForm .b -top
{.a 0}" attaches the <B>top</B></I> side of the widget <B>\.b</B></I> to the
<B>bottom</B></I> of the widget <B>\.a</B></I>.
</DL>
<DL>
<DT> <B>Parallel Side Attachment</B></I>
</I></B>
<DD> Opposite attachment specifies an anchor point located on the
<B>same</B></I> side of another slave widget, which must be managed by
tixForm in the same master window. An parallel attachment anchor point
is given by the sign <B>&amp;</B></I> follwed by the name of another widget.
For example, "tixForm .b -top {&amp;.a 0}" attaches the <B>top</B></I> side of
the widget <B>\.b</B></I> to the <B>top</B></I> of the widget <B>\.a</B></I>, making
the <B>top</B></I> sides of these two widgets at the same vertical position
in their parent window.
</DL>
<DL>
<DT> <B>No Attachment</B></I>
</I></B>
<DD> Specifies a side of the slave to be attached to nothing, indicated by
the keyword <B>none</B></I>. When the <B>none</B></I> anchor point is given, the
offser must be zero.
 
When a side of a slave is attached to <B>{none 0}</B></I>, the position
of this side is calculated by the position of the other side and the
natural size of the slave. For example, if a the <B>left</B></I> side of a
widget is attached to <B>{%0 100}</B></I>, its <B>right</B></I> side attached to
<B>{none 0}</B></I>, and the natural size of the widget is <B>50</B></I> pixels,
the <B>right</B></I> side of the widget will be positioned at pixel <B>{%0
149}</B></I>.
 
When both <B>-top</B></I> and <B>-bottom</B></I> are attached to <B>none</B></I>,
then by default <B>-top</B></I> will be attached to <B>{%0 0}</B></I>. When both
<B>-left</B></I> and <B>-right</B></I> are attached to none, then by default
<B>-left</B></I> will be attached to <B>{%0 0}</B></I>.
</DL>
</UL>
<P>
Shifting effects can be achieved by specifying a non-zero offset with
an anchor point. In the following example, the <B>top</B></I> side of
widget <B>\.b</B></I> is attached to the <B>bottom</B></I> of <B>\.a</B></I>; hence <B>\.b</B></I> 
always appears below <B>\.a</B></I>.  Also, the left edge of <B>\.b</B></I>
is attached to the <B>left</B></I> side of <B>\.a</B></I> with a 10
pixel offest.  Therefore, the <B>left</B></I> edge of <B>\.b</B></I> is always
<P>
<pre><code><code><code>
        tixForm .b -left {.a 10} -top {.a 0}
</code></code></code></pre>
<P>
<B>ABBREVIATIONS:</B></I> Certain abbreviations can be made on the
attachment specifications: First an offset of zero can be omitted.
Thus, the following two lines are equivalent:
<P>
<pre><code><code><code>
        tixForm .b -top {.a 0} -right {%100 0}
        tixForm .b -top {.a}   -right {%100}
</code></code></code></pre>
<P>
Also, because of the way TCL handles lists, when you omit the offset,
you can also leave out the braces. So you can further simplify the
above to:
<P>
<pre><code><code><code>
        tixForm .b -top .a -right %100
</code></code></code></pre>
<P>
In the second case, when the anchor point is omitted, the offset must
be given. A default anchor point is chosen according to the value of
the offset. If the anchor point is <B>0</B></I> or positive, the default
anchor point %0 is used; thus, "tixForm \.b -top 15" attaches the top
edge of <B>\.b</B></I> to a position 15 pixels below the top edge of the
master window. If the anchor point is "<B>-0</B></I>" or negative, the
default anchor point <B>%100</B></I> is used; thus, "tixForm \.a -right
-2" attaches the right edge of <B>\.a</B></I> to a position 2 pixels to
below shows a command with its equivalent abbreviation.
<P>
<pre><code><code><code>
        tixForm .b -top {%0 10} -bottom {%100 0}
        tixForm .b -top 10      -bottom -0
</code></code></code></pre>
<P>
</pre><H3>USING SPRINGS</H3>
To be written.
<P>
</pre><H3>ALGORITHM OF TIXFORM</H3>
TixForm starts with any slave in the list of slaves of the master
window. Then it tries to determine the position of each side of the
slave.
<P>
If the attachment of a side of the slave is grid attachment, the
position of the side is readily determined.
<P>
If the attachment of this side is <B>none</B></I>, then tixForm tries to
determine the position of the opposite side first, and then use the
position of the opposite side and the natural size of the slave to
determine the position of this side.
<P>
If the attachment is opposite or parallel widget attachments, then
tixForm tries to determine the positions of the other widget first,
and then use the positions of the other widget and the natural size of
the slave determine the position of this side. This recursive
algorithmis carried on until the positions of all slaves are
determined.
<P>
</pre><H3>CIRCULAR DEPENDENCY</H3>
<P>
The algorithm of tixForm will fail if a circular dependency exists in
the attachments of the slaves. For example:
<P>
<pre><code><code><code>
	tixForm .c -left .b
	tixForm .b -right .c
</code></code></code></pre>
<P>
In this example, the position of the left side of <B>.b</B></I> depends on
the right side of <B>.c</B></I>, which in turn depends on the left side of <B>.b</B></I>.
<P>
When a circular dependency is discovered during the execution of the
tixForm algorithm, tixForm will generate a background error and the
geometry of the slaves are undefined (and will be arbitrary). Notice
that tixForm only executes the algorithm when the specification of the
attachments.  Also, unlike the Motif Form manager widget, tixForm
defines circular dependency as "<I>dependency in the same
dimension</B></I>". Therefore, the following code fragment will does not
have circular dependency because the two widgets do not depend on each
other in the same dimension (<B>\.b</B></I> depends <B>.c</B></I> in the
horizontal dimension and <B>.c</B></I> depends on <B>.b</B></I> in the vertical
dimension):
<P>
<pre><code><code><code>
        tixForm .b -left .c
        tixForm .c -top .b
</code></code></code></pre>
<P>
</pre><H3>BUGS</H3>
<P>
Springs have not been fully implemented yet.
</pre><H3>KEYWORDS</H3>
Tix(n), Form, Geometry Management
<hr><i>Last modified Sun Jan 19 22:34:27 EST 1997 </i> --- 
<i>Serial 853731299</i>
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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