This commit is contained in:
2009-08-18 14:09:17 +00:00
parent 55d639d373
commit b0cebc4de6
3 changed files with 86 additions and 232 deletions

View File

@@ -28,7 +28,6 @@ namespace VEPROMS
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion
Color _CommentTitleBckColor;
VETreeNode _PrevBookMark = null;
DocVersionInfo _SelectedDVI = null;
StepTabPanel _SelectedStepTabPanel=null;
public StepTabPanel SelectedStepTabPanel
@@ -109,7 +108,6 @@ namespace VEPROMS
toolsPanel.Expanded = false;
ribbonControl1.ExpandedChanged +=new EventHandler(ribbonControl1_ExpandedChanged);
}
private void frmVEPROMS_FormClosing(object sender, FormClosingEventArgs e)
{
@@ -130,12 +128,11 @@ namespace VEPROMS
if (Settings.Default["Size"] != null) this.Size = Settings.Default.Size;
if (Settings.Default["WindowState"] != null) this.WindowState = Settings.Default.WindowState;
_MyMRIList = MostRecentItemList.GetMRILst((System.Collections.Specialized.StringCollection)(Properties.Settings.Default["MRIList"]));
_MyBookMarks = MostRecentItemList.GetMRILst((System.Collections.Specialized.StringCollection)(Properties.Settings.Default["BookMarks"]));
SetupMRU();
SetupBookMarks();
displaySearch1.SetupAnnotationSearch(ctrlAnnotationDetails, tc);
ctrlAnnotationDetails.SetupAnnotations(displaySearch1);
SetupButtons();
displayBookMarks.MyDisplayTabControl = tc; // allows bookmark selection to bring up steps/docs
}
private void SetupButtons()
{
@@ -146,20 +143,6 @@ namespace VEPROMS
}
#region MRU
private MostRecentItemList _MyMRIList;
private MostRecentItemList _MyBookMarks;
private void SetupBookMarks()
{
lbxBookMarks.SelectedValueChanged += new EventHandler(lbxBookMarks_SelectedValueChanged);
RefreshBookMarkData();
btnPrevPos.Enabled = false;
//lbxBookMarks.Enabled = false;
_PrevBookMark = null;
}
void lbxBookMarks_SelectedValueChanged(object sender, EventArgs e)
{
btnRmvCurBookMrk.Enabled = (lbxBookMarks.SelectedIndex >= 0);
}
private void SetupMRU()
{
icRecentDocs.SubItems.Clear();
@@ -202,7 +185,6 @@ namespace VEPROMS
private void SaveMRU()
{
Properties.Settings.Default.MRIList = _MyMRIList.ToSettings();
Properties.Settings.Default.BookMarks = _MyBookMarks.ToSettings();
Properties.Settings.Default.Save();
}
#endregion
@@ -589,56 +571,14 @@ namespace VEPROMS
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnMarkPrevPos_Click(object sender, EventArgs e)
private void btnBookMark_Click(object sender, EventArgs e)
{
btnSetBookMrk_Click(sender, e);
if (SelectedStepTabPanel == null||SelectedStepTabPanel.MyStepPanel==null||SelectedStepTabPanel.MyStepPanel.SelectedStepItem==null) return;
displayBookMarks.AddBookMark(SelectedStepTabPanel.MyStepPanel.SelectedStepItem.MyStepRTB.MyItemInfo);
if (toolsPanel.Expanded == false) toolsPanel.Expanded = true;
toolsTabs.SelectedTab = toolsTabBookMarks;
}
/// <summary>
/// Previous button on bottom tool bar
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnPrevPos_Click(object sender, EventArgs e)
{
//if (_PrevBookMark != null)
//{
// VETreeNode jumpToHere = _PrevBookMark; // save current previous
// btnSetBookMrk_Click(sender, e); // save current as the new previous
// tv.SelectedNode = jumpToHere; // jump to the saved previous
//}
}
/// <summary>
/// Clear Bookmarks button on Information pannel
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnClrBookMrks_Click(object sender, EventArgs e)
{
_MyBookMarks.Clear();
RefreshBookMarkData();
}
private void RefreshBookMarkData()
{
lbxBookMarks.DataSource = null;
lbxBookMarks.DisplayMember = "MenuTitle";
lbxBookMarks.DataSource = _MyBookMarks;
btnClrBookMrks.Enabled = (lbxBookMarks.Items.Count > 0);
}
/// <summary>
/// Remove Bookmark button on Information pannel
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnRmvCurBookMrk_Click(object sender, EventArgs e)
{
_MyBookMarks.RemoveAt(lbxBookMarks.SelectedIndex);
RefreshBookMarkData();
}
/// <summary>
/// Adds the given tree node to the list of bookmarks
/// TODO: Add a menu item to tree view context menu for adding to book mark list.
@@ -649,22 +589,6 @@ namespace VEPROMS
// if (!(lbxBookMarks.Items.Contains(bkmrk)))
// lbxBookMarks.Items.Add(bkmrk);
//}
/// <summary>
/// Set Bookmark button on the Information pannel
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnSetBookMrk_Click(object sender, EventArgs e)
{
_MyBookMarks.Add(SelectedStepTabPanel.SelectedStepItem.MyItemInfo);
RefreshBookMarkData();
}
private void lbxBookMarks_Click(object sender, EventArgs e)
{
MostRecentItem itm = lbxBookMarks.SelectedValue as MostRecentItem;
tc.OpenItem(itm.MyItemInfo);
}
#endregion
#region Find/Replace and Search
@@ -878,6 +802,14 @@ namespace VEPROMS
displayTags.MyRTB = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedStepItem.MyStepRTB;
}
#endregion
#region InfoTabBookMarks
private void infotabBookMarks_Click(object sender, EventArgs e)
{
infoPanel.Expanded = true;
infoTabs.SelectedTab = infotabTags;
displayTags.MyRTB = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedStepItem.MyStepRTB;
}
#endregion
private void tc_StepPanelModeChange(object sender, StepRTBModeChangeEventArgs args)
{
this.lblEditView.Text = args.ViewMode == E_ViewMode.Edit ? "Edit" : "View";
@@ -885,6 +817,7 @@ namespace VEPROMS
private ItemInfo _CurrentItem = null;
private void tc_ItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args)
{
lblEditView.Text = " ";
if (args == null)
{
@@ -908,19 +841,20 @@ namespace VEPROMS
infotabRO.Visible = true;
displayRO.MyRTB = null;
infotabTags.Visible = true;
displayBookMarks.MyRTB = null;
//vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem);
}
else
{
if (args.MyStepItem.MyItemInfo.IsSection || args.MyStepItem.MyItemInfo.IsProcedure)
{
infotabRO.Visible = infotabTransition.Visible = false;
infotabRO.Visible = infotabTransition.Visible = false;
infotabTags.Visible = true;
}
else
infotabRO.Visible = infotabTransition.Visible = infotabTags.Visible = true;
//vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem);
//vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem);
// When infotabTags is set to Visible, the matching panel also needs to be set to visible
// the other panels will appear as they are selected by the user.
infotabControlPanelTags.Visible = true;
@@ -929,6 +863,7 @@ namespace VEPROMS
displayTransition.MyRTB = args.MyStepItem.MyStepRTB;
displayRO.MyRTB = args.MyStepItem.MyStepRTB;
displayTags.MyRTB = args.MyStepItem.MyStepRTB;
displayBookMarks.MyRTB = args.MyStepItem.MyStepRTB;
displayRO.ProgressBar = bottomProgBar;
lblEditView.Text = args.MyStepItem.MyStepRTB.ViewRTB ? "View" : "Edit";
}