示例#1
0
    /// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Constructor[@name="()"]/*'/>
    public DockPanel() {
      m_extender = new DockPanelExtender(this);
      m_dragHandler = new DragHandler(this);
      m_panes = new DockPaneCollection();
      m_floatWindows = new FloatWindowCollection();

      SetStyle(ControlStyles.ResizeRedraw |
        ControlStyles.UserPaint |
        ControlStyles.AllPaintingInWmPaint, true);

      SuspendLayout();
      Font = SystemInformation.MenuFont;

      m_autoHideWindow = new AutoHideWindow(this);
      m_autoHideWindow.Visible = false;

      if (Environment.Version.Major == 1) {
        m_dummyControl = new DummyControl();
        m_dummyControl.Bounds = Rectangle.Empty;
        Controls.Add(m_dummyControl);
      }

      m_dockWindows = new DockWindowCollection(this);
      Controls.AddRange(new Control[]	{
				DockWindows[DockState.Document],
				DockWindows[DockState.DockLeft],
				DockWindows[DockState.DockRight],
				DockWindows[DockState.DockTop],
				DockWindows[DockState.DockBottom]
				});

      m_localWindowsHook = new LocalWindowsHook(HookType.WH_CALLWNDPROCRET);
      m_localWindowsHook.HookInvoked += new LocalWindowsHook.HookEventHandler(this.HookEventHandler);
      m_localWindowsHook.Install();

      m_dummyContent = new DockContent();
      ResumeLayout();
    }
示例#2
0
        private Rectangle GetWindowSplitterDragRectangle()
        {
            DockState state;
            DockPanel dockPanel;

            DockWindow     dockWindow     = DragControl as DockWindow;
            AutoHideWindow autoHideWindow = DragControl as AutoHideWindow;

            if (dockWindow != null)
            {
                state     = dockWindow.DockState;
                dockPanel = dockWindow.DockPanel;
            }
            else if (autoHideWindow != null)
            {
                state     = autoHideWindow.DockState;
                dockPanel = autoHideWindow.DockPanel;
            }
            else
            {
                return(Rectangle.Empty);
            }

            Rectangle rectLimit = dockPanel.DockArea;
            Point     location;

            if ((Control.ModifierKeys & Keys.Shift) == 0)
            {
                location = dockPanel.PointToClient(DragControl.Parent.PointToScreen(DragControl.Location));
            }
            else
            {
                location = dockPanel.DockArea.Location;
            }
            bool bVerticalSplitter;

            if (state == DockState.DockLeft || state == DockState.DockRight || state == DockState.DockLeftAutoHide || state == DockState.DockRightAutoHide)
            {
                rectLimit.X     += MeasurePane.MinSize;
                rectLimit.Width -= 2 * MeasurePane.MinSize;
                rectLimit.Y      = location.Y;
                if ((Control.ModifierKeys & Keys.Shift) == 0)
                {
                    rectLimit.Height = DragControl.Height;
                }
                bVerticalSplitter = true;
            }
            else
            {
                rectLimit.Y      += MeasurePane.MinSize;
                rectLimit.Height -= 2 * MeasurePane.MinSize;
                rectLimit.X       = location.X;
                if ((Control.ModifierKeys & Keys.Shift) == 0)
                {
                    rectLimit.Width = DragControl.Width;
                }
                bVerticalSplitter = false;
            }

            rectLimit.Location = dockPanel.PointToScreen(rectLimit.Location);

            return(GetSplitterDragRectangle(rectLimit, bVerticalSplitter));
        }
示例#3
0
		public void BeginDragAutoHideWindowSplitter(AutoHideWindow autoHideWindow, Point splitterLocation)
		{
			if (!InitDrag(autoHideWindow, DragSource.AutoHideWindowSplitter))
				return;

			autoHideWindow.FlagDragging = true;
			AutoHideWindowSplitter_BeginDrag(splitterLocation);
		}