2008-03-03 15:16:42 +00:00

112 lines
3.5 KiB
C#

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 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
{
get { return _TabItem; }
set { _TabItem = value; }
}
public ItemInfo ItemSelected
{
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; }
set { _MyPanel.MyItem = value; }
}
public DisplayTabPanel(DisplayTabControl myTabControl)
{
_MyTabControl = myTabControl;
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()
{
//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.LinkModifyTran += new DisplayPanelLinkEvent(_MyPanel_LinkModifyTran);
_MyPanel.LinkModifyRO += new DisplayPanelLinkEvent(_MyPanel_LinkModifyRO);
_MyPanel.ItemClick +=new Volian.Controls.Library.DisplayPanelEvent(_MyPanel_ItemClick);
_MyPanel.AttachmentClicked += new Volian.Controls.Library.DisplayPanelAttachmentEvent(_MyPanel_AttachmentClicked);
_MyPanel.ItemSelectedChanged += new DisplayPanelEvent(_MyPanel_ItemSelectedChanged);
}
void _MyPanel_LinkModifyTran(object sender, DisplayLinkEventArgs args)
{
_MyTabControl.OnLinkModifyTran(sender, args);
}
void _MyPanel_LinkModifyRO(object sender, DisplayLinkEventArgs args)
{
_MyTabControl.OnLinkModifyRO(sender, args);
}
void _MyPanel_ItemSelectedChanged(object sender, DisplayPanelEventArgs args)
{
_MyTabControl.OnItemSelectedChanged(sender, args);
}
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);
}
}
}