MRI Capability

MyConfig for ItemInfo
Fixed various problems with DisplayTabControl
VEPROMS ribbon for DisplayTabPanel
This commit is contained in:
Rich 2007-12-21 18:29:46 +00:00
parent d797d76ee3
commit 9a7b8ab75d
13 changed files with 1073 additions and 798 deletions

View File

@ -113,5 +113,16 @@ namespace VEPROMS.Properties {
this["SystemColor"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public global::System.Collections.Specialized.StringCollection MRIList {
get {
return ((global::System.Collections.Specialized.StringCollection)(this["MRIList"]));
}
set {
this["MRIList"] = value;
}
}
}
}

View File

@ -26,5 +26,8 @@
<Setting Name="SystemColor" Type="System.Int32" Scope="User">
<Value Profile="(Default)">2</Value>
</Setting>
<Setting Name="MRIList" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>

File diff suppressed because it is too large Load Diff

View File

@ -71,18 +71,67 @@ namespace VEPROMS
// Save the location and size of the VE-PROMS appication for this user
Settings.Default.Location = this.Location;
Settings.Default.Size = this.Size;
Settings.Default.Save();
SaveMRU();
//Settings.Default.Save();
}
private void ShutDownRibbons()
{
rtabEdit.Visible = false;
rtabHelp.Visible = false;
rtabHome.Visible = false;
rtabTools.Visible = false;
ribbonControl1.Height = 50;
}
private void frmVEPROMS_Load(object sender, EventArgs e)
{
// 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;
ShutDownRibbons();
_MyMRIList = MostRecentItemList.GetMRILst((System.Collections.Specialized.StringCollection)(Properties.Settings.Default["MRIList"]));
SetupMRU();
}
#region MRU
private MostRecentItemList _MyMRIList;
private void SetupMRU()
{
icRecentDocs.SubItems.Clear();
if (_MyMRIList.Count > 0)
{
LabelItem lblItem = new LabelItem();
lblItem.Text = "Recent Documents:";
icRecentDocs.SubItems.Add(lblItem);
//icRecentDocs.SubItems.Add();
for (int i = 0; i < _MyMRIList.Count; i++)
{
MostRecentItem mri = _MyMRIList[i];
ButtonItem btnItem = new ButtonItem();
if (i < 9)
btnItem.Text = string.Format("<b>&{0}.</b> {1}", i + 1, mri.MenuTitle);
else
btnItem.Text = string.Format(" {1}", i + 1, mri.MenuTitle);
btnItem.Tag = mri.ItemID;
btnItem.Tooltip = mri.ToolTip;
btnItem.Click += new EventHandler(btnItem_Click);
icRecentDocs.SubItems.Add(btnItem);
}
}
}
void btnItem_Click(object sender, EventArgs e)
{
ButtonItem btnItem = (ButtonItem)sender;
MostRecentItem mri = _MyMRIList.Add((int)(btnItem.Tag));
//SaveMRU();
SetupMRU();
if (mri != null) tc.OpenItem(mri.MyItem);
}
private void SaveMRU()
{
Properties.Settings.Default.MRIList = _MyMRIList.ToSettings();
Properties.Settings.Default.Save();
}
#endregion
#region Tree View
/// <summary>
/// Get the selected tree node's properties
/// </summary>
@ -101,7 +150,8 @@ namespace VEPROMS
epComments.Expanded = false;
rtxbComment.Text = "";
epComments.TitleStyle.BackColor1.Color = _CommentTitleBckColor;
if(_MyMRIList.Add(node.VEObject)!=null)
SetupMRU();
switch (node.VEObject.GetType().Name)
{
case "FolderInfo":
@ -115,6 +165,7 @@ namespace VEPROMS
case "ProcedureInfo":
_LastProcedureInfo = (ProcedureInfo)(_LastTreeNode.VEObject);
_LastProcedure = _LastProcedureInfo.Get();
tc.OpenItem((ItemInfo)_LastProcedureInfo);
if (_LastProcedureInfo.ItemAnnotationCount > 0)
{
@ -138,14 +189,14 @@ namespace VEPROMS
_LastStepInfo = (StepInfo)(_LastTreeNode.VEObject);
_LastStep = _LastStepInfo.Get();
tc.OpenItem((ItemInfo)_LastStepInfo);
if (_LastStepInfo.ItemAnnotationCount > 0)
{
if (!cbCmntDontPopup.Checked)
epComments.Expanded = true;
rtxbComment.Text = _LastStepInfo.ItemAnnotations[0].SearchText;
//if (_LastStepInfo.ItemAnnotationCount > 0)
//{
// if (!cbCmntDontPopup.Checked)
// epComments.Expanded = true;
// rtxbComment.Text = _LastStepInfo.ItemAnnotations[0].SearchText;
itemAnnotationsBindingSource.DataSource = _LastStepInfo.ItemAnnotations;
epComments.TitleStyle.BackColor1.Color = Color.Yellow;
}
// epComments.TitleStyle.BackColor1.Color = Color.Yellow;
//}
#region Sample Display Table Code
// display an exiting table in that rtf grid thing
//if ((_LastStepInfo.MyContent.Type == 20007) || (_LastStepInfo.MyContent.Type == 20009))
@ -944,45 +995,45 @@ namespace VEPROMS
/// <param name="node"></param>
private void setupRibbonTabs(VETreeNode node)
{
switch (node.VEObject.GetType().Name)
{
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;
}
//switch (node.VEObject.GetType().Name)
//{
// 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;
//}
}
/// <summary>
@ -1278,11 +1329,20 @@ namespace VEPROMS
private void tc_ItemSelectedChanged(object sender, DisplayPanelEventArgs args)
{
if (args.MyVlnCSLARTB.MyItem.ItemAnnotationCount > 0)
if(args == null)
itemAnnotationsBindingSource.DataSource = null;
else
itemAnnotationsBindingSource.DataSource = args.MyVlnCSLARTB.MyItem.ItemAnnotations;
}
private void itemAnnotationsBindingSource_DataSourceChanged(object sender, EventArgs e)
{
AnnotationInfoList myAnnotations = itemAnnotationsBindingSource.DataSource as AnnotationInfoList;
if (myAnnotations != null && myAnnotations.Count != 0)
{
if (!cbCmntDontPopup.Checked)
epComments.Expanded = true;
rtxbComment.Text = args.MyVlnCSLARTB.MyItem.ItemAnnotations[0].SearchText;
rtxbComment.Text = myAnnotations[0].SearchText;
}
else
{
@ -1290,6 +1350,7 @@ namespace VEPROMS
epComments.Expanded = false;
rtxbComment.Text = null;
}
}
}
}

View File

@ -533,9 +533,25 @@ namespace VEPROMS.CSLA.Library
{
get { return MyContent.MyFormat; }
}
private DynamicTypeDescriptor _MyConfig=null;
public DynamicTypeDescriptor MyConfig
{
get { return null; }
get
{
if (_MyConfig == null)
{
switch (MyContent.Type / 10000)
{
case 0:
_MyConfig = new ProcedureConfig(MyContent.Config);
break;
case 1:
_MyConfig = new SectionConfig(MyContent.Config);
break;
}
}
return _MyConfig;
}
}
//public bool HasStandardSteps()
//{ return MyContent.ContentItemCount > 1; }

View File

@ -13,6 +13,7 @@ namespace Volian.Controls.Library
{
public partial class DSOTabPanel : DevComponents.DotNetBar.PanelDockContainer
{
private DisplayTabControl _MyTabControl;
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private AxDSOFramer.AxFramerControl _MyDSOFramer;
private static int _Count = 0;
@ -24,8 +25,9 @@ namespace Volian.Controls.Library
get { return _TabItem; }
set { _TabItem = value; }
}
public DSOTabPanel(DocumentInfo documentInfo)
public DSOTabPanel(DocumentInfo documentInfo, DisplayTabControl myTabControl)
{
_MyTabControl = myTabControl;
InitializeComponent();
SetupDSOTabPanel();
_MyDocument = documentInfo;

View File

@ -567,7 +567,7 @@ namespace Volian.Controls.Library
vlnExp.Attachment = (item.MyContent.ContentPartCount == 0);
break;
case 2:
CanExpand = TemporaryFormat.IsHigh(item); ;
CanExpand = item.IsHigh && item.HasChildren; // TemporaryFormat.IsHigh(item); ;
break;
default:
CanExpand = false;
@ -622,10 +622,15 @@ namespace Volian.Controls.Library
{
_DisplayRTB.Focus();
_DisplayRTB.SelectAll();
if (CanExpand) AutoExpand();
int scrollValue = _Panel.VerticalScroll.Value + (Top - (_Panel.Height / 2));
if(scrollValue > _Panel.VerticalScroll.Minimum && scrollValue <= _Panel.VerticalScroll.Maximum)
_Panel.VerticalScroll.Value = scrollValue;
if (CanExpand)
AutoExpand(); // Expand the item if you can
int scrollValue = _Panel.VerticalScroll.Value + (Top - (_Panel.Height / 2)); // calculate scroll center for the item
if(scrollValue > _Panel.VerticalScroll.Minimum && scrollValue <= _Panel.VerticalScroll.Maximum) // If it isn't within range
_Panel.VerticalScroll.Value = scrollValue; // Center the item
}
public void ItemShow()
{
_DisplayRTB.Focus();
}
private void vlnCSLARTB_Paint(object sender, PaintEventArgs e)
{

View File

@ -121,7 +121,7 @@ namespace Volian.Controls.Library
//// TIMING: vlnCSLARTB.TimeIt("pMyItem End");
}
}
private Dictionary<int, DisplayItem> _ItemLookup;
internal Dictionary<int, DisplayItem> _ItemLookup;
public Dictionary<int, DisplayItem> ItemLookup
{
get { return _ItemLookup; }
@ -158,10 +158,15 @@ namespace Volian.Controls.Library
{
int id = value.ItemID;
ExpandAsNeeded(value);
ItemLookup[id].ItemSelect();
_ItemSelected = value;
ItemLookup[id].ItemSelect();
}
}
public void ItemShow()
{
if (_ItemSelected != null)
ItemLookup[_ItemSelected.ItemID].ItemShow();
}
private int _Scrolling = 0; // Volian Property Snippet
public int Scrolling
{

View File

@ -30,21 +30,18 @@ namespace Volian.Controls.Library
{
this.components = new System.ComponentModel.Container();
this.dotNetBarManager1 = new DevComponents.DotNetBar.DotNetBarManager(this.components);
this.dockSite4 = new DevComponents.DotNetBar.DockSite();
this.dockSite9 = new DevComponents.DotNetBar.DockSite();
this.bottomDocDockSite = new DevComponents.DotNetBar.DockSite();
this.fillDocDockSite = new DevComponents.DotNetBar.DockSite();
this._MyBar = new DevComponents.DotNetBar.Bar();
this.dockSite1 = new DevComponents.DotNetBar.DockSite();
this.dockSite2 = new DevComponents.DotNetBar.DockSite();
this.dockSite8 = new DevComponents.DotNetBar.DockSite();
this.dockSite5 = new DevComponents.DotNetBar.DockSite();
this.dockSite6 = new DevComponents.DotNetBar.DockSite();
this.dockSite7 = new DevComponents.DotNetBar.DockSite();
this.dockSite3 = new DevComponents.DotNetBar.DockSite();
this.dockContainerItem3 = new DevComponents.DotNetBar.DockContainerItem();
this.dockContainerItem1 = new DevComponents.DotNetBar.DockContainerItem();
this.dockContainerItem2 = new DevComponents.DotNetBar.DockContainerItem();
this.leftDocDockSite = new DevComponents.DotNetBar.DockSite();
this.rightDocDockSite = new DevComponents.DotNetBar.DockSite();
this.bottomBarDockSite = new DevComponents.DotNetBar.DockSite();
this.leftBarDockSite = new DevComponents.DotNetBar.DockSite();
this.rightBarDockSite = new DevComponents.DotNetBar.DockSite();
this.topBarDockSite = new DevComponents.DotNetBar.DockSite();
this.topDocDockSite = new DevComponents.DotNetBar.DockSite();
this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip();
this.dockSite9.SuspendLayout();
this.fillDocDockSite.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this._MyBar)).BeginInit();
this.SuspendLayout();
//
@ -59,45 +56,45 @@ namespace Volian.Controls.Library
this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlY);
this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.Del);
this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.Ins);
this.dotNetBarManager1.BottomDockSite = this.dockSite4;
this.dotNetBarManager1.BottomDockSite = this.bottomDocDockSite;
this.dotNetBarManager1.DefinitionName = "";
this.dotNetBarManager1.EnableFullSizeDock = false;
this.dotNetBarManager1.FillDockSite = this.dockSite9;
this.dotNetBarManager1.LeftDockSite = this.dockSite1;
this.dotNetBarManager1.FillDockSite = this.fillDocDockSite;
this.dotNetBarManager1.LeftDockSite = this.leftDocDockSite;
this.dotNetBarManager1.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F";
this.dotNetBarManager1.ParentForm = null;
this.dotNetBarManager1.ParentUserControl = this;
this.dotNetBarManager1.RightDockSite = this.dockSite2;
this.dotNetBarManager1.RightDockSite = this.rightDocDockSite;
this.dotNetBarManager1.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
this.dotNetBarManager1.ToolbarBottomDockSite = this.dockSite8;
this.dotNetBarManager1.ToolbarLeftDockSite = this.dockSite5;
this.dotNetBarManager1.ToolbarRightDockSite = this.dockSite6;
this.dotNetBarManager1.ToolbarTopDockSite = this.dockSite7;
this.dotNetBarManager1.TopDockSite = this.dockSite3;
this.dotNetBarManager1.ToolbarBottomDockSite = this.bottomBarDockSite;
this.dotNetBarManager1.ToolbarLeftDockSite = this.leftBarDockSite;
this.dotNetBarManager1.ToolbarRightDockSite = this.rightBarDockSite;
this.dotNetBarManager1.ToolbarTopDockSite = this.topBarDockSite;
this.dotNetBarManager1.TopDockSite = this.topDocDockSite;
//
// dockSite4
// bottomDocDockSite
//
this.dockSite4.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.dockSite4.Dock = System.Windows.Forms.DockStyle.Bottom;
this.dockSite4.DocumentDockContainer = new DevComponents.DotNetBar.DocumentDockContainer();
this.dockSite4.Location = new System.Drawing.Point(0, 383);
this.dockSite4.Name = "dockSite4";
this.dockSite4.Size = new System.Drawing.Size(673, 0);
this.dockSite4.TabIndex = 3;
this.dockSite4.TabStop = false;
this.bottomDocDockSite.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.bottomDocDockSite.Dock = System.Windows.Forms.DockStyle.Bottom;
this.bottomDocDockSite.DocumentDockContainer = new DevComponents.DotNetBar.DocumentDockContainer();
this.bottomDocDockSite.Location = new System.Drawing.Point(0, 383);
this.bottomDocDockSite.Name = "bottomDocDockSite";
this.bottomDocDockSite.Size = new System.Drawing.Size(673, 0);
this.bottomDocDockSite.TabIndex = 3;
this.bottomDocDockSite.TabStop = false;
//
// dockSite9
// fillDocDockSite
//
this.dockSite9.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.dockSite9.Controls.Add(this._MyBar);
this.dockSite9.Dock = System.Windows.Forms.DockStyle.Fill;
this.dockSite9.DocumentDockContainer = new DevComponents.DotNetBar.DocumentDockContainer(new DevComponents.DotNetBar.DocumentBaseContainer[] {
this.fillDocDockSite.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.fillDocDockSite.Controls.Add(this._MyBar);
this.fillDocDockSite.Dock = System.Windows.Forms.DockStyle.Fill;
this.fillDocDockSite.DocumentDockContainer = new DevComponents.DotNetBar.DocumentDockContainer(new DevComponents.DotNetBar.DocumentBaseContainer[] {
((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this._MyBar, 673, 383)))}, DevComponents.DotNetBar.eOrientation.Horizontal);
this.dockSite9.Location = new System.Drawing.Point(0, 0);
this.dockSite9.Name = "dockSite9";
this.dockSite9.Size = new System.Drawing.Size(673, 383);
this.dockSite9.TabIndex = 8;
this.dockSite9.TabStop = false;
this.fillDocDockSite.Location = new System.Drawing.Point(0, 0);
this.fillDocDockSite.Name = "fillDocDockSite";
this.fillDocDockSite.Size = new System.Drawing.Size(673, 383);
this.fillDocDockSite.TabIndex = 8;
this.fillDocDockSite.TabStop = false;
//
// _MyBar
//
@ -125,93 +122,78 @@ namespace Volian.Controls.Library
this._MyBar.TabNavigation = true;
this._MyBar.TabStop = false;
//
// dockSite1
// leftDocDockSite
//
this.dockSite1.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.dockSite1.Dock = System.Windows.Forms.DockStyle.Left;
this.dockSite1.DocumentDockContainer = new DevComponents.DotNetBar.DocumentDockContainer();
this.dockSite1.Location = new System.Drawing.Point(0, 0);
this.dockSite1.Name = "dockSite1";
this.dockSite1.Size = new System.Drawing.Size(0, 383);
this.dockSite1.TabIndex = 0;
this.dockSite1.TabStop = false;
this.leftDocDockSite.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.leftDocDockSite.Dock = System.Windows.Forms.DockStyle.Left;
this.leftDocDockSite.DocumentDockContainer = new DevComponents.DotNetBar.DocumentDockContainer();
this.leftDocDockSite.Location = new System.Drawing.Point(0, 0);
this.leftDocDockSite.Name = "leftDocDockSite";
this.leftDocDockSite.Size = new System.Drawing.Size(0, 383);
this.leftDocDockSite.TabIndex = 0;
this.leftDocDockSite.TabStop = false;
//
// dockSite2
// rightDocDockSite
//
this.dockSite2.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.dockSite2.Dock = System.Windows.Forms.DockStyle.Right;
this.dockSite2.DocumentDockContainer = new DevComponents.DotNetBar.DocumentDockContainer();
this.dockSite2.Location = new System.Drawing.Point(673, 0);
this.dockSite2.Name = "dockSite2";
this.dockSite2.Size = new System.Drawing.Size(0, 383);
this.dockSite2.TabIndex = 1;
this.dockSite2.TabStop = false;
this.rightDocDockSite.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.rightDocDockSite.Dock = System.Windows.Forms.DockStyle.Right;
this.rightDocDockSite.DocumentDockContainer = new DevComponents.DotNetBar.DocumentDockContainer();
this.rightDocDockSite.Location = new System.Drawing.Point(673, 0);
this.rightDocDockSite.Name = "rightDocDockSite";
this.rightDocDockSite.Size = new System.Drawing.Size(0, 383);
this.rightDocDockSite.TabIndex = 1;
this.rightDocDockSite.TabStop = false;
//
// dockSite8
// bottomBarDockSite
//
this.dockSite8.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.dockSite8.Dock = System.Windows.Forms.DockStyle.Bottom;
this.dockSite8.Location = new System.Drawing.Point(0, 383);
this.dockSite8.Name = "dockSite8";
this.dockSite8.Size = new System.Drawing.Size(673, 0);
this.dockSite8.TabIndex = 7;
this.dockSite8.TabStop = false;
this.bottomBarDockSite.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.bottomBarDockSite.Dock = System.Windows.Forms.DockStyle.Bottom;
this.bottomBarDockSite.Location = new System.Drawing.Point(0, 383);
this.bottomBarDockSite.Name = "bottomBarDockSite";
this.bottomBarDockSite.Size = new System.Drawing.Size(673, 0);
this.bottomBarDockSite.TabIndex = 7;
this.bottomBarDockSite.TabStop = false;
//
// dockSite5
// leftBarDockSite
//
this.dockSite5.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.dockSite5.Dock = System.Windows.Forms.DockStyle.Left;
this.dockSite5.Location = new System.Drawing.Point(0, 0);
this.dockSite5.Name = "dockSite5";
this.dockSite5.Size = new System.Drawing.Size(0, 383);
this.dockSite5.TabIndex = 4;
this.dockSite5.TabStop = false;
this.leftBarDockSite.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.leftBarDockSite.Dock = System.Windows.Forms.DockStyle.Left;
this.leftBarDockSite.Location = new System.Drawing.Point(0, 0);
this.leftBarDockSite.Name = "leftBarDockSite";
this.leftBarDockSite.Size = new System.Drawing.Size(0, 383);
this.leftBarDockSite.TabIndex = 4;
this.leftBarDockSite.TabStop = false;
//
// dockSite6
// rightBarDockSite
//
this.dockSite6.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.dockSite6.Dock = System.Windows.Forms.DockStyle.Right;
this.dockSite6.Location = new System.Drawing.Point(673, 0);
this.dockSite6.Name = "dockSite6";
this.dockSite6.Size = new System.Drawing.Size(0, 383);
this.dockSite6.TabIndex = 5;
this.dockSite6.TabStop = false;
this.rightBarDockSite.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.rightBarDockSite.Dock = System.Windows.Forms.DockStyle.Right;
this.rightBarDockSite.Location = new System.Drawing.Point(673, 0);
this.rightBarDockSite.Name = "rightBarDockSite";
this.rightBarDockSite.Size = new System.Drawing.Size(0, 383);
this.rightBarDockSite.TabIndex = 5;
this.rightBarDockSite.TabStop = false;
//
// dockSite7
// topBarDockSite
//
this.dockSite7.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.dockSite7.Dock = System.Windows.Forms.DockStyle.Top;
this.dockSite7.Location = new System.Drawing.Point(0, 0);
this.dockSite7.Name = "dockSite7";
this.dockSite7.Size = new System.Drawing.Size(673, 0);
this.dockSite7.TabIndex = 6;
this.dockSite7.TabStop = false;
this.topBarDockSite.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.topBarDockSite.Dock = System.Windows.Forms.DockStyle.Top;
this.topBarDockSite.Location = new System.Drawing.Point(0, 0);
this.topBarDockSite.Name = "topBarDockSite";
this.topBarDockSite.Size = new System.Drawing.Size(673, 0);
this.topBarDockSite.TabIndex = 6;
this.topBarDockSite.TabStop = false;
//
// dockSite3
// topDocDockSite
//
this.dockSite3.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.dockSite3.Dock = System.Windows.Forms.DockStyle.Top;
this.dockSite3.DocumentDockContainer = new DevComponents.DotNetBar.DocumentDockContainer();
this.dockSite3.Location = new System.Drawing.Point(0, 0);
this.dockSite3.Name = "dockSite3";
this.dockSite3.Size = new System.Drawing.Size(673, 0);
this.dockSite3.TabIndex = 2;
this.dockSite3.TabStop = false;
//
// dockContainerItem3
//
this.dockContainerItem3.Name = "dockContainerItem3";
this.dockContainerItem3.Text = "dockContainerItem3";
//
// dockContainerItem1
//
this.dockContainerItem1.Name = "dockContainerItem1";
this.dockContainerItem1.Text = "dockContainerItem1";
//
// dockContainerItem2
//
this.dockContainerItem2.Name = "dockContainerItem2";
this.dockContainerItem2.Text = "dockContainerItem2";
this.topDocDockSite.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
this.topDocDockSite.Dock = System.Windows.Forms.DockStyle.Top;
this.topDocDockSite.DocumentDockContainer = new DevComponents.DotNetBar.DocumentDockContainer();
this.topDocDockSite.Location = new System.Drawing.Point(0, 0);
this.topDocDockSite.Name = "topDocDockSite";
this.topDocDockSite.Size = new System.Drawing.Size(673, 0);
this.topDocDockSite.TabIndex = 2;
this.topDocDockSite.TabStop = false;
//
// superTooltip1
//
@ -221,18 +203,18 @@ namespace Volian.Controls.Library
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.dockSite9);
this.Controls.Add(this.dockSite2);
this.Controls.Add(this.dockSite1);
this.Controls.Add(this.dockSite3);
this.Controls.Add(this.dockSite4);
this.Controls.Add(this.dockSite5);
this.Controls.Add(this.dockSite6);
this.Controls.Add(this.dockSite7);
this.Controls.Add(this.dockSite8);
this.Controls.Add(this.fillDocDockSite);
this.Controls.Add(this.rightDocDockSite);
this.Controls.Add(this.leftDocDockSite);
this.Controls.Add(this.topDocDockSite);
this.Controls.Add(this.bottomDocDockSite);
this.Controls.Add(this.leftBarDockSite);
this.Controls.Add(this.rightBarDockSite);
this.Controls.Add(this.topBarDockSite);
this.Controls.Add(this.bottomBarDockSite);
this.Name = "DisplayTabControl";
this.Size = new System.Drawing.Size(673, 383);
this.dockSite9.ResumeLayout(false);
this.fillDocDockSite.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this._MyBar)).EndInit();
this.ResumeLayout(false);
@ -241,19 +223,19 @@ namespace Volian.Controls.Library
#endregion
private DevComponents.DotNetBar.DotNetBarManager dotNetBarManager1;
private DevComponents.DotNetBar.DockSite dockSite4;
private DevComponents.DotNetBar.DockSite dockSite9;
private DevComponents.DotNetBar.DockSite bottomDocDockSite;
private DevComponents.DotNetBar.DockSite fillDocDockSite;
private DevComponents.DotNetBar.Bar _MyBar;
private DevComponents.DotNetBar.DockContainerItem dockContainerItem1;
private DevComponents.DotNetBar.DockSite dockSite1;
private DevComponents.DotNetBar.DockSite dockSite2;
private DevComponents.DotNetBar.DockSite dockSite3;
private DevComponents.DotNetBar.DockSite dockSite5;
private DevComponents.DotNetBar.DockSite dockSite6;
private DevComponents.DotNetBar.DockSite dockSite7;
private DevComponents.DotNetBar.DockSite dockSite8;
private DevComponents.DotNetBar.DockContainerItem dockContainerItem2;
private DevComponents.DotNetBar.DockContainerItem dockContainerItem3;
//private DevComponents.DotNetBar.DockContainerItem dockContainerItem1;
private DevComponents.DotNetBar.DockSite leftDocDockSite;
private DevComponents.DotNetBar.DockSite rightDocDockSite;
private DevComponents.DotNetBar.DockSite topDocDockSite;
private DevComponents.DotNetBar.DockSite leftBarDockSite;
private DevComponents.DotNetBar.DockSite rightBarDockSite;
private DevComponents.DotNetBar.DockSite topBarDockSite;
private DevComponents.DotNetBar.DockSite bottomBarDockSite;
//private DevComponents.DotNetBar.DockContainerItem dockContainerItem2;
//private DevComponents.DotNetBar.DockContainerItem dockContainerItem3;
private DevComponents.DotNetBar.SuperTooltip superTooltip1;
}
}

View File

@ -7,6 +7,7 @@ using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using Volian.Controls.Library;
using DevComponents.DotNetBar;
namespace Volian.Controls.Library
{
@ -14,6 +15,7 @@ namespace Volian.Controls.Library
{
private Dictionary<string, DisplayTabItem> _MyPages;
public event DisplayPanelEvent ItemClick;
private List<DisplayTabItem> _RemovedItems = null;
internal void OnItemClick(object sender, DisplayPanelEventArgs args)
{
if (ItemClick != null) ItemClick(sender, args);
@ -30,10 +32,100 @@ namespace Volian.Controls.Library
}
private void SetUp()
{
_RemovedItems = new List<DisplayTabItem>();
Dock = DockStyle.Fill;
dotNetBarManager1.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
_MyPages = new Dictionary<string, DisplayTabItem>();
//dotNetBarManager1.DockTabClosing += new DevComponents.DotNetBar.DockTabClosingEventHandler(dotNetBarManager1_DockTabClosing);
//_MyBar.DockTabControl.CloseButtonOnTabsAlwaysDisplayed = true;
SetupBar(_MyBar);
dotNetBarManager1.BarTearOff += new EventHandler(dotNetBarManager1_BarTearOff);
}
void dotNetBarManager1_BarTearOff(object sender, EventArgs e)
{
Bar myBar = sender as Bar;
//SetupBar(myBar);
myBar.Enter += new EventHandler(myBar_Enter);
}
//private void ShowPG(object myObject)
//{
//frmPropGridTest tmp = new frmPropGridTest(myObject);
//tmp.Show();
//}
private void SetupBar(Bar myBar)
{
if (myBar.DockTabControl != null)
{
myBar.DockTabControl.CloseButtonOnTabsVisible = true;
myBar.DockTabControl.CloseButtonVisible = false;
myBar.DockTabControl.CloseButtonPosition = DevComponents.DotNetBar.eTabCloseButtonPosition.Right;
myBar.DockTabControl.Width = ClientRectangle.Width;
//ShowPG(myBar);
//ShowPG(myBar.DockTabControl);
}
myBar.DockTabClosing += new DockTabClosingEventHandler(myBar_DockTabClosing);
if (!myBar.Visible)
myBar.Visible = true;
myBar.RecalcLayout();
}
void myBar_Enter(object sender, EventArgs e)
{
Bar myBar = sender as Bar;
myBar.Enter -= new EventHandler(myBar_Enter);
SetupBar(sender as Bar);
}
void myBar_DockTabClosing(object sender, DockTabClosingEventArgs e)
{
e.RemoveDockTab = true;
_RemovedItems.Add((DisplayTabItem)e.DockContainerItem);
//RemoveItem((DisplayTabItem)e.DockContainerItem);
if (((Bar)sender).Items.Count == 1)// Remove bar if last item is closed...
{
dotNetBarManager1.Bars.Remove((Bar)sender);
ActivateRemainingTab();
}
}
private void ActivateRemainingTab()
{
foreach (Bar myBar in dotNetBarManager1.Bars)
{
if (myBar.DockSide == eDockSide.Document && myBar.Visible)
{
myBar.SelectedDockContainerItem.Selected = true;
}
}
// No Document Tabs Remaining - need to raise OnItemSelectedChanged
OnItemSelectedChanged(this, null);
}
private Bar GetFirstDocumentBar()
{
foreach (Bar b in dotNetBarManager1.Bars)
{
if (b.DockSide == eDockSide.Document && b.Visible)
return b;
}
// If no documents bars found, create new one
//_UniqueBarCount++;
Bar bar = BarUtilities.CreateDocumentBar();
//bar.DockTabClosing += new DockTabClosingEventHandler(DocumentBar_DockTabClosing);
//bar.Name = "barDocuments" + m_UniqueBarCount.ToString();
fillDocDockSite.GetDocumentUIManager().Dock(bar);
SetupBar(bar);
return bar;
}
//void dotNetBarManager1_DockTabClosing(object sender, DevComponents.DotNetBar.DockTabClosingEventArgs e)
//{
// e.RemoveDockTab = true;
// _RemovedItems.Add((DisplayTabItem)e.DockContainerItem);
// //RemoveItem((DisplayTabItem)e.DockContainerItem);
// if (((Bar)sender).Items.Count == 1) // Remove bar if last item is closed...
// dotNetBarManager1.Bars.Remove((Bar)sender);
//}
public DevComponents.DotNetBar.Bar MyBar
{
get { return _MyBar; }
@ -41,15 +133,56 @@ namespace Volian.Controls.Library
public DisplayTabItem SelectedTab
{
get { return (DisplayTabItem)_MyBar.SelectedDockContainerItem; }
set { if(value != null)_MyBar.SelectedDockContainerItem = value; }
set
{
if (value != null)
value.Selected = true;
}
}
public DisplayTabItem OpenItem(ItemInfo myItem)
{
while (_RemovedItems.Count > 0)
{
DisplayTabItem tabItem = _RemovedItems[0];
_RemovedItems.RemoveAt(0);
RemoveItem(tabItem);
}
_MyBar = GetParentBar(myItem);
if (myItem.MyContent.MyEntry == null)
return OpenDisplayTabPage(myItem);
else
return OpenDSOTabPage(myItem);
}
private Bar GetParentBar(ItemInfo myItem)
{
Bar myBar = null;
foreach (Bar b in dotNetBarManager1.Bars)
{
if (b.DockSide == eDockSide.Document && b.Visible)
{
myBar = b;
foreach (object itm in myBar.Items)
{
DisplayTabItem myTabItem = itm as DisplayTabItem;
if (myTabItem != null && myTabItem.MyTabPanel != null)
if (myTabItem.MyTabPanel.MyItem.ItemID == myItem.MyProcedure.ItemID)
return myBar;
}
}
}
if (myBar == null)
{
// If no documents bars found, create new one
//_UniqueBarCount++;
myBar = BarUtilities.CreateDocumentBar();
//bar.DockTabClosing += new DockTabClosingEventHandler(DocumentBar_DockTabClosing);
//bar.Name = "barDocuments" + m_UniqueBarCount.ToString();
fillDocDockSite.GetDocumentUIManager().Dock(myBar);
SetupBar(myBar);
}
return myBar;
}
private DisplayTabItem OpenDisplayTabPage(ItemInfo myItem)
{
ItemInfo proc = myItem.MyProcedure; // Find procedure Item
@ -58,18 +191,31 @@ namespace Volian.Controls.Library
if (_MyPages.ContainsKey(key)) // If Procedure Open use it
{
pg = _MyPages[key];
SelectedTab = pg;
pg.Selected = true;
//SelectedTab = pg;
}
else
{
pg = new DisplayTabItem(this.components, this, proc); // Open a new Procedure Tab
pg = new DisplayTabItem(this.components, this, proc, key); // Open a new Procedure Tab
//_MyBar.Items.Add(pg);
_MyPages.Add(key, pg);
SelectedTab = pg;
pg.Selected = true;
//SelectedTab = pg;
pg.MyTabPanel.MyItem = proc;
}
Application.DoEvents();
pg.ItemSelected = myItem; // Select the item
return pg;
}
internal void RemoveItem(DisplayTabItem myItem)
{
_MyPages.Remove(myItem.MyKey);
// Can I dispose the Panel
myItem.MyTabPanel.Dispose();
//myItem.Name = null;
components.Remove(myItem);
myItem.Dispose();
}
private DisplayTabItem OpenDSOTabPage(ItemInfo myItem)
{
DisplayTabItem pg = null;
@ -79,7 +225,7 @@ namespace Volian.Controls.Library
pg = _MyPages[key];
else
{
pg = new DisplayTabItem(this.components, this, myItem); // Open a new Procedure Tab
pg = new DisplayTabItem(this.components, this, myItem,key); // Open a new Procedure Tab
_MyPages.Add(key, pg);
}
SelectedTab = pg;

View File

@ -13,6 +13,11 @@ namespace Volian.Controls.Library
private DisplayTabControl _MyTabControl;
private ItemInfo _MyItem;
private DisplayTabPanel _MyTabPanel;
private string _MyKey;
public string MyKey
{
get { return _MyKey; }
}
public DisplayTabPanel MyTabPanel
{
get { return _MyTabPanel; }
@ -24,16 +29,42 @@ namespace Volian.Controls.Library
get { return _MyTabPanel.ItemSelected; }
set { _MyTabPanel.ItemSelected = value; }
}
public DisplayTabItem(IContainer container, DisplayTabControl myTabControl, ItemInfo myItem)
public DisplayTabItem(IContainer container, DisplayTabControl myTabControl, ItemInfo myItem, string myKey)
{
_MyKey = myKey;
_MyTabControl = myTabControl;
_MyItem = myItem;
container.Add(this);
InitializeComponent();
this.Click += new EventHandler(DisplayTabItem_Click);
if (myItem.MyContent.MyEntry == null)
SetupDisplayPanel();
else
SetupDSOPanel();
this.Disposed+=new EventHandler(DisplayTabItem_Disposed);
//_MyTabPanel.HandleDestroyed += new EventHandler(_MyTabPanel_HandleDestroyed);
//_MyTabPanel.Disposed += new EventHandler(_MyTabPanel_Disposed);
}
void DisplayTabItem_Click(object sender, EventArgs e)
{
// See if I can tell the TabControl that the ItemSelected has changed
DisplayTabItem myTabItem = sender as DisplayTabItem;
if(myTabItem == null)return;
DisplayTabPanel myTabPanel = myTabItem.MyTabPanel as DisplayTabPanel;
if(myTabPanel == null) return;
_MyTabControl.OnItemSelectedChanged(this,new DisplayPanelEventArgs(MyTabPanel.SelectedItem,null));
}
//void _MyTabPanel_Disposed(object sender, EventArgs e)
//{
// Console.WriteLine("_MyTabPanel_Disposed");
//}
//void _MyTabPanel_HandleDestroyed(object sender, EventArgs e)
//{
// Console.WriteLine("_MyTabPanel_HandleDestroyed");
//}
void DisplayTabItem_Disposed(object sender, EventArgs e)
{
Console.WriteLine("DisplayTabItem_Disposed");
}
private void SetupDisplayPanel()
{
@ -49,8 +80,7 @@ namespace Volian.Controls.Library
Tooltip = _MyItem.TabToolTip;
//
_MyTabControl.Controls.Add(_MyTabPanel);
_MyTabControl.MyBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
this});
_MyTabControl.MyBar.Items.Add(this);
// TODO: Cleanup _MyTabControl.Tabs.Add(this);
//
// tabPanel
@ -63,7 +93,7 @@ namespace Volian.Controls.Library
private void SetupDSOPanel()
{
EntryInfo myEntry = _MyItem.MyContent.MyEntry;
_MyDSOTabPanel = new DSOTabPanel(myEntry.MyDocument);
_MyDSOTabPanel = new DSOTabPanel(myEntry.MyDocument, _MyTabControl);
//
// tabItem
//

View File

@ -12,7 +12,13 @@ namespace Volian.Controls.Library
public partial class DisplayTabPanel : DevComponents.DotNetBar.PanelDockContainer
{
private DisplayTabControl _MyTabControl;
private DisplayTabRibbon _MyTabRibbon;
private Volian.Controls.Library.DisplayPanel _MyPanel;
public Volian.Controls.Library.DisplayPanel MyPanel
{
get { return _MyPanel; }
set { _MyPanel = value; }
}
private DisplayTabItem _TabItem;
public DisplayTabItem TabItem
{
@ -24,6 +30,10 @@ namespace Volian.Controls.Library
get { return _MyPanel.ItemSelected; }
set { _MyPanel.ItemSelected = value; }
}
public DisplayItem SelectedItem
{
get { return _MyPanel._ItemLookup[_MyPanel.ItemSelected.ItemID]; }
}
public ItemInfo MyItem
{
get { return _MyPanel.MyItem; }
@ -35,10 +45,25 @@ namespace Volian.Controls.Library
InitializeComponent();
SetupDisplayTabPanel();
SetupDisplayPanel();
SetupDisplayTabRibbon();
}
private void SetupDisplayTabRibbon()
{
_MyTabRibbon = new DisplayTabRibbon();
_MyTabRibbon.Dock = System.Windows.Forms.DockStyle.Top;
_MyTabRibbon.Location = new System.Drawing.Point(0, 0);
_MyTabRibbon.Name = "displayTabRibbon1";
_MyTabRibbon.RichTextBox = null;
this.Controls.Add(_MyTabRibbon);
}
private void SetupDisplayTabPanel()
{
Dock = System.Windows.Forms.DockStyle.Fill;
this.Enter += new EventHandler(DisplayTabPanel_Enter);
}
void DisplayTabPanel_Enter(object sender, EventArgs e)
{
if (ItemSelected != null) _MyPanel.ItemShow();
}
private void SetupDisplayPanel()
{

View File

@ -92,6 +92,12 @@
<Compile Include="DisplayTabPanel.Designer.cs">
<DependentUpon>DisplayTabPanel.cs</DependentUpon>
</Compile>
<Compile Include="DisplayTabRibbon.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="DisplayTabRibbon.designer.cs">
<DependentUpon>DisplayTabRibbon.cs</DependentUpon>
</Compile>
<Compile Include="DSOTabPanel.cs">
<SubType>Component</SubType>
</Compile>
@ -101,7 +107,13 @@
<Compile Include="FlagEnumEditor.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="MostRecentItem.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="RichTextBox41.cs">
<SubType>Component</SubType>
</Compile>
@ -129,6 +141,12 @@
<Compile Include="vlnTreeView.Designer.cs">
<DependentUpon>vlnTreeView.cs</DependentUpon>
</Compile>
<Compile Include="vlnTreeView3.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="vlnTreeView3.Designer.cs">
<DependentUpon>vlnTreeView3.cs</DependentUpon>
</Compile>
<Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
</ItemGroup>
<ItemGroup>
@ -140,6 +158,15 @@
<DependentUpon>DisplayTabControl.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="DisplayTabRibbon.resx">
<DependentUpon>DisplayTabRibbon.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="vlnExpander.resx">
<DependentUpon>vlnExpander.cs</DependentUpon>
<SubType>Designer</SubType>