home *** CD-ROM | disk | FTP | other *** search
/ ftp.swcp.com / ftp.swcp.com.zip / ftp.swcp.com / mac / mozilla-mac-0.9.sea.hqx / mozilla-mac-0.9 / res / samples / widgets.xul < prev    next >
Extensible Markup Language  |  2001-05-05  |  6KB  |  201 lines

  1. <?xml version="1.0"?> 
  2.  
  3. <!-- 
  4.   The contents of this file are subject to the Netscape Public
  5.   License Version 1.1 (the "License"); you may not use this file
  6.   except in compliance with the License. You may obtain a copy of
  7.   the License at http://www.mozilla.org/NPL/
  8.   
  9.   Software distributed under the License is distributed on an "AS
  10.   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  11.   implied. See the License for the specific language governing
  12.   rights and limitations under the License.
  13.   
  14.   The Original Code is Mozilla Communicator client code, released
  15.   March 31, 1998.
  16.   
  17.   The Initial Developer of the Original Code is Netscape
  18.   Communications Corporation. Portions created by Netscape are
  19.   Copyright (C) 1998-1999 Netscape Communications Corporation. All
  20.   Rights Reserved.
  21.   
  22.   Contributor(s): 
  23.     Ben Goodger <ben@netscape.com>
  24.  
  25. -->
  26.  
  27. <?xml-stylesheet href="chrome://navigator/skin/navigator.css" type="text/css"?> 
  28.  
  29. <window id="openLocation"
  30.         xmlns:html="http://www.w3.org/1999/xhtml"
  31.         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  32.         class="dialog"
  33.         style="width: 250px;"
  34.         align="vertical"> 
  35.               
  36.   <script>
  37.   <![CDATA[
  38.   
  39.   function testProperty( aID )
  40.   {
  41.     var element = document.getElementById( aID );
  42.     if (!element)
  43.       return false;
  44.       
  45.     var pValPair = prompt("Enter property,value:","").split(",");
  46.     var property = pValPair[0];
  47.     var value = pValPair[1];
  48.     element[property] = value;
  49.   }
  50.   
  51.   ]]>
  52.   </script>              
  53.               
  54.   <box autostretch="never" valign="center">
  55.     <text class="label" value="Foo Label 1:" for="nerp1"/>
  56.     <textbox flex="1" id="nerp1" disabled="true" value="disabled"/>
  57.     <button label="Test Property APIs" oncommand="testProperty('nerp1');"/>
  58.   </box>
  59.   <box autostretch="never" valign="center">
  60.     <text class="label" value="Foo Label 2:" for="nerp2"/>
  61.     <textbox flex="1" id="nerp2" readonly="true" value="readonly"/>
  62.     <button label="Test Property APIs" oncommand="testProperty('nerp2');"/>
  63.   </box>
  64.   <box autostretch="never" valign="center">
  65.     <text class="label" value="Foo Label 2:" for="nerp2r"/>
  66.     <textbox flex="1" id="nerp2r" readonly="true" disabled="true" value="readonly disabled"/>
  67.     <button label="Test Property APIs" oncommand="testProperty('nerp2r');"/>
  68.   </box>
  69.   <box autostretch="never" valign="center">
  70.     <text class="label" value="Foo Label 3:" for="nerp3"/>
  71.     <textbox flex="1" id="nerp3" value="regular"/>
  72.     <button label="Test Property APIs" oncommand="testProperty('nerp3');"/>
  73.   </box>
  74.   <box autostretch="never" valign="center">
  75.     <text class="label" value="Foo Label 5:" for="nerp4"/>
  76.     <menubutton label="regular menubutton">
  77.       <menupopup>
  78.         <menuitem label="foo 1"/>
  79.         <menuitem label="foo 2"/>
  80.         <menuitem label="foo 3"/>
  81.       </menupopup>
  82.     </menubutton>
  83.     <menubutton label="disabled menubutton" disabled="true">
  84.       <menupopup>
  85.         <menuitem label="foo 1"/>
  86.         <menuitem label="foo 2"/>
  87.         <menuitem label="foo 3"/>
  88.       </menupopup>
  89.     </menubutton>    
  90.   </box>
  91.   
  92.   <box autostretch="never" valign="center">
  93.     <text class="label" value="Foo Label 5:" for="nerp4"/>
  94.     <menulist label="regular menulist">
  95.       <menupopup>
  96.         <menuitem label="foo 1"/>
  97.         <menuitem label="foo 2"/>
  98.         <menuitem label="foo 3"/>
  99.       </menupopup>
  100.     </menulist>
  101.     <menulist label="disabled menulist" disabled="true">
  102.       <menupopup>
  103.         <menuitem label="foo 1"/>
  104.         <menuitem label="foo 2"/>
  105.         <menuitem label="foo 3"/>
  106.       </menupopup>
  107.     </menulist>    
  108.   </box>  
  109.   
  110.   <box>
  111.     <text class="label" value="Foo Label 4:"/>
  112.     <box orient="vertical" flex="1">
  113.       <textbox flex="1"/>
  114.       <box orient="vertical" autostretch="never">
  115.         <box flex="1">
  116.           <checkbox label="Checkbox 1" id="checkbox1"/>
  117.           <spring flex="1"/>
  118.           <button label="Test Property APIs" oncommand="testProperty('checkbox1');"/>
  119.         </box>
  120.         <checkbox label="Checkbox 2" disabled="true" checked="true"/>
  121.         <checkbox label="Checkbox 3"/>
  122.       </box>
  123.       <separator class="groove"/>
  124.       <radiogroup id="group" orient="vertical">
  125.         <box>
  126.           <radio group="group" label="Radio 1" id="radio1"/>
  127.           <spring flex="1"/>
  128.           <button label="Test Property APIs" oncommand="testProperty('radio1');"/>
  129.         </box>
  130.         <radio group="group" label="Radio 2"/>
  131.         <radio group="group" label="Radio 3" disabled="true" checked="true"/>
  132.       </radiogroup>
  133.     </box>
  134.   </box>
  135.  
  136.   <separator/>
  137.   
  138.   <box autostretch="never" valign="center">
  139.     <text class="label" value="Foo Label 7:"/>
  140.     <button label="Standard XUL Button"/>
  141.     <button class="dialog" label="Dialog XUL Button"/>
  142.     <button class="dialog" disabled="true" default="true" label="Disabled Button"/>
  143.   </box>
  144.         
  145.   <separator/>
  146.   
  147.   <box>
  148.     <box orient="vertical">
  149.       <text class="label" value="Foo Label 6:"/>
  150.       <spring flex="1"/>
  151.     </box>
  152.     <textbox id="textarea" rows="3" multiline="true" value="Regular multiline textbox"/>
  153.     <box orient="vertical">
  154.       <button label="Test Property APIs" oncommand="testProperty('textarea');"/>
  155.       <spring flex="1"/>
  156.     </box>
  157.   </box>
  158.   
  159.   <box>
  160.     <box orient="vertical">
  161.       <text class="label" value="Foo Label 6:"/>
  162.       <spring flex="1"/>
  163.     </box>
  164.     <textbox rows="3" multiline="true" disabled="true" value="Disabled multiline textbox"/>
  165.   </box>
  166.   
  167.   <separator/>
  168.  
  169.   <progressmeter mode="undetermined" flex="1"/>
  170.   
  171.   <script>
  172.   <![CDATA[
  173.     function advanceProgress()
  174.     {
  175.       var progressMeter = document.getElementById("normal");
  176.       if(progressMeter.getAttribute('value') <= 100) {
  177.         var newvalue = parseInt(progressMeter.getAttribute('value')) + 10;
  178.         progressMeter.setAttribute('value', newvalue);
  179.         setTimeout("advanceProgress()", 100);
  180.       }
  181.       else {
  182.         progressMeter.setAttribute('value', 0);
  183.         setTimeout("advanceProgress()", 100);
  184.       }
  185.     }  
  186.   
  187.   ]]>
  188.   </script>
  189.   
  190.   
  191.   <box autostretch="never" valign="center">
  192.     <progressmeter id="normal" mode="normal" flex="1"/>
  193.     <button label="Advance Progress" oncommand="advanceProgress();"/>
  194.   </box>
  195.   
  196.   <separator/>
  197.   
  198.   <scrollbar align="horizontal"/>
  199.   
  200.  </window>
  201.