home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 January / 01_02.iso / software / netscape62win / browser.xpi / bin / res / samples / dexopenchrome.xul < prev    next >
Extensible Markup Language  |  2001-07-09  |  4KB  |  155 lines

  1. <?xml version="1.0"?>
  2. <?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?> 
  3. <!DOCTYPE window>
  4. <!-- DO NOT LOCALIZE: this file is source documentation; not part of the build -->
  5. <!-- Sample interface for bringing up and passing parameters to a dialog -->
  6. <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  7.         xmlns:html="http://www.w3.org/1999/xhtml"
  8.         orient="horizontal"
  9.         title = "Chrome Features Test">
  10.  
  11. <script>
  12. <![CDATA[
  13.   var featureList = new Array("all",
  14.                       "close", "titlebar", "resizable", "scrollbars",
  15.                       "menubar", "toolbar", "status", "location",
  16.                       "chrome", "dialog", "modal", "dependent",
  17.                       "centerscreen",
  18.                       "alwaysLowered", "alwaysRaised");
  19.  
  20.   function OpenWindow(extension) {
  21.     var features = CalculateFeatures();
  22.     dump("******* begin open window\n");
  23.     window.open("dexparamdialog."+extension, "_blank", features);
  24.     dump("******* end open window\n");
  25.   }
  26.   function OpenDialog(extension) {
  27.     var features = CalculateFeatures();
  28.     dump("******* begin opendialog\n");
  29.     window.openDialog("dexparamdialog."+extension, "_blank", features,
  30.                       {remind:true});
  31.     dump("******* end opendialog\n");
  32.   }
  33.   function CalculateFeatures() {
  34.     var ctr;
  35.     var features;
  36.     var element;
  37.  
  38.     features = "";
  39.  
  40.     // read checkboxes
  41.     for (ctr = 0; ctr < featureList.length; ctr++) {
  42.       element = document.getElementById(featureList[ctr]);
  43.       if (element.checked) {
  44.         if (features.length > 0)
  45.           features = features + ",";
  46.         features = features + featureList[ctr];
  47.       } else {
  48.         element = document.getElementById(featureList[ctr]+"-ex");
  49.         if (element && element.checked) { // titlebar, close, dialog
  50.           if (features.length > 0)
  51.             features = features + ",";
  52.           features = features + featureList[ctr] + "=no";
  53.         }
  54.       }
  55.     }
  56.     dump("******* " + features + "\n");
  57.     return features;
  58.   }
  59. ]]>
  60. </script>
  61.  
  62. <vbox>
  63.   <grid>
  64.     <columns><column/><column/></columns>
  65.     <rows>
  66.       <row>
  67.         <checkbox id="all" label="all"/>
  68.         <checkbox id="all-ex" label="explicit"/>
  69.       </row>
  70.       <row>
  71.         <checkbox id="close" label="close"/>
  72.         <checkbox id="close-ex" label="explicit"/>
  73.       </row>
  74.       <row>
  75.         <checkbox id="titlebar" label="titlebar"/>
  76.         <checkbox id="titlebar-ex" label="explicit"/>
  77.       </row>
  78.       <row>
  79.         <checkbox id="resizable" label="resizable"/>
  80.         <spring/>
  81.       </row>
  82.       <row>
  83.         <checkbox id="scrollbars" label="scrollbars"/>
  84.         <spring/>
  85.       </row>
  86.       <row>
  87.         <checkbox id="alwaysRaised" label="raised"/>
  88.         <spring/>
  89.       </row>
  90.       <row>
  91.         <checkbox id="alwaysLowered" label="lowered"/>
  92.         <spring/>
  93.       </row>
  94.       <row>
  95.         <checkbox id="menubar" label="menubar"/>
  96.         <spring/>
  97.       </row>
  98.       <row>
  99.         <checkbox id="toolbar" label="toolbar"/>
  100.         <spring/>
  101.       </row>
  102.       <row>
  103.         <checkbox id="status" label="status"/>
  104.         <spring/>
  105.       </row>
  106.       <row>
  107.         <checkbox id="location" label="location"/>
  108.         <spring/>
  109.       </row>
  110.       <row>
  111.         <checkbox id="chrome" label="chrome"/>
  112.         <spring/>
  113.       </row>
  114.       <row>
  115.         <checkbox id="dialog" label="dialog"/>
  116.         <checkbox id="dialog-ex" label="explicit"/>
  117.       </row>
  118.       <row>
  119.         <checkbox id="modal" label="modal"/>
  120.         <spring/>
  121.       </row>
  122.       <row>
  123.         <checkbox id="dependent" label="dependent"/>
  124.         <spring/>
  125.       </row>
  126.       <row>
  127.         <checkbox id="centerscreen" label="centered"/>
  128.         <spring/>
  129.       </row>
  130.     </rows>
  131.   </grid>
  132. </vbox>
  133. <spring style="width: 8px"/>
  134. <vbox>
  135.   <hbox>
  136.     <spring flex="1"/>
  137.     <text value="Open"/>
  138.     <spring flex="1"/>
  139.   </hbox>
  140.   <grid>
  141.     <columns><column/><column/></columns>
  142.     <rows>
  143.       <row>
  144.         <button label="HTML Window" onclick="OpenWindow('html')"/>
  145.         <button label="XUL Window" onclick="OpenWindow('xul')"/>
  146.       </row>
  147.       <row>
  148.         <button label="HTML Dialog" onclick="OpenDialog('html')"/>
  149.         <button label="XUL Dialog" onclick="OpenDialog('xul')"/>
  150.       </row>
  151.     </rows>
  152.   </grid>
  153. </vbox>
  154. </window>
  155.