Beispiel #1
0
        void DockItOn(DockingContainer popup)
        {
            DockingContainer dockParent = _selectedDockingContainer;

            IconCenter.ButtonPosition pos = _posToDock;

            if (pos == IconCenter.ButtonPosition.NotOnTheButton)
            {
                return;
            }

            switch (pos)
            {
            case IconCenter.ButtonPosition.B_BottomHalf:
                dockParent.addChild(popup, DockStyle.Bottom);
                break;

            case IconCenter.ButtonPosition.B_BottomRemain:
                dockParent.addChild(popup, DockStyle.Bottom, true);
                break;

            case IconCenter.ButtonPosition.B_Center:
                dockParent.addChild(popup, DockStyle.Fill);
                break;

            case IconCenter.ButtonPosition.B_LeftHalf:
                dockParent.addChild(popup, DockStyle.Left);
                break;

            case IconCenter.ButtonPosition.B_LeftRemain:
                dockParent.addChild(popup, DockStyle.Left, true);
                break;

            case IconCenter.ButtonPosition.B_RightHalf:
                dockParent.addChild(popup, DockStyle.Right);
                break;

            case IconCenter.ButtonPosition.B_RightRemain:
                dockParent.addChild(popup, DockStyle.Right, true);
                break;

            case IconCenter.ButtonPosition.B_TopHalf:
                dockParent.addChild(popup, DockStyle.Top);
                break;

            case IconCenter.ButtonPosition.B_TopRemain:
                dockParent.addChild(popup, DockStyle.Top, true);
                break;
            }
            this.Connect(popup.Name, popup);
            popup.setNowInPopup(false);
            popup.hidePopup();

            this.Refresh();
        }
Beispiel #2
0
        void TitleBar_MouseDown(object sender, MouseEventArgs e)
        {
            if (_parent.isInPopup() == false)
            {
                Rectangle rect = CoodinateHandling.GetFormBoundWithControlsBound(_parent, _popup);

                _popup.SetBounds(rect.X, rect.Y, rect.Width + _popup.Padding.Left + _popup.Padding.Right, rect.Height + _popup.Padding.Top + _popup.Padding.Bottom, BoundsSpecified.All);
                _popup.Show();
                _popup.setContent(this._parent);
                _parent.setNowInPopup(true);
                _root.Disconnect(_parent.Name);
                _parent.PopThisFromParent();
                _popup.BringToFront();
            }
            _pressedPt = CoodinateHandling.GetWindowPointFromControlOffset(_popup, this, e.X, e.Y);

            _isDragging     = true;
            _popup.Opacity  = 0.7;
            this.MouseDown -= _mouseDown;
            this.MouseMove += _mouseMove;
            //_popup.MouseMove += _mouseMove;
            this.MouseUp += _mouseUp;
            _root.DragBegin(_parent, Control.MousePosition.X, Control.MousePosition.Y);
        }