Browse Source

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
shortcuts
Markus Palme 20 years ago
parent
commit
dc487c7331
  1. 42
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs

42
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs

@ -22,6 +22,7 @@ using System.Text;
using System.Xml; using System.Xml;
using ICSharpCode.TextEditor.Actions; using ICSharpCode.TextEditor.Actions;
using ICSharpCode.TextEditor.Document; using ICSharpCode.TextEditor.Document;
using ICSharpCode.TextEditor.Gui.CompletionWindow;
namespace ICSharpCode.TextEditor 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 // 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. // tooltips of text areas from inactive tabs floating around.
static ToolTip toolTip; static DeclarationViewWindow toolTip;
static string oldToolTip; static string oldToolTip;
bool toolTipSet; bool toolTipSet;
@ -308,16 +309,18 @@ namespace ICSharpCode.TextEditor
public void SetToolTip(string text) public void SetToolTip(string text)
{ {
if (toolTip == null) toolTip = new ToolTip(); if (toolTip == null) toolTip = new DeclarationViewWindow(this.FindForm());
toolTipSet = (text != null); toolTipSet = (text != null);
if (oldToolTip == text) if (oldToolTip == text)
return; return;
if (text == null) { if (text == null) {
toolTip.Hide(this); toolTip.Hide();
} else { } else {
Point p = PointToClient(Control.MousePosition); Point p = Control.MousePosition;
p.Offset(3, 3); p.Offset(3, 3);
toolTip.Show(text, this, p); toolTip.Location = p;
toolTip.Description = text;
toolTip.Show();
} }
oldToolTip = text; oldToolTip = text;
} }
@ -472,22 +475,19 @@ namespace ICSharpCode.TextEditor
} }
motherTextEditorControl.BeginUpdate(); motherTextEditorControl.BeginUpdate();
switch (ch) { // INSERT char
default: // INSERT char if (!HandleKeyPress(ch)) {
if (!HandleKeyPress(ch)) { switch (Caret.CaretMode) {
switch (Caret.CaretMode) { case CaretMode.InsertMode:
case CaretMode.InsertMode: InsertChar(ch);
InsertChar(ch); break;
break; case CaretMode.OverwriteMode:
case CaretMode.OverwriteMode: ReplaceChar(ch);
ReplaceChar(ch); break;
break; default:
default: Debug.Assert(false, "Unknown caret mode " + Caret.CaretMode);
Debug.Assert(false, "Unknown caret mode " + Caret.CaretMode); break;
break; }
}
}
break;
} }
int currentLineNr = Caret.Line; int currentLineNr = Caret.Line;

Loading…
Cancel
Save