Merge pull request 'C2024-001-Quick-Print-In-ribbon' (#204) from C2024-001-Quick-Print-In-ribbon into Development

code looked good.
This commit is contained in:
John Jenko 2024-01-11 14:25:53 -05:00
commit 1be087a279
6 changed files with 1684 additions and 1602 deletions

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,6 @@ using DescriptiveEnum;
using Volian.Base.Library;
using Volian.Print.Library;
using JR.Utils.GUI.Forms;
using System.Diagnostics;
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
@ -45,7 +44,7 @@ namespace VEPROMS
public FindReplace dlgFindReplace = null;
public VlnSpellCheck SpellChecker = null;
private Int64 _LastContentChange;
public Int64 LastContentChange
{
get { return _LastContentChange; }
@ -88,6 +87,8 @@ namespace VEPROMS
// multiple events because the print dialog will be displayed for each time the event was added.
_SelectedStepTabPanel.MyStepTabRibbon.PrintRequest -= new StepTabRibbonEvent(MyStepTabRibbon_PrintRequest);
_SelectedStepTabPanel.MyStepTabRibbon.PrintRequest += new StepTabRibbonEvent(MyStepTabRibbon_PrintRequest);
_SelectedStepTabPanel.MyStepTabRibbon.QPrintRequest -= new StepTabRibbonEvent(MyStepTabRibbon_QPrintRequest);
_SelectedStepTabPanel.MyStepTabRibbon.QPrintRequest += new StepTabRibbonEvent(MyStepTabRibbon_QPrintRequest);
_SelectedStepTabPanel.MyStepTabRibbon.ProgressBar = bottomProgBar;
_SelectedStepTabPanel.MyStepTabRibbon.ContActionSummaryRequest -= MyStepTabRibbon_ContActionSummaryRequest;
_SelectedStepTabPanel.MyStepTabRibbon.ContActionSummaryRequest += MyStepTabRibbon_ContActionSummaryRequest;
@ -1154,7 +1155,7 @@ namespace VEPROMS
pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
}
void tv_QPrintProcedure(object sender, vlnTreeEventArgs args) // Quick Print
void tv_QPrintProcedure(object sender, vlnTreeEventArgs args) // Quick Print right click menu on Procedure name.
{
try
{
@ -1408,14 +1409,75 @@ namespace VEPROMS
//added by jcb 20130718 to support create pdf button when multi-unit and user selects a unit
pi.MyDocVersion.DocVersionConfig.SelectedSlave = pi.ProcedureConfig.SelectedSlave;
DlgPrintProcedure prnDlg = new DlgPrintProcedure(pi);
prnDlg.SelectedSlave = pi.ProcedureConfig.SelectedSlave == 0 ? -1 : pi.ProcedureConfig.SelectedSlave; //added by jcb 20130718 to support create pdf button when multi-unit and user selects a unit
prnDlg.MySessionInfo = MySessionInfo;
prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window
try
{
using (DlgPrintProcedure prnDlg = new DlgPrintProcedure(pi))
{
prnDlg.SelectedSlave = pi.ProcedureConfig.SelectedSlave == 0 ? -1 : pi.ProcedureConfig.SelectedSlave; //added by jcb 20130718 to support create pdf button when multi-unit and user selects a unit
prnDlg.MySessionInfo = MySessionInfo;
prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window
//added by jcb 20130718 to support create pdf button when multi-unit and user selects a unit
pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
}
}
catch (Exception ex)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("Could not create PDF Print");
sb.AppendLine();
MessageBox.Show(sb.ToString(), "Error when creating PDF Print", MessageBoxButtons.OK, MessageBoxIcon.Warning);
_MyLog.Warn("Failed to create PDF print", ex);
}
}
void MyStepTabRibbon_QPrintRequest(object sender, StepTabRibbonEventArgs args)
{
// Fix for B2013-173:
// if the user did the print by using the shortcut keys 'Ctrl-P' the arguments sent in
// is the first opened procedure rather than the active procedure. So check for this
// and if they are not the same, use the CurrentItem from the main frmVEPROMS.
ProcedureInfo piThis = null;
if (_CurrentItem != null) piThis = _CurrentItem.MyProcedure;
ProcedureInfo pi = args.Proc as ProcedureInfo;
if (piThis != null && pi.ItemID != piThis.ItemID) pi = piThis;
// Check if Procedure Info is null
if (pi == null) return;
//added by jcb 20130718 to support create pdf button when multi-unit and user selects a unit
pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
pi.MyDocVersion.DocVersionConfig.SelectedSlave = pi.ProcedureConfig.SelectedSlave;
try
{
using (DlgPrintProcedure prnDlg = new DlgPrintProcedure(pi))
{
prnDlg.SelectedSlave = pi.ProcedureConfig.SelectedSlave == 0 ? -1 : pi.ProcedureConfig.SelectedSlave; //added by jcb 20130718 to support create pdf button when multi-unit and user selects a unit
prnDlg.MySessionInfo = MySessionInfo;
prnDlg.SetupForProcedure(); // Setup filename
//prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window
prnDlg.QPCreatePDF(); // Create Print report
//added by jcb 20130718 to support create pdf button when multi-unit and user selects a unit
pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
}
}
catch (Exception ex)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("Could not create PDF Print");
sb.AppendLine();
MessageBox.Show(sb.ToString(), "Error when creating PDF Print", MessageBoxButtons.OK, MessageBoxIcon.Warning);
_MyLog.Warn("Failed to create PDF print", ex);
}
}
void displaySearch1_PrintRequest(object sender, DisplaySearchEventArgs args)
@ -4897,26 +4959,11 @@ namespace VEPROMS
_MyLog.Error(str, ex);
}
}
}
private void btnShowErrFld_Click(object sender, EventArgs e)
{
string path = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
path = path + @"\Documents\VEPROMS";
if (Directory.Exists(path))
{
Process.Start("explorer.exe", path);
}
}
#region (Lock stuff / used for multi-user support)
private void btnHelp_Click(object sender, EventArgs e)
{
}
}
#region (Lock stuff / used for multi-user support)
public class TabItemsToClose : Stack<DisplayTabItem>
public class TabItemsToClose : Stack<DisplayTabItem>
{
public void PushDTI(DisplayTabItem dti)
{

View File

@ -188,11 +188,6 @@
llg/yF+gIjK+CZq8XgAAAABJRU5ErkJggg==
</value>
</data>
<data name="btnShowErrFld.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAANUlEQVR4nGNgoBR8ahL8jw1/bBTooMiAT8Qa8gmPAUQZ8n+Z3n9KMMOoAf9Hw0CPCmEw4AAA71z+QhwwNhoAAAAASUVORK5CYII=
</value>
</data>
<data name="office2007StartButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
R0lGODlhGwAVAIcAANmsrP7+/tqtrdmrq9Wjo9uwsNmtrf79/dSgoP/+/tShodalpdqsrN20tN64uNqv
@ -455,7 +450,7 @@
<value>164, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
<value>64</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@ -1029,10 +1029,23 @@ namespace Volian.Controls.Library
// OpenEnhancedDocument(this, args);
//}
public event StepTabRibbonEvent PrintRequest;
private void OnPrintRequest(StepTabRibbonEventArgs args)
public event StepTabRibbonEvent QPrintRequest;
private void OnPrintRequest(StepTabRibbonEventArgs args, int prttyp = 0)
{
if (PrintRequest != null)
PrintRequest(this, args);
if (PrintRequest != null) {
if (prttyp == 0)
{
PrintRequest(this, args);
}
}
if (QPrintRequest != null)
{
if (prttyp == 1)
{
QPrintRequest(this, args);
}
}
}
public event StepTabRibbonEvent ContActionSummaryRequest;
private void OnContActionSummaryRequest(StepTabRibbonEventArgs args)
@ -1947,7 +1960,7 @@ namespace Volian.Controls.Library
rtabChgId.Visible = MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds;
}
#region submenu for printing child procedures
#region submenu for printing child procedures
// C2020-013 add unit (child) submenu to create PDF and create CAS buttons
private void miMultiUnit_Click(object sender, EventArgs e)
{
@ -1956,12 +1969,16 @@ namespace Volian.Controls.Library
DevComponents.DotNetBar.ButtonItem mip = mi.Parent as DevComponents.DotNetBar.ButtonItem;
int selectedChild = (int)mi.Tag;
if (selectedChild == 0) return; // unit (child) not selected
MyItemInfo.MyProcedure.ProcedureConfig.SelectedSlave = (int) mi.Tag;
switch (mip.Text)
{
case "Create":
btnPdfCreate_Click(sender, e);
break;
case "Quick\r\nPrint":
btnPdfQuickCreate_Click(sender, e);
break;
case "Cont. Act\r\nSummary":
btnCASCreate_Click(sender, e);
break;
@ -1973,6 +1990,9 @@ namespace Volian.Controls.Library
btnPdfCreate.SubItems.Clear();
btnPdfCreate.Tag = null;
btnPdfCreate.Click -= new System.EventHandler(btnPdfCreate_Click);
btnPdfQuickCreate.SubItems.Clear();
btnPdfQuickCreate.Tag = null;
btnPdfQuickCreate.Click -= new System.EventHandler(btnPdfQuickCreate_Click);
btnCASCreate.SubItems.Clear();
btnCASCreate.Tag = null;
btnCASCreate.Click -= new System.EventHandler(btnCASCreate_Click);
@ -1990,12 +2010,16 @@ namespace Volian.Controls.Library
btnPdfCreate.SubItems.Add(btn);
btn = MakeSubMenuButton(s, k, miMultiUnit_Click);
btn.Enabled = procAppl;
btnPdfQuickCreate.SubItems.Add(btn);
btn = MakeSubMenuButton(s, k, miMultiUnit_Click);
btn.Enabled = procAppl;
btnReviewCreatePDF.SubItems.Add(btn);
btn = MakeSubMenuButton(s, k, miMultiUnit_Click);
btn.Enabled = procAppl;
btnCASCreate.SubItems.Add(btn);
}
btnPdfCreate.AutoExpandOnClick = true;
btnPdfQuickCreate.AutoExpandOnClick = true;
btnReviewCreatePDF.AutoExpandOnClick = true;
btnCASCreate.AutoExpandOnClick = true;
}
@ -4086,7 +4110,14 @@ namespace Volian.Controls.Library
{
if (MyItemInfo == null) return; // if creating a pdf before rtb exists, return;
if (MyEditItem != null) MyEditItem.SaveCurrentAndContents();
OnPrintRequest(new StepTabRibbonEventArgs(MyItemInfo.MyProcedure));
OnPrintRequest(new StepTabRibbonEventArgs(MyItemInfo.MyProcedure), 0);
}
private void btnPdfQuickCreate_Click(object sender, EventArgs e)
{
if (MyItemInfo == null) return; // if creating a pdf before rtb exists, return;
if (MyEditItem != null) MyEditItem.SaveCurrentAndContents();
OnPrintRequest(new StepTabRibbonEventArgs(MyItemInfo.MyProcedure), 1);
}
private void btnCASCreate_Click(object sender, EventArgs e)

View File

@ -165,6 +165,50 @@
<metadata name="superTooltipRibbon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="btnPdfQuickCreate.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAAr2AAAK9gHCr3ADAAAI0UlE
QVRYR53XSWwb1xkH8JElS+i50KUIempB9FyguQRoiya2gSyHOEWQADnkFtRxmwRBENcIigZx0sDNVsCJ
d1mSZcv0EluS7aS2JFv7QslaSIkUd3KG+zILZx/y3++RVBzvTgf4YzhDit/vfe89YsSx41/79nN79/yj
9ejBEz/vOtLb2XWkp7PrKOVYIydYjnffThdds/z43vGezu4TvZ09J04209d5svtUZy+d93/62c8unh+s
17rvMdh3k+s/fPmXKyPpq4GJ4mJwpugJe0qe6FLJE/eWPIn1socPlD1CqOxJRURPOip6MjE6s9DrVIS9
V/LwwaIn4S94Yms5T2Q16wkupT1+D+8ZuTL951K8yrW0tDQr3nVc7p3k3Ie+dwVuyKnYjIXkgoXUio3s
uo180EEx6qCcqEISapDTNShZoJID1HzjrGTZ/SrElINS0kI+qiMTUiH4ZcS9ZUwNL+2ChAcDhnonuDOH
vnP5RyUhOmUiMW9CWLaQ8VnIBQgRtlGMESLpEKJaL8aKVhIaKhnnNiLDEDYhTORjDFEBH5Awc2N5FzQ0
q93nGOwZ5/oPfudaHxEJYCA+b4BfMpH2Wsj6aUQhBmBf7EAUCJG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OE1ii+MkDf0Q8JeusdC9yO+CKJrUUTXo4j7
CbORqIOmx6ffhPMAQEdHB3e69xx39GD3L6bHPAfnpxfPzk7NuWcmZtzTY9PuqZtT7snRSffkyKR7Ynii
kesT7vHr443ztfH6681r9v7k8KR7amTKPX1j2j0zNuO+dOHS9hyfa1a862hra+O2tm/l2tvbW9raW9u3
drR1tLa1dmxp3dLR0trS0bKlEa6F66CP/79ppdznn1OO+x8FMcZP/Ws5zwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btnDelelete.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6