Add a checkmark to display the names and ips of network devices. And make a net-test. Added it to level0-help puzzle.

This commit is contained in:
Tim Young 2016-02-04 16:38:49 -06:00
parent dbbf30a4f3
commit f9b7ceffae
10 changed files with 89 additions and 13 deletions

View File

@ -313,6 +313,18 @@ namespace EduNetworkBuilder
}
return true;
}
if (TheTest == NetTestType.HelpRequest && dHost == "ViewButton" && ChangeColor)
{
BuilderWindow myWin = NB.GetBuilderWin();
if (myWin != null)
{
Control ctl = myWin.GetControlNamed("cbViewTitles");
if (ctl == null) return false;
if (ctl.BackColor != WrongColor)
ctl.BackColor = WrongColor;
}
return true;
}
Network theNet = NB.GetNetwork();
NetworkDevice Source = theNet.GetDeviceFromName(sHost);
if(Source!= null)

View File

@ -106,6 +106,7 @@ namespace EduNetworkBuilder
cbDest.Items.Add(HelpLevel);
}
cbDest.Items.Add("?Button");
cbDest.Items.Add("ViewButton");
}
else if (ToEdit.TheTest == NetTestType.ReadContextHelp)
{

View File

@ -22,7 +22,8 @@ namespace EduNetworkBuilder
public int myWidth = 1024;
public int Level = 0;
public double SortOrder = 0;
public bool ShowLabels = false;
public bool OptionShowLabels = false;
public bool ShowLabelsHere = false;
public LanguageStrings NetMessage;
public LanguageStrings NetTitle;
List<NetworkComponent> NetComponents = new List<NetworkComponent>();
@ -122,7 +123,8 @@ namespace EduNetworkBuilder
Load(Individual,PuzzleName);
break;
case "showlabels":
bool.TryParse(Individual.InnerText, out ShowLabels);
bool.TryParse(Individual.InnerText, out OptionShowLabels);
ShowLabelsHere = OptionShowLabels;
break;
case "itemsize":
int.TryParse(Individual.InnerText, out itemsize);
@ -242,7 +244,7 @@ namespace EduNetworkBuilder
writer.WriteElementString("height", myHeight.ToString());
writer.WriteElementString("width", myWidth.ToString());
writer.WriteElementString("itemsize", itemsize.ToString());
writer.WriteElementString("showlabels", ShowLabels.ToString());
writer.WriteElementString("showlabels", OptionShowLabels.ToString());
writer.WriteElementString("level", Level.ToString());
writer.WriteElementString("sortorder", SortOrder.ToString());
writer.WriteElementString("uniqueidentifier", UniqueIdentifier.ToString());
@ -542,7 +544,7 @@ namespace EduNetworkBuilder
foreach (NetworkComponent NC in NetComponents)
{
if (NC.GetType().ToString() == "EduNetworkBuilder.NetworkDevice")
NC.Print(TheNetImage, ShowLabels);
NC.Print(TheNetImage, ShowLabelsHere);
}
//Write the whole thing to the background image.
Graphics.FromImage(TheNetImageBackground).DrawImage(TheNetImage, 0, 0);
@ -824,6 +826,21 @@ namespace EduNetworkBuilder
return true;
}
}
if (nt.TheTest == NetTestType.HelpRequest && sHost == "" && dHost == nt.dHost && dHost == "ViewButton")
{
OldVal = nt.TaskWasDone;
nt.SetDone();
if (nt.TaskWasDone != OldVal)
{
BuilderWindow myWin = NB.GetBuilderWin();
if (myWin == null) return true;
Control ctl = myWin.GetControlNamed("cbViewTitles");
if (ctl == null) return false;
ctl.BackColor = Control.DefaultBackColor;
return true;
}
}
}
return false;

View File

@ -76,6 +76,7 @@
this.rbHelp2 = new System.Windows.Forms.RadioButton();
this.rbHelp1 = new System.Windows.Forms.RadioButton();
this.HelpPanel = new System.Windows.Forms.Panel();
this.cbViewTitles = new System.Windows.Forms.CheckBox();
this.myProgressBar = new System.Windows.Forms.ProgressBar();
this.msMainMenuStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbNetworkView)).BeginInit();
@ -440,7 +441,7 @@
// btnHelp
//
this.btnHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnHelp.Location = new System.Drawing.Point(2, 2);
this.btnHelp.Location = new System.Drawing.Point(2, 27);
this.btnHelp.Margin = new System.Windows.Forms.Padding(2);
this.btnHelp.Name = "btnHelp";
this.btnHelp.Size = new System.Drawing.Size(21, 20);
@ -453,7 +454,7 @@
//
this.rbHelp4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.rbHelp4.AutoSize = true;
this.rbHelp4.Location = new System.Drawing.Point(5, 28);
this.rbHelp4.Location = new System.Drawing.Point(5, 53);
this.rbHelp4.Margin = new System.Windows.Forms.Padding(2);
this.rbHelp4.Name = "rbHelp4";
this.rbHelp4.Size = new System.Drawing.Size(17, 16);
@ -465,7 +466,7 @@
//
this.rbHelp3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.rbHelp3.AutoSize = true;
this.rbHelp3.Location = new System.Drawing.Point(5, 44);
this.rbHelp3.Location = new System.Drawing.Point(5, 69);
this.rbHelp3.Margin = new System.Windows.Forms.Padding(2);
this.rbHelp3.Name = "rbHelp3";
this.rbHelp3.Size = new System.Drawing.Size(17, 16);
@ -477,7 +478,7 @@
//
this.rbHelp2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.rbHelp2.AutoSize = true;
this.rbHelp2.Location = new System.Drawing.Point(5, 62);
this.rbHelp2.Location = new System.Drawing.Point(5, 87);
this.rbHelp2.Margin = new System.Windows.Forms.Padding(2);
this.rbHelp2.Name = "rbHelp2";
this.rbHelp2.Size = new System.Drawing.Size(17, 16);
@ -490,7 +491,7 @@
this.rbHelp1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.rbHelp1.AutoSize = true;
this.rbHelp1.Checked = true;
this.rbHelp1.Location = new System.Drawing.Point(5, 80);
this.rbHelp1.Location = new System.Drawing.Point(5, 105);
this.rbHelp1.Margin = new System.Windows.Forms.Padding(2);
this.rbHelp1.Name = "rbHelp1";
this.rbHelp1.Size = new System.Drawing.Size(17, 16);
@ -502,6 +503,7 @@
// HelpPanel
//
this.HelpPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.HelpPanel.Controls.Add(this.cbViewTitles);
this.HelpPanel.Controls.Add(this.rbHelp4);
this.HelpPanel.Controls.Add(this.btnHelp);
this.HelpPanel.Controls.Add(this.rbHelp1);
@ -513,6 +515,16 @@
this.HelpPanel.Size = new System.Drawing.Size(25, 300);
this.HelpPanel.TabIndex = 10;
//
// cbViewTitles
//
this.cbViewTitles.AutoSize = true;
this.cbViewTitles.Location = new System.Drawing.Point(5, 7);
this.cbViewTitles.Name = "cbViewTitles";
this.cbViewTitles.Size = new System.Drawing.Size(18, 17);
this.cbViewTitles.TabIndex = 10;
this.cbViewTitles.UseVisualStyleBackColor = true;
this.cbViewTitles.CheckedChanged += new System.EventHandler(this.cbViewTitles_CheckedChanged);
//
// myProgressBar
//
this.myProgressBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
@ -605,6 +617,7 @@
private System.Windows.Forms.ToolStripMenuItem firewallsToolStripMenuItem1;
private System.Windows.Forms.ProgressBar myProgressBar;
private System.Windows.Forms.ToolStripMenuItem changeLanguageToolStripMenuItem;
private System.Windows.Forms.CheckBox cbViewTitles;
}
}

View File

@ -63,6 +63,7 @@ namespace EduNetworkBuilder
myTooltip.SetToolTip(rbHelp3, NB.Translate("NB_BuildWindMinor"));
myTooltip.SetToolTip(rbHelp4, NB.Translate("NB_BuildWindDecent"));
myTooltip.SetToolTip(btnHelp, NB.Translate("NB_BuildWindMsg"));
myTooltip.SetToolTip(cbViewTitles, NB.Translate("NB_cbViewTitles"));
myTooltip.Popup += myTooltip_Popup;
lblStatus.Text = "";
@ -382,6 +383,7 @@ namespace EduNetworkBuilder
UpdateMessages();
UpdateVisuals();
processing = true;
cbViewTitles.Checked = myNetwork.ShowLabelsHere;
Text = NB.Translate("NB_UpdteFrmName");
if (myNetwork.NetTitle.GetText() != "")
Text += ": " + myNetwork.NetTitle.GetText();
@ -1326,5 +1328,20 @@ namespace EduNetworkBuilder
this.Close(); //to turn off current app
}
}
private void cbViewTitles_CheckedChanged(object sender, EventArgs e)
{
if(!processing)
{
myNetwork.ShowLabelsHere = cbViewTitles.Checked;
bool didsomething = myNetwork.NoteActionDone(NetTestType.HelpRequest, "", "ViewButton");
if (didsomething)
{
UpdateForm();
myNetwork.TestForCompletion(true);
}
UpdateVisuals();
}
}
}
}

View File

@ -71,7 +71,7 @@ namespace EduNetworkBuilder
tbItemSize.Text = myNet.itemsize.ToString();
tbMessage.Text = myNet.NetMessage.GetText();
tbNetworkTitle.Text = myNet.NetTitle.GetText();
cbDisplayTitles.Checked = myNet.ShowLabels;
cbDisplayTitles.Checked = myNet.OptionShowLabels;
tbNetworkX.Text = myNet.myWidth.ToString();
tbNetworkY.Text = myNet.myHeight.ToString();
tbLevel.Text = myNet.Level.ToString();
@ -107,7 +107,8 @@ namespace EduNetworkBuilder
int.TryParse(tbItemSize.Text, out myNet.itemsize);
myNet.NetMessage.Add( tbMessage.Text);
myNet.NetTitle.Add(tbNetworkTitle.Text);
myNet.ShowLabels = cbDisplayTitles.Checked;
myNet.OptionShowLabels = cbDisplayTitles.Checked;
myNet.ShowLabelsHere = myNet.OptionShowLabels;
int.TryParse(tbNetworkX.Text, out myNet.myWidth);
int.TryParse(tbNetworkY.Text, out myNet.myHeight);
myNet.InvalidateEverything();

View File

@ -98,6 +98,11 @@
<dhost>?Button</dhost>
<thetest>HelpRequest</thetest>
</nettest>
<nettest>
<shost>pc0</shost>
<dhost>ViewButton</dhost>
<thetest>HelpRequest</thetest>
</nettest>
<nettest>
<shost>Help</shost>
<dhost>Read</dhost>

View File

@ -1,12 +1,14 @@
{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033\deflangfe1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Calibri;}}
{\*\generator Riched20 10.0.10586}{\*\mmathPr\mnaryLim0\mdispDef1\mwrapIndent1440 }\viewkind4\uc1
{\*\generator Riched20 10.0.10586}{\*\mmathPr\mdispDef1\mwrapIndent1440 }\viewkind4\uc1
\pard\nowidctlpar\sa200\sl276\slmult1\b\f0\fs22\lang9 Version 1.0.26\par
\b0 * Major graphics overhaul\par
- Packets move on timer\par
- Graphics drawn "smarter"\par
- Result is that things flow smoother. Loopback2 also works much nicer. \par
* Fixed minor issue with "help" puzzle\par
* Made help "?" button turn red when it is part of the puzzle\b\par
* Made help "?" button turn red when it is part of the puzzle\par
* Put checkmark to display names and IPs of devices on front form.\par
* Add a NetTest to show people to click on the "display Device names and IP" checkmark\b\par
Version 1.0.25\par
\b0 * Minor changes to help file\par
* Fixed size of labels on IP-Address editor box\par

View File

@ -1501,4 +1501,8 @@
<value>A partir du lien.</value>
<comment>P_StartingOnLink = Starting on link.</comment>
</data>
<data name="NB_cbViewTitles" xml:space="preserve">
<value>Display the name and IPs of network devices</value>
<comment>NetworkBuilder: NB_cbViewTitles = Display the name and IPs of network devices</comment>
</data>
</root>

View File

@ -1505,4 +1505,8 @@
<value>Starting on link.</value>
<comment>P_StartingOnLink = Starting on link.</comment>
</data>
<data name="NB_cbViewTitles" xml:space="preserve">
<value>Display the name and IPs of network devices</value>
<comment>NetworkBuilder: NB_cbViewTitles = Display the name and IPs of network devices</comment>
</data>
</root>