Merge pull request 'C2023-018 Upgrade: sub-step pagination' (#132) from GenWork into Development

code changes look good to proceed with testing.
This commit is contained in:
2023-10-10 08:22:32 -04:00
5 changed files with 76 additions and 70 deletions

View File

@@ -30,7 +30,6 @@ namespace Volian.Controls.Library
{
this.groupPanelPaginate = new DevComponents.DotNetBar.Controls.GroupPanel();
this.cbPrefPageBreak = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.cbSubStepPageBreak = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.cbPageBreak = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.cbCAS = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.cmbCheckoff = new DevComponents.DotNetBar.Controls.ComboBoxEx();
@@ -75,7 +74,6 @@ namespace Volian.Controls.Library
this.groupPanelPaginate.BackColor = System.Drawing.Color.Transparent;
this.groupPanelPaginate.CanvasColor = System.Drawing.SystemColors.Control;
this.groupPanelPaginate.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
this.groupPanelPaginate.Controls.Add(this.cbSubStepPageBreak);
this.groupPanelPaginate.Controls.Add(this.cbPrefPageBreak);
this.groupPanelPaginate.Controls.Add(this.cbPageBreak);
this.groupPanelPaginate.DisabledBackColor = System.Drawing.Color.Empty;
@@ -132,23 +130,6 @@ namespace Volian.Controls.Library
this.cbPrefPageBreak.Text = "Preferred Page Break (for Sup Info)";
this.cbPrefPageBreak.CheckedChanged += new System.EventHandler(this.cbPrefPageBreak_CheckedChanged);
//
// cbSubStepPageBreak
//
this.cbSubStepPageBreak.AutoSize = true;
//
//
//
this.cbSubStepPageBreak.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.cbSubStepPageBreak.Location = new System.Drawing.Point(3, 19);
this.cbSubStepPageBreak.Margin = new System.Windows.Forms.Padding(2);
this.cbSubStepPageBreak.Name = "cbSubStepPageBreak";
this.cbSubStepPageBreak.Size = new System.Drawing.Size(195, 15);
this.superTooltipTags.SetSuperTooltip(this.cbSubStepPageBreak, new DevComponents.DotNetBar.SuperTooltipInfo("Page Break for Sub-Steps", "", "When set, starts this step at the top of a page.\r\n\r\nkeyboard command: <Ctrl><Ente" +
"r>", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.cbSubStepPageBreak.TabIndex = 1;
this.cbSubStepPageBreak.Text = "Substep Page Break";
this.cbSubStepPageBreak.CheckedChanged += new System.EventHandler(this.cbSubStepPageBreak_CheckedChanged);
//
// cbPageBreak
//
this.cbPageBreak.AutoSize = true;
@@ -789,7 +770,6 @@ namespace Volian.Controls.Library
private System.Windows.Forms.TrackBar trBarFS;
private System.Windows.Forms.Button btnFSrestore;
private DevComponents.DotNetBar.Controls.CheckBoxX cbPrefPageBreak;
private DevComponents.DotNetBar.Controls.CheckBoxX cbSubStepPageBreak;
private DevComponents.DotNetBar.Controls.CheckBoxX cbIncludeInTOC;
private DevComponents.DotNetBar.Controls.CheckBoxX cbTCAS;
}

View File

@@ -110,7 +110,6 @@ namespace Volian.Controls.Library
cmbCheckoff.Enabled = false;
cbPageBreak.Enabled = false;
cbPrefPageBreak.Enabled = false;
cbSubStepPageBreak.Enabled = false;
cbPlaceKeeper.Enabled = false;
cbPlaceKeeperCont.Enabled = false;
cbIncludeInTOC.Enabled = false;
@@ -179,11 +178,12 @@ namespace Volian.Controls.Library
public void UpdatePageBreakCheckBox() // for use with shortcut keystroke <Ctrl><Enter>
{
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (CurItemInfo.IsHigh) cbPageBreak.Checked = false; // Page Break is set to false
if (sc != null && CurItemInfo.IsHigh) // otherwise, get data from config
cbPageBreak.Checked = sc.Step_NewManualPagebreak; // High Level Step has a manual page break
else
cbPageBreak.Checked = false; // Page Break is set to false
// C2023-018: if high, check oringinal flag, otherwise check sub-step flag for setting checkbox
cbPageBreak.Checked = false; // Page Break is set to false
if (sc != null && CurItemInfo.IsHigh) // otherwise, get data from config
cbPageBreak.Checked = sc.Step_NewManualPagebreak; // High Level Step has a manual page break
else if (sc != null && !CurItemInfo.IsCautionOrNotePart)
cbPageBreak.Checked = sc.Step_SubStepPagebreak;
}
public DocVersionInfo Mydvi = null; // this is initialized in vlnTreeComboSetsFillIn()
@@ -245,13 +245,23 @@ namespace Volian.Controls.Library
groupPanelFigSize.Style.BackColor = Color.Cornsilk;
cbPageBreak.Checked = false; // will be set below if HLS & config has it on
cbPrefPageBreak.Checked = false;
cbSubStepPageBreak.Checked = false;
cbPlaceKeeper.Checked = false; // will be set below if HLS & config has this set
cbPlaceKeeperCont.Checked = false; // will be set below if substep & config has this set
cbPageBreak.Enabled = CurItemInfo.IsHigh;
// C2023-018: upgrade for 2023, allow page break setting on non-HLS under certain conditions as listed here:
// - HLS only (original)
// - Upgrade for sub-steps: Not in supplemental info (original)
// - Upgrade for sub-steps: Not in Enhanced document
// - Upgrade for sub-steps: Only for single column procedure
// - Upgrade for sub-steps: Sequential sub-steps only
// - Upgrade for sub-steps: First level sub-steps only (CurItemInfo.MyParent.IsHigh)
SectionConfig secConfig = (SectionConfig)CurItemInfo.ActiveSection.MyConfig;
bool isSingleColumn = secConfig != null && secConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.One;
bool allowPageBreak = CurItemInfo.IsHigh || (!CurItemInfo.MyDocStyle.SupplementalInformation && !CurItemInfo.IsEnhancedStep
&& isSingleColumn && CurItemInfo.IsSequential && CurItemInfo.MyParent.IsHigh);
cbPageBreak.Enabled = allowPageBreak;
cbPrefPageBreak.Visible = cbPrefPageBreak.Enabled = (!CurItemInfo.IsInSupInfo && CurItemInfo.MyDocStyle.SupplementalInformation);
// C2023-015: Pagination on a sub-step
cbSubStepPageBreak.Visible = cbSubStepPageBreak.Enabled = CurItemInfo.IsSubStep && CurItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.AlarmPagination;
if (!CurItemInfo.IsFigure && !CurItemInfo.IsRtfRaw)
{
cbPlaceKeeper.Enabled = (((SectionConfig)CurItemInfo.ActiveSection.MyConfig).Section_Placekeeper == "Y");
@@ -297,7 +307,7 @@ namespace Volian.Controls.Library
}
else if (sc == null) // if there is no config data ...
{
if (CurItemInfo.IsHigh)cbPageBreak.Checked = false; // Page Break is set to false
cbPageBreak.Checked = false; // Page Break is set to false
cbCAS.Checked = CurItemInfo.IncludeOnContActSum; // set based on step type format flag
cbTCAS.Checked = CurItemInfo.IncludeOnTimeCriticalActionSum; // set based on step type format flag
cbPlaceKeeper.Checked = false;
@@ -305,10 +315,12 @@ namespace Volian.Controls.Library
}
else // otherwise, get data from config
{
// C2023-018: if high, use original config setting for page break, otherwise you sub-step setting
if (CurItemInfo.IsHigh)
cbPageBreak.Checked = sc.Step_NewManualPagebreak; // High Level Step has a manual page break
else
cbPageBreak.Checked = sc.Step_SubStepPagebreak;
if (cbPrefPageBreak.Enabled) cbPrefPageBreak.Checked = sc.Step_PreferredPagebreak;
if (cbSubStepPageBreak.Enabled) cbSubStepPageBreak.Checked = sc.Step_SubStepPagebreak;
cbPlaceKeeper.Checked = (sc.Step_Placekeeper == "Y"); // step text to be included on PlaceKeeper (Calvert Cliffs)
cbPlaceKeeperCont.Checked = (sc.Step_Placekeeper == "C"); // step is included on Placekeeper and marked as continuous action (Calvert Cliffs)
// set the Continuous Action Summary check box to the saved setting in the config or, if nothing in config, set to format flag setting
@@ -547,7 +559,10 @@ namespace Volian.Controls.Library
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (sc == null) return;
MyEditItem.ChangeBarForConfigItemChange = false;
sc.Step_NewManualPagebreak = cbPageBreak.Checked;
if (CurItemInfo.IsHigh)
sc.Step_NewManualPagebreak = cbPageBreak.Checked;
else // C2023-018: allow for sub-step page breaks
sc.Step_SubStepPagebreak = cbPageBreak.Checked;
MyEditItem.ChangeBarForConfigItemChange = true;
}
private void cbCAS_CheckedChanged(object sender, EventArgs e)
@@ -896,18 +911,6 @@ namespace Volian.Controls.Library
sc.Step_PreferredPagebreak = cbPrefPageBreak.Checked;
MyEditItem.ChangeBarForConfigItemChange = true;
}
// C2023-015: Pagination on a sub-step
private void cbSubStepPageBreak_CheckedChanged(object sender, EventArgs e)
{
if (_Initalizing) return;
MyEditItem.SaveContents();
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (sc == null) return;
MyEditItem.ChangeBarForConfigItemChange = false;
sc.Step_SubStepPagebreak = cbSubStepPageBreak.Checked;
MyEditItem.ChangeBarForConfigItemChange = true;
}
//private void txbxAltConActSumText_Leave(object sender, EventArgs e)
//{
// // User left Atlernate Continuous Action Text field. If text changed, then prompt