Exemple #1
0
 protected override void CreateObjects()
 {
     base.CreateObjects();
     this.m_Wrapping = new PlotLegendWrapping();
     base.AddSubClass(this.Wrapping);
     this.m_Rect = new iRectangle();
 }
Exemple #2
0
 protected override void CreateObjects()
 {
     base.CreateObjects();
     this.m_Rect           = new iRectangle();
     this.m_CellFormatting = new PlotLegendMultiColumnCellFormatting();
     base.AddSubClass(this.CellFormatting);
     this.m_Columns = new PlotLegendMultiColumnItemCollection(this.ComponentBase);
 }
Exemple #3
0
 private void DrawArrowDown(PaintArgs p, iRectangle r)
 {
     Point[] points = new Point[3]
     {
         new Point(r.Left, r.CenterY - r.WidthHalf),
         new Point(r.Right, r.CenterY - r.WidthHalf),
         new Point(r.CenterX, r.CenterY + r.WidthHalf)
     };
     p.Graphics.FillPolygon(p.Graphics.Brush(this.ColorOn), points);
     p.Graphics.DrawPolygon(p.Graphics.Pen(this.ColorOn), points);
 }
Exemple #4
0
 public void SetStartRectangle(iRectangle r, int width, int height, bool reverse)
 {
     if (!reverse)
     {
         r.Rectangle = new Rectangle(r.Left, r.Bottom - height, width, height);
     }
     else
     {
         r.Rectangle = new Rectangle(r.Left, r.Top, width, height);
     }
 }
Exemple #5
0
 public void ShiftRectangle(iRectangle r, int shift, bool reverse)
 {
     if (!reverse)
     {
         r.OffsetY(-shift);
     }
     else
     {
         r.OffsetY(shift);
     }
 }
Exemple #6
0
 private void DrawDot(PaintArgs p, iRectangle r, int yCenter)
 {
     Point[] points = new Point[4]
     {
         new Point(r.CenterX - this.Size, yCenter - this.Size),
         new Point(r.CenterX + this.Size, yCenter - this.Size),
         new Point(r.CenterX + this.Size, yCenter + this.Size),
         new Point(r.CenterX - this.Size, yCenter + this.Size)
     };
     p.Graphics.FillPolygon(p.Graphics.Brush(this.ColorOn), points);
     p.Graphics.DrawPolygon(p.Graphics.Pen(this.ColorOn), points);
 }
Exemple #7
0
 private void DrawMinus(PaintArgs p, iRectangle r)
 {
     Point[] points = new Point[4]
     {
         new Point(r.Left, r.CenterY - this.Size),
         new Point(r.Right, r.CenterY - this.Size),
         new Point(r.Right, r.CenterY + this.Size),
         new Point(r.Left, r.CenterY + this.Size)
     };
     p.Graphics.FillPolygon(p.Graphics.Brush(this.ColorOn), points);
     p.Graphics.DrawPolygon(p.Graphics.Pen(this.ColorOn), points);
 }
Exemple #8
0
 private void DrawSegmentD(PaintArgs p, iRectangle r, Color color)
 {
     Point[] points = new Point[4]
     {
         new Point(r.Left + this.Separation, r.Bottom),
         new Point(r.Right - this.Separation, r.Bottom),
         new Point(r.Right - this.Separation - this.Size * 2, r.Bottom - this.Size * 2),
         new Point(r.Left + this.Separation + this.Size * 2, r.Bottom - this.Size * 2)
     };
     p.Graphics.FillPolygon(p.Graphics.Brush(color), points);
     p.Graphics.DrawPolygon(p.Graphics.Pen(color), points);
 }
Exemple #9
0
 private void DrawSegmentF(PaintArgs p, iRectangle r, Color color)
 {
     Point[] points = new Point[4]
     {
         new Point(r.Left, r.Top + this.Separation),
         new Point(r.Left, r.CenterY - this.Separation),
         new Point(r.Left + this.Size * 2, r.CenterY - this.Separation - this.Size * 2),
         new Point(r.Left + this.Size * 2, r.Top + this.Separation + this.Size * 2)
     };
     p.Graphics.FillPolygon(p.Graphics.Brush(color), points);
     p.Graphics.DrawPolygon(p.Graphics.Pen(color), points);
 }
Exemple #10
0
        protected void DrawRange(PaintArgs p, Rectangle r, Color backColor, Orientation orientation)
        {
            int        num             = 1;
            int        thicknessPixels = this.GetThicknessPixels();
            int        num2            = (r.Height + 1) / (thicknessPixels + 1);
            iRectangle iRectangle      = new iRectangle(r);

            for (int i = 0; i < num2; i++)
            {
                this.Draw(p, iRectangle.Rectangle, backColor, orientation);
                iRectangle.Top += thicknessPixels + num;
            }
        }
Exemple #11
0
 private void DrawSegmentG(PaintArgs p, iRectangle r, Color color)
 {
     Point[] points = new Point[6]
     {
         new Point(r.Left + this.Separation, r.CenterY),
         new Point(r.Left + this.Separation + this.Size, r.CenterY - this.Size),
         new Point(r.Right - this.Separation - this.Size, r.CenterY - this.Size),
         new Point(r.Right - this.Separation, r.CenterY),
         new Point(r.Right - this.Separation - this.Size, r.CenterY + this.Size),
         new Point(r.Left + this.Separation + this.Size, r.CenterY + this.Size)
     };
     p.Graphics.FillPolygon(p.Graphics.Brush(color), points);
     p.Graphics.DrawPolygon(p.Graphics.Pen(color), points);
 }
Exemple #12
0
 private void DrawComma(PaintArgs p, iRectangle r)
 {
     this.DrawDotComma(p, r, p.Bottom - 3 * this.Size);
 }
Exemple #13
0
 private void DrawPeriod(PaintArgs p, iRectangle r)
 {
     this.DrawDot(p, r, p.Bottom - this.Size);
 }
Exemple #14
0
 void ISegment7.Draw(PaintArgs p, iRectangle r, Segment7Character character)
 {
     this.Draw(p, r, character);
 }
Exemple #15
0
 private void DrawSemiColon(PaintArgs p, iRectangle r)
 {
     this.DrawDot(p, r, p.CenterY - this.Size * 3);
     this.DrawDotComma(p, r, p.CenterY + this.Size * 3);
 }
Exemple #16
0
        private void Draw(PaintArgs p, iRectangle r, Segment7Character character)
        {
            Color colorOn  = this.ColorOn;
            Color offColor = this.GetOffColor();

            bool[] array;
            switch (character)
            {
            case Segment7Character.Space:
            {
                bool[] array2 = new bool[7];
                array = array2;
                goto IL_01c9;
            }

            case Segment7Character.X0:
                array = new bool[7]
                {
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    false
                };
                goto IL_01c9;

            case Segment7Character.X1:
                array = new bool[7]
                {
                    false,
                    true,
                    true,
                    false,
                    false,
                    false,
                    false
                };
                goto IL_01c9;

            case Segment7Character.X2:
                array = new bool[7]
                {
                    true,
                    true,
                    false,
                    true,
                    true,
                    false,
                    true
                };
                goto IL_01c9;

            case Segment7Character.X3:
                array = new bool[7]
                {
                    true,
                    true,
                    true,
                    true,
                    false,
                    false,
                    true
                };
                goto IL_01c9;

            case Segment7Character.X4:
                array = new bool[7]
                {
                    false,
                    true,
                    true,
                    false,
                    false,
                    true,
                    true
                };
                goto IL_01c9;

            case Segment7Character.X5:
                array = new bool[7]
                {
                    true,
                    false,
                    true,
                    true,
                    false,
                    true,
                    true
                };
                goto IL_01c9;

            case Segment7Character.X6:
                array = new bool[7]
                {
                    true,
                    false,
                    true,
                    true,
                    true,
                    true,
                    true
                };
                goto IL_01c9;

            case Segment7Character.X7:
                array = new bool[7]
                {
                    true,
                    true,
                    true,
                    false,
                    false,
                    false,
                    false
                };
                goto IL_01c9;

            case Segment7Character.X8:
                array = new bool[7]
                {
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true
                };
                goto IL_01c9;

            case Segment7Character.X9:
                array = new bool[7]
                {
                    true,
                    true,
                    true,
                    false,
                    false,
                    true,
                    true
                };
                goto IL_01c9;

            case Segment7Character.XA:
                array = new bool[7]
                {
                    true,
                    true,
                    true,
                    false,
                    true,
                    true,
                    true
                };
                goto IL_01c9;

            case Segment7Character.XB:
                array = new bool[7]
                {
                    false,
                    false,
                    true,
                    true,
                    true,
                    true,
                    true
                };
                goto IL_01c9;

            case Segment7Character.XC:
                array = new bool[7]
                {
                    true,
                    false,
                    false,
                    true,
                    true,
                    true,
                    false
                };
                goto IL_01c9;

            case Segment7Character.XD:
                array = new bool[7]
                {
                    false,
                    true,
                    true,
                    true,
                    true,
                    false,
                    true
                };
                goto IL_01c9;

            case Segment7Character.XE:
                array = new bool[7]
                {
                    true,
                    false,
                    false,
                    true,
                    true,
                    true,
                    true
                };
                goto IL_01c9;

            case Segment7Character.XF:
                array = new bool[7]
                {
                    true,
                    false,
                    false,
                    false,
                    true,
                    true,
                    true
                };
                goto IL_01c9;

            case Segment7Character.ArrowUp:
                this.DrawArrowUp(p, r);
                break;

            case Segment7Character.ArrowDown:
                this.DrawArrowDown(p, r);
                break;

            case Segment7Character.Colon:
                this.DrawColon(p, r);
                break;

            case Segment7Character.Comma:
                this.DrawComma(p, r);
                break;

            case Segment7Character.SemiColon:
                this.DrawSemiColon(p, r);
                break;

            case Segment7Character.Period:
                this.DrawPeriod(p, r);
                break;

            case Segment7Character.Minus:
                this.DrawMinus(p, r);
                break;

            case Segment7Character.Plus:
            {
                this.DrawPlus(p, r);
                break;
            }
IL_01c9:
                if (array[0])
                {
                    this.DrawSegmentA(p, r, colorOn);
                }
                else if (this.ShowOffSegments)
                {
                    this.DrawSegmentA(p, r, offColor);
                }
                if (array[1])
                {
                    this.DrawSegmentB(p, r, colorOn);
                }
                else if (this.ShowOffSegments)
                {
                    this.DrawSegmentB(p, r, offColor);
                }
                if (array[2])
                {
                    this.DrawSegmentC(p, r, colorOn);
                }
                else if (this.ShowOffSegments)
                {
                    this.DrawSegmentC(p, r, offColor);
                }
                if (array[3])
                {
                    this.DrawSegmentD(p, r, colorOn);
                }
                else if (this.ShowOffSegments)
                {
                    this.DrawSegmentD(p, r, offColor);
                }
                if (array[4])
                {
                    this.DrawSegmentE(p, r, colorOn);
                }
                else if (this.ShowOffSegments)
                {
                    this.DrawSegmentE(p, r, offColor);
                }
                if (array[5])
                {
                    this.DrawSegmentF(p, r, colorOn);
                }
                else if (this.ShowOffSegments)
                {
                    this.DrawSegmentF(p, r, offColor);
                }
                if (array[6])
                {
                    this.DrawSegmentG(p, r, colorOn);
                }
                else if (this.ShowOffSegments)
                {
                    this.DrawSegmentG(p, r, offColor);
                }
                break;
            }
        }
        public void UpdateDestinationSide()
        {
            Rectangle rectangle;

            if (this.DestinationType == PlotDragType.Group)
            {
                PlotLayoutBlockGroup plotLayoutBlockGroup = this.Destination as PlotLayoutBlockGroup;
                rectangle = plotLayoutBlockGroup.InnerRectangleLayout;
                Point[] array = new Point[3];
                Point   point = new Point((rectangle.Left + rectangle.Right) / 2, (rectangle.Top + rectangle.Bottom) / 2);
                array[0] = new Point(rectangle.Left, rectangle.Top);
                array[1] = point;
                array[2] = new Point(rectangle.Left, rectangle.Bottom);
                if (HitTest.Contains(this.MousePoint, array))
                {
                    this.DestinationRect            = new Rectangle(rectangle.Left - 10, rectangle.Top, 21, rectangle.Height);
                    this.DestinationSide            = PlotDragSide.Left;
                    this.Destination.List           = plotLayoutBlockGroup.ListLeft;
                    this.DestinationDockOrderOffset = PlotDragDockOrderOffset.Lower;
                }
                else
                {
                    array[0] = new Point(rectangle.Right, rectangle.Top);
                    array[1] = point;
                    array[2] = new Point(rectangle.Right, rectangle.Bottom);
                    if (HitTest.Contains(this.MousePoint, array))
                    {
                        this.DestinationRect            = new Rectangle(rectangle.Right - 10, rectangle.Top, 21, rectangle.Height);
                        this.DestinationSide            = PlotDragSide.Right;
                        this.Destination.List           = plotLayoutBlockGroup.ListRight;
                        this.DestinationDockOrderOffset = PlotDragDockOrderOffset.Lower;
                    }
                    else
                    {
                        array[0] = new Point(rectangle.Left, rectangle.Top);
                        array[1] = point;
                        array[2] = new Point(rectangle.Right, rectangle.Top);
                        if (HitTest.Contains(this.MousePoint, array))
                        {
                            this.DestinationRect            = new Rectangle(rectangle.Left, rectangle.Top - 10, rectangle.Width, 21);
                            this.DestinationSide            = PlotDragSide.Top;
                            this.Destination.List           = plotLayoutBlockGroup.ListTop;
                            this.DestinationDockOrderOffset = PlotDragDockOrderOffset.Lower;
                        }
                        else
                        {
                            this.DestinationRect            = new Rectangle(rectangle.Left, rectangle.Bottom - 10, rectangle.Width, 21);
                            this.DestinationSide            = PlotDragSide.Bottom;
                            this.Destination.List           = plotLayoutBlockGroup.ListBottom;
                            this.DestinationDockOrderOffset = PlotDragDockOrderOffset.Lower;
                        }
                    }
                }
            }
            else
            {
                rectangle = this.Destination.BoundsLayout;
                iRectangle iRectangle = new iRectangle(rectangle);
                if (this.Destination.Object != null && !this.Destination.Object.DockHorizontal)
                {
                    iRectangle.Height /= 3;
                    if (iRectangle.Rectangle.Contains(this.MousePoint))
                    {
                        rectangle.Offset(0, -10);
                        this.DestinationRect = rectangle;
                        this.DestinationSide = PlotDragSide.Top;
                        if (this.Destination.Object.DockTop)
                        {
                            this.DestinationDockOrderOffset = PlotDragDockOrderOffset.Higher;
                        }
                        else
                        {
                            this.DestinationDockOrderOffset = PlotDragDockOrderOffset.Lower;
                        }
                    }
                    else
                    {
                        iRectangle.OffsetY(7);
                        if (iRectangle.Rectangle.Contains(this.MousePoint))
                        {
                            this.DestinationRect            = rectangle;
                            this.DestinationSide            = PlotDragSide.Stack;
                            this.DestinationDockOrderOffset = PlotDragDockOrderOffset.Same;
                        }
                        else
                        {
                            rectangle.Offset(0, 10);
                            this.DestinationRect = rectangle;
                            this.DestinationSide = PlotDragSide.Bottom;
                            if (this.Destination.Object.DockTop)
                            {
                                this.DestinationDockOrderOffset = PlotDragDockOrderOffset.Lower;
                            }
                            else
                            {
                                this.DestinationDockOrderOffset = PlotDragDockOrderOffset.Higher;
                            }
                        }
                    }
                }
                else
                {
                    iRectangle.Width /= 3;
                    if (iRectangle.Rectangle.Contains(this.MousePoint))
                    {
                        rectangle.Offset(-10, 0);
                        this.DestinationRect = rectangle;
                        this.DestinationSide = PlotDragSide.Left;
                        if (this.Destination.Object.DockLeft)
                        {
                            this.DestinationDockOrderOffset = PlotDragDockOrderOffset.Higher;
                        }
                        else
                        {
                            this.DestinationDockOrderOffset = PlotDragDockOrderOffset.Lower;
                        }
                    }
                    else
                    {
                        iRectangle.OffsetX(7);
                        if (iRectangle.Rectangle.Contains(this.MousePoint))
                        {
                            this.DestinationRect            = rectangle;
                            this.DestinationSide            = PlotDragSide.Stack;
                            this.DestinationDockOrderOffset = PlotDragDockOrderOffset.Same;
                        }
                        else
                        {
                            rectangle.Offset(10, 0);
                            this.DestinationRect = rectangle;
                            this.DestinationSide = PlotDragSide.Right;
                            if (this.Destination.Object != null && !this.Destination.Object.DockLeft)
                            {
                                this.DestinationDockOrderOffset = PlotDragDockOrderOffset.Higher;
                            }
                            else
                            {
                                this.DestinationDockOrderOffset = PlotDragDockOrderOffset.Lower;
                            }
                        }
                    }
                }
            }
        }