Exemple #1
0
        public override void PaintValue(PaintValueEventArgs e)
        {
            MindFusion.FlowChartX.Pen pen =
                e.Value as MindFusion.FlowChartX.Pen;

            if (pen == null)
            {
                return;
            }

            try
            {
                // Be careful with pens...
                System.Drawing.Pen gdiPen = pen.CreateGDIPen();
                e.Graphics.DrawLine(gdiPen,
                                    e.Bounds.Left, e.Bounds.Top + e.Bounds.Height / 2,
                                    e.Bounds.Right - 1, e.Bounds.Top + e.Bounds.Height / 2);
                gdiPen.Dispose();
            }
            catch
            {
#if DEBUG
                System.Diagnostics.Debug.WriteLine("Shift!");
#endif
            }
        }
        private void SerializePen(CodeStatementCollection code,
                                  string property, FlowChart chart, MindFusion.FlowChartX.Pen pen)
        {
            string         representation;
            CodeExpression left  = null;
            CodeExpression right = null;
            CodeStatement  line  = null;

            representation = Pen.Serialize(pen);

            left =
                new CodePropertyReferenceExpression(
                    new CodeFieldReferenceExpression(
                        new CodeThisReferenceExpression(), chart.Name),
                    property);
            right =
                new CodeMethodInvokeExpression(
                    new CodeMethodReferenceExpression(
                        new CodeTypeReferenceExpression("MindFusion.FlowChartX.Pen"),
                        "Deserialize"),
                    new CodeExpression[]
            {
                new CodePrimitiveExpression(representation)
            });
            line = new CodeAssignStatement(left, right);

            code.Add(line);
        }
Exemple #3
0
 /// <summary>
 /// Updates the currently displayed dash pattern
 /// to match the one of the specified pen.
 /// </summary>
 public void SetDashPattern(MindFusion.FlowChartX.Pen pen)
 {
     if (pen.DashPattern != null)
     {
         SetDashPattern(pen.DashPattern);
     }
 }
Exemple #4
0
        internal virtual void restoreProperties(ItemProperties props)
        {
            fillColor     = props.fillColor;
            frameColor    = props.frameColor;
            ignoreLayout  = props.ignoreLayout;
            invisible     = props.invisible;
            locked        = props.locked;
            penDashStyle  = props.penDashStyle;
            penWidth      = props.penWidth;
            shadowColor   = props.shadowColor;
            shadowOffsetX = props.shadowOffsetX;
            shadowOffsetY = props.shadowOffsetY;
            tag           = props.tag;
            toolTip       = props.toolTip;

            pen = (Pen)props.pen.Clone();
            brush.Release();
            brush = props.brush;
            brush.AddRef();

            printable = props.printable;
            weight    = props.weight;
            hyperLink = props.hyperLink;

            restoreState(props.itemState);
        }
Exemple #5
0
        /// <summary>
        /// Updates the dash pattern of the specified pen
        /// to the one currently displayed in the control.
        /// </summary>
        public void GetDashPattern(MindFusion.FlowChartX.Pen pen)
        {
            float[] pattern = GetDashPattern(true);

            if (pattern == null)
            {
                pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
                return;
            }

            pen.DashPattern = pattern;
        }
Exemple #6
0
        private void UpdatePreview()
        {
            MindFusion.FlowChartX.Pen pen = Pen;
            if (pen == null)
            {
                return;
            }

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

            _temp        = pen.CreateGDIPen(RectangleF.Empty);
            _preview.Pen = _temp;
        }
Exemple #7
0
		internal virtual void restoreProperties(ItemProperties props)
		{
			fillColor = props.fillColor;
			frameColor = props.frameColor;
			ignoreLayout = props.ignoreLayout;
			invisible = props.invisible;
			locked = props.locked;
			penDashStyle = props.penDashStyle;
			penWidth = props.penWidth;
			shadowColor = props.shadowColor;
			shadowOffsetX = props.shadowOffsetX;
			shadowOffsetY = props.shadowOffsetY;
			tag = props.tag;
			toolTip = props.toolTip;

			pen = (Pen)props.pen.Clone();
			brush.Release();
			brush = props.brush;
			brush.AddRef();

			printable = props.printable;
			weight = props.weight;
			hyperLink = props.hyperLink;

			restoreState(props.itemState);
		}
Exemple #8
0
		internal override void restoreProperties(ItemProperties props)
		{
			ArrowProperties aprops = (ArrowProperties)props;

			allowMoveStart = aprops.allowMoveStart;
			allowMoveEnd = aprops.allowMoveEnd;
			ArrowHead = aprops.arrowHead;
			ArrowBase = aprops.arrowBase;
			IntermArrowHead = aprops.arrowInterm;
			autoRoute = aprops.autoRoute;
			dynamic = aprops.dynamic;
			ArrowHeadSize = aprops.headSize;
			ArrowBaseSize = aprops.baseSize;
			IntermHeadSize = aprops.intermSize;
			penColor = aprops.penColor;
			cascadeOrientation = aprops.cascadeOrientation;
			retainForm = aprops.retainForm;
			text = aprops.text;
			textColor = aprops.textColor;
			textStyle = aprops.textStyle;
			customDraw = aprops.customDraw;
			snapToNodeBorder = aprops.snapToNodeBorder;
			selStyle = aprops.selStyle;
			drawCrossings = aprops.drawCrossings;

			headPen = (MindFusion.FlowChartX.Pen)aprops.headPen.Clone();

			base.restoreProperties(props);
		}