コード例 #1
0
        protected override SizeF ArrangeOverride(SizeF finalSize)
        {
            SizeF arrowButtonDesiredSize = this.arrowButton != null ? this.arrowButton.DesiredSize : SizeF.Empty;

            for (int i = 0; i < this.Children.Count; i++)
            {
                RadElement child = this.Children[i];
                if (this.arrowButton != null && object.ReferenceEquals(child, this.arrowButton))
                {
                    float      arrowLeftPos = this.RightToLeft ? 0 : finalSize.Width - arrowButtonDesiredSize.Width;
                    RectangleF arrowArea    = new RectangleF(arrowLeftPos, 0, arrowButtonDesiredSize.Width, finalSize.Height);
                    child.Arrange(arrowArea);
                }
                else if (this.content != null && object.ReferenceEquals(child, this.content))
                {
                    float      contentLeftPos = this.RightToLeft ? arrowButtonDesiredSize.Width : 0;
                    RectangleF arrowArea      = new RectangleF(contentLeftPos, 0, finalSize.Width - arrowButtonDesiredSize.Width, finalSize.Height);
                    child.Arrange(arrowArea);
                }
                else
                {
                    child.Arrange(new RectangleF(PointF.Empty, finalSize));
                }
            }
            return(finalSize);
        }
コード例 #2
0
 protected virtual void ArrangeElement(
     RadElement element,
     SizeF finalSize,
     RectangleF clientRect)
 {
     if (element.FitToSizeMode == RadFitToSizeMode.FitToParentBounds)
     {
         element.Arrange(new RectangleF((PointF)Point.Empty, finalSize));
     }
     else if (element.FitToSizeMode == RadFitToSizeMode.FitToParentPadding)
     {
         element.Arrange(new RectangleF((float)this.BorderThickness.Left, (float)this.BorderThickness.Top, finalSize.Width - (float)this.BorderThickness.Horizontal, finalSize.Height - (float)this.BorderThickness.Vertical));
     }
     else
     {
         RectangleF finalRect = new RectangleF(clientRect.Left, clientRect.Top, Math.Min(clientRect.Width, element.DesiredSize.Width), Math.Min(clientRect.Height, element.DesiredSize.Height));
         if (element.StretchHorizontally || (double)finalRect.Width == 0.0 && element.Visibility != ElementVisibility.Collapsed)
         {
             finalRect.Width = clientRect.Width;
         }
         if (element.StretchVertically || (double)finalRect.Height == 0.0 && element.Visibility != ElementVisibility.Collapsed)
         {
             finalRect.Height = clientRect.Height;
         }
         element.Arrange(finalRect);
     }
 }
コード例 #3
0
        protected override SizeF ArrangeOverride(SizeF finalSize)
        {
            if (!EnsureBodyOrCheckElements())
            {
                return(base.ArrangeOverride(finalSize));
            }

            if ((checkElement != null) && (bodyElement != null))
            {
                LayoutCheckmark(new RectangleF(PointF.Empty, finalSize), true);
            }
            else
            {
                if (checkElement != null)
                {
                    checkElement.Arrange(new RectangleF(new PointF(0, 0), checkElement.DesiredSize));
                }

                if (bodyElement != null)
                {
                    bodyElement.Arrange(new RectangleF(new PointF(0, 0), bodyElement.DesiredSize));
                }
            }

            return(finalSize);
        }
コード例 #4
0
        protected override SizeF ArrangeOverride(SizeF finalSize)
        {
            RadElementCollection children = this.Children;

            int x = 0;
            int y = 0;

            for (int i = 0; i < children.Count; i++)
            {
                RadElement child = children[i];
                SizeF      elementPrefferedSize = child.DesiredSize;
                elementPrefferedSize.Width  = Math.Max(elementPrefferedSize.Width, this.defaultCellSize.Width);
                elementPrefferedSize.Height = Math.Max(elementPrefferedSize.Height, this.defaultCellSize.Height);
                PointF elementPosition = new PointF(x * this.defaultCellSize.Width, y * this.defaultCellSize.Height);
                elementPosition.X += (this.defaultCellSize.Width - elementPrefferedSize.Width) / 2;
                elementPosition.Y += (this.defaultCellSize.Height - elementPrefferedSize.Height) / 2;

                child.Arrange(new RectangleF(elementPosition, elementPrefferedSize));

                if (x < this.columns - 1)
                {
                    x++;
                }
                else
                {
                    x = 0;
                    y++;
                }
            }

            return(finalSize);
        }
コード例 #5
0
        public Bitmap GetAsBitmapEx(bool doArrangeAndMeasure, RadElement element, SizeF availableSize, SizeF finalSize, Brush brush, float totalAngle, SizeF totalScale)
        {
            RadElement parent = element.Parent;
            int        indexInChildrenCollection = -1;

            if (parent != null)
            {
                indexInChildrenCollection = parent.Children.IndexOf(element);
            }

            this.RootElement.Children.Add(element);

            if (doArrangeAndMeasure)
            {
                element.ResetLayout(true);
                element.Measure(availableSize);
                element.Arrange(new RectangleF(new PointF(0, 0), finalSize));
            }

            Bitmap bitmap = element.GetAsBitmapEx(brush, totalAngle, totalScale);

            //add the element to its previous parent (it will be automatically removed from its current parent)
            if (parent != null)
            {
                parent.Children.Insert(indexInChildrenCollection, element);
            }
            else
            {
                this.RootElement.Children.Remove(element);
            }

            return(bitmap);
        }
コード例 #6
0
        protected override SizeF ArrangeOverride(SizeF finalSize)
        {
            if (this.IsChildViewVisible)
            {
                finalSize.Height -= (float)this.childTableElement.ViewInfo.ExpandedHeight;
            }
            RectangleF clientRectangle = this.GetClientRectangle(finalSize);

            this.Layout.Arrange(clientRectangle);
            RadElement radElement1 = (RadElement)this.leftPinnedColumns;
            RadElement radElement2 = (RadElement)this.rightPinnedColumns;

            if (this.RightToLeft)
            {
                radElement1 = (RadElement)this.rightPinnedColumns;
                radElement2 = (RadElement)this.leftPinnedColumns;
            }
            float x1 = 0.0f;

            radElement1.Arrange(new RectangleF(x1, 0.0f, radElement1.DesiredSize.Width, finalSize.Height));
            if ((double)radElement1.DesiredSize.Width > 0.0)
            {
                x1 += radElement1.DesiredSize.Width + (float)this.tableElement.CellSpacing;
            }
            this.scrollableColumns.Arrange(new RectangleF(x1, 0.0f, this.scrollableColumns.DesiredSize.Width, finalSize.Height));
            float x2 = x1 + (this.scrollableColumns.DesiredSize.Width + (float)this.tableElement.CellSpacing);

            radElement2.Arrange(new RectangleF(x2, 0.0f, radElement2.DesiredSize.Width, finalSize.Height));
            if (this.IsChildViewVisible)
            {
                this.detailsElement.Arrange(new RectangleF(clientRectangle.Left, clientRectangle.Bottom, clientRectangle.Width, (float)this.childTableElement.ViewInfo.ExpandedHeight));
                finalSize.Height += (float)this.childTableElement.ViewInfo.ExpandedHeight;
            }
            return(finalSize);
        }
コード例 #7
0
        protected virtual void ArrangeSelfReferencePanel(SizeF finalSize, ref RectangleF clientRect)
        {
            RadElement stackLayoutElement = (RadElement)this.SelfReferenceLayout.StackLayoutElement;
            int        width      = (int)this.SelfReferenceLayout.StackLayoutElement.DesiredSize.Width;
            RectangleF rectangleF = clientRect;

            rectangleF.Width = (float)width;
            if (stackLayoutElement.FitToSizeMode == RadFitToSizeMode.FitToParentBounds)
            {
                rectangleF.Location = (PointF)(this.RightToLeft ? new Point((int)((double)clientRect.Right - (double)width), 0) : Point.Empty);
                rectangleF.Height   = finalSize.Height;
                stackLayoutElement.Arrange(rectangleF);
            }
            else
            {
                if (this.RightToLeft)
                {
                    rectangleF.X = clientRect.Right - (float)width;
                }
                this.ArrangeElement(stackLayoutElement, finalSize, rectangleF);
            }
            if (this.RightToLeft)
            {
                clientRect.Width -= (float)width;
            }
            else
            {
                clientRect.X     += (float)width;
                clientRect.Width -= (float)width;
            }
        }
コード例 #8
0
        public Bitmap GetAsBitmapEx(
            bool doArrangeAndMeasure,
            RadElement element,
            SizeF availableSize,
            SizeF finalSize,
            Brush brush,
            float totalAngle,
            SizeF totalScale)
        {
            RadElement parent = element.Parent;
            int        index  = -1;

            if (parent != null)
            {
                index = parent.Children.IndexOf(element);
            }
            this.RootElement.Children.Add(element);
            if (doArrangeAndMeasure)
            {
                element.ResetLayout(true);
                element.Measure(availableSize);
                element.Arrange(new RectangleF(new PointF(0.0f, 0.0f), finalSize));
            }
            Bitmap asBitmapEx = element.GetAsBitmapEx(brush, totalAngle, totalScale);

            if (parent != null)
            {
                parent.Children.Insert(index, element);
            }
            else
            {
                this.RootElement.Children.Remove(element);
            }
            return(asBitmapEx);
        }
コード例 #9
0
 protected virtual RectangleF ArrangeElementCore(
     RadElement element,
     SizeF finalSize,
     RectangleF arrangeRect)
 {
     element.Arrange(arrangeRect);
     return(arrangeRect);
 }
コード例 #10
0
ファイル: RootRadElement.cs プロジェクト: configare/hispeed
 protected override SizeF ArrangeOverride(SizeF finalSize)
 {
     for (int i = 0; i < this.Children.Count; i++)
     {
         RadElement child = this.Children[i];
         child.Arrange(new RectangleF(PointF.Empty, finalSize));
     }
     return(finalSize);
 }
コード例 #11
0
 protected virtual void ArrangeElement(RadElement element, RectangleF clientRect, RectangleF finalRect, SizeF finalSize)
 {
     if (element.FitToSizeMode == RadFitToSizeMode.FitToParentBounds && Orientation == System.Windows.Forms.Orientation.Horizontal)
     {
         finalRect.X     -= this.Padding.Left + this.GetBorderThickness(true).Left;
         finalRect.Height = finalSize.Height;
         finalRect.Y      = 0;
     }
     element.Arrange(finalRect);
 }
コード例 #12
0
        protected override SizeF ArrangeOverride(SizeF finalSize)
        {
            RectangleF clientRect = GetClientRectangle(finalSize);

            if (hostedItem == null)
            {
                return(finalSize);
            }

            hostedItem.Arrange(clientRect);
            return(finalSize);
        }
コード例 #13
0
        // Methods
        protected override SizeF ArrangeOverride(SizeF arrangeSize)
        {
            RadElementCollection children = base.Children;
            int   count = children.Count;
            int   effectiveChildrenCount = count - (this.LastChildFill ? 1 : 0);
            float x             = 0;
            float y             = 0;
            float elementWidth  = 0;
            float elementHeight = 0;

            for (int i = 0; i < count; i++)
            {
                RadElement element = children[i];
                if (element != null)
                {
                    SizeF      desiredSize = element.DesiredSize;
                    RectangleF finalRect   = new RectangleF(x, y,
                                                            Math.Max((float)0, (float)(arrangeSize.Width - (x + elementWidth))),
                                                            Math.Max((float)0, (float)(arrangeSize.Height - (y + elementHeight))));
                    if (i < effectiveChildrenCount)
                    {
                        switch (GetDock(element))
                        {
                        case Dock.Left:
                            x += desiredSize.Width;
                            finalRect.Width = desiredSize.Width;
                            break;

                        case Dock.Right:
                            elementWidth   += desiredSize.Width;
                            finalRect.X     = Math.Max((float)0, (float)(arrangeSize.Width - elementWidth));
                            finalRect.Width = desiredSize.Width;
                            break;

                        case Dock.Top:
                            y += desiredSize.Height;
                            finalRect.Height = desiredSize.Height;
                            break;

                        case Dock.Bottom:
                            elementHeight   += desiredSize.Height;
                            finalRect.Y      = Math.Max((float)0, (float)(arrangeSize.Height - elementHeight));
                            finalRect.Height = desiredSize.Height;
                            break;
                        }
                    }
                    element.Arrange(finalRect);
                }
            }
            return(arrangeSize);
        }
コード例 #14
0
        protected override SizeF ArrangeOverride(SizeF finalSize)
        {
            RectangleF bounds = this.Parent.Bounds;

            SizeF fixedSize = finalSize;

            InitializeElements();
            SizeF captionSize = SizeF.Empty;
            SizeF bodySize    = SizeF.Empty;

            int captionHeight = 8;

            if (captionElement != null)
            {
                captionSize = captionElement.DesiredSize;
                if (captionElement.Visibility != ElementVisibility.Collapsed)
                {
                    captionSize.Height = Math.Max(captionHeight, captionSize.Height);
                }
            }

            if (bodyElement != null)
            {
                bodySize = bodyElement.DesiredSize;

                if (bodyElement.Visibility == ElementVisibility.Collapsed)
                {
                    bodySize.Height = 0;
                }
            }

            float maxWidth      = Math.Max(captionSize.Width, bodySize.Width);
            float maxBodyHeight = bodySize.Height;

            maxWidth      = fixedSize.Width;
            maxBodyHeight = fixedSize.Height - captionSize.Height;

            if (captionElement != null)
            {
                SizeF  size            = new SizeF(maxWidth, captionSize.Height);
                PointF captionLocation = this.CaptionOnTop ? PointF.Empty : new PointF(0, maxBodyHeight);
                captionElement.Arrange(new RectangleF(captionLocation, size));
            }
            if (bodyElement != null)
            {
                SizeF  size         = new SizeF(maxWidth, maxBodyHeight);
                PointF bodyLocation = this.CaptionOnTop ? new PointF(0, captionSize.Height) : PointF.Empty;
                bodyElement.Arrange(new RectangleF(bodyLocation, size));
            }
            return(finalSize);
        }
コード例 #15
0
        protected virtual void ArrangeEditorElement(SizeF finalSize, RectangleF clientRect)
        {
            RadElement editorElement = (RadElement)this.GetEditorElement(this.editor);
            float      height1       = editorElement.DesiredSize.Height;

            if (editorElement.StretchVertically)
            {
                height1 = clientRect.Height;
            }
            float      height2   = Math.Min(height1, finalSize.Height);
            RectangleF finalRect = new RectangleF(clientRect.X, clientRect.Y + (float)(((double)clientRect.Height - (double)height2) / 2.0), clientRect.Width, height2);

            editorElement.Arrange(finalRect);
        }
コード例 #16
0
ファイル: DockLayoutPanel.cs プロジェクト: RichardHaggard/BDC
        protected override SizeF ArrangeOverride(SizeF arrangeSize)
        {
            RadElementCollection children = this.Children;
            int   count = children.Count;
            int   num1  = count - (this.LastChildFill ? 1 : 0);
            float x     = 0.0f;
            float y     = 0.0f;
            float num2  = 0.0f;
            float num3  = 0.0f;

            for (int index = 0; index < count; ++index)
            {
                RadElement element = children[index];
                if (element != null)
                {
                    SizeF      desiredSize = element.DesiredSize;
                    RectangleF finalRect   = new RectangleF(x, y, Math.Max(0.0f, arrangeSize.Width - (x + num2)), Math.Max(0.0f, arrangeSize.Height - (y + num3)));
                    if (index < num1)
                    {
                        switch (DockLayoutPanel.GetDock(element))
                        {
                        case Dock.Left:
                            x += desiredSize.Width;
                            finalRect.Width = desiredSize.Width;
                            break;

                        case Dock.Top:
                            y += desiredSize.Height;
                            finalRect.Height = desiredSize.Height;
                            break;

                        case Dock.Right:
                            num2           += desiredSize.Width;
                            finalRect.X     = Math.Max(0.0f, arrangeSize.Width - num2);
                            finalRect.Width = desiredSize.Width;
                            break;

                        case Dock.Bottom:
                            num3            += desiredSize.Height;
                            finalRect.Y      = Math.Max(0.0f, arrangeSize.Height - num3);
                            finalRect.Height = desiredSize.Height;
                            break;
                        }
                    }
                    element.Arrange(finalRect);
                }
            }
            return(arrangeSize);
        }
コード例 #17
0
        protected override SizeF ArrangeOverride(SizeF finalSize)
        {
            if (this.Children.Count == 0)
            {
                return(finalSize);
            }
            float height = finalSize.Height / (float)this.Children.Count;

            for (int index = 0; index < this.Children.Count; ++index)
            {
                RadElement child = this.Children[index];
                child.Arrange(new RectangleF(0.0f, (float)index * height, child.DesiredSize.Width, height));
            }
            return(finalSize);
        }
コード例 #18
0
        protected override SizeF ArrangeOverride(SizeF finalSize)
        {
            SizeF sizeF = this.arrowButton != null ? this.arrowButton.DesiredSize : SizeF.Empty;

            for (int index = 0; index < this.Children.Count; ++index)
            {
                RadElement child = this.Children[index];
                if (this.arrowButton != null && object.ReferenceEquals((object)child, (object)this.arrowButton))
                {
                    RectangleF finalRect = new RectangleF(this.RightToLeft ? 0.0f : finalSize.Width - sizeF.Width, 0.0f, sizeF.Width, finalSize.Height);
                    child.Arrange(finalRect);
                }
                else if (this.content != null && object.ReferenceEquals((object)child, (object)this.content))
                {
                    RectangleF finalRect = new RectangleF(this.RightToLeft ? sizeF.Width : 0.0f, 0.0f, finalSize.Width - sizeF.Width, finalSize.Height);
                    child.Arrange(finalRect);
                }
                else
                {
                    child.Arrange(new RectangleF(PointF.Empty, finalSize));
                }
            }
            return(finalSize);
        }
コード例 #19
0
        protected override RectangleF ArrangeElementCore(RadElement element, SizeF finalSize, RectangleF arrangeRect)
        {
            RadListElement    listElement = this.Parent as RadListElement;
            RadListVisualItem item        = element as RadListVisualItem;

            if (listElement != null && listElement.ShowGroups && item != null && !(item is RadListVisualGroupItem) &&
                item.Data.Group != item.Data.Owner.groupFactory.DefaultGroup && item.Data.Group.Collapsible)
            {
                float offset = listElement.CollapsibleGroupItemsOffset;
                arrangeRect = new RectangleF(arrangeRect.Left + offset, arrangeRect.Top, arrangeRect.Width - offset, arrangeRect.Height);
            }

            element.Arrange(arrangeRect);
            return(arrangeRect);
        }
コード例 #20
0
        protected override SizeF ArrangeOverride(SizeF finalSize)
        {
            //base.ArrangeOverride(finalSize);
            int        count   = this.Children.Count;
            RadElement element = null;
            float      curX    = 0;
            float      curY    = 0;

            if (count == 0)
            {
                return(finalSize);
            }

            //this.InitElements();

            this.curElementMaxX = (int)Math.Floor(finalSize.Width / this.longestElementSize.Width);
            if (this.MaxColumns < this.curElementMaxX)
            {
                this.curElementMaxX = this.MaxColumns;
            }
            this.curElementMaxY = (int)Math.Floor(finalSize.Height / this.longestElementSize.Height);
            if (this.MaxRows < this.curElementMaxY)
            {
                this.curElementMaxY = this.MaxRows;
            }

            this.lineCount = count / curElementMaxX + ((count % curElementMaxX) != 0 ? 1 : 0);

            int i = this.CurrentLine * curElementMaxX;

            for (int yCount = 0; yCount < curElementMaxY && i < count; ++yCount)
            {
                for (int xCount = 0; xCount < curElementMaxX && i < count; ++xCount, ++i)
                {
                    element            = this.Children[i];
                    element.Visibility = ElementVisibility.Visible;
                    element.Arrange(new RectangleF(curX, curY, this.longestElementSize.Width, this.longestElementSize.Height));
                    curX += this.longestElementSize.Width;
                }
                curY += this.longestElementSize.Height;
                curX  = 0;
            }
            return(finalSize);
        }
コード例 #21
0
        private void ArrangeHorizontal(SizeF finalSize)
        {
            switch (this.TrackBarElement.TrackBarMode)
            {
            case TrackBarRangeMode.SingleThumb:
                if (this.Children.Count <= 0)
                {
                    break;
                }
                SizeF desiredSize1 = this.Children[0].DesiredSize;
                this.Children[0].Arrange(new RectangleF(!this.RightToLeft ? new PointF(0.0f, 0.0f) : new PointF(finalSize.Width - desiredSize1.Width, 0.0f), desiredSize1));
                break;

            case TrackBarRangeMode.StartFromTheBeginning:
                using (RadElementCollection.RadElementEnumerator enumerator = this.Children.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        RadElement current      = enumerator.Current;
                        SizeF      desiredSize2 = current.DesiredSize;
                        PointF     location     = !this.RightToLeft ? new PointF(0.0f, 0.0f) : new PointF(finalSize.Width - desiredSize2.Width, 0.0f);
                        current.ZIndex = (int)(1000.0 - (double)current.DesiredSize.Width * 10.0);
                        RectangleF finalRect = new RectangleF(location, desiredSize2);
                        current.Arrange(finalRect);
                    }
                    break;
                }

            case TrackBarRangeMode.Range:
                using (RadElementCollection.RadElementEnumerator enumerator = this.Children.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        RadElement current = enumerator.Current;
                        TrackBarIndicatorElement indicatorElement = current as TrackBarIndicatorElement;
                        SizeF      desiredSize2 = current.DesiredSize;
                        RectangleF finalRect    = new RectangleF(!this.RightToLeft ? new PointF(Math.Abs(this.TrackBarElement.Minimum - indicatorElement.RangeInfo.Start) * this.TrackBarElement.TickOffSet, 0.0f) : new PointF((float)((double)finalSize.Width - (double)desiredSize2.Width - (double)Math.Abs(this.TrackBarElement.Minimum - indicatorElement.RangeInfo.Start) * (double)this.TrackBarElement.TickOffSet), 0.0f), desiredSize2);
                        current.Arrange(finalRect);
                    }
                    break;
                }
            }
        }
コード例 #22
0
        protected virtual void ArrangeEditorElement(SizeF finalSize, RectangleF clientRect)
        {
            RadElement editorElement = (RadElement)this.GetEditorElement(this.editor);
            float      height1       = editorElement.DesiredSize.Height;

            if (editorElement.StretchVertically)
            {
                height1 = clientRect.Height;
            }
            float height2 = Math.Min(height1, finalSize.Height);

            if (this.ViewTemplate.ViewDefinition is HtmlViewDefinition && this.ControlBoundingRectangle.X < 0)
            {
                clientRect.X += (float)-this.ControlBoundingRectangle.X;
            }
            RectangleF finalRect = new RectangleF(clientRect.X, clientRect.Y + (float)(((double)clientRect.Height - (double)height2) / 2.0), clientRect.Width, height2);

            editorElement.Arrange(finalRect);
        }
コード例 #23
0
 protected override SizeF ArrangeOverride(SizeF finalSize)
 {
     for (int index = 0; index < this.Children.Count; ++index)
     {
         RadElement child = this.Children[index];
         if (this.ShouldArrangeChild(child))
         {
             RectangleF finalRect = new RectangleF(PointF.Empty, finalSize);
             if (!this.BypassLayoutPolicies)
             {
                 if (child.FitToSizeMode == RadFitToSizeMode.FitToParentContent || child.FitToSizeMode == RadFitToSizeMode.FitToParentPadding)
                 {
                     Padding borderThickness = this.BorderThickness;
                     finalRect.Location = PointF.Add(finalRect.Location, new SizeF((float)borderThickness.Left, (float)borderThickness.Top));
                     finalRect.Size     = SizeF.Subtract(finalRect.Size, (SizeF)borderThickness.Size);
                 }
                 if (child.FitToSizeMode == RadFitToSizeMode.FitToParentContent)
                 {
                     finalRect.Location = PointF.Add(finalRect.Location, new SizeF((float)this.Padding.Left, (float)this.Padding.Top));
                     finalRect.Size     = SizeF.Subtract(finalRect.Size, (SizeF)this.Padding.Size);
                 }
             }
             if (child == this.textBoxItem && this.ButtonsStack.DesiredSize != SizeF.Empty)
             {
                 finalRect.Size = SizeF.Subtract(finalRect.Size, new SizeF(this.ButtonsStack.DesiredSize.Width, 0.0f));
                 if (this.RightToLeft)
                 {
                     finalRect.Location = PointF.Add(finalRect.Location, new SizeF(this.ButtonsStack.DesiredSize.Width, 0.0f));
                 }
             }
             else if (child == this.ButtonsStack)
             {
                 if (!this.RightToLeft)
                 {
                     finalRect.Location = PointF.Add(finalRect.Location, new SizeF(finalRect.Width - this.ButtonsStack.DesiredSize.Width, 0.0f));
                 }
                 finalRect.Size = new SizeF(this.ButtonsStack.DesiredSize.Width, finalRect.Height);
             }
             child.Arrange(finalRect);
         }
     }
     return(finalSize);
 }
コード例 #24
0
        protected virtual void ArrangeEditorElement(
            RadElement element,
            RectangleF editorRect,
            RectangleF clientRect)
        {
            float height = element.DesiredSize.Height;

            if (element.StretchVertically)
            {
                height = clientRect.Height;
            }
            if ((double)height == 0.0)
            {
                height = editorRect.Height;
            }
            editorRect.Height = Math.Min(editorRect.Height, height);
            editorRect.Y     += (float)(((double)clientRect.Height - (double)editorRect.Height) / 2.0);
            element.Arrange(editorRect);
        }
コード例 #25
0
        private void ArrangeVertical(SizeF finalSize)
        {
            switch (this.TrackBarElement.TrackBarMode)
            {
            case TrackBarRangeMode.SingleThumb:
                if (this.Children.Count <= 0)
                {
                    break;
                }
                SizeF desiredSize1 = this.Children[0].DesiredSize;
                this.Children[0].Arrange(new RectangleF(new PointF(0.0f, finalSize.Height - desiredSize1.Height), desiredSize1));
                break;

            case TrackBarRangeMode.StartFromTheBeginning:
                using (RadElementCollection.RadElementEnumerator enumerator = this.Children.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        RadElement current      = enumerator.Current;
                        SizeF      desiredSize2 = current.DesiredSize;
                        current.ZIndex = (int)(1000.0 - (double)current.DesiredSize.Height * 10.0);
                        RectangleF finalRect = new RectangleF(new PointF(0.0f, finalSize.Height - desiredSize2.Height), desiredSize2);
                        current.Arrange(finalRect);
                    }
                    break;
                }

            case TrackBarRangeMode.Range:
                using (RadElementCollection.RadElementEnumerator enumerator = this.Children.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        RadElement current = enumerator.Current;
                        TrackBarIndicatorElement indicatorElement = current as TrackBarIndicatorElement;
                        SizeF      desiredSize2 = current.DesiredSize;
                        RectangleF finalRect    = new RectangleF(new PointF(0.0f, finalSize.Height - Math.Abs(this.TrackBarElement.Minimum - indicatorElement.RangeInfo.Start) * this.TrackBarElement.TickOffSet - desiredSize2.Height), desiredSize2);
                        current.Arrange(finalRect);
                    }
                    break;
                }
            }
        }
コード例 #26
0
ファイル: WrapLayoutPanel.cs プロジェクト: configare/hispeed
        private void ArrangeLine(float VPosition, float lineV, int start, int end, bool useItemU, float itemU, float totalU)
        {
            float currentUPosition = 0;
            bool  isHorizontal     = this.Orientation == Orientation.Horizontal;
            RadElementCollection internalChildren = base.Children;
            float stretchedItemU = 0;

            if (this.stretchItems)
            {
                stretchedItemU = DetermineStretchedItemU(start, end, internalChildren, totalU);
            }

            for (int i = start; i < end; i++)
            {
                RadElement element = internalChildren[i];
                if (element != null)
                {
                    UVSize size        = new UVSize(this.Orientation, element.DesiredSize.Width, element.DesiredSize.Height);
                    float  actualItemU = useItemU ? itemU : size.U;

                    if (this.stretchItems && element.Visibility != ElementVisibility.Collapsed && actualItemU < stretchedItemU)
                    {
                        actualItemU = stretchedItemU;
                    }

                    RectangleF rect = new RectangleF(isHorizontal ? currentUPosition : VPosition,
                                                     isHorizontal ? VPosition : currentUPosition,
                                                     isHorizontal ? actualItemU : lineV,
                                                     isHorizontal ? lineV : actualItemU);
                    if (this.RightToLeft)
                    {
                        if (isHorizontal)
                        {
                            rect.X = totalU - rect.X - rect.Width;
                        }
                    }

                    element.Arrange(rect);
                    currentUPosition += actualItemU;
                }
            }
        }
コード例 #27
0
 protected virtual void ArrangeElement(
     RadElement element,
     RectangleF clientRect,
     RectangleF finalRect,
     SizeF finalSize)
 {
     if (element.FitToSizeMode == RadFitToSizeMode.FitToParentBounds && this.Orientation == Orientation.Horizontal)
     {
         if (!element.RightToLeft)
         {
             finalRect.X -= (float)(this.Padding.Left + this.GetBorderThickness(true).Left);
         }
         else
         {
             finalRect.X += (float)(this.Padding.Right + this.GetBorderThickness(true).Right);
         }
         finalRect.Height = finalSize.Height;
         finalRect.Y      = 0.0f;
     }
     element.Arrange(finalRect);
 }
コード例 #28
0
 protected override RectangleF ArrangeElementCore(
     RadElement element,
     SizeF finalSize,
     RectangleF arrangeRect)
 {
     if (element is BaseListViewGroupVisualItem)
     {
         return(base.ArrangeElementCore(element, finalSize, arrangeRect));
     }
     if (this.owner.FullRowSelect)
     {
         arrangeRect.Width = (float)((IVirtualizedElement <ListViewDataItem>)element).Data.ActualSize.Width;
     }
     if (this.owner.Owner.ShowGroups && (this.owner.Owner.EnableCustomGrouping || this.owner.Owner.EnableGrouping) && (this.owner.Owner.Groups.Count > 0 && !this.owner.Owner.FullRowSelect))
     {
         arrangeRect.X     += (float)this.owner.Owner.GroupIndent;
         arrangeRect.Width -= (float)this.owner.Owner.GroupIndent;
     }
     element.Arrange(arrangeRect);
     return(arrangeRect);
 }
コード例 #29
0
        protected override SizeF ArrangeOverride(SizeF finalSize)
        {
            base.ArrangeOverride(finalSize);

            float      width    = this.layoutPanel.LeftColumnWidth + this.layoutPanel.LeftColumnMaxPadding;
            RectangleF leftRect = new RectangleF(this.headerElement.DesiredSize.Width +
                                                 this.BorderThickness.Left + this.Padding.Left + this.layoutPanel.BoundingRectangle.Left,
                                                 this.BorderThickness.Top + this.Padding.Top,
                                                 width,
                                                 finalSize.Height - (this.BorderThickness.Vertical + this.Padding.Vertical));

            if (this.RightToLeft)
            {
                leftRect.X = finalSize.Width - (this.headerElement.DesiredSize.Width +
                                                this.BorderThickness.Right + this.Padding.Right + leftRect.Width);
            }

            leftColumnElement.Arrange(leftRect);
            SizeF scrollViewerArrangeSize = new SizeF(finalSize);

            scrollViewerArrangeSize.Width  -= (this.BorderThickness.Horizontal + this.Padding.Horizontal);
            scrollViewerArrangeSize.Height -= (this.BorderThickness.Vertical + this.Padding.Vertical);
            RectangleF scrollViewerRect = new RectangleF(new PointF(this.headerElement.DesiredSize.Width, 0), scrollViewerArrangeSize);

            if (this.RightToLeft)
            {
                scrollViewerRect.X = finalSize.Width - this.Padding.Horizontal - this.BorderThickness.Vertical - scrollViewerRect.X - scrollViewerRect.Width;
            }

            if (GetBitState(UseScrollingStateKey) && this.scrollViewer != null)
            {
                this.scrollViewer.Arrange(scrollViewerRect);
            }
            else
            {
                this.layoutPanel.Arrange(scrollViewerRect);
            }

            return(finalSize);
        }
コード例 #30
0
        private void ArrangeLine(
            float VPosition,
            float lineV,
            int start,
            int end,
            bool useItemU,
            float itemU,
            float totalU)
        {
            float num1 = 0.0f;
            bool  flag = this.Orientation == Orientation.Horizontal;
            RadElementCollection children = this.Children;
            float num2 = 0.0f;

            if (this.stretchItems)
            {
                num2 = this.DetermineStretchedItemU(start, end, children, totalU);
            }
            for (int index = start; index < end; ++index)
            {
                RadElement radElement = children[index];
                if (radElement != null)
                {
                    WrapLayoutPanel.UVSize uvSize = new WrapLayoutPanel.UVSize(this.Orientation, radElement.DesiredSize.Width, radElement.DesiredSize.Height);
                    float num3 = useItemU ? itemU : uvSize.U;
                    if (this.stretchItems && radElement.Visibility != ElementVisibility.Collapsed && (double)num3 < (double)num2)
                    {
                        num3 = num2;
                    }
                    RectangleF finalRect = new RectangleF(flag ? num1 : VPosition, flag ? VPosition : num1, flag ? num3 : lineV, flag ? lineV : num3);
                    if (this.RightToLeft && flag)
                    {
                        finalRect.X = totalU - finalRect.X - finalRect.Width;
                    }
                    radElement.Arrange(finalRect);
                    num1 += num3;
                }
            }
        }