[Monodevelop-patches-list] r448 - in trunk/MonoDevelop: . src/AddIns/DisplayBindings/TextEditor/Gui/Editor

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Sun Jan 11 16:00:43 EST 2004


Author: pedroas
Date: 2004-01-11 16:00:42 -0500 (Sun, 11 Jan 2004)
New Revision: 448

Modified:
   trunk/MonoDevelop/TODO
   trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/Editor/SharpDevelopTextAreaControl.cs
Log:
Implemented the asynchronous completion window to avoid annoying the user
when he knows what he want. And avoid bloking the user interface, too

This is not well tested. As all threading code it needs much testing/reviewing.



Modified: trunk/MonoDevelop/TODO
===================================================================
--- trunk/MonoDevelop/TODO	2004-01-11 20:31:42 UTC (rev 447)
+++ trunk/MonoDevelop/TODO	2004-01-11 21:00:42 UTC (rev 448)
@@ -26,8 +26,6 @@
 - organize this list
 - switch to a proper build system
 - Allow show hidden (.*) files/directories in the file browser.
-- Make the completion window asynchronous to don't stop edititing when not
-  needed.
 - Figure out how to print the textarea char markers in pango, as it rejectes
   the original #d ones.
 

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/Editor/SharpDevelopTextAreaControl.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/Editor/SharpDevelopTextAreaControl.cs	2004-01-11 20:31:42 UTC (rev 447)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/Editor/SharpDevelopTextAreaControl.cs	2004-01-11 21:00:42 UTC (rev 448)
@@ -32,7 +32,9 @@
 		readonly static string contextMenuPath       = "/SharpDevelop/ViewContent/DefaultTextEditor/ContextMenu";
 		readonly static string editActionsPath       = "/AddIns/DefaultTextEditor/EditActions";
 		readonly static string formatingStrategyPath = "/AddIns/DefaultTextEditor/Formater";
-		
+		uint timeout = 0;
+		char currentchar;
+				
 		public SharpDevelopTextAreaControl()
 		{
 			Document.FoldingManager.FoldingStrategy = new ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ParserFoldingStrategy();
@@ -82,7 +84,17 @@
 		InsightWindow insightWindow = null;
 		bool HandleKeyPress(char ch)
 		{
+			if (timeout != 0) {
+				Gtk.Timeout.Remove(timeout);
+			}
+			timeout = Gtk.Timeout.Add(700, new Gtk.Function(HandleKeyPressImpl));
+			currentchar = ch;
+			return false;
+		}
+		
+		bool HandleKeyPressImpl() {
 			CompletionWindow completionWindow;
+			char ch = currentchar;
 			
 			string fileName = FileName;
 			




More information about the Monodevelop-patches-list mailing list