private RectangleF ArrangeButtons(SizeF finalSize)
        {
            RectangleF client      = this.GetClientRectangle(finalSize);
            SizeF      buttonsSize = this.buttonsPanel.DesiredSize;

            StripViewAlignment align       = (StripViewAlignment)this.GetValue(RadPageViewStripElement.StripAlignmentProperty);
            RectangleF         buttonsRect = RectangleF.Empty;

            switch (align)
            {
            case StripViewAlignment.Top:
            case StripViewAlignment.Bottom:
                float left = client.Right - buttonsSize.Width - this.buttonsPanel.Margin.Right;
                buttonsRect  = new RectangleF(left, client.Y, buttonsSize.Width, client.Height);
                client.Width = buttonsRect.Left - client.Left - this.buttonsPanel.Margin.Left;
                if (this.RightToLeft)
                {
                    client.X      = client.X - this.Padding.Left + this.Padding.Right;
                    buttonsRect.X = client.X;
                    client.X     += buttonsRect.Width;
                }
                break;

            case StripViewAlignment.Left:
            case StripViewAlignment.Right:
                float top = client.Bottom - buttonsSize.Height - this.buttonsPanel.Margin.Bottom;
                buttonsRect   = new RectangleF(client.X, top, client.Width, buttonsSize.Height);
                client.Height = buttonsRect.Top - client.Top - this.buttonsPanel.Margin.Top;
                break;
            }

            this.buttonsPanel.Arrange(buttonsRect);

            return(client);
        }
示例#2
0
        private RectangleF ArrangeButtons(SizeF finalSize)
        {
            RectangleF         clientRectangle    = this.GetClientRectangle(finalSize);
            SizeF              desiredSize        = this.buttonsPanel.DesiredSize;
            StripViewAlignment stripViewAlignment = (StripViewAlignment)this.GetValue(RadPageViewStripElement.StripAlignmentProperty);
            RectangleF         finalRect          = RectangleF.Empty;

            switch (stripViewAlignment)
            {
            case StripViewAlignment.Top:
            case StripViewAlignment.Bottom:
                finalRect             = new RectangleF(clientRectangle.Right - desiredSize.Width - (float)this.buttonsPanel.Margin.Right, clientRectangle.Y, desiredSize.Width, clientRectangle.Height);
                clientRectangle.Width = finalRect.Left - clientRectangle.Left - (float)this.buttonsPanel.Margin.Left;
                if (this.RightToLeft)
                {
                    clientRectangle.X  = clientRectangle.X - (float)this.Padding.Left + (float)this.Padding.Right;
                    finalRect.X        = clientRectangle.X;
                    clientRectangle.X += finalRect.Width;
                    break;
                }
                break;

            case StripViewAlignment.Right:
            case StripViewAlignment.Left:
                float y = clientRectangle.Bottom - desiredSize.Height - (float)this.buttonsPanel.Margin.Bottom;
                finalRect = new RectangleF(clientRectangle.X, y, clientRectangle.Width, desiredSize.Height);
                clientRectangle.Height = finalRect.Top - clientRectangle.Top - (float)this.buttonsPanel.Margin.Top;
                break;
            }
            this.buttonsPanel.Arrange(finalRect);
            return(clientRectangle);
        }
示例#3
0
 public override void Update()
 {
     this.fitMode   = (StripViewItemFitMode)this.itemLayout.GetValue(RadPageViewStripElement.ItemFitModeProperty);
     this.align     = (StripViewAlignment)this.itemLayout.GetValue(RadPageViewStripElement.StripAlignmentProperty);
     this.itemAlign = (StripViewItemAlignment)this.itemLayout.GetValue(RadPageViewStripElement.ItemAlignmentProperty);
     base.Update();
 }
        protected internal override bool IsPreviousKey(Keys key)
        {
            StripViewAlignment align = this.StripAlignment;

            switch (align)
            {
            case StripViewAlignment.Left:
            case StripViewAlignment.Right:
                return(key == Keys.Up);
            }

            return(base.IsPreviousKey(key));
        }
        private SizeF PerformMeasure(SizeF availableSize)
        {
            this.buttonsPanel.Measure(availableSize);
            SizeF buttonsSize        = this.buttonsPanel.DesiredSize;
            StripViewAlignment align = (StripViewAlignment)this.GetValue(RadPageViewStripElement.StripAlignmentProperty);

            switch (align)
            {
            case StripViewAlignment.Top:
            case StripViewAlignment.Bottom:
                availableSize.Width -= buttonsSize.Width + this.buttonsPanel.Margin.Horizontal;
                this.buttonsPanel.Measure(availableSize);
                break;

            case StripViewAlignment.Left:
            case StripViewAlignment.Right:
                availableSize.Height -= buttonsSize.Height + this.buttonsPanel.Margin.Vertical;
                break;
            }

            this.itemLayout.Measure(availableSize);
            SizeF stripSize = this.itemLayout.DesiredSize;
            SizeF measured  = SizeF.Empty;

            switch (align)
            {
            case StripViewAlignment.Top:
            case StripViewAlignment.Bottom:
                measured.Width = buttonsSize.Width + this.buttonsPanel.Margin.Horizontal +
                                 stripSize.Width + this.itemLayout.Margin.Horizontal;
                measured.Height = Math.Max(buttonsSize.Height + this.buttonsPanel.Margin.Vertical,
                                           stripSize.Height + this.itemLayout.Margin.Vertical);
                break;

            case StripViewAlignment.Left:
            case StripViewAlignment.Right:
                measured.Width = Math.Max(buttonsSize.Width + this.buttonsPanel.Margin.Horizontal,
                                          stripSize.Width + this.itemLayout.Margin.Horizontal);
                measured.Height = buttonsSize.Height + this.buttonsPanel.Margin.Vertical +
                                  stripSize.Height + this.itemLayout.Margin.Vertical;
                break;
            }

            return(measured);
        }
示例#6
0
        private void UpdateItemContainer(StripViewAlignment align)
        {
            switch (align)
            {
            case StripViewAlignment.Top:
            case StripViewAlignment.Bottom:
                int num1 = (int)this.itemContainer.SetDefaultValueOverride(RadElement.StretchVerticallyProperty, (object)false);
                int num2 = (int)this.itemContainer.SetDefaultValueOverride(RadElement.StretchHorizontallyProperty, (object)true);
                break;

            case StripViewAlignment.Right:
            case StripViewAlignment.Left:
                int num3 = (int)this.itemContainer.SetDefaultValueOverride(RadElement.StretchHorizontallyProperty, (object)false);
                int num4 = (int)this.itemContainer.SetDefaultValueOverride(RadElement.StretchVerticallyProperty, (object)true);
                break;
            }
            this.itemContainer.ButtonsPanel.SetContentOrientation(this.GetAutomaticItemOrientation(true), true);
        }
        private void UpdateItemContainer(StripViewAlignment align)
        {
            switch (align)
            {
            case StripViewAlignment.Left:
            case StripViewAlignment.Right:
                this.itemContainer.SetDefaultValueOverride(StretchHorizontallyProperty, false);
                this.itemContainer.SetDefaultValueOverride(StretchVerticallyProperty, true);
                break;

            case StripViewAlignment.Top:
            case StripViewAlignment.Bottom:
                this.itemContainer.SetDefaultValueOverride(StretchVerticallyProperty, false);
                this.itemContainer.SetDefaultValueOverride(StretchHorizontallyProperty, true);
                break;
            }

            this.itemContainer.ButtonsPanel.SetContentOrientation(this.GetAutomaticItemOrientation(true), true);
        }
示例#8
0
        private SizeF PerformMeasure(SizeF availableSize)
        {
            this.buttonsPanel.Measure(availableSize);
            SizeF desiredSize1 = this.buttonsPanel.DesiredSize;
            StripViewAlignment stripViewAlignment = (StripViewAlignment)this.GetValue(RadPageViewStripElement.StripAlignmentProperty);

            switch (stripViewAlignment)
            {
            case StripViewAlignment.Top:
            case StripViewAlignment.Bottom:
                availableSize.Width -= desiredSize1.Width + (float)this.buttonsPanel.Margin.Horizontal;
                this.buttonsPanel.Measure(availableSize);
                break;

            case StripViewAlignment.Right:
            case StripViewAlignment.Left:
                availableSize.Height -= desiredSize1.Height + (float)this.buttonsPanel.Margin.Vertical;
                break;
            }
            this.itemLayout.Measure(availableSize);
            SizeF desiredSize2 = this.itemLayout.DesiredSize;
            SizeF empty        = SizeF.Empty;

            switch (stripViewAlignment)
            {
            case StripViewAlignment.Top:
            case StripViewAlignment.Bottom:
                empty.Width  = desiredSize1.Width + (float)this.buttonsPanel.Margin.Horizontal + desiredSize2.Width + (float)this.itemLayout.Margin.Horizontal;
                empty.Height = Math.Max(desiredSize1.Height + (float)this.buttonsPanel.Margin.Vertical, desiredSize2.Height + (float)this.itemLayout.Margin.Vertical);
                break;

            case StripViewAlignment.Right:
            case StripViewAlignment.Left:
                empty.Width  = Math.Max(desiredSize1.Width + (float)this.buttonsPanel.Margin.Horizontal, desiredSize2.Width + (float)this.itemLayout.Margin.Horizontal);
                empty.Height = desiredSize1.Height + (float)this.buttonsPanel.Margin.Vertical + desiredSize2.Height + (float)this.itemLayout.Margin.Vertical;
                break;
            }
            return(empty);
        }