Пример #1
0
 public Line(Point a, Point b, ref DrawingSurface d, ref Box shapeA, ref Box shapeB) : this(a, b, ref d)         //this constructor will call the above constructor
     //immediately before executing it's own code.
     //this just avoids copying and pasteing the code.
 {
     item1 = shapeA;
     item2 = shapeB;
 }
Пример #2
0
        public bool mouseMove(DrawingSurface d, MouseEventArgs e)
        {
            var p = new Point(e.X - previousPoint.X, e.Y - previousPoint.Y);

            d.selectedShape.Move(p);
            previousPoint = e.Location;
            d.Invalidate();

            return(true);
        }
Пример #3
0
        public bool mouseDown(DrawingSurface d, MouseEventArgs e)
        {
            //The user has just chosen the second shape they want to connect to.
            bool success = d.selectedShape.handleConnection(firstBox);

            if (success)
            {
                d.Invalidate();
            }

            return(!success);
        }
Пример #4
0
        }                                          //The item that endpoint p2 is anchored to



        public Line(Point a, Point b, ref DrawingSurface d)
        {
            p1 = a;
            p2 = b;

            thickness = 10;
            color     = Color.Black;

            surface     = d;
            sensitivity = 1.5F;                 //The F is used to tell c# that 1.5 is a float, rather than a double. because trying to store it in a Float variable
            //isn't enough of a hint.
            item1 = null;
            item2 = null;
        }
Пример #5
0
        public Box(Point p, ref DrawingSurface d)
        {
            height     = 50;
            width      = 100;
            color      = Color.Black;
            thickness  = 5;
            TLCorner   = p;
            text       = new TextBox();
            text.Width = 50;

            surface = d;

            top_anchor    = new List <Line>();
            bottom_anchor = new List <Line>();
            left_anchor   = new List <Line>();
            right_anchor  = new List <Line>();

            default_anchor = null;

            contextMenu = d.boxMenu;
        }
 public ConnectionLine(Point a, Point b, ref DrawingSurface d, ref Box shapeA, ref Box shapeB)
     : base(a, b, ref d, ref shapeA, ref shapeB)
 {
 }
 public ConnectionLine(Point a, Point b, ref DrawingSurface d)
     : base(a, b, ref d)
 {
 }
Пример #8
0
 public void startConnection(DrawingSurface d, Box box)
 //this is called when the user right-clicks on a shape and clicks the "Connect To..." option from the context menu
 {
     firstBox = box;
 }
Пример #9
0
        public bool mouseUp(DrawingSurface d, MouseEventArgs e)
        {
            //throw new NotImplementedException();

            return(true);
        }
Пример #10
0
 public bool mouseUp(DrawingSurface d, MouseEventArgs e)
 {
     d.selectedShape = null;
     return(false);
 }
Пример #11
0
 public bool mouseDown(DrawingSurface d, MouseEventArgs e)
 {
     previousPoint = e.Location;
     return(true);
 }