[Monodevelop-patches-list] r1246 - in trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor: . CodeCompletion

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Thu Mar 25 16:55:04 EST 2004


Author: tberman
Date: 2004-03-25 16:55:04 -0500 (Thu, 25 Mar 2004)
New Revision: 1246

Modified:
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionWindow.cs
Log:
this commit was brought to you by the letters 'N' and 'P'


Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog	2004-03-25 21:14:07 UTC (rev 1245)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog	2004-03-25 21:55:04 UTC (rev 1246)
@@ -1,5 +1,10 @@
 2004-03-25  Todd Berman  <tberman at sevenl.net>
 
+	* CodeCompletion/CompletionWindow.cs: fix bug that didnt allow you to
+	enter shift+p or shift+n.
+
+2004-03-25  Todd Berman  <tberman at sevenl.net>
+
 	* CodeCompletion/CompletionWindow.cs: fix bug where the first item
 	in the list was never being touched due to a for loop miscue.
 

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionWindow.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionWindow.cs	2004-03-25 21:14:07 UTC (rev 1245)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionWindow.cs	2004-03-25 21:55:04 UTC (rev 1246)
@@ -47,22 +47,39 @@
 
 		protected override bool OnKeyPressEvent (Gdk.EventKey e)
 		{
-			switch ((char)e.Key) {
-			case '.':
-			case ' ':
-			case ';':
-			case '(':
-			case '[':
-				control.SimulateKeyPress (ref e);
-				LostFocusListView (null, null);
-				return true;
-			case (char) Gdk.Key.BackSpace:
-				control.SimulateKeyPress (ref e);
-				insertLength--;
-				if (insertLength == -1) {
+			uint state = (uint)e.State;
+			state &= 1101u;
+
+			switch (state) {
+			case 0: //NORMAL
+				switch ((char)e.Key) {
+				case '.':
+				case ' ':
+				case ';':
+				case '(':
+				case '[':
+					control.SimulateKeyPress (ref e);
 					LostFocusListView (null, null);
+					return true;
+				case (char) Gdk.Key.BackSpace:
+					control.SimulateKeyPress (ref e);
+					insertLength--;
+					if (insertLength == -1) {
+						LostFocusListView (null, null);
+					}
+					return true;
 				}
-				return true;
+				break;
+			case 1: //SHIFT
+				switch ((char)e.Key) {
+				case 'P':
+				case 'N':
+					KeyPressEventArgs fake_args = new KeyPressEventArgs ();
+					fake_args.Args = new object[] { e };
+					ListKeypressEvent (null, fake_args);
+					return true;
+				}
+				break;
 			}
 			return base.OnKeyPressEvent (e);
 		}
@@ -84,7 +101,7 @@
 					LostFocusListView (null, null);
 					ex.RetVal = true;
 					return;
-					
+
 				default:
 					if (val != '_' && !Char.IsLetterOrDigit (val)) {
 						if (listView.Selection.CountSelectedRows () > 0) {




More information about the Monodevelop-patches-list mailing list