public static void AddPane(Pane pane) { if (FocusedPaneGroup == null) { FocusedPaneGroup = new PaneGroup(FocusedContainer); FocusedContainer.InsertPanel(FocusedPaneGroup); } FocusedPaneGroup.AddPane(pane); }
internal static void ShowDockHelper(PaneGroup paneGroup) { if (dockHelper == null || dockHelper.Disposed) { dockHelper = new DockHelper(paneGroup); } else { dockHelper.Parent = paneGroup; dockHelper.Invalidate(); } dockHelper.IsHidden = false; }
public DockHelper(PaneGroup parent) : base(parent) { var bSize = 30; addUp = new DockButton(this, AddUp, "up"); addLeft = new DockButton(this, AddLeft, "left"); addDown = new DockButton(this, AddDown, "down"); addRigth = new DockButton(this, AddRigth, "rigth"); addCenter = new DockButton(this, AddCenter, "center"); addUp.SetPosition(bSize, 0); addLeft.SetPosition(0, bSize); addDown.SetPosition(bSize, 2 * bSize); addRigth.SetPosition(2 * bSize, bSize); addCenter.SetPosition(bSize, bSize); SizeToChildren(); }
/// <summary> /// Move pane to a container relative to targetPaneGroup. /// </summary> /// <param name="pane">Pane to be moved</param> /// <param name="targetPaneGroup"> </param> /// <param name="depth">Refer a parent container of targetPaneGroup, each depth is one parent container away. /// Depth 0 add a PaneContainer in the same container if the container is horizontal, if not /// adds the movedPane to a new child vertical container</param> /// <param name="moveRigth"> True to move pane to the rigth of targetPaneGroup </param> internal static void MovePaneHorizontally(TabButton pane, PaneGroup targetPaneGroup, uint depth, bool moveRigth) { var container = GetParentContainer(targetPaneGroup); if (!container.IsHorizontal) { var childContainer = new Container(container) { IsHorizontal = true }; container.ReplacePanel(targetPaneGroup, childContainer, false); childContainer.InsertPanel(targetPaneGroup); container = childContainer; } var paneGroup = new PaneGroup(container); paneGroup.AddPage(pane); container.InsertPanel(paneGroup, targetPaneGroup, !moveRigth); }
/// <summary> /// Move pane from the current PaneGroup to the targetPaneGroup. /// </summary> /// <param name="pane">Pane to be moved</param> /// <param name="targetPaneGroup"></param> internal static void MovePane(TabButton pane, PaneGroup targetPaneGroup) { targetPaneGroup.AddPage(pane); }