This commit is contained in:
2011-02-08 11:25:03 +00:00
parent f524056e6c
commit 3a46cb8580
6 changed files with 846 additions and 778 deletions

View File

@@ -259,6 +259,12 @@ namespace VEPROMS
SetupButtons();
displayBookMarks.MyDisplayTabControl = tc; // allows bookmark selection to bring up steps/docs
office2007StartButton1.MouseDown +=new MouseEventHandler(office2007StartButton1_MouseDown);
displayRO.EnabledChanged += new EventHandler(displayRO_EnabledChanged);
}
void displayRO_EnabledChanged(object sender, EventArgs e)
{
Console.WriteLine("here");
}
void _MyMRIList_AfterRemove(object sender)
@@ -822,7 +828,7 @@ namespace VEPROMS
displayRO.Mydvi = SelectedDVI;
displayRO.MyROFST = SelectedROFst;
displayRO.MyRTB = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedRTBItem.MyStepRTB;
displayRO.MyRTB = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
displayRO.TabControl = tc;
displayRO.ProgressBar = bottomProgBar;
@@ -833,7 +839,7 @@ namespace VEPROMS
{
if (tc == null || tc.SelectedDisplayTabItem == null) return;
if (SelectedStepTabPanel == null) return;
displayTransition.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedRTBItem.MyStepRTB;
displayTransition.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
//displayTransition.RangeColor = global::VEPROMS.Properties.Settings.Default.TransitionRangeColor;
displayTransition.CurTrans = null;
}
@@ -865,7 +871,7 @@ namespace VEPROMS
{
infoPanel.Expanded = true;
infoTabs.SelectedTab = infotabTags;
displayTags.MyRTB = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedRTBItem.MyStepRTB;
displayTags.MyEditItem = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem;
}
#endregion
#region InfoTabBookMarks
@@ -873,7 +879,7 @@ namespace VEPROMS
{
infoPanel.Expanded = true;
infoTabs.SelectedTab = infotabTags;
displayTags.MyRTB = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedRTBItem.MyStepRTB;
displayTags.MyEditItem = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem;
}
#endregion
#region PanelSupport
@@ -954,9 +960,13 @@ namespace VEPROMS
this.lblEditView.Text = args.ViewMode == E_ViewMode.Edit ? "Edit" : "View";
}
private ItemInfo _CurrentItem = null;
private StepRTB _LastStepRTB = null;
private void tc_ItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args)
{
if (_LastStepRTB != null && !_LastStepRTB.Disposing)
_LastStepRTB.EditModeChanged -= new StepRTBEvent(_LastStepRTB_EditModeChanged);
_LastStepRTB = args != null && args.MyEditItem != null ? args.MyEditItem.MyStepRTB : null;
if (_LastStepRTB != null) _LastStepRTB.EditModeChanged += new StepRTBEvent(_LastStepRTB_EditModeChanged);
lblEditView.Text = " ";
if (args == null)
{
@@ -981,18 +991,18 @@ namespace VEPROMS
_CurrentItem = args.MyItemInfo;
}
//vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem);
if (args.MyRTBItem == null)
if (args.MyEditItem == null)
{
infotabTransition.Visible = false;
infotabRO.Visible = true;
displayRO.MyRTB = null;
infotabTags.Visible = false;
displayBookMarks.MyRTB = null;
displayBookMarks.MyEditItem = null;
//vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem);
}
else
{
if (args.MyRTBItem.MyItemInfo.IsSection || args.MyRTBItem.MyItemInfo.IsProcedure)
if (args.MyEditItem.MyItemInfo.IsSection || args.MyEditItem.MyItemInfo.IsProcedure)
{
infotabRO.Visible = infotabTransition.Visible = false;
infotabTags.Visible = false;
@@ -1000,36 +1010,54 @@ namespace VEPROMS
}
else
{
infotabRO.Visible = infotabTransition.Visible = infotabTags.Visible = true;
infotabTags.Visible = true;
if (_LastStepRTB != null)
{
infotabRO.Visible = infotabTransition.Visible = true;
displayRO.Enabled = displayTransition.Enabled = _LastStepRTB.EditMode;
}
else
infotabRO.Visible = infotabTransition.Visible = false;
// 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;
displayTags.IsVisible = true;
}
// When infotabTags is set to Visible, it is given focus. The next line returns focus to the StepRTB
args.MyRTBItem.MyStepRTB.Focus();
displayTransition.MyRTB = args.MyRTBItem.MyStepRTB;
displayRO.MyRTB = args.MyRTBItem.MyStepRTB;
displayTags.MyRTB = args.MyRTBItem.MyStepRTB;
displayBookMarks.MyRTB = args.MyRTBItem.MyStepRTB;
args.MyEditItem.SetFocus();
displayTransition.MyRTB = args.MyEditItem.MyStepRTB;
displayRO.MyRTB = args.MyEditItem.MyStepRTB;
displayTags.MyEditItem = args.MyEditItem;
displayBookMarks.MyEditItem = args.MyEditItem;
displayRO.ProgressBar = bottomProgBar;
lblEditView.Text = args.MyRTBItem.MyStepRTB.ViewRTB ? "View" : "Edit";
lblEditView.Text = args.MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit ? "Edit" : "View" ;
_CurrentItem.Deleted += new ItemInfoEvent(_CurrentItem_Deleted);
dlgFindReplace.MyRTBItem = args.MyRTBItem;
SpellChecker.MyRTBItem = args.MyRTBItem;
}
if (args.MyRTBItem != null)
{
SelectedStepTabPanel = args.MyRTBItem.MyStepPanel.MyStepTabPanel;
//SelectedStepTabPanel = ((DisplayTabItem)tc.SelectedDisplayTabItem).MyStepTabPanel;
dlgFindReplace.MyEditItem = args.MyEditItem;
SpellChecker.MyEditItem = args.MyEditItem;
}
if (args.MyEditItem != null)
SelectedStepTabPanel = args.MyEditItem.MyStepPanel.MyStepTabPanel;
else
SelectedDVI = args.MyItemInfo.ActiveParent.ActiveParent as DocVersionInfo;
}
ctrlAnnotationDetails.UpdateAnnotationGrid(_CurrentItem);
AnnotationPanelView();
btnPrint.Enabled = (_CurrentItem != null);
}
void _LastStepRTB_EditModeChanged(object sender, EventArgs args)
{
if (_LastStepRTB.EditMode) // going into edit mode in a cell of the grid.
displayRO.Enabled = displayTransition.Enabled = _LastStepRTB.EditMode;
else // going out of edit mode in a cell of the grid.
{
if (!_LastStepRTB.Parent.Focused && (infotabRO.IsSelected || infotabTransition.IsSelected)) return;
displayRO.Enabled = displayTransition.Enabled = _LastStepRTB.EditMode;
}
}
void _CurrentItem_Deleted(object sender)
{
//displayBookMarks.DeleteItemBookMarkPanel(_CurrentItem);
@@ -1073,7 +1101,7 @@ namespace VEPROMS
infoTabs.SelectedTab = infotabTransition;
if (SelectedStepTabPanel == null) return;
//displayTransition.RangeColor = global::VEPROMS.Properties.Settings.Default.TransitionRangeColor;
displayTransition.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedRTBItem.MyStepRTB;
displayTransition.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
displayTransition.CurTrans = args.MyLinkText.MyTransitionInfo;
}
private void tc_LinkModifyRO(object sender, StepPanelLinkEventArgs args)
@@ -1083,7 +1111,7 @@ namespace VEPROMS
if (SelectedStepTabPanel == null) return;
displayRO.MyROFST = SelectedROFst;
displayRO.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedRTBItem.MyStepRTB;
displayRO.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
displayRO.CurROLink = args.MyLinkText.MyRoUsageInfo;
displayRO.Mydvi = SelectedDVI;
displayRO.ProgressBar = bottomProgBar;
@@ -1272,7 +1300,7 @@ namespace VEPROMS
#region PanelEvents
private void infoPanel_Click(object sender, EventArgs e)
{
displayTags.MyRTB = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedRTBItem.MyStepRTB;
displayTags.MyEditItem = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem;
}
//private void tv_SectionShouldClose(object sender, vlnTreeSectionInfoEventArgs args)
//{
@@ -1429,5 +1457,11 @@ namespace VEPROMS
_MyMRIList.Refresh();
SetupMRU();
}
private void btnEditItem_Click(object sender, EventArgs e)
{
frmPropGrid pg = new frmPropGrid(tc.SelectedDisplayTabItem.MyStepTabPanel.SelectedEditItem, "EditItem");
pg.Show();
}
}
}