Tree node name logic

This commit is contained in:
Jsj
2008-03-26 18:37:16 +00:00
parent e65a1c1f0a
commit 6cdb38906c
3 changed files with 423 additions and 395 deletions

View File

@@ -50,6 +50,18 @@ namespace VEPROMS
// set the color of the ribbon
RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable((eOffice2007ColorScheme)Settings.Default.SystemColor);
// LATER: get the user setting to control what is displayed for each tree node
// The logic is in the ToString() functions in FolderExt.cs and DocVersionExt.cs
//the GetFolder(1) function will read in the frist node (using ToString() to assign node text)
// Get the saved Tree Node Diplay settings
//if (Settings.Default["UseNameOnTreeNode"])
//{
//}
//if (Settings.Default["UseTitleOnTreeNode"])
//{
//}
VETreeNode tn = VETreeNode.GetFolder(1);
tv.Nodes.Add(tn);
tv.NodeNew += new Volian.Controls.Library.vlnTreeViewTreeNodeEvent(tv_NodeNew);
@@ -365,10 +377,27 @@ namespace VEPROMS
}
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
// this.Text = "VE-PROMS - " + e.Node.Text; // build and display window caption
caption = "";
VETreeNode tn = (VETreeNode)e.Node;
while (tn != null)
{
switch (tn.VEObject.GetType().Name)
{
case "FolderInfo":
case "DocVersionInfo":
if (caption.Equals(""))
caption = tn.Text;
else
caption = tn.Text + " - " + caption;
break;
}
tn = (VETreeNode)tn.Parent;
}
this.Text = caption;
}
void tv_NodeProperties(object sender, Volian.Controls.Library.vlnTreeEventArgs args)