From 6d3db35cfcb8683d7157f7465ef01b0d65895135 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Thu, 27 Sep 2018 14:41:10 -0500 Subject: [PATCH] Move Working on getting the listboxwindow not to disappear when we do regression testing --- EduNetworkBuilder/EduNetworkBuilder.csproj | 4 +- EduNetworkBuilder/ListBoxWindow.cs | 64 +++++++++++----------- EduNetworkBuilder/Network.cs | 1 + EduNetworkBuilder/NetworkBuilder.cs | 5 +- 4 files changed, 40 insertions(+), 34 deletions(-) diff --git a/EduNetworkBuilder/EduNetworkBuilder.csproj b/EduNetworkBuilder/EduNetworkBuilder.csproj index 5e05c7f..fa24d3e 100644 --- a/EduNetworkBuilder/EduNetworkBuilder.csproj +++ b/EduNetworkBuilder/EduNetworkBuilder.csproj @@ -112,7 +112,9 @@ LinkEditor.cs - + + Form + ListBoxWindow.cs diff --git a/EduNetworkBuilder/ListBoxWindow.cs b/EduNetworkBuilder/ListBoxWindow.cs index 6dd9e02..54f3a5f 100644 --- a/EduNetworkBuilder/ListBoxWindow.cs +++ b/EduNetworkBuilder/ListBoxWindow.cs @@ -14,38 +14,38 @@ using System.Resources; namespace EduNetworkBuilder { - - class MyPuzzleEntry - { - public string Title; - public string PuzzleName; - public bool isdone = false; - public string level = ""; - public bool InRegressionMode = false; - public bool HasTest = false; - public bool PassedTest = false; - public bool FailedTest = false; - - public override string ToString() - { - string donstr = ""; - if (InRegressionMode) - { - if (HasTest) donstr = "+ "; - else donstr = "- "; - if (PassedTest) donstr = "$ "; - if (FailedTest) donstr = "$ "; - return donstr + level + " " + this.Title; - } - else - { - if (isdone) donstr = "* "; - return donstr + level + " " + this.Title; - } - } - } public partial class ListBoxWindow : Form { + class MyPuzzleEntry + { + public string Title; + public string PuzzleName; + public bool isdone = false; + public string level = ""; + public bool InRegressionMode = false; + public bool HasTest = false; + public bool PassedTest = false; + public bool FailedTest = false; + + public override string ToString() + { + string donstr = ""; + if (InRegressionMode) + { + if (HasTest) donstr = "+ "; + else donstr = "- "; + if (PassedTest) donstr = "$ "; + if (FailedTest) donstr = "$ "; + return donstr + level + " " + this.Title; + } + else + { + if (isdone) donstr = "* "; + return donstr + level + " " + this.Title; + } + } + } + protected LBContents MyMode = LBContents.messages; protected DebugLevel WhatToDisplay = DebugLevel.info; //used when viewing packet-messages NetworkDevice myNetDevice; @@ -506,11 +506,11 @@ namespace EduNetworkBuilder { MyPuzzleEntry MPE = (MyPuzzleEntry)lbWindowData.SelectedItem; string TheName = MPE.PuzzleName; - Visible = false; + //Visible = false; BuilderWindow myWin = (BuilderWindow)Application.OpenForms["BuilderWindow"]; if (myWin != null) { - myWin.Activate(); + //myWin.Activate(); myWin.replayNetwork(TheName, 1); //Return back to the listbox window Visible = true; diff --git a/EduNetworkBuilder/Network.cs b/EduNetworkBuilder/Network.cs index 4f4f4b4..c2b8feb 100644 --- a/EduNetworkBuilder/Network.cs +++ b/EduNetworkBuilder/Network.cs @@ -1357,6 +1357,7 @@ namespace EduNetworkBuilder { if (Application.OpenForms[i].Name == "BuilderWindow") continue; //We do not kill the builder window if (EvenRTF && Application.OpenForms[i].Name == "RTFWindow") continue; //We do not kill the rtf window + //if (EvenRTF && Application.OpenForms[i].Name == "ListBoxWindow") continue; //Testing because listbox window is accidentally closed Application.OpenForms[i].Hide(); //make them disappear Application.OpenForms[i].Close(); //actually close them } diff --git a/EduNetworkBuilder/NetworkBuilder.cs b/EduNetworkBuilder/NetworkBuilder.cs index 8f36fc2..8180aa7 100644 --- a/EduNetworkBuilder/NetworkBuilder.cs +++ b/EduNetworkBuilder/NetworkBuilder.cs @@ -2968,8 +2968,11 @@ namespace EduNetworkBuilder //We want to show dialog, but it needs to go to the background. After that, //It returns from the show dialog. So we need to loop continuously until //It is completed. + DialogResult WhatHappened = DialogResult.Retry; while (!LBW.ClosingRegression) - LBW.ShowDialog(); + { + WhatHappened = LBW.ShowDialog(); + } } #endregion