<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<!DOCTYPE overlay [
<!ENTITY % platformCommunicatorDTD SYSTEM "chrome://communicator-platform/locale/platformCommunicatorOverlay.dtd" >
%platformCommunicatorDTD;
<!ENTITY % prefMousewheelDTD SYSTEM "chrome://communicator/locale/pref/pref-mousewheel.dtd" >
%prefMousewheelDTD;
]>

<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <prefpane id="mousewheel_pane"
            label="&pref.mouseWheel.title;"
            script="chrome://communicator/content/pref/pref-mousewheel.js">

    <preferences id="mousewheel_preferences">
      <preference id="mousewheel.default.action"
                  name="mousewheel.default.action"
                  type="int"/>
      <preference id="mousewheel.default.delta_multiplier_y"
                  name="mousewheel.default.delta_multiplier_y"
                  type="int"/>
      <preference id="mousewheel.default.action.override_x"
                  name="mousewheel.default.action.override_x"
                  type="int"/>
      <preference id="mousewheel.default.delta_multiplier_x"
                  name="mousewheel.default.delta_multiplier_x"
                  type="int"/>
      <preference id="mousewheel.with_alt.action"
                  name="mousewheel.with_alt.action"
                  type="int"/>
      <preference id="mousewheel.with_alt.delta_multiplier_y"
                  name="mousewheel.with_alt.delta_multiplier_y"
                  type="int"/>
      <preference id="mousewheel.with_alt.action.override_x"
                  name="mousewheel.with_alt.action.override_x"
                  type="int"/>
      <preference id="mousewheel.with_alt.delta_multiplier_x"
                  name="mousewheel.with_alt.delta_multiplier_x"
                  type="int"/>
      <preference id="mousewheel.with_control.action"
                  name="mousewheel.with_control.action"
                  type="int"/>
      <preference id="mousewheel.with_control.delta_multiplier_y"
                  name="mousewheel.with_control.delta_multiplier_y"
                  type="int"/>
      <preference id="mousewheel.with_control.action.override_x"
                  name="mousewheel.with_control.action.override_x"
                  type="int"/>
      <preference id="mousewheel.with_control.delta_multiplier_x"
                  name="mousewheel.with_control.delta_multiplier_x"
                  type="int"/>
      <preference id="mousewheel.with_shift.action"
                  name="mousewheel.with_shift.action"
                  type="int"/>
      <preference id="mousewheel.with_shift.delta_multiplier_y"
                  name="mousewheel.with_shift.delta_multiplier_y"
                  type="int"/>
      <preference id="mousewheel.with_shift.action.override_x"
                  name="mousewheel.with_shift.action.override_x"
                  type="int"/>
      <preference id="mousewheel.with_shift.delta_multiplier_x"
                  name="mousewheel.with_shift.delta_multiplier_x"
                  type="int"/>
    </preferences>

    <description>&mouseWheelPanel.label;</description>

    <tabbox class="spaced">
      <tabs>
        <tab label="&usingJustTheWheel.label;"/>
        <tab label="&usingWheelAndAlt.label;"/>
        <tab label="&usingWheelAndCtrl.label;"/>
        <tab label="&usingWheelAndShft.label;"/>
      </tabs>

      <tabpanels>

        <!-- no key modifiers -->
        <vbox>
          <groupbox>
            <caption label="&mouseWheelGroup.label;"/>
            <radiogroup id="mousewheel_default_action"
                        preference="mousewheel.default.action"
                        onsyncfrompreference="document.getElementById('mousewheel_pane').doEnabling(this);">
              <radio value="0" label="&doNothing.label;" accesskey="&doNothing.accesskey;"/>
              <radio value="1" label="&scrollDocument.label;" accesskey="&scrollDocument.accesskey;"/>
              <radio value="2" label="&history.label;" accesskey="&history.accesskey;"/>
              <radio value="3" label="&zoom.label;" accesskey="&zoom.accesskey;"/>
            </radiogroup>
            <hbox align="center">
              <label control="mousewheel_default_delta_multiplier_y"
                     value="&wheelSpeed.label;"/>
              <textbox type="number" min="-999999" max="999999" size="6"
                       id="mousewheel_default_delta_multiplier_y"
                       accesskey="&wheelSpeed.accesskey;"
                       preference="mousewheel.default.delta_multiplier_y"
                       onsyncfrompreference="document.getElementById('mousewheel_pane').updateCheckbox(this);"/>
              <label value="%"/>
              <checkbox label="&reverseDirection.label;"
                        accesskey="&reverseDirection.accesskey;"
                        oncommand="updateTextbox(this);"/>
            </hbox>
          </groupbox>

          <groupbox>
            <caption label="&mouseWheelHorizGroup.label;"/>
            <radiogroup id="mousewheel_default_action_x"
                        preference="mousewheel.default.action.override_x"
                        onsyncfrompreference="document.getElementById('mousewheel_pane').doEnablingX(this);">
              <radio value="-1" label="&sameAsVertical.label;" accesskey="&sameAsVertical.accesskey;"/>
              <radio value="0" label="&doNothing.label;" accesskey="&doNothingHoriz.accesskey;"/>
              <radio value="1" label="&scrollDocument.label;" accesskey="&scrollDocumentHoriz.accesskey;"/>
              <radio value="2" label="&history.label;" accesskey="&historyHoriz.accesskey;"/>
              <radio value="3" label="&zoom.label;" accesskey="&zoomHoriz.accesskey;"/>
            </radiogroup>
            <hbox align="center">
              <label control="mousewheel_default_delta_multiplier_x"
                     value="&wheelSpeed.label;"/>
              <textbox type="number" min="-999999" max="999999" size="6"
                       id="mousewheel_default_delta_multiplier_x"
                       accesskey="&wheelSpeedHoriz.accesskey;"
                       preference="mousewheel.default.delta_multiplier_x"
                       onsyncfrompreference="document.getElementById('mousewheel_pane').updateCheckbox(this);"/>
              <label value="%"/>
              <checkbox label="&reverseDirection.label;"
                        accesskey="&reverseDirectionHoriz.accesskey;"
                        oncommand="updateTextbox(this);"/>
            </hbox>
          </groupbox>
        </vbox>

        <!-- alt modifiers -->
        <vbox>
          <groupbox>
            <caption label="&mouseWheelGroup.label;"/>
            <radiogroup id="mousewheel_with_alt_action"
                        preference="mousewheel.with_alt.action"
                        onsyncfrompreference="document.getElementById('mousewheel_pane').doEnabling(this);">
              <radio value="0" label="&doNothing.label;" accesskey="&doNothing.accesskey;"/>
              <radio value="1" label="&scrollDocument.label;" accesskey="&scrollDocument.accesskey;"/>
              <radio value="2" label="&history.label;" accesskey="&history.accesskey;"/>
              <radio value="3" label="&zoom.label;" accesskey="&zoom.accesskey;"/>
            </radiogroup>
            <hbox align="center">
              <label control="mousewheel_with_alt_delta_multiplier_y"
                     value="&wheelSpeed.label;"/>
              <textbox type="number" min="-999999" max="999999" size="6"
                       id="mousewheel_with_alt_delta_multiplier_y"
                       accesskey="&wheelSpeed.accesskey;"
                       preference="mousewheel.with_alt.delta_multiplier_y"
                       onsyncfrompreference="document.getElementById('mousewheel_pane').updateCheckbox(this);"/>
              <label value="%"/>
              <checkbox label="&reverseDirection.label;"
                        accesskey="&reverseDirection.accesskey;"
                        oncommand="updateTextbox(this);"/>
            </hbox>
          </groupbox>

          <groupbox>
            <caption label="&mouseWheelHorizGroup.label;"/>
            <radiogroup id="mousewheel_with_alt_action_x"
                        preference="mousewheel.with_alt.action.override_x"
                        onsyncfrompreference="document.getElementById('mousewheel_pane').doEnablingX(this);">
              <radio value="-1" label="&sameAsVertical.label;" accesskey="&sameAsVertical.accesskey;"/>
              <radio value="0" label="&doNothing.label;" accesskey="&doNothingHoriz.accesskey;"/>
              <radio value="1" label="&scrollDocument.label;" accesskey="&scrollDocumentHoriz.accesskey;"/>
              <radio value="2" label="&history.label;" accesskey="&historyHoriz.accesskey;"/>
              <radio value="3" label="&zoom.label;" accesskey="&zoomHoriz.accesskey;"/>
            </radiogroup>
            <hbox align="center">
              <label control="mousewheel_with_alt_delta_multiplier_x"
                     value="&wheelSpeed.label;"/>
              <textbox type="number" min="-999999" max="999999" size="6"
                       id="mousewheel_with_alt_delta_multiplier_x"
                       accesskey="&wheelSpeedHoriz.accesskey;"
                       preference="mousewheel.with_alt.delta_multiplier_x"
                       onsyncfrompreference="document.getElementById('mousewheel_pane').updateCheckbox(this);"/>
              <label value="%"/>
              <checkbox label="&reverseDirection.label;"
                        accesskey="&reverseDirectionHoriz.accesskey;"
                        oncommand="updateTextbox(this);"/>
            </hbox>
          </groupbox>
        </vbox>

        <!-- control modifiers -->
        <vbox>
          <groupbox>
            <caption label="&mouseWheelGroup.label;"/>
            <radiogroup id="mousewheel_with_control_action"
                        preference="mousewheel.with_control.action"
                        onsyncfrompreference="document.getElementById('mousewheel_pane').doEnabling(this);">
              <radio value="0" label="&doNothing.label;" accesskey="&doNothing.accesskey;"/>
              <radio value="1" label="&scrollDocument.label;" accesskey="&scrollDocument.accesskey;"/>
              <radio value="2" label="&history.label;" accesskey="&history.accesskey;"/>
              <radio value="3" label="&zoom.label;" accesskey="&zoom.accesskey;"/>
            </radiogroup>
            <hbox align="center">
              <label control="mousewheel_with_control_delta_multiplier_y"
                     value="&wheelSpeed.label;"/>
              <textbox type="number" min="-999999" max="999999" size="6"
                       id="mousewheel_with_control_delta_multiplier_y"
                       accesskey="&wheelSpeed.accesskey;"
                       preference="mousewheel.with_control.delta_multiplier_y"
                       onsyncfrompreference="document.getElementById('mousewheel_pane').updateCheckbox(this);"/>
              <label value="%"/>
              <checkbox label="&reverseDirection.label;"
                        accesskey="&reverseDirection.accesskey;"
                        oncommand="updateTextbox(this);"/>
            </hbox>
          </groupbox>

          <groupbox>
            <caption label="&mouseWheelHorizGroup.label;"/>
            <radiogroup id="mousewheel_with_control_action_x"
                        preference="mousewheel.with_control.action.override_x"
                        onsyncfrompreference="document.getElementById('mousewheel_pane').doEnablingX(this);">
              <radio value="-1" label="&sameAsVertical.label;" accesskey="&sameAsVertical.accesskey;"/>
              <radio value="0" label="&doNothing.label;" accesskey="&doNothingHoriz.accesskey;"/>
              <radio value="1" label="&scrollDocument.label;" accesskey="&scrollDocumentHoriz.accesskey;"/>
              <radio value="2" label="&history.label;" accesskey="&historyHoriz.accesskey;"/>
              <radio value="3" label="&zoom.label;" accesskey="&zoomHoriz.accesskey;"/>
            </radiogroup>
            <hbox align="center">
              <label control="mousewheel_with_control_delta_multiplier_x"
                     value="&wheelSpeed.label;"/>
              <textbox type="number" min="-999999" max="999999" size="6"
                       id="mousewheel_with_control_delta_multiplier_x"
                       accesskey="&wheelSpeedHoriz.accesskey;"
                       preference="mousewheel.with_control.delta_multiplier_x"
                       onsyncfrompreference="document.getElementById('mousewheel_pane').updateCheckbox(this);"/>
              <label value="%"/>
              <checkbox label="&reverseDirection.label;"
                        accesskey="&reverseDirectionHoriz.accesskey;"
                        oncommand="updateTextbox(this);"/>
            </hbox>
          </groupbox>
        </vbox>

        <!-- shift modifiers -->
        <vbox>
          <groupbox>
            <caption label="&mouseWheelGroup.label;"/>
            <radiogroup id="mousewheel_with_shift_action"
                        preference="mousewheel.with_shift.action"
                        onsyncfrompreference="document.getElementById('mousewheel_pane').doEnabling(this);">
              <radio value="0" label="&doNothing.label;" accesskey="&doNothing.accesskey;"/>
              <radio value="1" label="&scrollDocument.label;" accesskey="&scrollDocument.accesskey;"/>
              <radio value="2" label="&history.label;" accesskey="&history.accesskey;"/>
              <radio value="3" label="&zoom.label;" accesskey="&zoom.accesskey;"/>
            </radiogroup>
            <hbox align="center">
              <label control="mousewheel_with_shift_delta_multiplier_y"
                     value="&wheelSpeed.label;"/>
              <textbox type="number" min="-999999" max="999999" size="6"
                       id="mousewheel_with_shift_delta_multiplier_y"
                       accesskey="&wheelSpeed.accesskey;"
                       preference="mousewheel.with_shift.delta_multiplier_y"
                       onsyncfrompreference="document.getElementById('mousewheel_pane').updateCheckbox(this);"/>
              <label value="%"/>
              <checkbox label="&reverseDirection.label;"
                        accesskey="&reverseDirection.accesskey;"
                        oncommand="updateTextbox(this);"/>
            </hbox>
          </groupbox>

          <groupbox>
            <caption label="&mouseWheelHorizGroup.label;"/>
            <radiogroup id="mousewheel_with_shift_action_x"
                        preference="mousewheel.with_shift.action.override_x"
                        onsyncfrompreference="document.getElementById('mousewheel_pane').doEnablingX(this);">
              <radio value="-1" label="&sameAsVertical.label;" accesskey="&sameAsVertical.accesskey;"/>
              <radio value="0" label="&doNothing.label;" accesskey="&doNothingHoriz.accesskey;"/>
              <radio value="1" label="&scrollDocument.label;" accesskey="&scrollDocumentHoriz.accesskey;"/>
              <radio value="2" label="&history.label;" accesskey="&historyHoriz.accesskey;"/>
              <radio value="3" label="&zoom.label;" accesskey="&zoomHoriz.accesskey;"/>
            </radiogroup>
            <hbox align="center">
              <label control="mousewheel_with_shift_delta_multiplier_x"
                     value="&wheelSpeed.label;"/>
              <textbox type="number" min="-999999" max="999999" size="6"
                       id="mousewheel_with_shift_delta_multiplier_x"
                       accesskey="&wheelSpeedHoriz.accesskey;"
                       preference="mousewheel.with_shift.delta_multiplier_x"
                       onsyncfrompreference="document.getElementById('mousewheel_pane').updateCheckbox(this);"/>
              <label value="%"/>
              <checkbox label="&reverseDirection.label;"
                        accesskey="&reverseDirectionHoriz.accesskey;"
                        oncommand="updateTextbox(this);"/>
            </hbox>
          </groupbox>
        </vbox>
      </tabpanels>
    </tabbox>
  </prefpane>
</overlay>
