From 0714077c4317cc3e24c6498c77299e6dba772d1e Mon Sep 17 00:00:00 2001 From: test Date: Wed, 23 Dec 2020 19:48:53 +0900 Subject: [PATCH] =?utf8?q?=E3=83=89=E3=83=A9=E3=83=83=E3=82=B0=E3=81=97?= =?utf8?q?=E3=81=AA=E3=81=8C=E3=82=89=E3=81=AE=E9=81=B8=E6=8A=9E=E3=81=8C?= =?utf8?q?=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=8F=E3=81=AA=E3=82=8B=E3=81=AE?= =?utf8?q?=E3=81=A7=E5=85=83=E3=81=AB=E6=88=BB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- UWP/FooEditEngine.UWP/FooTextBox.cs | 14 ++++++++++++++ WPF/FooEditEngine/FooTextBox.cs | 8 ++++++++ Windows/FooEditEngine/FooTextBox.cs | 6 ++++++ 3 files changed, 28 insertions(+) diff --git a/UWP/FooEditEngine.UWP/FooTextBox.cs b/UWP/FooEditEngine.UWP/FooTextBox.cs index c26e26b..71da92f 100644 --- a/UWP/FooEditEngine.UWP/FooTextBox.cs +++ b/UWP/FooEditEngine.UWP/FooTextBox.cs @@ -1174,6 +1174,20 @@ namespace FooEditEngine.UWP void gestureRecongnizer_Dragging(GestureRecognizer sender, DraggingEventArgs e) { + Point p = e.Position; + TextPointSearchRange searchRange; + if (this.View.HitTextArea(p.X, p.Y)) + searchRange = TextPointSearchRange.TextAreaOnly; + else if (this._Controller.SelectionLength > 0) + searchRange = TextPointSearchRange.Full; + else + return; + TextPoint tp = this.View.GetTextPointFromPostion(p, searchRange); + this._Controller.MoveCaretAndSelect(tp, this.IsModiferKeyPressed(VirtualKey.LeftControl)); +#if ENABLE_AUTMATION + if (this.peer != null) + this.peer.OnNotifyCaretChanged(); +#endif this.Refresh(); } diff --git a/WPF/FooEditEngine/FooTextBox.cs b/WPF/FooEditEngine/FooTextBox.cs index c874899..30a3bb8 100644 --- a/WPF/FooEditEngine/FooTextBox.cs +++ b/WPF/FooEditEngine/FooTextBox.cs @@ -975,6 +975,14 @@ namespace FooEditEngine.WPF { this.Cursor = Cursors.Arrow; } + if (leftPressed) + { + bool controlPressed = (Keyboard.GetKeyStates(Key.LeftCtrl) & KeyStates.Down) == KeyStates.Down; + this._Controller.MoveCaretAndSelect(tp, controlPressed); + if (this.peer != null) + this.peer.OnNotifyCaretChanged(); + this.Refresh(); + } } Gripper hittedGripper; diff --git a/Windows/FooEditEngine/FooTextBox.cs b/Windows/FooEditEngine/FooTextBox.cs index 71dc24f..0b7c134 100644 --- a/Windows/FooEditEngine/FooTextBox.cs +++ b/Windows/FooEditEngine/FooTextBox.cs @@ -1200,6 +1200,12 @@ namespace FooEditEngine.Windows this.Cursor = Cursors.Hand; else this.Cursor = Cursors.IBeam; + + if (e.Button == MouseButtons.Left) + { + this.Controller.MoveCaretAndSelect(tp, ModifierKeys.HasFlag(Keys.Control)); + this.Refresh(); + } } else { -- 2.11.0