Fixed populating change list tab for single unit sites

Refresh Context Menu when keyboard is used to activate it.
This commit is contained in:
Rich 2013-01-09 20:34:07 +00:00
parent 888db4bade
commit dd6285f4a4
2 changed files with 26 additions and 19 deletions

View File

@ -57,7 +57,7 @@ namespace Volian.Controls.Library
_MyProcedureInfo = value; _MyProcedureInfo = value;
if (value == null) return; if (value == null) return;
SetRevDate(MyProcedureInfo.DTS); SetRevDate(MyProcedureInfo.DTS);
if (_MyProcedureInfo != null && this.Visible) if (_MyProcedureInfo != null && RefreshRequired && lbChanges.Visible)
WalkProcedure(); WalkProcedure();
} }
} }
@ -81,10 +81,8 @@ namespace Volian.Controls.Library
this.Visible = true; this.Visible = true;
UpdateHistory(); UpdateHistory();
if (this.lbChanges.Visible && RefreshRequired) if (this.lbChanges.Visible && RefreshRequired)
{
WalkProcedure(); WalkProcedure();
} }
}
else else
this.Visible = false; this.Visible = false;
} }
@ -134,6 +132,8 @@ namespace Volian.Controls.Library
SetRevDate(DateTime.Parse(cfg.Print_RevDate)); SetRevDate(DateTime.Parse(cfg.Print_RevDate));
} }
else else
{
if (MyProcedureInfo.MyDocVersion.DocVersionConfig.Unit_Count > 1)
{ {
DateTime minDts = DateTime.MaxValue; DateTime minDts = DateTime.MaxValue;
for (int j = 1; j <= MyProcedureInfo.MyDocVersion.DocVersionConfig.Unit_Count; j++) for (int j = 1; j <= MyProcedureInfo.MyDocVersion.DocVersionConfig.Unit_Count; j++)
@ -150,6 +150,15 @@ namespace Volian.Controls.Library
} }
SetRevDate(minDts); SetRevDate(minDts);
} }
else
{
ProcedureConfig cfg = MyProcedureInfo.MyConfig as ProcedureConfig;
if (cfg.Print_RevDate == null || cfg.Print_RevDate == string.Empty)
SetRevDate(MyProcedureInfo.DTS);
else
SetRevDate(DateTime.Parse(cfg.Print_RevDate));
}
}
} }
} }
private DateTime _MyRevDate; private DateTime _MyRevDate;
@ -164,7 +173,6 @@ namespace Volian.Controls.Library
InitializeComponent(); InitializeComponent();
myRTB.FormatFont = null; myRTB.FormatFont = null;
RefreshRequired = true; RefreshRequired = true;
//tabControl1.SelectedTab = tabItem2;// Start with Change List
} }
private void lbChanges_VisibleChanged(object sender, System.EventArgs e) private void lbChanges_VisibleChanged(object sender, System.EventArgs e)
@ -173,12 +181,8 @@ namespace Volian.Controls.Library
{ {
ApplDisplayMode = 0; ApplDisplayMode = 0;
} }
if (RefreshRequired) if (lbChanges.Visible && RefreshRequired)
{
Console.WriteLine("before walkprocedure - {0}", DateTime.Now.ToLongTimeString());
WalkProcedure(); WalkProcedure();
Console.WriteLine("after walkprocedure - {0}", DateTime.Now.ToLongTimeString());
}
} }
private void lbChanges_SelectedIndexChanged(object sender, EventArgs e) private void lbChanges_SelectedIndexChanged(object sender, EventArgs e)

View File

@ -1785,6 +1785,9 @@ namespace Volian.Controls.Library
private bool _SendBackSpace = false; private bool _SendBackSpace = false;
void StepRTB_KeyDown(object sender, KeyEventArgs e) 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) if (e.Control)
{ {
IsControlChar = true; IsControlChar = true;