Пример #1
0
        private void cboLineSpacingStyle_SelectedIndexChanged(object sender, EventArgs e)
        {
            LineSpacingStyle style = (LineSpacingStyle)cboLineSpacingStyle.SelectedIndex;

            switch (style)
            {
            case LineSpacingStyle.SpaceSingle:
            case LineSpacingStyle.Space1pt5:
            case LineSpacingStyle.SpaceDouble:
            case LineSpacingStyle.SpaceExactly:
                txtLineSpacing.Value     = 0;
                txtLineSpacing.Enabled   = false;
                txtLineSpacing.Increment = 1m;
                lblBang.Visible          = false;
                break;

            case LineSpacingStyle.SpaceSpecify:
                txtLineSpacing.Enabled   = true;
                txtLineSpacing.Value     = (decimal)(GraphicsUnitConvert.ToTwips(_CommandParameter.LineSpacing, GraphicsUnit.Document) / 20.0);
                txtLineSpacing.Increment = 1m;
                lblBang.Visible          = true;
                break;

            case LineSpacingStyle.SpaceMultiple:
                txtLineSpacing.Value     = 3;
                txtLineSpacing.Increment = 0.25m;
                lblBang.Visible          = false;
                txtLineSpacing.Enabled   = true;
                break;
            }
        }
Пример #2
0
        public override void CopyFrom(DxfHandledObject from, CloneContext cloneContext)
        {
            base.CopyFrom(from, cloneContext);
            DxfMText dxfMtext = (DxfMText)from;

            this.string_1              = dxfMtext.string_1;
            this.Style                 = Class906.GetTextStyle(cloneContext, dxfMtext.Style);
            this.point3D_0             = dxfMtext.point3D_0;
            this.double_1              = dxfMtext.double_1;
            this.double_2              = dxfMtext.double_2;
            this.double_3              = dxfMtext.double_3;
            this.attachmentPoint_0     = dxfMtext.attachmentPoint_0;
            this.drawingDirection_0    = dxfMtext.drawingDirection_0;
            this.vector3D_0            = dxfMtext.vector3D_0;
            this.vector3D_1            = dxfMtext.vector3D_1;
            this.lineSpacingStyle_0    = dxfMtext.lineSpacingStyle_0;
            this.double_4              = dxfMtext.double_4;
            this.backgroundFillFlags_0 = dxfMtext.backgroundFillFlags_0;
            if (dxfMtext.backgroundFillInfo_0 == null)
            {
                this.backgroundFillInfo_0 = (BackgroundFillInfo)null;
            }
            else
            {
                this.backgroundFillInfo_0 = dxfMtext.backgroundFillInfo_0.Clone(cloneContext);
            }
        }
Пример #3
0
 public Class1023(
     Class1023.Class1024 paragraphFormat,
     double lineSpacingFactor,
     LineSpacingStyle lineSpacingStyle,
     Class596 settings)
 {
     this.class1024_0        = paragraphFormat;
     this.double_0           = lineSpacingFactor;
     this.lineSpacingStyle_0 = lineSpacingStyle;
     this.class596_0         = new Class596(settings);
     this.method_0(settings);
 }
Пример #4
0
 public Class427(double lineSpacingFactor, LineSpacingStyle lineSpacingStyle, Class596 settings)
     : base(settings)
 {
     this.double_0           = lineSpacingFactor;
     this.lineSpacingStyle_0 = lineSpacingStyle;
 }
Пример #5
0
        internal static IList <Class908> smethod_1(
            string text,
            double width,
            double height,
            AttachmentPoint attachmentPoint,
            double lineSpacingFactor,
            LineSpacingStyle lineSpacingStyle,
            DxfTextStyle style,
            double widthFactor,
            Color color,
            DrawingDirection drawingDirection,
            short lineWeight,
            Matrix4D insertionTransformation,
            Class985 resultLayoutInfo,
            Enum24 whiteSpaceHandlingFlags)
        {
            Class1023[]      class1023Array = Class594.smethod_12(text, width, height, attachmentPoint, lineSpacingFactor, lineSpacingStyle, style, widthFactor, color, drawingDirection);
            Vector2D         zero           = Vector2D.Zero;
            IList <Class908> class908List   = (IList <Class908>) new List <Class908>();
            Bounds2D         bounds         = new Bounds2D();

            foreach (Class1023 class1023 in class1023Array)
            {
                class1023.imethod_0(ref zero, class1023.Settings.Height, whiteSpaceHandlingFlags);
                bounds.Update(class1023.GetBounds(whiteSpaceHandlingFlags, resultLayoutInfo));
            }
            double num1 = 0.0;
            double num2 = 0.0;

            if (bounds.Initialized)
            {
                switch (attachmentPoint)
                {
                case AttachmentPoint.TopLeft:
                    num1 = -bounds.Corner1.X;
                    num2 = -bounds.Corner2.Y;
                    break;

                case AttachmentPoint.TopCenter:
                    num1 = -bounds.Center.X;
                    num2 = -bounds.Corner2.Y;
                    break;

                case AttachmentPoint.TopRight:
                    num1 = -bounds.Corner2.X;
                    num2 = -bounds.Corner2.Y;
                    break;

                case AttachmentPoint.MiddleLeft:
                    num1 = -bounds.Corner1.X;
                    num2 = -bounds.Center.Y;
                    break;

                case AttachmentPoint.MiddleCenter:
                    num1 = -bounds.Center.X;
                    num2 = -bounds.Center.Y;
                    break;

                case AttachmentPoint.MiddleRight:
                    num1 = -bounds.Corner2.X;
                    num2 = -bounds.Center.Y;
                    break;

                case AttachmentPoint.BottomLeft:
                    num1 = -bounds.Corner1.X;
                    num2 = -bounds.Corner1.Y;
                    break;

                case AttachmentPoint.BottomCenter:
                    num1 = -bounds.Center.X;
                    num2 = -bounds.Corner1.Y;
                    break;

                case AttachmentPoint.BottomRight:
                    num1 = -bounds.Corner2.X;
                    num2 = -bounds.Corner1.Y;
                    break;
                }
            }
            if (width == 0.0)
            {
                num1 = 0.0;
            }
            Vector2D vector2D = new Vector2D(num1, num2);

            foreach (Class1023 class1023 in class1023Array)
            {
                class1023.Offset += vector2D;
                class1023.imethod_3((ICollection <Class908>)class908List, insertionTransformation, lineWeight);
            }
            if (resultLayoutInfo != null)
            {
                bounds.Move(num1, num2);
                resultLayoutInfo.Bounds.Update(bounds);
                if (resultLayoutInfo.FirstLineBounds != null)
                {
                    resultLayoutInfo.FirstLineBounds.Move(num1, num2);
                }
                if (resultLayoutInfo.LastLineBounds != null && resultLayoutInfo.LastLineBounds != resultLayoutInfo.FirstLineBounds)
                {
                    resultLayoutInfo.LastLineBounds.Move(num1, num2);
                }
            }
            return(class908List);
        }