Esempio n. 1
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;
                }
            }
        }
Esempio n. 2
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;
                }
            }
        }