Save WindowState - Maximize, Minimize, Normal by user.

Load all at once code to support print.
Open Command from the Start (PROMS2010) Menu.
Enter key on treeview executes Open.
The Treeview was retaining focus after opening procedures or accessory documents. This was fixed.
Tab Bar initialized to the full width.
Items were not always being displayed after the tree was clicked.
The RO and Transition Info tabs are made invisible for accessory documents.
The Tags, RO and Transition tabs are made invisible when no doucment is selected.
Enter the DSO Framer window when it is created.
Enter the Accessory page editor or step editor when a tab is selected.
Remember the last selection in a step editor page when you return.
Activate one of the remaining tabs when a tab is closed.
Embed the pushpin images.
This commit is contained in:
Rich
2008-05-21 21:00:07 +00:00
parent 41eb961ceb
commit e42c3cea5c
17 changed files with 869 additions and 358 deletions

View File

@@ -78,8 +78,12 @@ namespace VEPROMS
private void frmVEPROMS_FormClosing(object sender, FormClosingEventArgs e)
{
// Save the location and size of the VE-PROMS appication for this user
Settings.Default.Location = this.Location;
Settings.Default.Size = this.Size;
if (this.WindowState == FormWindowState.Normal)
{
Settings.Default.Location = this.Location;
Settings.Default.Size = this.Size;
}
Settings.Default.WindowState = this.WindowState;
SaveMRU();
//Settings.Default.Save();
}
@@ -96,10 +100,10 @@ namespace VEPROMS
// get the saved location and size of the VE-PROMS appication for this user
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;
ShutDownRibbons();
_MyMRIList = MostRecentItemList.GetMRILst((System.Collections.Specialized.StringCollection)(Properties.Settings.Default["MRIList"]));
_MyBookMarks = MostRecentItemList.GetMRILst((System.Collections.Specialized.StringCollection)(Properties.Settings.Default["BookMarks"]));
SetupMRU();
SetupBookMarks();
SetupAnnotations();
@@ -189,8 +193,8 @@ namespace VEPROMS
/// <param name="node">VETreeNode</param>
void SetupNodes(VETreeNode node)
{
if (!node.Equals(_LastTreeNode))
{
//if (!node.Equals(_LastTreeNode))
//{
_LastTreeNode = node;
_LastFolderInfo = null;
_LastFolder = null;
@@ -198,8 +202,8 @@ namespace VEPROMS
_LastProcedure = null;
_LastSection = null;
_LastStep = null;
//epAnnotations.Expanded = false;
//rtxbComment.Text = "";
epAnnotations.Expanded = false;
rtxbComment.Text = "";
epAnnotations.TitleStyle.BackColor1.Color = _CommentTitleBckColor;
if (_MyMRIList.Add(node.VEObject) != null)
SetupMRU();
@@ -260,8 +264,24 @@ namespace VEPROMS
//default:
//break;
//}
setupRibbonTabs(node);
SetCaption((VETreeNode)node);
//}
}
private void SetCaption(VETreeNode tn)
{
StringBuilder caption = new StringBuilder();
string sep = string.Empty;
while (tn != null)
{
if (tn.VEObject.GetType() == typeof(FolderInfo) || tn.VEObject.GetType() == typeof(DocVersionInfo))
{
caption.Append(sep + tn.Text);
sep = " - ";
}
tn = (VETreeNode)tn.Parent;
}
this.Text = caption.ToString();
}
bool tv_NodeDelete(object sender, Volian.Controls.Library.vlnTreeEventArgs args)
@@ -277,7 +297,7 @@ namespace VEPROMS
if (_LastFolderInfo != null)
{
DialogResult result = MessageBox.Show("Are you sure you want to delete " + _LastFolderInfo.Name, "Verify Folder Delete",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
Folder.Delete(_LastFolderInfo.FolderID);
@@ -355,12 +375,40 @@ namespace VEPROMS
}
}
}
private void SaveIfChanged2(Item tmp)
{
SaveIfChanged<Item>(tmp);
}
/// <summary>
/// When the treeview is clicked - a timer is set
/// This is done because the focus is returned to the treeview after the click event
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void tv_Click(object sender, EventArgs e)
{
tmrTreeView.Enabled = true;
}
/// <summary>
/// This event is fired from the timer after the treeview click event completes
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void tmrTreeView_Tick(object sender, EventArgs e)
{
tmrTreeView.Enabled = false; // Timer has now fired
SaveIfChanged();
VETreeNode tn = tv.SelectedNode as VETreeNode;
if (tn != null) SetupNodes(tn);
}
private void tv_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == '\r')
{
tv_Click(sender, new EventArgs());
e.Handled = true;
}
}
private void tv_BeforeExpand(object sender, TreeViewCancelEventArgs e)
{
VETreeNode tn = ((VETreeNode)e.Node);
@@ -371,35 +419,11 @@ namespace VEPROMS
tn.LoadChildren(true);
}
private void tv_AfterSelect(object sender, TreeViewEventArgs e)
{
string caption = null;
SaveIfChanged();
SetupNodes((VETreeNode)e.Node);
// this.Text = "VE-PROMS - " + e.Node.Text; // build and display window caption
caption = "";
VETreeNode tn = (VETreeNode)e.Node;
while (tn != null)
{
if (tn.VEObject.GetType() == typeof(FolderInfo) || tn.VEObject.GetType() == typeof(DocVersionInfo))
{
if (caption.Equals(""))
caption = tn.Text;
else
caption = tn.Text + " - " + caption;
}
tn = (VETreeNode)tn.Parent;
}
this.Text = caption;
}
void tv_NodeProperties(object sender, Volian.Controls.Library.vlnTreeEventArgs args)
{
DisplayProperties();
}
#endregion
#region Property Page and Grid
/// <summary>
@@ -438,7 +462,7 @@ namespace VEPROMS
/// <returns></returns>
private static Color cGetColor(string strColor)
{
// This was copied from frmFolderProperties.CS
// This was copied from frmFolderProperties.CS
Color rtnColor;
if (strColor == null || strColor.Equals(""))
rtnColor = Color.White;
@@ -566,7 +590,6 @@ namespace VEPROMS
}
#endregion
#region Table Insert Sample Code
private void btnInsTable_Click(object sender, EventArgs e)
{
@@ -597,7 +620,6 @@ namespace VEPROMS
//}
}
#endregion
#region Edit/View Modes
/// <summary>
/// Edit Mode button on the bottom tool bar
@@ -640,7 +662,6 @@ namespace VEPROMS
}
#endregion
#region Multi User
/// <summary>
@@ -666,7 +687,6 @@ namespace VEPROMS
}
#endregion
#region Progress Bar
/// <summary>
@@ -725,14 +745,14 @@ namespace VEPROMS
public string ProgBarText
{
get { return bottomProgBar.Text; }
set {
set
{
bottomProgBar.TextVisible = true;
bottomProgBar.Text = value;
bottomProgBar.Text = value;
}
}
#endregion
#region Views: Procedure Background Deviation
/// <summary>
/// Procedure Step View button on the bottom tool bar
@@ -764,7 +784,6 @@ namespace VEPROMS
btnViewTypes.Text = btnViewDev.Text;
}
#endregion
#region Bookmarks
/// <summary>
@@ -826,15 +845,15 @@ namespace VEPROMS
{
_MyBookMarks.RemoveAt(lbxBookMarks.SelectedIndex);
RefreshBookMarkData();
// lbxBookMarks.Items.RemoveAt(lbxBookMarks.SelectedIndex);
// if (lbxBookMarks.Items.Count == 0)
// {
// //lbxBookMarks.Enabled = false;
// btnPrevPos.Enabled = false;
// btnClrBookMrks.Enabled = (lbxBookMarks.Items.Count > 0);
// //btnRmvCurBookMrk.Enabled = (lbxBookMarks.SelectedIndex >= 0);
// _PrevBookMark = null;
// }
// lbxBookMarks.Items.RemoveAt(lbxBookMarks.SelectedIndex);
// if (lbxBookMarks.Items.Count == 0)
// {
// //lbxBookMarks.Enabled = false;
// btnPrevPos.Enabled = false;
// btnClrBookMrks.Enabled = (lbxBookMarks.Items.Count > 0);
// //btnRmvCurBookMrk.Enabled = (lbxBookMarks.SelectedIndex >= 0);
// _PrevBookMark = null;
// }
}
/// <summary>
@@ -867,7 +886,6 @@ namespace VEPROMS
}
#endregion
#region DisplayPanel
/// <summary>
@@ -940,7 +958,6 @@ namespace VEPROMS
// }
//}
#endregion
#region Font
/// <summary>
@@ -973,7 +990,6 @@ namespace VEPROMS
btnUline.Checked = !btnUline.Checked;
}
#endregion
#region Find/Replace and Search
/// <summary>
@@ -1002,7 +1018,6 @@ namespace VEPROMS
}
#endregion
#region Similar Steps
/// <summary>
@@ -1019,7 +1034,6 @@ namespace VEPROMS
}
#endregion
#region Help/About
/// <summary>
@@ -1049,54 +1063,38 @@ namespace VEPROMS
#endregion
#region Ribbon
/// <summary>
/// Hide and Unhide ribbon tabs based on the type of tree node selected
/// This Opens the treeView or opens the selected item in the TreeView
/// </summary>
/// <param name="node"></param>
private void setupRibbonTabs(VETreeNode node)
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnOpen_Click(object sender, EventArgs e)
{
//switch (node.VEObject.GetType().Name) // Change to else if & typeof
//{
// case "FolderInfo":
// rtabEdit.Visible = false;
// rtabTools.Visible = false;
// rbnPrint.Visible = false;
// ribbonControl1.SelectedRibbonTabItem = rtabHome;
// break;
// case "DocVersionInfo":
// rtabEdit.Visible = false;
// rtabTools.Visible = false;
// rbnPrint.Visible = false;
// ribbonControl1.SelectedRibbonTabItem = rtabHome;
// break;
// case "ProcedureInfo":
// rtabEdit.Visible = true;
// rtabTools.Visible = true;
// rbnPrint.Visible = true;
// ribbonControl1.SelectedRibbonTabItem = rtabEdit;
// break;
// case "SectionInfo":
// rtabEdit.Visible = true;
// rtabTools.Visible = true;
// rbnPrint.Visible = true;
// ribbonControl1.SelectedRibbonTabItem = rtabEdit;
// break;
// case "StepInfo":
// rtabEdit.Visible = true;
// rtabTools.Visible = true;
// rbnPrint.Visible = true;
// ribbonControl1.SelectedRibbonTabItem = rtabEdit;
// break;
// default:
// rtabEdit.Visible = false;
// rtabTools.Visible = false;
// rbnPrint.Visible = false;
// ribbonControl1.SelectedRibbonTabItem = rtabHome;
// break;
//}
if (!expandablePanel2.Expanded) // If panel not expanded - expand it.
{
expandablePanel2.Expanded = true;
if(tv.Nodes.Count > 0)tv.SelectedNode = tv.Nodes[0];
tv.Focus();
}
else
{
VETreeNode tn = (VETreeNode)(tv.SelectedNode);
if (tn != null)
{
if (tn.VEObject.GetType() == typeof(FolderInfo) || tn.VEObject.GetType() == typeof(DocVersionInfo))
{
if (tn.Nodes.Count > 0)
{
tn.Expand();
tv.SelectedNode = tn.Nodes[0];
tv.Focus();
}
}
else
SetupNodes(tn);
}
}
}
/// <summary>
/// Options button on the dialog that appears when the V icon is clicked (top left of application window)
/// note that the "V icon" is also called the Office 2007 Start Button
@@ -1152,10 +1150,10 @@ namespace VEPROMS
displayTransition.CurTrans = null;
}
#endregion
private AnnotationInfoList _Annotations;
private AnnotationInfoList _Annotations;
private ItemInfo _CurrentItem = null;
private void tc_ItemSelectedChanged(object sender,ItemSelectedChangedEventArgs args)
private void tc_ItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args)
{
//CurrentAnnotation = null;
if (args == null)
@@ -1165,28 +1163,22 @@ private AnnotationInfoList _Annotations;
_Annotations = null;
itemAnnotationsBindingSource.DataSource = _Annotations;
AnnotationPanelView();
infotabRO.Visible = infotabTransition.Visible = infotabTags.Visible = false;
return;
}
if (_CurrentItem != args.MyItemInfo)
_CurrentItem = args.MyItemInfo; //tc.SelectedDisplayTabItem.MyItemInfo;
vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}",_CurrentItem);
//vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem);
if (args.MyStepItem == null)
{
//itemAnnotationsBindingSource.DataSource = null;
//_Annotations = null;
//UpdateAnnotationGrid();
//_CurrentItem = args.MyItemInfo; //tc.SelectedDisplayTabItem.MyItemInfo;
infotabRO.Visible = infotabTransition.Visible = false;
infotabTags.Visible = true;
//vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem);
}
else
{
//_CurrentItem = args.MyItemInfo;
//vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem);
//UpdateAnnotationGrid();
//StepTabPanel dtp = ((DisplayTabItem)tc.SelectedDisplayTabItem).MyStepTabPanel;
//if (dtp == null) return;
//displayTransition.MyRTB = dtp.MyStepPanel.SelectedStepRTB;
//displayRO.MyRTB = dtp.MyStepPanel.SelectedStepItem.MyStepRTB;
infotabRO.Visible = infotabTransition.Visible = infotabTags.Visible = true;
displayTransition.MyRTB = args.MyStepItem.MyStepRTB;
displayRO.MyRTB = args.MyStepItem.MyStepRTB;
}
@@ -1229,7 +1221,7 @@ private AnnotationInfoList _Annotations;
}
}
}
Console.WriteLine("Row = {0}",row);
//Console.WriteLine("Row = {0}", row);
c1AnnotationGrid.Select(row, 0, true);
}
//private void ShowItemAnnotations(string title)
@@ -1238,13 +1230,13 @@ private AnnotationInfoList _Annotations;
//}
//private void itemAnnotationsBindingSource_DataSourceChanged(object sender, EventArgs e)
//{
//_LoadingGrid = true;
//Console.WriteLine("itemAnnotationsBindingSource_DataSourceChanged 1");
//AnnotationInfoList myAnnotations = itemAnnotationsBindingSource.DataSource as AnnotationInfoList;
//Console.WriteLine("itemAnnotationsBindingSource_DataSourceChanged 2");
//AnnotationPannelView(_Annotations);
//Console.WriteLine("itemAnnotationsBindingSource_DataSourceChanged 3");
//_LoadingGrid = false;
//_LoadingGrid = true;
//Console.WriteLine("itemAnnotationsBindingSource_DataSourceChanged 1");
//AnnotationInfoList myAnnotations = itemAnnotationsBindingSource.DataSource as AnnotationInfoList;
//Console.WriteLine("itemAnnotationsBindingSource_DataSourceChanged 2");
//AnnotationPannelView(_Annotations);
//Console.WriteLine("itemAnnotationsBindingSource_DataSourceChanged 3");
//_LoadingGrid = false;
//}
private void AnnotationPanelView()
{
@@ -1274,7 +1266,7 @@ private AnnotationInfoList _Annotations;
if (_CurrentAnnotation == null && value == null) return; // No Change
if (_CurrentAnnotation != null && value != null)
if (_CurrentAnnotation.AnnotationID == value.AnnotationID) return; // No Change
vlnStackTrace.ShowStack("CurrentAnnotation = '{0}' Old = '{1}'", value, _CurrentAnnotation);
//vlnStackTrace.ShowStack("CurrentAnnotation = '{0}' Old = '{1}'", value, _CurrentAnnotation);
if (_CurrentAnnotation != null || _AddingAnnotation)
{
//if (_CurrentAnnotation.TypeID != (int)cbGridAnnoType.SelectedValue) SaveAnnotation();
@@ -1331,7 +1323,7 @@ private AnnotationInfoList _Annotations;
private void btnSave_Click(object sender, EventArgs e)
{
}
private void tc_LinkActiveChanged(object sender, StepPanelLinkEventArgs args)
{
@@ -1398,7 +1390,7 @@ private AnnotationInfoList _Annotations;
_LoadingList = false;
}
private int LastResultsMouseOverIndex=-1;
private int LastResultsMouseOverIndex = -1;
void lbResults_MouseMove(object sender, MouseEventArgs e)
{
int ResultsMouseOverIndex = lbResults.IndexFromPoint(e.Location);
@@ -1517,12 +1509,12 @@ private AnnotationInfoList _Annotations;
private bool AnnotationDirty
{
get { return _AnnotationDirty; }
set
set
{
btnRemoveAnnotation.Enabled = btnAddAnnotation.Enabled = !value;
btnRemoveAnnotation.Enabled = btnAddAnnotation.Enabled = !value;
btnSaveAnnotation.Enabled = btnCancelAnnoation.Enabled = value;
_AddingAnnotation = value && (CurrentAnnotation == null);
_AnnotationDirty = value;
_AnnotationDirty = value;
}
}
@@ -1587,7 +1579,5 @@ private AnnotationInfoList _Annotations;
}
}
}
}