Able to add a new shape. Cannot edit existing shapes yet...
This commit is contained in:
		@@ -19,11 +19,12 @@ namespace EduNetworkBuilder
 | 
			
		||||
        public Color FillColor = Color.Empty;
 | 
			
		||||
        int DragSize = 15;
 | 
			
		||||
 | 
			
		||||
        public NetShape(NetShapeType What, Rectangle Where, Color color)
 | 
			
		||||
        public NetShape(NetShapeType What, Rectangle Where, Color fillcolor, Color linecolor)
 | 
			
		||||
        {
 | 
			
		||||
            MyShape = What;
 | 
			
		||||
            InArea = Where;
 | 
			
		||||
            FillColor = color;
 | 
			
		||||
            FillColor = fillcolor;
 | 
			
		||||
            LineColor = linecolor;
 | 
			
		||||
        }
 | 
			
		||||
        public NetShape(XmlNode what)
 | 
			
		||||
        {
 | 
			
		||||
 
 | 
			
		||||
@@ -1115,6 +1115,11 @@ namespace EduNetworkBuilder
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void AddShape(NetShape what)
 | 
			
		||||
        {
 | 
			
		||||
            Shapes.Add(what);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        void KillAllExtraWindows(bool EvenRTF=false)
 | 
			
		||||
        {
 | 
			
		||||
            for(int i = Application.OpenForms.Count -1; i >=0; i--)
 | 
			
		||||
 
 | 
			
		||||
@@ -1481,12 +1481,32 @@ namespace EduNetworkBuilder
 | 
			
		||||
 | 
			
		||||
                    Rectangle selectbox = new Rectangle(topCorner.X, topCorner.Y, botCorner.X - topCorner.X, botCorner.Y - topCorner.Y);
 | 
			
		||||
 | 
			
		||||
                    ItemsSelected.AddRange(myNetwork.DevicesInRectangle(selectbox));
 | 
			
		||||
                    //Console.WriteLine("Selected " + ItemsSelected.Count + " items");
 | 
			
		||||
                    MouseIsDown = false;
 | 
			
		||||
                    DrawHighlightBoxes();
 | 
			
		||||
                    pbNetworkView.Invalidate();
 | 
			
		||||
                    return;
 | 
			
		||||
                    if (!myNetwork.InShapeEditMode)
 | 
			
		||||
                    {
 | 
			
		||||
                        ItemsSelected.AddRange(myNetwork.DevicesInRectangle(selectbox));
 | 
			
		||||
                        //Console.WriteLine("Selected " + ItemsSelected.Count + " items");
 | 
			
		||||
                        MouseIsDown = false;
 | 
			
		||||
                        DrawHighlightBoxes();
 | 
			
		||||
                        pbNetworkView.Invalidate();
 | 
			
		||||
                        return;
 | 
			
		||||
                    }
 | 
			
		||||
                    else
 | 
			
		||||
                    {
 | 
			
		||||
                        //We just made a shape.
 | 
			
		||||
                        try
 | 
			
		||||
                        {
 | 
			
		||||
                            Color FillColor = Color.FromName(cbFillColor.Text);
 | 
			
		||||
                            Color LineColor = Color.FromName(cbLineColor.Text);
 | 
			
		||||
                            NetShape NS = new NetShape(CurrentShape, selectbox,FillColor,LineColor);
 | 
			
		||||
 | 
			
		||||
                            myNetwork.AddShape(NS);
 | 
			
		||||
                            UpdateForm();
 | 
			
		||||
                        }
 | 
			
		||||
                        catch
 | 
			
		||||
                        {
 | 
			
		||||
                            //Nothing to do.  Something is wrong with the colors.
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                MouseIsDown = false;
 | 
			
		||||
                if (selectedButton == "btnLink")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user