/// <summary> /// Create a new check item with initial settings. /// </summary> /// <param name="page">Page for which the check button is to be created.</param> /// <param name="orientation">Initial orientation of the check button.</param> protected override INavCheckItem CreateCheckItem(KryptonPage page, VisualOrientation orientation) { // Create a check button view element ViewDrawNavRibbonTab ribbonTab = new ViewDrawNavRibbonTab(Navigator, page); // Convert the button orientation to the appropriate visual orientations VisualOrientation orientBackBorder = ConvertButtonBorderBackOrientation(); VisualOrientation orientContent = ConvertButtonContentOrientation(); // Set the correct initial orientation of the button ribbonTab.SetOrientation(orientBackBorder, orientContent); return(ribbonTab); }
/// <summary> /// Create a new check item with initial settings. /// </summary> /// <param name="page">Page for which the check button is to be created.</param> /// <param name="orientation">Initial orientation of the check button.</param> protected override INavCheckItem CreateCheckItem(KryptonPage page, VisualOrientation orientation) { // Create a check button view element ViewDrawNavRibbonTab ribbonTab = new ViewDrawNavRibbonTab(Navigator, page); // Convert the button orientation to the appropriate visual orientations VisualOrientation orientBackBorder = ConvertButtonBorderBackOrientation(); VisualOrientation orientContent = ConvertButtonContentOrientation(); // Set the correct initial orientation of the button ribbonTab.SetOrientation(orientBackBorder, orientContent); return ribbonTab; }
private void RenderChildren(RenderContext context, bool drawChecked) { IEnumerable <ViewBase> orderedChildren; // Use tab style to decide what order the children are drawn in if (context.Renderer.RenderTabBorder.GetTabBorderLeftDrawing(TabBorderStyle)) { orderedChildren = this; } else { orderedChildren = this.Reverse(); } // Ask each child to render in turn foreach (ViewBase child in orderedChildren) { // Only render visible children that are inside the clipping rectangle if (child.Visible && child.ClientRectangle.IntersectsWith(context.ClipRect)) { // If this is a page representation that can overlap group border ViewDrawNavCheckButtonBar buttonBar = child as ViewDrawNavCheckButtonBar; ViewDrawNavRibbonTab tab = child as ViewDrawNavRibbonTab; if ((buttonBar != null) || (tab != null)) { bool itemChecked = buttonBar?.Checked ?? tab.Checked; // Are we allowed to draw the checked item? if ((!itemChecked && !drawChecked) || (itemChecked && drawChecked)) { child.Render(context); } } else { if (!drawChecked) { child.Render(context); } } } } }