[Aptitude-svn-commit] r3490 - in branches/aptitude-0.3/aptitude: . src/vscreen

Daniel Burrows dburrows@costa.debian.org
Mon, 27 Jun 2005 21:49:08 +0000


Author: dburrows
Date: Mon Jun 27 21:49:05 2005
New Revision: 3490

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/vscreen/vs_tree.cc
   branches/aptitude-0.3/aptitude/src/vscreen/vs_tree.h
Log:
Convert vs_tree::handle_char to vs_tree::handle_key.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Mon Jun 27 21:49:05 2005
@@ -1,5 +1,9 @@
 2005-06-27  Daniel Burrows  <dburrows@debian.org>
 
+	* src/vscreen/vs_tree.cc, src/vscreen/vs_tree.h:
+
+	  Convert vs_tree::handle_char to vs_tree::handle_key.
+
 	* src/vscreen/vs_table.cc, src/vscreen/vs_table.h:
 
 	  Convert vs_table::handle_char to vs_table::handle_key.

Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_tree.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_tree.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_tree.cc	Mon Jun 27 21:49:05 2005
@@ -601,7 +601,7 @@
     set_selection(tmp);
 }
 
-bool vs_tree::handle_char(chtype ch)
+bool vs_tree::handle_key(const key &k)
 {
   // umm...
   //width++;
@@ -609,12 +609,12 @@
 
   if(selected!=vs_treeiterator(NULL))
     {
-      if(hierarchical && bindings->key_matches(ch, "Parent"))
+      if(hierarchical && bindings->key_matches(k, "Parent"))
 	{
 	  if(!selected.is_root())
 	    set_selection(selected.get_up());
 	}
-      else if(!hierarchical && prev_level && bindings->key_matches(ch, "Left"))
+      else if(!hierarchical && prev_level && bindings->key_matches(k, "Left"))
 	{
 	  selected->unhighlighted(this);
 
@@ -634,8 +634,8 @@
       else if(!hierarchical &&
 	      selected!=end && selected->get_selectable() &&
 	      selected->begin()!=selected->end() &&
-	      (bindings->key_matches(ch, "Right") ||
-	       bindings->key_matches(ch, "Confirm")))
+	      (bindings->key_matches(k, "Right") ||
+	       bindings->key_matches(k, "Confirm")))
 	{
 	  selected->unhighlighted(this);
 	  prev_level=new flat_frame(begin, end, top, selected, prev_level);
@@ -649,21 +649,21 @@
 
 	  vscreen_update();
 	}
-      else if(bindings->key_matches(ch, "Down"))
+      else if(bindings->key_matches(k, "Down"))
 	line_down();
-      else if(bindings->key_matches(ch, "Up"))
+      else if(bindings->key_matches(k, "Up"))
 	line_up();
-      else if(bindings->key_matches(ch, "NextPage"))
+      else if(bindings->key_matches(k, "NextPage"))
 	page_down();
-      else if(bindings->key_matches(ch, "PrevPage"))
+      else if(bindings->key_matches(k, "PrevPage"))
 	page_up();
-      else if(bindings->key_matches(ch, "Begin"))
+      else if(bindings->key_matches(k, "Begin"))
 	jump_to_begin();
-      else if(bindings->key_matches(ch, "End"))
+      else if(bindings->key_matches(k, "End"))
 	jump_to_end();
-      else if(bindings->key_matches(ch, "LevelUp"))
+      else if(bindings->key_matches(k, "LevelUp"))
 	level_line_up();
-      else if(bindings->key_matches(ch, "LevelDown"))
+      else if(bindings->key_matches(k, "LevelDown"))
 	level_line_down();
       /*else if(bindings->key_matches(ch, "Search"))
 	{
@@ -676,10 +676,11 @@
       search_for("");*/
       else
 	{
-	  if(selected!=end && selected->get_selectable() && selected->dispatch_char(ch, this))
+	  if(selected!=end && selected->get_selectable() &&
+	     selected->dispatch_char(k, this))
 	    vscreen_update();
 	  else
-	    return vscreen_widget::handle_char(ch);
+	    return vscreen_widget::handle_key(k);
 	}
       return true;
     }

Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_tree.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_tree.h	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_tree.h	Mon Jun 27 21:49:05 2005
@@ -107,7 +107,7 @@
   //  It'll be the first thing to be removed in the next version..
   //  -- well, it wasn't.
 
-  virtual bool handle_char(chtype ch);
+  virtual bool handle_key(const key &k);
 public:
   vs_tree();
   vs_tree(vs_treeitem *_root, bool showroot=false);