⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dockpanestripvs2005.cs

📁 Fireball.CodeEditor is an source code editor control derived from the best compona SyntaxBox Control
💻 CS
📖 第 1 页 / 共 3 页
字号:
// *****************************************************************************
// 
//  Copyright 2004, Weifen Luo
//  All rights reserved. The software and associated documentation 
//  supplied hereunder are the proprietary information of Weifen Luo
//  and are supplied subject to licence terms.
// 
//  WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using System.ComponentModel;

namespace Fireball.Docking
{
	/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/ClassDef/*'/>
	[ToolboxItem(false)]
	public class DockPaneStripVS2005 : DockPaneStripBase
	{
		#region consts
		private const int _ToolWindowStripGapLeft = 4;
		private const int _ToolWindowStripGapRight = 3;
		private const int _ToolWindowImageHeight = 16;
		private const int _ToolWindowImageWidth = 16;
		private const int _ToolWindowImageGapTop = 3;
		private const int _ToolWindowImageGapBottom = 1;
		private const int _ToolWindowImageGapLeft = 3;
		private const int _ToolWindowImageGapRight = 2;
		private const int _ToolWindowTextGapRight = 1;
		private const int _ToolWindowTabSeperatorGapTop = 3;
		private const int _ToolWindowTabSeperatorGapBottom = 3;

		private const int _DocumentTabMaxWidth = 200;
		private const int _DocumentButtonGapTop = 5;
		private const int _DocumentButtonGapBottom = 5;
		private const int _DocumentButtonGapBetween = 0;
		private const int _DocumentButtonGapRight = 3;
		private const int _DocumentTabGapTop = 3;
		private const int _DocumentTabGapLeft = 3;
		private const int _DocumentTabGapRight = 10;
		private const int _DocumentTextExtraHeight = 6;
		private const int _DocumentTextExtraWidth = 10;
		private const int _DocumentIconGapLeft = 6;
		private const int _DocumentIconHeight = 16;
		private const int _DocumentIconWidth = 16;

		private const string _ResourceImageCloseEnabled = "DockPaneStrip.CloseEnabled.bmp";
		private const string _ResourceImageCloseDisabled = "DockPaneStrip.CloseDisabled.bmp";
		private const string _ResourceImageScrollLeftEnabled = "DockPaneStrip.ScrollLeftEnabled.bmp";
		private const string _ResourceImageScrollLeftDisabled = "DockPaneStrip.ScrollLeftDisabled.bmp";
		private const string _ResourceImageScrollRightEnabled = "DockPaneStrip.ScrollRightEnabled.bmp";
		private const string _ResourceImageScrollRightDisabled = "DockPaneStrip.ScrollRightDisabled.bmp";
		private const string _ResourceToolTipClose = "DockPaneStrip.ToolTipClose";
		private const string _ResourceToolTipScrollLeft = "DockPaneStrip.ToolTipScrollLeft";
		private const string _ResourceToolTipScrollRight = "DockPaneStrip.ToolTipScrollRight";
		#endregion

		private InertButton m_buttonClose, m_buttonScrollLeft, m_buttonScrollRight;
		private IContainer m_components;
		private ToolTip m_toolTip;

		/// <exclude/>
		protected IContainer Components
		{
			get	{	return m_components;	}
		}

		private int m_offsetX = 0;
		private int OffsetX
		{
			get	{	return m_offsetX;	}
			set
			{	
				m_offsetX = value;
				#if DEBUG
				if (m_offsetX > 0)
					throw new InvalidOperationException();
				#endif
			}
		}

		#region Customizable Properties
		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowStripGapLeft"]/*'/>
		protected virtual int ToolWindowStripGapLeft
		{
			get	{	return _ToolWindowStripGapLeft;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowStripGapRight"]/*'/>
		protected virtual int ToolWindowStripGapRight
		{
			get	{	return _ToolWindowStripGapRight;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowImageHeight"]/*'/>
		protected virtual int ToolWindowImageHeight
		{
			get	{	return _ToolWindowImageHeight;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowImageWidth"]/*'/>
		protected virtual int ToolWindowImageWidth
		{
			get	{	return _ToolWindowImageWidth;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowImageGapTop"]/*'/>
		protected virtual int ToolWindowImageGapTop
		{
			get	{	return _ToolWindowImageGapTop;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowImageGapBottom"]/*'/>
		protected virtual int ToolWindowImageGapBottom
		{
			get	{	return _ToolWindowImageGapBottom;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowImageGapLeft"]/*'/>
		protected virtual int ToolWindowImageGapLeft
		{
			get	{	return _ToolWindowImageGapLeft;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowImageGapRight"]/*'/>
		protected virtual int ToolWindowImageGapRight
		{
			get	{	return _ToolWindowImageGapRight;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowTextGapRight"]/*'/>
		protected virtual int ToolWindowTextGapRight
		{
			get	{	return _ToolWindowTextGapRight;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowSeperatorGaptop"]/*'/>
		protected virtual int ToolWindowTabSeperatorGapTop
		{
			get	{	return _ToolWindowTabSeperatorGapTop;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowSeperatorGapBottom"]/*'/>
		protected virtual int ToolWindowTabSeperatorGapBottom
		{
			get	{	return _ToolWindowTabSeperatorGapBottom;	}
		}

		private static Image _imageCloseEnabled = null;
		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ImageCloseEnabled"]/*'/>
		protected virtual Image ImageCloseEnabled
		{
			get
			{	
				if (_imageCloseEnabled == null)
					_imageCloseEnabled = ResourceHelper.LoadBitmap(_ResourceImageCloseEnabled);
				return _imageCloseEnabled;
			}
		}

		private static Image _imageCloseDisabled = null;
		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ImageCloseDisabled"]/*'/>
		protected virtual Image ImageCloseDisabled
		{
			get
			{	
				if (_imageCloseDisabled == null)
					_imageCloseDisabled = ResourceHelper.LoadBitmap(_ResourceImageCloseDisabled);
				return _imageCloseDisabled;
			}
		}

		private static Image _imageScrollLeftEnabled = null;
		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ImageScrollLeftEnabled"]/*'/>
		protected virtual Image ImageScrollLeftEnabled
		{
			get
			{	
				if (_imageScrollLeftEnabled == null)
					_imageScrollLeftEnabled = ResourceHelper.LoadBitmap(_ResourceImageScrollLeftEnabled);
				return _imageScrollLeftEnabled;
			}
		}

		private static Image _imageScrollLeftDisabled = null;
		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ImageScrollLeftDisabled"]/*'/>
		protected virtual Image ImageScrollLeftDisabled
		{
			get
			{	
				if (_imageScrollLeftDisabled == null)
					_imageScrollLeftDisabled = ResourceHelper.LoadBitmap(_ResourceImageScrollLeftDisabled);
				return _imageScrollLeftDisabled;
			}
		}

		private static Image _imageScrollRightEnabled = null;
		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ImageScrollRightEnabled"]/*'/>
		protected virtual Image ImageScrollRightEnabled
		{
			get
			{	
				if (_imageScrollRightEnabled == null)
					_imageScrollRightEnabled = ResourceHelper.LoadBitmap(_ResourceImageScrollRightEnabled);
				return _imageScrollRightEnabled;
			}
		}

		private static Image _imageScrollRightDisabled = null;
		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ImageScrollRightDisabled"]/*'/>
		protected virtual Image ImageScrollRightDisabled
		{
			get
			{	
				if (_imageScrollRightDisabled == null)
					_imageScrollRightDisabled = ResourceHelper.LoadBitmap(_ResourceImageScrollRightDisabled);
				return _imageScrollRightDisabled;
			}
		}

		private static string _toolTipClose = null;
		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolTipClose"]/*'/>
		protected virtual string ToolTipClose
		{
			get
			{	
				if (_toolTipClose == null)
					_toolTipClose = ResourceHelper.GetString(_ResourceToolTipClose);
				return _toolTipClose;
			}
		}

		private static string _toolTipScrollLeft = null;
		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolTipScrollLeft"]/*'/>
		protected virtual string ToolTipScrollLeft
		{
			get
			{	
				if (_toolTipScrollLeft == null)
					_toolTipScrollLeft = ResourceHelper.GetString(_ResourceToolTipScrollLeft);
				return _toolTipScrollLeft;
			}
		}

		private static string _toolTipScrollRight = null;
		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolTipScrollRight"]/*'/>
		protected virtual string ToolTipScrollRight
		{
			get
			{	
				if (_toolTipScrollRight == null)
					_toolTipScrollRight = ResourceHelper.GetString(_ResourceToolTipScrollRight);
				return _toolTipScrollRight;
			}
		}

		private static StringFormat _toolWindowTextStringFormat = null;
		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowTextStringFormat"]/*'/>
		protected virtual StringFormat ToolWindowTextStringFormat
		{
			get
			{	
				if (_toolWindowTextStringFormat == null)
				{
					_toolWindowTextStringFormat = new StringFormat(StringFormat.GenericTypographic);
					_toolWindowTextStringFormat.Trimming = StringTrimming.EllipsisCharacter;
					_toolWindowTextStringFormat.LineAlignment = StringAlignment.Center;
					_toolWindowTextStringFormat.FormatFlags = StringFormatFlags.NoWrap;
				}
				return _toolWindowTextStringFormat;
			}
		}

		private static StringFormat _documentTextStringFormat = null;
		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentTextStringFormat"]/*'/>
		public static StringFormat DocumentTextStringFormat
		{
			get
			{	
				if (_documentTextStringFormat == null)
				{
					_documentTextStringFormat = new StringFormat(StringFormat.GenericTypographic);
					_documentTextStringFormat.Alignment = StringAlignment.Near;
					_documentTextStringFormat.Trimming = StringTrimming.EllipsisCharacter;
					_documentTextStringFormat.LineAlignment = StringAlignment.Center;
					_documentTextStringFormat.FormatFlags = StringFormatFlags.NoWrap;
				}
				return _documentTextStringFormat;
			}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentTabMaxWidth"]/*'/>
		protected virtual int DocumentTabMaxWidth
		{
			get	{	return _DocumentTabMaxWidth;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentButtonGapTop"]/*'/>
		protected virtual int DocumentButtonGapTop
		{
			get	{	return _DocumentButtonGapTop;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentButtonGapBottom"]/*'/>
		protected virtual int DocumentButtonGapBottom
		{
			get	{	return _DocumentButtonGapBottom;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentButtonGapBetween"]/*'/>
		protected virtual int DocumentButtonGapBetween
		{
			get	{	return _DocumentButtonGapBetween;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentButtonGapRight"]/*'/>
		protected virtual int DocumentButtonGapRight
		{
			get	{	return _DocumentButtonGapRight;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentTabGapTop"]/*'/>
		protected virtual int DocumentTabGapTop
		{
			get	{	return _DocumentTabGapTop;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentTabGapLeft"]/*'/>
		protected virtual int DocumentTabGapLeft
		{
			get	{	return _DocumentTabGapLeft;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentTabGapRight"]/*'/>
		protected virtual int DocumentTabGapRight
		{
			get	{	return _DocumentTabGapRight;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentTextExtraHeight"]/*'/>
		protected int DocumentTextExtraHeight
		{
			get	{	return _DocumentTextExtraHeight;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentTextExtraWidth"]/*'/>
		protected virtual int DocumentTextExtraWidth
		{
			get	{	return _DocumentTextExtraWidth;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentIconGapLeft"]/*'/>
		protected virtual int DocumentIconGapLeft
		{
			get	{	return _DocumentIconGapLeft;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentIconWidth"]/*'/>
		protected virtual int DocumentIconWidth
		{
			get	{	return _DocumentIconWidth;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentIconHeight"]/*'/>
		protected virtual int DocumentIconHeight
		{
			get	{	return _DocumentIconHeight;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="OutlineInnerPen"]/*'/>
		protected virtual Pen OutlineInnerPen
		{
			get	{	return SystemPens.ControlDark;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="OutlineOuterPen"]/*'/>
		protected virtual Pen OutlineOuterPen
		{
			get	{	return SystemPens.ControlDark;	}
		}

		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ActiveBackBrush"]/*'/>
		protected virtual Color ActiveBackColor1
		{
            get
            {
                return SystemColors.Control;
            }
		}

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ActiveBackBrush"]/*'/>
        protected virtual Color ActiveBackColor2
        {
            get
            {
                return SystemColors.ControlLightLight;
            }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -