Author: lou
Date: 2007-10-31 19:14:23 -0700 (Wed, 31 Oct 2007)
New Revision: 7075
Modified:
openlaszlo/trunk/docs/src/developers/classes-introductory.dbk
Log:
Change 20071031-lou-x by [EMAIL PROTECTED] on 2007-10-31 22:09:49 AST
in /Users/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: dguide broken links: links containing /guide/ should be /developers/
Bugs Fixed: LPP-4923
Technical Reviewer: (pending)
QA Reviewer: frisco de rosario
Doc Reviewer: (pending)
Details: change ulink to xref to fix broken link
Modified: openlaszlo/trunk/docs/src/developers/classes-introductory.dbk
===================================================================
--- openlaszlo/trunk/docs/src/developers/classes-introductory.dbk
2007-11-01 00:52:47 UTC (rev 7074)
+++ openlaszlo/trunk/docs/src/developers/classes-introductory.dbk
2007-11-01 02:14:23 UTC (rev 7075)
@@ -46,19 +46,7 @@
</programlisting>
</example>
-<?example role="live-example"><title>Defining a new tag</title><programlisting
role="lzx-embednew"><filename>introductory-classes-$1.lzx</filename><parameter/><code>
-<canvas height="20">
- <class name="square" width="20" height="20" bgcolor="red"/>
- <square/>
- <square x="30"/>
-</canvas>
-</code></programlisting><programlisting>
-<canvas height="20">
- <class name="square" width="20" height="20" bgcolor="red"/>
- <square/>
- <square x="30"/>
-</canvas>
-</programlisting><?lzx-edit programs/introductory-classes-$1.lzx></example?>
+<!-- remove commented out sample code here and others that was ignored by the
build. IORIO 31 oct 2007 -->
<para>This program is equivalent to the following program, but is shorter
and easier to maintain.</para>
@@ -70,13 +58,6 @@
<textobject><textdata
fileref="programs/introductory-classes-$2.lzx"/></textobject>
</programlisting>
</example>
-<?example role="live-example"><title>Without the class
tag</title><programlisting
role="lzx-embednew"><filename>introductory-classes-$2.lzx</filename><parameter/><code><canvas
height="20">
- <view width="20" height="20" bgcolor="red"/>
- <view x="30" width="20" height="20" bgcolor="red"/>
-</canvas></code></programlisting><programlisting><canvas
height="20">
- <view width="20" height="20" bgcolor="red"/>
- <view x="30" width="20" height="20" bgcolor="red"/>
-</canvas></programlisting><?lzx-edit
programs/introductory-classes-$2.lzx></example?>
<para>In addition, the class definition in the first program can be moved
to a separate file, through the use of the
<indexterm><primary>library</primary></indexterm><sgmltag
class="element"><library></sgmltag><remark role="fixme">[unknown
tag]</remark>
@@ -92,19 +73,6 @@
<textobject><textdata
fileref="programs/introductory-classes-$3.lzx"/></textobject>
</programlisting>
</example>
-<?example role="live-example"><title>Defining a tag in a library
file</title><programlisting
role="lzx-embednew"><filename>introductory-classes-$3.lzx</filename><parameter/><code>
-<canvas height="20">
- <include href="square.lzx"/>
- <square/>
- <square x="30"/>
-</canvas>
-</code></programlisting><programlisting>
-<canvas height="20">
- <include href="square.lzx"/>
- <square/>
- <square x="30"/>
-</canvas>
-</programlisting><?lzx-edit programs/introductory-classes-$3.lzx></example?>
<informalexample role="live-example"><programlisting>
<library>
@@ -123,16 +91,6 @@
</programlisting>
</example>
-<?example role="live-example"><title>Overriding a class
attribute</title><programlisting
role="lzx-embednew"><filename>introductory-classes-$5.lzx</filename><parameter/><code><canvas
height="20">
- <include href="square.lzx"/>
- <square/>
- <square x="30" bgcolor="green"/>
-</canvas></code></programlisting><programlisting><canvas
height="20">
- <include href="square.lzx"/>
- <square/>
- <square x="30" bgcolor="green"/>
-</canvas></programlisting><?lzx-edit
programs/introductory-classes-$5.lzx></example?>
-
<para>A class can introduce a new attribute with the
<indexterm><primary>attribute</primary></indexterm><sgmltag
class="element"><attribute></sgmltag><remark role="fixme">[unknown
tag]</remark>
<!--unknown tag: attribute-->
element:</para>
@@ -144,26 +102,11 @@
</programlisting>
</example>
-<?example role="live-example"><title>Defining an
attribute</title><programlisting
role="lzx-embednew"><filename>introductory-classes-$6.lzx</filename><parameter/><code><canvas
height="20">
- <class name="square" width="${this.size}" height="${this.size}"
bgcolor="red">
- <attribute name="size" value="20"/>
- </class>
- <square/>
- <square size="15" x="30"/>
- <square size="10" x="50"/>
-</canvas></code></programlisting><programlisting><canvas
height="20">
- <class name="square" width="${this.size}" height="${this.size}"
bgcolor="red">
- <attribute name="size" value="20"/>
- </class>
- <square/>
- <square size="15" x="30"/>
- <square size="10" x="50"/>
-</canvas></programlisting><?lzx-edit
programs/introductory-classes-$6.lzx></example?>
-
+<!-- fix LPP-4923: replace ulink with xref to fix broken link. IORIO 31 oct
2007 -->
<para>For more information about attributes and class definitions, see
the <indexterm><primary>attribute</primary></indexterm><sgmltag
class="element"><attribute></sgmltag><remark role="fixme">[unknown
tag]</remark>
<!--unknown tag: attribute-->
- tag and the <ulink url="../guide/classes-tutorial.html"
type="laszlo-dguide">Class tutorial</ulink>.</para>
+ tag and <xref linkend="classes-tutorial" />.</para>
<para/></section><section><title>Children</title>
<para>If a class definition contains children, these children are copied
@@ -176,24 +119,6 @@
</programlisting>
</example>
-<?example role="live-example"><title>Class children</title><programlisting
role="lzx-embednew"><filename>introductory-classes-$7.lzx</filename><parameter/><code>
-<canvas height="20">
- <class name="myframe" width="20" height="20" bgcolor="red">
- <view x="2" y="2" width="16" height="16" bgcolor="blue"/>
- </class>
- <myframe/>
- <myframe x="30"/>
-</canvas>
-</code></programlisting><programlisting>
-<canvas height="20">
- <class name="myframe" width="20" height="20" bgcolor="red">
- <view x="2" y="2" width="16" height="16" bgcolor="blue"/>
- </class>
- <myframe/>
- <myframe x="30"/>
-</canvas>
-</programlisting><?lzx-edit programs/introductory-classes-$7.lzx></example?>
-
<example role="live-example">
<title>Using attributes and class children together</title>
<programlisting language="lzx">
@@ -201,29 +126,6 @@
</programlisting>
</example>
-<?example role="live-example" id="class-1"><title>Using attributes and class
children together</title><programlisting
role="lzx-embednew"><filename>class-1.lzx</filename><parameter/><code>
-<canvas height="40">
- <class name="myframe" extends="view">
- <attribute name="bgcolor" value="red"/>
- <view x="5" y="5" width="${parent.width-10}"
- height="${parent.height-10}"
- bgcolor="blue"/>
- </class>
-
- <myframe width="40" height="40"/>
-</canvas>
-</code></programlisting><programlisting>
-<canvas height="40">
- <class name="myframe" extends="view"<co id="N10086"/>>
- <attribute name="bgcolor" value="red"/>
- <view x="5" y="5" width="${parent.width-10}"
- height="${parent.height-10}"
- bgcolor="blue"/>
- </class>
-
- <myframe width="40" height="40"/><co id="N10090"/>
-</canvas>
-</programlisting><?lzx-edit programs/class-1.lzx></example?>
<calloutlist><callout arearefs="N10086"><para>
The <indexterm><primary>extends</primary></indexterm><sgmltag
class="attribute">extends</sgmltag> is optional here. The default base class
is
<indexterm><primary>LzView</primary></indexterm><classname>LzView</classname>.</para></callout><callout
arearefs="N10090"><para>
Create an instance of
<indexterm><primary>myframe</primary></indexterm><classname>myframe</classname>.</para></callout></calloutlist>
@@ -253,16 +155,6 @@
</programlisting>
</example>
-<?example role="live-example"><title>Built-in text
classes</title><programlisting
role="lzx-embednew"><filename>introductory-classes-$9.lzx</filename><parameter/><code>
-<canvas height="50" layout="y">
- <inputtext>plain text</inputtext>
- <text><i>styled</i> text</text>
-</canvas></code></programlisting><programlisting>
-<canvas height="50" layout="y">
- <inputtext>plain text</inputtext>
- <text><i>styled</i> text</text>
-</canvas></programlisting><?lzx-edit
programs/introductory-classes-$9.lzx></example?>
-
<para>The <indexterm><primary>text</primary></indexterm><sgmltag
class="element"><text></sgmltag><remark role="fixme">[unknown
tag]</remark>
<!--unknown tag: text-->
may contain character text,
@@ -287,21 +179,6 @@
<textobject><textdata
fileref="programs/introductory-classes-$10.lzx"/></textobject>
</programlisting>
</example>
-<?example role="live-example"><title>Extending the built-in text
classes</title><programlisting
role="lzx-embednew"><filename>introductory-classes-$10.lzx</filename><parameter/><code>
-<canvas height="50" layout="y">
- <class name="mytext" extends="text"/>
- <class name="myinputtext" extends="inputtext"/>
- <myinputtext>plain text</myinputtext>
- <mytext><i>styled</i> text</mytext>
-</canvas>
-</code></programlisting><programlisting>
-<canvas height="50" layout="y">
- <class name="mytext" extends="text"/>
- <class name="myinputtext" extends="inputtext"/>
- <myinputtext>plain text</myinputtext>
- <mytext><i>styled</i> text</mytext>
-</canvas>
-</programlisting><?lzx-edit programs/introductory-classes-$10.lzx></example?>
<para>A tag may also contain text if it defines an attribute named
<indexterm><primary>text</primary></indexterm><sgmltag
class="attribute">text</sgmltag> with a value of <literal>text</literal> (for
@@ -320,33 +197,6 @@
<textobject><textdata
fileref="programs/introductory-classes-$11.lzx"/></textobject>
</programlisting>
</example>
-<?example role="live-example"><title>Defining new text
classes</title><programlisting
role="lzx-embednew"><filename>introductory-classes-$11.lzx</filename><parameter/><code>
-<canvas height="50" layout="y">
- <class name="mytext">
- <attribute name="text" type="html"/>
- <text text="${parent.text}"/>
- </class>
- <class name="myinputtext">
- <attribute name="text" type="html"/>
- <inputtext text="${parent.text}"/>
- </class>
- <mytext><i>styled</i> text</mytext>
- <myinputtext>plain text</myinputtext>
-</canvas>
-</code></programlisting><programlisting>
-<canvas height="50" layout="y">
- <class name="mytext">
- <attribute name="text" type="html"/>
- <text text="${parent.text}"/>
- </class>
- <class name="myinputtext">
- <attribute name="text" type="html"/>
- <inputtext text="${parent.text}"/>
- </class>
- <mytext><i>styled</i> text</mytext>
- <myinputtext>plain text</myinputtext>
-</canvas>
-</programlisting><?lzx-edit programs/introductory-classes-$11.lzx></example?>
<para/></section><section
id="introductory-classes.placement"><title>Placement</title>
@@ -362,36 +212,6 @@
</programlisting>
</example>
-<?example role="live-example" id="class-2"><title>Default placement of
children in a class</title><programlisting
role="lzx-embednew"><filename>class-2.lzx</filename><parameter/><code>
-<canvas height="50">
- <class name="myframe" extends="view">
- <attribute name="bgcolor" value="red"/>
- <view x="5" y="5" width="${parent.width-10}"
- height="${parent.height-10}"
- bgcolor="#FFFFCC" />
- </class>
-
- <!-- Create an instance of myframe with text inside it-->
- <myframe width="220" height="20">
- <text>This is some text</text>
- </myframe>
-</canvas>
-</code></programlisting><programlisting>
-<canvas height="50">
- <class name="myframe" extends="view">
- <attribute name="bgcolor" value="red"/>
- <view x="5" y="5" width="${parent.width-10}"
- height="${parent.height-10}"
- bgcolor="#FFFFCC" />
- </class>
-
- <!-- Create an instance of myframe with text inside it-->
- <myframe width="220" height="20">
- <emphasis role="b"><text>This is some text</text></emphasis>
- </myframe>
-</canvas>
-</programlisting><?lzx-edit programs/class-2.lzx></example?>
-
<para>This behavior can be changed using the
<indexterm><primary>node.defaultplacement</primary></indexterm><sgmltag
class="attribute">node.defaultplacement</sgmltag> attribute or the
<indexterm><primary><literal>LzNode.determinePlacement()</literal></primary></indexterm><methodname>LzNode.determinePlacement()</methodname>
method. Using
@@ -410,38 +230,6 @@
<textobject><textdata fileref="programs/class-3.lzx"/></textobject>
</programlisting>
</example>
-
-<?example role="live-example" id="class-3"><title>Using placement within a
class</title><programlisting
role="lzx-embednew"><filename>class-3.lzx</filename><parameter/><code>
-<canvas height="50">
- <class name="myframe" extends="view">
- <attribute name="bgcolor" value="red"/>
- <attribute name="defaultplacement" value="'insideview'"/>
- <view x="5" y="5" width="${parent.width-10}" name='insideview'
- height="${parent.height-10}"
- bgcolor="#FFFFCC"/>
- </class>
-
- <!-- Create an instance of myframe with text inside it-->
- <myframe width="220" height="50">
- <text>This is some text</text>
- </myframe>
-</canvas>
-</code></programlisting><programlisting>
-<canvas height="50">
- <class name="myframe" extends="view">
- <attribute name="bgcolor" value="red"/>
- <emphasis role="em"><attribute name="defaultplacement"
value="'insideview'"/></emphasis>
- <view x="5" y="5" width="${parent.width-10}" <emphasis
role="em">name='insideview'</emphasis>
- height="${parent.height-10}"
- bgcolor="#FFFFCC"/>
- </class>
-
- <!-- Create an instance of myframe with text inside it-->
- <myframe width="220" height="50">
- <text>This is some text</text>
- </myframe>
-</canvas>
-</programlisting><?lzx-edit programs/class-3.lzx></example?>
<para/></section></section><section><title>Constraints in class
definitions</title>
<para>
Constraints are a general mechanism for relating the value of one attribute to
that of another, as explained in <xref linkend="constraints"/>.
@@ -554,40 +342,6 @@
<textobject><textdata
fileref="programs/introductory-classes-$17.lzx"/></textobject>
</programlisting>
</example>
-<?example role="live-example"><title>accessing views by
name</title><programlisting
role="lzx-embednew"><filename>introductory-classes-$17.lzx</filename><parameter/><code>
-<canvas debug="true">
- <script>
- var foo = new LzView(canvas, {width: 50, height: 50,
- x: 50, y: 100,
- bgcolor: 0,
- name: "myview"});
- </script>
-
- <button>Make window red
- <handler name="onclick">
- var nameOfView = "myview";
- canvas[nameOfView].setAttribute('bgcolor', 0xff0000);
- </handler>
- </button>
-</canvas>
-</code></programlisting><programlisting>
-<canvas debug="true">
- <script>
- var foo = new LzView(canvas, {width: 50, height: 50,
- x: 50, y: 100,
- bgcolor: 0,
- name: "myview"});
- </script>
-
- <button>Make window red
- <handler name="onclick">
- var nameOfView = "myview";
- canvas[nameOfView].setAttribute('bgcolor', 0xff0000);
- </handler>
- </button>
-</canvas>
-</programlisting><?lzx-edit programs/introductory-classes-$17.lzx></example?>
-
<para/></section></section><section><title>A Prototype-based language</title>
<para>
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins