Example #1
0
        /// <summary>
        /// 以DockBar模式(必须指定停靠方向,否则默认停靠在左侧)向DockManager注册一个DockElement
        /// </summary>
        /// <param name="title">标题栏文字</param>
        /// <param name="content">内容</param>
        /// <param name="imageSource">标题栏图标</param>
        /// <param name="side">停靠方向(默认左侧)</param>
        /// <param name="canSelect">是否直接停靠在选项栏中供用户选择(默认为False)</param>
        /// <param name="desiredWidth">期望的宽度</param>
        /// <param name="desiredHeight">期望的高度</param>
        /// <returns></returns>
        public void RegisterDock(IDockSource content, DockSide side = DockSide.Left, bool canSelect = false, double desiredWidth = Constants.DockDefaultWidthLength, double desiredHeight = Constants.DockDefaultHeightLength)
        {
            DockElement ele = new DockElement()
            {
                ID            = id++,
                Title         = content.Header,
                Content       = content as UIElement,
                ImageSource   = content.Icon,
                Side          = side,
                Mode          = DockMode.DockBar,
                CanSelect     = canSelect,
                DesiredWidth  = desiredWidth,
                DesiredHeight = desiredHeight
            };

            switch (side)
            {
            case DockSide.Left:
            case DockSide.Right:
            case DockSide.Top:
            case DockSide.Bottom:
                _root.AddSideChild(ele, side);
                break;

            default:    //其他非法方向返回NULL
                ele.Dispose();
                break;
            }
            var ctrl = new DockControl(ele);

            AddDockControl(ctrl);
            content.DockControl = ctrl;
        }
Example #2
0
        public void ToDockSide(DockSide side, bool isActive = false)
        {
            if (side != DockSide.Left && side != DockSide.Top && side != DockSide.Right && side != DockSide.Bottom)
            {
                return;
            }
            if (_container != null)
            {
                if (side != Side || Mode != DockMode.DockBar)
                {
                    var dockManager = DockManager;
                    _container.Detach(this);
                    _container = null;

                    Mode = DockMode.DockBar;
                    Side = side;
                    dockManager.Root.AddSideChild(this, Side);
                }

                if (isActive)
                {
                    _dockControl.SetActive();
                }
            }
        }
Example #3
0
 protected internal override void DrawCollapsedTab(
     Graphics graphics,
     Rectangle bounds,
     DockSide dockSide,
     Image image,
     string text,
     Font font,
     Color backColor,
     Color foreColor,
     DrawItemState state,
     bool vertical)
 {
     if (dockSide == DockSide.Left || dockSide == DockSide.Right)
     {
         using (Image xe058541ca798c059 = (Image) new Bitmap(image))
         {
             xe058541ca798c059.RotateFlip(RotateFlipType.Rotate90FlipNone);
             xa811784015ed8842.x36c79cea8e98cf3c(graphics, bounds, dockSide, xe058541ca798c059, text, font, SystemBrushes.ControlDarkDark, SystemColors.ControlDark, this.TabTextDisplay == TabTextDisplayMode.AllTabs);
         }
     }
     else
     {
         xa811784015ed8842.x36c79cea8e98cf3c(graphics, bounds, dockSide, image, text, font, SystemBrushes.ControlDarkDark, SystemColors.ControlDark, this.TabTextDisplay == TabTextDisplayMode.AllTabs);
     }
 }
Example #4
0
 public DockSpot(Rect spotRect, Rect parentRect, DockSide dockSide, DockPanel dockPanel)
 {
     Rect       = spotRect;
     ParentRect = parentRect;
     Side       = dockSide;
     DockPanel  = dockPanel;
     RootDock   = dockPanel.GetType() == typeof(RootDockPanel);
 }
Example #5
0
 protected internal abstract void DrawCollapsedTab(
     Graphics graphics,
     Rectangle bounds,
     DockSide dockSide,
     Image image,
     string text,
     Font font,
     System.Drawing.Color backColor,
     System.Drawing.Color foreColor,
     DrawItemState state,
     bool vertical);
Example #6
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);
         }
     }
 }
Example #7
0
 public void Load(XElement ele)
 {
     _isDocument = bool.Parse(ele.Attribute("IsDocument").Value);
     _side       = (DockSide)System.Enum.Parse(typeof(DockSide), ele.Attribute("Side").Value);
     foreach (var item in ele.Elements())
     {
         var itemNode = new ItemNode(this);
         itemNode.Load(item);
         _children.AddLast(itemNode);
     }
 }
Example #8
0
 public static bool Assert(this DockSide side)
 {
     if (side == DockSide.None ||
         side == DockSide.Left ||
         side == DockSide.Right ||
         side == DockSide.Top ||
         side == DockSide.Bottom)
     {
         return(true);
     }
     return(false);
 }
 /// <summary>
 /// Shows a docked window.
 /// </summary>
 /// <param name = "viewModel">The view model.</param>
 /// <param name = "context">The context.</param>
 /// <param name = "selectWhenShown">If set to <c>true</c> the window will be selected when shown.</param>
 /// <param name = "dockSide">The dock side.</param>
 public void ShowDockedWindow(object viewModel,
                              object context = null,
                              bool selectWhenShown = true,
                              DockSide dockSide = DockSide.Left)
 {
     var dockableContent = GetDockable(viewModel, context);
     dockableContent.Show(GetDockingManager(), GetAnchorStyle(dockSide));
     if (selectWhenShown)
         dockableContent.Activate();
     else
         dockableContent.ToggleAutoHide();
 }
Example #10
0
        public DockingTabControl(GuiWidget widgetTodockTo, DockSide dockSide, PrinterConfig printer)
            : base(FlowDirection.TopToBottom)
        {
            this.theme          = ApplicationController.Instance.Theme;
            this.printer        = printer;
            this.widgetTodockTo = widgetTodockTo;
            this.DockSide       = dockSide;
            this.BorderColor    = theme.MinimalShade;
            this.Border         = new BorderDouble(left: 1);

            // Add dummy widget to ensure OnLoad fires
            this.AddChild(new GuiWidget(10, 10));
        }
Example #11
0
 public static void x36c79cea8e98cf3c(
     Graphics x41347a961b838962,
     Rectangle xda73fcb97c77d998,
     DockSide xf33779c598cac695,
     Image xe058541ca798c059,
     string xb41faee6912a2313,
     Font x26094932cf7a9139,
     Brush x4fe4e32776bbc2b0,
     Color xa1359fb73f86c7a4,
     bool x96c7dce50f0f3286)
 {
     xa811784015ed8842.x36c79cea8e98cf3c(x41347a961b838962, xda73fcb97c77d998, xf33779c598cac695, xe058541ca798c059, xb41faee6912a2313, x26094932cf7a9139, (Brush)null, x4fe4e32776bbc2b0, xa1359fb73f86c7a4, x96c7dce50f0f3286);
 }
Example #12
0
        private static void Update(DockSide panel, float requested)
        {
            float size = requested;

            DockRect dockRect = DockUtility.dockStack.Peek();

            switch (panel)
            {
            case DockSide.Bottom:
            case DockSide.Top:
                size = (int)Mathf.Clamp(size, 0, dockRect.Fill.height);
                break;

            case DockSide.Left:
            case DockSide.Right:
                size = (int)Mathf.Clamp(size, 0, dockRect.Fill.width);
                break;

            default:
                throw new ArgumentOutOfRangeException("panel", panel, null);
            }

            switch (panel)
            {
            case DockSide.Bottom:
                dockRect.Bottom       = new Rect(dockRect.Fill.xMin, dockRect.Fill.yMax - size, dockRect.Fill.width, size);
                dockRect.Fill.height -= size;
                break;

            case DockSide.Top:
                dockRect.Top          = new Rect(dockRect.Fill.xMin, dockRect.Fill.yMin, dockRect.Fill.width, size);
                dockRect.Fill.height -= size;
                dockRect.Fill.y      += size;
                break;

            case DockSide.Left:
                dockRect.Left        = new Rect(dockRect.Fill.xMin, dockRect.Fill.yMin, size, dockRect.Fill.height);
                dockRect.Fill.width -= size;
                dockRect.Fill.x     += size;
                break;

            case DockSide.Right:
                dockRect.Right       = new Rect(dockRect.Fill.xMax - size, dockRect.Fill.yMin, size, dockRect.Fill.height);
                dockRect.Fill.width -= size;
                break;

            default:
                throw new ArgumentOutOfRangeException("panel", panel, null);
            }
        }
Example #13
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            DockSide side = (DockSide)value;

            if (side == DockSide.Right)
            {
                return(90.0);
            }
            if (side == DockSide.Left)
            {
                return(270);
            }

            return(Binding.DoNothing);
        }
Example #14
0
 internal static void ChangeSide(IDockView view, DockSide side)
 {
     if (view.Model != null && view.Model.Side == side)
     {
         return;
     }
     if (view is BaseGroupControl)
     {
         (view.Model as BaseLayoutGroup).Side = side;
     }
     if (view is LayoutGroupPanel)
     {
         (view as LayoutGroupPanel).Side = side;
     }
 }
Example #15
0
		protected internal override void DrawCollapsedTab(Graphics graphics, Rectangle bounds, DockSide dockSide, Image image, string text, Font font, Color backColor, Color foreColor, DrawItemState state, bool vertical)
		{
			using (Brush brush = CreateLinearGradientBrush(bounds, vertical ? CollapsedTabVerticalBackground : CollapsedTabHorizontalBackground, vertical ? LinearGradientMode.Horizontal : LinearGradientMode.Vertical))
			{
			    if (dockSide != DockSide.Left && dockSide != DockSide.Right)
			    {
			        RenderHelper.smethod_6(graphics, bounds, dockSide, image, text, font, brush, Brushes.Black, CollapsedTabBorder, TabTextDisplay == TabTextDisplayMode.AllTabs);
			        return;
			    }
			    using (var bm = new Bitmap(image))
				{
					bm.RotateFlip(RotateFlipType.Rotate90FlipNone);
					RenderHelper.smethod_6(graphics, bounds, dockSide, bm, text, font, brush, Brushes.Black, CollapsedTabBorder, TabTextDisplay == TabTextDisplayMode.AllTabs);
				}
			}
		}
Example #16
0
        private void ShowDockedWindow(IDockScreen viewModel,
                                      bool activate     = true,
                                      DockSide dockSide = DockSide.Left)
        {
            var dockableContent = GetDockable(viewModel);

            dockableContent.Show(_dockingManager, GetAnchorStyle(dockSide));
            if (activate)
            {
                dockableContent.Activate();
            }
            else
            {
                dockableContent.ToggleAutoHide();
            }
        }
Example #17
0
        private static AnchorStyle GetAnchorStyle(DockSide side)
        {
            switch (side)
            {
            case DockSide.None: return(AnchorStyle.None);

            case DockSide.Left: return(AnchorStyle.Left);

            case DockSide.Top: return(AnchorStyle.Top);

            case DockSide.Right: return(AnchorStyle.Right);

            case DockSide.Bottom: return(AnchorStyle.Bottom);

            default: return(AnchorStyle.Left);
            }
        }
Example #18
0
        /// <summary>
        /// Shows a docked window.
        /// </summary>
        /// <param name = "viewModel">The view model.</param>
        /// <param name = "context">The context.</param>
        /// <param name = "selectWhenShown">If set to <c>true</c> the window will be selected when shown.</param>
        /// <param name = "dockSide">The dock side.</param>
        public void ShowDockedWindow(object viewModel,
                                     object context       = null,
                                     bool selectWhenShown = true,
                                     DockSide dockSide    = DockSide.Left)
        {
            var dockableContent = GetDockable(viewModel, context);

            dockableContent.Show(GetDockingManager(), GetAnchorStyle(dockSide));
            if (selectWhenShown)
            {
                dockableContent.Activate();
            }
            else
            {
                dockableContent.ToggleAutoHide();
            }
        }
Example #19
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;
        }
Example #20
0
        /// <summary>
        /// Initializes a new instance of the Dropdown Control class.
        /// </summary>
        public DropdownControl()
        {
            SetStyle(ControlStyles.ResizeRedraw |
                     ControlStyles.OptimizedDoubleBuffer |
                     ControlStyles.Selectable |
                     ControlStyles.UserMouse |
                     ControlStyles.UserPaint |
                     ControlStyles.AllPaintingInWmPaint,
                     true);

            _dropdownState  = DropdownState.Normal;
            _dockSide       = DockSide.Left;
            _hostControl    = null;
            _showDropShadow = true;

            ControlAdded += ClientControlAdded;
            LostFocus    += ControlLostFocus;
            GotFocus     += ControlGotFocus;
            TextChanged  += ControlTextChanged;
        }
Example #21
0
        /// <summary>
        /// 以Float模式向DockManager注册一个DockElement
        /// </summary>
        /// <param name="title">标题栏文字</param>
        /// <param name="content">内容</param>
        /// <param name="imageSource">标题栏图标</param>
        /// <param name="side">停靠方向(默认左侧)</param>
        /// <param name="desiredWidth">期望的宽度</param>
        /// <param name="desiredHeight">期望的高度</param>
        /// <returns></returns>
        public void RegisterFloat(IDockSource content, DockSide side = DockSide.Left, double desiredWidth = Constants.DockDefaultWidthLength, double desiredHeight = Constants.DockDefaultHeightLength)
        {
            DockElement ele = new DockElement()
            {
                ID            = id++,
                Title         = content.Header,
                Content       = content as UIElement,
                ImageSource   = content.Icon,
                Side          = side,
                Mode          = DockMode.Float,
                DesiredWidth  = desiredWidth,
                DesiredHeight = desiredHeight
            };
            var ctrl  = new DockControl(ele);
            var group = new LayoutGroup(side, ele.Mode, this);

            group.Attach(ele);
            AddDockControl(ctrl);
            content.DockControl = ctrl;
        }
Example #22
0
 public void Load(XElement ele)
 {
     _isDocument = bool.Parse(ele.Attribute("IsDocument").Value);
     _side       = (DockSide)System.Enum.Parse(typeof(DockSide), ele.Attribute("Side").Value);
     _direction  = (Direction)System.Enum.Parse(typeof(Direction), ele.Attribute("Direction").Value);
     foreach (var item in ele.Elements())
     {
         var node = default(ILayoutNode);
         if (item.Name == "Panel")
         {
             node = new PanelNode(this);
         }
         else
         {
             node = new GroupNode(this);
         }
         node.Load(item);
         _children.AddLast(node);
     }
 }
Example #23
0
 protected internal override void DrawCollapsedTab(
     Graphics graphics,
     Rectangle bounds,
     DockSide dockSide,
     Image image,
     string text,
     Font font,
     Color backColor,
     Color foreColor,
     DrawItemState state,
     bool vertical)
 {
     if ((state & DrawItemState.Selected) == DrawItemState.Selected)
     {
         xa811784015ed8842.x36c79cea8e98cf3c(graphics, bounds, dockSide, image, text, font, SystemBrushes.ControlText, SystemColors.ControlDarkDark, this.TabTextDisplay == TabTextDisplayMode.AllTabs);
     }
     else
     {
         xa811784015ed8842.x36c79cea8e98cf3c(graphics, bounds, dockSide, image, text, font, SystemBrushes.ControlText, SystemColors.ControlDarkDark, this.TabTextDisplay == TabTextDisplayMode.AllTabs);
     }
 }
Example #24
0
        internal void AddSideChild(IDockElement ele, DockSide side)
        {
            switch (side)
            {
            case DockSide.Left:
                LeftSide.Attach(ele);
                break;

            case DockSide.Right:
                RightSide.Attach(ele);
                break;

            case DockSide.Top:
                TopSide.Attach(ele);
                break;

            case DockSide.Bottom:
                BottomSide.Attach(ele);
                break;
            }
        }
Example #25
0
        /// <summary>
        /// 以Float模式向DockManager注册一个DockElement
        /// </summary>
        /// <param name="title">标题栏文字</param>
        /// <param name="content">内容</param>
        /// <param name="imageSource">标题栏图标</param>
        /// <param name="side">停靠方向(默认左侧)</param>
        /// <param name="desiredWidth">期望的宽度</param>
        /// <param name="desiredHeight">期望的高度</param>
        /// <returns></returns>
        public void RegisterFloat(IDockSource content, DockSide side = DockSide.Left, int?id = null, double desiredWidth = Constants.DockDefaultWidthLength, double desiredHeight = Constants.DockDefaultHeightLength, double floatLeft = 0.0, double floatTop = 0.0)
        {
            DockElement ele = new DockElement()
            {
                ID            = id.HasValue ? id.Value : _GetID(),
                Title         = content.Header,
                Content       = content,
                ImageSource   = content.Icon,
                Side          = side,
                Mode          = DockMode.Float,
                DesiredWidth  = desiredWidth,
                DesiredHeight = desiredHeight,
                FloatLeft     = floatLeft,
                FloatTop      = floatTop
            };
            var ctrl  = new DockControl(ele);
            var group = new LayoutGroup(side, ele.Mode, this);

            group.Attach(ele);
            AddDockControl(ctrl);
            content.DockControl = ctrl;
        }
Example #26
0
        //This worked, but better don't use.
        //Instead, if panels added/removed/changed in new version, now automatically uses data from the default XML file.
        /// <summary>
        /// Creates new _Panel and adds it by the panel of control cBy, to an existing or new tab group or split.
        /// Does nothing if c is already added.
        /// The new panel settings will be saved to the XML file.
        /// Call this ater Create() when the new version of your app wants to add more panels without replacing the old XML (user-modified).
        /// You can simply always call this function for all panels added in new versions (it does nothing if called not first time). Or call it once, eg if FindPanel() returns false for that control.
        /// Also in new versions always pass the control to Create() too; it just ignores it if there is still no XML element for it.
        /// </summary>
        /// <param name="c">Control of the new _Panel.</param>
        /// <param name="cBy">Add the new panel by the panel of this control.</param>
        /// <param name="side">Specifies whether to add in a tab group or split, and at which side of cBy.</param>
        /// <param name="xml">XML containing single element that stores panel settings, eg "&lt;panel text='Results' tooltip='Find results' image='15' hide='' /&gt;".</param>
        public void ZAddPanel(Control c, Control cBy, DockSide side, string xml)
        {
            if (_FindPanel(c) != null)
            {
                return;
            }

            this.Controls.Add(c);

            var  xdoc = XElement.Load(xml);
            var  gp   = new _Panel(c, this, null, xdoc);
            bool hide = gp.IsHidden; gp.DockState = DockState.Hidden;
            var  gpBy = _FindPanel(cBy);

            gp.DockBy(gpBy, side, true);
            if (hide)
            {
                gp.Hide();
            }

            //not tested when cBy panel is hidden or floating
        }
Example #27
0
        public void Show(IDockScreen screen, DockType?dockType, bool activate, DockSide dockSide)
        {
            DockType type = dockType.HasValue ? dockType.Value : screen.Type;

            switch (type)
            {
            case DockType.Document:
                ShowDocumentWindow(screen, activate);
                break;

            case DockType.DockableContent:
                ShowDockedWindow(screen, activate, dockSide);
                break;

            case DockType.Floating:
                ShowFloatingWindow(screen, activate);
                break;

            default:
                break;
            }
        }
Example #28
0
        public void ShowDockedWindow(object viewModel, DockArea dockArea, object context = null,
                                     bool selectWhenShown       = true, DockSide dockSide = DockSide.Left,
                                     double startupVisibleWidth = -1, bool hideOnClose    = false, bool isCloseable = true)
        {
            var dockingManager = GetDockingManager();

            var anchor = GetAnchorStyle(dockSide);

            // TODO
            //if (anchor == AnchorStyle.Left && dockArea != DockArea.Master)
            //{
            //    var istview = IoC.Get<FacilitiesViewModel>();
            //    var instdockable = GetDockable(istview, null, DockArea.Master);

            //    instdockable.Show(dockingManager, anchor);
            //}

            var dockableContent = GetDockable(viewModel, context, dockArea);

            dockableContent.HideOnClose = hideOnClose;
            dockableContent.IsCloseable = isCloseable;
            dockableContent.Show(dockingManager, anchor);

            if (startupVisibleWidth >= 0)
            {
                var width = new GridLength(startupVisibleWidth);
                ResizingPanel.SetResizeWidth(dockableContent.ContainerPane, width);
            }

            if (selectWhenShown)
            {
                dockableContent.Activate();
            }
            //else
            //    dockableContent.ToggleAutoHide();
        }
Example #29
0
		protected internal override void DrawCollapsedTab(Graphics graphics, Rectangle bounds, DockSide dockSide, Image image, string text, Font font, Color backColor, Color foreColor, DrawItemState state, bool vertical)
		{
		    using (var brush = new SolidBrush(backColor))
		        graphics.FillRectangle(brush, bounds);
		    if (dockSide != DockSide.Top)
			{
				graphics.DrawLine(pen_2, bounds.Left, bounds.Top, bounds.Right, bounds.Top);
			}
			if (dockSide != DockSide.Right)
			{
				graphics.DrawLine(pen_2, bounds.Right, bounds.Top, bounds.Right, bounds.Bottom);
			}
			if (dockSide != DockSide.Bottom)
			{
				graphics.DrawLine(pen_2, bounds.Left, bounds.Bottom, bounds.Right, bounds.Bottom);
			}
			if (dockSide != DockSide.Left)
			{
				graphics.DrawLine(pen_2, bounds.Left, bounds.Top, bounds.Left, bounds.Bottom);
			}
			bounds.Inflate(-2, -2);
		    if (vertical)
		        bounds.Offset(0, 1);
		    else
		        bounds.Offset(1, 0);
		    graphics.DrawImage(image, new Rectangle(bounds.Left, bounds.Top, image.Width, image.Height));
		    if (text.Length == 0) return;
            if (vertical)
		    {
		        bounds.Offset(0, 23);
		        graphics.DrawString(text, font, solidBrush_1, bounds, VerticalTextFormat);
		        return;
		    }
		    bounds.Offset(23, 0);
		    graphics.DrawString(text, font, solidBrush_1, bounds, HorizontalTextFormat);
		}
 private static AnchorStyle GetAnchorStyle(DockSide side)
 {
     switch (side)
     {
         case DockSide.None: return AnchorStyle.None;
         case DockSide.Left: return AnchorStyle.Left;
         case DockSide.Top: return AnchorStyle.Top;
         case DockSide.Right: return AnchorStyle.Right;
         case DockSide.Bottom: return AnchorStyle.Bottom;
         default: return AnchorStyle.Left;
     }
 }
Example #31
0
		public void SplitForLayoutSystem(LayoutSystemBase layoutSystem, DockSide side)
		{
		    if (layoutSystem == null)
		        throw new ArgumentNullException(nameof(layoutSystem));
		    if (side == DockSide.None)
		        throw new ArgumentException(nameof(side));
		    if (layoutSystem.Parent != null)
		        throw new InvalidOperationException("This layout system must be removed from its parent before it can be moved to a new layout system.");
		    if (Parent == null)
		        throw new InvalidOperationException("This layout system is not parented yet.");

            var parent = Parent;
			if (parent.SplitMode != Orientation.Horizontal)
			{
				if (parent.SplitMode == Orientation.Vertical)
				{
					if (side == DockSide.Left || side == DockSide.Right)
					{
						method_12(layoutSystem, (side == DockSide.Left) ? parent.LayoutSystems.IndexOf(this) : (parent.LayoutSystems.IndexOf(this) + 1), false);
						return;
					}
					method_13(layoutSystem, Orientation.Horizontal, side == DockSide.Top);
				}
				return;
			}
			if (side != DockSide.Top && side != DockSide.Bottom)
			{
				method_13(layoutSystem, Orientation.Vertical, side == DockSide.Left);
				return;
			}
			method_12(layoutSystem, (side == DockSide.Top) ? parent.LayoutSystems.IndexOf(this) : (parent.LayoutSystems.IndexOf(this) + 1), true);
		}
Example #32
0
        protected internal override void DrawCollapsedTab(
            Graphics graphics,
            Rectangle bounds,
            DockSide dockSide,
            Image image,
            string text,
            Font font,
            Color backColor,
            Color foreColor,
            DrawItemState state,
            bool vertical)
        {
            using (SolidBrush solidBrush = new SolidBrush(backColor))
                graphics.FillRectangle((Brush)solidBrush, bounds);
            if (dockSide == DockSide.Top)
            {
                goto label_20;
            }
            else
            {
                goto label_26;
            }
label_5:
            do
            {
                if (text.Length != 0)
                {
                    goto label_10;
                }
                else
                {
                    goto label_7;
                }
label_6:
                continue;
label_7:
                if (((vertical ? 1 : 0) & 0) != 0)
                {
                    goto label_6;
                }
                else
                {
                    goto label_27;
                }
label_10:
                if (!vertical)
                {
                    bounds.Offset(23, 0);
                    graphics.DrawString(text, font, (Brush)this.x54c190ae969c389d, (RectangleF)bounds, EverettRenderer.x27e1c82c97265861);
                    goto label_6;
                }
                else
                {
                    goto label_11;
                }
            }while (false);
            return;

label_27:
            return;

label_11:
            bounds.Offset(0, 23);
            graphics.DrawString(text, font, (Brush)this.x54c190ae969c389d, (RectangleF)bounds, EverettRenderer.xc351c68a86733972);
            if (((vertical ? 1 : 0) & 0) == 0)
            {
                return;
            }
            goto label_18;
label_12:
            if (vertical)
            {
                bounds.Offset(0, 1);
                goto label_15;
            }
label_14:
            bounds.Offset(1, 0);
label_15:
            graphics.DrawImage(image, new Rectangle(bounds.Left, bounds.Top, image.Width, image.Height));
            goto label_5;
label_17:
            if (dockSide != DockSide.Left)
            {
                graphics.DrawLine(this.xa33e6094d9ed12d6, bounds.Left, bounds.Top, bounds.Left, bounds.Bottom);
            }
            else
            {
                goto label_19;
            }
label_18:
            if (false)
            {
                goto label_17;
            }
label_19:
            bounds.Inflate(-2, -2);
            goto label_12;
label_20:
            if (dockSide != DockSide.Right)
            {
                goto label_24;
            }
label_21:
            if (dockSide != DockSide.Bottom)
            {
                graphics.DrawLine(this.xa33e6094d9ed12d6, bounds.Left, bounds.Bottom, bounds.Right, bounds.Bottom);
                goto label_17;
            }
            else
            {
                goto label_17;
            }
label_24:
            graphics.DrawLine(this.xa33e6094d9ed12d6, bounds.Right, bounds.Top, bounds.Right, bounds.Bottom);
            if ((uint)vertical - (uint)vertical > uint.MaxValue)
            {
                goto label_5;
            }
            else
            {
                goto label_21;
            }
label_26:
            graphics.DrawLine(this.xa33e6094d9ed12d6, bounds.Left, bounds.Top, bounds.Right, bounds.Top);
            if (false)
            {
                if ((uint)vertical + (uint)vertical < 0U)
                {
                    goto label_12;
                }
                else
                {
                    goto label_14;
                }
            }
            else
            {
                goto label_20;
            }
        }
Example #33
0
 protected internal override void DrawCollapsedTab(Graphics graphics, Rectangle bounds, DockSide dockSide, Image image, string text, Font font, Color backColor, Color foreColor, DrawItemState state, bool vertical)
 {
     if ((state & DrawItemState.Selected) == DrawItemState.Selected)
         RenderHelper.smethod_5(graphics, bounds, dockSide, image, text, font, SystemBrushes.ControlText,
             SystemColors.ControlDarkDark, TabTextDisplay == TabTextDisplayMode.AllTabs);
     else
         RenderHelper.smethod_5(graphics, bounds, dockSide, image, text, font, SystemBrushes.ControlText,
             SystemColors.ControlDarkDark, TabTextDisplay == TabTextDisplayMode.AllTabs);
 }
Example #34
0
		public static void smethod_5(Graphics g, Rectangle bounds, DockSide dockSide, Image image, string text, Font font, Brush brush, Color color, bool bool_0)
		{
			smethod_6(g, bounds, dockSide, image, text, font, null, brush, color, bool_0);
		}
Example #35
0
        public void Split(DockSide direction)
        {
            if (!IsInContainer)
                throw new InvalidOperationException("A window cannot be split while it is not hosted in a DockContainer.");
            if (LayoutSystem.Controls.Count < 2)
                throw new InvalidOperationException("A minimum of 2 windows need to be present in a tab group before one can be split off. Check LayoutSystem.Controls.Count before calling this method.");
            if (direction == DockSide.None)
                throw new ArgumentException("direction");

            var layoutSystem = LayoutSystem;
            LayoutUtilities.smethod_11(this);
            var newLayoutSystem = layoutSystem.DockContainer.CreateNewLayoutSystem(this, LayoutSystem.WorkingSize);
            layoutSystem.SplitForLayoutSystem(newLayoutSystem, direction);
            Activate();
        }
Example #36
0
        public static void x36c79cea8e98cf3c(
            Graphics x41347a961b838962,
            Rectangle xda73fcb97c77d998,
            DockSide xf33779c598cac695,
            Image xe058541ca798c059,
            string xb41faee6912a2313,
            Font x26094932cf7a9139,
            Brush x6f967439eb9e4ffb,
            Brush x4fe4e32776bbc2b0,
            Color xa1359fb73f86c7a4,
            bool x96c7dce50f0f3286)
        {
            bool flag = false;

label_36:
            System.Drawing.Point[] points = new System.Drawing.Point[6];
            int num;

            switch (xf33779c598cac695)
            {
            case DockSide.Top:
                points[0] = new System.Drawing.Point(xda73fcb97c77d998.Left, xda73fcb97c77d998.Top);
                if ((uint)x96c7dce50f0f3286 <= uint.MaxValue)
                {
                    points[1] = new System.Drawing.Point(xda73fcb97c77d998.Right, xda73fcb97c77d998.Top);
                    points[2] = new System.Drawing.Point(xda73fcb97c77d998.Right, xda73fcb97c77d998.Bottom - 2);
                    points[3] = new System.Drawing.Point(xda73fcb97c77d998.Right - 2, xda73fcb97c77d998.Bottom);
                    goto label_28;
                }
                else
                {
                    goto default;
                }

            case DockSide.Bottom:
                points[0] = new System.Drawing.Point(xda73fcb97c77d998.Left + 2, xda73fcb97c77d998.Top);
                points[1] = new System.Drawing.Point(xda73fcb97c77d998.Right - 2, xda73fcb97c77d998.Top);
                goto label_26;

            case DockSide.Left:
                points[0] = new System.Drawing.Point(xda73fcb97c77d998.Left, xda73fcb97c77d998.Top);
                points[1] = new System.Drawing.Point(xda73fcb97c77d998.Right - 2, xda73fcb97c77d998.Top);
                points[2] = new System.Drawing.Point(xda73fcb97c77d998.Right, xda73fcb97c77d998.Top + 2);
                points[3] = new System.Drawing.Point(xda73fcb97c77d998.Right, xda73fcb97c77d998.Bottom - 2);
                points[4] = new System.Drawing.Point(xda73fcb97c77d998.Right - 2, xda73fcb97c77d998.Bottom);
                points[5] = new System.Drawing.Point(xda73fcb97c77d998.Left, xda73fcb97c77d998.Bottom);
                if ((uint)num - (uint)x96c7dce50f0f3286 >= 0U)
                {
                    if ((uint)flag + (uint)x96c7dce50f0f3286 >= 0U)
                    {
                        flag = true;
                        goto default;
                    }
                    else
                    {
                        goto label_26;
                    }
                }
                else
                {
                    goto label_8;
                }

            case DockSide.Right:
                points[0] = new System.Drawing.Point(xda73fcb97c77d998.Left + 2, xda73fcb97c77d998.Top);
                if (true)
                {
                    points[1] = new System.Drawing.Point(xda73fcb97c77d998.Right, xda73fcb97c77d998.Top);
                    points[2] = new System.Drawing.Point(xda73fcb97c77d998.Right, xda73fcb97c77d998.Bottom);
                    if (true)
                    {
                        points[3] = new System.Drawing.Point(xda73fcb97c77d998.Left + 2, xda73fcb97c77d998.Bottom);
                        points[4] = new System.Drawing.Point(xda73fcb97c77d998.Left, xda73fcb97c77d998.Bottom - 2);
                        points[5] = new System.Drawing.Point(xda73fcb97c77d998.Left, xda73fcb97c77d998.Top + 2);
                        flag      = true;
                        goto default;
                    }
                    else
                    {
                        goto default;
                    }
                }
                else
                {
                    goto label_40;
                }

            default:
label_18:
                if (x6f967439eb9e4ffb != null)
                {
                    x41347a961b838962.FillPolygon(x6f967439eb9e4ffb, points);
                }
                do
                {
                    using (Pen pen = new Pen(xa1359fb73f86c7a4))
                        x41347a961b838962.DrawPolygon(pen, points);
                    xda73fcb97c77d998.Inflate(-2, -2);
                    if ((uint)x96c7dce50f0f3286 - (uint)x96c7dce50f0f3286 < 0U)
                    {
                        goto label_17;
                    }
                }while ((uint)num > uint.MaxValue);
                if (flag)
                {
                    goto label_16;
                }
                else
                {
                    goto label_12;
                }
label_9:
                x41347a961b838962.DrawImage(xe058541ca798c059, new Rectangle(xda73fcb97c77d998.Left, xda73fcb97c77d998.Top, xe058541ca798c059.Width, xe058541ca798c059.Height));
                break;
label_12:
                if ((uint)x96c7dce50f0f3286 - (uint)num >= 0U)
                {
                    xda73fcb97c77d998.Offset(1, 0);
                    goto label_9;
                }
                else
                {
                    goto label_28;
                }
label_16:
                xda73fcb97c77d998.Offset(0, 1);
                goto label_9;
            }
label_3:
            if (xb41faee6912a2313.Length == 0)
            {
                if ((uint)flag >= 0U)
                {
                    return;
                }
            }
            else
            {
                goto label_10;
            }
label_6:
            xda73fcb97c77d998.Offset(0, num);
            if (((x96c7dce50f0f3286 ? 1 : 0) | -2) != 0)
            {
                x41347a961b838962.DrawString(xb41faee6912a2313, x26094932cf7a9139, x4fe4e32776bbc2b0, (RectangleF)xda73fcb97c77d998, EverettRenderer.xc351c68a86733972);
            }
            else
            {
                goto label_18;
            }
label_8:
            if ((uint)num + (uint)flag >= 0U)
            {
                return;
            }
label_10:
            num = !x96c7dce50f0f3286 ? 23 : 21;
            if (!flag)
            {
                xda73fcb97c77d998.Offset(num, 0);
                if ((num | (int)byte.MaxValue) != 0)
                {
                    goto label_40;
                }
                else
                {
                    goto label_36;
                }
            }
            else
            {
                goto label_6;
            }
label_17:
            points[5] = new System.Drawing.Point(xda73fcb97c77d998.Left, xda73fcb97c77d998.Top + 2);
            goto label_18;
label_26:
            points[2] = new System.Drawing.Point(xda73fcb97c77d998.Right, xda73fcb97c77d998.Top + 2);
            points[3] = new System.Drawing.Point(xda73fcb97c77d998.Right, xda73fcb97c77d998.Bottom);
            points[4] = new System.Drawing.Point(xda73fcb97c77d998.Left, xda73fcb97c77d998.Bottom);
            goto label_17;
label_28:
            points[4] = new System.Drawing.Point(xda73fcb97c77d998.Left + 2, xda73fcb97c77d998.Bottom);
            points[5] = new System.Drawing.Point(xda73fcb97c77d998.Left, xda73fcb97c77d998.Bottom - 2);
            goto label_18;
label_40:
            if (false)
            {
                return;
            }
            if ((uint)num >= 0U)
            {
                x41347a961b838962.DrawString(xb41faee6912a2313, x26094932cf7a9139, x4fe4e32776bbc2b0, (RectangleF)xda73fcb97c77d998, EverettRenderer.x27e1c82c97265861);
            }
            else
            {
                goto label_3;
            }
        }
Example #37
0
 protected internal abstract void DrawCollapsedTab(Graphics graphics, Rectangle bounds, DockSide dockSide, Image image, string text, Font font, Color backColor, Color foreColor, DrawItemState state, bool vertical);
Example #38
0
        internal IDockView FindChildByLevel(int level, DockSide side)
        {
            IDockView view = _rootGroupPanel;

            while (level > 0)
            {
                level--;
                if (view is BaseGroupControl)
                {
                    break;
                }
                if (view is LayoutGroupPanel)
                {
                    var panel = (view as LayoutGroupPanel);
                    if (panel.Direction == Direction.None)
                    {
                        break;
                    }
                    if (panel.Direction == Direction.LeftToRight)
                    {
                        if (side == DockSide.Top || side == DockSide.Bottom)
                        {
                            break;
                        }
                        if (side == DockSide.Left)
                        {
                            var child = panel.Children[0];
                            if (child is LayoutDocumentGroupControl)
                            {
                                break;
                            }
                            view = child as IDockView;
                        }
                        if (side == DockSide.Right)
                        {
                            var child = panel.Children[panel.Count - 1];
                            if (child is LayoutDocumentGroupControl)
                            {
                                break;
                            }
                            view = child as IDockView;
                        }
                    }
                    else
                    {
                        if (side == DockSide.Left || side == DockSide.Right)
                        {
                            break;
                        }
                        if (side == DockSide.Top)
                        {
                            var child = panel.Children[0];
                            if (child is LayoutDocumentGroupControl)
                            {
                                break;
                            }
                            view = child as IDockView;
                        }
                        if (side == DockSide.Bottom)
                        {
                            var child = panel.Children[panel.Count - 1];
                            if (child is LayoutDocumentGroupControl)
                            {
                                break;
                            }
                            view = child as IDockView;
                        }
                    }
                }
            }
            return(view);
        }
Example #39
0
 internal Rectangle method_20(DockContainer container, ControlLayoutSystem layoutSystem, DockSide dockSide)
 {
     var result = new Rectangle(container.PointToScreen(layoutSystem.Bounds.Location), layoutSystem.Bounds.Size);
     switch (dockSide)
     {
         case DockSide.Top:
             result.Height /= 2;
             break;
         case DockSide.Bottom:
             result.Offset(0, result.Height / 2);
             result.Height /= 2;
             break;
         case DockSide.Left:
             result.Width /= 2;
             break;
         case DockSide.Right:
             result.Offset(result.Width / 2, 0);
             result.Width /= 2;
             break;
     }
     return result;
 }
Example #40
0
		protected internal override void DrawCollapsedTab(Graphics graphics, Rectangle bounds, DockSide dockSide, Image image, string text, Font font, Color backColor, Color foreColor, DrawItemState state, bool vertical)
		{
			if (dockSide != DockSide.Left && dockSide != DockSide.Right)
			{
				RenderHelper.smethod_5(graphics, bounds, dockSide, image, text, font, SystemBrushes.ControlDarkDark, SystemColors.ControlDark, TabTextDisplay == TabTextDisplayMode.AllTabs);
			}
			else
			{
				using (Image image2 = new Bitmap(image))
				{
					image2.RotateFlip(RotateFlipType.Rotate90FlipNone);
					RenderHelper.smethod_5(graphics, bounds, dockSide, image2, text, font, SystemBrushes.ControlDarkDark, SystemColors.ControlDark, TabTextDisplay == TabTextDisplayMode.AllTabs);
				}
			}
		}
Example #41
0
 private void method_19(DockContainer container, ControlLayoutSystem layoutSystem, DockTarget dockTarget, DockSide dockSide)
 {
     dockTarget.Bounds = method_20(container, layoutSystem, dockSide);
     dockTarget.DockSide = dockSide;
 }
Example #42
0
        public virtual void WriteXml(System.Xml.XmlWriter writer)
        {
            if (!string.IsNullOrWhiteSpace(Title))
            {
                writer.WriteAttributeString("Title", Title);
            }

            //if (IconSource != null)
            //    writer.WriteAttributeString("IconSource", IconSource.ToString());

            if (IsSelected)
            {
                writer.WriteAttributeString("IsSelected", IsSelected.ToString());
            }

            if (IsLastFocusedDocument)
            {
                writer.WriteAttributeString("IsLastFocusedDocument", IsLastFocusedDocument.ToString());
            }

            if (!string.IsNullOrWhiteSpace(ContentId))
            {
                writer.WriteAttributeString("ContentId", ContentId);
            }


            if (ToolTip != null && ToolTip is string)
            {
                if (!string.IsNullOrWhiteSpace((string)ToolTip))
                {
                    writer.WriteAttributeString("ToolTip", (string)ToolTip);
                }
            }

            if (FloatingLeft != 0.0)
            {
                writer.WriteAttributeString("FloatingLeft", FloatingLeft.ToString(CultureInfo.InvariantCulture));
            }
            if (FloatingTop != 0.0)
            {
                writer.WriteAttributeString("FloatingTop", FloatingTop.ToString(CultureInfo.InvariantCulture));
            }
            if (FloatingWidth != 0.0)
            {
                writer.WriteAttributeString("FloatingWidth", FloatingWidth.ToString(CultureInfo.InvariantCulture));
            }
            if (FloatingHeight != 0.0)
            {
                writer.WriteAttributeString("FloatingHeight", FloatingHeight.ToString(CultureInfo.InvariantCulture));
            }

            if (IsMaximized)
            {
                writer.WriteAttributeString("IsMaximized", IsMaximized.ToString());
            }
            if (!CanClose)
            {
                writer.WriteAttributeString("CanClose", CanClose.ToString());
            }
            if (!CanFloat)
            {
                writer.WriteAttributeString("CanFloat", CanFloat.ToString());
            }
            if (!GarbageCollectible)
            {
                writer.WriteAttributeString("GarbageCollectible", GarbageCollectible.ToString());
            }

            if (LastActivationTimeStamp != null)
            {
                writer.WriteAttributeString("LastActivationTimeStamp", LastActivationTimeStamp.Value.ToString(CultureInfo.InvariantCulture));
            }

            if (_previousContainer != null)
            {
                var paneSerializable = _previousContainer as ILayoutPaneSerializable;
                if (paneSerializable != null)
                {
                    writer.WriteAttributeString("PreviousContainerId", paneSerializable.Id);
                    writer.WriteAttributeString("PreviousContainerIndex", _previousContainerIndex.ToString());
                }
            }

            writer.WriteAttributeString("DockSide", DockSide.ToString());
        }
Example #43
0
 public void OpenBeside(DockControl existingWindow, DockSide side)
 {
     if (existingWindow == null)
         throw new ArgumentNullException();
     if (existingWindow == this)
         return;
     if (existingWindow.DockSituation == DockSituation.None)
         throw new InvalidOperationException("The specified window is not open.");
     Remove();
     existingWindow.LayoutSystem.SplitForLayoutSystem(new ControlLayoutSystem(MetaData.DockedState.Size, new[] { this }, this), side);
 }
Example #44
0
		public static void smethod_6(Graphics g, Rectangle bounds, DockSide dockSide, Image image, string text, Font font, Brush brush, Brush brush_1, Color color_0, bool allTab)
		{
			bool vertical = false;
			Point[] array = new Point[6];
			switch (dockSide)
			{
			case DockSide.Top:
				array[0] = new Point(bounds.Left, bounds.Top);
				array[1] = new Point(bounds.Right, bounds.Top);
				array[2] = new Point(bounds.Right, bounds.Bottom - 2);
				array[3] = new Point(bounds.Right - 2, bounds.Bottom);
				array[4] = new Point(bounds.Left + 2, bounds.Bottom);
				array[5] = new Point(bounds.Left, bounds.Bottom - 2);
				break;
			case DockSide.Bottom:
				array[0] = new Point(bounds.Left + 2, bounds.Top);
				array[1] = new Point(bounds.Right - 2, bounds.Top);
				array[2] = new Point(bounds.Right, bounds.Top + 2);
				array[3] = new Point(bounds.Right, bounds.Bottom);
				array[4] = new Point(bounds.Left, bounds.Bottom);
				array[5] = new Point(bounds.Left, bounds.Top + 2);
				break;
			case DockSide.Left:
				array[0] = new Point(bounds.Left, bounds.Top);
				array[1] = new Point(bounds.Right - 2, bounds.Top);
				array[2] = new Point(bounds.Right, bounds.Top + 2);
				array[3] = new Point(bounds.Right, bounds.Bottom - 2);
				array[4] = new Point(bounds.Right - 2, bounds.Bottom);
				array[5] = new Point(bounds.Left, bounds.Bottom);
				vertical = true;
				break;
			case DockSide.Right:
				array[0] = new Point(bounds.Left + 2, bounds.Top);
				array[1] = new Point(bounds.Right, bounds.Top);
				array[2] = new Point(bounds.Right, bounds.Bottom);
				array[3] = new Point(bounds.Left + 2, bounds.Bottom);
				array[4] = new Point(bounds.Left, bounds.Bottom - 2);
				array[5] = new Point(bounds.Left, bounds.Top + 2);
				vertical = true;
				break;
			}
			if (brush != null)
			{
				g.FillPolygon(brush, array);
			}
			using (var pen = new Pen(color_0))
			{
				g.DrawPolygon(pen, array);
			}
			bounds.Inflate(-2, -2);
			if (vertical)
			{
				bounds.Offset(0, 1);
			}
			else
			{
				bounds.Offset(1, 0);
			}
			g.DrawImage(image, new Rectangle(bounds.Left, bounds.Top, image.Width, image.Height));
		    if (text.Length == 0) return;
		    var num = allTab ? 21 : 23;
		    if (vertical)
		    {
		        bounds.Offset(0, num);
		        g.DrawString(text, font, brush_1, bounds, EverettRenderer.VerticalTextFormat);
		    }
		    else
		    {
		        bounds.Offset(num, 0);
		        g.DrawString(text, font, brush_1, bounds, EverettRenderer.HorizontalTextFormat);
		    }
		}