Add color choosing boxes for Line and Fill colors for use when adding a shape.

This commit is contained in:
Tim Young 2018-02-26 18:07:56 -06:00
parent 483951f022
commit d6a2a62c9b
2 changed files with 48 additions and 3 deletions

View File

@ -76,6 +76,8 @@
this.HelpPanel = new System.Windows.Forms.Panel();
this.btnCaptions = new System.Windows.Forms.Button();
this.myProgressBar = new System.Windows.Forms.ProgressBar();
this.cbLineColor = new System.Windows.Forms.ComboBox();
this.cbFillColor = new System.Windows.Forms.ComboBox();
this.msMainMenuStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbNetworkView)).BeginInit();
this.HelpPanel.SuspendLayout();
@ -515,11 +517,29 @@
this.myProgressBar.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.myProgressBar.TabIndex = 11;
//
// cbLineColor
//
this.cbLineColor.FormattingEnabled = true;
this.cbLineColor.Location = new System.Drawing.Point(12, 433);
this.cbLineColor.Name = "cbLineColor";
this.cbLineColor.Size = new System.Drawing.Size(79, 24);
this.cbLineColor.TabIndex = 12;
//
// cbFillColor
//
this.cbFillColor.FormattingEnabled = true;
this.cbFillColor.Location = new System.Drawing.Point(11, 463);
this.cbFillColor.Name = "cbFillColor";
this.cbFillColor.Size = new System.Drawing.Size(80, 24);
this.cbFillColor.TabIndex = 13;
//
// BuilderWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(617, 507);
this.Controls.Add(this.cbFillColor);
this.Controls.Add(this.cbLineColor);
this.Controls.Add(this.myProgressBar);
this.Controls.Add(this.lblStatus);
this.Controls.Add(this.lbMessages);
@ -598,6 +618,8 @@
private System.Windows.Forms.ToolStripMenuItem logoutToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem randomToolStripMenuItem;
private System.Windows.Forms.Button btnCaptions;
private System.Windows.Forms.ComboBox cbLineColor;
private System.Windows.Forms.ComboBox cbFillColor;
}
}

View File

@ -95,6 +95,16 @@ namespace EduNetworkBuilder
myNetwork.RegisterDisplayArea(pbNetworkView);
List<string> ColorNames = new List<string>() { "Black","White","Green","LightGreen","Blue","LightBlue","Grey","Brown","SaddleBrown" };
ColorNames.Sort();
cbFillColor.Items.Clear();
cbLineColor.Items.Clear();
foreach(string ColorName in ColorNames)
{
cbFillColor.Items.Add(ColorName);
cbLineColor.Items.Add(ColorName);
}
BuildButtons();
LayoutButtons();
UpdateForm();
@ -548,6 +558,16 @@ namespace EduNetworkBuilder
UpdateMenu();
UpdateMessages();
UpdateVisuals();
if(selectedButton == "btnShapes")
{
cbFillColor.Visible = true;
cbLineColor.Visible = true;
}
else
{
cbFillColor.Visible = false;
cbLineColor.Visible = false;
}
if (myNetwork != null && myNetwork.LoadedFromResource)
optionsToolStripMenuItem.Visible = false;
else
@ -711,6 +731,8 @@ namespace EduNetworkBuilder
private void btnClick(object sender, EventArgs e)
{
bool doupdate = false;
if (selectedButton == "btnShapes") doupdate = true;
foreach(Control btn in Buttons)
{
if(btn == sender)
@ -719,12 +741,14 @@ namespace EduNetworkBuilder
btn.BackColor = Color.LightGreen;
selectedButton = btn.Name;
lblStatus.Text = myTooltip.GetToolTip(btn);
if (selectedButton == "btnShapes") doupdate = true;
}
else
{
btn.BackColor = Button.DefaultBackColor;
}
}
if (doupdate) UpdateForm();
}
private void btnReset()
{
@ -2527,9 +2551,8 @@ namespace EduNetworkBuilder
UpdateForm();
UpdateMessages();
}
#endregion Random Map Stuff
#endregion Random Map Stuff
}
}