Inheritance: System.Windows.Forms.UserControl, IDockDragSource
 public CustomFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds)
     : base(dockPanel, pane, bounds)
 {
     FormBorderStyle = FormBorderStyle.Sizable;
     ShowInTaskbar = true;
     Owner = null;
 }
        public void InitWindows( DockPane navigatorPane, DockPane outputPane )
        {
            availableTestStations = new AvailableTestStationsWindow();
            availableTestStations.Show(DockPanel, DockState.DockRight);
            availableTestStations.Hide();

            //availableTestAdapters = new AvailableTestAdaptersWindow();
            //availableTestAdapters.Show(navigatorPane, DockAlignment.Bottom, .60);
            //availableTestAdapters.Hide();

            availableInstruments = new AvailableInstrumentsWindow();
            availableInstruments.Show(navigatorPane, DockAlignment.Bottom, .50);
            availableInstruments.Hide();

            requiredSignals = new RequiredSignalsWindow();
            requiredSignals.Show(outputPane, DockAlignment.Right, .50 );
            requiredSignals.Hide();
            requiredSignals.SignalRequirementSelected += new ATMLManagerLibrary.delegates.ItemSelectionDeligate<ATMLModelLibrary.model.SignalRequirementsSignalRequirement>(requiredSignals_SignalRequirementSelected);

            requiredInstruments = new RequiredInstrumentsWindow();
            requiredInstruments.Show( requiredSignals.Pane, DockAlignment.Bottom, 0 );
            requiredInstruments.DockTo(requiredSignals.Pane, DockStyle.Fill, 0 );
            requiredInstruments.Hide();

            requiredAdapters = new RequiredAdaptersWindow();
            requiredAdapters.Show(requiredSignals.Pane, DockAlignment.Bottom, 0);
            requiredAdapters.DockTo(requiredSignals.Pane, DockStyle.Fill, 0);
            requiredAdapters.Hide();
        }
        public VS2005MultithreadingDockPaneCaption(DockPane pane)
            : base(pane)
        {
            SuspendLayout();

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

            // clone shared resources
            lock (typeof(Resources))
            {
                _imageButtonAutoHide = (Bitmap)Resources.DockPane_AutoHide.Clone();
                _imageButtonClose = (Bitmap)Resources.DockPane_Close.Clone();
                _imageButtonDock = (Bitmap)Resources.DockPane_Dock.Clone();
                _imageButtonOptions = (Bitmap)Resources.DockPane_Option.Clone();
            }

            // create background blend
            _activeBackColorGradientBlend = new Blend(2)
            {
                Factors = new float[] { 0.5F, 1.0F },
                Positions = new float[] { 0.0F, 1.0F },
            };

            ResumeLayout();
        }
        public VS2005MultithreadingDockPaneStrip(DockPane pane)
            : base(pane)
        {
            SetStyle(ControlStyles.ResizeRedraw |
                ControlStyles.UserPaint |
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.OptimizedDoubleBuffer, true);

            SuspendLayout();

            m_components = new Container();
            m_toolTip = new ToolTip(Components);
            m_selectMenu = new ContextMenuStrip(Components);
            m_graphicsPath = new GraphicsPath();

            // clone shared resources
            lock (typeof(Resources))
            {
                m_imageButtonClose = (Bitmap)Resources.DockPane_Close.Clone();
                m_imageButtonWindowList = (Bitmap)Resources.DockPane_Option.Clone();
                m_imageButtonWindowListOverflow = (Bitmap)Resources.DockPane_OptionOverflow.Clone();
            }

            ResumeLayout();
        }
		private void InternalConstruct(DockPanel dockPanel, DockPane pane, bool boundsSpecified, Rectangle bounds)
		{
			if (dockPanel == null)
				throw(new ArgumentNullException(Strings.FloatWindow_Constructor_NullDockPanel));

			m_nestedPanes = new NestedPaneCollection(this);

			FormBorderStyle = FormBorderStyle.SizableToolWindow;
			ShowInTaskbar = false;
            if (dockPanel.RightToLeft != RightToLeft)
                RightToLeft = dockPanel.RightToLeft;
            if (RightToLeftLayout != dockPanel.RightToLeftLayout)
                RightToLeftLayout = dockPanel.RightToLeftLayout;
			
			SuspendLayout();
            if (boundsSpecified)
            {
                Bounds = bounds;
                StartPosition = FormStartPosition.Manual;
            }
            else
            {
                StartPosition = FormStartPosition.WindowsDefaultLocation;
                Size = dockPanel.DefaultFloatWindowSize;
            }

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

			ResumeLayout();
		}
        public VS2005DockPaneCaption(DockPane pane) : base(pane)
        {
            SuspendLayout();

            Font = PluginCore.PluginBase.Settings.DefaultFont;
            m_components = new Container();
            m_toolTip = new ToolTip(Components);

            // Adjust size based on scale
            double scale = ScaleHelper.GetScale();
            if (scale >= 2) // 200%
            {
                _TextGapTop = 3;
                _TextGapBottom = 6;
                _ButtonGapBottom = 4;
            }
            else if (scale >= 1.5) // 150%
            {
                _TextGapTop = 2;
                _TextGapBottom = 4;
                _ButtonGapBottom = 4;
            }
            else if (scale >= 1.2) // 120%
            {
                _TextGapTop = 2;
                _TextGapBottom = 2;
            }
            // Else 100%

            ResumeLayout();
        }
 internal void SetStatus(NestedPaneCollection nestedPanes, DockPane previousPane, DockAlignment alignment, double proportion)
 {
     m_nestedPanes = nestedPanes;
     m_previousPane = previousPane;
     m_alignment = alignment;
     m_proportion = proportion;
 }
        public void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex)
        {
            if (dockStyle == DockStyle.Fill)
            {
                for (int i = NestedPanes.Count - 1; i >= 0; i--)
                {
                    DockPane paneFrom = NestedPanes[i];
                    for (int j = paneFrom.Contents.Count - 1; j >= 0; j--)
                    {
                        IDockContent c = paneFrom.Contents[j];
                        c.DockHandler.Pane = pane;
                        if (contentIndex != -1)
                            pane.SetContentIndex(c, contentIndex);
                        c.DockHandler.Activate();
                    }
                }
            }
            else
            {
                DockAlignment alignment = DockAlignment.Left;
                if (dockStyle == DockStyle.Left)
                    alignment = DockAlignment.Left;
                else if (dockStyle == DockStyle.Right)
                    alignment = DockAlignment.Right;
                else if (dockStyle == DockStyle.Top)
                    alignment = DockAlignment.Top;
                else if (dockStyle == DockStyle.Bottom)
                    alignment = DockAlignment.Bottom;

                MergeNestedPanes(VisibleNestedPanes, pane.NestedPanesContainer.NestedPanes, pane, alignment, 0.5);
            }
        }
Beispiel #9
0
 protected internal DockPane(IDockContent content, DockPane previousPane, DockAlignment alignment,
     double proportion, bool show)
 {
     if (previousPane == null)
         throw (new ArgumentNullException("previousPane"));
     InternalConstruct(content, previousPane.DockState, false, Rectangle.Empty, previousPane, alignment,
         proportion, show);
 }
 public VS2005DockPaneCaption(DockPane pane)
     : base(pane)
 {
     this.SuspendLayout();
     this.m_components = new Container();
     this.m_toolTip = new ToolTip(this.Components);
     this.ResumeLayout();
 }
 protected internal DockPaneCaptionBase(DockPane pane)
 {
     this.m_dockPane = pane;
     this.SetStyle(
             ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint
             | ControlStyles.AllPaintingInWmPaint, true);
     this.SetStyle(ControlStyles.Selectable, false);
 }
            private void SetActivePane()
            {
                DockPane value = (ActiveContent == null ? null : ActiveContent.DockHandler.Pane);

                if (value == m_activePane)
                    return;

                m_activePane = value;
            }
        public VS2012DockPaneCaption(DockPane pane)
            : base(pane)
        {
            SuspendLayout();

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

            ResumeLayout();
        }
 public VS2012LightSplitterControl(DockPane pane)
     : base(pane)
 {
     _horizontalBrush = new SolidBrush(pane.DockPanel.Skin.DockPaneStripSkin.DocumentGradient.ActiveTabGradient.EndColor);
     this._verticalSurroundColors = new[]
                                        {
                                            pane.DockPanel.Skin.DockPaneStripSkin.DocumentGradient
                                                .InactiveTabGradient.StartColor
                                        };
 }
 public VS2012SplitterControl(DockPane pane)
     : base(pane)
 {
     _horizontalBrush = pane.DockPanel.Theme.PaintingService.GetBrush(pane.DockPanel.Skin.ColorPalette.TabSelectedInactive.Background);
     _backgroundBrush = pane.DockPanel.Theme.PaintingService.GetBrush(pane.DockPanel.Skin.ColorPalette.MainWindowActive.Background);
     this._verticalSurroundColors = new[]
                                        {
                                            pane.DockPanel.Skin.ColorPalette.TabSelectedInactive.Background
                                        };
 }
        public VS2005DockPaneCaption(DockPane pane)
            : base(pane)
        {
            SuspendLayout();

            Font = PluginCore.PluginBase.Settings.DefaultFont;
            m_components = new Container();
            m_toolTip = new ToolTip(Components);

            ResumeLayout();
        }
        public VS2005DockPaneCaption(DockPane pane)
            : base(pane)
        {
            SuspendLayout();

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

            ResumeLayout();
        }
        public void ShowDock(DockPane pane, DockAlignment align, double proportion)
        {
            FormClosed += new FormClosedEventHandler(dock_FormClosed);
            
            if (m_Docks.Count > 0)
                Show(m_Docks[0].Pane, m_Docks[0]);
            else
                Show(pane, align, proportion);

            m_Docks.Add(this);
        }
 public VS2005DockPaneStrip(DockPane pane)
     : base(pane)
 {
     this.SetStyle(
             ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint
             | ControlStyles.OptimizedDoubleBuffer, true);
     this.SuspendLayout();
     this.m_components = new Container();
     this.m_toolTip = new ToolTip(this.Components);
     this.m_selectMenu = new ContextMenuStrip(this.Components);
     this.ResumeLayout();
 }
Beispiel #20
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(Strings.DockPane_SetDockState_InvalidState);

			if (content == null)
				throw new ArgumentNullException(Strings.DockPane_Constructor_NullContent);

			if (content.DockHandler.DockPanel == null)
				throw new ArgumentException(Strings.DockPane_Constructor_NullDockPanel);


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

			m_isFloat = (dockState == DockState.Float);

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

			m_splitter = new SplitterControl(this);

			m_nestedDockingStatus = new NestedDockingStatus(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)
				DockTo(prevPane.NestedPanesContainer, 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);
		}
        public VS2012DockPaneStrip(DockPane pane)
            : base(pane)
        {
            SetStyle(ControlStyles.ResizeRedraw |
                ControlStyles.UserPaint |
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.OptimizedDoubleBuffer, true);

            SuspendLayout();

            m_components = new Container();
            m_toolTip = new ToolTip(Components);
            m_selectMenu = new ContextMenuStrip(Components);
            pane.DockPanel.Theme.ApplyTo(m_selectMenu);

            ResumeLayout();
        }
        public VS2005DockPaneStrip(DockPane pane)
            : base(pane)
        {
            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            SuspendLayout();

            Font = SystemInformation.MenuFont;

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

            ResumeLayout();
        }
        public VS2003DockPaneStrip(DockPane pane)
            : base(pane)
        {
            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, 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 += Close_Click;

            m_buttonScrollLeft.Enabled = false;
            m_buttonScrollLeft.RepeatClick = true;
            m_buttonScrollLeft.ToolTipText = ToolTipScrollLeft;
            m_buttonScrollLeft.Anchor = AnchorStyles.Top | AnchorStyles.Right;
            m_buttonScrollLeft.Click += ScrollLeft_Click;

            m_buttonScrollRight.Enabled = false;
            m_buttonScrollRight.RepeatClick = true;
            m_buttonScrollRight.ToolTipText = ToolTipScrollRight;
            m_buttonScrollRight.Anchor = AnchorStyles.Top | AnchorStyles.Right;
            m_buttonScrollRight.Click += ScrollRight_Click;

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

            ResumeLayout();
        }
        public VS2005DockPaneStrip(DockPane pane)
            : base(pane)
        {
            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            SuspendLayout();

            Font = PluginCore.PluginBase.Settings.DefaultFont;

            m_components = new Container();
            m_toolTip = new ToolTip(Components);
            m_selectMenu = new ContextMenuStrip(Components);
            m_selectMenu.Font = PluginCore.PluginBase.Settings.DefaultFont;
            m_selectMenu.Renderer = new DockPanelStripRenderer(false);

            ResumeLayout();
        }
		/// <include file='CodeDoc/DockPaneCaptionVS2003.xml' path='//CodeDoc/Class[@name="DockPaneCaptionVS2003"]/Construct[@name="(DockPane)"]/*'/>
		protected internal VS2003DockPaneCaption(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();
		}
 public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds)
 {
     return(new FloatWindow(dockPanel, pane, bounds));
 }
Beispiel #27
0
 public void DockTo(DockPane paneTo, DockStyle dockStyle, int contentIndex, double proportion)
 {
     DockHandler.DockTo(paneTo, dockStyle, contentIndex, proportion);
 }
 private void Close_Click(object sender, EventArgs e)
 {
     DockPane.CloseActiveContent();
 }
Beispiel #29
0
 private void SetVisibleContentsToPane(DockPane pane)
 {
     SetVisibleContentsToPane(pane, ActiveContent);
 }
Beispiel #30
0
 public void Show(DockPane pane, IDockContent beforeContent)
 {
     DockHandler.Show(pane, beforeContent);
 }
Beispiel #31
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(Strings.DockPane_SetDockState_InvalidState);
            }

            if (content == null)
            {
                throw new ArgumentNullException(Strings.DockPane_Constructor_NullContent);
            }

            if (content.DockHandler.DockPanel == null)
            {
                throw new ArgumentException(Strings.DockPane_Constructor_NullDockPanel);
            }


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

            m_isFloat = (dockState == DockState.Float);

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

            m_splitter = new SplitterControl(this);

            m_nestedDockingStatus = new NestedDockingStatus(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)
            {
                DockTo(prevPane.NestedPanesContainer, 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);
        }
 protected virtual Pane CreatePane(DockPane dockPane)
 {
     return(new Pane(dockPane));
 }
 internal TabCollection(DockPane pane)
 {
     m_dockPane = pane;
 }
Beispiel #34
0
        internal void RemovePane(DockPane pane)
        {
            if (!Panes.Contains(pane))
                return;

            Panes.Remove(pane);
        }
 public void FloatAt(Rectangle floatWindowBounds)
 {
     DockPane pane = DockPanel.DockPaneFactory.CreateDockPane(Content, floatWindowBounds, true);
 }
 public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds)
 {
     return new FloatWindow(dockPanel, pane, bounds);
 }
 private void ResumeSetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
 {
     ResumeSetDockState();
     SetDockState(isHidden, visibleState, oldPane);
 }
Beispiel #38
0
 internal protected FloatWindow(DockPanel dockPanel, DockPane pane)
 {
     InternalConstruct(dockPanel, pane, false, Rectangle.Empty);
 }
 public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane)
 {
     return(new FloatWindow(dockPanel, pane));
 }
Beispiel #40
0
 public void Show(DockPane pane, DockStyle dock)
 {
     SaveOldValues();
     SetValues(Rectangle.Empty, pane, dock, -1);
     TestChange();
 }
 public DockPane CreateDockPane(IDockContent content, DockPane prevPane, DockAlignment alignment, double proportion, bool show)
 {
     return(new DockPane(content, prevPane, alignment, proportion, show));
 }
Beispiel #42
0
 public void Show(DockPane previousPane, DockAlignment alignment, double proportion)
 {
     DockHandler.Show(previousPane, alignment, proportion);
 }
Beispiel #43
0
 internal void SetPaneAndVisible(DockPane pane)
 {
     this.SetPane(pane);
     this.SetVisible();
 }
 internal void SetPaneAndVisible(DockPane pane)
 {
     SetPane(pane);
     SetVisible();
 }
Beispiel #45
0
        internal void SetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
        {
            if (this.IsSuspendSetDockState)
            {
                return;
            }
            if (this.DockPanel == null && visibleState != DockState.Unknown)
            {
                throw new InvalidOperationException(Strings.DockContentHandler_SetDockState_NullPanel);
            }
            if (visibleState == DockState.Hidden ||
                (visibleState != DockState.Unknown && !this.IsDockStateValid(visibleState)))
            {
                throw new InvalidOperationException(Strings.DockContentHandler_SetDockState_InvalidState);
            }
            DockPanel dockPanel = this.DockPanel;

            if (dockPanel != null)
            {
                dockPanel.SuspendLayout(true);
            }
            this.SuspendSetDockState();
            DockState oldDockState = this.DockState;

            if (this.m_isHidden != isHidden || oldDockState == DockState.Unknown)
            {
                this.m_isHidden = isHidden;
            }
            this.m_visibleState = visibleState;
            this.m_dockState    = isHidden ? DockState.Hidden : visibleState;
            if (visibleState == DockState.Unknown)
            {
                this.Pane = null;
            }
            else
            {
                this.m_isFloat = (this.m_visibleState == DockState.Float);
                if (this.Pane == null)
                {
                    this.Pane = this.DockPanel.DockPaneFactory.CreateDockPane(this.Content, visibleState, true);
                }
                else if (this.Pane.DockState != visibleState)
                {
                    if (this.Pane.Contents.Count == 1)
                    {
                        this.Pane.SetDockState(visibleState);
                    }
                    else
                    {
                        this.Pane = this.DockPanel.DockPaneFactory.CreateDockPane(this.Content, visibleState, true);
                    }
                }
            }
            if (this.Form.ContainsFocus)
            {
                if (this.DockState == DockState.Hidden || this.DockState == DockState.Unknown)
                {
                    this.DockPanel.ContentFocusManager.GiveUpFocus(this.Content);
                }
            }
            this.SetPaneAndVisible(this.Pane);
            if (oldPane != null && !oldPane.IsDisposed && oldDockState == oldPane.DockState)
            {
                RefreshDockPane(oldPane);
            }
            if (this.Pane != null && this.DockState == this.Pane.DockState)
            {
                if ((this.Pane != oldPane) || (this.Pane == oldPane && oldDockState != oldPane.DockState))
                {
                    RefreshDockPane(this.Pane);
                }
            }
            if (oldDockState != this.DockState)
            {
                if (this.DockState == DockState.Hidden || this.DockState == DockState.Unknown ||
                    DockHelper.IsDockStateAutoHide(this.DockState))
                {
                    this.DockPanel.ContentFocusManager.RemoveFromList(this.Content);
                }
                else
                {
                    this.DockPanel.ContentFocusManager.AddToList(this.Content);
                }
                this.OnDockStateChanged(EventArgs.Empty);
            }
            this.ResumeSetDockState();
            if (dockPanel != null)
            {
                dockPanel.ResumeLayout(true, true);
            }
        }
Beispiel #46
0
 protected void ShowTabPageContextMenu(Point position)
 {
     DockPane.ShowTabPageContextMenu(this, position);
 }
 public void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex)
 {
     DockTo(pane, dockStyle, contentIndex, 0.5);
 }
 public DockPaneStripBase CreateDockPaneStrip(DockPane pane)
 {
     return(new VS2005DockPaneStrip(pane));
 }
        internal void SetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
        {
            if (IsSuspendSetDockState)
            {
                return;
            }

            if (DockPanel == null && visibleState != DockState.Unknown)
            {
                throw new InvalidOperationException(DJMaxEditor.Resources.DockContentHandler_SetDockState_NullPanel);
            }

            if (visibleState == DockState.Hidden || (visibleState != DockState.Unknown && !IsDockStateValid(visibleState)))
            {
                throw new InvalidOperationException(DJMaxEditor.Resources.DockContentHandler_SetDockState_InvalidState);
            }

            DockPanel dockPanel = DockPanel;

            if (dockPanel != null)
            {
                dockPanel.SuspendLayout(true);
            }

            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);
                    }
                }
            }

            if (Form.ContainsFocus)
            {
                if (DockState == DockState.Hidden || DockState == DockState.Unknown)
                {
                    if (!Win32Helper.IsRunningOnMono)
                    {
                        DockPanel.ContentFocusManager.GiveUpFocus(Content);
                    }
                }
            }

            SetPaneAndVisible(Pane);

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

            if (Pane != null && DockState == Pane.DockState)
            {
                if ((Pane != oldPane) ||
                    (Pane == oldPane && oldDockState != oldPane.DockState))
                {
                    // Avoid early refresh of hidden AutoHide panes
                    if ((Pane.DockWindow == null || Pane.DockWindow.Visible || Pane.IsHidden) && !Pane.IsAutoHide)
                    {
                        RefreshDockPane(Pane);
                    }
                }
            }

            if (oldDockState != DockState)
            {
                if (DockState == DockState.Hidden || DockState == DockState.Unknown ||
                    DockHelper.IsDockStateAutoHide(DockState))
                {
                    if (!Win32Helper.IsRunningOnMono)
                    {
                        DockPanel.ContentFocusManager.RemoveFromList(Content);
                    }
                }
                else if (!Win32Helper.IsRunningOnMono)
                {
                    DockPanel.ContentFocusManager.AddToList(Content);
                }

                ResetAutoHidePortion(oldDockState, DockState);
                OnDockStateChanged(EventArgs.Empty);
            }

            ResumeSetDockState();

            if (dockPanel != null)
            {
                dockPanel.ResumeLayout(true, true);
            }
        }
 public DockPaneCaptionBase CreateDockPaneCaption(DockPane pane)
 {
     return(new VS2005DockPaneCaption(pane));
 }
Beispiel #51
0
 public void Show(DockPane pane, int contentIndex)
 {
     SaveOldValues();
     SetValues(Rectangle.Empty, pane, DockStyle.Fill, contentIndex);
     TestChange();
 }
Beispiel #52
0
 public void DockTo(DockPane paneTo, DockStyle dockStyle, int contentIndex)
 {
     DockHandler.DockTo(paneTo, dockStyle, contentIndex);
 }
Beispiel #53
0
 internal protected FloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds)
 {
     InternalConstruct(dockPanel, pane, true, bounds);
 }
 private static void RefreshDockPane(DockPane pane)
 {
     pane.RefreshChanges();
     pane.ValidateActiveContent();
 }
 public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane)
 {
     return new FloatWindow(dockPanel, pane);
 }
Beispiel #56
0
        protected override void WndProc(ref Message m)
        {
            switch (m.Msg)
            {
            case (int)Win32.Msgs.WM_NCLBUTTONDOWN:
            {
                if (IsDisposed)
                {
                    return;
                }

                uint result = Win32Helper.IsRunningOnMono ? 0 : NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
                if (result == 2 && DockPanel.AllowEndUserDocking && this.AllowEndUserDocking)            // HITTEST_CAPTION
                {
                    Activate();
                    m_dockPanel.BeginDrag(this);
                }
                else
                {
                    base.WndProc(ref m);
                }

                return;
            }

            case (int)Win32.Msgs.WM_NCRBUTTONDOWN:
            {
                uint result = Win32Helper.IsRunningOnMono ? 0 : NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
                if (result == 2)            // HITTEST_CAPTION
                {
                    DockPane theOnlyPane = (VisibleNestedPanes.Count == 1) ? VisibleNestedPanes[0] : null;
                    if (theOnlyPane != null && theOnlyPane.ActiveContent != null)
                    {
                        theOnlyPane.ShowTabPageContextMenu(this, PointToClient(Control.MousePosition));
                        return;
                    }
                }

                base.WndProc(ref m);
                return;
            }

            case (int)Win32.Msgs.WM_CLOSE:
                if (NestedPanes.Count == 0)
                {
                    base.WndProc(ref m);
                    return;
                }
                for (int i = NestedPanes.Count - 1; i >= 0; i--)
                {
                    DockContentCollection contents = NestedPanes[i].Contents;
                    for (int j = contents.Count - 1; j >= 0; j--)
                    {
                        IDockContent content = contents[j];
                        if (content.DockHandler.DockState != DockState.Float)
                        {
                            continue;
                        }

                        if (!content.DockHandler.CloseButton)
                        {
                            continue;
                        }

                        if (content.DockHandler.HideOnClose)
                        {
                            content.DockHandler.Hide();
                        }
                        else
                        {
                            content.DockHandler.Close();
                        }
                    }
                }
                return;

            case (int)Win32.Msgs.WM_NCLBUTTONDBLCLK:
            {
                uint result = !DoubleClickTitleBarToDock || Win32Helper.IsRunningOnMono
                            ? 0
                            : NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);

                if (result != 2)            // HITTEST_CAPTION
                {
                    base.WndProc(ref m);
                    return;
                }

                DockPanel.SuspendLayout(true);

                // Restore to panel
                foreach (DockPane pane in NestedPanes)
                {
                    if (pane.DockState != DockState.Float)
                    {
                        continue;
                    }
                    pane.RestoreToPanel();
                }


                DockPanel.ResumeLayout(true, true);
                return;
            }

            case WM_CHECKDISPOSE:
                if (NestedPanes.Count == 0)
                {
                    Dispose();
                }
                return;
            }

            base.WndProc(ref m);
        }
Beispiel #57
0
        internal void AddPane(DockPane pane)
        {
            if (Panes.Contains(pane))
                return;

            pane.IsMaximizedChanged += pane_IsMaximizedChanged;

            Panes.Add(pane);
        }
Beispiel #58
0
        private static void MergeNestedPanes(VisibleNestedPaneCollection nestedPanesFrom, NestedPaneCollection nestedPanesTo, DockPane prevPane, DockAlignment alignment, double proportion)
        {
            if (nestedPanesFrom.Count == 0)
            {
                return;
            }

            int count = nestedPanesFrom.Count;

            DockPane[]      panes       = new DockPane[count];
            DockPane[]      prevPanes   = new DockPane[count];
            DockAlignment[] alignments  = new DockAlignment[count];
            double[]        proportions = new double[count];

            for (int i = 0; i < count; i++)
            {
                panes[i]       = nestedPanesFrom[i];
                prevPanes[i]   = nestedPanesFrom[i].NestedDockingStatus.PreviousPane;
                alignments[i]  = nestedPanesFrom[i].NestedDockingStatus.Alignment;
                proportions[i] = nestedPanesFrom[i].NestedDockingStatus.Proportion;
            }

            DockPane pane = panes[0].DockTo(nestedPanesTo.Container, prevPane, alignment, proportion);

            panes[0].DockState = nestedPanesTo.DockState;

            for (int i = 1; i < count; i++)
            {
                for (int j = i; j < count; j++)
                {
                    if (prevPanes[j] == panes[i - 1])
                    {
                        prevPanes[j] = pane;
                    }
                }
                pane = panes[i].DockTo(nestedPanesTo.Container, prevPanes[i], alignments[i], proportions[i]);
                panes[i].DockState = nestedPanesTo.DockState;
            }
        }
Beispiel #59
0
        public void SetPaneIndex(DockPane pane, int index)
        {
            int oldIndex = Panes.IndexOf(pane);
            if (oldIndex == -1)
                throw(new ArgumentException(Strings.DockPanel_SetPaneIndex_InvalidPane));

            if (index < 0 || index > Panes.Count - 1)
                if (index != -1)
                    throw(new ArgumentOutOfRangeException(Strings.DockPanel_SetPaneIndex_InvalidIndex));
                
            if (oldIndex == index)
                return;
            if (oldIndex == Panes.Count - 1 && index == -1)
                return;

            Panes.Remove(pane);
            if (index == -1)
                Panes.Add(pane);
            else if (oldIndex < index)
                Panes.AddAt(pane, index - 1);
            else
                Panes.AddAt(pane, index);
        }
 protected internal Pane(DockPane dockPane)
 {
     m_dockPane = dockPane;
 }