Exemple #1
0
            public void MulitpleWindowDock(RadDock Dock)
            {
                ToolWindow windowLeft = new ToolWindow();

                windowLeft.Text = "Window Left";
                Dock.DockWindow(windowLeft, DockPosition.Left);
                ToolWindow windowBottom = new ToolWindow();

                windowBottom.Text = "Window Bottom";
                Dock.DockWindow(windowBottom, DockPosition.Bottom);
                ToolWindow windowBottomRight = new ToolWindow();

                windowBottomRight.Text = "Window Bottom Right";
                Dock.DockWindow(windowBottomRight, windowBottom, DockPosition.Right);
                DocumentWindow document1 = new DocumentWindow();

                document1.Text = "Document 1";
                Dock.AddDocument(document1);
                DocumentWindow document2 = new DocumentWindow();

                document2.Text = "Document 2";
                Dock.AddDocument(document2);
                DocumentWindow document3 = new DocumentWindow();

                document3.Text = "Document 3";
                Dock.AddDocument(document3);
            }
Exemple #2
0
            //LaunchForm ln = new LaunchForm();
            //bool launched = ln.Launch(txt, false, "", CurrentForm);


            public void ToolWindowsDock(RadDock Dock)
            {
                ToolWindow windowTop = new ToolWindow();

                windowTop.Text = "Window Top";
                Dock.DockWindow(windowTop, DockPosition.Top);
            }
Exemple #3
0
        public void DisplayWindow(ISmartWindow window, WindowPosition position, params object[] options)
        {
            if (position == null || position.DockStyle == DockStyle.Fill)
            {
                DisplayWindow(window);
                return;
            }
            if ((window as DockWindow).DockState == DockState.Hidden)
            {
                (window as DockWindow).DockState = DockState.Docked;
                return;
            }
            if (position.DockStyle == DockStyle.None)
            {
                if (options != null && options.Length > 0)
                {
                    Rectangle rect = (Rectangle)options[0];
                    _radDock.FloatWindow(window as DockWindow, rect);
                }
                else
                {
                    _radDock.FloatWindow(window as DockWindow);
                }
                return;
            }
            DockPosition dockPosition = GetDockPosition(position);

            if (position.IsSharePanel)
            {
                DockWindow edgeDockwindow = GetEdgeDockwindow(dockPosition);
                if (edgeDockwindow == null)
                {
                    _radDock.DockWindow(window as DockWindow, dockPosition);
                    _edgeDockwindows.Add((DockPosition)dockPosition, window as DockWindow);
                }
                else
                {
                    _edgeDockwindows.Remove(dockPosition);
                    _edgeDockwindows.Add(dockPosition, window as DockWindow);
                    _radDock.DockWindow(window as DockWindow, edgeDockwindow.DockTabStrip, DockPosition.Top);
                }
            }
            else
            {
                _radDock.DockWindow(window as DockWindow, dockPosition);
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="previewSurface"></param>
        /// <returns></returns>
        public override ControlStyleBuilderInfoList GetThemeDesignedControls(Control previewSurface)
        {
            //Docking requires the following stylesheet registrations

            //<RadStylesheetRelation ControlType="Telerik.WinControls.UI.Docking.RadDock"
            //                       ElementType="Telerik.WinControls.RootRadElement" />

            //<RadStylesheetRelation ControlType="Telerik.WinControls.UI.RadSplitContainer"
            //                       ElementType="Telerik.WinControls.RootRadElement" />

            //<RadStylesheetRelation ControlType="Telerik.WinControls.UI.Docking.DocumentTabStrip"
            //                       ElementType="Telerik.WinControls.RootRadElement" />

            //<RadStylesheetRelation ControlType="Telerik.WinControls.UI.Docking.ToolTabStrip"
            //                       ElementType="Telerik.WinControls.RootRadElement" />

            //<RadStylesheetRelation ControlType="Telerik.WinControls.UI.Docking.ToolTabStrip"
            //                       ElementType="Telerik.WinControls.UI.RadTabStripElement"  />

            //<RadStylesheetRelation ControlType="Telerik.WinControls.UI.Docking.DocumentTabStrip"
            //                       ElementType="Telerik.WinControls.UI.RadTabStripElement"  />

            //<RadStylesheetRelation ControlType="Telerik.WinControls.UI.Docking.ToolTabStrip"
            //                       ElementType="Telerik.WinControls.UI.RadTitleBarElement" />

            ControlStyleBuilderInfoList res = new ControlStyleBuilderInfoList();

            RadDock dock = new RadDock();

            dock.Size = new Size(400, 400);

            ToolWindow window = new ToolWindow("Tool Window 2");

            dock.DockWindow(window, DockPosition.Left);

            dock.DockWindow(new ToolWindow("Tool Window 3"), window, DockPosition.Fill);

            dock.DockWindow(new ToolWindow("Tool Window 1"), window, DockPosition.Left);

            DocumentWindow documentWindow = new DocumentWindow("Document 1");

            dock.DockWindow(documentWindow, DockPosition.Fill);
            dock.DockWindow(new DocumentWindow("Document 2"), DockPosition.Fill);

            dock.DockWindow(window, DockPosition.Bottom);
            dock.DockWindow(new ToolWindow("Tool Window 4"), window, DockPosition.Fill);

            //Todo Add parameter to ControlStyleBuilderInfo() to specify which is the control that should be managed on the design surface

            //ControlStyleBuilderInfo designed = new ControlStyleBuilderInfo(gridViewPreview, gridRow);
            //designed.StylePreviewRoot = previewTableBodyElement.Children[previewRowIndex];
            //designed.MainElementClassName = gridRow.GetType().FullName;
            //designed.Registration = new XmlStyleBuilderRegistration(null, typeof(RadGridView).FullName, gridRow.GetType().FullName);
            //designed.StyleDispatcher = (IStyleDispatcher)gridViewPreview.GridElement;

            //<RadStylesheetRelation ControlType="Telerik.WinControls.UI.Docking.RadDock"
            //                       ElementType="Telerik.WinControls.RootRadElement" />
            ControlStyleBuilderInfo mainDockInfo = new ControlStyleBuilderInfo(dock, dock.RootElement);

            res.Add(mainDockInfo);

            //<RadStylesheetRelation ControlType="Telerik.WinControls.UI.RadSplitContainer"
            //                       ElementType="Telerik.WinControls.RootRadElement" />
            RadSplitContainer       container = (RadSplitContainer)dock.SplitPanels[0];
            ControlStyleBuilderInfo info      = new ControlStyleBuilderInfo(container, container.RootElement);

            info.StylePreviewRoot     = container.RootElement;
            info.MainElementClassName = container.RootElement.GetThemeEffectiveType().FullName;
            //info.Registration = new XmlStyleBuilderRegistration(null, typeof(RadGridView).FullName, gridRow.GetType().FullName);
            //designed.StyleDispatcher = (IStyleDispatcher)gridViewPreview.GridElement;
            res.Add(info);

            //<RadStylesheetRelation ControlType="Telerik.WinControls.UI.Docking.DocumentTabStrip"
            //                       ElementType="Telerik.WinControls.RootRadElement" />
            DocumentTabStrip documentStrip = (DocumentTabStrip)documentWindow.TabStrip;

            info = new ControlStyleBuilderInfo(documentStrip, documentStrip.RootElement);
            info.StylePreviewRoot = documentStrip.RootElement;
            res.Add(info);

            //<RadStylesheetRelation ControlType="Telerik.WinControls.UI.Docking.ToolTabStrip"
            //ElementType="Telerik.WinControls.RootRadElement" />
            info = new ControlStyleBuilderInfo(window.TabStrip, window.TabStrip.RootElement);
            info.StylePreviewRoot = window.TabStrip.RootElement;
            res.Add(info);

            ////<RadStylesheetRelation ControlType="Telerik.WinControls.UI.Docking.ToolTabStrip"
            ////                       ElementType="Telerik.WinControls.UI.RadTabStripElement"  />
            //info = new ControlStyleBuilderInfo(window.TabStrip, window.TabStrip.TabStripElement);
            //info.StylePreviewRoot = window.TabStrip.TabStripElement;
            //res.Add(info);

            ////<RadStylesheetRelation ControlType="Telerik.WinControls.UI.Docking.DocumentTabStrip"
            ////                       ElementType="Telerik.WinControls.UI.RadTabStripElement"  />
            //info = new ControlStyleBuilderInfo(documentStrip, documentStrip.TabStripElement);
            //info.StylePreviewRoot = documentStrip.TabStripElement;
            //res.Add(info);

            ////<RadStylesheetRelation ControlType="Telerik.WinControls.UI.Docking.ToolTabStrip"
            ////                       ElementType="Telerik.WinControls.UI.RadTitleBarElement" />
            //RadElement captionElement = ((ToolTabStrip)window.TabStrip).CaptionElement;
            //info = new ControlStyleBuilderInfo(window.TabStrip, captionElement);
            //info.StylePreviewRoot = captionElement;
            //res.Add(info);

            return(res);
        }