Toggle viewing of drag areas on shapes when shape selector is pressed.

This commit is contained in:
Tim Young 2018-02-27 07:25:32 -06:00
parent d6a2a62c9b
commit cb3a29b4ea
3 changed files with 13 additions and 4 deletions

View File

@ -55,7 +55,7 @@ namespace EduNetworkBuilder
} }
if(InShapeEditMode) if(InShapeEditMode)
{ {
int sz = 5; int sz = 15;
Color edgeColor = Color.Black; Color edgeColor = Color.Black;
if (FillColor == Color.Black) edgeColor = Color.White; if (FillColor == Color.Black) edgeColor = Color.White;
coloredBrush = new SolidBrush(edgeColor); coloredBrush = new SolidBrush(edgeColor);

View File

@ -70,6 +70,7 @@ namespace EduNetworkBuilder
private List<string> BrokenItems = new List<string>(); private List<string> BrokenItems = new List<string>();
private List<NetShape> Shapes = new List<NetShape>(); //For storing simple shapes which are drawn on the network private List<NetShape> Shapes = new List<NetShape>(); //For storing simple shapes which are drawn on the network
public bool IsRandomNetwork = false; public bool IsRandomNetwork = false;
public bool InShapeEditMode = false;
private List<AnimationClass> Animations = new List<AnimationClass>(); private List<AnimationClass> Animations = new List<AnimationClass>();
@ -800,7 +801,7 @@ namespace EduNetworkBuilder
Graphics.FromImage(TheNetImage).FillRectangle(theBrush, new Rectangle(0,0, TheNetImage.Width, TheNetImage.Height)); Graphics.FromImage(TheNetImage).FillRectangle(theBrush, new Rectangle(0,0, TheNetImage.Width, TheNetImage.Height));
//re-generate the image //re-generate the image
foreach (NetShape shape in Shapes) foreach (NetShape shape in Shapes)
shape.Draw(TheNetImage); //Draw any shapes shape.Draw(TheNetImage, InShapeEditMode); //Draw any shapes
//Do all the links first //Do all the links first
foreach (NetworkComponent NC in NetComponents) foreach (NetworkComponent NC in NetComponents)
{ {

View File

@ -741,14 +741,22 @@ namespace EduNetworkBuilder
btn.BackColor = Color.LightGreen; btn.BackColor = Color.LightGreen;
selectedButton = btn.Name; selectedButton = btn.Name;
lblStatus.Text = myTooltip.GetToolTip(btn); lblStatus.Text = myTooltip.GetToolTip(btn);
if (selectedButton == "btnShapes") doupdate = true; myNetwork.InShapeEditMode = true;
if (selectedButton == "btnShapes") {
myNetwork.InShapeEditMode = true;
doupdate = true;
}
else
{
myNetwork.InShapeEditMode = false;
}
} }
else else
{ {
btn.BackColor = Button.DefaultBackColor; btn.BackColor = Button.DefaultBackColor;
} }
} }
if (doupdate) UpdateForm(); if (doupdate) { UpdateForm(); }
} }
private void btnReset() private void btnReset()
{ {