Allow empty colors, but if both are empty, do not use them.
This commit is contained in:
parent
1d1290c3c2
commit
a06f27a836
@ -99,7 +99,7 @@ namespace EduNetworkBuilder
|
|||||||
|
|
||||||
myNetwork.RegisterDisplayArea(pbNetworkView);
|
myNetwork.RegisterDisplayArea(pbNetworkView);
|
||||||
|
|
||||||
List<string> ColorNames = new List<string>() { "Black","White","Green","LightGreen","Blue","LightBlue","Grey","Brown","SaddleBrown" };
|
List<string> ColorNames = new List<string>() { "Black","White","Green","LightGreen","Blue","LightBlue","Grey","Brown","SaddleBrown", "Empty" };
|
||||||
ColorNames.Sort();
|
ColorNames.Sort();
|
||||||
cbFillColor.Items.Clear();
|
cbFillColor.Items.Clear();
|
||||||
cbLineColor.Items.Clear();
|
cbLineColor.Items.Clear();
|
||||||
@ -1495,13 +1495,20 @@ namespace EduNetworkBuilder
|
|||||||
//We just made a shape.
|
//We just made a shape.
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Color FillColor = Color.FromName(cbFillColor.Text);
|
string fColor = cbFillColor.Text;
|
||||||
Color LineColor = Color.FromName(cbLineColor.Text);
|
string lColor = cbLineColor.Text;
|
||||||
|
if (fColor == "") fColor = "Empty";
|
||||||
|
if (lColor == "") lColor = "Empty";
|
||||||
|
Color FillColor = Color.FromName(fColor);
|
||||||
|
Color LineColor = Color.FromName(lColor);
|
||||||
|
if (LineColor.Name != "Empty" || FillColor.Name != "Empty")
|
||||||
|
{
|
||||||
NetShape NS = new NetShape(CurrentShape, selectbox, FillColor, LineColor);
|
NetShape NS = new NetShape(CurrentShape, selectbox, FillColor, LineColor);
|
||||||
|
|
||||||
myNetwork.AddShape(NS);
|
myNetwork.AddShape(NS);
|
||||||
UpdateForm();
|
UpdateForm();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
//Nothing to do. Something is wrong with the colors.
|
//Nothing to do. Something is wrong with the colors.
|
||||||
|
Loading…
Reference in New Issue
Block a user