ide:ProjectView; added alt + up/down to quickly navigate between the projects.
authorRejean Loyer <rejean.loyer@gmail.com>
Thu, 4 Oct 2012 00:10:05 +0000 (20:10 -0400)
committerRejean Loyer <rejean.loyer@gmail.com>
Mon, 22 Oct 2012 09:45:13 +0000 (05:45 -0400)
ide/src/project/ProjectView.ec

index b75dc9a..10e7586 100644 (file)
@@ -316,6 +316,16 @@ class ProjectView : Window
          return true;
       }
 
+      bool NotifyKeyHit(ListBox listBox, DataRow row, Key key, unichar ch)
+      {
+         if(key == altUp || key == altDown)
+         {
+            SelectNextProject(key == altUp);
+            return false;
+         }
+         return true;
+      }
+
       bool NotifyKeyDown(ListBox listBox, DataRow row, Key key, unichar ch)
       {
          if(row)
@@ -1257,6 +1267,24 @@ class ProjectView : Window
       return prj;
    }
    
+   void SelectNextProject(bool backwards)
+   {
+      DataRow row = fileList.currentRow;
+      DataRow currentRow = row;
+      ProjectNode node = (ProjectNode)row.tag;
+      if(node.type != project)
+         row = node.project.topNode.row;
+      else if(backwards)
+         row = row.previous ? row.previous : fileList.lastRow;
+      if(!backwards)
+         row = row.next ? row.next : fileList.firstRow;
+      if(row && row != currentRow)
+      {
+         fileList.SelectRow(row);
+         fileList.currentRow = row;
+      }
+   }
+
    ProjectNode GetSelectedNode(bool useSelection)
    {
       ProjectNode node = null;