internal override float GetItemOffset(RectangleF clientRect, PageViewItemSizeInfo sizeInfo, float proposedOffset) { int itemSpacing = this.layoutInfo.itemSpacing; ExplorerBarItemSizeInfo itemSizeInfo = sizeInfo as ExplorerBarItemSizeInfo; SizeF contentSize = itemSizeInfo.contentSize; switch (this.layoutInfo.position) { case StackViewPosition.Bottom: case StackViewPosition.Top: proposedOffset += contentSize.Height; break; default: proposedOffset += contentSize.Width; break; } if (itemSizeInfo.IsExpanded) { proposedOffset -= itemSpacing; } ExplorerBarLayoutInfo info = this.layoutInfo as ExplorerBarLayoutInfo; info.fullLayoutLength = (int)proposedOffset; return(proposedOffset); }
protected List <ContentAreaLayoutInfo> GetContentAreaLayoutInfos(RectangleF clientRect) { RectangleF contentRectangle = Rectangle.Empty; ExplorerBarLayoutInfo explorerLayoutInfo = this.layoutInfo as ExplorerBarLayoutInfo; List <ContentAreaLayoutInfo> layoutInfos = new List <ContentAreaLayoutInfo>(); foreach (ExplorerBarItemSizeInfo sizeInfo in explorerLayoutInfo.items) { contentRectangle = this.GetContentWithSelectedContentRectangle(sizeInfo, clientRect); ContentAreaLayoutInfo info = new ContentAreaLayoutInfo(); info.AssociatedItem = sizeInfo.item; info.ContentAreaRectangle = contentRectangle; layoutInfos.Add(info); } return(layoutInfos); }
internal virtual float GetContentLength(ExplorerBarItemSizeInfo itemSizeInfo, float availableLength) { switch (this.ContentSizeMode) { case ExplorerBarContentSizeMode.FixedLength: return(itemSizeInfo.item.PageLength); case ExplorerBarContentSizeMode.AutoSizeToBestFit: if (Owner == null) { switch (this.layoutInfo.position) { case StackViewPosition.Top: return(itemSizeInfo.contentSize.Height); case StackViewPosition.Left: return(itemSizeInfo.contentSize.Width); } } else { Size contentMetrics = this.GetItemContentMetrics(itemSizeInfo); switch (this.layoutInfo.position) { case StackViewPosition.Top: return(contentMetrics.Height); case StackViewPosition.Left: return(contentMetrics.Width); } } break; case ExplorerBarContentSizeMode.EqualLength: float itemLength = this.layoutInfo.layoutLength; ExplorerBarLayoutInfo explorerLayoutInfo = this.layoutInfo as ExplorerBarLayoutInfo; return((availableLength - itemLength) / explorerLayoutInfo.expandedItemsCount); } return(availableLength); }
protected override RectangleF ArrangeContent(RectangleF clientRect) { List <ContentAreaLayoutInfo> layoutInfos = this.GetContentAreaLayoutInfos(clientRect); ExplorerBarLayoutInfo explLayoutInfo = this.layoutInfo as ExplorerBarLayoutInfo; explLayoutInfo.fullLayoutLength = explLayoutInfo.layoutLength; foreach (ContentAreaLayoutInfo contentAreaLayoutInfo in layoutInfos) { RadPageViewExplorerBarItem item = (contentAreaLayoutInfo.AssociatedItem as RadPageViewExplorerBarItem); RadPageViewContentAreaElement contentAreaElement = item.AssociatedContentAreaElement; contentAreaElement.Arrange(contentAreaLayoutInfo.ContentAreaRectangle); switch (explLayoutInfo.position) { case StackViewPosition.Top: explLayoutInfo.fullLayoutLength += contentAreaLayoutInfo.ContentAreaRectangle.Height; break; case StackViewPosition.Left: explLayoutInfo.fullLayoutLength += contentAreaLayoutInfo.ContentAreaRectangle.Width; break; } } this.OnContentBoundsChanged(); switch (explLayoutInfo.position) { case StackViewPosition.Top: if (this.Header.Visibility == ElementVisibility.Visible) { explLayoutInfo.fullLayoutLength += this.Header.Margin.Bottom; } if (this.Footer.Visibility == ElementVisibility.Visible) { explLayoutInfo.fullLayoutLength += this.Footer.Margin.Top; } break; } explLayoutInfo.fullLayoutLength -= explLayoutInfo.expandedItemsCount * explLayoutInfo.itemSpacing; return(clientRect); }
protected virtual void UpdateScrollbarMetrics(RectangleF clientRect) { ExplorerBarLayoutInfo explorerBarLayoutInfo = this.layoutInfo as ExplorerBarLayoutInfo; switch (explorerBarLayoutInfo.position) { case StackViewPosition.Top: this.scrollbar.LargeChange = (int)clientRect.Height; break; case StackViewPosition.Left: this.scrollbar.LargeChange = (int)clientRect.Width; break; } this.scrollbar.Minimum = 0; if (explorerBarLayoutInfo.fullLayoutLength != this.scrollbar.Maximum) { this.scrollbar.Maximum = (int)explorerBarLayoutInfo.fullLayoutLength; } }
protected virtual bool CheckShowScrollbar(RectangleF clientRect) { ExplorerBarLayoutInfo explorerBarLayoutInfo = this.layoutInfo as ExplorerBarLayoutInfo; switch (explorerBarLayoutInfo.position) { case StackViewPosition.Top: if (clientRect.Height < explorerBarLayoutInfo.fullLayoutLength) { return(true); } break; case StackViewPosition.Left: if (clientRect.Width < explorerBarLayoutInfo.fullLayoutLength) { return(true); } break; } return(false); }