コード例 #1
0
        public DockPage Put(Widget widget, DockType type)
        {
            DockPage page = PickPage(widget);

            if (page != null)
            {
                page.Panel.DockItem.Visible = true;
                if (page.Visible)
                {
                    page.Panel.CurrentPage = page;
                }
                else
                {
                    page.Visible = true;
                }
            }
            else
            {
                widget.GotFocus += ChildFocusInEvent;

                DockItem item = null;
                if (type == DockType.Content)
                {
                    item = Main;
                }
                else if (type == DockType.Left)
                {
                    item = GetDockItem("Left", Main, LayoutAlignType.Left, false);
                }
                else if (type == DockType.LeftBottom)
                {
                    item = GetDockItem("Left", Main, LayoutAlignType.Left, false);
                    item = GetDockItem("LeftBottom", item, LayoutAlignType.Bottom, true);
                }
                else if (type == DockType.Right)
                {
                    item = GetDockItem("Right", Main, LayoutAlignType.Right, false);
                }
                else if (type == DockType.RightBottom)
                {
                    item = GetDockItem("Right", Main, LayoutAlignType.Right, false);
                    item = GetDockItem("RightBottom", item, LayoutAlignType.Bottom, true);
                }
                else if (type == DockType.Top)
                {
                    item = GetDockItem("Top", Main, LayoutAlignType.Top, false);
                }
                else if (type == DockType.Bottom)
                {
                    item = GetDockItem("Bottom", Main, LayoutAlignType.Bottom, false);
                    //item.Panel.PagesAlign = LayoutAlignType.Bottom;
                }
                item.Visible = true;
                page         = item.Panel.Put(widget);
            }
            QueueForReallocate();
            return(page);
        }
コード例 #2
0
        public void ClosePage(Widget c)
        {
            DockPage dp = GetPage(c);

            if (dp != null)
            {
                dp.Close();
            }
        }
コード例 #3
0
 protected internal void OnPageDoubleClick(DockPage page)
 {
     if (hided.Count == 0)
     {
         HideExcept(page.Panel.DockItem);
     }
     else
     {
         Unhide();
     }
 }
コード例 #4
0
        protected override void OnButtonReleased(ButtonEventArgs args)
        {
            base.OnButtonReleased(args);

            if (State.HasFlag(DockBoxState.InProcess))
            {
                if (State.HasFlag(DockBoxState.SizeLR))
                {
                    var dx = cach.X - args.Position.X;
                    if (hitLeft != null && hitLeft.Item != null)
                    {
                        hitLeft.Item.Width -= dx;
                    }
                    if (hitRight != null && hitRight.Item != null)
                    {
                        hitRight.Item.Width += dx;
                    }
                }
                if (State.HasFlag(DockBoxState.SizeUD))
                {
                    var dy = cach.Y - args.Position.Y;
                    if (hitTop != null && hitTop.Item != null)
                    {
                        hitTop.Item.Height -= dy;
                    }
                    if (hitBottom != null && hitBottom.Item != null)
                    {
                        hitBottom.Item.Height += dy;
                    }
                }
                if (State.HasFlag(DockBoxState.Move))
                {
                    var htest = DockHitTest(args.X, args.Y, 50);
                    page.Remove();
                    if (htest.Item != null)
                    {
                        if (htest.Align == LayoutAlignType.None)
                        {
                            htest.Item.Panel.Put(page);
                        }
                        else
                        {
                            var      name  = $"{(htest.Item.Name == "Content" ? "" : htest.Item.Name)}{htest.Align.ToString()}";
                            DockItem nitem = GetDockItem(name, htest.Item, htest.Align, true);
                            nitem.Panel.Put(page);
                        }
                    }
                    page = null;
                }
                QueueForReallocate();
                QueueDraw();
                State = DockBoxState.Default;
            }
        }
コード例 #5
0
 public DockPage GetPage(Widget c)
 {
     foreach (DockItem item in items.GetItems())
     {
         DockPage dp = item.Panel.GetPage(c);
         if (dp != null)
         {
             return(dp);
         }
     }
     return(null);
 }
コード例 #6
0
 public DockPage GetPage(string name)
 {
     foreach (DockItem item in items.GetItems())
     {
         DockPage dp = item.Panel.GetPage(name);
         if (dp != null)
         {
             return(dp);
         }
     }
     return(null);
 }
コード例 #7
0
 public DockPageEventArgs(DockPage page)
 {
     this.page = page;
 }
コード例 #8
0
 protected internal void OnPageDrag(ToolItemEventArgs e)
 {
     page  = e.Item as DockPage;
     State = DockBoxState.Move | DockBoxState.InProcess;
 }