Skip to content

Commit

Permalink
Add _ScintillaManagedDragDrop for making RevokeDragDrop() optional
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmetsait committed Apr 17, 2024
1 parent 7b0357f commit 9995bfc
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Shared/Scintilla.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,8 @@ protected override unsafe void OnHandleCreated(EventArgs e)
// ways to solve this, but my favorite is to revoke drag and drop from the
// native Scintilla control before base.OnHandleCreated does the standard
// processing of AllowDrop.
NativeMethods.RevokeDragDrop(Handle);
if (!this._ScintillaManagedDragDrop)
NativeMethods.RevokeDragDrop(this.Handle);

base.OnHandleCreated(e);
}
Expand Down Expand Up @@ -3276,6 +3277,18 @@ public unsafe void ClearRepresentation(string encodedString)

#region Properties

/// <summary>
/// Gets or sets whether Scintilla's native drag & drop should be used instead of WinForms based one.
/// </summary>
/// <value><c>true</c> if Scintilla's native drag & drop should be used; otherwise, <c>false</c>. The default is false.</value>
[DefaultValue(false)]
[Category("Behaviour")]
[Description("Indicates whether Scintilla's native drag & drop should be used instead of WinForms based one.")]
public bool _ScintillaManagedDragDrop { get; set; }
// Underscore is used so that WinForms Designer sets it before any other
// property. Otherwise ApplyResources gets called on the control before
// the property is set, which then triggers OnHandleCreated before we
// have the final value.

/// <summary>
/// Gets or sets the bi-directionality of the Scintilla control.
Expand Down

0 comments on commit 9995bfc

Please sign in to comment.