From dc487c7331da065dc04c97b0840d5cae46eb287f Mon Sep 17 00:00:00 2001 From: Markus Palme Date: Tue, 25 Oct 2005 17:57:31 +0000 Subject: [PATCH] Texteditor now uses DeclarationViewWindow instead of ToolTip (part of SD2-498) git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@624 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Project/Src/Gui/TextArea.cs | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs index 084c58cb88..33601ac661 100644 --- a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs +++ b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs @@ -22,6 +22,7 @@ using System.Text; using System.Xml; using ICSharpCode.TextEditor.Actions; using ICSharpCode.TextEditor.Document; +using ICSharpCode.TextEditor.Gui.CompletionWindow; namespace ICSharpCode.TextEditor { @@ -296,7 +297,7 @@ namespace ICSharpCode.TextEditor // static because the mouse can only be in one text area and we don't want to have // tooltips of text areas from inactive tabs floating around. - static ToolTip toolTip; + static DeclarationViewWindow toolTip; static string oldToolTip; bool toolTipSet; @@ -308,16 +309,18 @@ namespace ICSharpCode.TextEditor public void SetToolTip(string text) { - if (toolTip == null) toolTip = new ToolTip(); + if (toolTip == null) toolTip = new DeclarationViewWindow(this.FindForm()); toolTipSet = (text != null); if (oldToolTip == text) return; if (text == null) { - toolTip.Hide(this); + toolTip.Hide(); } else { - Point p = PointToClient(Control.MousePosition); + Point p = Control.MousePosition; p.Offset(3, 3); - toolTip.Show(text, this, p); + toolTip.Location = p; + toolTip.Description = text; + toolTip.Show(); } oldToolTip = text; } @@ -472,22 +475,19 @@ namespace ICSharpCode.TextEditor } motherTextEditorControl.BeginUpdate(); - switch (ch) { - default: // INSERT char - if (!HandleKeyPress(ch)) { - switch (Caret.CaretMode) { - case CaretMode.InsertMode: - InsertChar(ch); - break; - case CaretMode.OverwriteMode: - ReplaceChar(ch); - break; - default: - Debug.Assert(false, "Unknown caret mode " + Caret.CaretMode); - break; - } - } - break; + // INSERT char + if (!HandleKeyPress(ch)) { + switch (Caret.CaretMode) { + case CaretMode.InsertMode: + InsertChar(ch); + break; + case CaretMode.OverwriteMode: + ReplaceChar(ch); + break; + default: + Debug.Assert(false, "Unknown caret mode " + Caret.CaretMode); + break; + } } int currentLineNr = Caret.Line;