Show Progress bar when Printing all procedures

Added Cancel button for printing all procedures
Added Timer for automatic processes
This commit is contained in:
Rich 2012-09-17 19:14:29 +00:00
parent ffcffcc5ba
commit 41c9f223b0
7 changed files with 113 additions and 40 deletions

View File

@ -88,6 +88,7 @@ namespace VEPROMS
this.cbxOrPgBrk = new System.Windows.Forms.CheckBox(); this.cbxOrPgBrk = new System.Windows.Forms.CheckBox();
this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip(); this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip();
this.cbxCmpPRMSpfd = new System.Windows.Forms.CheckBox(); this.cbxCmpPRMSpfd = new System.Windows.Forms.CheckBox();
this.pbPDFsStatus = new DevComponents.DotNetBar.Controls.ProgressBarX();
((System.ComponentModel.ISupportInitialize)(this.tabControl1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tabControl1)).BeginInit();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabControlPanel3.SuspendLayout(); this.tabControlPanel3.SuspendLayout();
@ -104,8 +105,8 @@ namespace VEPROMS
// tabControl1 // tabControl1
// //
this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.tabControl1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(125)))), ((int)(((byte)(125)))), ((int)(((byte)(125))))); this.tabControl1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(125)))), ((int)(((byte)(125)))), ((int)(((byte)(125)))));
this.tabControl1.CanReorderTabs = true; this.tabControl1.CanReorderTabs = true;
this.tabControl1.Controls.Add(this.tabControlPanel3); this.tabControl1.Controls.Add(this.tabControlPanel3);
@ -128,6 +129,7 @@ namespace VEPROMS
// tabControlPanel3 // tabControlPanel3
// //
this.tabControlPanel3.AutoScroll = true; this.tabControlPanel3.AutoScroll = true;
this.tabControlPanel3.Controls.Add(this.pbPDFsStatus);
this.tabControlPanel3.Controls.Add(this.gpnlDebug); this.tabControlPanel3.Controls.Add(this.gpnlDebug);
this.tabControlPanel3.Controls.Add(this.grpDateSelector); this.tabControlPanel3.Controls.Add(this.grpDateSelector);
this.tabControlPanel3.Controls.Add(this.txbReviewDate); this.tabControlPanel3.Controls.Add(this.txbReviewDate);
@ -153,7 +155,7 @@ namespace VEPROMS
this.tabControlPanel3.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; this.tabControlPanel3.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.tabControlPanel3.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); this.tabControlPanel3.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199)))));
this.tabControlPanel3.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) this.tabControlPanel3.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right)
| DevComponents.DotNetBar.eBorderSide.Bottom))); | DevComponents.DotNetBar.eBorderSide.Bottom)));
this.tabControlPanel3.Style.GradientAngle = 90; this.tabControlPanel3.Style.GradientAngle = 90;
this.tabControlPanel3.TabIndex = 3; this.tabControlPanel3.TabIndex = 3;
this.tabControlPanel3.TabItem = this.tbGeneral; this.tabControlPanel3.TabItem = this.tbGeneral;
@ -342,7 +344,7 @@ namespace VEPROMS
// txbPDFLocation // txbPDFLocation
// //
this.txbPDFLocation.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.txbPDFLocation.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
// //
// //
// //
@ -457,7 +459,7 @@ namespace VEPROMS
// txbPDFName // txbPDFName
// //
this.txbPDFName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.txbPDFName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
// //
// //
// //
@ -531,7 +533,7 @@ namespace VEPROMS
this.tabControlPanel1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; this.tabControlPanel1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.tabControlPanel1.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); this.tabControlPanel1.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199)))));
this.tabControlPanel1.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) this.tabControlPanel1.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right)
| DevComponents.DotNetBar.eBorderSide.Bottom))); | DevComponents.DotNetBar.eBorderSide.Bottom)));
this.tabControlPanel1.Style.GradientAngle = 90; this.tabControlPanel1.Style.GradientAngle = 90;
this.tabControlPanel1.TabIndex = 5; this.tabControlPanel1.TabIndex = 5;
this.tabControlPanel1.TabItem = this.tbSettings; this.tabControlPanel1.TabItem = this.tbSettings;
@ -555,7 +557,7 @@ namespace VEPROMS
// txbPdfLocationS // txbPdfLocationS
// //
this.txbPdfLocationS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.txbPdfLocationS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
// //
// //
// //
@ -574,7 +576,6 @@ namespace VEPROMS
this.btnPdfLocation.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnPdfLocation.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnPdfLocation.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnPdfLocation.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnPdfLocation.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnPdfLocation.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnPdfLocation.FocusOnLeftMouseButtonDown = true;
this.btnPdfLocation.Image = ((System.Drawing.Image)(resources.GetObject("btnPdfLocation.Image"))); this.btnPdfLocation.Image = ((System.Drawing.Image)(resources.GetObject("btnPdfLocation.Image")));
this.btnPdfLocation.Location = new System.Drawing.Point(519, 3); this.btnPdfLocation.Location = new System.Drawing.Point(519, 3);
this.btnPdfLocation.Name = "btnPdfLocation"; this.btnPdfLocation.Name = "btnPdfLocation";
@ -604,7 +605,6 @@ namespace VEPROMS
this.btnWaterMarkOff.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnWaterMarkOff.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnWaterMarkOff.Checked = true; this.btnWaterMarkOff.Checked = true;
this.btnWaterMarkOff.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnWaterMarkOff.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnWaterMarkOff.FocusOnLeftMouseButtonDown = true;
this.btnWaterMarkOff.Location = new System.Drawing.Point(164, 84); this.btnWaterMarkOff.Location = new System.Drawing.Point(164, 84);
this.btnWaterMarkOff.Margin = new System.Windows.Forms.Padding(2); this.btnWaterMarkOff.Margin = new System.Windows.Forms.Padding(2);
this.btnWaterMarkOff.Name = "btnWaterMarkOff"; this.btnWaterMarkOff.Name = "btnWaterMarkOff";
@ -619,7 +619,6 @@ namespace VEPROMS
this.btnChgBarOff.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnChgBarOff.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnChgBarOff.Checked = true; this.btnChgBarOff.Checked = true;
this.btnChgBarOff.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnChgBarOff.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnChgBarOff.FocusOnLeftMouseButtonDown = true;
this.btnChgBarOff.Location = new System.Drawing.Point(164, 58); this.btnChgBarOff.Location = new System.Drawing.Point(164, 58);
this.btnChgBarOff.Margin = new System.Windows.Forms.Padding(2); this.btnChgBarOff.Margin = new System.Windows.Forms.Padding(2);
this.btnChgBarOff.Name = "btnChgBarOff"; this.btnChgBarOff.Name = "btnChgBarOff";
@ -634,7 +633,6 @@ namespace VEPROMS
this.btnDuplxOff.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnDuplxOff.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnDuplxOff.Checked = true; this.btnDuplxOff.Checked = true;
this.btnDuplxOff.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnDuplxOff.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnDuplxOff.FocusOnLeftMouseButtonDown = true;
this.btnDuplxOff.Location = new System.Drawing.Point(164, 111); this.btnDuplxOff.Location = new System.Drawing.Point(164, 111);
this.btnDuplxOff.Margin = new System.Windows.Forms.Padding(2); this.btnDuplxOff.Margin = new System.Windows.Forms.Padding(2);
this.btnDuplxOff.Name = "btnDuplxOff"; this.btnDuplxOff.Name = "btnDuplxOff";
@ -664,7 +662,6 @@ namespace VEPROMS
// //
this.btnDuplxOn.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnDuplxOn.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnDuplxOn.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnDuplxOn.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnDuplxOn.FocusOnLeftMouseButtonDown = true;
this.btnDuplxOn.Location = new System.Drawing.Point(123, 111); this.btnDuplxOn.Location = new System.Drawing.Point(123, 111);
this.btnDuplxOn.Margin = new System.Windows.Forms.Padding(2); this.btnDuplxOn.Margin = new System.Windows.Forms.Padding(2);
this.btnDuplxOn.Name = "btnDuplxOn"; this.btnDuplxOn.Name = "btnDuplxOn";
@ -678,7 +675,6 @@ namespace VEPROMS
// //
this.btnWaterMarkOn.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnWaterMarkOn.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnWaterMarkOn.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnWaterMarkOn.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnWaterMarkOn.FocusOnLeftMouseButtonDown = true;
this.btnWaterMarkOn.Location = new System.Drawing.Point(123, 84); this.btnWaterMarkOn.Location = new System.Drawing.Point(123, 84);
this.btnWaterMarkOn.Margin = new System.Windows.Forms.Padding(2); this.btnWaterMarkOn.Margin = new System.Windows.Forms.Padding(2);
this.btnWaterMarkOn.Name = "btnWaterMarkOn"; this.btnWaterMarkOn.Name = "btnWaterMarkOn";
@ -724,7 +720,6 @@ namespace VEPROMS
// //
this.btnChgBarOn.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnChgBarOn.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnChgBarOn.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnChgBarOn.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnChgBarOn.FocusOnLeftMouseButtonDown = true;
this.btnChgBarOn.Location = new System.Drawing.Point(123, 58); this.btnChgBarOn.Location = new System.Drawing.Point(123, 58);
this.btnChgBarOn.Margin = new System.Windows.Forms.Padding(2); this.btnChgBarOn.Margin = new System.Windows.Forms.Padding(2);
this.btnChgBarOn.Name = "btnChgBarOn"; this.btnChgBarOn.Name = "btnChgBarOn";
@ -756,7 +751,7 @@ namespace VEPROMS
this.tabControlPanel2.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; this.tabControlPanel2.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.tabControlPanel2.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); this.tabControlPanel2.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199)))));
this.tabControlPanel2.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) this.tabControlPanel2.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right)
| DevComponents.DotNetBar.eBorderSide.Bottom))); | DevComponents.DotNetBar.eBorderSide.Bottom)));
this.tabControlPanel2.Style.GradientAngle = 90; this.tabControlPanel2.Style.GradientAngle = 90;
this.tabControlPanel2.TabIndex = 2; this.tabControlPanel2.TabIndex = 2;
this.tabControlPanel2.TabItem = this.tbChangeBars; this.tabControlPanel2.TabItem = this.tbChangeBars;
@ -1026,7 +1021,6 @@ namespace VEPROMS
this.btnCreatePDF.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnCreatePDF.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCreatePDF.BackColor = System.Drawing.SystemColors.Control; this.btnCreatePDF.BackColor = System.Drawing.SystemColors.Control;
this.btnCreatePDF.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnCreatePDF.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnCreatePDF.FocusOnLeftMouseButtonDown = true;
this.btnCreatePDF.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnCreatePDF.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnCreatePDF.Location = new System.Drawing.Point(5, 281); this.btnCreatePDF.Location = new System.Drawing.Point(5, 281);
this.btnCreatePDF.Margin = new System.Windows.Forms.Padding(2); this.btnCreatePDF.Margin = new System.Windows.Forms.Padding(2);
@ -1044,7 +1038,6 @@ namespace VEPROMS
this.btnCancel.BackColor = System.Drawing.SystemColors.Control; this.btnCancel.BackColor = System.Drawing.SystemColors.Control;
this.btnCancel.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnCancel.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.FocusOnLeftMouseButtonDown = true;
this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnCancel.Location = new System.Drawing.Point(450, 281); this.btnCancel.Location = new System.Drawing.Point(450, 281);
this.btnCancel.Margin = new System.Windows.Forms.Padding(2); this.btnCancel.Margin = new System.Windows.Forms.Padding(2);
@ -1110,6 +1103,19 @@ namespace VEPROMS
this.cbxCmpPRMSpfd.UseVisualStyleBackColor = false; this.cbxCmpPRMSpfd.UseVisualStyleBackColor = false;
this.cbxCmpPRMSpfd.Visible = false; this.cbxCmpPRMSpfd.Visible = false;
// //
// pbPDFsStatus
//
//
//
//
this.pbPDFsStatus.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.pbPDFsStatus.Location = new System.Drawing.Point(7, 220);
this.pbPDFsStatus.Name = "pbPDFsStatus";
this.pbPDFsStatus.Size = new System.Drawing.Size(539, 23);
this.pbPDFsStatus.TabIndex = 87;
this.pbPDFsStatus.Text = "Procedures Converted to PDF";
this.pbPDFsStatus.Visible = false;
//
// DlgPrintProcedure // DlgPrintProcedure
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1214,5 +1220,6 @@ namespace VEPROMS
private System.Windows.Forms.CheckBox cbxOrPgBrk; private System.Windows.Forms.CheckBox cbxOrPgBrk;
private DevComponents.DotNetBar.SuperTooltip superTooltip1; private DevComponents.DotNetBar.SuperTooltip superTooltip1;
private System.Windows.Forms.CheckBox cbxCmpPRMSpfd; private System.Windows.Forms.CheckBox cbxCmpPRMSpfd;
private DevComponents.DotNetBar.Controls.ProgressBarX pbPDFsStatus;
} }
} }

View File

@ -218,7 +218,7 @@ namespace VEPROMS
private Timer _MyTimer; private Timer _MyTimer;
private void SetupForProcedure() private void SetupForProcedure()
{ {
this.Text = "Create PDF for " + ProcNum; if(_DocVersionInfo == null)this.Text = "Create PDF for " + ProcNum;
// get list of previous pdf files // get list of previous pdf files
// if no previous pdf file, then get path from frmVersionProperties // if no previous pdf file, then get path from frmVersionProperties
// dlgSelectFile.InitialDirectory = pdf path from frmVersionProperties // dlgSelectFile.InitialDirectory = pdf path from frmVersionProperties
@ -392,19 +392,26 @@ namespace VEPROMS
ChangeBarDefinition cbd = DetermineChangeBarSettings(); ChangeBarDefinition cbd = DetermineChangeBarSettings();
int n = _DocVersionInfo.Procedures.Count; int n = _DocVersionInfo.Procedures.Count;
int i = 0; int i = 0;
pbPDFsStatus.Maximum = n;
pbPDFsStatus.Visible = true;
this.Text = string.Format("Processing {0}", _DocVersionInfo.MyFolder.Name);
foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures) foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures)
{ {
MyProcedure = myProc; MyProcedure = myProc;
if (myProc.Sections != null) if (myProc.Sections != null)
{ {
SetupForProcedure(); SetupForProcedure();
this.Text = string.Format("Create PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n); 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)); 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));
frmStatus.CloseWhenDone = true; frmStatus.CloseWhenDone = true;
Application.DoEvents(); frmStatus.CancelStop = true;
frmStatus.ShowDialog(); frmStatus.ShowDialog();
if (frmStatus.CancelPrinting) break;
} }
} }
pbPDFsStatus.Visible = false;
if(!Automatic) if(!Automatic)
ShowDebugFiles(); ShowDebugFiles();
} }

View File

@ -120,9 +120,6 @@
<metadata name="docVersionConfigBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="docVersionConfigBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>321, 17</value> <value>321, 17</value>
</metadata> </metadata>
<metadata name="docVersionConfigBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>321, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnPdfLocation.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="btnPdfLocation.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>

View File

@ -35,6 +35,7 @@ namespace VEPROMS
this.tmrRun = new System.Windows.Forms.Timer(this.components); this.tmrRun = new System.Windows.Forms.Timer(this.components);
this.btnOpenFolder = new DevComponents.DotNetBar.ButtonX(); this.btnOpenFolder = new DevComponents.DotNetBar.ButtonX();
this.btnOpenPDF = new DevComponents.DotNetBar.ButtonX(); this.btnOpenPDF = new DevComponents.DotNetBar.ButtonX();
this.btnCancel = new DevComponents.DotNetBar.ButtonX();
this.SuspendLayout(); this.SuspendLayout();
// //
// lblStatus // lblStatus
@ -42,11 +43,11 @@ namespace VEPROMS
// //
// //
// //
this.lblStatus.BackgroundStyle.Class = "";
this.lblStatus.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.lblStatus.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.lblStatus.Location = new System.Drawing.Point(12, 21); this.lblStatus.Location = new System.Drawing.Point(9, 17);
this.lblStatus.Margin = new System.Windows.Forms.Padding(2);
this.lblStatus.Name = "lblStatus"; this.lblStatus.Name = "lblStatus";
this.lblStatus.Size = new System.Drawing.Size(304, 23); this.lblStatus.Size = new System.Drawing.Size(228, 19);
this.lblStatus.TabIndex = 0; this.lblStatus.TabIndex = 0;
this.lblStatus.Text = "Ready"; this.lblStatus.Text = "Ready";
// //
@ -55,11 +56,11 @@ namespace VEPROMS
// //
// //
// //
this.pb.BackgroundStyle.Class = "";
this.pb.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.pb.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.pb.Location = new System.Drawing.Point(12, 65); this.pb.Location = new System.Drawing.Point(9, 53);
this.pb.Margin = new System.Windows.Forms.Padding(2);
this.pb.Name = "pb"; this.pb.Name = "pb";
this.pb.Size = new System.Drawing.Size(721, 23); this.pb.Size = new System.Drawing.Size(541, 19);
this.pb.TabIndex = 1; this.pb.TabIndex = 1;
this.pb.TextVisible = true; this.pb.TextVisible = true;
// //
@ -71,9 +72,10 @@ namespace VEPROMS
// //
this.btnOpenFolder.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnOpenFolder.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnOpenFolder.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnOpenFolder.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnOpenFolder.Location = new System.Drawing.Point(658, 28); this.btnOpenFolder.Location = new System.Drawing.Point(494, 23);
this.btnOpenFolder.Margin = new System.Windows.Forms.Padding(2);
this.btnOpenFolder.Name = "btnOpenFolder"; this.btnOpenFolder.Name = "btnOpenFolder";
this.btnOpenFolder.Size = new System.Drawing.Size(75, 23); this.btnOpenFolder.Size = new System.Drawing.Size(56, 19);
this.btnOpenFolder.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.btnOpenFolder.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnOpenFolder.TabIndex = 2; this.btnOpenFolder.TabIndex = 2;
this.btnOpenFolder.Text = "Open Folder"; this.btnOpenFolder.Text = "Open Folder";
@ -84,25 +86,42 @@ namespace VEPROMS
// //
this.btnOpenPDF.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnOpenPDF.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnOpenPDF.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnOpenPDF.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnOpenPDF.Location = new System.Drawing.Point(568, 28); this.btnOpenPDF.Location = new System.Drawing.Point(426, 23);
this.btnOpenPDF.Margin = new System.Windows.Forms.Padding(2);
this.btnOpenPDF.Name = "btnOpenPDF"; this.btnOpenPDF.Name = "btnOpenPDF";
this.btnOpenPDF.Size = new System.Drawing.Size(75, 23); this.btnOpenPDF.Size = new System.Drawing.Size(56, 19);
this.btnOpenPDF.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.btnOpenPDF.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnOpenPDF.TabIndex = 3; this.btnOpenPDF.TabIndex = 3;
this.btnOpenPDF.Text = "Open PDF"; this.btnOpenPDF.Text = "Open PDF";
this.btnOpenPDF.Visible = false; this.btnOpenPDF.Visible = false;
this.btnOpenPDF.Click += new System.EventHandler(this.btnOpenPDF_Click); this.btnOpenPDF.Click += new System.EventHandler(this.btnOpenPDF_Click);
// //
// btnCancel
//
this.btnCancel.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnCancel.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnCancel.Location = new System.Drawing.Point(475, 21);
this.btnCancel.Margin = new System.Windows.Forms.Padding(2);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(77, 19);
this.btnCancel.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnCancel.TabIndex = 4;
this.btnCancel.Text = "Cancel";
this.btnCancel.Visible = false;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// frmPDFStatusForm // frmPDFStatusForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(745, 104); this.ClientSize = new System.Drawing.Size(559, 84);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOpenPDF); this.Controls.Add(this.btnOpenPDF);
this.Controls.Add(this.btnOpenFolder); this.Controls.Add(this.btnOpenFolder);
this.Controls.Add(this.pb); this.Controls.Add(this.pb);
this.Controls.Add(this.lblStatus); this.Controls.Add(this.lblStatus);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "frmPDFStatusForm"; this.Name = "frmPDFStatusForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "frmPDFStatusForm"; this.Text = "frmPDFStatusForm";
@ -119,5 +138,6 @@ namespace VEPROMS
private System.Windows.Forms.Timer tmrRun; private System.Windows.Forms.Timer tmrRun;
private DevComponents.DotNetBar.ButtonX btnOpenFolder; private DevComponents.DotNetBar.ButtonX btnOpenFolder;
private DevComponents.DotNetBar.ButtonX btnOpenPDF; private DevComponents.DotNetBar.ButtonX btnOpenPDF;
private DevComponents.DotNetBar.ButtonX btnCancel;
} }
} }

View File

@ -13,12 +13,30 @@ namespace VEPROMS
{ {
public partial class frmPDFStatusForm : Form public partial class frmPDFStatusForm : Form
{ {
private bool _CancelPrinting = false;
public bool CancelPrinting
{
get { return _CancelPrinting; }
set { _CancelPrinting = value; }
}
private bool _CloseWhenDone = false; private bool _CloseWhenDone = false;
public bool CloseWhenDone public bool CloseWhenDone
{ {
get { return _CloseWhenDone; } get { return _CloseWhenDone; }
set { _CloseWhenDone = value; } set { _CloseWhenDone = value; }
} }
private bool _CancelStop = false;
public bool CancelStop
{
get { return _CancelStop; }
set { _CancelStop = value; }
}
private bool _Stop = false;
public bool Stop
{
get { return _Stop; }
set { _Stop = value; }
}
private string _PDFPath; private string _PDFPath;
public string PDFPath public string PDFPath
@ -52,6 +70,7 @@ namespace VEPROMS
PDFPath = pdfPath; PDFPath = pdfPath;
this.Text = "Creating PDF of " + myItem.DisplayNumber; this.Text = "Creating PDF of " + myItem.DisplayNumber;
_NewLocation = newLocation; _NewLocation = newLocation;
DialogResult = DialogResult.OK;
} }
public bool AllowAllWatermarks public bool AllowAllWatermarks
{ {
@ -71,6 +90,7 @@ namespace VEPROMS
pb.Text = string.Format("Processing {0} ({1} of {2})", args.MyStatus, args.Progress + 1, pb.Maximum); pb.Text = string.Format("Processing {0} ({1} of {2})", args.MyStatus, args.Progress + 1, pb.Maximum);
} }
MyStatus = args.MyStatus; MyStatus = args.MyStatus;
Application.DoEvents();
} }
public string MyStatus public string MyStatus
{ {
@ -89,6 +109,8 @@ namespace VEPROMS
private void tmrRun_Tick(object sender, EventArgs e) private void tmrRun_Tick(object sender, EventArgs e)
{ {
tmrRun.Enabled = false; tmrRun.Enabled = false;
if (CancelStop) btnCancel.Visible = true;
Application.DoEvents();
MyPromsPrinter.StatusChanged += new PromsPrinterStatusEvent(pp_StatusChanged); MyPromsPrinter.StatusChanged += new PromsPrinterStatusEvent(pp_StatusChanged);
DateTime tStart = DateTime.Now; DateTime tStart = DateTime.Now;
_PdfFile = MyPromsPrinter.Print(PDFPath); _PdfFile = MyPromsPrinter.Print(PDFPath);
@ -113,18 +135,21 @@ namespace VEPROMS
return; return;
} }
} }
private void btnOpenPDF_Click(object sender, EventArgs e) private void btnOpenPDF_Click(object sender, EventArgs e)
{ {
System.Diagnostics.Process.Start(_PdfFile); System.Diagnostics.Process.Start(_PdfFile);
this.Close(); this.Close();
} }
private void btnOpenFolder_Click(object sender, EventArgs e) private void btnOpenFolder_Click(object sender, EventArgs e)
{ {
System.Diagnostics.Process.Start("Explorer", "/select," + _PdfFile); System.Diagnostics.Process.Start("Explorer", "/select," + _PdfFile);
this.Close(); this.Close();
} }
private void btnCancel_Click(object sender, EventArgs e)
{
CancelPrinting = true;
btnCancel.Text = "Cancelled";
btnCancel.Enabled = false;
}
} }
} }

View File

@ -99,6 +99,7 @@ namespace VEPROMS
this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip(); this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.tmrTreeView = new System.Windows.Forms.Timer(this.components); this.tmrTreeView = new System.Windows.Forms.Timer(this.components);
this.tmrAutomatic = new System.Windows.Forms.Timer(this.components);
this.toolsPanel = new DevComponents.DotNetBar.ExpandablePanel(); this.toolsPanel = new DevComponents.DotNetBar.ExpandablePanel();
this.toolsTabs = new DevComponents.DotNetBar.TabControl(); this.toolsTabs = new DevComponents.DotNetBar.TabControl();
this.annotationSearch = new DevComponents.DotNetBar.TabControlPanel(); this.annotationSearch = new DevComponents.DotNetBar.TabControlPanel();
@ -1055,6 +1056,11 @@ namespace VEPROMS
this.tmrTreeView.Interval = 10; this.tmrTreeView.Interval = 10;
this.tmrTreeView.Tick += new System.EventHandler(this.tmrTreeView_Tick); this.tmrTreeView.Tick += new System.EventHandler(this.tmrTreeView_Tick);
// //
// tmrAutomatic
//
this.tmrAutomatic.Interval = 100;
this.tmrAutomatic.Tick += new System.EventHandler(this.tmrAutomatic_Tick);
//
// toolsPanel // toolsPanel
// //
this.toolsPanel.CanvasColor = System.Drawing.SystemColors.Control; this.toolsPanel.CanvasColor = System.Drawing.SystemColors.Control;
@ -1465,6 +1471,7 @@ namespace VEPROMS
private DevComponents.DotNetBar.ButtonX btnAnnoDetailsPushPin; private DevComponents.DotNetBar.ButtonX btnAnnoDetailsPushPin;
private DevComponents.DotNetBar.ButtonItem buttonItem1; private DevComponents.DotNetBar.ButtonItem buttonItem1;
private System.Windows.Forms.Timer tmrTreeView; private System.Windows.Forms.Timer tmrTreeView;
private System.Windows.Forms.Timer tmrAutomatic;
private Volian.Controls.Library.AnnotationDetails ctrlAnnotationDetails; private Volian.Controls.Library.AnnotationDetails ctrlAnnotationDetails;
private DevComponents.DotNetBar.ButtonItem btnHelp; private DevComponents.DotNetBar.ButtonItem btnHelp;
private DevComponents.DotNetBar.ButtonItem btnHelpManual; private DevComponents.DotNetBar.ButtonItem btnHelpManual;

View File

@ -532,7 +532,7 @@ namespace VEPROMS
tmrShutDown.Enabled = true; tmrShutDown.Enabled = true;
} }
else else
RunAutomatic(); tmrAutomatic.Enabled = true;
// Shutoff UpdateFormats for Production Mode // Shutoff UpdateFormats for Production Mode
if (Volian.Base.Library.VlnSettings.ProductionMode) if (Volian.Base.Library.VlnSettings.ProductionMode)
btnAdmin.Visible = false; btnAdmin.Visible = false;
@ -600,7 +600,12 @@ namespace VEPROMS
} }
} }
} }
if(ranAuto) this.Close(); if (ranAuto)
{
Volian.Base.Library.DebugPagination.Close();
Volian.Base.Library.DebugText.Close();
this.Close();
}
} }
private bool _RunNext = false; private bool _RunNext = false;
//void prnDlg_FormClosed(object sender, FormClosedEventArgs e) //void prnDlg_FormClosed(object sender, FormClosedEventArgs e)
@ -835,6 +840,11 @@ namespace VEPROMS
tv.Enabled = true; tv.Enabled = true;
if (giveTvFocus) tv.Focus(); if (giveTvFocus) tv.Focus();
} }
private void tmrAutomatic_Tick(object sender, EventArgs e)
{
tmrAutomatic.Enabled = false; // Timer has now fired
RunAutomatic();
}
private void tv_BeforeExpand(object sender, TreeViewCancelEventArgs e) private void tv_BeforeExpand(object sender, TreeViewCancelEventArgs e)
{ {
VETreeNode tn = ((VETreeNode)e.Node); VETreeNode tn = ((VETreeNode)e.Node);