protected override void InitPanels()
        {
            NDockZone         zone;
            NDockingPanelHost panelHost;

            zone      = new NDockZone(Orientation.Vertical);
            panelHost = new NDockingPanelHost();
            panelHost.AddChild(GetGenericPanel());
            zone.AddChild(panelHost);

            panelHost = new NDockingPanelHost();
            panelHost.AddChild(GetGenericPanel());
            zone.AddChild(panelHost);

            m_Container.RootZone.AddChild(zone);

            NDockingPanel panel = new NDockingPanel();

            panelHost = new NDockingPanelHost();
            panelHost.AddChild(panel);

            m_Container.RootZone.AddChild(panelHost);

            NDockingPanelContainer container = m_DockManager.AddContainer(DockStyle.Fill);

            container.RootZone.Orientation = Orientation.Vertical;
            container.BackColor            = Color.Red;
            container.DockPadding.All      = 10;
            panel.Controls.Add(container);

            panelHost = new NDockingPanelHost();
            panelHost.AddChild(GetGenericPanel());
            panelHost.AddChild(GetGenericPanel());
            container.RootZone.AddChild(panelHost);
        }
示例#2
0
        protected override void LayoutExample()
        {
            NExampleBaseUC uc = CurrentExampleControl as NExampleBaseUC;

            if (uc == null)
            {
                return;
            }

            int nWidth  = uc.Width + 10;
            int nHeight = uc.Height + 60;

            ExampleLayout newLayout = (nWidth > 330) ? ExampleLayout.WideScreen : ExampleLayout.Standard;

            if (m_CurrentLayout == newLayout)
            {
                if (ExamplePanel.ParentZone != null)
                {
                    if (newLayout == ExampleLayout.WideScreen)
                    {
                        ExamplePanel.SizeInfo.AbsoluteSize = new Size(0, nHeight);
                    }
                    else if (newLayout == ExampleLayout.Standard)
                    {
                        ExamplePanel.SizeInfo.AbsoluteSize = new Size(nWidth, 0);
                    }
                }
            }
            else
            {
                m_CurrentLayout = newLayout;

                NDockingPanelContainer mainContainer = DockManager.MainContainer;

                if (newLayout == ExampleLayout.WideScreen)
                {
                    INDockZone        zone   = DockManager.m_ControlHost.ParentZone;
                    NDockingPanelHost dpHost = FindDockingPanelHostInZone(zone);

                    if (dpHost != null)
                    {
                        ExamplePanel.PerformDock(dpHost, DockStyle.Fill, 0);
                    }
                    else
                    {
                        ExamplePanel.PerformDock(zone, DockStyle.Bottom, 0);
                    }

                    ExamplePanel.SizeInfo.AbsoluteSize = new Size(0, nHeight);
                }
                else if (newLayout == ExampleLayout.Standard)
                {
                    ExamplePanel.PerformDock(mainContainer.RootZone, DockStyle.Right, 0);
                    ExamplePanel.SizeInfo.AbsoluteSize = new Size(nWidth, 0);
                }
            }
        }
        internal void UpdateContainer()
        {
            NDockingPanelContainer container = nDockingPanel1.ContainerPanel;

            if (container == null || container.DockState != DockState.Floating)
            {
                return;
            }

            int maxWidth  = (int)widthNumeric.Value;
            int maxHeight = (int)heightNumeric.Value;
            int minWidth  = (int)minWidthNumeric.Value;
            int minHeight = (int)minHeightNumeric.Value;

            container.MinimumSize = new Size(minWidth, minHeight);
            container.MaximumSize = new Size(maxWidth, maxHeight);

            container.Sizable = nCheckBox1.Checked;
        }