protected internal DockPaneCaptionFromBase(DockPane pane) : base(pane)
		{
			

			SuspendLayout();

			Font = SystemInformation.MenuFont;

			m_buttonClose = new InertButton(ImageCloseEnabled, ImageCloseDisabled);
			m_buttonAutoHide = new InertButton();

			m_buttonClose.ToolTipText = ToolTipClose;
			
			m_buttonClose.Anchor = AnchorStyles.Top | AnchorStyles.Right;
			m_buttonClose.Click += new EventHandler(this.Close_Click);

			m_buttonAutoHide.ToolTipText = ToolTipAutoHide;
			m_buttonAutoHide.Anchor = AnchorStyles.Top | AnchorStyles.Right;
			m_buttonAutoHide.Click += new EventHandler(AutoHide_Click);

			m_buttonWhatIsIt = new InertButton();
			m_buttonWhatIsIt.BackColor = ColorMixer.LightColor;
			m_buttonWhatIsIt.ForeColor = ColorMixer.DarkColor;
			m_buttonWhatIsIt.ToolTipText = "What is this?";
			m_buttonWhatIsIt.Text = "?";
			m_buttonWhatIsIt.Anchor = AnchorStyles.Top | AnchorStyles.Right;
			m_buttonWhatIsIt.Click+=new EventHandler(m_buttonWhatIsIt_Click);


			Controls.AddRange(new Control[]	{	m_buttonWhatIsIt, m_buttonClose, m_buttonAutoHide });

			ResumeLayout();
		}
Ejemplo n.º 2
0
		public void BeginDragPane(DockPane pane)
		{
			if (!InitDrag(pane, DragSource.Pane))
				return;

			Pane_BeginDrag();
		}
Ejemplo n.º 3
0
		internal int Add(DockPane pane)
		{
			if (InnerList.Contains(pane))
				return InnerList.IndexOf(pane);

			return InnerList.Add(pane);
		}
Ejemplo n.º 4
0
		internal void Add(DockPane pane, DockPane paneBefore)
		{
			if (paneBefore == null)
				Add(pane);
			else
				InnerList.Insert(IndexOf(paneBefore), pane);
		}
Ejemplo n.º 5
0
		private void InternalConstruct(DockPanel dockPanel, DockPane pane, bool boundsSpecified, Rectangle bounds)
		{
			if (dockPanel == null)
				throw(new ArgumentNullException(ResourceHelper.GetString("FloatWindow.Constructor.NullDockPanel")));

			m_dockList = new DockList(this);

			FormBorderStyle = FormBorderStyle.SizableToolWindow;
			ShowInTaskbar = false;
			
			SuspendLayout();
			if (boundsSpecified)
			{
				Bounds = bounds;
				StartPosition = FormStartPosition.Manual;
			}
			else
				StartPosition = FormStartPosition.WindowsDefaultLocation;

			m_dummyControl = new DummyControl();
			m_dummyControl.Bounds = Rectangle.Empty;
			Controls.Add(m_dummyControl);

			m_dockPanel = dockPanel;
			Owner = DockPanel.FindForm();
			DockPanel.AddFloatWindow(this);
			if (pane != null)
				pane.FloatWindow = this;

			ResumeLayout();
		}
Ejemplo n.º 6
0
		internal void AddAt(DockPane pane, int index)
		{
			if (index < 0 || index > InnerList.Count - 1)
				return;
			
			if (Contains(pane))
				return;

			InnerList.Insert(index, pane);
		}
Ejemplo n.º 7
0
		/// <include file='CodeDoc/DockPaneCaptionBase.xml' path='//CodeDoc/Class[@name="DockPaneCaptionBase"]/Construct[@name="(DockPane)"]/*'/>
		protected internal DockPaneCaptionBase(DockPane pane)
		{
			m_dockPane = pane;

			SetStyle(ControlStyles.ResizeRedraw, true);
			SetStyle(ControlStyles.UserPaint, true);
			SetStyle(ControlStyles.AllPaintingInWmPaint, true);
			SetStyle(ControlStyles.DoubleBuffer, true);
			SetStyle(ControlStyles.Selectable, false);
		}
Ejemplo n.º 8
0
		/// <include file='CodeDoc/DockPaneStripBase.xml' path='//CodeDoc/Class[@name="DockPaneStripBase"]/Construct[@name="(DockPane)"]/*'/>
		protected internal DockPaneStripBase(DockPane pane)
		{
			m_dockPane = pane;

			#if FRAMEWORK_VER_2x
			SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
			#else
			SetStyle(ControlStyles.DoubleBuffer, true);
			#endif

			SetStyle(ControlStyles.Selectable, false);
		}
Ejemplo n.º 9
0
		internal void Add(DockPane pane)
		{
			if (pane == null)
				return;

			DockList oldDockList = (pane.DockListContainer == null) ? null : pane.DockListContainer.DockList;
			if (oldDockList != null)
				oldDockList.InternalRemove(pane);
			InnerList.Add(pane);
			if (oldDockList != null)
				oldDockList.CheckFloatWindowDispose();
		}
Ejemplo n.º 10
0
		public bool ContainsPane(DockPane pane)
		{
			if (pane.IsHidden)
				return false;

			for (int i=0; i<m_states.Length; i++)
			{
				if (m_states[i].DockState == pane.DockState && m_states[i].Selected)
					return true;
			}
			return false;
		}
Ejemplo n.º 11
0
		private void SetActivePane()
		{
			DockPane value = (ActiveContent == null ? null : ActiveContent.DockHandler.Pane);

			if (value == m_activePane)
				return;

			if (m_activePane != null)
				if (m_activePane.IsActivated)
					DockPanel.Focus();

			m_activePane = value;
		}
Ejemplo n.º 12
0
		/// <include file='CodeDoc/DockPaneCaptionBase.xml' path='//CodeDoc/Class[@name="DockPaneCaptionBase"]/Construct[@name="(DockPane)"]/*'/>
		protected internal DockPaneCaptionBase(DockPane pane)
		{
			m_dockPane = pane;

			#if FRAMEWORK_VER_2x
			SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
			#else
			SetStyle(ControlStyles.DoubleBuffer, true);
			#endif
			SetStyle(ControlStyles.ResizeRedraw, true);
			SetStyle(ControlStyles.UserPaint, true);
			SetStyle(ControlStyles.AllPaintingInWmPaint, true);
			SetStyle(ControlStyles.Selectable, false);
		}
		/// <include file='CodeDoc/DockPaneCaptionVS2003.xml' path='//CodeDoc/Class[@name="DockPaneCaptionVS2003"]/Construct[@name="(DockPane)"]/*'/>
		protected internal DockPaneCaptionVS2003(DockPane pane) : base(pane)
		{
			SuspendLayout();

			Font = SystemInformation.MenuFont;

			m_buttonClose = new InertButton(ImageCloseEnabled, ImageCloseDisabled);
			m_buttonAutoHide = new InertButton();

			m_buttonClose.ToolTipText = ToolTipClose;
			m_buttonClose.Anchor = AnchorStyles.Top | AnchorStyles.Right;
			m_buttonClose.Click += new EventHandler(this.Close_Click);

			m_buttonAutoHide.ToolTipText = ToolTipAutoHide;
			m_buttonAutoHide.Anchor = AnchorStyles.Top | AnchorStyles.Right;
			m_buttonAutoHide.Click += new EventHandler(AutoHide_Click);

			Controls.AddRange(new Control[]	{	m_buttonClose, m_buttonAutoHide });

			ResumeLayout();
		}
        protected internal DockPaneCaptionFromBase(DockPane pane)
            : base(pane)
        {
            SuspendLayout();
            Font = SystemInformation.MenuFont;

            m_buttonClose = new PopupButton(ImageCloseEnabled, ImageCloseDisabled);
            m_buttonClose.ActiveBackColorGradientBegin = Color.FromArgb(59, 128, 237);
            m_buttonClose.ActiveBackColorGradientEnd = Color.FromArgb(49, 106, 197);
            m_buttonClose.InactiveBackColorGradientBegin = Color.FromArgb(204, 199, 186);
            m_buttonClose.InactiveBackColorGradientEnd = Color.FromArgb(204, 199, 186);

            m_buttonAutoHide = new PopupButton();
            m_buttonAutoHide.ActiveBackColorGradientBegin = Color.FromArgb(59, 128, 237);
            m_buttonAutoHide.ActiveBackColorGradientEnd = Color.FromArgb(49, 106, 197);
            m_buttonAutoHide.InactiveBackColorGradientBegin = Color.FromArgb(204, 199, 186);
            m_buttonAutoHide.InactiveBackColorGradientEnd = Color.FromArgb(204, 199, 186);

            m_buttonOptions = new PopupButton(ImageOptionsEnabled, ImageOptionsDisabled);
            m_buttonOptions.ActiveBackColorGradientBegin = Color.FromArgb(59, 128, 237);
            m_buttonOptions.ActiveBackColorGradientEnd = Color.FromArgb(49, 106, 197);
            m_buttonOptions.InactiveBackColorGradientBegin = Color.FromArgb(204, 199, 186);
            m_buttonOptions.InactiveBackColorGradientEnd = Color.FromArgb(204, 199, 186);

            m_buttonClose.ToolTipText = ToolTipClose;
            m_buttonClose.Anchor = AnchorStyles.Top | AnchorStyles.Right;
            m_buttonClose.Click += new System.EventHandler(Close_Click);

            m_buttonAutoHide.ToolTipText = ToolTipAutoHide;
            m_buttonAutoHide.Anchor = AnchorStyles.Top | AnchorStyles.Right;
            m_buttonAutoHide.Click += new System.EventHandler(AutoHide_Click);

            m_buttonOptions.ToolTipText = ToolTipOptions;
            m_buttonOptions.Anchor = AnchorStyles.Top | AnchorStyles.Right;
            m_buttonOptions.Click += new System.EventHandler(Options_Click);

            Controls.AddRange(new Control[] {m_buttonClose, m_buttonAutoHide, m_buttonOptions});
            ResumeLayout();
        }
 protected virtual void OnEndDrawTabStrip(DockPane.AppearanceStyle appearance)
 {
 }
Ejemplo n.º 16
0
 internal DockContentCollection(DockPane pane)
 {
     m_dockPane = pane;
 }
Ejemplo n.º 17
0
 private void RefreshDockPane(DockPane pane)
 {
     pane.RefreshChanges();
     pane.ValidateActiveContent();
 }
Ejemplo n.º 18
0
		private void InternalAddToDockList(IDockListContainer container, DockPane prevPane, DockAlignment alignment, double proportion)
		{
			if ((container.DockState == DockState.Float) != IsFloat)
				throw new InvalidOperationException(ResourceHelper.GetString("DockPane.AddToDockList.InvalidContainer"));

			int count = container.DockList.Count;
			if (container.DockList.Contains(this))
				count --;
			if (prevPane == null && count > 0)
				throw new InvalidOperationException(ResourceHelper.GetString("DockPane.AddToDockList.NullPrevPane"));

			if (prevPane != null && !container.DockList.Contains(prevPane))
				throw new InvalidOperationException(ResourceHelper.GetString("DockPane.AddToDockList.NoPrevPane"));

			if (prevPane == this)
				throw new InvalidOperationException(ResourceHelper.GetString("DockPane.AddToDockList.SelfPrevPane"));

			IDockListContainer oldContainer = DockListContainer;
			DockState oldDockState = DockState;
			container.DockList.Add(this);
			NestedDockingStatus.SetStatus(container.DockList, prevPane, alignment, proportion);

			if (DockHelper.IsDockWindowState(DockState))
				m_dockState = container.DockState;

			RefreshStateChange(oldContainer, oldDockState);
		}
Ejemplo n.º 19
0
		private void SetVisibleContentsToPane(DockPane pane)
		{
			SetVisibleContentsToPane(pane, ActiveContent);
		}
Ejemplo n.º 20
0
 internal void Remove(DockPane pane)
 {
     InternalRemove(pane);
     CheckFloatWindowDispose();
 }
Ejemplo n.º 21
0
		/// <include file='CodeDoc/AutoHidePane.xml' path='//CodeDoc/Class[@name="AutoHidePane"]/Construct[@name="(DockPane)"]/*'/>
		public AutoHidePane(DockPane pane)
		{
			m_dockPane = pane;
			m_tabs = new AutoHideTabCollection(DockPane);
		}
Ejemplo n.º 22
0
		internal void SetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
		{
			if (IsSuspendSetDockState)
				return;

			if (DockPanel == null && visibleState != DockState.Unknown)
				throw new InvalidOperationException(ResourceHelper.GetString("IDockContent.SetDockState.NullPanel"));

			if (visibleState == DockState.Hidden || (visibleState != DockState.Unknown && !IsDockStateValid(visibleState)))
				throw new InvalidOperationException(ResourceHelper.GetString("IDockContent.SetDockState.InvalidState"));

			SuspendSetDockState();

			DockState oldDockState = DockState;

			if (m_isHidden != isHidden || oldDockState == DockState.Unknown)
			{
				m_isHidden = isHidden;
			}
			m_visibleState = visibleState;
			m_dockState = isHidden ? DockState.Hidden : visibleState;

			if (visibleState == DockState.Unknown)
				Pane = null;
			else
			{
				m_isFloat = (m_visibleState == DockState.Float);

				if (Pane == null)
					Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, visibleState, true);
				else if (Pane.DockState != visibleState)
				{
					if (Pane.Contents.Count == 1)
						Pane.SetDockState(visibleState);
					else
						Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, visibleState, true);
				}
			}

			SetPane(Pane);
			SetVisible();

			if (oldPane != null && !oldPane.IsDisposed && oldDockState == oldPane.DockState)
				RefreshDockPane(oldPane);

			if (Pane != null && DockState == Pane.DockState)
			{
				if ((Pane != oldPane) ||
					(Pane == oldPane && oldDockState != oldPane.DockState))
					RefreshDockPane(Pane);
			}

			if (oldDockState != DockState)
				OnDockStateChanged(EventArgs.Empty);

			ResumeSetDockState();
		}
Ejemplo n.º 23
0
 private void ResumeSetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
 {
     ResumeSetDockState();
     SetDockState(isHidden, visibleState, oldPane);
 }
Ejemplo n.º 24
0
 internal void Remove(DockPane pane)
 {
     InnerList.Remove(pane);
 }
Ejemplo n.º 25
0
 internal void AddAt(DockPane pane, DockPane paneBefore)
 {
     AddAt(pane, IndexOf(paneBefore));
 }
Ejemplo n.º 26
0
 /// <include file='CodeDoc\DockList.xml' path='//CodeDoc/Class[@name="DockList"]/Method[@name="IndexOf(DockPane)"]/*'/>
 public int IndexOf(DockPane pane)
 {
     return(InnerList.IndexOf(pane));
 }
Ejemplo n.º 27
0
 /// <include file='CodeDoc\DockList.xml' path='//CodeDoc/Class[@name="DockList"]/Method[@name="Contains(DockPane)"]/*'/>
 public bool Contains(DockPane pane)
 {
     return(InnerList.Contains(pane));
 }
        protected internal DockPaneStripFromBase(DockPane pane)
            : base(pane)
        {
            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.SupportsTransparentBackColor, true);

            SuspendLayout();
            Font = SystemInformation.MenuFont;
            BackColor = Color.FromArgb(228, 226, 213);

            m_components = new Container();
            m_toolTip = new ToolTip(Components);

            m_buttonClose = new PopupButton(ImageCloseEnabled, ImageCloseDisabled);
            m_buttonClose.IsActivated = true;
            m_buttonClose.ActiveBackColorGradientBegin = Color.FromArgb(228, 226, 213);
            m_buttonClose.ActiveBackColorGradientEnd = Color.FromArgb(228, 226, 213);
            m_buttonClose.ToolTipText = ToolTipClose;
            m_buttonClose.Anchor = AnchorStyles.Top | AnchorStyles.Right;

            m_buttonOptions = new PopupButton(ImageOptionsEnabled, ImageOptionsDisabled);
            m_buttonOptions.IsActivated = true;
            m_buttonOptions.ActiveBackColorGradientBegin = Color.FromArgb(228, 226, 213);
            m_buttonOptions.ActiveBackColorGradientEnd = Color.FromArgb(228, 226, 213);
            m_buttonOptions.ToolTipText = ToolTipOptions;
            m_buttonOptions.Anchor = AnchorStyles.Top | AnchorStyles.Right;

            m_buttonClose.Click += new System.EventHandler(Close_Click);
            m_buttonOptions.Click += new System.EventHandler(Options_Click);
            Controls.AddRange(new Control[] { m_buttonClose, m_buttonOptions });
            ResumeLayout();
        }
Ejemplo n.º 29
0
		internal void SetPane(DockPane pane)
		{
			if (pane != null && pane.DockState == DockState.Document && DockPanel.DocumentStyle == DocumentStyles.DockingMdi)
			{
				if (Form.Parent is DockPane)
					SetParent(null);
				if (Form.MdiParent != DockPanel.ParentForm)
				{
					FlagClipWindow = true;
					Form.MdiParent = DockPanel.ParentForm;
				}
			}
			else
			{
				FlagClipWindow = true;
				if (Form.MdiParent != null)
					Form.MdiParent = null;
				if (Form.TopLevel)
					Form.TopLevel = false;
				SetParent(pane);
			}
		}
Ejemplo n.º 30
0
		/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Method[@name="Show(DockPane, DockAlignment, double)"]/*'/>
		public void Show(DockPane prevPane, DockAlignment alignment, double proportion)
		{
			if (prevPane == null)
				throw(new ArgumentException(ResourceHelper.GetString("IDockContent.Show.InvalidPrevPane")));

			if (DockHelper.IsDockStateAutoHide(prevPane.DockState))
				throw(new ArgumentException(ResourceHelper.GetString("IDockContent.Show.InvalidPrevPane")));

			DockPanel = prevPane.DockPanel;
			DockPanel.DockPaneFactory.CreateDockPane(Content, prevPane, alignment, proportion, true);
			Show();
		}
Ejemplo n.º 31
0
		private void ResumeSetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
		{
			ResumeSetDockState();
			SetDockState(isHidden, visibleState, oldPane);
		}
 public DockPaneSplitter(DockPane pane)
 {
     SetStyle(ControlStyles.Selectable, false);
     m_pane = pane;
 }
Ejemplo n.º 33
0
		private void RefreshDockPane(DockPane pane)
		{
			pane.RefreshChanges();
			pane.ValidateActiveContent();
		}
Ejemplo n.º 34
0
		private void InternalConstruct(IDockContent content, DockState dockState, bool flagBounds, Rectangle floatWindowBounds, DockPane prevPane, DockAlignment alignment, double proportion, bool show)
		{
			if (dockState == DockState.Hidden || dockState == DockState.Unknown)
				throw new ArgumentException(ResourceHelper.GetString("DockPane.DockState.InvalidState"));

			if (content == null)
				throw new ArgumentNullException(ResourceHelper.GetString("DockPane.Constructor.NullContent"));

			if (content.DockHandler.DockPanel == null)
				throw new ArgumentException(ResourceHelper.GetString("DockPane.Constructor.NullDockPanel"));


			SuspendLayout();
			SetStyle(ControlStyles.Selectable, false);

			m_isFloat = (dockState == DockState.Float);

			m_contents = new DockContentCollection();
			m_displayingContents = new DockContentCollection(this);
			m_tabs = new DockPaneTabCollection(this);
			m_dockPanel = content.DockHandler.DockPanel;
			m_dockPanel.AddPane(this);

			m_splitter = new DockPaneSplitter(this);

			m_nestedDockingStatus = new NestedDockingStatus(this);

			m_autoHidePane = DockPanel.AutoHidePaneFactory.CreateAutoHidePane(this);
			m_captionControl = DockPanel.DockPaneCaptionFactory.CreateDockPaneCaption(this);
			m_tabStripControl = DockPanel.DockPaneStripFactory.CreateDockPaneStrip(this);
			Controls.AddRange(new Control[] {	m_captionControl, m_tabStripControl	});
			
			DockPanel.SuspendLayout(true);
			if (flagBounds)
				FloatWindow = DockPanel.FloatWindowFactory.CreateFloatWindow(DockPanel, this, floatWindowBounds);
			else if (prevPane != null)
				AddToDockList(prevPane.DockListContainer, prevPane, alignment, proportion);

			SetDockState(dockState);
			if (show)
				content.DockHandler.Pane = this;
			else if (this.IsFloat)
				content.DockHandler.FloatPane = this;
			else
				content.DockHandler.PanelPane = this;

			ResumeLayout();
			DockPanel.ResumeLayout(true, true);
		}
Ejemplo n.º 35
0
		/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Method[@name="Show(DockPane, IDockContent)"]/*'/>
		public void Show(DockPane pane, IDockContent beforeContent)
		{
			if (pane == null)
				throw(new ArgumentNullException(ResourceHelper.GetString("IDockContent.Show.NullPane")));

			if (beforeContent != null && pane.Contents.IndexOf(beforeContent) == -1)
				throw(new ArgumentException(ResourceHelper.GetString("IDockContent.Show.InvalidBeforeContent")));

			DockPanel = pane.DockPanel;
			Pane = pane;
			pane.SetContentIndex(Content, pane.Contents.IndexOf(beforeContent));
			Show();
		}
Ejemplo n.º 36
0
        /// <exclude/>
        protected override void WndProc(ref Message m)
        {
            if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDOWN)
            {
                int index = GetHitTest();
                if (index != -1)
                {
                    IDockContent content = Tabs[index].Content;
                    if (DockPane.ActiveContent != content)
                    {
                        DockPane.ActiveContent = content;
                        DockPane.Activate();
                        Update();
                    }
                    if (DockPane.DockPanel.AllowRedocking && DockPane.AllowRedocking && DockPane.ActiveContent.DockHandler.AllowRedocking)
                    {
                        DockPane.DockPanel.DragHandler.BeginDragContent(DockPane.ActiveContent);
                    }
                }
                else
                {
                    base.WndProc(ref m);
                }
                return;
            }
            else if (m.Msg == (int)Win32.Msgs.WM_RBUTTONDOWN)
            {
                int index = GetHitTest();
                if (index != -1)
                {
                    IDockContent content = Tabs[index].Content;
                    if (DockPane.ActiveContent != content)
                    {
                        DockPane.ActiveContent = content;
                    }
                }
                base.WndProc(ref m);
                return;
            }
            else if (m.Msg == (int)Win32.Msgs.WM_RBUTTONUP)
            {
                int index = GetHitTest();
                if (index != -1)
                {
                    IDockContent content = Tabs[index].Content;
#if FRAMEWORK_VER_2x
                    if (content.DockHandler.TabPageContextMenuStrip != null)
                    {
                        content.DockHandler.TabPageContextMenuStrip.Show(this, this.PointToClient(Control.MousePosition));
                    }
                    else if (content.DockHandler.TabPageContextMenu != null)
                    {
                        content.DockHandler.TabPageContextMenu.Show(this, this.PointToClient(Control.MousePosition));
                    }
#else
                    if (content.DockHandler.TabPageContextMenu != null)
                    {
                        content.DockHandler.TabPageContextMenu.Show(this, this.PointToClient(Control.MousePosition));
                    }
#endif
                }
                base.WndProc(ref m);
                return;
            }
            else if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDBLCLK)
            {
                base.WndProc(ref m);

                int index = GetHitTest();
                if (DockPane.DockPanel.AllowRedocking && index != -1)
                {
                    IDockContent content = Tabs[index].Content;
                    try { content.DockHandler.IsFloat = !content.DockHandler.IsFloat; }
                    catch { }
                }

                return;
            }

            base.WndProc(ref m);
            return;
        }
Ejemplo n.º 37
0
		/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Method[@name="AddToDockList(IDockListContainer, DockPane, DockAlignment, double)"]/*'/>
		public DockPane AddToDockList(IDockListContainer container, DockPane prevPane, DockAlignment alignment, double proportion)
		{
			if (container == null)
				throw new InvalidOperationException(ResourceHelper.GetString("DockPane.AddToDockList.NullContainer"));

			if (container.IsFloat == this.IsFloat)
			{
				InternalAddToDockList(container, prevPane, alignment, proportion);
				return this;
			}

			IDockContent firstContent = GetFirstContent(container.DockState);
			if (firstContent == null)
				return null;

			DockPane pane;
			DockPanel.DummyContent.DockPanel = DockPanel;
			if (container.IsFloat)
				pane = DockPanel.DockPaneFactory.CreateDockPane(DockPanel.DummyContent, (FloatWindow)container, true);
			else
				pane = DockPanel.DockPaneFactory.CreateDockPane(DockPanel.DummyContent, container.DockState, true);

			pane.AddToDockList(container, prevPane, alignment, proportion);
			SetVisibleContentsToPane(pane);
			DockPanel.DummyContent.DockPanel = null;

			return pane;
		}
 internal AutoHideTabCollection(DockPane pane)
 {
     m_dockPane  = pane;
     m_dockPanel = pane.DockPanel;
 }
Ejemplo n.º 39
0
		private void SetVisibleContentsToPane(DockPane pane, IDockContent activeContent)
		{
			for (int i=0; i<DisplayingContents.Count; i++)
			{
				IDockContent content = DisplayingContents[i];
				if (content.DockHandler.IsDockStateValid(pane.DockState))
				{
					content.DockHandler.Pane = pane;
					i--;
				}
			}

			if (activeContent != null && pane.DisplayingContents.Contains(activeContent))
				pane.ActiveContent = activeContent;
		}
Ejemplo n.º 40
0
 private void Close_Click(object sender, EventArgs e)
 {
     DockPane.CloseActiveContent();
 }
Ejemplo n.º 41
0
		/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(IDockContent, DockPane, DockAlignment, double, bool)"]/*'/>
		public DockPane(IDockContent content, DockPane prevPane, DockAlignment alignment, double proportion, bool show)
		{
			if (prevPane == null)
				throw(new ArgumentNullException());
			InternalConstruct(content, prevPane.DockState, false, Rectangle.Empty, prevPane, alignment, proportion, show);
		}
Ejemplo n.º 42
0
        internal void SetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
        {
            if (IsSuspendSetDockState)
            {
                return;
            }

            if (DockPanel == null && visibleState != DockState.Unknown)
            {
                throw new InvalidOperationException(ResourceHelper.GetString("IDockContent.SetDockState.NullPanel"));
            }

            if (visibleState == DockState.Hidden || (visibleState != DockState.Unknown && !IsDockStateValid(visibleState)))
            {
                throw new InvalidOperationException(ResourceHelper.GetString("IDockContent.SetDockState.InvalidState"));
            }

            SuspendSetDockState();

            DockState oldDockState = DockState;

            if (m_isHidden != isHidden || oldDockState == DockState.Unknown)
            {
                m_isHidden = isHidden;
            }
            m_visibleState = visibleState;
            m_dockState    = isHidden ? DockState.Hidden : visibleState;

            if (visibleState == DockState.Unknown)
            {
                Pane = null;
            }
            else
            {
                m_isFloat = (m_visibleState == DockState.Float);

                if (Pane == null)
                {
                    Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, visibleState, true);
                }
                else if (Pane.DockState != visibleState)
                {
                    if (Pane.Contents.Count == 1)
                    {
                        Pane.SetDockState(visibleState);
                    }
                    else
                    {
                        Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, visibleState, true);
                    }
                }
            }

            SetPane(Pane);
            SetVisible();

            if (oldPane != null && !oldPane.IsDisposed && oldDockState == oldPane.DockState)
            {
                RefreshDockPane(oldPane);
            }

            if (Pane != null && DockState == Pane.DockState)
            {
                if ((Pane != oldPane) ||
                    (Pane == oldPane && oldDockState != oldPane.DockState))
                {
                    RefreshDockPane(Pane);
                }
            }

            if (oldDockState != DockState)
            {
                OnDockStateChanged(EventArgs.Empty);
            }

            ResumeSetDockState();
        }
Ejemplo n.º 43
0
		/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Construct[@name="(DockPane)"]/*'/>
		protected internal DockPaneStripVS2003(DockPane pane) : base(pane)
		{
			SetStyle(ControlStyles.ResizeRedraw, true);
			SetStyle(ControlStyles.UserPaint, true);
			SetStyle(ControlStyles.AllPaintingInWmPaint, true);
			SetStyle(ControlStyles.DoubleBuffer, true);

			SuspendLayout();

			Font = SystemInformation.MenuFont;
			BackColor = Color.WhiteSmoke;
			
			m_components = new Container();
			m_toolTip = new ToolTip(Components);

			m_buttonClose = new InertButton(ImageCloseEnabled, ImageCloseDisabled);
			m_buttonScrollLeft = new InertButton(ImageScrollLeftEnabled, ImageScrollLeftDisabled);
			m_buttonScrollRight = new InertButton(ImageScrollRightEnabled, ImageScrollRightDisabled);

			m_buttonClose.ToolTipText = ToolTipClose;
			m_buttonClose.Anchor = AnchorStyles.Top | AnchorStyles.Right;
			m_buttonClose.Click += new EventHandler(Close_Click);

			m_buttonScrollLeft.Enabled = false;
			m_buttonScrollLeft.ToolTipText = ToolTipScrollLeft;
			m_buttonScrollLeft.Anchor = AnchorStyles.Top | AnchorStyles.Right;
			m_buttonScrollLeft.Click += new EventHandler(ScrollLeft_Click);

			m_buttonScrollRight.Enabled = false;
			m_buttonScrollRight.ToolTipText = ToolTipScrollRight;
			m_buttonScrollRight.Anchor = AnchorStyles.Top | AnchorStyles.Right;
			m_buttonScrollRight.Click += new EventHandler(ScrollRight_Click);

			Controls.AddRange(new Control[] {	m_buttonClose,
												m_buttonScrollLeft,
												m_buttonScrollRight	});

			ResumeLayout();
		}
Ejemplo n.º 44
0
        private void RefreshChanges()
        {
            Region    region       = new Region(Rectangle.Empty);
            Rectangle rectDockArea = FullPanelEdge ? DockPanel.DockArea : DockPanel.DocumentWindowBounds;

            rectDockArea.Location = DockPanel.PointToScreen(rectDockArea.Location);
            if (ShouldPanelIndicatorVisible(DockState.DockLeft))
            {
                PanelLeft.Location = new Point(rectDockArea.X + _PanelIndicatorMargin, rectDockArea.Y + (rectDockArea.Height - PanelRight.Height) / 2);
                PanelLeft.Visible  = true;
                region.Union(PanelLeft.Bounds);
            }
            else
            {
                PanelLeft.Visible = false;
            }

            if (ShouldPanelIndicatorVisible(DockState.DockRight))
            {
                PanelRight.Location = new Point(rectDockArea.X + rectDockArea.Width - PanelRight.Width - _PanelIndicatorMargin, rectDockArea.Y + (rectDockArea.Height - PanelRight.Height) / 2);
                PanelRight.Visible  = true;
                region.Union(PanelRight.Bounds);
            }
            else
            {
                PanelRight.Visible = false;
            }

            if (ShouldPanelIndicatorVisible(DockState.DockTop))
            {
                PanelTop.Location = new Point(rectDockArea.X + (rectDockArea.Width - PanelTop.Width) / 2, rectDockArea.Y + _PanelIndicatorMargin);
                PanelTop.Visible  = true;
                region.Union(PanelTop.Bounds);
            }
            else
            {
                PanelTop.Visible = false;
            }

            if (ShouldPanelIndicatorVisible(DockState.DockBottom))
            {
                PanelBottom.Location = new Point(rectDockArea.X + (rectDockArea.Width - PanelBottom.Width) / 2, rectDockArea.Y + rectDockArea.Height - PanelBottom.Height - _PanelIndicatorMargin);
                PanelBottom.Visible  = true;
                region.Union(PanelBottom.Bounds);
            }
            else
            {
                PanelBottom.Visible = false;
            }

            if (ShouldPanelIndicatorVisible(DockState.Document))
            {
                Rectangle rectDocumentWindow = DockPanel.DocumentWindowBounds;
                rectDocumentWindow.Location = DockPanel.PointToScreen(rectDocumentWindow.Location);
                PanelFill.Location          = new Point(rectDocumentWindow.X + (rectDocumentWindow.Width - PanelFill.Width) / 2, rectDocumentWindow.Y + (rectDocumentWindow.Height - PanelFill.Height) / 2);
                PanelFill.Visible           = true;
                region.Union(PanelFill.Bounds);
            }
            else
            {
                PanelFill.Visible = false;
            }

            if (ShouldPaneDiamondVisible())
            {
                Rectangle rect = DockPane.ClientRectangle;
                rect.Location        = DockPane.PointToScreen(rect.Location);
                PaneDiamond.Location = new Point(rect.Left + (rect.Width - PaneDiamond.Width) / 2, rect.Top + (rect.Height - PaneDiamond.Height) / 2);
                PaneDiamond.Visible  = true;
                using (GraphicsPath graphicsPath = PaneDiamond.DisplayingGraphicsPath.Clone() as GraphicsPath)
                {
                    Point[] pts = new Point[]
                    {
                        new Point(PaneDiamond.Left, PaneDiamond.Top),
                        new Point(PaneDiamond.Right, PaneDiamond.Top),
                        new Point(PaneDiamond.Left, PaneDiamond.Bottom)
                    };
                    using (Matrix matrix = new Matrix(PaneDiamond.ClientRectangle, pts))
                    {
                        graphicsPath.Transform(matrix);
                    }
                    region.Union(graphicsPath);
                }
            }
            else
            {
                PaneDiamond.Visible = false;
            }

            Region = region;
        }