From ade3d2356b8fa5b68453cad9032caafbbd5e0190 Mon Sep 17 00:00:00 2001 From: konekoneko Date: Tue, 4 Oct 2016 18:03:30 +0530 Subject: [PATCH] =?utf8?q?=E3=83=87=E3=83=90=E3=83=83=E3=82=AF=E3=83=AC?= =?utf8?q?=E3=83=B3=E3=83=80=E3=83=BC=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=97?= =?utf8?q?=E3=81=A6=E3=82=82=E3=81=9D=E3=81=AE=E3=81=BE=E3=81=BE=E5=8B=95?= =?utf8?q?=E3=81=8F=E3=82=88=E3=81=86=E3=81=AB=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 | 53 ++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/UWP/FooEditEngine.UWP/FooTextBox.cs b/UWP/FooEditEngine.UWP/FooTextBox.cs index 79ff9d2..c4172c1 100644 --- a/UWP/FooEditEngine.UWP/FooTextBox.cs +++ b/UWP/FooEditEngine.UWP/FooTextBox.cs @@ -8,6 +8,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ + using System; using System.Text; using System.ComponentModel; @@ -39,7 +40,11 @@ namespace FooEditEngine.UWP { EditView View; Controller _Controller; +#if !DUMMY_RENDER D2DRender Render; +#else + DummyRender Render; +#endif ScrollBar horizontalScrollBar, verticalScrollBar; Windows.UI.Xaml.Shapes.Rectangle rectangle; GestureRecognizer gestureRecongnizer = new GestureRecognizer(); @@ -62,7 +67,11 @@ namespace FooEditEngine.UWP this.rectangle = new Windows.UI.Xaml.Shapes.Rectangle(); this.rectangle.Margin = this.Padding; +#if !DUMMY_RENDER this.Render = new D2DRender(this,this.rectangle); +#else + this.Render = new DummyRender(); +#endif this.Document = new Document(); @@ -1296,7 +1305,6 @@ namespace FooEditEngine.UWP /// public static void OnPropertyChanged(object sender, DependencyPropertyChangedEventArgs e) { -#if !DUMMY_RENDER FooTextBox source = (FooTextBox)sender; if(e.Property.Equals(SelectedTextProperty) && !source.nowCaretMove) source._Controller.SelectedText = source.SelectedText; @@ -1304,8 +1312,6 @@ namespace FooEditEngine.UWP source.SetDocument(source.Document); if(e.Property.Equals(HilighterProperty)) source.View.Hilighter = source.Hilighter; - if (e.Property.Equals(TextAntialiasModeProperty)) - source.Render.TextAntialiasMode = source.TextAntialiasMode; if (e.Property.Equals(FoldingStrategyProperty)) source.View.LayoutLines.FoldingStrategy = source.FoldingStrategy; if (e.Property.Equals(IndentModeProperty)) @@ -1326,6 +1332,26 @@ namespace FooEditEngine.UWP source.View.HideLineMarker = !source.DrawCaretLine; if (e.Property.Equals(DrawLineNumberProperty)) source.Document.DrawLineNumber = source.DrawLineNumber; + if (e.Property.Equals(MarkURLProperty)) + source.Document.UrlMark = source.MarkURL; + if (e.Property.Equals(LineBreakProperty)) + source.Document.LineBreak = source.LineBreakMethod; + if (e.Property.Equals(LineBreakCharCountProperty)) + source.Document.LineBreakCharCount = source.LineBreakCharCount; + if (e.Property.Equals(FlowDirectionProperty)) + { + source.Document.RightToLeft = source.FlowDirection == Windows.UI.Xaml.FlowDirection.RightToLeft; + if (source.horizontalScrollBar != null) + source.horizontalScrollBar.FlowDirection = source.FlowDirection; + } + if (e.Property.Equals(DrawRulerProperty)) + { + source.Document.HideRuler = !source.DrawRuler; + source._Controller.JumpCaret(source.Document.CaretPostion.row, source.Document.CaretPostion.col); + } +#if !DUMMY_RENDER + if (e.Property.Equals(TextAntialiasModeProperty)) + source.Render.TextAntialiasMode = source.TextAntialiasMode; if(e.Property.Equals(MagnificationPowerPropertyKey)) source.Render.FontSize = source.FontSize * source.MagnificationPower; if (e.Property.Equals(FontFamilyProperty)) @@ -1362,8 +1388,6 @@ namespace FooEditEngine.UWP source.View.Padding = new Padding((int)source.Padding.Left, (int)source.Padding.Top, (int)source.Padding.Right, (int)source.Padding.Bottom); if (e.Property.Equals(LineMarkerProperty)) source.Render.LineMarker = D2DRenderBase.ToColor4(source.LineMarker); - if (e.Property.Equals(MarkURLProperty)) - source.Document.UrlMark = source.MarkURL; if (e.Property.Equals(ShowFullSpaceProperty)) source.Render.ShowFullSpace = source.ShowFullSpace; if (e.Property.Equals(ShowHalfSpaceProperty)) @@ -1372,30 +1396,15 @@ namespace FooEditEngine.UWP source.Render.ShowTab = source.ShowTab; if (e.Property.Equals(ShowLineBreakProperty)) source.Render.ShowLineBreak = source.ShowLineBreak; - if (e.Property.Equals(LineBreakProperty)) - source.Document.LineBreak = source.LineBreakMethod; - if (e.Property.Equals(LineBreakCharCountProperty)) - source.Document.LineBreakCharCount = source.LineBreakCharCount; if (e.Property.Equals(UpdateAreaProperty)) source.Render.UpdateArea = D2DRenderBase.ToColor4(source.UpdateArea); if (e.Property.Equals(LineNumberProperty)) source.Render.LineNumber = D2DRenderBase.ToColor4(source.LineNumber); - if (e.Property.Equals(FlowDirectionProperty)) - { - source.Document.RightToLeft = source.FlowDirection == Windows.UI.Xaml.FlowDirection.RightToLeft; - if(source.horizontalScrollBar != null) - source.horizontalScrollBar.FlowDirection = source.FlowDirection; - } - if (e.Property.Equals(DrawRulerProperty)) - { - source.Document.HideRuler = !source.DrawRuler; - source._Controller.JumpCaret(source.Document.CaretPostion.row, source.Document.CaretPostion.col); - } #endif } -#endregion + #endregion -#region event + #region event /// /// コンテキストメニューが表示されるときに呼び出されます -- 2.11.0