<?xml version="1.0"?>
<!--
   - The contents of this file are subject to the Netscape Public
   - License Version 1.1 (the "License"); you may not use this file
   - except in compliance with the License. You may obtain a copy of
   - the License at http://www.mozilla.org/NPL/
   -  
   - Software distributed under the License is distributed on an "AS
   - IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
   - implied. See the License for the specific language governing
   - rights and limitations under the License.
   -  
   - The Original Code is Mozilla Communicator client code, released
   - March 31, 1998.
   - 
   - The Initial Developer of the Original Code is Netscape
   - Communications Corporation. Portions created by Netscape are
   - Copyright (C) 1999-2000 Netscape Communications Corporation. All
   - Rights Reserved.
   - 
   - Contributor(s): 
	- Brian King
	- Dan Haddix
  -->

<?xml-stylesheet href="chrome://editor/skin/EdImageMap.css" type="text/css"?> 

<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> 
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://editor/skin/" type="text/css"?>

<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<?xul-overlay href="chrome://editor/content/EdDialogOverlay.xul"?> 

<!DOCTYPE window SYSTEM "chrome://editor/locale/EditorImageMap.dtd">


<!-- dialog containing a control requiring initial setup -->
<window class="dialog" title="&windowTitle.label;"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:html="http://www.w3.org/TR/REC-html40"
    onload = "Startup()"
    onunload="//finishMap();"
    orient="vertical"
    width="640" height="480"
   >
<!--
	screenX="10" screenY="10"
	persist="screenX screenY width height"
-->

  <!-- Methods common to all editor dialogs -->
  <script language="JavaScript" src="chrome://editor/content/EdDialogCommon.js" />
  <script language="JavaScript" src="chrome://global/content/dialogOverlay.js" />

  <!-- Methods for Image Map only -->
  <script language="JavaScript" src="chrome://editor/content/EdImageMap.js" />
  <script language="JavaScript" src="chrome://editor/content/EdImageMapShapes.js" />

  <broadcaster id="args" value=""/>

  <keyset id="defaultKeySet">

    <key id="deletespot"   keycode="VK_DELETE"   onkeypress="deleteElement(currentElement)" />
    <key id="nudgeup"      keycode="VK_UP"       onkeypress="nudge(event, 'up')" />
    <key id="nudgeleft"    keycode="VK_LEFT"     onkeypress="nudge(event, 'left')" />
    <key id="nudgedown"    keycode="VK_DOWN"     onkeypress="nudge(event, 'down')" />
    <key id="nudgeright"   keycode="VK_RIGHT"    onkeypress="nudge(event, 'right')" />
    <key id="mapclearkb"   xulkey="true" key="&clear.accesskey;" observes="Map:Clear" />
    <key id="mapselectkb"  xulkey="true" key="&selectall.accesskey;" observes="Map:SelectAll" />
    <key id="mapclosekb"   xulkey="true" key="&close.accesskey;" observes="Map:Close" />
    <key id="mapcutkb"     xulkey="true" key="&cut.accesskey;" observes="Map:Cut" />
    <key id="mapcopykb"    xulkey="true" key="&copy.accesskey;" observes="Map:Copy" />
    <key id="mappastekb"   xulkey="true" key="&paste.accesskey;" observes="Map:Paste" />
    <key id="mappropskb"   xulkey="true" key="&props.accesskey;" observes="Map:Props" />
    <key id="maptbarkb"    xulkey="true" key="&tbar.accesskey;" observes="Map:ViewToolbar" />

  </keyset>

  <broadcaster id="Map:Clear" value="&clearCmd.label;" oncommand=""/>
  <broadcaster id="Map:Close" value="&closeCmd.label;" oncommand="exitImageMap()"/>
  <broadcaster id="Map:Copy" value="&copyCmd.label;" disabled="true" oncommand="cutCopy()"/>
  <broadcaster id="Map:Cut" value="&cutCmd.label;" disabled="true" oncommand="cutCopy(true)"/>
  <broadcaster id="Map:Paste" value="&pasteCmd.label;" disabled="true" oncommand="paste()"/>
  <broadcaster id="Map:Props" value="&propsCmd.label;" oncommand="hotSpotProps(currentElement[0])"/>
  <broadcaster id="Map:ViewToolbar" value="&showhideTbarCmd.label;" oncommand="hideToolbar()"/>
  <broadcaster id="Map:Apercent" value="&apercentCmd.label;" checked="true" oncommand="zoom('', 1)"/>
  <broadcaster id="Map:Bpercent" value="&bpercentCmd.label;" oncommand="zoom('', 2)"/>
  <broadcaster id="Map:Cpercent" value="&cpercentCmd.label;" oncommand="zoom('', 4)"/>
  <broadcaster id="Map:Contrast" value="&contrastCmd.label;" oncommand="highContrast()" toggled="0" checked="false"/>
  <broadcaster id="Map:About" value="&aboutCmd.label;" onaction=""/>
  <broadcaster id="Map:ZoomIn" value="&zoominCmd.label;" oncommand="zoom('in')"/>
  <broadcaster id="Map:ZoomOut" value="&zoomoutCmd.label;" disabled="true" oncommand="zoom('out')"/>
  <broadcaster id="Map:SelectAll" value="&selectallCmd.label;" oncommand="selectAll()"/>

  <!-- Interim hack to transition from nsIXULWindowCallbacks/ShowWindowWithArgs -->
  <broadcaster id="dialog.start" ready="false"/>
  <observes element="dialog.start" attribute="ready" onchange="EditorStartup('html')"/>
    
<menubar>
  <!-- File menu -->
  <menu id="mapfileMenu" value="&mapfileMenu.label;" accesskey="&mapfilemenu.accesskey;">
    <menupopup>
      <menuitem accesskey="&mapfileclear.accesskey;" key="mapclearkb" observes="Map:Clear"/>
      <menuitem accesskey="&mapfileclose.accesskey;" key="mapclosekb" observes="Map:Close"/>
    </menupopup>
  </menu>

  <!-- Edit menu -->
  <menu id="mapeditMenu" value="&mapeditMenu.label;" accesskey="&mapeditmenu.accesskey;">
    <menupopup>
      <menuitem accesskey="&mapselectall.accesskey;" key="mapselectkb" observes="Map:SelectAll"/>
      <menuitem accesskey="&mapeditcut.accesskey;" key="mapcutkb" observes="Map:Cut"/>
      <menuitem accesskey="&mapeditcopy.accesskey;" key="mapcopykb" observes="Map:Copy"/>
      <menuitem accesskey="&mapeditpaste.accesskey;" key="mappastekb" observes="Map:Paste"/>
      <menuseparator/>
      <menuitem accesskey="&mapeditprops.accesskey;" key="mappropskb" observes="Map:Props"/>
    </menupopup>
  </menu>

  <!-- View menu -->
  <menu id="mapviewMenu" value="&mapviewMenu.label;" accesskey="&mapviewmenu.accesskey;">
    <menupopup>
      <menuitem id="view_hidetoolbar" accesskey="&mapviewtbar.accesskey;" key="maptbarkb" observes="Map:ViewToolbar"/>
      <menu id="mapscalingMenu" value="&mapviewScale.label;" accesskey="&mapviewscale.accesskey;">
        <menupopup>
          <menuitem accesskey="&zoomone.accesskey;" key="" observes="Map:Apercent"/>
          <menuitem accesskey="&zoomtwo.accesskey;" key="" observes="Map:Bpercent"/>
          <menuitem accesskey="&zoomthree.accesskey;" key="" observes="Map:Cpercent"/>
        </menupopup>
      </menu>
      <menuseparator/>
      <menuitem accesskey="&contrast.accesskey;" observes="Map:Contrast" />
    </menupopup>
  </menu>

  <menu id="maphelpMenu" value="&maphelpMenu.label;" accesskey="&maphelpmenu.accesskey;">
    <menupopup>
      <menuitem accesskey="&about.accesskey;" observes="Map:About"/>
    </menupopup>
  </menu>

  <spring flex="1"/>
</menubar>


<toolbar id="toolbar" class="toolbar-primary" persist="collapsed">
  <button id="cutButton" class="button-toolbar-2 top" observes="Map:Cut"/>
  <button id="copyButton" class="button-toolbar-2 top" observes="Map:Copy"/>
  <button id="pasteButton" class="button-toolbar-2 top" observes="Map:Paste"/>
  <button id="zoomInButton" class="button-toolbar-2 top" observes="Map:ZoomIn"/>
  <button id="zoomOutButton" class="button-toolbar-2 top" observes="Map:ZoomOut"/>
  <button id="contrastButton" class="button-toolbar-2 top" observes="Map:Contrast"/>
  <spring flex="1"/>
</toolbar> 


<box align="horizontal" flex="100">

  <toolbar id="toolbox" orient="vertical">
  <box orient="vertical">
    <button id="pointerButton" class="tool" toggled="1" onclick="changeTool(event, 'pointer')"/>
    <button id="rectButton" class="tool" onclick="changeTool(event, 'rect')"/>
    <button id="cirButton" class="tool" onclick="changeTool(event, 'cir')"/>
    <button id="polyButton" class="tool" onclick="changeTool(event, 'poly')"/>
    <spring flex="1"/>
  </box>
  </toolbar>

  <!-- Content Area -->
  <iframe id="content" src="EdImageMapPage.html" flex="1"/>

</box>

  <!-- from EdDialogOverlay -->
  <!-- not sure if this is needed, but put it in just in case 
  <box id="AdvancedEditButton"/> -->

  <box orient="horizontal">

    <!-- Cheap hack until I get key events hooked up
    <button 
    class   = "push dialog"
    id	    = "DelButton"
    value="&delSpotCmd.label;" 
    onclick="deleteElement(currentElement)"/> -->
    
    <spring flex="1"/>

    <!-- from global dialogOverlay -->
    <box id="okCancelButtons"/>

  </box>

</window>
