/// <summary>
        /// Adds TextBox
        /// </summary>
        public void addTextBox(int x, int y, int x1, int y1, RichTextBox t, Color penC, Color fillC, float penW,
                               bool filled)
        {
            if (x1 - minDim <= x)
            {
                x1 = x + minDim;
            }
            if (y1 - minDim <= y)
            {
                y1 = y + minDim;
            }

            deSelect();
            var r = new BoxText(x, y, x1, y1)
            {
                PenColor  = penC,
                PenWidth  = penW,
                FillColor = fillC,
                IsFilled  = filled,
                rtf       = t.Rtf
            };

            //Stext r = new Stext(x, y, x1, y1);

            List.Add(r);
            // store the operation in undo/redo buffer
            storeDo("I", r);

            sRec            = new SelRect(r);
            selectedElement = r;
            selectedElement.Select();
        }
示例#2
0
        public override Element Copy()
        {
            var newE = new BoxText(Location0.X, Location0.Y, Location1.X, Location1.Y)
            {
                PenColor   = PenColor,
                PenWidth   = PenWidth,
                FillColor  = FillColor,
                IsFilled   = IsFilled,
                IsLine     = IsLine,
                Alpha      = Alpha,
                dashStyle  = dashStyle,
                ShowBorder = ShowBorder,
                OnGrpXRes  = OnGrpXRes,
                OnGrpX1Res = OnGrpX1Res,
                OnGrpYRes  = OnGrpYRes,
                OnGrpY1Res = OnGrpY1Res
            };

            newE.copyGradprop(this);

            newE.rtf = rtf;

            return(newE);
        }