|
|
|
@ -242,6 +242,7 @@ namespace ICSharpCode.Core |
|
|
|
|
|
|
|
|
|
|
|
textArea.IconBarMargin.MouseDown += IconBarMouseDown; |
|
|
|
textArea.IconBarMargin.MouseDown += IconBarMouseDown; |
|
|
|
textArea.ToolTipRequest += TextAreaToolTipRequest; |
|
|
|
textArea.ToolTipRequest += TextAreaToolTipRequest; |
|
|
|
|
|
|
|
textArea.MouseLeave += TextAreaMouseLeave; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -252,6 +253,7 @@ namespace ICSharpCode.Core |
|
|
|
|
|
|
|
|
|
|
|
textArea.IconBarMargin.MouseDown -= IconBarMouseDown; |
|
|
|
textArea.IconBarMargin.MouseDown -= IconBarMouseDown; |
|
|
|
textArea.ToolTipRequest -= TextAreaToolTipRequest; |
|
|
|
textArea.ToolTipRequest -= TextAreaToolTipRequest; |
|
|
|
|
|
|
|
textArea.MouseLeave -= TextAreaMouseLeave; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -286,6 +288,7 @@ namespace ICSharpCode.Core |
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
static void TextAreaToolTipRequest(object sender, ToolTipRequestEventArgs e) |
|
|
|
static void TextAreaToolTipRequest(object sender, ToolTipRequestEventArgs e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
DebuggerGridControl toolTipControl = null; |
|
|
|
try { |
|
|
|
try { |
|
|
|
TextArea textArea = (TextArea)sender; |
|
|
|
TextArea textArea = (TextArea)sender; |
|
|
|
if (e.ToolTipShown) return; |
|
|
|
if (e.ToolTipShown) return; |
|
|
|
@ -314,7 +317,6 @@ namespace ICSharpCode.Core |
|
|
|
ResolveResult result = ParserService.Resolve(expressionResult, logicPos.Y + 1, logicPos.X + 1, textArea.MotherTextEditorControl.FileName, textContent); |
|
|
|
ResolveResult result = ParserService.Resolve(expressionResult, logicPos.Y + 1, logicPos.X + 1, textArea.MotherTextEditorControl.FileName, textContent); |
|
|
|
bool debuggerCanShowValue; |
|
|
|
bool debuggerCanShowValue; |
|
|
|
string toolTipText = GetText(result, expression, out debuggerCanShowValue); |
|
|
|
string toolTipText = GetText(result, expression, out debuggerCanShowValue); |
|
|
|
DebuggerGridControl toolTipControl = null; |
|
|
|
|
|
|
|
if (toolTipText != null) { |
|
|
|
if (toolTipText != null) { |
|
|
|
if (Control.ModifierKeys == Keys.Control) { |
|
|
|
if (Control.ModifierKeys == Keys.Control) { |
|
|
|
toolTipText = "expr: " + expressionResult.ToString() + "\n" + toolTipText; |
|
|
|
toolTipText = "expr: " + expressionResult.ToString() + "\n" + toolTipText; |
|
|
|
@ -326,10 +328,7 @@ namespace ICSharpCode.Core |
|
|
|
if (toolTipText != null) { |
|
|
|
if (toolTipText != null) { |
|
|
|
e.ShowToolTip(toolTipText); |
|
|
|
e.ShowToolTip(toolTipText); |
|
|
|
} |
|
|
|
} |
|
|
|
if (oldToolTipControl != null) { |
|
|
|
CloseOldToolTip(); |
|
|
|
Form frm = oldToolTipControl.FindForm(); |
|
|
|
|
|
|
|
if (frm != null) frm.Close(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (toolTipControl != null) { |
|
|
|
if (toolTipControl != null) { |
|
|
|
toolTipControl.ShowForm(textArea, logicPos); |
|
|
|
toolTipControl.ShowForm(textArea, logicPos); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -338,9 +337,33 @@ namespace ICSharpCode.Core |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception ex) { |
|
|
|
} catch (Exception ex) { |
|
|
|
ICSharpCode.Core.MessageService.ShowError(ex); |
|
|
|
ICSharpCode.Core.MessageService.ShowError(ex); |
|
|
|
|
|
|
|
} finally { |
|
|
|
|
|
|
|
if (toolTipControl == null && CanCloseOldToolTip) |
|
|
|
|
|
|
|
CloseOldToolTip(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static bool CanCloseOldToolTip { |
|
|
|
|
|
|
|
get { |
|
|
|
|
|
|
|
return oldToolTipControl != null && oldToolTipControl.AllowClose; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void CloseOldToolTip() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (oldToolTipControl != null) { |
|
|
|
|
|
|
|
Form frm = oldToolTipControl.FindForm(); |
|
|
|
|
|
|
|
if (frm != null) frm.Close(); |
|
|
|
|
|
|
|
oldToolTipControl = null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void TextAreaMouseLeave(object source, EventArgs e) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (CanCloseOldToolTip && !oldToolTipControl.IsMouseOver) |
|
|
|
|
|
|
|
CloseOldToolTip(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static string GetText(ResolveResult result, string expression, out bool debuggerCanShowValue) |
|
|
|
static string GetText(ResolveResult result, string expression, out bool debuggerCanShowValue) |
|
|
|
{ |
|
|
|
{ |
|
|
|
debuggerCanShowValue = false; |
|
|
|
debuggerCanShowValue = false; |
|
|
|
|