bidi_component_sampler.lzx

<canvas width="800" height="450">
    <include href="lz/tree.lzx"/>
    <include href="testmedia/frosty.lzx"/>

    <debug x="450" y="200" height="200"/>

    <!-- verify that all text has bidirectional property -->
     <attribute name="allBidi" value="true" type="boolean"/>
    <handler name="oninit">
      
               if ($debug) {
                   Debug.info("checking that all text views have LzTLFTextField (bidi) in sprite");
                   checkSubviews(this.subviews);
                   if (this.allBidi) {
                       Debug.info("All text views are bidi");
                   } else {
                       Debug.error("Some text views are not bidi");
                   }
               }

      
    </handler>
    <method name="checkSubviews" args="s">
      
               for (var i in s) {
                  var v = s[i];
                  if (v is lz['LzDebugWindow']) continue;
                  if (v is LzText ) {
                     if (! v.tsprite.textfield is LzTLFTextField) {
                         Debug.error('textview ',v, ' is not LzTLFTextField');
                         this.allBidi = false;
                     }
                  } else {
                      this.checkSubviews(v.subviews);
                  }
               }

      
    </method>



    <dataset name="weatherdata" request="true" src="http://www.laszlosystems.com/cgi-pub/weather.cgi?zip=30622"/>
    <view id="s1" x="20" y="20" hasdirectionallayout="true">
        <view layout="spacing:20">
            <view name="stylechooser" layout="axis:x; spacing:4">
                <text>Select one:</text>
                <combobox width="120" editable="false">
                    <textlistitem text="Caviar"/>
                    <textlistitem text="Cheese"/>
                    <textlistitem text="Jelly"/>
                    <textlistitem text="Beans"/>
                    <textlistitem text="Liverwurst"/>
                </combobox>
            </view>
            <tabslider width="250" height="200">
                <tabelement text="holiday cheer" selected="true">
                    <radiogroup>
                        <radiobutton id="rb1" text="peace on earth"/>
                        <radiobutton text="joy to the world"/>
                        <radiobutton text="happy new year"/>
                    </radiogroup>
                </tabelement>
                <tabelement text="housewares">
                    <simplelayout axis="y" spacing="10"/>
                    <checkbox text="stainless steel"/>
                    <checkbox text="glassware"/>
                </tabelement>
                <tabelement text="isotope">
                    <text multiline="true" width="${immediateparent.width}">
                        Atoms that have the same number of protons but a different number of neutrons. They are atoms of the same element that have different masses. The isotope number is the number of protons plus the number of neutrons.
                    </text>
                </tabelement>
                <tabelement text="etymology">
                    <text multiline="true" width="${immediateparent.width}">
                        [iso- + Greek topos, place (so called because the isotopes of a chemical element occupy the same position in the periodic table of elements).]
                    </text>
                </tabelement>
                <tabelement text="whale bones"/>
            </tabslider>

            <tabs>
                <tabpane>Insecticides
                    <simplelayout spacing="10" inset="10"/>
                    <radiogroup>
                        <radiobutton>Yes, I want to know more</radiobutton>
                        <radiobutton>No, I prefer to remain blissfully unaware</radiobutton>
                        <radiobutton>Please tell my neighbor, who may tell me</radiobutton>
                    </radiogroup>
                </tabpane>
                <tabpane selected="true">Parcheesi
                    <text>On my honor I will do my best </text>
                    <button height="22">Testify</button>
                    <simplelayout spacing="10"/>
                </tabpane>
                <tabpane text="Bogart, GA">
                      <grid datapath="weatherdata:/weather" contentdatapath="forecast/day" shownitems="3" height="${this.immediateparent.height}">
                        <gridcolumn width="80" resizable="false">Day
                        <text datapath="@label"/>
                        </gridcolumn>
                        <gridcolumn width="100" resizable="false">Forecast
                        <text datapath="@desc"/>
                        </gridcolumn>
                        <gridcolumn width="60" resizable="false">Temp
                        <text datapath="@temp"/>
                        </gridcolumn>
                      </grid>
                </tabpane>
            </tabs>
        </view>

        <window text="test window" width="250" height="250" x="430" y="180" resizable="true" id="fw" title="Frosty the Snowman">
            <menubar name="mbar" placement="menubar">
                 <menu name="file" id="mfile" width="80">File
                     <menuitem text="item 1"/>
                     <menuitem text="item 2"/>
                     <menuseparator/>
                     <menuitem id="MWS" text="item 3">
                         <menu name="subedit">subedit
                             <menuitem text="subitem 1"/>
                             <menuitem text="subitem 2"/>
                         </menu>
                     </menuitem>
                 </menu>

                 <menu name="Options">Document
                     <menuitem text="option 1"/>
                     <menuitem text="option 2"/>
                     <menuitem text="option 3"/>
                     <menuitem text="option 4"/>
                     <menuitem text="option 5"/>
                     <menuitem text="option 6"/>
                 </menu>
            </menubar>
            <frosty/>
            <scrollbar/>
        </window>

        <view layout="spacing:14">
            <button height="22">Submit</button>
            <button height="22">Cancel</button>
            <button height="22">OK</button>
            <button height="22">Revert</button>
            <button height="22" enabled="false">disabled</button>

            <combobox width="100">
                <textlistitem text="pistachio" selected="true"/>
                <textlistitem text="chocolate chip"/>
                <textlistitem text="coffee"/>
            </combobox>

            <radiogroup>
                <radiobutton text="tension"/>
                <radiobutton text="distance"/>
                <radiobutton text="delerium"/>
                <radiobutton text="froth"/>
                <radiobutton text="persuasion"/>
            </radiogroup>
            <slider showvalue="true" showfill="true" showrange="true" width="100" value="50"/>

            <tree>Trunk of the tree
              <tree xindent="5">Branch 1
                <tree isleaf="true">Leaf A</tree>
                <tree isleaf="true">Leaf B</tree>
              </tree>
              <tree xindent="5">Branch 2
                <tree isleaf="true">Leaf C</tree>
                <tree isleaf="true">Leaf D</tree>
              </tree>
            </tree>
        </view>
        <view layout="spacing:20">
            <view layout="spacing:10">
                <checkbox text="I want to take a weekend flight"/>
                <checkbox text="Also search airports within 70 miles"/>
                <checkbox text="I prefer non-stop flights"/>
            </view>
            <view layout="spacing:5">
                <edittext id="e1" oninit="this.field.setAttribute('direction', 'rtl')" width="200" text="א בְּרֵאשִׁית בָּרָא אֱלֹהִים RTL"/>
                <edittext width="200" text="disabled" enabled="false"/>
            </view>
        </view>

        <simplelayout axis="x" spacing="20"/>
    </view>

</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2001-2008, 2010, 2011 Laszlo Systems, Inc.  All Rights Reserved.              *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->
<!-- @LZX_VERSION@                                                         -->

Cross References

Includes

Named Instances