diff --git a/PROMS/Volian.Controls.Library/DisplayHistory.cs b/PROMS/Volian.Controls.Library/DisplayHistory.cs index 8926dc77..c7f6177e 100644 --- a/PROMS/Volian.Controls.Library/DisplayHistory.cs +++ b/PROMS/Volian.Controls.Library/DisplayHistory.cs @@ -57,7 +57,7 @@ namespace Volian.Controls.Library _MyProcedureInfo = value; if (value == null) return; SetRevDate(MyProcedureInfo.DTS); - if (_MyProcedureInfo != null && this.Visible) + if (_MyProcedureInfo != null && RefreshRequired && lbChanges.Visible) WalkProcedure(); } } @@ -81,9 +81,7 @@ namespace Volian.Controls.Library this.Visible = true; UpdateHistory(); if (this.lbChanges.Visible && RefreshRequired) - { WalkProcedure(); - } } else this.Visible = false; @@ -135,20 +133,31 @@ namespace Volian.Controls.Library } else { - DateTime minDts = DateTime.MaxValue; - for (int j = 1; j <= MyProcedureInfo.MyDocVersion.DocVersionConfig.Unit_Count; j++) + if (MyProcedureInfo.MyDocVersion.DocVersionConfig.Unit_Count > 1) + { + DateTime minDts = DateTime.MaxValue; + for (int j = 1; j <= MyProcedureInfo.MyDocVersion.DocVersionConfig.Unit_Count; j++) + { + ProcedureConfig cfg = MyProcedureInfo.MyConfig as ProcedureConfig; + cfg.SelectedSlave = j; + if (cfg.Print_RevDate != null && cfg.Print_RevDate != string.Empty) + { + if (DateTime.Parse(cfg.Print_RevDate) < minDts && DateTime.Parse(cfg.Print_RevDate) > MyProcedureInfo.DTS) + minDts = DateTime.Parse(cfg.Print_RevDate); + } + else + minDts = MyProcedureInfo.DTS; + } + SetRevDate(minDts); + } + else { ProcedureConfig cfg = MyProcedureInfo.MyConfig as ProcedureConfig; - cfg.SelectedSlave = j; - if (cfg.Print_RevDate != null && cfg.Print_RevDate != string.Empty) - { - if (DateTime.Parse(cfg.Print_RevDate) < minDts && DateTime.Parse(cfg.Print_RevDate) > MyProcedureInfo.DTS) - minDts = DateTime.Parse(cfg.Print_RevDate); - } + if (cfg.Print_RevDate == null || cfg.Print_RevDate == string.Empty) + SetRevDate(MyProcedureInfo.DTS); else - minDts = MyProcedureInfo.DTS; + SetRevDate(DateTime.Parse(cfg.Print_RevDate)); } - SetRevDate(minDts); } } } @@ -164,7 +173,6 @@ namespace Volian.Controls.Library InitializeComponent(); myRTB.FormatFont = null; RefreshRequired = true; - //tabControl1.SelectedTab = tabItem2;// Start with Change List } private void lbChanges_VisibleChanged(object sender, System.EventArgs e) @@ -173,12 +181,8 @@ namespace Volian.Controls.Library { ApplDisplayMode = 0; } - if (RefreshRequired) - { - Console.WriteLine("before walkprocedure - {0}", DateTime.Now.ToLongTimeString()); + if (lbChanges.Visible && RefreshRequired) WalkProcedure(); - Console.WriteLine("after walkprocedure - {0}", DateTime.Now.ToLongTimeString()); - } } private void lbChanges_SelectedIndexChanged(object sender, EventArgs e) diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index 381688d3..99dcb9a0 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -1785,6 +1785,9 @@ namespace Volian.Controls.Library private bool _SendBackSpace = false; void StepRTB_KeyDown(object sender, KeyEventArgs e) { + // added jcb 20130103 to support set ro from word doc with annotation when right click menu is opened by keyboard + if (e.KeyCode == Keys.Apps) + OnSetMenu(this, new StepRTBMenuEventArgs("OpenContextMenu")); if (e.Control) { IsControlChar = true;