Added code to support textbox in status bar at bottom of PROMS which allows user to locate an item by the itemid or contentid in debug mode

This commit is contained in:
Rich 2014-10-24 01:30:19 +00:00
parent 73ca054fa2
commit f1c6f819b9
2 changed files with 42 additions and 4 deletions

View File

@ -72,6 +72,7 @@ namespace VEPROMS
this.lblItemID = new DevComponents.DotNetBar.LabelItem();
this.lblResolution = new DevComponents.DotNetBar.LabelItem();
this.lblUser = new DevComponents.DotNetBar.LabelItem();
this.txtSearch = new DevComponents.DotNetBar.TextBoxItem();
this.btnEditItem = new DevComponents.DotNetBar.ButtonItem();
this.btnFixMSWord = new DevComponents.DotNetBar.ButtonItem();
this.epAnnotations = new DevComponents.DotNetBar.ExpandablePanel();
@ -496,6 +497,7 @@ namespace VEPROMS
this.lblResolution,
this.btnEditItem,
this.lblUser,
this.txtSearch,
this.btnFixMSWord});
this.bottomBar.Location = new System.Drawing.Point(5, 569);
this.bottomBar.Name = "bottomBar";
@ -595,6 +597,10 @@ namespace VEPROMS
this.lblUser.Name = "lblUser";
this.lblUser.Text = "User";
//
// txtSearch
//
this.txtSearch.Name = "txtSearch";
//
// btnEditItem
//
this.btnEditItem.ForeColor = System.Drawing.Color.Blue;
@ -1612,6 +1618,7 @@ namespace VEPROMS
private System.Windows.Forms.ComboBox cmbFont;
private DevComponents.DotNetBar.LabelItem lblResolution;
private DevComponents.DotNetBar.LabelItem lblUser;
private DevComponents.DotNetBar.TextBoxItem txtSearch;
private DevComponents.DotNetBar.ButtonItem btnEditItem;
private DevComponents.DotNetBar.TabControlPanel tabControlPanel1;
private DevComponents.DotNetBar.TabItem infotabHistory;

View File

@ -867,11 +867,13 @@ namespace VEPROMS
System.Threading.TimerCallback timerDelegate = new System.Threading.TimerCallback(this.PingSession);
if (!System.Diagnostics.Process.GetCurrentProcess().ProcessName.ToLower().EndsWith("vshost"))
//MyActivityTimer = new System.Threading.Timer(timerDelegate, autoEvent, 30000, 30000);
MyActivityTimer = new System.Threading.Timer(timerDelegate, autoEvent, 10000, 10000);
//string debugMode = ConfigurationManager.AppSettings["Debug"];
//VlnSettings.DebugMode = bool.Parse(debugMode); // set debug for the Volian.Controls.Library
// get the saved location and size of the VE-PROMS appication for this user
this.txtSearch.KeyDown += new KeyEventHandler(txtSearch_KeyDown);
if (Settings.Default["Location"] != null) this.Location = Settings.Default.Location;
if (Settings.Default["Size"] != null) this.Size = Settings.Default.Size;
if (Settings.Default["WindowState"] != null) this.WindowState = Settings.Default.WindowState;
@ -942,9 +944,37 @@ namespace VEPROMS
//}
}
void txtSearch_KeyDown(object sender, KeyEventArgs e)
{
if(e.KeyCode == Keys.Enter)
{
ItemInfo ii = null;
ContentInfo ci = null;
if(txtSearch.Text.Length > 0)
{
if (txtSearch.Text.ToUpper().StartsWith("C="))
{
ci = ContentInfo.Get(int.Parse(txtSearch.Text.Substring(2)));
if(ci != null)
ii = ci.ContentItems[0];
}
else
ii = ItemInfo.Get(int.Parse(txtSearch.Text));
if (ii != null)
{
tc.OpenItem(ii);
tv.AdjustTree(ii);
}
else
MessageBox.Show("No item found");
}
}
}
void tmrCloseTabItems_Tick(object sender, EventArgs e)
{
while(MyCloseTabList.CountDTI > 0)
while (MyCloseTabList.CountDTI > 0)
{
DisplayTabItem dti = MyCloseTabList.PopDTI();
if (dti.MyDSOTabPanel != null)
@ -1300,6 +1330,7 @@ namespace VEPROMS
cmbFont.Visible = false;
btnEditItem.Visible = false;
lblResolution.Visible = false;
txtSearch.Visible = false;
}
}
#region MRU