diff --git a/PROMS/Formats/fmtall/CATEBCKall.xml b/PROMS/Formats/fmtall/CATEBCKall.xml index d31a021c..2947594f 100644 Binary files a/PROMS/Formats/fmtall/CATEBCKall.xml and b/PROMS/Formats/fmtall/CATEBCKall.xml differ diff --git a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs index aaf2fab9..d11f1282 100644 --- a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs +++ b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs @@ -1206,18 +1206,23 @@ namespace VEPROMS private bool validateDate(TextBox txtDate) { DateTime dDate; - if (DateTime.TryParse(txtDate.Text, out dDate)) + if (!(txtDate.Text == "")) { - return true; - } - else - { - string txtDate2 = txtDate.Text; - string message = String.Format("Date {0} in wrong format" + System.Environment.NewLine + "Correct the revision date.", txtDate2); - string txtTitle = "Invalid Format"; - MessageBox.Show(message, txtTitle); - return false; + + if (DateTime.TryParse(txtDate.Text, out dDate)) + { + return true; + } + else + { + string txtDate2 = txtDate.Text; + string message = String.Format("Date {0} in wrong format" + System.Environment.NewLine + "Correct the revision date.", txtDate2); + string txtTitle = "Invalid Format"; + MessageBox.Show(message, txtTitle); + return false; + } } + return true; } private void txbRevDate_Enter(object sender, EventArgs e) diff --git a/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs b/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs index 91c20e91..9ef8319b 100644 --- a/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs +++ b/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs @@ -295,7 +295,10 @@ namespace VEPROMS } } - while (!MyPromsPrinter.MergeNotIncluded && _PdfFile == null && MessageBox.Show("Try Again?", "PDF Creation Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes); + // B2024-062 Added check for EmptyProcedure. We don't need to show the Try Again message if the procedure + // is empty, as it would be just be a waste of time for the user. + while (!MyPromsPrinter.MergeNotIncluded && _PdfFile == null && !MyPromsPrinter.EmptyProcedure && + MessageBox.Show("Try Again?", "PDF Creation Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes); if (_PdfFile == null) diff --git a/PROMS/Volian.Controls.Library/AnnotationDetails.cs b/PROMS/Volian.Controls.Library/AnnotationDetails.cs index a6ed00e8..dca9ff95 100644 --- a/PROMS/Volian.Controls.Library/AnnotationDetails.cs +++ b/PROMS/Volian.Controls.Library/AnnotationDetails.cs @@ -674,12 +674,15 @@ namespace Volian.Controls.Library { using (Annotation annotation = CurrentAnnotation.Get()) { - annotation.RtfText = rtxbComment.Rtf; - annotation.SearchText = rtxbComment.Text; - annotation.MyAnnotationType = annotationType; - annotation.DTS = DateTime.Now; - annotation.UserID = Volian.Base.Library.VlnSettings.UserID; - annotation.Save(); + if (annotation != null) // B2024-061 check for null reference + { + annotation.RtfText = rtxbComment.Rtf; + annotation.SearchText = rtxbComment.Text; + annotation.MyAnnotationType = annotationType; + annotation.DTS = DateTime.Now; + annotation.UserID = Volian.Base.Library.VlnSettings.UserID; + annotation.Save(); + } } } } diff --git a/PROMS/Volian.Controls.Library/DisplayTags.cs b/PROMS/Volian.Controls.Library/DisplayTags.cs index cadc1ba4..c191a66a 100644 --- a/PROMS/Volian.Controls.Library/DisplayTags.cs +++ b/PROMS/Volian.Controls.Library/DisplayTags.cs @@ -103,7 +103,7 @@ namespace Volian.Controls.Library public string TbFSwd { get {return tbFSWd.Text;} - set { tbFSWd.Text = value; tbFSWd.Refresh(); trBarFS.Value = Convert.ToInt32(value); } + set { tbFSWd.Text = value; tbFSWd.Refresh(); } // trBarFS.Value = Convert.ToInt32(value); } public string TbFSht @@ -111,7 +111,7 @@ namespace Volian.Controls.Library get { return tbFSHt.Text; } set { tbFSHt.Text = value; tbFSHt.Refresh(); _origFigureSizeRatio = float.Parse(value) / float.Parse(tbFSWd.Text); } } - + #endregion #region Constructor public DisplayTags() diff --git a/PROMS/Volian.Controls.Library/ImageItem.cs b/PROMS/Volian.Controls.Library/ImageItem.cs index c419f9c9..b51fcd9b 100644 --- a/PROMS/Volian.Controls.Library/ImageItem.cs +++ b/PROMS/Volian.Controls.Library/ImageItem.cs @@ -256,7 +256,8 @@ namespace Volian.Controls.Library private int _origCfgHt = 0; // keep track if original size was stored in cfg private int _origCfgWd = 0; private bool _pastedNew = false; // need this for flagging newly pasted image (may need to clear cfg) - private DisplayTags _displayTags; + private DisplayTags _displayTags = new DisplayTags(); + //House myhouse = new House(); #endregion #region Constructors @@ -316,8 +317,11 @@ namespace Volian.Controls.Library } private void SetWidthsAndHeights(System.Drawing.Image img) { + int wd = img.Width * MyStepPanel.DPI / 72; // converts from screen resolution's DPI to image's points (72/inch) int ht = img.Height * MyStepPanel.DPI / 72; + + if (MyItemInfo.MyContent.MyImage != null) // image is null if creating new. { ImageConfig ic = new ImageConfig(MyItemInfo.MyContent.MyImage); @@ -340,9 +344,9 @@ namespace Volian.Controls.Library _displayTags.TbFSwd = wd.ToString(); _displayTags.TbFSht = ht.ToString(); } - - } + + // the following gets called for 'NEW' images private E_ImageSource InsType = E_ImageSource.None; public ImageItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, EditItem nextEditItem, ImageItem.E_ImageSource insType, DisplayTags displayTags) diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index ee22b33e..bd55fe6f 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -138,6 +138,15 @@ namespace Volian.Print.Library get { return _Prefix; } set { _Prefix = value; } } + + // B2024-062 Set to true when the procedure being printed has no content. + // When set to true, will prevent the "Try Again" dialog from appearing + // and simply exit the print function + private bool _EmptyProcedure = false; + public bool EmptyProcedure + { + get { return _EmptyProcedure; } + } private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public event PromsPrinterStatusEvent StatusChanged; internal void OnStatusChanged(object sender, PromsPrintStatusArgs args) @@ -933,6 +942,9 @@ namespace Volian.Print.Library { MessageBox.Show("This procedure has no content and will not be printed.", "Empty Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information); ProfileTimer.Pop(profileDepth); + // B2024-062 Added check for EmptyProcedure. This is to prevent the Try Again message + // from appearing after the user clicks on the OK button from the Empty Procedure message + _EmptyProcedure = true; return null; } OnStatusChanged(myProcedure.DisplayNumber, PromsPrinterStatusType.ProgressSetup, myProcedure.Sections.Count);