From e0f9db8b7b8a7cc67f9381422f12f788ed58de0d Mon Sep 17 00:00:00 2001 From: toehead2001 Date: Wed, 24 Apr 2019 12:32:06 -0600 Subject: [PATCH] Add support for SCI_GETFOCUS and SCI_SETFOCUS --- src/ScintillaNET/Scintilla.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/ScintillaNET/Scintilla.cs b/src/ScintillaNET/Scintilla.cs index d71b722..72da426 100644 --- a/src/ScintillaNET/Scintilla.cs +++ b/src/ScintillaNET/Scintilla.cs @@ -4287,6 +4287,25 @@ public int IndicatorValue } } + /// + /// This is used by clients that have complex focus requirements such as having their own window + /// that gets the real focus but with the need to indicate that Scintilla has the logical focus. + /// + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public bool InternalFocusFlag + { + get + { + return (DirectMessage(NativeMethods.SCI_GETFOCUS) != IntPtr.Zero); + } + set + { + var focus = (value ? new IntPtr(1) : IntPtr.Zero); + DirectMessage(NativeMethods.SCI_SETFOCUS, focus); + } + } + /// /// Gets or sets the current lexer. ///