protected override void OnDragStart(Point ptMouse, Point ptRelativeMouse)
        {
            //Manager.Drag(this, this.PointToScreenDPI(ptMouse), ptRelativeMouse);
            Manager.Drag(this, HelperFunc.PointToScreenWithoutFlowDirection(this, ptMouse), ptRelativeMouse);


            base.OnDragStart(ptMouse, ptRelativeMouse);
        }
Exemple #2
0
        protected override void OnDragStart(Point ptMouse, Point ptRelativeMouse)
        {
            if (IsFloatingAllowed)
            {
                Manager.Drag(this, HelperFunc.PointToScreenWithoutFlowDirection(this, ptMouse), ptRelativeMouse);
            }

            base.OnDragStart(ptMouse, ptRelativeMouse);
        }
        protected override void OnDragStart(Point ptMouse, Point ptRelativeMouse)
        {
            if (DockableStyle != DockableStyle.None &&
                State != DockableContentState.AutoHide)
            {
                Manager.Drag(this, HelperFunc.PointToScreenWithoutFlowDirection(this, ptMouse), ptRelativeMouse);
            }

            base.OnDragStart(ptMouse, ptRelativeMouse);
        }
Exemple #4
0
        protected override void OnDragStart(Point ptMouse, Point ptRelativeMouse)
        {
            if (DockableStyle != DockableStyle.None &&
                (State == DockableContentState.Docked || State == DockableContentState.Document || State == DockableContentState.DockableWindow) &&
                !Manager.DragPaneServices.IsDragging)
            {
                Manager.Drag(this, HelperFunc.PointToScreen(this, ptMouse), ptRelativeMouse);
            }

            base.OnDragStart(ptMouse, ptRelativeMouse);
        }
        protected override Size ArrangeOverride(Size finalSize)
        {
            if (ChildDefinitiveLenght.Count == 0)
            {
                foreach (UIElement child in Children)
                {
                    child.Arrange(new Rect());
                }
                return(new Size());
            }

            if (Children.Count == 0)
            {
            }
            else if (Children.Count == 1)
            {
                if (Children[0] != null)
                {
                    Children[0].Arrange(new Rect(new Point(0, 0), finalSize));
                }
            }
            else
            {
                double totSum             = 0.0;
                int    childWithInfDefLen = 0;
                for (int i = 0; i < Children.Count; i++)
                {
                    //UIElement child = ResizingDirection == ResizingDirection.Direct ? Children[i] : Children[Children.Count - 1 - i];
                    //UIElement child = FlowDirection == FlowDirection.LeftToRight ? Children[i] : Children[Children.Count - 1 - i];
                    UIElement        child         = Children[i];
                    IDockableControl dockableChild = child as IDockableControl;
                    if (dockableChild != null && !dockableChild.IsDocked)
                    {
                        continue;
                    }
                    if (!ChildDefinitiveLenght.ContainsKey(child))
                    {
                        totSum += Orientation == Orientation.Horizontal ?
                                  child.DesiredSize.Width :
                                  child.DesiredSize.Height;

                        continue;
                    }

                    double defLength = ChildDefinitiveLenght[child];
                    if (!double.IsInfinity(defLength))
                    {
                        totSum += defLength;
                    }
                    else
                    {
                        childWithInfDefLen++;
                    }
                }

                double sizeForInfDefLenght = 0.0;
                if ((Orientation == Orientation.Horizontal && HelperFunc.IsLessThen(totSum, finalSize.Width)) ||
                    (Orientation == Orientation.Vertical && HelperFunc.IsLessThen(totSum, finalSize.Height)))
                {
                    Debug.Assert(childWithInfDefLen > 0);
                    if (childWithInfDefLen > 0)
                    {
                        sizeForInfDefLenght = Orientation == Orientation.Horizontal ?
                                              (finalSize.Width - totSum) / childWithInfDefLen :
                                              (finalSize.Height - totSum) / childWithInfDefLen;
                    }
                }


                double offset = 0;

                for (int i = 0; i < Children.Count; i++)
                {
                    //UIElement child = ResizingDirection == ResizingDirection.Direct ? Children[i] : Children[Children.Count - 1 - i];
                    //UIElement child = FlowDirection == FlowDirection.LeftToRight ? Children[i] : Children[Children.Count - 1 - i];
                    UIElement        child         = Children[i];
                    IDockableControl dockableChild = child as IDockableControl;
                    if (dockableChild != null && !dockableChild.IsDocked)
                    {
                        child.Arrange(new Rect());
                    }
                    else if (ChildDefinitiveLenght.ContainsKey(child))
                    {
                        double defLength = ChildDefinitiveLenght[child];

                        if (double.IsInfinity(defLength))
                        {
                            defLength = sizeForInfDefLenght;
                        }

                        if (Orientation == Orientation.Horizontal)
                        {
                            child.Arrange(new Rect(offset, 0, defLength, finalSize.Height));
                        }
                        else
                        {
                            child.Arrange(new Rect(0, offset, finalSize.Width, defLength));
                        }

                        offset += defLength;
                    }
                    else
                    {
                        bool splitterIsVisible = ((i < Children.Count - 2 &&
                                                   PrevChildIsVisible(i)) ||
                                                  NextChildIsVisible(i) && PrevChildIsVisible(i)
                                                  );


                        if (!splitterIsVisible)
                        {
                            child.Arrange(new Rect());
                        }
                        else
                        {
                            //Splitters..
                            if (Orientation == Orientation.Horizontal)
                            {
                                child.Arrange(new Rect(offset, 0, child.DesiredSize.Width, finalSize.Height));
                                offset += child.DesiredSize.Width;
                            }
                            else
                            {
                                child.Arrange(new Rect(0, offset, finalSize.Width, child.DesiredSize.Height));
                                offset += child.DesiredSize.Height;
                            }
                        }
                    }
                }
            }

            return(base.ArrangeOverride(finalSize));
        }