diff --git a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs index 3fe025ba..0c2e556f 100644 --- a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs +++ b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs @@ -102,7 +102,7 @@ namespace VEPROMS gpnlDebug.Visible = Volian.Base.Library.VlnSettings.DebugMode; } public DlgPrintProcedure(ProcedureInfo pi) - { + { InitializeComponent(); _AllProcedures = false; _DocVersionConfig = (pi.ActiveParent as DocVersionInfo).DocVersionConfig; @@ -112,7 +112,16 @@ namespace VEPROMS PrepForAllOrOne(true); cbxOpenAfterCreate2.Checked = pi.MyDocVersion.DocVersionConfig.Print_AlwaysViewPDFAfterCreate; } - + /// + /// RHM 20120925 Added so that the dialog would center over the PROMS window + /// + /// + protected override void OnActivated(EventArgs e) + { + base.OnActivated(e); + if (Owner != null) + Location = new Point(Owner.Left + Owner.Width / 2 - Width / 2, Owner.Top + Owner.Height/2 - Height/2); + } private void HandleDocVersionSettings() { @@ -404,7 +413,8 @@ namespace VEPROMS pbPDFsStatus.TextVisible = true; pbPDFsStatus.Text = string.Format("Creating PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n); pbPDFsStatus.Value = i; - frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNum, RevDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left,Bottom)); + // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. + frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNum, RevDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left,Bottom-50)); frmStatus.CloseWhenDone = true; frmStatus.CancelStop = true; frmStatus.ShowDialog(); @@ -418,7 +428,7 @@ namespace VEPROMS private void CreateDebugFiles() { if (cbxDebugPagination.Checked) - Volian.Base.Library.DebugPagination.Open(PDFPath + "\\DebugPagaination.txt"); + Volian.Base.Library.DebugPagination.Open(PDFPath + "\\DebugPagination.txt"); // RHM 20120925 Corrected spelling if (cbxDebugText.Checked) Volian.Base.Library.DebugText.Open(PDFPath + "\\DebugText.txt"); } @@ -439,7 +449,8 @@ namespace VEPROMS // Determine change bar settings. First get from config & then see if override from dialog. // Also check that format allows override. ChangeBarDefinition cbd = DetermineChangeBarSettings(); - frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNum, RevDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom)); + // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. + frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNum, RevDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50)); frmStatus.ShowDialog(); this.Close(); ShowDebugFiles(); diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index 103a2a58..5014ba59 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -362,7 +362,7 @@ namespace VEPROMS if (dvi == null) return; tc.SaveCurrentEditItem(); DlgPrintProcedure prnDlg = new DlgPrintProcedure(dvi); - prnDlg.Show(); + prnDlg.Show(this); // RHM 20120925 - Center dialog over PROMS window } void tv_PrintProcedure(object sender, vlnTreeEventArgs args) { @@ -370,7 +370,7 @@ namespace VEPROMS if (pi == null) return; tc.SaveCurrentEditItem(pi); DlgPrintProcedure prnDlg = new DlgPrintProcedure(pi); - prnDlg.Show(); + prnDlg.Show(this); // RHM 20120925 - Center dialog over PROMS window } void RefreshDisplayHistory(object sender) { @@ -422,7 +422,7 @@ namespace VEPROMS ProcedureInfo pi = args.Proc as ProcedureInfo; if (pi == null) return; DlgPrintProcedure prnDlg = new DlgPrintProcedure(pi); - prnDlg.Show(); + prnDlg.Show(this); // RHM 20120925 - Center dialog over PROMS window } void displaySearch1_PrintRequest(object sender, DisplaySearchEventArgs args) { @@ -592,7 +592,7 @@ namespace VEPROMS if (dvi != null) { DlgPrintProcedure prnDlg = new DlgPrintProcedure(dvi,true); - prnDlg.ShowDialog(); + prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window //prnDlg.FormClosed += new FormClosedEventHandler(prnDlg_FormClosed); //while (!_RunNext) Application.DoEvents(); ranAuto = true; @@ -1895,7 +1895,7 @@ namespace VEPROMS //} //string pnum = DisplayText.StaticStripRtfCommands(this._CurrentItem.MyProcedure.ProcedureConfig.Number).Replace("\\u8209?", "-"); DlgPrintProcedure prnDlg = new DlgPrintProcedure(this._CurrentItem.MyProcedure);//dvi.DocVersionConfig,pnum); - prnDlg.Show(); + prnDlg.Show(this); // RHM 20120925 - Center dialog over PROMS window } private void lblResolution_Click(object sender, EventArgs e) diff --git a/PROMS/Volian.Print.Library/Grid2Pdf.cs b/PROMS/Volian.Print.Library/Grid2Pdf.cs index 054ed547..ddcd2e5e 100644 --- a/PROMS/Volian.Print.Library/Grid2Pdf.cs +++ b/PROMS/Volian.Print.Library/Grid2Pdf.cs @@ -197,7 +197,8 @@ namespace Volian.Print.Library } iTextSharp.text.Paragraph myPara = RtfToParagraph(str); myColumnText1.SetSimpleColumn(0, 0, w - 2, MyContentByte.PdfDocument.PageSize.Top); // Padding = 4 - myPara.MultipliedLeading = 1.2F; + myPara.MultipliedLeading = 1.00F; // RHM 20120925 - Line spacing should be 6 lines per inch. + myPara.SpacingAfter = 8; // RHM 20120925 - Add a line to properly space text from lines. myColumnText1.AddElement(myPara); //myColumnText1.Canvas.SetColorFill(PrintOverride.OverrideTextColor(System.Drawing.Color.Black)); float posBefore = myColumnText1.YLine; @@ -567,12 +568,14 @@ namespace Volian.Print.Library BordersToPdf(myColumnText, left, top, x, w, y, h ); float hAdjust = VeritcalTextAlignment(h); iTextSharp.text.pdf.ColumnText myColumnText1 = new iTextSharp.text.pdf.ColumnText(myColumnText.Canvas); - myColumnText1.SetSimpleColumn(1 + left + x, top - y - h, left + x + w, 1 + top - y - hAdjust); // 2 == Default Padding + float adjustTextLocation = mult * 4; // RHM 20120925 Move text down about 1 half line from the border + myColumnText1.SetSimpleColumn(1 + left + x, top - y - h , left + x + w, 1 + top - y - hAdjust - adjustTextLocation); // 2 == Default Padding MyPara.MultipliedLeading *= _MyPageHelper.YMultiplier; myColumnText1.AddElement(MyPara); myColumnText1.Go(); myColumnText.Canvas.RestoreState(); } + private static float _SixLinesPerInch = 12; // twips #endregion #region Private Text Methods private float VeritcalTextAlignment(float h) diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 7bbcc681..c80b8991 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -972,6 +972,7 @@ namespace Volian.Print.Library yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text yoff += (Height + (2 * SixLinesPerInch)); CalculateXOffset(itemInfo, maxRNO, formatInfo); + yoff = (float)Math.Ceiling(yoff); // RHM 20120925 - Make sure that yOff is an integer value after a grid } else if (itemInfo.IsFigure) // if a figure we've got to determine the size: { @@ -1003,7 +1004,7 @@ namespace Volian.Print.Library //yForCheckoff = yoff + Height - SixLinesPerInch; if (dropCheckoff) yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text - yoff += (Height + (2 * SixLinesPerInch)); + yoff += (Height + (SixLinesPerInch)); // RHM 20120925 - Eliminate extra space after Figure try {