Tab Controls
This commit is contained in:
parent
2e773acb06
commit
544013bbe5
36
PROMS/Volian.Controls.Library/DSOTabPanel.Designer.cs
generated
Normal file
36
PROMS/Volian.Controls.Library/DSOTabPanel.Designer.cs
generated
Normal file
@ -0,0 +1,36 @@
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
partial class DSOTabPanel
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
187
PROMS/Volian.Controls.Library/DSOTabPanel.cs
Normal file
187
PROMS/Volian.Controls.Library/DSOTabPanel.cs
Normal file
@ -0,0 +1,187 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Volian.Controls.Library;
|
||||
|
||||
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
public partial class DSOTabPanel : DevComponents.DotNetBar.PanelDockContainer
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private AxDSOFramer.AxFramerControl _MyDSOFramer;
|
||||
private static int _Count = 0;
|
||||
private DocumentInfo _MyDocument;
|
||||
private int _MyCount;
|
||||
private DisplayTabItem _TabItem;
|
||||
public DisplayTabItem TabItem
|
||||
{
|
||||
get { return _TabItem; }
|
||||
set { _TabItem = value; }
|
||||
}
|
||||
public DSOTabPanel(DocumentInfo documentInfo)
|
||||
{
|
||||
InitializeComponent();
|
||||
SetupDSOTabPanel();
|
||||
_MyDocument = documentInfo;
|
||||
SetupDSO();
|
||||
|
||||
}
|
||||
|
||||
private void SetupDSOTabPanel()
|
||||
{
|
||||
Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
}
|
||||
public DocumentInfo DocumentInfo
|
||||
{
|
||||
get { return _MyDocument; }
|
||||
}
|
||||
private DSOFile _DSOFile;
|
||||
internal DSOFile DSOFile
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_DSOFile == null)
|
||||
_DSOFile = new DSOFile(_MyDocument);
|
||||
return _DSOFile;
|
||||
}
|
||||
}
|
||||
public bool IsDirty
|
||||
{
|
||||
get { return _MyDSOFramer.IsDirty; }
|
||||
}
|
||||
private void SetupDSO()
|
||||
{
|
||||
_Count++;
|
||||
_MyCount = _Count;
|
||||
this._MyDSOFramer = new AxDSOFramer.AxFramerControl();
|
||||
((System.ComponentModel.ISupportInitialize)(this._MyDSOFramer)).BeginInit();
|
||||
//this.SuspendLayout();
|
||||
this.Controls.Add(this._MyDSOFramer);
|
||||
this.components.Add(this._MyDSOFramer);
|
||||
this._MyDSOFramer.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
//this._MyDSOFramer.Enabled = true;
|
||||
//this._MyDSOFramer.Location = new System.Drawing.Point(0, 0);
|
||||
//this._MyDSOFramer.Name = "_DSOFramer";
|
||||
//System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WordDSOTab));
|
||||
//this._DSOFramer.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("_FC.OcxState")));
|
||||
//this._MyDSOFramer.Size = new System.Drawing.Size(657, 453);
|
||||
//this._MyDSOFramer.TabIndex = 0;
|
||||
((System.ComponentModel.ISupportInitialize)(this._MyDSOFramer)).EndInit();
|
||||
//this.ResumeLayout(false);
|
||||
this._MyDSOFramer.EventsEnabled = true;
|
||||
this._MyDSOFramer.Open(DSOFile.MyFile.FullName);
|
||||
this._MyDSOFramer.Menubar = false;
|
||||
this._MyDSOFramer.Titlebar = false;
|
||||
//this._DSOFramer.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoSetOnFirstOpen;
|
||||
if (_MyCount < 20)
|
||||
this._MyDSOFramer.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow;
|
||||
this._MyDSOFramer.Invalidated += new InvalidateEventHandler(_DSOFramer_Invalidated);
|
||||
this._MyDSOFramer.BeforeDocumentClosed += new AxDSOFramer._DFramerCtlEvents_BeforeDocumentClosedEventHandler(_MyDSOFramer_BeforeDocumentClosed);
|
||||
//this.Resize += new EventHandler(DSOTabPage_Resize);
|
||||
this.Enter += new EventHandler(DSOTabPanel_Enter);
|
||||
}
|
||||
void _MyDSOFramer_BeforeDocumentClosed(object sender, AxDSOFramer._DFramerCtlEvents_BeforeDocumentClosedEvent e)
|
||||
{
|
||||
try
|
||||
{
|
||||
SaveDirty();
|
||||
//if(SaveDirty()) e.cancel = true;
|
||||
//throw new System.Data.DataException();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_MyLog.Warn("Before Closing Document ", ex);
|
||||
}
|
||||
}
|
||||
void DSOTabPanel_Enter(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_MyDSOFramer.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow;
|
||||
_MyDSOFramer.Focus();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.ErrorFormat("DSOTabPage_Enter", ex);
|
||||
}
|
||||
}
|
||||
public bool SaveDSO()
|
||||
{
|
||||
bool result = true;
|
||||
try
|
||||
{
|
||||
_MyDSOFramer.Save();
|
||||
DSOFile.SaveFile();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("SaveDSO", ex);
|
||||
result = false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public bool SaveDirty()
|
||||
{
|
||||
if (_MyDSOFramer.IsDirty)
|
||||
{
|
||||
// TODO: Should be based upon Item rather than Document.
|
||||
if (MessageBox.Show("Save changes to " + this.Name, "Document has Changed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
return SaveDSO();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool CloseDSO()
|
||||
{
|
||||
return CloseDSO(false);
|
||||
}
|
||||
public bool CloseDSO(bool force)
|
||||
{
|
||||
bool result = true;
|
||||
try
|
||||
{
|
||||
_MyDSOFramer.Close();
|
||||
Controls.Remove(_MyDSOFramer);
|
||||
components.Remove(_MyDSOFramer);
|
||||
_MyDSOFramer.Dispose();
|
||||
_MyDSOFramer = null;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("SaveDSO - " + this.Name, ex);
|
||||
result = false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
void _DSOFramer_Invalidated(object sender, InvalidateEventArgs e)
|
||||
{
|
||||
//ConsoleWriteLine("_DSOFramer_Invalidated");
|
||||
if (_MyCount >= 20)
|
||||
_MyDSOFramer.Activate();
|
||||
}
|
||||
//void DSOTabPage_Resize(object sender, EventArgs e)
|
||||
//{
|
||||
// //_DSOFramer.Refresh();
|
||||
//}
|
||||
public void Activate()
|
||||
{
|
||||
try
|
||||
{
|
||||
this._MyDSOFramer.Activate();
|
||||
if (_MyCount < 20)
|
||||
this._MyDSOFramer.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow;
|
||||
//this._DSOFramer.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoSetOnFirstOpen;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Activate", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
259
PROMS/Volian.Controls.Library/DisplayTabControl.Designer.cs
generated
Normal file
259
PROMS/Volian.Controls.Library/DisplayTabControl.Designer.cs
generated
Normal file
@ -0,0 +1,259 @@
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
partial class DisplayTabControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
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._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.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip();
|
||||
this.dockSite9.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this._MyBar)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// dotNetBarManager1
|
||||
//
|
||||
this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.F1);
|
||||
this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlC);
|
||||
this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlA);
|
||||
this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlV);
|
||||
this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlX);
|
||||
this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlZ);
|
||||
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.DefinitionName = "";
|
||||
this.dotNetBarManager1.EnableFullSizeDock = false;
|
||||
this.dotNetBarManager1.FillDockSite = this.dockSite9;
|
||||
this.dotNetBarManager1.LeftDockSite = this.dockSite1;
|
||||
this.dotNetBarManager1.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F";
|
||||
this.dotNetBarManager1.ParentForm = null;
|
||||
this.dotNetBarManager1.ParentUserControl = this;
|
||||
this.dotNetBarManager1.RightDockSite = this.dockSite2;
|
||||
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;
|
||||
//
|
||||
// dockSite4
|
||||
//
|
||||
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;
|
||||
//
|
||||
// dockSite9
|
||||
//
|
||||
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[] {
|
||||
((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;
|
||||
//
|
||||
// _MyBar
|
||||
//
|
||||
this._MyBar.AccessibleDescription = "DotNetBar Bar (_MyBar)";
|
||||
this._MyBar.AccessibleName = "DotNetBar Bar";
|
||||
this._MyBar.AccessibleRole = System.Windows.Forms.AccessibleRole.ToolBar;
|
||||
this._MyBar.AlwaysDisplayDockTab = true;
|
||||
this._MyBar.CanCustomize = false;
|
||||
this._MyBar.CanDockBottom = false;
|
||||
this._MyBar.CanDockDocument = true;
|
||||
this._MyBar.CanDockLeft = false;
|
||||
this._MyBar.CanDockRight = false;
|
||||
this._MyBar.CanDockTop = false;
|
||||
this._MyBar.CanHide = true;
|
||||
this._MyBar.CanUndock = false;
|
||||
this._MyBar.CloseSingleTab = true;
|
||||
this._MyBar.DockTabAlignment = DevComponents.DotNetBar.eTabStripAlignment.Top;
|
||||
this._MyBar.LayoutType = DevComponents.DotNetBar.eLayoutType.DockContainer;
|
||||
this._MyBar.Location = new System.Drawing.Point(0, 0);
|
||||
this._MyBar.Name = "_MyBar";
|
||||
this._MyBar.Size = new System.Drawing.Size(673, 383);
|
||||
this._MyBar.Stretch = true;
|
||||
this._MyBar.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
|
||||
this._MyBar.TabIndex = 0;
|
||||
this._MyBar.TabNavigation = true;
|
||||
this._MyBar.TabStop = false;
|
||||
//
|
||||
// dockSite1
|
||||
//
|
||||
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;
|
||||
//
|
||||
// dockSite2
|
||||
//
|
||||
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;
|
||||
//
|
||||
// dockSite8
|
||||
//
|
||||
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;
|
||||
//
|
||||
// dockSite5
|
||||
//
|
||||
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;
|
||||
//
|
||||
// dockSite6
|
||||
//
|
||||
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;
|
||||
//
|
||||
// dockSite7
|
||||
//
|
||||
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;
|
||||
//
|
||||
// dockSite3
|
||||
//
|
||||
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";
|
||||
//
|
||||
// superTooltip1
|
||||
//
|
||||
this.superTooltip1.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F";
|
||||
//
|
||||
// DisplayTabControl
|
||||
//
|
||||
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.Name = "DisplayTabControl";
|
||||
this.Size = new System.Drawing.Size(673, 383);
|
||||
this.dockSite9.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this._MyBar)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevComponents.DotNetBar.DotNetBarManager dotNetBarManager1;
|
||||
private DevComponents.DotNetBar.DockSite dockSite4;
|
||||
private DevComponents.DotNetBar.DockSite dockSite9;
|
||||
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.SuperTooltip superTooltip1;
|
||||
}
|
||||
}
|
84
PROMS/Volian.Controls.Library/DisplayTabControl.cs
Normal file
84
PROMS/Volian.Controls.Library/DisplayTabControl.cs
Normal file
@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Volian.Controls.Library;
|
||||
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
public partial class DisplayTabControl : UserControl
|
||||
{
|
||||
public event DisplayPanelEvent ItemClick;
|
||||
private Dictionary<string, DisplayTabItem> _MyPages;
|
||||
internal void OnItemClick(object sender, DisplayPanelEventArgs args)
|
||||
{
|
||||
if (ItemClick != null) ItemClick(sender, args);
|
||||
}
|
||||
public DisplayTabControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
SetUp();
|
||||
}
|
||||
private void SetUp()
|
||||
{
|
||||
Dock = DockStyle.Fill;
|
||||
dotNetBarManager1.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
|
||||
_MyPages = new Dictionary<string, DisplayTabItem>();
|
||||
}
|
||||
public DevComponents.DotNetBar.Bar MyBar
|
||||
{
|
||||
get { return _MyBar; }
|
||||
}
|
||||
public DisplayTabItem SelectedTab
|
||||
{
|
||||
get { return (DisplayTabItem)_MyBar.SelectedDockContainerItem; }
|
||||
set { if(value != null)_MyBar.SelectedDockContainerItem = value; }
|
||||
}
|
||||
public DisplayTabItem OpenItem(ItemInfo myItem)
|
||||
{
|
||||
if (myItem.MyContent.MyEntry == null)
|
||||
return OpenDisplayTabPage(myItem);
|
||||
else
|
||||
return OpenDSOTabPage(myItem);
|
||||
}
|
||||
private DisplayTabItem OpenDisplayTabPage(ItemInfo myItem)
|
||||
{
|
||||
ItemInfo proc = myItem.MyProcedure; // Find procedure Item
|
||||
string key = "Item - " + proc.ItemID.ToString();
|
||||
DisplayTabItem pg = null;
|
||||
if (_MyPages.ContainsKey(key)) // If Procedure Open use it
|
||||
{
|
||||
pg = _MyPages[key];
|
||||
SelectedTab = pg;
|
||||
}
|
||||
else
|
||||
{
|
||||
pg = new DisplayTabItem(this.components, this, proc); // Open a new Procedure Tab
|
||||
_MyPages.Add(key, pg);
|
||||
SelectedTab = pg;
|
||||
pg.MyTabPanel.MyItem = proc;
|
||||
}
|
||||
pg.ItemSelected = myItem; // Select the item
|
||||
return pg;
|
||||
}
|
||||
private DisplayTabItem OpenDSOTabPage(ItemInfo myItem)
|
||||
{
|
||||
DisplayTabItem pg = null;
|
||||
EntryInfo myEntry = myItem.MyContent.MyEntry;
|
||||
string key = "Doc - " + myEntry.DocID;
|
||||
if (_MyPages.ContainsKey(key)) // If Procedure Open use it
|
||||
pg = _MyPages[key];
|
||||
else
|
||||
{
|
||||
pg = new DisplayTabItem(this.components, this, myItem); // Open a new Procedure Tab
|
||||
_MyPages.Add(key, pg);
|
||||
}
|
||||
SelectedTab = pg;
|
||||
return pg;
|
||||
}
|
||||
}
|
||||
}
|
126
PROMS/Volian.Controls.Library/DisplayTabControl.resx
Normal file
126
PROMS/Volian.Controls.Library/DisplayTabControl.resx
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="dotNetBarManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>168, 17</value>
|
||||
</metadata>
|
||||
</root>
|
36
PROMS/Volian.Controls.Library/DisplayTabItem.Designer.cs
generated
Normal file
36
PROMS/Volian.Controls.Library/DisplayTabItem.Designer.cs
generated
Normal file
@ -0,0 +1,36 @@
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
partial class DisplayTabItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
//protected override void Dispose(bool disposing)
|
||||
//{
|
||||
// if (disposing && (components != null))
|
||||
// {
|
||||
// components.Dispose();
|
||||
// }
|
||||
// base.Dispose(disposing);
|
||||
//}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
86
PROMS/Volian.Controls.Library/DisplayTabItem.cs
Normal file
86
PROMS/Volian.Controls.Library/DisplayTabItem.cs
Normal file
@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
public partial class DisplayTabItem : DevComponents.DotNetBar.DockContainerItem
|
||||
{
|
||||
private DisplayTabControl _MyTabControl;
|
||||
private ItemInfo _MyItem;
|
||||
private DisplayTabPanel _MyTabPanel;
|
||||
public DisplayTabPanel MyTabPanel
|
||||
{
|
||||
get { return _MyTabPanel; }
|
||||
set { _MyTabPanel = value; }
|
||||
}
|
||||
private DSOTabPanel _MyDSOTabPanel;
|
||||
public ItemInfo ItemSelected
|
||||
{
|
||||
get { return _MyTabPanel.ItemSelected; }
|
||||
set { _MyTabPanel.ItemSelected = value; }
|
||||
}
|
||||
public DisplayTabItem(IContainer container, DisplayTabControl myTabControl, ItemInfo myItem)
|
||||
{
|
||||
_MyTabControl = myTabControl;
|
||||
_MyItem = myItem;
|
||||
container.Add(this);
|
||||
InitializeComponent();
|
||||
if (myItem.MyContent.MyEntry == null)
|
||||
SetupDisplayPanel();
|
||||
else
|
||||
SetupDSOPanel();
|
||||
}
|
||||
private void SetupDisplayPanel()
|
||||
{
|
||||
((System.ComponentModel.ISupportInitialize)(_MyTabControl.MyBar)).BeginInit();
|
||||
_MyTabControl.MyBar.SuspendLayout();
|
||||
_MyTabPanel = new DisplayTabPanel(_MyTabControl);
|
||||
//
|
||||
// tabItem
|
||||
//
|
||||
Control = _MyTabPanel;
|
||||
Name = "tabItem Item " + _MyItem.ItemID;
|
||||
Text = _MyItem.TabTitle;
|
||||
Tooltip = _MyItem.TabToolTip;
|
||||
//
|
||||
_MyTabControl.Controls.Add(_MyTabPanel);
|
||||
_MyTabControl.MyBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
|
||||
this});
|
||||
// TODO: Cleanup _MyTabControl.Tabs.Add(this);
|
||||
//
|
||||
// tabPanel
|
||||
//
|
||||
_MyTabPanel.TabItem = this;
|
||||
((System.ComponentModel.ISupportInitialize)(_MyTabControl.MyBar)).EndInit();
|
||||
_MyTabControl.MyBar.ResumeLayout(false);
|
||||
//_MyTabPanel.MyItem = _MyItem;
|
||||
}
|
||||
private void SetupDSOPanel()
|
||||
{
|
||||
EntryInfo myEntry = _MyItem.MyContent.MyEntry;
|
||||
_MyDSOTabPanel = new DSOTabPanel(myEntry.MyDocument);
|
||||
//
|
||||
// tabItem
|
||||
//
|
||||
Control = _MyDSOTabPanel;
|
||||
Name = "tabItem Item " + _MyItem.ItemID;
|
||||
Text = _MyItem.TabTitle;
|
||||
Tooltip = _MyItem.TabToolTip;
|
||||
//
|
||||
_MyTabControl.Controls.Add(_MyDSOTabPanel);
|
||||
_MyTabControl.MyBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
|
||||
this});
|
||||
//
|
||||
// tabPanel
|
||||
//
|
||||
_MyTabControl.SelectedTab = this;
|
||||
_MyDSOTabPanel.TabItem = this;
|
||||
//_MyTabControl.SetToolTip(this, "Header", "Footer", "Body");
|
||||
}
|
||||
}
|
||||
}
|
36
PROMS/Volian.Controls.Library/DisplayTabPanel.Designer.cs
generated
Normal file
36
PROMS/Volian.Controls.Library/DisplayTabPanel.Designer.cs
generated
Normal file
@ -0,0 +1,36 @@
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
partial class DisplayTabPanel
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
70
PROMS/Volian.Controls.Library/DisplayTabPanel.cs
Normal file
70
PROMS/Volian.Controls.Library/DisplayTabPanel.cs
Normal file
@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Volian.Controls.Library;
|
||||
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
public partial class DisplayTabPanel : DevComponents.DotNetBar.PanelDockContainer
|
||||
{
|
||||
private DisplayTabControl _MyTabControl;
|
||||
private Volian.Controls.Library.DisplayPanel _MyPanel;
|
||||
private DisplayTabItem _TabItem;
|
||||
public DisplayTabItem TabItem
|
||||
{
|
||||
get { return _TabItem; }
|
||||
set { _TabItem = value; }
|
||||
}
|
||||
public ItemInfo ItemSelected
|
||||
{
|
||||
get { return _MyPanel.ItemSelected; }
|
||||
set { _MyPanel.ItemSelected = value; }
|
||||
}
|
||||
public ItemInfo MyItem
|
||||
{
|
||||
get { return _MyPanel.MyItem; }
|
||||
set { _MyPanel.MyItem = value; }
|
||||
}
|
||||
public DisplayTabPanel(DisplayTabControl myTabControl)
|
||||
{
|
||||
_MyTabControl = myTabControl;
|
||||
InitializeComponent();
|
||||
SetupDisplayTabPanel();
|
||||
SetupDisplayPanel();
|
||||
}
|
||||
private void SetupDisplayTabPanel()
|
||||
{
|
||||
Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
}
|
||||
private void SetupDisplayPanel()
|
||||
{
|
||||
//this.Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
|
||||
_MyPanel = new Volian.Controls.Library.DisplayPanel(this.components);
|
||||
this.Controls.Add(_MyPanel);
|
||||
//
|
||||
// _MyPanel
|
||||
//
|
||||
_MyPanel.AutoScroll = true;
|
||||
_MyPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
_MyPanel.LinkClicked +=new Volian.Controls.Library.DisplayPanelLinkEvent(_MyPanel_LinkClicked);
|
||||
_MyPanel.ItemClick +=new Volian.Controls.Library.DisplayPanelEvent(_MyPanel_ItemClick);
|
||||
_MyPanel.AttachmentClicked += new Volian.Controls.Library.DisplayPanelAttachmentEvent(_MyPanel_AttachmentClicked);
|
||||
}
|
||||
void _MyPanel_AttachmentClicked(object sender, DisplayPanelAttachmentEventArgs args)
|
||||
{
|
||||
_MyTabControl.OpenItem(args.MyDisplayItem.MyItem);
|
||||
}
|
||||
void _MyPanel_ItemClick(object sender, DisplayPanelEventArgs args)
|
||||
{
|
||||
_MyTabControl.OnItemClick(sender, args);
|
||||
}
|
||||
void _MyPanel_LinkClicked(object sender, DisplayLinkEventArgs args)
|
||||
{
|
||||
_MyTabControl.OpenItem(args.ItemTo);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user