B2012-368 fixed problem to newly entered not being saved when checkoff type is changed

B2012-357  fixed problem of not being able to insert a new substep if you first deleted an equipment list substep
B2012-367  Fixed problem of Note type that uses the Indent token not printing the note
This commit is contained in:
John Jenko 2012-12-13 22:57:50 +00:00
parent fba56b1f55
commit 6eb479b8fa
3 changed files with 13 additions and 2 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;