Ejemplo n.º 1
0
        private void ScTextView_MouseDown(object sender, ScMouseEventArgs e)
        {
            metricsList = null;
            Focus();

            hitTestMetrics[0] = CurrentTextLayout.HitTestPoint(
                (float)e.Location.X,
                (float)e.Location.Y,
                out isTrailingHit[0],
                out isInside[0]);

            hitTestMetrics[1] = hitTestMetrics[0];
            isInside[1]       = isInside[0];
            isTrailingHit[1]  = isTrailingHit[0];
            cursorIdx         = 0;

            int x = (int)Math.Round(hitTestMetrics[cursorIdx].Left);
            int y = (int)Math.Round(hitTestMetrics[cursorIdx].Top);

            SetImeWindowsPos(x, y);



            StopAnim();
            StartAnim();
            Refresh();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Updates the TextFormat and TextLayout.
        /// </summary>
        private void UpdateTextFormatAndLayout()
        {
            try
            {
                if (CurrentTextFormat != null)
                {
                    CurrentTextFormat.Dispose();
                    CurrentTextFormat = null;
                }

                if (CurrentTextLayout != null)
                {
                    CurrentTextLayout.Dispose();
                    CurrentTextLayout = null;
                }

                FontText = "SharpDX - This font was loaded from a resource";

                // Initialize a TextFormat
                CurrentTextFormat = new TextFormat(FactoryDWrite, FontFamilyName, CurrentFontCollection, FontWeight.Normal, FontStyle.Normal, FontStretch.Normal, 64);
                CurrentTextFormat.TextAlignment      = TextAlignment.Center;
                CurrentTextFormat.ParagraphAlignment = ParagraphAlignment.Center;

                CurrentTextLayout = new TextLayout(FactoryDWrite, FontText, CurrentTextFormat, renderControl.ClientSize.Width, renderControl.ClientSize.Height);
            }
            catch (Exception ex)
            {
                LogException(ex);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Updates the size of the font.
 /// </summary>
 private void UpdateFontSize()
 {
     try
     {
         CurrentTextLayout.SetFontSize(FontSize, CurrentTextRange);
     }
     catch (Exception ex)
     {
         LogException(ex);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Updates the underline.
 /// </summary>
 private void UpdateUnderline()
 {
     try
     {
         CurrentTextLayout.SetUnderline(FontIsUnderline, CurrentTextRange);
     }
     catch (Exception ex)
     {
         LogException(ex);
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Updates the italic.
 /// </summary>
 private void UpdateItalic()
 {
     try
     {
         CurrentTextLayout.SetFontStyle(FontIsItalic ? FontStyle.Italic : FontStyle.Normal, CurrentTextRange);
     }
     catch (Exception ex)
     {
         LogException(ex);
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Updates the bold.
 /// </summary>
 private void UpdateBold()
 {
     try
     {
         CurrentTextLayout.SetFontWeight(FontIsBold ? FontWeight.Bold : FontWeight.Normal, CurrentTextRange);
     }
     catch (Exception ex)
     {
         LogException(ex);
     }
 }
Ejemplo n.º 7
0
        void DownDirBtn(int dir)
        {
            metricsList = null;

            if (dir == -1)
            {
                if (isTrailingHit[0] == false)
                {
                    if (hitTestMetrics[0].TextPosition != 0)
                    {
                        metricsList       = CurrentTextLayout.HitTestTextRange(hitTestMetrics[0].TextPosition - 1, 1, 0.0f, 0.0f);
                        hitTestMetrics[0] = metricsList[0];
                    }
                }
                else
                {
                    isTrailingHit[0] = false;
                }
            }
            else
            {
                if (isTrailingHit[0] == false)
                {
                    isTrailingHit[0] = true;
                }
                else
                {
                    if (hitTestMetrics[0].TextPosition != txt.Count() - 1)
                    {
                        metricsList       = CurrentTextLayout.HitTestTextRange(hitTestMetrics[0].TextPosition + 1, 1, 0.0f, 0.0f);
                        hitTestMetrics[0] = metricsList[0];
                    }
                }
            }

            hitTestMetrics[1] = hitTestMetrics[0];
            isTrailingHit[1]  = isTrailingHit[0];
            cursorIdx         = 0;

            int x = (int)Math.Round(hitTestMetrics[cursorIdx].Left);
            int y = (int)Math.Round(hitTestMetrics[cursorIdx].Top);

            SetImeWindowsPos(x, y);

            StopAnim();
            StartAnim();
            Refresh();
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }

                if (CurrentTextFormat != null)
                {
                    CurrentTextFormat.Dispose();
                }

                if (CurrentTextLayout != null)
                {
                    CurrentTextLayout.Dispose();
                }

                if (CustomTextRenderer != null)
                {
                    CustomTextRenderer.Dispose();
                }

                if (SceneColorBrush != null)
                {
                    SceneColorBrush.Dispose();
                }

                if (RenderTarget2D != null)
                {
                    RenderTarget2D.Dispose();
                }

                if (FactoryDWrite != null)
                {
                    FactoryDWrite.Dispose();
                }

                if (Factory2D != null)
                {
                    Factory2D.Dispose();
                }
            }
            base.Dispose(disposing);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Handles the Paint event of the renderControl control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.PaintEventArgs"/> instance containing the event data.</param>
        void RenderControlPaint(object sender, PaintEventArgs e)
        {
            try
            {
                RenderTarget2D.BeginDraw();

                RenderTarget2D.Clear(new Color4(1, 1, 1, 1));

                //RenderTarget2D.DrawTextLayout(new PointF(0, 0), CurrentTextLayout, SceneColorBrush);

                CurrentTextLayout.Draw(CustomTextRenderer, 0, 0);


                RenderTarget2D.EndDraw();
            }
            catch (Exception ex)
            {
                LogException(ex);
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Updates the TextFormat and TextLayout.
        /// </summary>
        private void UpdateTextFormatAndLayout()
        {
            try
            {
                if (CurrentTextFormat != null)
                {
                    CurrentTextFormat.Dispose();
                    CurrentTextFormat = null;
                }

                if (CurrentTextLayout != null)
                {
                    CurrentTextLayout.Dispose();
                    CurrentTextLayout = null;
                }

                // Initialize a TextFormat
                CurrentTextFormat = new TextFormat(FactoryDWrite, FontFamilyName, FontSize)
                {
                    TextAlignment = TextAlignment.Center, ParagraphAlignment = ParagraphAlignment.Center
                };

                CurrentTextLayout = new TextLayout(FactoryDWrite, FontText, CurrentTextFormat, renderControl.Width, renderControl.Height);

                // Set a stylistic typography
                var typo = new Typography(FactoryDWrite);
                typo.AddFontFeature(new FontFeature(FontFeatureTag.StylisticSet7, 1));
                CurrentTextLayout.SetTypography(typo, CurrentTextRange);
                typo.Dispose();

                UpdateBold();
                UpdateItalic();
                UpdateUnderline();
                UpdateFontSize();
            }
            catch (Exception ex)
            {
                LogException(ex);
            }
        }
Ejemplo n.º 11
0
        protected override void OnMouseDown(Document document, ToolMouseEventArgs e)
        {
            ctrlKey = e.IsControlPressed;

            //Store the mouse position.
            Point pt = e.PointDouble.ToGdkPoint();

            // Grab focus so we can get keystrokes
            imContext.FocusIn();

            if (selection != null)
            {
                selection.Dispose();
            }
            selection = document.Selection.Clone();

            // A right click allows you to move the text around
            if (e.MouseButton == MouseButton.Right)
            {
                //The user is dragging text with the right mouse button held down, so track the mouse as it moves.
                tracking = true;

                //Remember the position of the mouse before the text is dragged.
                startMouseXY    = e.PointDouble;
                startClickPoint = clickPoint;

                //Change the cursor to indicate that the text is being dragged.
                SetCursor(cursor_hand);

                return;
            }

            // The user clicked the left mouse button
            if (e.MouseButton == MouseButton.Left)
            {
                // If the user is [editing or holding down Ctrl] and clicked
                //within the text, move the cursor to the click location
                if ((is_editing || ctrlKey) && CurrentTextBounds.ContainsCorrect(pt))
                {
                    StartEditing();

                    //Change the position of the cursor to where the mouse clicked.
                    TextPosition p = CurrentTextLayout.PointToTextPosition(pt);
                    CurrentTextEngine.SetCursorPosition(p, true);

                    //Redraw the text with the new cursor position.
                    RedrawText(true, true);

                    return;
                }

                // We're already editing and the user clicked outside the text,
                // commit the user's work, and start a new edit
                switch (CurrentTextEngine.State)
                {
                // We were editing, save and stop
                case TextMode.Uncommitted:
                    StopEditing(true);
                    break;

                // We were editing, but nothing had been
                // keyed. Stop editing.
                case TextMode.Unchanged:
                    StopEditing(false);
                    break;
                }

                if (ctrlKey)
                {
                    //Go through every UserLayer.
                    foreach (UserLayer ul in document.Layers.UserLayers)
                    {
                        //Check each UserLayer's editable text boundaries to see if they contain the mouse position.
                        if (ul.textBounds.ContainsCorrect(pt))
                        {
                            //The mouse clicked on editable text.

                            //Change the current UserLayer to the Layer that contains the text that was clicked on.
                            document.Layers.SetCurrentUserLayer(ul);

                            //The user is editing text now.
                            is_editing = true;

                            //Set the cursor in the editable text where the mouse was clicked.
                            TextPosition p = CurrentTextLayout.PointToTextPosition(pt);
                            CurrentTextEngine.SetCursorPosition(p, true);

                            //Redraw the editable text with the cursor.
                            RedrawText(true, true);

                            //Don't check any more UserLayers - stop at the first UserLayer that has editable text containing the mouse position.
                            return;
                        }
                    }
                }
                else
                {
                    if (CurrentTextEngine.State == TextMode.NotFinalized)
                    {
                        //The user is making a new text and the old text hasn't been finalized yet.
                        FinalizeText();
                    }

                    if (!is_editing)
                    {
                        // Start editing at the cursor location
                        clickPoint = pt;
                        CurrentTextEngine.Clear();
                        UpdateFont();
                        clickPoint.Offset(0, -CurrentTextLayout.FontHeight / 2);
                        CurrentTextEngine.Origin = clickPoint;
                        StartEditing();
                        RedrawText(true, true);
                    }
                }
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Draws the text.
        /// </summary>
        /// <param name="showCursor">Whether or not to show the mouse cursor in the drawing.</param>
        /// <param name="useTextLayer">Whether or not to use the TextLayer (as opposed to the Userlayer).</param>
        private void RedrawText(bool showCursor, bool useTextLayer)
        {
            Rectangle r = CurrentTextLayout.GetLayoutBounds();

            r.Inflate(10 + OutlineWidth, 10 + OutlineWidth);
            InflateAndInvalidate(r);
            CurrentTextBounds = r;

            Rectangle cursorBounds = Rectangle.Zero;

            Cairo.ImageSurface surf;

            if (!useTextLayer)
            {
                //Draw text on the current UserLayer's surface as finalized text.
                surf = PintaCore.Workspace.ActiveDocument.Layers.CurrentUserLayer.Surface;
            }
            else
            {
                //Draw text on the current UserLayer's TextLayer's surface as re-editable text.
                surf = PintaCore.Workspace.ActiveDocument.Layers.CurrentUserLayer.TextLayer.Layer.Surface;

                ClearTextLayer();
            }

            using (var g = new Cairo.Context(surf)) {
                g.Save();

                // Show selection if on text layer
                if (useTextLayer)
                {
                    // Selected Text
                    Cairo.Color c = new Cairo.Color(0.7, 0.8, 0.9, 0.5);
                    foreach (Rectangle rect in CurrentTextLayout.SelectionRectangles)
                    {
                        g.FillRectangle(rect.ToCairoRectangle(), c);
                    }
                }

                if (selection != null)
                {
                    selection.Clip(g);
                }

                g.MoveTo(new Cairo.PointD(CurrentTextEngine.Origin.X, CurrentTextEngine.Origin.Y));

                g.SetSourceColor(PintaCore.Palette.PrimaryColor);

                //Fill in background
                if (BackgroundFill)
                {
                    using (var g2 = new Cairo.Context(surf)) {
                        if (selection != null)
                        {
                            selection.Clip(g2);
                        }

                        g2.FillRectangle(CurrentTextLayout.GetLayoutBounds().ToCairoRectangle(), PintaCore.Palette.SecondaryColor);
                    }
                }

                // Draw the text
                if (FillText)
                {
                    Pango.CairoHelper.ShowLayout(g, CurrentTextLayout.Layout);
                }

                if (FillText && StrokeText)
                {
                    g.SetSourceColor(PintaCore.Palette.SecondaryColor);
                    g.LineWidth = OutlineWidth;

                    Pango.CairoHelper.LayoutPath(g, CurrentTextLayout.Layout);
                    g.Stroke();
                }
                else if (StrokeText)
                {
                    g.SetSourceColor(PintaCore.Palette.PrimaryColor);
                    g.LineWidth = OutlineWidth;

                    Pango.CairoHelper.LayoutPath(g, CurrentTextLayout.Layout);
                    g.Stroke();
                }

                if (showCursor)
                {
                    var loc   = CurrentTextLayout.GetCursorLocation();
                    var color = PintaCore.Palette.PrimaryColor;

                    g.Antialias = Cairo.Antialias.None;
                    g.DrawLine(new Cairo.PointD(loc.X, loc.Y),
                               new Cairo.PointD(loc.X, loc.Y + loc.Height),
                               color, 1);

                    cursorBounds = Rectangle.Inflate(loc, 2, 10);
                }

                g.Restore();


                if (useTextLayer && (is_editing || ctrlKey) && !CurrentTextEngine.IsEmpty())
                {
                    //Draw the text edit rectangle.

                    g.Save();

                    g.Translate(.5, .5);

                    using (Cairo.Path p = g.CreateRectanglePath(CurrentTextBounds.ToCairoRectangle())) {
                        g.AppendPath(p);
                    }

                    g.LineWidth = 1;

                    g.SetSourceColor(new Cairo.Color(1, 1, 1));
                    g.StrokePreserve();

                    g.SetDash(new double[] { 2, 4 }, 0);
                    g.SetSourceColor(new Cairo.Color(1, .1, .2));

                    g.Stroke();

                    g.Restore();
                }
            }

            InflateAndInvalidate(PintaCore.Workspace.ActiveDocument.Layers.CurrentUserLayer.previousTextBounds);
            PintaCore.Workspace.Invalidate(old_cursor_bounds);
            InflateAndInvalidate(r);
            PintaCore.Workspace.Invalidate(cursorBounds);

            old_cursor_bounds = cursorBounds;
        }
Ejemplo n.º 13
0
        private void TxtView_D2DPaint(D2DGraphics g)
        {
            if (!string.IsNullOrWhiteSpace(BackGroundText) && !isHideBackGroundText)
            {
                g.RenderTarget.AntialiasMode = AntialiasMode.PerPrimitive;
                SolidColorBrush brush      = new SolidColorBrush(g.RenderTarget, GDIDataD2DUtils.TransToRawColor4(BackGroundTextColor));
                TextFormat      textFormat = new TextFormat(D2DGraphics.dwriteFactory, foreFont.FamilyName, foreFont.Weight, foreFont.Style, foreFont.Size)
                {
                    TextAlignment = TextAlignment.Leading, ParagraphAlignment = ParagraphAlignment.Center
                };

                textFormat.WordWrapping = WordWrapping.Wrap;

                SharpDX.RectangleF textRegionRect =
                    new SharpDX.RectangleF(0, 0, Width - 1, Height - 1);

                g.RenderTarget.DrawText(BackGroundText, textFormat, textRegionRect, brush, DrawTextOptions.Clip);
            }


            if (metricsList != null)
            {
                g.RenderTarget.AntialiasMode = AntialiasMode.Aliased;


                SharpDX.Direct2D1.Brush brush = new SolidColorBrush(g.RenderTarget, SharpDX.Color.SkyBlue);

                foreach (HitTestMetrics m in metricsList)
                {
                    SharpDX.RectangleF textRegionRect =
                        new SharpDX.RectangleF((float)Math.Ceiling(m.Left), (float)Math.Ceiling(m.Top), (float)Math.Ceiling(m.Width), (float)Math.Ceiling(m.Height));

                    g.RenderTarget.FillRectangle(textRegionRect, brush);
                }
            }

            g.RenderTarget.AntialiasMode = AntialiasMode.PerPrimitive;

            if (CurrentTextLayout != null && scTextRenderer != null)
            {
                CurrentTextLayout.Draw(scTextRenderer, 0, 0);
            }


            if (cursorState == 1)
            {
                g.RenderTarget.AntialiasMode = AntialiasMode.Aliased;

                RawRectangleF rect =
                    new RawRectangleF(
                        hitTestMetrics[cursorIdx].Left,
                        hitTestMetrics[cursorIdx].Top,
                        hitTestMetrics[cursorIdx].Left + hitTestMetrics[cursorIdx].Width,
                        hitTestMetrics[cursorIdx].Top + hitTestMetrics[cursorIdx].Height);

                RawVector2 pt0;
                RawVector2 pt1;

                if (isTrailingHit[cursorIdx] == false)
                {
                    pt0 = new RawVector2((float)Math.Ceiling(rect.Left), (float)Math.Ceiling(rect.Top));
                    pt1 = new RawVector2((float)Math.Ceiling(rect.Left), (float)Math.Ceiling(rect.Bottom));
                }
                else
                {
                    pt0 = new RawVector2((float)Math.Ceiling(rect.Right), (float)Math.Ceiling(rect.Top));
                    pt1 = new RawVector2((float)Math.Ceiling(rect.Right), (float)Math.Ceiling(rect.Bottom));
                }

                RawColor4 color = GDIDataD2DUtils.TransToRawColor4(Color.FromArgb(255, 255, 0, 0));
                SharpDX.Direct2D1.Brush brushx = new SolidColorBrush(g.RenderTarget, color);

                if (pt0.X == 0 && pt1.X == 0)
                {
                    pt1.X = pt0.X = 1;
                }

                g.RenderTarget.DrawLine(pt0, pt1, brushx);
            }
        }
Ejemplo n.º 14
0
        private void TxtView_MouseMove(object sender, ScMouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                hitTestMetrics[1] = CurrentTextLayout.HitTestPoint(
                    (float)e.Location.X,
                    (float)e.Location.Y,
                    out isTrailingHit[1],
                    out isInside[1]);

                HitTestMetrics start, end;
                RawBool        startTrailingHit, endTrailingHit;
                int            startTextPosition, endTextPosition;

                if (hitTestMetrics[1].TextPosition == hitTestMetrics[0].TextPosition &&
                    (isTrailingHit[1] == false && isTrailingHit[0] == true) ||
                    hitTestMetrics[1].TextPosition < hitTestMetrics[0].TextPosition)
                {
                    start             = hitTestMetrics[1];
                    startTextPosition = start.TextPosition;
                    startTrailingHit  = isTrailingHit[1];

                    end             = hitTestMetrics[0];
                    endTextPosition = end.TextPosition;
                    endTrailingHit  = isTrailingHit[0];
                }
                else
                {
                    start             = hitTestMetrics[0];
                    startTextPosition = start.TextPosition;
                    startTrailingHit  = isTrailingHit[0];

                    end             = hitTestMetrics[1];
                    endTextPosition = end.TextPosition;
                    endTrailingHit  = isTrailingHit[1];
                }


                if (startTrailingHit == true)
                {
                    startTextPosition += 1;
                }

                if (endTrailingHit == false)
                {
                    endTextPosition -= 1;
                }

                int len = endTextPosition - startTextPosition + 1;

                if (len > 0)
                {
                    metricsList = CurrentTextLayout.HitTestTextRange(startTextPosition, len, 0.0f, 0.0f);
                }
                else
                {
                    metricsList = null;
                }

                if (metricsList != null)
                {
                    cursorIdx = 1;
                    StopAnim();
                    StartAnim();
                    Refresh();
                }
            }
        }
Ejemplo n.º 15
0
        void AddNewText(string newText)
        {
            HitTestMetrics start, end;
            RawBool        startTrailingHit, endTrailingHit;
            int            startTextPosition, endTextPosition;
            string         a = "", b = "";
            int            newHitIdx = 0;

            if (hitTestMetrics[1].TextPosition == hitTestMetrics[0].TextPosition &&
                (isTrailingHit[1] == false && isTrailingHit[0] == true) ||
                hitTestMetrics[1].TextPosition < hitTestMetrics[0].TextPosition)
            {
                start             = hitTestMetrics[1];
                startTextPosition = start.TextPosition;
                startTrailingHit  = isTrailingHit[1];

                end             = hitTestMetrics[0];
                endTextPosition = end.TextPosition;
                endTrailingHit  = isTrailingHit[0];
            }
            else
            {
                start             = hitTestMetrics[0];
                startTextPosition = start.TextPosition;
                startTrailingHit  = isTrailingHit[0];

                end             = hitTestMetrics[1];
                endTextPosition = end.TextPosition;
                endTrailingHit  = isTrailingHit[1];
            }

            if (string.IsNullOrWhiteSpace(txt))
            {
                a = "";
                b = "";
            }
            else if (startTextPosition == endTextPosition && startTrailingHit == false && endTrailingHit == false)   //点击前端
            {
                int pos = startTextPosition;
                a = txt.Substring(0, pos);
                b = txt.Substring(pos, txt.Length - pos);
            }
            else if (startTextPosition == endTextPosition && startTrailingHit == true && endTrailingHit == false) //点击后端
            {
                int pos = startTextPosition + 1;
                a = txt.Substring(0, pos);
                b = txt.Substring(pos, txt.Length - pos);
            }
            else if (startTrailingHit == true && endTrailingHit == true) //开始位置"后端", 结束位置"后端"
            {
                a = txt.Substring(0, startTextPosition + 1);
                b = txt.Substring(endTextPosition + 1, txt.Length - endTextPosition - 1);
            }
            else if (startTrailingHit == true && endTrailingHit == false) //开始位置"后端", 结束位置"前端"
            {
                a = txt.Substring(0, startTextPosition + 1);
                b = txt.Substring(endTextPosition, txt.Length - endTextPosition);
            }
            else if (startTrailingHit == false && endTrailingHit == true) //开始位置"前端", 结束位置"后端"
            {
                a = txt.Substring(0, startTextPosition);
                b = txt.Substring(endTextPosition + 1, txt.Length - endTextPosition - 1);
            }
            else if (startTrailingHit == false && endTrailingHit == false) //开始位置"前端", 结束位置"前端"
            {
                a = txt.Substring(0, startTextPosition);
                b = txt.Substring(endTextPosition, txt.Length - endTextPosition);
            }

            RectangleF oldrc = DrawBox;

            txt = a + newText + b;

            CreateD2D();
            InitTextFormatLayout();

            newHitIdx = a.Count() + newText.Count();

            if (newHitIdx < 0)
            {
                newHitIdx = 0;
            }

            metricsList = CurrentTextLayout.HitTestTextRange(newHitIdx, 1, 0.0f, 0.0f);

            hitTestMetrics[1] = hitTestMetrics[0] = metricsList[0];
            isInside[1]       = isInside[0];
            isTrailingHit[1]  = isTrailingHit[0] = false;
            cursorIdx         = 0;

            metricsList = null;

            int x = (int)Math.Round(hitTestMetrics[cursorIdx].Left);
            int y = (int)Math.Round(hitTestMetrics[cursorIdx].Top);

            SetImeWindowsPos(x, y);


            if (CursorPositionEvent != null)
            {
                RectangleF rect =
                    new RectangleF(
                        hitTestMetrics[cursorIdx].Left,
                        hitTestMetrics[cursorIdx].Top,
                        hitTestMetrics[cursorIdx].Width,
                        hitTestMetrics[cursorIdx].Height);

                CursorPositionEvent(rect);
            }

            if (TextViewValueChangedEvent != null)
            {
                TextViewValueChangedEvent(this);
            }


            InvalidateGlobalRect(GDIDataD2DUtils.UnionRectF(oldrc, DrawBox));
        }