Ejemplo n.º 1
0
 protected DrawText(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     if (info == null)
     {
         throw new ArgumentNullException("info");
     }
     try
     {
         _shapeoutline           = new ShapeOutline(this);
         _shapefill              = new ShapeFill(this);
         this.ShapeType          = STATIC_OBJ_TYPE.ID_TEXT;
         TextValue               = info.GetString("TextValue");
         font                    = FontXmlConverter.ConvertToFont(info.GetString("font"));
         Orientation             = (TextOrientation)info.GetInt32("Orientation");
         TextBlinking            = info.GetBoolean("TextBlinking");
         textAlignment           = (TextAlignment)info.GetInt32("textAlignment");
         IsFix                   = info.GetBoolean("IsFix");
         TextColor               = (Color)info.GetValue("TextColor", TextColor.GetType());
         _shapefill.FillColor    = info.GetString("ShapeFill");
         _shapeoutline.LineStyle = info.GetString("shapeoutline");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 2
0
 public void SelecactiveColor(ref Color bcolor, ShapeOutline shapeoutline)
 {
     if (Common.Blinking && shapeoutline.BoarderBlinking)
     {
         bcolor = shapeoutline.BoarderColor2;
     }
     else
     {
         bcolor = shapeoutline.BoarderColor1;
     }
 }
Ejemplo n.º 3
0
        //private Point startPoint;
        //private Point endPoint;
        protected DrawLine(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            if (info == null)
            {
                throw new ArgumentNullException("info");
            }

            _shapeoutline = new ShapeOutline(this);
            startPoint    = (Point)info.GetValue("startPoint", startPoint.GetType());
            endPoint      = (Point)info.GetValue("endPoint", endPoint.GetType());
            _shapeoutline = (ShapeOutline)info.GetValue("shapeoutline", _shapeoutline.GetType());
        }
Ejemplo n.º 4
0
 public DrawPolygon(PageList _parent)
     : base(_parent)
 {
     _shapeoutline = new ShapeOutline(this);
     _shapefill    = new ShapeFill(this);
     Resizeable    = true;
     //pointArray = new ArrayList();
     ShapeType              = STATIC_OBJ_TYPE.ID_POLYGON;
     shapefill.FillColor    = Common.LastFillColor;
     shapeoutline.LineStyle = Common.LastLineStyle;
     Propertylist.Add("BorderWidth,Border Width,DINT");
     Propertylist.Add("BorderColor,Border Color,Color");
     Propertylist.Add("BorderBlinking,Border Blinking,BOOL");
     //LoadCursor();
     Initialize();
 }
Ejemplo n.º 5
0
 public DrawRectangle(PageList _parent)
     : base(_parent)
 {
     _shapeoutline = new ShapeOutline(this);
     _shapefill    = new ShapeFill(this);
     Resizeable    = true;
     SetRectangle(0, 0, 1, 1);
     ShapeType              = STATIC_OBJ_TYPE.ID_RECT;
     shapefill.FillColor    = Common.LastFillColor;
     shapeoutline.LineStyle = Common.LastLineStyle;
     Propertylist.Add("BorderWidth,Border Width,DINT");
     Propertylist.Add("BorderColor,Border Color,Color");
     Propertylist.Add("BorderBlinking,Border Blinking,BOOL");
     Propertylist.Add("Color1,Fill Color 1,Color");
     Propertylist.Add("Color2,Fill Color 2,Color");
     Propertylist.Add("Blinking,Blinking,BOOL");
     Propertylist.Add("Visible,Visible,BOOL");
 }
Ejemplo n.º 6
0
        //private void LoadCursor()
        //{

        //    try
        //    {

        //        handleCursor = new Cursor(Application.StartupPath + "\\Polygon.cur");
        //        //m_Cursor = new Cursor(GetType(), "Rectangle.cur");
        //    }
        //    catch (NullReferenceException e)
        //    {
        //        MessageBox.Show(e.Message.ToString());
        //    }
        //}



        protected DrawPolygon(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            if (info == null)
            {
                throw new ArgumentNullException("info");
            }
            try
            {
                _shapeoutline           = new ShapeOutline(this);
                _shapefill              = new ShapeFill(this);
                this.ShapeType          = STATIC_OBJ_TYPE.ID_POLYLINE;
                Points                  = info.GetString("Points");
                _shapefill.FillColor    = info.GetString("ShapeFill");
                _shapeoutline.LineStyle = info.GetString("shapeoutline");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 7
0
        //public DrawGraphic(PageList _parent,int x, int y, int width, int height)
        //    : base(_parent)
        //{
        //    Resizeable = true;
        //    Center = new Point(x + (width / 2), y + (height / 2));

        //    TipText = String.Format("_rectangle Center @ {0}, {1}", Center.X, Center.Y);
        //}

        //public DrawGraphic(PageList _parent, int x, int y, int width, int height, Color lineColor, Color fillColor)
        //    : base(_parent)
        //{
        //    Resizeable = true;
        //    Center = new Point(x + (width / 2), y + (height / 2));

        //    //shapeoutline.BoarderColor1 = lineColor;
        //    //FillColor11 = fillColor;
        //    //FillType = FillTypePatern.Transparent;
        //    //shapeoutline.BoarderWidth = 1;
        //    TipText = String.Format("_rectangle Center @ {0}, {1}", Center.X, Center.Y);
        //}

        //public DrawGraphic(PageList _parent, int x, int y, int width, int height, Color lineColor, Color fillColor, bool filled)
        //    : base(_parent)
        //{
        //    Resizeable = true;
        //    Center = new Point(x + (width / 2), y + (height / 2));

        //    //BoarderColor1 = lineColor;
        //    //FillColor11 = fillColor;
        //    ////if (filled)
        //    ////{
        //    //FillType = FillTypePatern.Transparent;
        //    //}
        //    //else
        //    //{
        //    //    FillType = 0;
        //    //}
        //    //BoarderWidth = 1;
        //    TipText = String.Format("_rectangle Center @ {0}, {1}", Center.X, Center.Y);
        //}

        //public DrawGraphic(PageList _parent, int x, int y, int width, int height, DrawingPens.PenType pType, Color fillColor, bool filled)
        //    : base(_parent)
        //{
        //    Resizeable = true;
        //    Center = new Point(x + (width / 2), y + (height / 2));

        //    //DrawPen = DrawingPens.SetCurrentPen(pType);
        //    //PenType = pType;
        //    //FillColor11 = fillColor;
        //    //FillType = FillTypePatern.Transparent;
        //    //BoarderWidth = 1;
        //    TipText = String.Format("_rectangle Center @ {0}, {1}", Center.X, Center.Y);
        //}

        //public DrawGraphic(PageList _parent, int x, int y, int width, int height, Color lineColor, Color fillColor, bool filled, int lineWidth)
        //    : base(_parent)
        //{
        //    Resizeable = true;
        //    Center = new Point(x + (width / 2), y + (height / 2));


        //    //BoarderColor1 = lineColor;
        //    //FillColor11 = fillColor;
        //    //FillType = FillTypePatern.Transparent;

        //    //BoarderWidth = lineWidth;
        //    TipText = String.Format("_rectangle Center @ {0}, {1}", Center.X, Center.Y);
        //}

        /// <summary>
        /// Draw rectangle
        /// </summary>
        /// <param name="g"></param>

        //public void makeBoarderDashStyle(/*DashStyle BoarderDashStyle, int BoarderWidth, int BoarderLinePaternScale, ref float[] cuspat*/)
        //{
        //    if (cuspat != null)
        //    {
        //        cuspat = null;
        //    }
        //    //cuspat = new float[6];
        //    switch (shapeoutline.BoarderDashStyle)
        //    {
        //        case DashStyle.Dot:
        //            cuspat = new float[4];
        //            cuspat[0] =  BoarderLinePaternScale;
        //            cuspat[1] =  BoarderLinePaternScale;
        //            cuspat[2] =  BoarderLinePaternScale;
        //            cuspat[3] =  BoarderLinePaternScale;
        //           break;
        //        case DashStyle.DashDotDot:
        //           cuspat = new float[6];
        //            cuspat[0] =  BoarderLinePaternScale * 5;
        //            cuspat[1] =  BoarderLinePaternScale;
        //            cuspat[2] =  BoarderLinePaternScale;
        //            cuspat[3] =  BoarderLinePaternScale;
        //            cuspat[4] =  BoarderLinePaternScale;
        //            cuspat[5] =  BoarderLinePaternScale;
        //            break;
        //        case DashStyle.DashDot:
        //            cuspat = new float[4];
        //            cuspat[0] =  BoarderLinePaternScale * 5;
        //            cuspat[1] =  BoarderLinePaternScale;
        //            cuspat[2] =  BoarderLinePaternScale;
        //            cuspat[3] =  BoarderLinePaternScale;
        //            break;
        //        case DashStyle.Dash:
        //            cuspat = new float[2];
        //            cuspat[0] =  BoarderLinePaternScale * 5;
        //            cuspat[1] =  BoarderLinePaternScale;
        //           break;
        //    }
        //}
        public Pen MakePen(Color _color, ShapeOutline shapeoutline)
        {
            Pen pen = new Pen(_color, shapeoutline.BoarderWidth);

            pen.DashStyle = shapeoutline.BoarderDashStyle;
            //switch (BoarderDashStyle)
            //{

            //    case DashStyle.Dot:
            //    case DashStyle.DashDotDot:
            //    case DashStyle.DashDot:
            //    case DashStyle.Dash:
            //        pen.DashStyle = DashStyle.Custom;
            //        pen.DashPattern = cuspat;
            //        break;
            //    default:
            //        pen.DashStyle = DashStyle.Solid; ;
            //        break;
            //}
            return(pen);
        }
Ejemplo n.º 8
0
 public DrawText(PageList _parent)
     : base(_parent)
 {
     _shapeoutline = new ShapeOutline(this);
     _shapefill    = new ShapeFill(this);
     Resizeable    = true;
     //SetRectangle(0, 0, 1,1);
     _theText               = "";
     this.ShapeType         = STATIC_OBJ_TYPE.ID_TEXT;
     shapefill.FillColor    = Common.LastFillColor;
     shapeoutline.LineStyle = Common.LastLineStyle;
     Propertylist.Add("Text,Text,STRING");
     Propertylist.Add("TextColor,Text Color,Color");
     Propertylist.Add("TextBlinking,Text Blinking,BOOL");
     Propertylist.Add("BorderWidth,Border Width,DINT");
     Propertylist.Add("BorderColor,Border Color,Color");
     Propertylist.Add("BorderBlinking,Border Blinking,BOOL");
     Propertylist.Add("Color1,Fill Color,Color");
     Propertylist.Add("Visible,Visible,BOOL");
     Initialize();
 }
Ejemplo n.º 9
0
 protected DrawRectangle(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     if (info == null)
     {
         throw new ArgumentNullException("info");
     }
     try
     {
         _shapeoutline           = new ShapeOutline(this);
         _shapefill              = new ShapeFill(this);
         this.ShapeType          = STATIC_OBJ_TYPE.ID_RECT;
         _roundnessx             = info.GetInt32("RoundnessX");
         _roundnessy             = info.GetInt32("RoundnessY");
         _shapefill.FillColor    = info.GetString("ShapeFill");
         _shapeoutline.LineStyle = info.GetString("shapeoutline");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 10
0
        public DrawLine(PageList _parent, int x1, int y1, int x2, int y2)
            : base(_parent)
        {
            _shapeoutline          = new ShapeOutline(this);
            ShapeType              = STATIC_OBJ_TYPE.ID_LINE;
            shapeoutline.LineStyle = Common.LastLineStyle;
            Resizeable             = true;
            startPoint.X           = x1;
            startPoint.Y           = y1;
            endPoint.X             = x2;
            endPoint.Y             = y2;


            ArrowSize = 1;
            Propertylist.Add("Border Width,Line Width,DINT");
            Propertylist.Add("BorderColor,Line Color,Color");
            Propertylist.Add("BorderBlinking,Line Blinking,BOOL");
            Propertylist.Add("Visible,Visible,BOOL");

            oIndex  = 0;
            TipText = String.Format("Line Start @ {0}-{1}, End @ {2}-{3}", x1, y1, x2, y2);
            Initialize();
        }
Ejemplo n.º 11
0
        public DrawLine(PageList _parent)
            : base(_parent)
        {
            _shapeoutline          = new ShapeOutline(this);
            ShapeType              = STATIC_OBJ_TYPE.ID_LINE;
            shapeoutline.LineStyle = Common.LastLineStyle;
            Resizeable             = true;
            startPoint.X           = 0;
            startPoint.Y           = 0;
            endPoint.X             = 1;
            endPoint.Y             = 1;
            oIndex = 0;


            ArrowSize = 1;

            Propertylist.Add("Border Width,Line Width,DINT");
            Propertylist.Add("BorderColor,Line Color,Color");
            Propertylist.Add("BorderBlinking,Line Blinking,BOOL");
            Propertylist.Add("Visible,Visible,BOOL");

            Initialize();
        }
Ejemplo n.º 12
0
 public DrawRectangle(PageList _parent, int x, int y, int width, int height)
     : base(_parent)
 {
     _shapeoutline          = new ShapeOutline(this);
     _shapefill             = new ShapeFill(this);
     Resizeable             = true;
     Center                 = new Point(x + (width / 2), y + (height / 2));
     _rectangle.X           = x;
     _rectangle.Y           = y;
     _rectangle.Width       = width;
     _rectangle.Height      = height;
     ShapeType              = STATIC_OBJ_TYPE.ID_RECT;
     shapefill.FillColor    = Common.LastFillColor;
     shapeoutline.LineStyle = Common.LastLineStyle;
     TipText                = String.Format("_rectangle Center @ {0}, {1}", Center.X, Center.Y);
     Propertylist.Add("BorderWidth,Border Width,DINT");
     Propertylist.Add("BorderColor,Border Color,Color");
     Propertylist.Add("BorderBlinking,Border Blinking,BOOL");
     Propertylist.Add("Color1,Fill Color 1,Color");
     Propertylist.Add("Color2,Fill Color 2,Color");
     Propertylist.Add("Blinking,Blinking,BOOL");
     Propertylist.Add("Visible,Visible,BOOL");
 }
Ejemplo n.º 13
0
 public DrawText(PageList _parent, int x, int y, string textToDraw, Font textFont, Color textColor)
     : base(_parent)
 {
     _shapeoutline          = new ShapeOutline(this);
     _shapefill             = new ShapeFill(this);
     Resizeable             = true;
     _rectangle.X           = x;
     _rectangle.Y           = y;
     _theText               = textToDraw;
     _font                  = textFont;
     TextColor              = textColor;
     this.ShapeType         = STATIC_OBJ_TYPE.ID_TEXT;
     shapefill.FillColor    = Common.LastFillColor;
     shapeoutline.LineStyle = Common.LastLineStyle;
     Propertylist.Add("Text,Text,STRING");
     Propertylist.Add("TextColor,Text Color,Color");
     Propertylist.Add("TextBlinking,Text Blinking,BOOL");
     Propertylist.Add("BorderWidth,Border Width,DINT");
     Propertylist.Add("BorderColor,Border Color,Color");
     Propertylist.Add("BorderBlinking,Border Blinking,BOOL");
     Propertylist.Add("Color1,Fill Color,Color");
     Propertylist.Add("Visible,Visible,BOOL");
     Initialize();
 }
Ejemplo n.º 14
0
        public void SelecactiveColor(ref Color bcolor, ref Color fColor1, ref Color fColor2, ShapeFill shapefill, ShapeOutline shapeoutline)
        {
            if (Common.Blinking && shapeoutline.BoarderBlinking)
            {
                bcolor = shapeoutline.BoarderColor2;
            }
            else
            {
                bcolor = shapeoutline.BoarderColor1;
            }

            switch (shapefill.FillType)
            {
            case FillTypePatern.Transparent:
                break;

            case FillTypePatern.Solid:

                //Brush b;
                if (Common.Blinking && shapefill.Blinking)
                {
                    fColor1 = shapefill.FillColor12;
                }
                else
                {
                    fColor1 = shapefill.FillColor11;
                }
                break;

            case FillTypePatern.Hatched:
                if (Common.Blinking && shapefill.Blinking)
                {
                    fColor1 = Color.Transparent;
                }
                else
                {
                    fColor1 = shapefill.FillColor11;
                }

                break;

            case FillTypePatern.Gradient:
                if (Common.Blinking && shapefill.Blinking)
                {
                    fColor1 = shapefill.FillColor12;
                    fColor2 = shapefill.FillColor22;
                }
                else
                {
                    fColor1 = shapefill.FillColor11;
                    fColor2 = shapefill.FillColor21;
                }

                break;
            }
        }
Ejemplo n.º 15
0
 public ShapeOutline(ShapeOutline tocopy)
 {
     this.LineStyle = tocopy.LineStyle;
 }