Exemplo n.º 1
0
        private void CreateFloatPanels()
        {
            FloatGroup fGroup1 = new FloatGroup()
            {
                FloatLocation = new Point(100, 100), FloatSize = new Size(200, 200)
            };
            LayoutGroup group = new LayoutGroup()
            {
                Orientation = Orientation.Vertical
            };
            LayoutPanel panel4 = CreateLayoutPanel("Panel4");
            LayoutPanel panel5 = CreateLayoutPanel("Panel5");

            group.AddRange(new BaseLayoutItem[] { panel4, panel5 });
            fGroup1.Add(group);

            FloatGroup fGroup2 = new FloatGroup()
            {
                FloatLocation = new Point(150, 150), FloatSize = new Size(200, 200)
            };
            LayoutPanel panel6 = CreateLayoutPanel("Panel6");

            fGroup2.Add(panel6);

            dockManager.FloatGroups.AddRange(new FloatGroup[] { fGroup1, fGroup2 });
        }
Exemplo n.º 2
0
        private void OpenOrActivateForm(string key, string caption, Control content, string toolTip, bool noScroll)
        {
            if (_openDocuments.ContainsKey(key))
            {
                dockLayoutManager1.DockController.Activate(_openDocuments[key]);
                return;
            }

            content.MaxHeight = 5000;
            content.MaxWidth = 10000;

            var panel = new DocumentPanel();
            panel.AllowClose = true;
            panel.Caption = caption;
            panel.ToolTip = toolTip ?? caption ?? "";

            panel.SizeChanged += (o, e) =>
            {
                Debug.WriteLine("Panel: W: {0}, H: {1}", panel.ActualWidth, panel.ActualHeight);
            };
            _openDocuments[key] = panel;

            if (noScroll)
            {
                panel.Content = content;
            }
            else
            {
                var scrollView = new ScrollViewer();
                scrollView.Content = content;
                content.HorizontalAlignment = HorizontalAlignment.Stretch;
                //content.VerticalAlignment = VerticalAlignment.Stretch;
                scrollView.SizeChanged += (o, e) =>
                {
                    Debug.WriteLine("Scroll: W: {0}, H: {1}", scrollView.ActualWidth, scrollView.ActualHeight);
                };

                panel.Content = scrollView;
            }

            if (_panelInfos.ContainsKey(key))
            {
                var i = _panelInfos[key];
                if (i.IsFloating)
                {
                    var g = new FloatGroup();
                    g.FloatLocation = i.FloatLocation;
                    g.FloatSize = i.FloatSize;
                    g.Add(panel);
                    dockLayoutManager1.FloatGroups.Add(g);
                }
                else
                {
                    dockLayoutManager1.DockController.Dock(panel, baseDocumentGroup, DockType.Fill);
                    //baseDocumentGroup.Add(panel);
                }
            }
            else
            {
                dockLayoutManager1.DockController.Dock(panel, baseDocumentGroup, DockType.Fill);
                //baseDocumentGroup.Add(panel);
            }
            dockLayoutManager1.DockController.Activate(panel);
        }
Exemplo n.º 3
0
        private void OpenOrActivateForm(string key, string caption, Control content, string toolTip, bool noScroll)
        {
            if (_openDocuments.ContainsKey(key))
            {
                dockLayoutManager1.DockController.Activate(_openDocuments[key]);
                return;
            }

            content.MaxHeight = 5000;
            content.MaxWidth  = 10000;

            var panel = new DocumentPanel();

            panel.AllowClose = true;
            panel.Caption    = caption;
            panel.ToolTip    = toolTip ?? caption ?? "";

            panel.SizeChanged += (o, e) =>
            {
                Debug.WriteLine("Panel: W: {0}, H: {1}", panel.ActualWidth, panel.ActualHeight);
            };
            _openDocuments[key] = panel;

            if (noScroll)
            {
                panel.Content = content;
            }
            else
            {
                var scrollView = new ScrollViewer();
                scrollView.Content          = content;
                content.HorizontalAlignment = HorizontalAlignment.Stretch;
                //content.VerticalAlignment = VerticalAlignment.Stretch;
                scrollView.SizeChanged += (o, e) =>
                {
                    Debug.WriteLine("Scroll: W: {0}, H: {1}", scrollView.ActualWidth, scrollView.ActualHeight);
                };

                panel.Content = scrollView;
            }

            if (_panelInfos.ContainsKey(key))
            {
                var i = _panelInfos[key];
                if (i.IsFloating)
                {
                    var g = new FloatGroup();
                    g.FloatLocation = i.FloatLocation;
                    g.FloatSize     = i.FloatSize;
                    g.Add(panel);
                    dockLayoutManager1.FloatGroups.Add(g);
                }
                else
                {
                    dockLayoutManager1.DockController.Dock(panel, baseDocumentGroup, DockType.Fill);
                    //baseDocumentGroup.Add(panel);
                }
            }
            else
            {
                dockLayoutManager1.DockController.Dock(panel, baseDocumentGroup, DockType.Fill);
                //baseDocumentGroup.Add(panel);
            }
            dockLayoutManager1.DockController.Activate(panel);
        }