C2024-001 Quick-Print-in-ribbon
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user