Author: lou
Date: 2008-02-23 09:25:17 -0800 (Sat, 23 Feb 2008)
New Revision: 8095
Modified:
openlaszlo/trunk/docs/src/developers/constraints.dbk
openlaszlo/trunk/docs/src/developers/programs/constraints-$1.lzx
Log:
Change 20080223-lou-s by [EMAIL PROTECTED] on 2008-02-23 13:17:10 AST
in /Users/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Constraints chapter of the dguide: replace references to
applyContsraint (deprecated) with applyConstraintMethod.
New Features:
Bugs Fixed: LPP-5460
Technical Reviewer: (ptw)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Tests: visual verify
Modified: openlaszlo/trunk/docs/src/developers/constraints.dbk
===================================================================
--- openlaszlo/trunk/docs/src/developers/constraints.dbk 2008-02-23
17:22:27 UTC (rev 8094)
+++ openlaszlo/trunk/docs/src/developers/constraints.dbk 2008-02-23
17:25:17 UTC (rev 8095)
@@ -15,8 +15,8 @@
as well.</para>
<para/></section><section><title>Syntax for creating and removing
constraints</title>
-<para>Constraints may be created in either of two ways:</para>
-<itemizedlist spacing="compact"><listitem><para>in a tag, using the ${} syntax
to tie the value of one attribute to that of
another</para></listitem><listitem><para>in script, using the
<indexterm><primary><literal>applyConstraint()</literal></primary></indexterm><methodname>applyConstraint()</methodname>
method</para></listitem><listitem><para>in script, using
delegates</para></listitem></itemizedlist>
+<para>Constraints may be created as follows:</para>
+<itemizedlist spacing="compact"><listitem><para>in a tag, using the ${} syntax
to tie the value of one attribute to that of
another</para></listitem><listitem><para>in script, using the
<indexterm><primary><literal>applyConstraintMethod()</literal></primary></indexterm><methodname>applyConstraintMethod()</methodname>
method</para></listitem><listitem><para>in script, using
delegates</para></listitem></itemizedlist>
<para>These are described in turn below.</para>
<para>There is no method for removing constraints. Therefore if you have a
constraint that you wish to sometimes be in force and other times not be in
force, you should use <indexterm><primary>state</primary></indexterm><sgmltag
class="element"><state></sgmltag><remark role="fixme">[unknown
tag]</remark>
<!--unknown tag: state-->
@@ -38,20 +38,20 @@
<para role="fixme"><remark role="fixme"><emphasis role="para-label">FIXME:
</emphasis> note the lousy explanation below </remark></para>
-<para>The following example uses the
<indexterm><primary><literal>applyConstraint()</literal></primary></indexterm><methodname>applyConstraint()</methodname>
method inherited from
<indexterm><primary>LzNode</primary></indexterm><classname>LzNode</classname>
in order to create a constraint at
+<para>The following example uses the
<indexterm><primary><literal>applyConstraintMethod()</literal></primary></indexterm><methodname>applyConstraintMethod()</methodname>
method inherited from
<indexterm><primary>LzNode</primary></indexterm><classname>LzNode</classname>
in order to create a constraint at
runtime. You'll see that the <literal>setConstraint</literal> method has the
same effect as the simple expression <literal>y=${m.y}</literal>
</para>
<example role="live-example">
- <title>Runtime constraintes with applyConstraint</title>
+ <title>Runtime constraintes with applyConstraintMethod</title>
<programlisting language="lzx">
<textobject><textdata fileref="programs/constraints-$1.lzx"/></textobject>
</programlisting>
</example>
-<para><literal>f</literal> is a callback function that is required for the
<indexterm><primary><literal>applyConstraint()</literal></primary></indexterm><methodname>applyConstraint()</methodname>
method. <varname>d</varname>
+<para><literal>f</literal> is a callback function that is required for the
<indexterm><primary><literal>applyConstraintMethod()</literal></primary></indexterm><methodname>applyConstraintMethod()</methodname>
method. <varname>d</varname>
is an array consisting of a pointer to a reference node, and the attribute to
bind to.</para>
<para/></section><section><title>Delegates and constraints</title>
<para>Laszlo applications can use something called a
<glossterm>delegate</glossterm> in script to associate a
Modified: openlaszlo/trunk/docs/src/developers/programs/constraints-$1.lzx
===================================================================
--- openlaszlo/trunk/docs/src/developers/programs/constraints-$1.lzx
2008-02-23 17:22:27 UTC (rev 8094)
+++ openlaszlo/trunk/docs/src/developers/programs/constraints-$1.lzx
2008-02-23 17:25:17 UTC (rev 8095)
@@ -1,22 +1,18 @@
-
-<canvas>
- <view x="250" width="20" height="20" bgcolor="red"
- y="${m.y}"/>
-
- <view x="300" width="20" height="20" bgcolor="blue">
- <handler name="oninit">
- var f = function () {
- this.setAttribute("y", m.y);
- }
- var d = [m, "y"];
- this.applyConstraint("y", f, d);
- </handler>
- </view>
-
- <window id="m" x="10" title="Drag me" width="160" height="20"/>
+<canvas>
+ <view x="250" width="20" height="20" bgcolor="red" y="${m.y}"/>
+ <view x="300" width="20" height="20" bgcolor="blue">
+ <handler name="oninit">
+ var d = [m, "y"];
+ this.applyConstraintMethod("myConstraintMethod", d);
+ </handler>
+ <method name="myConstraintMethod" >
+ this.setAttribute("y", m.y);
+ </method>
+ </view>
+ <window id="m" x="10" title="Drag me" width="160" height="20"/>
</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ****************************************************** -->
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins