Bug 373240 Uppercase the VK_* bits for consistency with the rest of the codebase (Gv1 - toolkit). p=Serge Gautherie <sgautherie.bz@free.fr>,r=enndeakin
authorbugzilla@standard8.demon.co.uk
Tue, 03 Apr 2007 10:06:57 -0700
changeset 297 904d9563bfc36fe99d538e6e051bb08c44b34c01
parent 296 65e92850afbc2d0fb742660bd79e5c9d85850c93
child 298 032e56e7e75dd582881daca4249a55f78d2bd9d9
push idunknown
push userunknown
push dateunknown
reviewersenndeakin
bugs373240
milestone1.9a4pre
Bug 373240 Uppercase the VK_* bits for consistency with the rest of the codebase (Gv1 - toolkit). p=Serge Gautherie <sgautherie.bz@free.fr>,r=enndeakin
toolkit/content/widgets/listbox.xml
toolkit/content/widgets/tree.xml
toolkit/mozapps/downloads/content/download.xml
toolkit/mozapps/shared/content/richview.xml
--- a/toolkit/content/widgets/listbox.xml
+++ b/toolkit/content/widgets/listbox.xml
@@ -702,27 +702,27 @@
             this.scrollToIndex(newTop);
             return pageOffset;          
           ]]>
         </body>
       </method>
     </implementation>
     
     <handlers>
-      <handler event="keypress" keycode="vk_up" modifiers="control shift any"
+      <handler event="keypress" keycode="VK_UP" modifiers="control shift any"
                phase="target" action="moveByOffset(-1, !event.ctrlKey, event.shiftKey);"/>
-      <handler event="keypress" keycode="vk_down" modifiers="control shift any"
+      <handler event="keypress" keycode="VK_DOWN" modifiers="control shift any"
                phase="target" action="moveByOffset(1, !event.ctrlKey, event.shiftKey);"/>
-      <handler event="keypress" keycode="vk_home" modifiers="control shift any"
+      <handler event="keypress" keycode="VK_HOME" modifiers="control shift any"
                phase="target" action="moveByOffset(-this.currentIndex, !event.ctrlKey, event.shiftKey);"/>
-      <handler event="keypress" keycode="vk_end" modifiers="control shift any"
+      <handler event="keypress" keycode="VK_END" modifiers="control shift any"
                phase="target" action="moveByOffset(this.getRowCount() - this.currentIndex - 1, !event.ctrlKey, event.shiftKey);"/>
-      <handler event="keypress" keycode="vk_page_up" modifiers="control shift any"
+      <handler event="keypress" keycode="VK_PAGE_UP" modifiers="control shift any"
                phase="target" action="moveByOffset(this.scrollOnePage(-1), !event.ctrlKey, event.shiftKey);"/>
-      <handler event="keypress" keycode="vk_page_down" modifiers="control shift any"
+      <handler event="keypress" keycode="VK_PAGE_DOWN" modifiers="control shift any"
                phase="target" action="moveByOffset(this.scrollOnePage(1), !event.ctrlKey, event.shiftKey);"/>
       <handler event="keypress" key=" " phase="target">
         <![CDATA[
           if (this.currentItem) {
             if (this.currentItem.getAttribute("type") != "checkbox")
               this.addItemToSelection(this.currentItem);
             else if (!this.currentItem.disabled)
               this.currentItem.checked = !this.currentItem.checked;
--- a/toolkit/content/widgets/tree.xml
+++ b/toolkit/content/widgets/tree.xml
@@ -418,50 +418,50 @@
             var col = this._getNextColumn(this.currentIndex, false);
             this.view.selection.currentColumn = col;
           }
         ]]>
       </handler>
       <handler event="blur" action="this.treeBoxObject.focused = false;"/>
       <handler event="blur" phase="capturing"
                action="if (event.originalTarget == this.inputField.inputField) this.stopEditing(true);"/>
-      <handler event="keypress" keycode="vk_enter">
+      <handler event="keypress" keycode="VK_ENTER">
         <![CDATA[
           if (this._editingColumn) {
             this.stopEditing(true);
             this.focus();
             event.stopPropagation();
           }
           else {
             this.changeOpenState(this.currentIndex);
           }
         ]]>
       </handler>
-      <handler event="keypress" keycode="vk_return">
+      <handler event="keypress" keycode="VK_RETURN">
         <![CDATA[
           if (this._editingColumn) {
             this.stopEditing(true);
             this.focus();
             event.stopPropagation();
           }
           else {
             this.changeOpenState(this.currentIndex);
           }
         ]]>
       </handler>
-      <handler event="keypress" keycode="vk_escape">
+      <handler event="keypress" keycode="VK_ESCAPE">
         <![CDATA[
           if (this._editingColumn) {
             this.stopEditing(false);
             this.focus();
             event.stopPropagation();
           }
         ]]>
       </handler>
-      <handler event="keypress" keycode="vk_left">
+      <handler event="keypress" keycode="VK_LEFT">
         <![CDATA[
          if (this._editingColumn)
            return;
 
          var row = this.currentIndex;
          if (row < 0)
            return;
 
@@ -495,17 +495,17 @@
            var col = this._getNextColumn(row, true);
            if (col) {
              this.view.selection.currentColumn = col;
              this.treeBoxObject.ensureCellIsVisible(row, col);
            }
          }
         ]]>
       </handler>
-      <handler event="keypress" keycode="vk_right">
+      <handler event="keypress" keycode="VK_RIGHT">
         <![CDATA[
          if (this._editingColumn)
            return;
 
           var row = this.currentIndex;
           if (row < 0)
             return;
 
@@ -547,17 +547,17 @@
             var col = this._getNextColumn(row, false);
             if (col) {
               this.view.selection.currentColumn = col;
               this.treeBoxObject.ensureCellIsVisible(row, col);
             }
           }
         ]]>
       </handler>
-      <handler event="keypress" keycode="vk_up"
+      <handler event="keypress" keycode="VK_UP"
                modifiers="accel any">
         <![CDATA[
          if (this._editingColumn)
            return;
 
          if (this._isAccelPressed(event) && this.view.selection.single) {
            this.treeBoxObject.scrollByLines(-1);
            return;
@@ -581,17 +581,17 @@
 
          if (!this._isAccelPressed(event))
            this.view.selection.timedSelect(c, this._selectDelay);
          else // Ctrl+Up moves the anchor without selecting
            this.currentIndex = c;
          this.treeBoxObject.ensureRowIsVisible(c);
         ]]>
       </handler>
-      <handler event="keypress" keycode="vk_down"
+      <handler event="keypress" keycode="VK_DOWN"
                modifiers="accel any">
         <![CDATA[
          if (this._editingColumn)
            return;
 
          if (this._isAccelPressed(event) && this.view.selection.single) {
            this.treeBoxObject.scrollByLines(1);
            return;
@@ -615,45 +615,45 @@
 
          if (!this._isAccelPressed(event))
            this.view.selection.timedSelect(c, this._selectDelay);
          else // Ctrl+Down moves the anchor without selecting
            this.currentIndex = c;
          this.treeBoxObject.ensureRowIsVisible(c);
         ]]>
       </handler>
-      <handler event="keypress" keycode="vk_up"
+      <handler event="keypress" keycode="VK_UP"
                modifiers="accel any, shift">
         <![CDATA[
          if (this._editingColumn || this.view.selection.single)
            return;
          var c = this.currentIndex;
          if (c == -1 || c == 0)
            return;
          // Extend the selection from the existing pivot, if any
          this.view.selection.rangedSelect(-1, c - 1,
                                           this._isAccelPressed(event));
          this.treeBoxObject.ensureRowIsVisible(c - 1);
         ]]>
       </handler>
-      <handler event="keypress" keycode="vk_down"
+      <handler event="keypress" keycode="VK_DOWN"
                modifiers="accel any, shift">
         <![CDATA[
          if (this._editingColumn || this.view.selection.single)
            return;
          var c = this.currentIndex;
          if (c+1 == this.view.rowCount)
            return;
          // Extend the selection from the existing pivot, if any
          this.view.selection.rangedSelect(-1, c + 1,
                                           this._isAccelPressed(event));
          this.treeBoxObject.ensureRowIsVisible(c + 1);
         ]]>
       </handler>
-      <handler event="keypress" keycode="vk_page_up"
+      <handler event="keypress" keycode="VK_PAGE_UP"
                modifiers="accel any">
         <![CDATA[
          if (this._editingColumn)
            return;
 
          if (this.pageUpOrDownMovesSelection == this._isAccelPressed(event)) {
            this.treeBoxObject.scrollByPages(-1);
            return;
@@ -669,17 +669,17 @@
          if (c <= i) {
             var p = this.treeBoxObject.getPageLength();
             i = c <= p ? 0 : c - p;
             this.treeBoxObject.ensureRowIsVisible(i);
          }
          this.view.selection.timedSelect(i, this._selectDelay);
         ]]>
       </handler>
-      <handler event="keypress" keycode="vk_page_down"
+      <handler event="keypress" keycode="VK_PAGE_DOWN"
                modifiers="accel any">
         <![CDATA[
          if (this._editingColumn)
            return;
 
          if (this.pageUpOrDownMovesSelection == this._isAccelPressed(event)) {
            this.treeBoxObject.scrollByPages(1);
            return;
@@ -696,17 +696,17 @@
          var i = this.treeBoxObject.getFirstVisibleRow() + p - 1;
          if (c >= i) {
             i = c + p;
             this.treeBoxObject.ensureRowIsVisible(i > l ? l : i);
          }
          this.view.selection.timedSelect(i > l ? l : i, this._selectDelay);
         ]]>
       </handler>
-      <handler event="keypress" keycode="vk_page_up"
+      <handler event="keypress" keycode="VK_PAGE_UP"
                modifiers="accel any, shift">
         <![CDATA[
          if (this._editingColumn || this.view.selection.single)
            return;
          var c = this.currentIndex;
          if (c == -1)
            return;
          if (c == 0 && this.view.selection.isSelected(c)) {
@@ -718,17 +718,17 @@
             var p = this.treeBoxObject.getPageLength();
             i = c <= p ? 0 : c - p;
             this.treeBoxObject.ensureRowIsVisible(i);
          }
          // Extend the selection from the existing pivot, if any
          this.view.selection.rangedSelect(-1, i, this._isAccelPressed(event));
         ]]>
       </handler>
-      <handler event="keypress" keycode="vk_page_down"
+      <handler event="keypress" keycode="VK_PAGE_DOWN"
                modifiers="accel any, shift">
         <![CDATA[
          if (this._editingColumn || this.view.selection.single)
            return;
          var c = this.currentIndex;
          var l = this.view.rowCount - 1;
          if (l == -1)
            return;
@@ -741,31 +741,31 @@
          if (c >= i) {
             i = c + p;
             this.treeBoxObject.ensureRowIsVisible(i > l ? l : i);
          }
          // Extend the selection from the existing pivot, if any
          this.view.selection.rangedSelect(-1, i > l ? l : i, this._isAccelPressed(event));
         ]]>
       </handler>
-      <handler event="keypress" keycode="vk_home"
+      <handler event="keypress" keycode="VK_HOME"
                modifiers="accel any">
         <![CDATA[
          if (this._editingColumn || this.view.rowCount == 0)
            return;
          // Normal behaviour is to select the first row
          if (!this._isAccelPressed(event))
            this.view.selection.timedSelect(0, this._selectDelay);
          // In a multiselect tree Ctrl+Home moves the anchor
          else if (!this.view.selection.single)
            this.currentIndex = 0;
          this.treeBoxObject.ensureRowIsVisible(0);
         ]]>
       </handler>
-      <handler event="keypress" keycode="vk_end"
+      <handler event="keypress" keycode="VK_END"
                modifiers="accel any">
         <![CDATA[
          if (this._editingColumn)
            return;
 
          var l = this.view.rowCount - 1;
          if (l < 0)
            return;
@@ -773,27 +773,27 @@
          if (!this._isAccelPressed(event))
            this.view.selection.timedSelect(l, this._selectDelay);
          // In a multiselect tree Ctrl+End moves the anchor
          else if (!this.view.selection.single)
            this.currentIndex = l;
          this.treeBoxObject.ensureRowIsVisible(l);
         ]]>
       </handler>
-      <handler event="keypress" keycode="vk_home"
+      <handler event="keypress" keycode="VK_HOME"
                modifiers="accel any, shift">
         <![CDATA[
          if (this._editingColumn || this.view.selection.single)
            return;
          // Extend the selection from the existing pivot, if any
          this.view.selection.rangedSelect(-1, 0, this._isAccelPressed(event));
          this.treeBoxObject.ensureRowIsVisible(0);
         ]]>
       </handler>
-      <handler event="keypress" keycode="vk_end"
+      <handler event="keypress" keycode="VK_END"
                modifiers="accel any, shift">
         <![CDATA[
          if (this._editingColumn || this.view.selection.single)
            return;
          var l = this.view.rowCount - 1;
          // Extend the selection from the existing pivot, if any
          this.view.selection.rangedSelect(-1, l, this._isAccelPressed(event));
          this.treeBoxObject.ensureRowIsVisible(l);
--- a/toolkit/mozapps/downloads/content/download.xml
+++ b/toolkit/mozapps/downloads/content/download.xml
@@ -522,24 +522,24 @@
         if (event.ctrlKey) {
           this.selected = null;
           return;
         }
         
         this.selected = event.target;
       ]]>
       </handler>
-      <handler event="keypress" keycode="vk_enter" action="if (this.selected) this.selected.fireEvent('open');"/>
-      <handler event="keypress" keycode="vk_return" action="if (this.selected) this.selected.fireEvent('open');"/>
-      <handler event="keypress" keycode="vk_up" action="this.selectionBackward(event);"/>
-      <handler event="keypress" keycode="vk_left" action="this.selectionBackward(event);"/>
-      <handler event="keypress" keycode="vk_down" action="this.selectionForward(event);"/>
-      <handler event="keypress" keycode="vk_right" action="this.selectionForward(event);"/>
-      <handler event="keypress" keycode="vk_up" modifiers="meta" action="this.selected = null"/>
-      <handler event="keypress" keycode="vk_down" modifiers="meta" action="this.selected = null"/>
-      <handler event="keypress" keycode="vk_left" modifiers="meta" action="this.selected = null"/>
-      <handler event="keypress" keycode="vk_right" modifiers="meta" action="this.selected = null"/>
-      <handler event="keypress" keycode="vk_delete" action="if (this.selected) this.selected.fireEvent('remove');"/>
+      <handler event="keypress" keycode="VK_ENTER" action="if (this.selected) this.selected.fireEvent('open');"/>
+      <handler event="keypress" keycode="VK_RETURN" action="if (this.selected) this.selected.fireEvent('open');"/>
+      <handler event="keypress" keycode="VK_UP" action="this.selectionBackward(event);"/>
+      <handler event="keypress" keycode="VK_LEFT" action="this.selectionBackward(event);"/>
+      <handler event="keypress" keycode="VK_DOWN" action="this.selectionForward(event);"/>
+      <handler event="keypress" keycode="VK_RIGHT" action="this.selectionForward(event);"/>
+      <handler event="keypress" keycode="VK_UP" modifiers="meta" action="this.selected = null;"/>
+      <handler event="keypress" keycode="VK_DOWN" modifiers="meta" action="this.selected = null;"/>
+      <handler event="keypress" keycode="VK_LEFT" modifiers="meta" action="this.selected = null;"/>
+      <handler event="keypress" keycode="VK_RIGHT" modifiers="meta" action="this.selected = null;"/>
+      <handler event="keypress" keycode="VK_DELETE" action="if (this.selected) this.selected.fireEvent('remove');"/>
       <handler event="keypress" key=" " action="if (this.selected) { this.selected.pauseResume(); }"/>
     </handlers>
   </binding>
   
 </bindings>
--- a/toolkit/mozapps/shared/content/richview.xml
+++ b/toolkit/mozapps/shared/content/richview.xml
@@ -182,24 +182,24 @@
         
         if (event.target == this)
           this.selected = null
         else
           this.selected = event.target;
       ]]>
       </handler>
       <handler event="dblclick" action="if (this.selected &amp;&amp; event.button == 0) this.selected.fireEvent('open');"/>
-      <handler event="keypress" keycode="vk_enter" action="if (this.selected) this.selected.fireEvent('open');"/>
-      <handler event="keypress" keycode="vk_return" action="if (this.selected) this.selected.fireEvent('open');"/>
-      <handler event="keypress" keycode="vk_up" action="this.selectionBackward(event);"/>
-      <handler event="keypress" keycode="vk_left" action="this.selectionBackward(event);"/>
-      <handler event="keypress" keycode="vk_down" action="this.selectionForward(event);"/>
-      <handler event="keypress" keycode="vk_right" action="this.selectionForward(event);"/>
-      <handler event="keypress" keycode="vk_up" modifiers="meta" action="this.selected = null"/>
-      <handler event="keypress" keycode="vk_down" modifiers="meta" action="this.selected = null"/>
-      <handler event="keypress" keycode="vk_left" modifiers="meta" action="this.selected = null"/>
-      <handler event="keypress" keycode="vk_right" modifiers="meta" action="this.selected = null"/>
-      <handler event="keypress" keycode="vk_delete" action="if (this.selected) this.selected.fireEvent('remove');"/>
+      <handler event="keypress" keycode="VK_ENTER" action="if (this.selected) this.selected.fireEvent('open');"/>
+      <handler event="keypress" keycode="VK_RETURN" action="if (this.selected) this.selected.fireEvent('open');"/>
+      <handler event="keypress" keycode="VK_UP" action="this.selectionBackward(event);"/>
+      <handler event="keypress" keycode="VK_LEFT" action="this.selectionBackward(event);"/>
+      <handler event="keypress" keycode="VK_DOWN" action="this.selectionForward(event);"/>
+      <handler event="keypress" keycode="VK_RIGHT" action="this.selectionForward(event);"/>
+      <handler event="keypress" keycode="VK_UP" modifiers="meta" action="this.selected = null;"/>
+      <handler event="keypress" keycode="VK_DOWN" modifiers="meta" action="this.selected = null;"/>
+      <handler event="keypress" keycode="VK_LEFT" modifiers="meta" action="this.selected = null;"/>
+      <handler event="keypress" keycode="VK_RIGHT" modifiers="meta" action="this.selected = null;"/>
+      <handler event="keypress" keycode="VK_DELETE" action="if (this.selected) this.selected.fireEvent('remove');"/>
     </handlers>
   </binding>
   
 </bindings>