diff --git a/PROMS/Volian.Controls.Library/DisplayTags.cs b/PROMS/Volian.Controls.Library/DisplayTags.cs index 9a6efda9..1490991a 100644 --- a/PROMS/Volian.Controls.Library/DisplayTags.cs +++ b/PROMS/Volian.Controls.Library/DisplayTags.cs @@ -278,6 +278,7 @@ namespace Volian.Controls.Library private void cbPageBreak_CheckedChanged(object sender, EventArgs e) { if (_Initalizing) return; + MyEditItem.SaveContents(); StepConfig sc = CurItemInfo.MyConfig as StepConfig; if (sc == null) return; sc.Step_NewManualPagebreak = cbPageBreak.Checked; @@ -285,6 +286,7 @@ namespace Volian.Controls.Library private void cbCAS_CheckedChanged(object sender, EventArgs e) { if (_Initalizing) return; + MyEditItem.SaveContents(); StepConfig sc = CurItemInfo.MyConfig as StepConfig; if (sc == null) return; sc.Step_CAS = cbCAS.Checked; @@ -336,6 +338,9 @@ namespace Volian.Controls.Library //} msgBox = string.Format("This Step Type was changed to {0}", listBoxStepTypes.Items[listBoxStepTypes.SelectedIndex]); } + // the follow line was to try and fix a refresh problem when you change the type of a new substep + //topEditItem.MyStepPanel.Reset(); + topEditItem.SetAllTabs(); MessageBox.Show(msgBox); @@ -349,6 +354,7 @@ namespace Volian.Controls.Library private void rbChgBarOvrRideOn_CheckedChanged(object sender, EventArgs e) { if (_Initalizing) return; + MyEditItem.SaveContents(); // if checked, set the config data to 'On'. Otherwise, the 'check' event // handler for the other control sets the data appropriately. @@ -367,6 +373,7 @@ namespace Volian.Controls.Library private void rbChgBarOvrRideOff_CheckedChanged(object sender, EventArgs e) { if (_Initalizing) return; + MyEditItem.SaveContents(); // if checked, set the config data to 'Off'. Otherwise, the 'check' event // handler for the other control sets the data appropriately. @@ -385,7 +392,7 @@ namespace Volian.Controls.Library private void cmbCheckoff_SelectedIndexChanged(object sender, EventArgs e) { if (_Initalizing) return; - + MyEditItem.SaveContents(); // set selected index in the step's config. int indx = cmbCheckoff.SelectedIndex; StepConfig sc = CurItemInfo.MyConfig as StepConfig; diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index e1a281c9..6c3fc2e4 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -853,7 +853,7 @@ namespace Volian.Controls.Library if (btn.Name == "btnInsHLS" && sd.Type == "RNOType") addit = false; if (btn.Name == "btnInsCaut" && sd.Type.Length >= 4 && sd.Type.Substring(0, 4) == "Note") addit = false; if (btn.Name == "btnInsNote" && sd.Type.Length >= 7 && sd.Type.Substring(0, 7) == "Caution") addit = false; - if (btn.Name == "btnInsSubstep" && MyItemInfo.Steps != null) addit = false; + if (btn.Name == "btnInsSubstep" && MyItemInfo.Steps != null && MyItemInfo.Steps.Count > 0) addit = false; if (addit) { DevComponents.DotNetBar.ButtonItem bi = new DevComponents.DotNetBar.ButtonItem("btn" + sd.Type, sd.Type); diff --git a/PROMS/Volian.Print.Library/vlnPrintObject.cs b/PROMS/Volian.Print.Library/vlnPrintObject.cs index b5bccc17..de13f367 100644 --- a/PROMS/Volian.Print.Library/vlnPrintObject.cs +++ b/PROMS/Volian.Print.Library/vlnPrintObject.cs @@ -314,6 +314,9 @@ namespace Volian.Print.Library // create a chunk with that symbol. Then loop through all of the chunks until we find // this symbol, adding up the widths to that point. This width is the value that // needs to be used to set the indent. + // Notes: + // A hard return will reset the chkW (indent width) back to zero. + // We jump out of the processing loop after the first indent token is found and ignor any other ones IRtfDocument rtfDoc2 = RtfInterpreterTool.BuildDoc(rtf.Replace("\x05", @"\f1 \u9999? \f0 ")); Rtf2iTextSharp rtf2IText2 = new Rtf2iTextSharp(rtfDoc2); iTextSharp.text.Paragraph para2 = rtf2IText2.Convert(); @@ -321,6 +324,7 @@ namespace Volian.Print.Library foreach (Chunk chk in para2.Chunks) { if (chk.Content[0] == 9999) break; + if (chk.Content.Contains("\n")) chkW = 0; //hard return - reset chkW (indent start) chkW += chk.GetWidthPoint(); } para.IndentationLeft = chkW;