• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Toolkit.ViewLayoutContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ComponentFactory.Krypton.Toolkit.ViewLayoutContext的典型用法代码示例。如果您正苦于以下问题:C# ViewLayoutContext类的具体用法?C# ViewLayoutContext怎么用?C# ViewLayoutContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ViewLayoutContext类属于ComponentFactory.Krypton.Toolkit命名空间,在下文中一共展示了ViewLayoutContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Layout

        /// <summary>
        /// Perform a layout of the elements.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override void Layout(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // We take on all the available display area
            ClientRectangle = context.DisplayRectangle;

            // Are we allowed to layout child controls?
            if (!context.ViewManager.DoNotLayoutControls)
            {
                // Are we allowed to actually layout the pages?
                if (_navigator.InternalCanLayout)
                {
                    // Do not position the child panel if it is borrowed
                    if (!_navigator.IsChildPanelBorrowed)
                    {
                        // Position the child panel for showing page information
                        _navigator.ChildPanel.SetBounds(HIDDEN_OFFSET,
                                                        HIDDEN_OFFSET,
                                                        ClientWidth,
                                                        ClientHeight);
                    }
                }
            }
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:29,代码来源:ViewLayoutPageHide.cs


示例2: Layout

        /// <summary>
        /// Perform a layout of the elements.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override void Layout(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // We take on all the available display area
            ClientRectangle = context.DisplayRectangle;

            // Are we allowed to layout child controls?
            if (!context.ViewManager.DoNotLayoutControls)
            {
                // Are we allowed to actually layout the pages?
                if (_navigator.InternalCanLayout)
                {
                    // Update position of page if not already in correct position
                    if ((_page.Location != Point.Empty) ||
                        (_page.Width != ClientWidth) ||
                        (_page.Height != ClientHeight))
                    {
                        _page.SetBounds(0, 0, ClientWidth, ClientHeight);
                    }

                    // Update position of child panel if not already in correct position
                    if ((_navigator.ChildPanel.Location != ClientLocation) ||
                        (_navigator.ChildPanel.Width != ClientWidth) ||
                        (_navigator.ChildPanel.Height != ClientHeight))
                    {
                        // Position the child panel for showing page
                        _navigator.ChildPanel.SetBounds(ClientLocation.X,
                                                        ClientLocation.Y,
                                                        ClientWidth,
                                                        ClientHeight);
                    }
                }
            }
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:39,代码来源:ViewLayoutPopupPage.cs


示例3: Layout

        /// <summary>
        /// Perform a layout of the elements.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override void Layout(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // Validate incoming reference
            if (context == null) throw new ArgumentNullException("context");

            // We take on all the available display area
            ClientRectangle = context.DisplayRectangle;

            // Layout children from top to bottom with equal height and the total width
            int yOffset = 0;
            int childHeight = (ClientHeight / Count) + 1;
            foreach (ViewBase child in this)
            {
                // If this is the last child in collection...
                if (child == this[Count - 1])
                {
                    //...then give it all the remainder space
                    childHeight = ClientHeight - yOffset;
                }

                // Position the child
                context.DisplayRectangle = new Rectangle(ClientLocation.X, yOffset, ClientWidth, childHeight);
                child.Layout(context);

                // Move down to next position
                yOffset += (childHeight - 1);
            }

            // Put back the original display value now we have finished
            context.DisplayRectangle = ClientRectangle;
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:37,代码来源:ViewLayoutRibbonGalleryButtons.cs


示例4: GetPreferredSize

        /// <summary>
        /// Discover the preferred size of the element.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override Size GetPreferredSize(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // Ask the renderer for the required size of the drop down button
            return context.Renderer.RenderGlyph.GetDropDownButtonPreferredSize(context, _palette, State, Orientation);
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:11,代码来源:ViewDrawDropDownButton.cs


示例5: GetPreferredSize

        /// <summary>
        /// Discover the preferred size of the element.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override Size GetPreferredSize(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // Accumulate the stacked size
            Size preferredSize = Size.Empty;

            foreach (ViewBase child in this)
            {
                if (child.Visible)
                {
                    // Get the preferred size of the child
                    Size childSize = child.GetPreferredSize(context);

                    // Depending on orientation, add up child sizes
                    if (Horizontal)
                    {
                        preferredSize.Height = Math.Max(preferredSize.Height, childSize.Height);
                        preferredSize.Width += childSize.Width;
                    }
                    else
                    {
                        preferredSize.Height += childSize.Height;
                        preferredSize.Width = Math.Max(preferredSize.Width, childSize.Width);
                    }
                }
            }

            return preferredSize;
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:34,代码来源:ViewLayoutStack.cs


示例6: Layout

        /// <summary>
        /// Perform a layout of the elements.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override void Layout(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // We take on all the available display area
            ClientRectangle = context.DisplayRectangle;
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:11,代码来源:ViewDrawRibbonScrollButton.cs


示例7: GetPreferredSize

        /// <summary>
        /// Discover the preferred size of the element.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override Size GetPreferredSize(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // We are a null leaf, so have no size
            return Size.Empty;
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:11,代码来源:ViewLayoutNull.cs


示例8: GetPreferredSize

        public override Size GetPreferredSize(ViewLayoutContext context)
        {
            Size preferredSize = Size.Empty;

            // We need an owning form to perform calculations
            if (_ownerForm != null)
            {
                // We only have size if custom chrome is being used with composition
                if (_ownerForm.ApplyCustomChrome && _ownerForm.ApplyComposition)
                {
                    try
                    {
                        // Create structure that will be populated by call to WM_GETTITLEBARINFOEX
                        PI.TITLEBARINFOEX tbi = new PI.TITLEBARINFOEX();
                        tbi.cbSize = (uint)Marshal.SizeOf(tbi);

                        // Ask the window for the title bar information
                        PI.SendMessage(_ownerForm.Handle, PI.WM_GETTITLEBARINFOEX, IntPtr.Zero, ref tbi);

                        // Find width of the button rectangle
                        int closeWidth = tbi.rcCloseButton.right - tbi.rcCloseButton.left;
                        int helpWidth = tbi.rcHelpButton.right - tbi.rcHelpButton.left;
                        int minWidth = tbi.rcMinButton.right - tbi.rcMinButton.left;
                        int maxWidth = tbi.rcMaxButton.right - tbi.rcMaxButton.left;

                        int clientWidth = _ownerForm.ClientSize.Width;
                        int clientScreenRight = _ownerForm.RectangleToScreen(_ownerForm.ClientRectangle).Right;
                        int leftMost = clientScreenRight;

                        // Find the left most button edge (start with right side of client area)
                        if ((closeWidth > 0) && (closeWidth < clientWidth))
                            leftMost = Math.Min(leftMost, tbi.rcCloseButton.left);

                        if ((helpWidth > 0) && (helpWidth < clientWidth))
                            leftMost = Math.Min(leftMost, tbi.rcHelpButton.left);

                        if ((minWidth > 0) && (minWidth < clientWidth))
                            leftMost = Math.Min(leftMost, tbi.rcMinButton.left);

                        if ((maxWidth > 0) && (maxWidth < clientWidth))
                            leftMost = Math.Min(leftMost, tbi.rcMaxButton.left);

                        // Our width is the distance between the left most button edge and the right
                        // side of the client area (this space the buttons are taking up). Plus a small
                        // extra gap between the first button and the caption elements to its left.
                        _width = (clientScreenRight - leftMost) + SPACING_GAP;

                        preferredSize.Width = _width;
                    }
                    catch(ObjectDisposedException)
                    {
                        // Asking for the WM_GETTITLEBARINFOEX can cause exception if the form level
                        // Icon has already been disposed. This happens in rare circumstances.
                    }
                }
            }

            return preferredSize;
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:59,代码来源:ViewDrawRibbonCompoRightBorder.cs


示例9: Layout

        /// <summary>
        /// Perform a layout of the elements.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override void Layout(ViewLayoutContext context)
        {
            // Make all stacking items that should be visible are visible
            ViewBuilder.UnshrinkAppropriatePages();

            // Let base class continue with standard layout
            base.Layout(context);
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:12,代码来源:ViewLayoutOutlookMini.cs


示例10: GetPreferredSize

        /// <summary>
        /// Discover the preferred size of the element.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override Size GetPreferredSize(ViewLayoutContext context)
        {
            // Get the preferred size of the contained content
            Size preferredSize = base.GetPreferredSize(context);

            // Add on the padding we need around edges
            return new Size(preferredSize.Width + _preferredPadding.Horizontal,
                            preferredSize.Height + _preferredPadding.Vertical);
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:13,代码来源:ViewLayoutRibbonPadding.cs


示例11: Layout

        /// <summary>
        /// Perform a layout of the elements.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override void Layout(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // Validate incoming reference
            if (context == null) throw new ArgumentNullException("context");

            // We take on all the available display area
            Rectangle original = context.DisplayRectangle;
            ClientRectangle = original;

            // Layout each child
            int offset = 0;
            int space = (_orientation == Orientation.Vertical ? ClientHeight : ClientWidth);
            for(int i=0; i<Count; i++)
            {
                ViewBase child = this[i];

                // Find length of this item
                int length = 0;

                // If this is the last item then it takes the remaining space
                if (i == (Count - 1))
                    length = space;
                else
                {
                    // Give this item an equal portion of the remainder
                    length = space / (Count - i);
                }

                // Ask child for it's own preferred size
                Size childPreferred = child.GetPreferredSize(context);

                // Size child to our relevant dimension
                if (_orientation == Orientation.Vertical)
                    context.DisplayRectangle = new Rectangle(ClientRectangle.X,
                                                             ClientRectangle.Y + offset,
                                                             childPreferred.Width,
                                                             length);
                else
                    context.DisplayRectangle = new Rectangle(ClientRectangle.X + offset,
                                                             ClientRectangle.Y,
                                                             length,
                                                             ClientRectangle.Height);

                // Ask the child to layout
                child.Layout(context);

                // Adjust running values
                offset += length;
                space -= length;
            }

            // Put back the original display value now we have finished
            context.DisplayRectangle = original;
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:60,代码来源:ViewLayoutFit.cs


示例12: GetPreferredSize

        /// <summary>
        /// Discover the preferred size of the element.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override Size GetPreferredSize(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // Get the sizing metric
            int length = _paletteMetric.GetMetricInt(ElementState, _metricInt);

            // Use the same size for vertical and horizontal
            return new Size(length, length);
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:14,代码来源:ViewLayoutMetricSpacer.cs


示例13: Layout

        /// <summary>
        /// Perform a layout of the elements.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override void Layout(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // Get the sizing metric
            int length = _paletteMetric.GetMetricInt(ElementState, _metricInt);

            // Always use the metric and ignore given space
            ClientRectangle = new Rectangle(context.DisplayRectangle.Location, new Size(length, length));
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:14,代码来源:ViewLayoutMetricSpacer.cs


示例14: Layout

        /// <summary>
        /// Perform a layout of the elements.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override void Layout(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // We take on all the available display area
            ClientRectangle = context.DisplayRectangle;

            // Ensure all children are layed out in our total space
            base.Layout(context);
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:14,代码来源:ViewDrawMenuImageColumn.cs


示例15: Layout

        /// <summary>
        /// Perform a layout of the elements.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override void Layout(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // We take on all the available display area
            ClientRectangle = context.DisplayRectangle;

            // Put back the original display value now we have finished
            context.DisplayRectangle = ClientRectangle;
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:14,代码来源:ViewLayoutWeekCorner.cs


示例16: Layout

        /// <summary>
        /// Perform a layout of the elements.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override void Layout(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // Validate incoming reference
            if (context == null) throw new ArgumentNullException("context");

            // We take on all the available display area
            ClientRectangle = context.DisplayRectangle;
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:14,代码来源:ViewLayoutRibbonTabsSpare.cs


示例17: GetPreferredSize

        /// <summary>
        /// Discover the preferred size of the element.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override Size GetPreferredSize(ViewLayoutContext context)
        {
            // Get size of the contained items
            Size preferredSize = base.GetPreferredSize(context);

            // Add on the border padding
            preferredSize = CommonHelper.ApplyPadding(Orientation.Horizontal, preferredSize, _borderPadding);
            preferredSize.Height = Math.Max(preferredSize.Height, QAT_HEIGHT_FULL);

            return preferredSize;
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:15,代码来源:ViewDrawRibbonQATOverflow.cs


示例18: GetPreferredSize

        /// <summary>
        /// Discover the preferred size of the element.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override Size GetPreferredSize(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // Start with size needed to draw a week number
            Size retSize = new Size(_months.SizeDay.Width, _months.SizeDays.Height);

            // Add the width of the vertical border
            retSize.Width += _palette.GetBorderWidth(State);

            return retSize;
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:16,代码来源:ViewLayoutWeekCorner.cs


示例19: Layout

        /// <summary>
        /// Perform a layout of the elements.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override void Layout(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // We take on all the available display area
            ClientRectangle = context.DisplayRectangle;

            // Let base class layout the children
            base.Layout(context);

            // Put back the original size before returning
            context.DisplayRectangle = ClientRectangle;
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:17,代码来源:ViewDrawMenuColorColumn.cs


示例20: GetPreferredSize

        /// <summary>
        /// Discover the preferred size of the element.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override Size GetPreferredSize(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // Ask base class to find preferred size of all children
            Size preferredSize = base.GetPreferredSize(context);

            // Add on the display padding
            preferredSize.Width += _displayPadding.Horizontal;
            preferredSize.Height += _displayPadding.Vertical;

            return preferredSize;
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:17,代码来源:ViewLayoutPadding.cs



注:本文中的ComponentFactory.Krypton.Toolkit.ViewLayoutContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Security.EntityToken类代码示例发布时间:2022-05-24
下一篇:
C# Toolkit.RenderContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap