<?xml version="1.0"?>
<!DOCTYPE window>
<!-- DO NOT LOCALIZE: this file is source documentation; not part of the build -->
<!-- Simple sample interface for bringing up a dialog -->
<xul:window
    xmlns:html="http://www.w3.org/TR/REC-html40"
    xmlns:xul ="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    title = "Dialog creation sample">

  <html:script>
    function MakeDialog() {
      var toolkitCore = GetToolkitCore();
      if (toolkitCore)
        toolkitCore.ShowWindow("resource:/res/samples/dexsimpledialog.xul",
            window);
    }
    function ModalDialog() {
      var toolkitCore = GetToolkitCore();
      if (toolkitCore)
        toolkitCore.ShowModalDialog("resource:/res/samples/dexsimpledialog.xul",
            window);
    }
    function GetToolkitCore() {
      var toolkitCore = XPAppCoresManager.Find("ToolkitCore");
      if (!toolkitCore) {
        toolkitCore = new ToolkitCore();
        if (toolkitCore)
          toolkitCore.Init("ToolkitCore");
      }
      return toolkitCore;
    }
  </html:script>

  <xul:toolbox> 
    <xul:toolbar>
      <!-- insert the next line should the bug where buttons don't show up
           without an image specified ever return -->
      <!-- src="resource:/res/toolbar/stop.gif" align="bottom" -->
      <xul:titledbutton
         value="Make Dialog" onclick="MakeDialog()"
         style="background-color:rgb(192,192,192);"/>
      <xul:titledbutton
         value="Modal Dialog" onclick="ModalDialog()"
         style="background-color:rgb(192,192,192);"/>
    </xul:toolbar>
  </xul:toolbox>
</xul:window>
