home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / phoenx05.zip / phoenix / res / samples / dexopenchrome.xul < prev    next >
Extensible Markup Language  |  2002-12-10  |  4KB  |  154 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.         orient="horizontal"
  8.         title = "Chrome Features Test">
  9.  
  10. <script>
  11. <![CDATA[
  12.   var featureList = new Array("all",
  13.                       "close", "titlebar", "resizable", "scrollbars",
  14.                       "menubar", "toolbar", "status", "location",
  15.                       "chrome", "dialog", "modal", "dependent",
  16.                       "centerscreen",
  17.                       "alwaysLowered", "alwaysRaised");
  18.  
  19.   function OpenWindow(extension) {
  20.     var features = CalculateFeatures();
  21.     dump("******* begin open window\n");
  22.     window.open("dexparamdialog."+extension, "_blank", features);
  23.     dump("******* end open window\n");
  24.   }
  25.   function OpenDialog(extension) {
  26.     var features = CalculateFeatures();
  27.     dump("******* begin opendialog\n");
  28.     window.openDialog("dexparamdialog."+extension, "_blank", features,
  29.                       {remind:true});
  30.     dump("******* end opendialog\n");
  31.   }
  32.   function CalculateFeatures() {
  33.     var ctr;
  34.     var features;
  35.     var element;
  36.  
  37.     features = "";
  38.  
  39.     // read checkboxes
  40.     for (ctr = 0; ctr < featureList.length; ctr++) {
  41.       element = document.getElementById(featureList[ctr]);
  42.       if (element.checked) {
  43.         if (features.length > 0)
  44.           features = features + ",";
  45.         features = features + featureList[ctr];
  46.       } else {
  47.         element = document.getElementById(featureList[ctr]+"-ex");
  48.         if (element && element.checked) { // titlebar, close, dialog
  49.           if (features.length > 0)
  50.             features = features + ",";
  51.           features = features + featureList[ctr] + "=no";
  52.         }
  53.       }
  54.     }
  55.     dump("******* " + features + "\n");
  56.     return features;
  57.   }
  58. ]]>
  59. </script>
  60.  
  61. <vbox>
  62.   <grid>
  63.     <columns><column/><column/></columns>
  64.     <rows>
  65.       <row>
  66.         <checkbox id="all" label="all"/>
  67.         <checkbox id="all-ex" label="explicit"/>
  68.       </row>
  69.       <row>
  70.         <checkbox id="close" label="close"/>
  71.         <checkbox id="close-ex" label="explicit"/>
  72.       </row>
  73.       <row>
  74.         <checkbox id="titlebar" label="titlebar"/>
  75.         <checkbox id="titlebar-ex" label="explicit"/>
  76.       </row>
  77.       <row>
  78.         <checkbox id="resizable" label="resizable"/>
  79.         <spacer/>
  80.       </row>
  81.       <row>
  82.         <checkbox id="scrollbars" label="scrollbars"/>
  83.         <spacer/>
  84.       </row>
  85.       <row>
  86.         <checkbox id="alwaysRaised" label="raised"/>
  87.         <spacer/>
  88.       </row>
  89.       <row>
  90.         <checkbox id="alwaysLowered" label="lowered"/>
  91.         <spacer/>
  92.       </row>
  93.       <row>
  94.         <checkbox id="menubar" label="menubar"/>
  95.         <spacer/>
  96.       </row>
  97.       <row>
  98.         <checkbox id="toolbar" label="toolbar"/>
  99.         <spacer/>
  100.       </row>
  101.       <row>
  102.         <checkbox id="status" label="status"/>
  103.         <spacer/>
  104.       </row>
  105.       <row>
  106.         <checkbox id="location" label="location"/>
  107.         <spacer/>
  108.       </row>
  109.       <row>
  110.         <checkbox id="chrome" label="chrome"/>
  111.         <spacer/>
  112.       </row>
  113.       <row>
  114.         <checkbox id="dialog" label="dialog"/>
  115.         <checkbox id="dialog-ex" label="explicit"/>
  116.       </row>
  117.       <row>
  118.         <checkbox id="modal" label="modal"/>
  119.         <spacer/>
  120.       </row>
  121.       <row>
  122.         <checkbox id="dependent" label="dependent"/>
  123.         <spacer/>
  124.       </row>
  125.       <row>
  126.         <checkbox id="centerscreen" label="centered"/>
  127.         <spacer/>
  128.       </row>
  129.     </rows>
  130.   </grid>
  131. </vbox>
  132. <spacer style="width: 8px"/>
  133. <vbox>
  134.   <hbox>
  135.     <spacer flex="1"/>
  136.     <text value="Open"/>
  137.     <spacer flex="1"/>
  138.   </hbox>
  139.   <grid>
  140.     <columns><column/><column/></columns>
  141.     <rows>
  142.       <row>
  143.         <button label="HTML Window" onclick="OpenWindow('html')"/>
  144.         <button label="XUL Window" onclick="OpenWindow('xul')"/>
  145.       </row>
  146.       <row>
  147.         <button label="HTML Dialog" onclick="OpenDialog('html')"/>
  148.         <button label="XUL Dialog" onclick="OpenDialog('xul')"/>
  149.       </row>
  150.     </rows>
  151.   </grid>
  152. </vbox>
  153. </window>
  154.