Exemplo n.º 1
0
 public void Add(DockableGroup controls, PeekSide side)
 {
     foreach (IDockablePanel control in controls.Panels)
     {
         Add(control, controls.SuggestedSize, side);
     }
 }
Exemplo n.º 2
0
 public WindowActionEventArgs(RoutedEvent routedEvent, WindowAction action, Point?location = null, DockableGroup controls = null, PeekSide?side = null) : base(routedEvent)
 {
     Action           = action;
     Location         = location;
     DockableControls = controls;
     Side             = side;
 }
Exemplo n.º 3
0
 public void Dock(DockableGroup controls, DockSide side)
 {
     if (this.side == null)
     {
         if (side == DockSide.Center)
         {
             dockCenter(controls);
         }
         else
         {
             dockSide(controls, side);
         }
     }
     else if (this.side == DockSide.Center)
     {
         if (side == DockSide.Center)
         {
             dockCenter(controls);
         }
         else
         {
             dockSide(controls, side);
         }
     }
     else
     {
         if (this.side == side && !(this is RootDockPanel))
         {
             if (this.side == DockSide.Top || this.side == DockSide.Left)
             {
                 (splitContainer.Panel1 as DockPanel).Dock(controls, DockSide.Center);
             }
             else
             {
                 (splitContainer.Panel2 as DockPanel).Dock(controls, DockSide.Center);
             }
         }
         else if (side == DockSide.Center)
         {
             if (this.side == DockSide.Top || this.side == DockSide.Left)
             {
                 (splitContainer.Panel2 as DockPanel).Dock(controls, DockSide.Center);
             }
             else
             {
                 (splitContainer.Panel1 as DockPanel).Dock(controls, DockSide.Center);
             }
         }
         else
         {
             dockSide(controls, side);
         }
     }
 }
Exemplo n.º 4
0
        private void dockCenter(DockableGroup controls)
        {
            if (tabControl == null)
            {
                tabControl     = new TabControl();
                Content        = tabControl;
                splitContainer = null;
            }

            foreach (IDockablePanel control in controls.Panels)
            {
                tabControl.Items.Add(new EditorTab(control));
            }
            side = DockSide.Center;
        }
Exemplo n.º 5
0
        private void dockSide(DockableGroup controls, DockSide side)
        {
            SplitPanel splitContainer = this.splitContainer;

            if (splitContainer == null || this.side != side || this is RootDockPanel)
            {
                splitContainer = new SplitPanel();
            }

            DockPanel child1 = new DockPanel();
            DockPanel child2 = new DockPanel();

            splitContainer.Panel1 = child1;
            splitContainer.Panel2 = child2;

            double size;

            if (side == DockSide.Left || side == DockSide.Right)
            {
                size = Math.Min(controls.SuggestedSize.Width, ActualWidth * 0.8);
            }
            else
            {
                splitContainer.Orientation = Orientation.Vertical;
                size = Math.Min(controls.SuggestedSize.Height, ActualHeight * 0.8);
            }

            if (side == DockSide.Left || side == DockSide.Top)
            {
                splitContainer.Panel1Size = new GridLength(size);
                child1.Dock(controls, DockSide.Center);
                child2.move(this);
            }
            else
            {
                splitContainer.Panel2Size = new GridLength(size);
                child2.Dock(controls, DockSide.Center);
                child1.move(this);
            }

            Content             = splitContainer;
            this.splitContainer = splitContainer;
            tabControl          = null;
            this.side           = side;
        }
Exemplo n.º 6
0
        public EditorWindow(WorkspacePanel workspacePanel, DockableGroup controls) : this()
        {
            foreach (IDockablePanel control in controls.Panels)
            {
                tabControl.Items.Add(new EditorTab(control));
            }

            this.workspacePanel = workspacePanel;
            this.controls       = controls.Panels;
            Owner = GetWindow(workspacePanel);

            Width  = controls.SuggestedSize.Width;
            Height = controls.SuggestedSize.Height;

            AddHandler(TitleBar.WindowDraggedEvent, new WindowEventHandler(titleBar_WindowDragged));
            AddHandler(TitleBar.WindowDroppedEvent, new WindowEventHandler(titleBar_WindowDropped));
            AddHandler(TitleBar.WindowActionEvent, new WindowActionEventHandler(titleBar_WindowAction));
        }
Exemplo n.º 7
0
 public void Dock(DockableGroup controls)
 {
     rootDockPanel.Dock(controls, DockSide.Center);
 }
Exemplo n.º 8
0
 internal void dock(DockableGroup controls)
 {
     Window.GetWindow(this).Activate();
     highlightWindow.SelectedSpot.DockPanel.Dock(controls, highlightWindow.SelectedSpot.Side);
 }