Ejemplo n.º 1
0
 protected override void CreateChildElements()
 {
     this.elementProvider = this.CreateElementProvider();
     this.scroller        = this.CreateItemScroller();
     base.CreateChildElements();
     this.InitializeItemScroller(this.scroller);
     this.HScrollBar.Maximum = 0;
     this.WireEvents();
 }
Ejemplo n.º 2
0
        protected override SizeF MeasureOverride(SizeF availableSize)
        {
            RadTreeViewElement treeViewElement = this.TreeViewElement;

            SizeF desiredSize = base.MeasureOverride(availableSize);

            int oldHeight = this.Data.ActualSize.Height;
            int newHeight = this.ItemHeight;

            if (treeViewElement != null && ((this.Editor != null && newHeight < desiredSize.Height) || treeViewElement.AutoSizeItems))
            {
                newHeight = (int)desiredSize.Height;
                this.states[TreeNodeElement.UpdateScrollRangeIfNeeded] = true;
            }
            else
            {
                desiredSize.Height = newHeight;
            }

            if (treeViewElement != null && oldHeight != newHeight &&
                (this.states[TreeNodeElement.UpdateScrollRangeIfNeeded] ||
                 treeViewElement.AllowArbitraryItemHeight || treeViewElement.AutoSizeItems))
            {
                ItemScroller <RadTreeNode> scroller = treeViewElement.Scroller;
                this.Data.ActualSize = new Size(this.Data.ActualSize.Width, newHeight);
                scroller.UpdateScrollRange(scroller.Scrollbar.Maximum + (newHeight - oldHeight), false);
            }

            if (this.Editor == null)
            {
                this.states[TreeNodeElement.UpdateScrollRangeIfNeeded] = false;
            }

            if (!float.IsInfinity(availableSize.Width))
            {
                Size size = desiredSize.ToSize();
                this.Data.ActualSize = new Size(this.Data.ActualSize.Width, size.Height);
                desiredSize.Width    = availableSize.Width;
            }
            else if (!ContentElement.TextWrap && this.Editor == null)
            {
                this.Data.ActualSize = desiredSize.ToSize();
            }

            return(desiredSize);
        }
Ejemplo n.º 3
0
        protected override SizeF MeasureOverride(SizeF availableSize)
        {
            RadTreeViewElement treeViewElement = this.TreeViewElement;
            SizeF sizeF   = base.MeasureOverride(availableSize);
            int   height1 = this.Data.ActualSize.Height;
            int   height2 = this.ItemHeight;

            if (treeViewElement != null && (this.Editor != null && (double)height2 < (double)sizeF.Height || treeViewElement.AutoSizeItems))
            {
                height2         = (int)sizeF.Height;
                this.states[4L] = true;
            }
            else
            {
                sizeF.Height = (float)height2;
            }
            if (treeViewElement != null && height1 != height2 && (this.states[4L] || treeViewElement.AllowArbitraryItemHeight || treeViewElement.AutoSizeItems))
            {
                ItemScroller <RadTreeNode> scroller = treeViewElement.Scroller;
                this.Data.ActualSize = new Size(this.Data.ActualSize.Width, height2);
                scroller.UpdateScrollRange(scroller.Scrollbar.Maximum + (height2 - height1), false);
            }
            if (this.Editor == null)
            {
                this.states[4L] = false;
            }
            if (!float.IsInfinity(availableSize.Width))
            {
                this.Data.ActualSize = new Size(this.Data.ActualSize.Width, sizeF.ToSize().Height);
                sizeF.Width          = availableSize.Width;
            }
            else if (!this.ContentElement.TextWrap && this.Editor == null)
            {
                this.Data.ActualSize = sizeF.ToSize();
            }
            return(sizeF);
        }
Ejemplo n.º 4
0
 protected virtual void InitializeItemScroller(ItemScroller <Item> scroller)
 {
     this.scroller.Scrollbar        = this.VScrollBar;
     this.scroller.ElementProvider  = this.elementProvider;
     this.scroller.ScrollerUpdated += new EventHandler(this.scroller_ScrollerUpdated);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// This method provides a chance to setup the ItemScroller.
 /// </summary>
 /// <param name="scroller">The item scroller on which properties will be set.</param>
 protected virtual void InitializeItemScroller(ItemScroller <Item> scroller)
 {
     this.scroller.Scrollbar       = this.VScrollBar;
     this.scroller.ElementProvider = this.elementProvider;
 }