C2018-012 code cleanup and improved design of print dialog

This commit is contained in:
John Jenko 2018-04-20 19:33:38 +00:00
parent 2b8e75735d
commit 62028e030c
3 changed files with 686 additions and 853 deletions

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,10 @@ namespace VEPROMS
{ {
public bool SaveLinks public bool SaveLinks
{ {
get { return cbxPDFLinks.Checked; } get
{
return swtbtnPDFLinks.Value;
}
} }
public bool RemoveTrailingHardReturnsAndManualPageBreaks public bool RemoveTrailingHardReturnsAndManualPageBreaks
{ {
@ -132,13 +135,14 @@ namespace VEPROMS
MyProcedure = dvi.Procedures[0].MyProcedure; MyProcedure = dvi.Procedures[0].MyProcedure;
// B2017-188: Don't allow user to uncheck the checkbox for printing blank pages if procedure has supplemental information // B2017-188: Don't allow user to uncheck the checkbox for printing blank pages if procedure has supplemental information
// This change was made to each of the DlgPrintProcedure methods. // This change was made to each of the DlgPrintProcedure methods.
if (_MyProcedure!=null && _MyProcedure.ProcHasSupInfoData) cbxBlankPgsForDuplex.Enabled = false; if (_MyProcedure != null && _MyProcedure.ProcHasSupInfoData) swtbtnBlankPgsForDuplex.Enabled = false;
btnCreatePDF.Text = "Create PDFs"; btnCreatePDF.Text = "Create PDFs";
HandleDocVersionSettings(); HandleDocVersionSettings();
PrepForAllOrOne(false); PrepForAllOrOne(false);
Rtf2iTextSharp.DoingComparison = cbxDebug.Checked; // RHM20150506 Multiline ItemID TextBox Rtf2iTextSharp.DoingComparison = cbxDebug.Checked; // RHM20150506 Multiline ItemID TextBox
// don't open all PDFs if doing All Procedures // don't open all PDFs if doing All Procedures
//cbxOpenAfterCreate2.Checked = dvi.DocVersionConfig.Print_AlwaysViewPDFAfterCreate; //cbxOpenAfterCreate2.Checked = dvi.DocVersionConfig.Print_AlwaysViewPDFAfterCreate;
expPrnSetting.Expanded = swtbtnBlankPgsForDuplex.Value || swtbtnChgBar.Value || swtbtnGeneratePlacekeeper.Value || swtbtnPDFLinks.Value || swtbtnPROMSVersion.Value || swtbtnWaterMark.Value;
} }
public DlgPrintProcedure(DocVersionInfo dvi) public DlgPrintProcedure(DocVersionInfo dvi)
{ {
@ -147,14 +151,14 @@ namespace VEPROMS
_AllProcedures = true; _AllProcedures = true;
_DocVersionConfig = dvi.DocVersionConfig; _DocVersionConfig = dvi.DocVersionConfig;
_DocVersionInfo = dvi; _DocVersionInfo = dvi;
cbxBlankPgsForDuplex.Checked = dvi.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts; swtbtnBlankPgsForDuplex.Value = dvi.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts;
MyProcedure = dvi.Procedures[0].MyProcedure; MyProcedure = dvi.Procedures[0].MyProcedure;
if (_MyProcedure != null && _MyProcedure.ProcHasSupInfoData) cbxBlankPgsForDuplex.Enabled = false; if (_MyProcedure != null && _MyProcedure.ProcHasSupInfoData) swtbtnBlankPgsForDuplex.Enabled = false;
btnCreatePDF.Text = "Create PDFs"; btnCreatePDF.Text = "Create PDFs";
HandleDocVersionSettings(); HandleDocVersionSettings();
PrepForAllOrOne(false); PrepForAllOrOne(false);
// don't open all PDFs if doing All Procedures // don't open all PDFs if doing All Procedures
//cbxOpenAfterCreate2.Checked = dvi.DocVersionConfig.Print_AlwaysViewPDFAfterCreate; expPrnSetting.Expanded = swtbtnBlankPgsForDuplex.Value || swtbtnChgBar.Value || swtbtnGeneratePlacekeeper.Value || swtbtnPDFLinks.Value || swtbtnPROMSVersion.Value || swtbtnWaterMark.Value;
} }
private void PrepForAllOrOne(bool oneProcedure) private void PrepForAllOrOne(bool oneProcedure)
{ {
@ -167,9 +171,9 @@ namespace VEPROMS
cbxOverwritePDF2.Visible = oneProcedure; cbxOverwritePDF2.Visible = oneProcedure;
cbxOverwritePDF2.Checked = true; cbxOverwritePDF2.Checked = true;
gpnlDebug.Visible = Volian.Base.Library.VlnSettings.DebugMode; gpnlDebug.Visible = Volian.Base.Library.VlnSettings.DebugMode;
cbxGeneratePlacekeeper.Checked = false; swtbtnGeneratePlacekeeper.Value = false;
cbxGenerateConActSum.Checked = false; cbxGenerateConActSum.Checked = false;
cbxGeneratePlacekeeper.Visible = oneProcedure && swtbtnGeneratePlacekeeper.Visible = lblGeneratePlacekeeper.Visible = oneProcedure &&
((MyProcedure.ActiveFormat.PlantFormat.FormatData.PurchaseOptions & E_PurchaseOptions.AutoPlacekeeper) == E_PurchaseOptions.AutoPlacekeeper); ((MyProcedure.ActiveFormat.PlantFormat.FormatData.PurchaseOptions & E_PurchaseOptions.AutoPlacekeeper) == E_PurchaseOptions.AutoPlacekeeper);
} }
private string _UnitNumber; private string _UnitNumber;
@ -184,18 +188,21 @@ namespace VEPROMS
get { return _UnitIndex; } get { return _UnitIndex; }
set { _UnitIndex = value; } set { _UnitIndex = value; }
} }
// C2018-012 - Code Cleanup - redesigned the Print Dialog to include a sliding panel and remplaced check boxes with ON/OFF switches
public DlgPrintProcedure(ProcedureInfo pi) public DlgPrintProcedure(ProcedureInfo pi)
{ {
InitializeComponent(); InitializeComponent();
_AllProcedures = false; _AllProcedures = false;
_DocVersionConfig = pi.MyDocVersion.DocVersionConfig; _DocVersionConfig = pi.MyDocVersion.DocVersionConfig;
cbxBlankPgsForDuplex.Checked = pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts; swtbtnBlankPgsForDuplex.Value = pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts;
MyProcedure = pi; MyProcedure = pi;
if (_MyProcedure != null && _MyProcedure.ProcHasSupInfoData) cbxBlankPgsForDuplex.Enabled = false; if (_MyProcedure != null && _MyProcedure.ProcHasSupInfoData) swtbtnBlankPgsForDuplex.Enabled = false;
btnCreatePDF.Text = "Create PDF"; btnCreatePDF.Text = "Create PDF";
HandleDocVersionSettings(); HandleDocVersionSettings();
PrepForAllOrOne(true); PrepForAllOrOne(true);
cbxOpenAfterCreate2.Checked = pi.MyDocVersion.DocVersionConfig.Print_AlwaysViewPDFAfterCreate; cbxOpenAfterCreate2.Checked = pi.MyDocVersion.DocVersionConfig.Print_AlwaysViewPDFAfterCreate;
expPrnSetting.Expanded = swtbtnBlankPgsForDuplex.Value || swtbtnChgBar.Value || swtbtnGeneratePlacekeeper.Value || swtbtnPDFLinks.Value || swtbtnPROMSVersion.Value || swtbtnWaterMark.Value;
} }
public DlgPrintProcedure(ProcedureInfo pi, bool automatic) // RHM20150506 Multiline ItemID TextBox public DlgPrintProcedure(ProcedureInfo pi, bool automatic) // RHM20150506 Multiline ItemID TextBox
{ {
@ -204,13 +211,14 @@ namespace VEPROMS
Rtf2iTextSharp.DoingComparison = cbxDebug.Checked; Rtf2iTextSharp.DoingComparison = cbxDebug.Checked;
_AllProcedures = false; _AllProcedures = false;
_DocVersionConfig = pi.MyDocVersion.DocVersionConfig; _DocVersionConfig = pi.MyDocVersion.DocVersionConfig;
cbxBlankPgsForDuplex.Checked = pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts; swtbtnBlankPgsForDuplex.Value = pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts;
MyProcedure = pi; MyProcedure = pi;
if (_MyProcedure != null && _MyProcedure.ProcHasSupInfoData) cbxBlankPgsForDuplex.Enabled = false; if (_MyProcedure != null && _MyProcedure.ProcHasSupInfoData) swtbtnBlankPgsForDuplex.Enabled = false;
btnCreatePDF.Text = "Create PDF"; btnCreatePDF.Text = "Create PDF";
HandleDocVersionSettings(); HandleDocVersionSettings();
PrepForAllOrOne(true); PrepForAllOrOne(true);
cbxOpenAfterCreate2.Checked = pi.MyDocVersion.DocVersionConfig.Print_AlwaysViewPDFAfterCreate; cbxOpenAfterCreate2.Checked = pi.MyDocVersion.DocVersionConfig.Print_AlwaysViewPDFAfterCreate;
expPrnSetting.Expanded = swtbtnBlankPgsForDuplex.Value || swtbtnChgBar.Value || swtbtnGeneratePlacekeeper.Value || swtbtnPDFLinks.Value || swtbtnPROMSVersion.Value || swtbtnWaterMark.Value;
} }
/// <summary> /// <summary>
/// RHM 20120925 Added so that the dialog would center over the PROMS window /// RHM 20120925 Added so that the dialog would center over the PROMS window
@ -231,25 +239,12 @@ namespace VEPROMS
if (txbPDFLocation.Text == null || txbPDFLocation.Text.Length == 0 || !Directory.Exists(txbPDFLocation.Text)) if (txbPDFLocation.Text == null || txbPDFLocation.Text.Length == 0 || !Directory.Exists(txbPDFLocation.Text))
txbPDFLocation.Text = VlnSettings.TemporaryFolder; txbPDFLocation.Text = VlnSettings.TemporaryFolder;
SetCompareVisibility(); SetCompareVisibility();
// if the default setting is 'SelectBeforePrinting', put up a message box to determine whether the user // if the default setting is 'SelectBeforePrinting', expand the Additional Print Settings panel
// wants change bars. If not, 'Change Bar' on the Setting tab is 'OFF' and no Change bar tab.
// If yes, the Change bar tab is the selected tab.
if (_DocVersionConfig.Print_ChangeBar == PrintChangeBar.SelectBeforePrinting) if (_DocVersionConfig.Print_ChangeBar == PrintChangeBar.SelectBeforePrinting)
{ {
DialogResult dr = DialogResult.Yes; swtbtnChgBar.Value = false;
if(!Automatic) cbxOvrrideDefChgBars.Checked = false;
dr = MessageBox.Show("Do you want change bars?", "Change Bars", MessageBoxButtons.YesNo); expPrnSetting.Expanded = true;
if (dr == DialogResult.Yes)
{
btnChgBarOn.PerformClick();
if(!Automatic) tabControl1.SelectedTab = tbChangeBars;
rbFormatDefault.PerformClick();
rbFormatDefault.Checked = true; // default to 'Format Default'
}
else
{
btnChgBarOff.PerformClick();
}
} }
} }
@ -265,32 +260,33 @@ namespace VEPROMS
cbxOpenAfterCreate2.Checked = _DocVersionConfig.Print_AlwaysViewPDFAfterCreate; cbxOpenAfterCreate2.Checked = _DocVersionConfig.Print_AlwaysViewPDFAfterCreate;
// Changebars on/off // Changebars on/off
if (_DocVersionConfig.Print_ChangeBar == PrintChangeBar.Without) if (_DocVersionConfig.Print_ChangeBar == PrintChangeBar.Without)
btnChgBarOff.PerformClick(); swtbtnChgBar.Value = false;
else else
btnChgBarOn.PerformClick(); swtbtnChgBar.Value = true;
// Watermark on/off // Watermark on/off
if (_DocVersionConfig.Print_Watermark == PrintWatermark.None) if (_DocVersionConfig.Print_Watermark == PrintWatermark.None)
btnWaterMarkOff.PerformClick(); swtbtnWaterMark.Value = false;
else else
btnWaterMarkOn.PerformClick(); swtbtnWaterMark.Value = true;
// Auto Duplexing on/off // Auto Duplexing on/off - Auto duplex was used only by Point Beach formats These buttons were removed from the dialog
// There was not print coding to support this format flag
if ((_MyProcedure.ActiveParent as DocVersionInfo).ActiveFormat.PlantFormat.FormatData.PrintData.AllowDuplex) //if ((_MyProcedure.ActiveParent as DocVersionInfo).ActiveFormat.PlantFormat.FormatData.PrintData.AllowDuplex)
{ //{
lblAutoDuplexing.Visible = true; // lblAutoDuplexing.Visible = true;
btnDuplxOff.Visible = true; // btnDuplxOff.Visible = true;
btnDuplxOn.Visible = true; // btnDuplxOn.Visible = true;
if (_DocVersionConfig.Print_DisableDuplex) // if (_DocVersionConfig.Print_DisableDuplex)
btnDuplxOff.PerformClick(); // btnDuplxOff.PerformClick();
else // else
btnDuplxOn.PerformClick(); // btnDuplxOn.PerformClick();
} //}
else //else
{ //{
lblAutoDuplexing.Visible = false; // lblAutoDuplexing.Visible = false;
btnDuplxOff.Visible = false; // btnDuplxOff.Visible = false;
btnDuplxOn.Visible = false; // btnDuplxOn.Visible = false;
} //}
SetCompareVisibility(); SetCompareVisibility();
// default to using OriginalPageBreaks (16bit page breaks) if App.config is set // default to using OriginalPageBreaks (16bit page breaks) if App.config is set
@ -427,73 +423,30 @@ namespace VEPROMS
this.Close(); this.Close();
} }
private void btnAvChgBarOn_Click(object sender, EventArgs e) private void swtbtnChgBar_ValueChanged(object sender, EventArgs e)
{ {
if (!btnChgBarOn.Checked) if (swtbtnChgBar.Value)
{ {
btnChgBarOn.Checked = true; ppGpbxUserSpecCB.Enabled = true;
btnChgBarOff.Checked = false;
tbChangeBars.Visible = true;
// to set which radio button (Format default or Custom) is checked, look at config data
switch (_DocVersionConfig.Print_ChangeBar) switch (_DocVersionConfig.Print_ChangeBar)
{ {
case PrintChangeBar.WithUserSpecified: case PrintChangeBar.WithUserSpecified:
rbCustom.Checked = true; cbxOvrrideDefChgBars.Checked = true;
break; break;
case PrintChangeBar.SelectBeforePrinting: case PrintChangeBar.SelectBeforePrinting:
case PrintChangeBar.WithDefault: case PrintChangeBar.WithDefault:
default: default:
rbFormatDefault.Checked = true; cbxOvrrideDefChgBars.Checked = false;
break; break;
} }
} }
} else
private void btnAvChgBarOff_Click(object sender, EventArgs e) ppGpbxUserSpecCB.Enabled = false;
{
if (!btnChgBarOff.Checked)
{
btnChgBarOff.Checked = true;
btnChgBarOn.Checked = false;
tbChangeBars.Visible = false;
}
} }
private void btnAdvDuplxOn_Click(object sender, EventArgs e) private void swtbtnWaterMark_ValueChanged(object sender, EventArgs e)
{ {
if (!btnDuplxOn.Checked) cbxWaterMark.Visible = swtbtnWaterMark.Value;
{
btnDuplxOn.Checked = true;
btnDuplxOff.Checked = false;
}
}
private void btnAdvDuplxOff_Click(object sender, EventArgs e)
{
if (!btnDuplxOff.Checked)
{
btnDuplxOff.Checked = true; ;
btnDuplxOn.Checked = false;
}
}
private void btnAdvWaterMarkOn_Click(object sender, EventArgs e)
{
if (!btnWaterMarkOn.Checked)
{
btnWaterMarkOn.Checked = true;
btnWaterMarkOff.Checked = false;
cbxWaterMark.Visible = true;
}
}
private void btnAdvWaterMarkOff_Click(object sender, EventArgs e)
{
if (!btnWaterMarkOff.Checked)
{
btnWaterMarkOff.Checked = true;
btnWaterMarkOn.Checked = false;
cbxWaterMark.Visible = false;
}
} }
private void txbPDFLocation_Leave(object sender, EventArgs e) private void txbPDFLocation_Leave(object sender, EventArgs e)
@ -540,7 +493,7 @@ namespace VEPROMS
_MyProcedure = value; _MyProcedure = value;
// if procedure has supplemental information, the automatially check the add blank pages for duplex printing // if procedure has supplemental information, the automatially check the add blank pages for duplex printing
if (_MyProcedure.ProcHasSupInfoData) if (_MyProcedure.ProcHasSupInfoData)
cbxBlankPgsForDuplex.Checked = true; swtbtnBlankPgsForDuplex.Value = true;
} }
} }
private int _SelectedSlave = 0; private int _SelectedSlave = 0;
@ -581,7 +534,7 @@ namespace VEPROMS
CreateDebugFiles(); CreateDebugFiles();
// If file exists, determine if overwrite checkbox allows overwrite, if not prompt. // If file exists, determine if overwrite checkbox allows overwrite, if not prompt.
Volian.Print.Library.Rtf2Pdf.PdfDebug = cbxDebug.Checked; Volian.Print.Library.Rtf2Pdf.PdfDebug = cbxDebug.Checked;
PrintWatermark pw = (btnWaterMarkOn.Checked) ? (PrintWatermark)cbxWaterMark.SelectedValue : PrintWatermark.None; PrintWatermark pw = (swtbtnWaterMark.Value) ? (PrintWatermark)cbxWaterMark.SelectedValue : PrintWatermark.None;
// Determine change bar settings. First get from config & then see if override from dialog. // Determine change bar settings. First get from config & then see if override from dialog.
// Also check that format allows override. // Also check that format allows override.
ChangeBarDefinition cbd = DetermineChangeBarSettings(); ChangeBarDefinition cbd = DetermineChangeBarSettings();
@ -609,7 +562,7 @@ namespace VEPROMS
// RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered.
frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked,
cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, myPDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, myPDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50),
cbxBlankPgsForDuplex.Checked, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, cbxPROMSVersion.Checked);//C2018-009 print PROMS version swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value);//C2018-009 print PROMS version
frmStatus.CloseWhenDone = true; frmStatus.CloseWhenDone = true;
Application.DoEvents(); Application.DoEvents();
frmStatus.CancelStop = true; frmStatus.CancelStop = true;
@ -632,7 +585,7 @@ namespace VEPROMS
// B2016-249 Output Procedure to folder associated with Parent Child // B2016-249 Output Procedure to folder associated with Parent Child
frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked,
cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, GetMultiunitPDFPath(), cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, GetMultiunitPDFPath(), cbd, txbPDFName.Text, new Point(Left, Bottom - 50),
cbxBlankPgsForDuplex.Checked, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, cbxPROMSVersion.Checked);//C2018-009 print PROMS version swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value);//C2018-009 print PROMS version
frmStatus.CloseWhenDone = true; frmStatus.CloseWhenDone = true;
Application.DoEvents(); Application.DoEvents();
frmStatus.CancelStop = true; frmStatus.CancelStop = true;
@ -658,7 +611,7 @@ namespace VEPROMS
// B2016-249 Output Procedure to folder associated with Parent Child // B2016-249 Output Procedure to folder associated with Parent Child
frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked,
cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, GetMultiunitPDFPath(), cbd, txbPDFName.Text, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, GetMultiunitPDFPath(), cbd, txbPDFName.Text,
new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, cbxPROMSVersion.Checked);//C2018-009 print PROMS version new Point(Left, Bottom - 50), swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value);//C2018-009 print PROMS version
frmStatus.CloseWhenDone = true; frmStatus.CloseWhenDone = true;
Application.DoEvents(); Application.DoEvents();
frmStatus.CancelStop = true; frmStatus.CancelStop = true;
@ -734,7 +687,7 @@ namespace VEPROMS
// If file exists, determine if overwrite checkbox allows overwrite, if not prompt. // If file exists, determine if overwrite checkbox allows overwrite, if not prompt.
Volian.Print.Library.Rtf2Pdf.PdfDebug = cbxDebug.Checked; Volian.Print.Library.Rtf2Pdf.PdfDebug = cbxDebug.Checked;
PrintWatermark pw = (btnWaterMarkOn.Checked) ? (PrintWatermark)cbxWaterMark.SelectedValue : PrintWatermark.None; PrintWatermark pw = (swtbtnWaterMark.Value) ? (PrintWatermark)cbxWaterMark.SelectedValue : PrintWatermark.None;
// Determine change bar settings. First get from config & then see if override from dialog. // Determine change bar settings. First get from config & then see if override from dialog.
// Also check that format allows override. // Also check that format allows override.
ChangeBarDefinition cbd = DetermineChangeBarSettings(); ChangeBarDefinition cbd = DetermineChangeBarSettings();
@ -748,8 +701,8 @@ namespace VEPROMS
// B2016-249 Output Procedure to folder associated with Parent Child // B2016-249 Output Procedure to folder associated with Parent Child
frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked,
cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, GetMultiunitPDFPath(), cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, GetMultiunitPDFPath(), cbd, txbPDFName.Text, new Point(Left, Bottom - 50),
cbxBlankPgsForDuplex.Checked, _AllProcedures || Automatic,Prefix,SaveLinks,RemoveTrailingHardReturnsAndManualPageBreaks,cbxPROMSVersion.Checked); //C2018-009 print PROMS version swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic,Prefix,SaveLinks,RemoveTrailingHardReturnsAndManualPageBreaks,swtbtnPROMSVersion.Value); //C2018-009 print PROMS version
frmStatus.MakePlaceKeeper = cbxGeneratePlacekeeper.Checked; frmStatus.MakePlaceKeeper = swtbtnGeneratePlacekeeper.Value;
frmStatus.MakeContinuousActionSummary = cbxGenerateConActSum.Checked; frmStatus.MakeContinuousActionSummary = cbxGenerateConActSum.Checked;
if (Automatic && cbxGenerateConActSum.Checked) if (Automatic && cbxGenerateConActSum.Checked)
frmStatus.OnlyShowContinuousActionSummary = true; frmStatus.OnlyShowContinuousActionSummary = true;
@ -775,7 +728,7 @@ namespace VEPROMS
ChangeBarDefinition cbd = new ChangeBarDefinition(); ChangeBarDefinition cbd = new ChangeBarDefinition();
// if the dialog has 'without change bar' selected, then just set without and return // if the dialog has 'without change bar' selected, then just set without and return
if (btnChgBarOff.Checked) if (!swtbtnChgBar.Value)
{ {
cbd.MyChangeBarType = PrintChangeBar.Without; cbd.MyChangeBarType = PrintChangeBar.Without;
return cbd; return cbd;
@ -783,7 +736,7 @@ namespace VEPROMS
// Get settings from dialog because these are used to set the initial dialog values and // Get settings from dialog because these are used to set the initial dialog values and
// any changes from user overrides the initial settings. // any changes from user overrides the initial settings.
ChangeBarData changeBarData = MyProcedure.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData; ChangeBarData changeBarData = MyProcedure.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData;
if (rbFormatDefault.Checked || _DocVersionConfig == null || _DocVersionConfig.Print_ChangeBar == PrintChangeBar.WithDefault) if (!cbxOvrrideDefChgBars.Checked || _DocVersionConfig == null || _DocVersionConfig.Print_ChangeBar == PrintChangeBar.WithDefault)
{ {
cbd.MyChangeBarType = PrintChangeBar.WithDefault; cbd.MyChangeBarType = PrintChangeBar.WithDefault;
cbd.MyChangeBarText = changeBarData.ChangeBarMessage == "ChgID" ? PrintChangeBarText.ChgID : cbd.MyChangeBarText = changeBarData.ChangeBarMessage == "ChgID" ? PrintChangeBarText.ChgID :
@ -791,7 +744,7 @@ namespace VEPROMS
changeBarData.ChangeBarMessage == "None" ? PrintChangeBarText.None : changeBarData.ChangeBarMessage == "None" ? PrintChangeBarText.None :
changeBarData.ChangeBarMessage == "RevNum" ? PrintChangeBarText.RevNum : PrintChangeBarText.UserDef; changeBarData.ChangeBarMessage == "RevNum" ? PrintChangeBarText.RevNum : PrintChangeBarText.UserDef;
} }
else if (rbCustom.Checked || _DocVersionConfig.Print_ChangeBar == PrintChangeBar.WithUserSpecified) else if (cbxOvrrideDefChgBars.Checked || _DocVersionConfig.Print_ChangeBar == PrintChangeBar.WithUserSpecified)
{ {
cbd.MyChangeBarLoc = _DocVersionConfig.Print_ChangeBarLoc; // (PrintChangeBarLoc)ppCmbxChgBarPos.SelectedIndex; cbd.MyChangeBarLoc = _DocVersionConfig.Print_ChangeBarLoc; // (PrintChangeBarLoc)ppCmbxChgBarPos.SelectedIndex;
cbd.MyChangeBarText = (PrintChangeBarText)ppCmbxChgBarTxtType.SelectedIndex; cbd.MyChangeBarText = (PrintChangeBarText)ppCmbxChgBarTxtType.SelectedIndex;
@ -873,11 +826,15 @@ namespace VEPROMS
private void SetCustomControls(bool enabled) private void SetCustomControls(bool enabled)
{ {
ppCmbxChgBarPos.Enabled = enabled;
ppCmbxChgBarTxtType.Enabled = enabled; ppCmbxChgBarTxtType.Enabled = enabled;
lblCbTxtType.Enabled = enabled;
ppTxbxChangeBarUserMsgOne.Enabled = enabled; ppTxbxChangeBarUserMsgOne.Enabled = enabled;
ppTxbxChangeBarUserMsgTwo.Enabled = enabled; ppTxbxChangeBarUserMsgTwo.Enabled = enabled;
} }
private void cbxOvrrideDefChgBars_CheckStateChanged(object sender, EventArgs e)
{
SetCustomControls(cbxOvrrideDefChgBars.Checked);
}
private void rbCustom_Click(object sender, EventArgs e) private void rbCustom_Click(object sender, EventArgs e)
{ {
@ -972,6 +929,29 @@ namespace VEPROMS
itm.Save(); itm.Save();
} }
} }
private void expPrnSetting_ExpandedChanged(object sender, DevComponents.DotNetBar.ExpandedChangeEventArgs e)
{
if (expPrnSetting.Expanded)
this.Size = new Size(this.Size.Width + (expPrnSetting.Size.Width - expPrnSetting.TitlePanel.Size.Height), this.Size.Height);
//else
// this.Size = new Size(this.Size.Width-(expPrnSetting.Size.Width-expPrnSetting.TitlePanel.Size.Height), this.Size.Height);
//Refresh();
}
private void expPrnSetting_ExpandedChanging(object sender, DevComponents.DotNetBar.ExpandedChangeEventArgs e)
{
if (expPrnSetting.Expanded)
//this.Size = new Size(this.Size.Width+(expPrnSetting.Size.Width-expPrnSetting.TitlePanel.Size.Height), this.Size.Height);
//else
this.Size = new Size(this.Size.Width-(expPrnSetting.Size.Width-expPrnSetting.TitlePanel.Size.Height), this.Size.Height);
//Refresh();
}
//private void cbxDebug_CheckedChanged(object sender, EventArgs e) //private void cbxDebug_CheckedChanged(object sender, EventArgs e)
//{ //{
// cbxCmpPRMSpfd.Visible = cbxDebug.Checked; // cbxCmpPRMSpfd.Visible = cbxDebug.Checked;

View File

@ -134,15 +134,15 @@
<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>
<metadata name="DlgBrowseFolder.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="DlgBrowseFolder.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>153, 17</value> <value>153, 17</value>
</metadata> </metadata>
<metadata name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>549, 17</value> <value>549, 17</value>
</metadata> </metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>40</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
AAABAA4AMDAQAAEABABoBgAA5gAAACAgEAABAAQA6AIAAE4HAAAYGBAAAQAEAOgBAAA2CgAAEBAQAAEA AAABAA4AMDAQAAEABABoBgAA5gAAACAgEAABAAQA6AIAAE4HAAAYGBAAAQAEAOgBAAA2CgAAEBAQAAEA