@ -29,12 +29,12 @@ namespace ICSharpCode.TextEditor
@@ -29,12 +29,12 @@ namespace ICSharpCode.TextEditor
[ToolboxItem(false)]
public class TextArea : Control
{
internal bool H iddenMouseCursor = false ;
bool h iddenMouseCursor = false ;
/// <summary>
/// The position where the mouse cursor was when it was hidden. Sometimes the text editor gets MouseMove
/// events when typing text even if the mouse is not moved.
/// </summary>
internal Point M ouseCursorHidePosition;
Point m ouseCursorHidePosition;
Point virtualTop = new Point ( 0 , 0 ) ;
TextAreaControl motherTextAreaControl ;
@ -315,6 +315,20 @@ namespace ICSharpCode.TextEditor
@@ -315,6 +315,20 @@ namespace ICSharpCode.TextEditor
}
}
/// <summary>
/// Shows the mouse cursor if it has been hidden.
/// </summary>
/// <param name="forceShow"><c>true</c> to always show the cursor or <c>false</c> to show it only if it has been moved since it was hidden.</param>
internal void ShowHiddenCursor ( bool forceShow )
{
if ( hiddenMouseCursor ) {
if ( mouseCursorHidePosition ! = Cursor . Position | | forceShow ) {
Cursor . Show ( ) ;
hiddenMouseCursor = false ;
}
}
}
// 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.
@ -576,10 +590,10 @@ namespace ICSharpCode.TextEditor
@@ -576,10 +590,10 @@ namespace ICSharpCode.TextEditor
return ;
}
if ( ! H iddenMouseCursor & & TextEditorProperties . HideMouseCursor ) {
if ( ! h iddenMouseCursor & & TextEditorProperties . HideMouseCursor ) {
if ( this . ClientRectangle . Contains ( PointToClient ( Cursor . Position ) ) ) {
M ouseCursorHidePosition = Cursor . Position ;
H iddenMouseCursor = true ;
m ouseCursorHidePosition = Cursor . Position ;
h iddenMouseCursor = true ;
Cursor . Hide ( ) ;
}
}