ecere/gui/DirectoriesBox: Fixed 2-line moves on Ctrl-Up/Down, Disabled scrolling...
authorJerome St-Louis <jerome@ecere.com>
Thu, 2 May 2013 10:40:01 +0000 (06:40 -0400)
committerJerome St-Louis <jerome@ecere.com>
Thu, 2 May 2013 10:40:01 +0000 (06:40 -0400)
- Ctrl-Up/Down was conflicting between scrolling and moving rows up/down

ecere/src/gui/controls/PathBox.ec
ecere/src/sys/Date.ec

index 5a8b013..bc16010 100644 (file)
@@ -507,8 +507,27 @@ public:
          return true;
       }
 
+      bool NotifyKeyHit(ListBox listBox, DataRow row, Key key, unichar ch)
+      {
+         // Prioritize row moving Ctrl-Up/Down over scrollbar scrolling
+         if(key == ctrlUp || key == ctrlDown)
+         {
+            Button btn = (key == ctrlUp) ? up : down;
+            btn.OnKeyHit(hotKey, 0);
+            return false;
+         }
+         return true;
+      }
+
       bool NotifyKeyDown(ListBox listBox, DataRow row, Key key, unichar ch)
       {
+         // Prioritize row moving Ctrl-Up/Down over scrollbar scrolling
+         if(key == ctrlUp || key == ctrlDown)
+         {
+            Button btn = (key == ctrlUp) ? up : down;
+            btn.OnKeyDown(hotKey, 0);
+            return false;
+         }
          if(key == del)
          {
             listBox.StopEditing(true);
index 0ed34a9..b86078b 100644 (file)
@@ -542,7 +542,7 @@ public:
       button.pressing = true;
       button.NotifyClicked(this, button, x, y, mods);
       button.timer.Start();
-      return true;
+      return false; //true;
    }
 
    bool NotifyMouseLeave(RepButton button, Modifiers mods)