diff --git a/EduNetworkBuilder/EduNetworkBuilder.csproj b/EduNetworkBuilder/EduNetworkBuilder.csproj index 3631a73..e6e5646 100644 --- a/EduNetworkBuilder/EduNetworkBuilder.csproj +++ b/EduNetworkBuilder/EduNetworkBuilder.csproj @@ -414,6 +414,7 @@ + diff --git a/EduNetworkBuilder/NetShape.cs b/EduNetworkBuilder/NetShape.cs index cfa93eb..7c76dbf 100644 --- a/EduNetworkBuilder/NetShape.cs +++ b/EduNetworkBuilder/NetShape.cs @@ -64,6 +64,7 @@ namespace EduNetworkBuilder //We want to put drag-marks on the corners of our rectangle foreach(Rectangle one in Corners()) G.FillRectangle(coloredBrush, one); + G.DrawImage(Properties.Resources.X, Center()); } G.Dispose(); } @@ -83,6 +84,19 @@ namespace EduNetworkBuilder return tCorners; } + //A rectangle in the center of the shape that we can click on + Rectangle Center() + { + int size = 100; + if (InArea.Width < 200 || InArea.Height < 200) + size = 50; + if (InArea.Width < size || InArea.Height < size) + size = Math.Min(InArea.Width / 2, InArea.Height / 2); + int cx = InArea.X + (InArea.Width / 2); + int cy = InArea.Y + (InArea.Height / 2); + return new Rectangle(cx - (size / 2), cy - (size / 2), size, size); + } + public bool CornersAreClickedOn(Point ClickPoint) { foreach(Rectangle rec in Corners()) @@ -93,6 +107,13 @@ namespace EduNetworkBuilder return false; } + public bool CenterIsClickedOn(Point ClickPoint) + { + if (Center().Contains(ClickPoint)) + return true; + return false; + } + /// /// return the opposite point from the one clicked on. This is so we can start /// dragging from here. diff --git a/EduNetworkBuilder/Properties/Resources.Designer.cs b/EduNetworkBuilder/Properties/Resources.Designer.cs index ced1681..48b45d5 100644 --- a/EduNetworkBuilder/Properties/Resources.Designer.cs +++ b/EduNetworkBuilder/Properties/Resources.Designer.cs @@ -1409,5 +1409,15 @@ namespace EduNetworkBuilder.Properties { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap X { + get { + object obj = ResourceManager.GetObject("X", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/EduNetworkBuilder/Properties/Resources.resx b/EduNetworkBuilder/Properties/Resources.resx index 160eb31..a9b88cb 100644 --- a/EduNetworkBuilder/Properties/Resources.resx +++ b/EduNetworkBuilder/Properties/Resources.resx @@ -517,4 +517,7 @@ ..\Resources\tree.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\X.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/EduNetworkBuilder/Resources/X.png b/EduNetworkBuilder/Resources/X.png new file mode 100644 index 0000000..b5ea952 Binary files /dev/null and b/EduNetworkBuilder/Resources/X.png differ