示例#1
0
            protected override ToolStripItemLayoutOptions CommonLayoutOptions()
            {
                ToolStripItemLayoutOptions layoutOptions = base.CommonLayoutOptions();

                layoutOptions.borderSize = 0;
                return(layoutOptions);
            }
示例#2
0
        protected virtual ToolStripItemLayoutOptions CommonLayoutOptions()
        {
            ToolStripItemLayoutOptions options = new ToolStripItemLayoutOptions();
            Rectangle rectangle = new Rectangle(Point.Empty, this.ownerItem.Size);

            options.client = rectangle;
            options.growBorderBy1PxWhenDefault = false;
            options.borderSize        = 2;
            options.paddingSize       = 0;
            options.maxFocus          = true;
            options.focusOddEvenFixup = false;
            options.font                = this.ownerItem.Font;
            options.text                = ((this.Owner.DisplayStyle & ToolStripItemDisplayStyle.Text) == ToolStripItemDisplayStyle.Text) ? this.Owner.Text : string.Empty;
            options.imageSize           = this.PreferredImageSize;
            options.checkSize           = 0;
            options.checkPaddingSize    = 0;
            options.checkAlign          = ContentAlignment.TopLeft;
            options.imageAlign          = this.Owner.ImageAlign;
            options.textAlign           = this.Owner.TextAlign;
            options.hintTextUp          = false;
            options.shadowedText        = !this.ownerItem.Enabled;
            options.layoutRTL           = RightToLeft.Yes == this.Owner.RightToLeft;
            options.textImageRelation   = this.Owner.TextImageRelation;
            options.textImageInset      = 0;
            options.everettButtonCompat = false;
            options.gdiTextFormatFlags  = ContentAlignToTextFormat(this.Owner.TextAlign, this.Owner.RightToLeft == RightToLeft.Yes);
            options.gdiTextFormatFlags  = this.Owner.ShowKeyboardCues ? options.gdiTextFormatFlags : (options.gdiTextFormatFlags | TextFormatFlags.HidePrefix);
            return(options);
        }
 protected virtual ToolStripItemLayoutOptions CommonLayoutOptions()
 {
     ToolStripItemLayoutOptions options = new ToolStripItemLayoutOptions();
     Rectangle rectangle = new Rectangle(Point.Empty, this.ownerItem.Size);
     options.client = rectangle;
     options.growBorderBy1PxWhenDefault = false;
     options.borderSize = 2;
     options.paddingSize = 0;
     options.maxFocus = true;
     options.focusOddEvenFixup = false;
     options.font = this.ownerItem.Font;
     options.text = ((this.Owner.DisplayStyle & ToolStripItemDisplayStyle.Text) == ToolStripItemDisplayStyle.Text) ? this.Owner.Text : string.Empty;
     options.imageSize = this.PreferredImageSize;
     options.checkSize = 0;
     options.checkPaddingSize = 0;
     options.checkAlign = ContentAlignment.TopLeft;
     options.imageAlign = this.Owner.ImageAlign;
     options.textAlign = this.Owner.TextAlign;
     options.hintTextUp = false;
     options.shadowedText = !this.ownerItem.Enabled;
     options.layoutRTL = RightToLeft.Yes == this.Owner.RightToLeft;
     options.textImageRelation = this.Owner.TextImageRelation;
     options.textImageInset = 0;
     options.everettButtonCompat = false;
     options.gdiTextFormatFlags = ContentAlignToTextFormat(this.Owner.TextAlign, this.Owner.RightToLeft == RightToLeft.Yes);
     options.gdiTextFormatFlags = this.Owner.ShowKeyboardCues ? options.gdiTextFormatFlags : (options.gdiTextFormatFlags | TextFormatFlags.HidePrefix);
     return options;
 }
示例#4
0
 private System.Windows.Forms.ButtonInternal.ButtonBaseAdapter.LayoutData GetLayoutData()
 {
     this.currentLayoutOptions = this.CommonLayoutOptions();
     if (this.Owner.TextDirection != ToolStripTextDirection.Horizontal)
     {
         this.currentLayoutOptions.verticalText = true;
     }
     return(this.currentLayoutOptions.Layout());
 }
 private System.Windows.Forms.ButtonInternal.ButtonBaseAdapter.LayoutData GetLayoutData()
 {
     this.currentLayoutOptions = this.CommonLayoutOptions();
     if (this.Owner.TextDirection != ToolStripTextDirection.Horizontal)
     {
         this.currentLayoutOptions.verticalText = true;
     }
     return this.currentLayoutOptions.Layout();
 }
示例#6
0
            private ButtonBaseAdapter.LayoutData GetLayoutData()
            {
                _currentLayoutOptions = CommonLayoutOptions();

                if (Owner.TextDirection != ToolStripTextDirection.Horizontal)
                {
                    _currentLayoutOptions.VerticalText = true;
                }

                ButtonBaseAdapter.LayoutData data = _currentLayoutOptions.Layout();
                return(data);
            }
            protected override ToolStripItemLayoutOptions CommonLayoutOptions()
            {
                ToolStripItemLayoutOptions options = base.CommonLayoutOptions();

                if (ownerItem.ShowDropDownArrow)
                {
                    if (ownerItem.TextDirection == ToolStripTextDirection.Horizontal)
                    {
                        // We're rendering horizontal....  make sure to take care of RTL issues.

                        int widthOfDropDown = dropDownArrowSize.Width + scaledDropDownArrowPadding.Horizontal;
                        options.Client.Width -= widthOfDropDown;

                        if (ownerItem.RightToLeft == RightToLeft.Yes)
                        {
                            // if RightToLeft.Yes: [ v | rest of drop down button ]
                            options.Client.Offset(widthOfDropDown, 0);
                            dropDownArrowRect = new Rectangle(scaledDropDownArrowPadding.Left, 0, dropDownArrowSize.Width, ownerItem.Bounds.Height);
                        }
                        else
                        {
                            // if RightToLeft.No [ rest of drop down button | v ]
                            dropDownArrowRect = new Rectangle(options.Client.Right, 0, dropDownArrowSize.Width, ownerItem.Bounds.Height);
                        }
                    }
                    else
                    {
                        // else we're rendering vertically.
                        int heightOfDropDown = dropDownArrowSize.Height + scaledDropDownArrowPadding.Vertical;

                        options.Client.Height -= heightOfDropDown;

                        //  [ rest of button / v]
                        dropDownArrowRect = new Rectangle(0, options.Client.Bottom + scaledDropDownArrowPadding.Top, ownerItem.Bounds.Width - 1, dropDownArrowSize.Height);
                    }
                }

                return(options);
            }
示例#8
0
            protected virtual ToolStripItemLayoutOptions CommonLayoutOptions()
            {
                ToolStripItemLayoutOptions layoutOptions = new ToolStripItemLayoutOptions();
                Rectangle bounds = new Rectangle(Point.Empty, _ownerItem.Size);

                layoutOptions.Client = bounds;

                layoutOptions.GrowBorderBy1PxWhenDefault = false;

                layoutOptions.BorderSize        = BorderWidth;
                layoutOptions.PaddingSize       = 0;
                layoutOptions.MaxFocus          = true;
                layoutOptions.FocusOddEvenFixup = false;
                layoutOptions.Font              = _ownerItem.Font;
                layoutOptions.Text              = ((Owner.DisplayStyle & ToolStripItemDisplayStyle.Text) == ToolStripItemDisplayStyle.Text) ? Owner.Text : string.Empty;
                layoutOptions.ImageSize         = PreferredImageSize;
                layoutOptions.CheckSize         = 0;
                layoutOptions.CheckPaddingSize  = 0;
                layoutOptions.CheckAlign        = ContentAlignment.TopLeft;
                layoutOptions.ImageAlign        = Owner.ImageAlign;
                layoutOptions.TextAlign         = Owner.TextAlign;
                layoutOptions.HintTextUp        = false;
                layoutOptions.ShadowedText      = !_ownerItem.Enabled;
                layoutOptions.LayoutRTL         = RightToLeft.Yes == Owner.RightToLeft;
                layoutOptions.TextImageRelation = Owner.TextImageRelation;
                // Set textImageInset to 0 since we don't draw 3D border for ToolStripItems.
                layoutOptions.TextImageInset        = 0;
                layoutOptions.DotNetOneButtonCompat = false;

                // Support RTL
                layoutOptions.GdiTextFormatFlags = ContentAlignToTextFormat(Owner.TextAlign, Owner.RightToLeft == RightToLeft.Yes);

                // Hide underlined &File unless ALT is pressed
                layoutOptions.GdiTextFormatFlags = (Owner.ShowKeyboardCues) ? layoutOptions.GdiTextFormatFlags : layoutOptions.GdiTextFormatFlags | TextFormatFlags.HidePrefix;

                return(layoutOptions);
            }