154 references to LayoutUtils
System.Windows.Forms (154)
System\Windows\Forms\Control.cs (12)
2058proposedSize = LayoutUtils.ConvertZeroToUnbounded(proposedSize); 2068if (!cachedSize.IsEmpty && (proposedSize == LayoutUtils.s_maxSize)) 2091if (GetExtendedState(ExtendedStates.UserPreferredSizeCache) && proposedSize == LayoutUtils.s_maxSize) 2443value = LayoutUtils.ClampNegativePaddingToZero(value); 5195Size maximumSize = LayoutUtils.ConvertZeroToUnbounded(MaximumSize); 5199Size = LayoutUtils.IntersectSizes(new Size(proposedWidth, proposedHeight), maximumSize) 5201newBounds.Size = LayoutUtils.UnionSizes(newBounds.Size, MinimumSize); 9757LayoutUtils.UnionSizes(Size.Empty, minSize), // make sure we don't go below 0. 9766LayoutUtils.UnionSizes(Size.Empty, maxSize), // make sure we don't go below 0. 9773Size maximumSize = LayoutUtils.ConvertZeroToUnbounded(maxSize); 9774Size scaledSize = LayoutUtils.IntersectSizes(rawScaledBounds.Size, maximumSize); 9775scaledSize = LayoutUtils.UnionSizes(scaledSize, minSize);
System\Windows\Forms\Controls\Buttons\Button.cs (2)
89return AutoSizeMode == AutoSizeMode.GrowAndShrink ? preferredSize : LayoutUtils.UnionSizes(preferredSize, Size); 107return AutoSizeMode == AutoSizeMode.GrowAndShrink ? paddedSize : LayoutUtils.UnionSizes(paddedSize, Size);
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (1)
961return LayoutUtils.UnionSizes(preferedSize + Padding.Size, MinimumSize);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (3)
464if ((Control.TextAlign & LayoutUtils.AnyCenter) == 0) 565Client = LayoutUtils.DeflateRect(clientRectangle, padding), 592Client = LayoutUtils.DeflateRect(Control.ClientRectangle, Control.Padding),
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (26)
181CheckAlign == ContentAlignment.MiddleCenter || !LayoutUtils.IsHorizontalAlignment(CheckAlign); 183action[s_combineImageText] = !LayoutUtils.IsHorizontalRelation(TextImageRelation); 243action[s_combineCheck] = CheckAlign == ContentAlignment.MiddleCenter || !LayoutUtils.IsVerticalAlignment(CheckAlign); 244action[s_combineImageText] = !LayoutUtils.IsVerticalRelation(TextImageRelation); 276layout.Focus = LayoutUtils.InflateRect(layout.Focus, Padding); 372if ((align & LayoutUtils.AnyRight) != 0) 376else if ((align & LayoutUtils.AnyCenter) != 0) 381if ((align & LayoutUtils.AnyBottom) != 0) 385else if ((align & LayoutUtils.AnyTop) != 0) 470=> s_imageAlignToRelation[LayoutUtils.ContentAlignmentToIndex(alignment)]; 473=> LayoutUtils.GetOppositeTextImageRelation(ImageAlignToRelation(alignment)); 502layout.ImageBounds = LayoutUtils.Align(size, maxBounds, imageAlign); 503layout.TextBounds = LayoutUtils.Align(textSize, maxBounds, textAlign); 508Size maxTextSize = LayoutUtils.SubAlignedRegion(maxBounds.Size, ImageSize, textImageRelation); 513Size combinedSize = LayoutUtils.AddAlignedRegion(textSize, ImageSize, textImageRelation); 514maxCombinedBounds.Size = LayoutUtils.UnionSizes(maxCombinedBounds.Size, combinedSize); 515Rectangle combinedBounds = LayoutUtils.Align(combinedSize, maxCombinedBounds, ContentAlignment.MiddleCenter); 528LayoutUtils.SplitRegion( 538LayoutUtils.SplitRegion( 541(AnchorStyles)LayoutUtils.GetOppositeTextImageRelation(textImageRelation), 549LayoutUtils.SplitRegion( 555LayoutUtils.ExpandRegionsToFillBounds( 563layout.ImageBounds = LayoutUtils.Align(ImageSize, layout.ImageBounds, imageAlign); 564layout.TextBounds = LayoutUtils.Align(textSize, layout.TextBounds, textAlign); 662proposedSize = LayoutUtils.FlipSizeIf(VerticalText, proposedSize); 682return LayoutUtils.FlipSizeIf(VerticalText, textSize);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonPopupAdapter.cs (2)
143layout.GetPreferredSizeCore(LayoutUtils.s_maxSize) == PaintPopupLayout(up: true, 2).GetPreferredSizeCore(LayoutUtils.s_maxSize),
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonStandardAdapter.cs (2)
211layout.GetPreferredSizeCore(LayoutUtils.s_maxSize) == PaintLayout(up: true).GetPreferredSizeCore(LayoutUtils.s_maxSize),
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxPopupAdapter.cs (2)
124layout.GetPreferredSizeCore(LayoutUtils.s_maxSize) == PaintPopupLayout(show3D: false).GetPreferredSizeCore(LayoutUtils.s_maxSize),
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxStandardAdapter.cs (1)
49if (layout.Options.TextAlign != LayoutUtils.AnyLeft
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (2)
774Size textSize = TextRenderer.MeasureText(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine); 785Size textSize = TextRenderer.MeasureText(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine);
System\Windows\Forms\Controls\ComboBox\ComboBox.FlatComboAdapter.cs (1)
128if (!LayoutUtils.IsZeroWidthOrHeight(_whiteFillRect))
System\Windows\Forms\Controls\Labels\Label.cs (5)
48private LayoutUtils.MeasureTextCache? _textMeasurementCache; 628internal LayoutUtils.MeasureTextCache MeasureTextCache 629=> _textMeasurementCache ??= new LayoutUtils.MeasureTextCache(); 1058proposedConstraints = LayoutUtils.UnionSizes(proposedConstraints, Size.Empty); 1254Rectangle face = LayoutUtils.DeflateRect(ClientRectangle, Padding);
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
145private Rectangle ClientRectWithPadding => LayoutUtils.DeflateRect(ClientRectangle, Padding);
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (1)
1307Size textSize = LayoutUtils.OldGetLargestStringSizeInCollection(Font, strings);
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (1)
344Rectangle result = LayoutUtils.DeflateRect(ClientRectangle, Padding);
System\Windows\Forms\Controls\TabControl\TabPage.cs (1)
611Rectangle inflateRect = LayoutUtils.InflateRect(DisplayRectangle, Padding);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (10)
2326maxSize = LayoutUtils.IntersectSizes(maxSize, proposedConstraints); 2362maxSize = LayoutUtils.FlipSize(toolStrip.DefaultSize); 3469if (!LayoutUtils.IsZeroWidthOrHeight(bitmapSize)) 3520if (LayoutUtils.IsZeroWidthOrHeight(clippingRect)) 3528if (!LayoutUtils.AreWidthAndHeightLarger(bitmapSize, itemSize)) 3899bounds = LayoutUtils.InflateRect(bounds, GripMargin); 4218size = LayoutUtils.UnionSizes(size, _toolStripOverflowButton.Bounds.Size); 4223size = LayoutUtils.UnionSizes(size, _toolStripGrip.Bounds.Size); 4295biggestItemSize = LayoutUtils.UnionSizes(biggestItemSize, item.Bounds.Size); 4355biggestItemSize = LayoutUtils.UnionSizes(biggestItemSize, item.Bounds.Size);
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (3)
650Size size = LayoutUtils.DeflateRect(Bounds, Padding).Size; 651Rectangle bounds = LayoutUtils.Align(size, Bounds, ControlAlign); 660bounds = LayoutUtils.Align(_control.Size, Bounds, ControlAlign);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (7)
99rect = LayoutUtils.InflateRect(rect, new Padding(0, Padding.Top, 0, Padding.Bottom)); 364_checkRectangle = LayoutUtils.Align(maxCheckSize, new Rectangle(nextPoint.X, nextPoint.Y, maxCheckSize.Width, _maxItemSize.Height), ContentAlignment.MiddleCenter); 369_imageRectangle = LayoutUtils.Align(maxImageSize, new Rectangle(nextPoint.X, nextPoint.Y, maxImageSize.Width, _maxItemSize.Height), ContentAlignment.MiddleCenter); 380_checkRectangle = LayoutUtils.Align(maxCheckSize, new Rectangle(nextPoint.X, nextPoint.Y, checkAndImageMarginWidth, _maxItemSize.Height), ContentAlignment.MiddleCenter); 399_checkRectangle = LayoutUtils.Align(LayoutUtils.UnionSizes(maxCheckSize, maxImageSize), new Rectangle(nextPoint.X, nextPoint.Y, checkAndImageMarginWidth - 1, _maxItemSize.Height), ContentAlignment.MiddleCenter); 456_textRectangle.Y = LayoutUtils.VAlign(_textRectangle.Size, new Rectangle(Point.Empty, _maxItemSize), ContentAlignment.MiddleCenter).Y;
System\Windows\Forms\Controls\ToolStrips\ToolStripGrip.cs (2)
15private static Size s_dragSize = LayoutUtils.s_maxSize; 135if (s_dragSize == LayoutUtils.s_maxSize)
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (3)
566Rectangle content = LayoutUtils.InflateRect(InternalLayout.ContentRectangle, Padding); 567content.Size = LayoutUtils.UnionSizes(Size.Empty, content.Size); 2339constrainingSize = LayoutUtils.ConvertZeroToUnbounded(constrainingSize);
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemInternalLayout.ToolStripItemLayoutOptions.cs (3)
16private Size _cachedSize = LayoutUtils.s_invalidSize; 17private Size _cachedProposedConstraints = LayoutUtils.s_invalidSize; 22if (_cachedSize != LayoutUtils.s_invalidSize
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.ToolStripMenuItemInternalLayout.cs (2)
74arrowRect.Y = LayoutUtils.VAlign(arrowRect.Size, _ownerItem.ClientBounds, ContentAlignment.MiddleCenter).Y; 130imageRect.Y = LayoutUtils.VAlign(imageRect.Size, _ownerItem.ClientBounds, ContentAlignment.MiddleCenter).Y;
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflow.cs (1)
141biggestItemSize = LayoutUtils.UnionSizes(biggestItemSize, item.Bounds.Size);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (4)
157return LayoutUtils.InflateRect(ClientRectangle, s_dragMargin); 203_rowMargin = LayoutUtils.FlipPadding(_rowMargin); 1019Rectangle bounds = LayoutUtils.InflateRect(row.Bounds, row.Margin); 1091if (!LayoutUtils.IsZeroWidthOrHeight(intersection))
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (3)
20private Size _maxSize = LayoutUtils.s_maxSize; 172_maxSize = LayoutUtils.s_maxSize; 205_maxSize = LayoutUtils.s_maxSize;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.HorizontalRowManager.cs (1)
32if ((!ToolStripPanel.Visible || LayoutUtils.IsZeroWidthOrHeight(raftingDisplayRectangle)) && (ToolStripPanel.ParentInternal is not null))
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.VerticalRowManager.cs (1)
33if ((!ToolStripPanel.Visible || LayoutUtils.IsZeroWidthOrHeight(raftingDisplayRectangle)) && (ToolStripPanel.ParentInternal is not null))
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (5)
288buttonBounds = LayoutUtils.DeflateRect(buttonBounds, deflatePadding); 562bounds = LayoutUtils.DeflateRect(bounds, _scaledDropDownMenuItemPaintPadding); 1142if (!LayoutUtils.IsZeroWidthOrHeight(gradientBounds)) 1156if (!LayoutUtils.IsZeroWidthOrHeight(gradientBounds)) 1230overflowBoundsFill = LayoutUtils.RTLTranslate(overflowBoundsFill, bounds);
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (2)
877Size textSize = LayoutUtils.FlipSize(textRect.Size); 975if (!LayoutUtils.IsZeroWidthOrHeight(sizeGripBounds))
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackLayout.cs (2)
339Rectangle bounds = LayoutUtils.VAlign(item.Size, _displayRectangle, AnchorStyles.None); 472Rectangle bounds = LayoutUtils.HAlign(item.Size, _displayRectangle, AnchorStyles.None);
System\Windows\Forms\Controls\UpDown\DomainUpDown.cs (1)
516int width = LayoutUtils.OldGetLargestStringSizeInCollection(Font, Items).Width;
System\Windows\Forms\Form.cs (2)
4208Size adjustedSize = AutoSizeMode == AutoSizeMode.GrowAndShrink ? prefSize : LayoutUtils.UnionSizes(prefSize, Size); 6759Size minTrack = (AutoSize && _formStateEx[s_formStateExInModalSizingLoop] == 1) ? LayoutUtils.UnionSizes(_minAutoSize, MinimumSize) : MinimumSize;
System\Windows\Forms\Layout\ArrangedElement.cs (2)
75value = LayoutUtils.ClampNegativePaddingToZero(value); 87value = LayoutUtils.ClampNegativePaddingToZero(value);
System\Windows\Forms\Layout\CommonProperties.cs (6)
153&& rectangle != LayoutUtils.s_maxRectangle 253value = LayoutUtils.ClampNegativePaddingToZero(value); 328element.Properties.AddValue(s_specifiedBoundsProperty, LayoutUtils.s_maxRectangle); 347element.Properties.AddValue(s_preferredSizeCacheProperty, LayoutUtils.s_invalidSize); 373/// value of <see cref="LayoutUtils.s_maxSize"/> (or <see cref="Size.Empty"/> too). 377if (element.Properties.TryGetValue(s_preferredSizeCacheProperty, out Size size) && (size != LayoutUtils.s_invalidSize))
System\Windows\Forms\Layout\DefaultLayout.cs (4)
35Size proposedConstraints = LayoutUtils.s_maxSize; 60Size newSize = LayoutUtils.UnionSizes(bounds.Size, prefSize); 681preferredSize = LayoutUtils.UnionSizes(preferredSizeForDocking, preferredSizeForAnchoring); 1124Rectangle elementSpace = LayoutUtils.InflateRect(GetCachedBounds(element), margin);
System\Windows\Forms\Layout\FlowLayout.ContainerProxy.cs (1)
103_displayRect = LayoutUtils.FlipRectangleIf(IsVertical, value);
System\Windows\Forms\Layout\FlowLayout.cs (4)
104return LayoutUtils.FlipSizeIf(flowDirection == FlowDirection.TopDown || GetFlowDirection(container) == FlowDirection.BottomUp, layoutSize); 197elementConstraints = LayoutUtils.UnionSizes(new Size(1, 1), elementConstraints); 230cellBounds = LayoutUtils.DeflateRect(cellBounds, elementProxy.Margin); 233containerProxy.Bounds = LayoutUtils.AlignAndStretch(prefSize, cellBounds, anchorStyles);
System\Windows\Forms\Layout\FlowLayout.ElementProxy.cs (6)
23AnchorStyles anchorStyles = LayoutUtils.GetUnifiedAnchor(Element!); 24bool isStretch = (anchorStyles & LayoutUtils.VerticalAnchorStyles) == LayoutUtils.VerticalAnchorStyles; // whether the control stretches to fill in the whole space 31return LayoutUtils.VerticalAnchorStyles; 80return (LayoutUtils.VerticalAnchorStyles & styles) == LayoutUtils.VerticalAnchorStyles;
System\Windows\Forms\Layout\FlowLayout.VerticalElementProxy.cs (10)
21AnchorStyles anchorStyles = LayoutUtils.GetUnifiedAnchor(Element!); 22bool isStretch = (anchorStyles & LayoutUtils.HorizontalAnchorStyles) == LayoutUtils.HorizontalAnchorStyles; // whether the control stretches to fill in the whole space 27return LayoutUtils.VerticalAnchorStyles; 46set => base.Bounds = LayoutUtils.FlipRectangle(value); 49public override Padding Margin => LayoutUtils.FlipPadding(base.Margin); 51public override Size MinimumSize => LayoutUtils.FlipSize(base.MinimumSize); 53public override Size SpecifiedSize => LayoutUtils.FlipSize(base.SpecifiedSize); 57return LayoutUtils.FlipSize(base.GetPreferredSize(LayoutUtils.FlipSize(proposedSize)));
System\Windows\Forms\Layout\TableLayout.cs (5)
1260cellBounds = LayoutUtils.DeflateRect(cellBounds, elementMargin); 1266AnchorStyles anchorStyles = LayoutUtils.GetUnifiedAnchor(element); 1268Rectangle elementBounds = LayoutUtils.AlignAndStretch(GetElementSize(element, cellBounds.Size), cellBounds, anchorStyles); 1483if (LayoutUtils.IsIntersectHorizontally(elementBounds1, elementBounds2)) 1500if (LayoutUtils.IsIntersectVertically(elementBounds1, elementBounds2))
System\Windows\Forms\Scrolling\ScrollableControl.cs (1)
210return LayoutUtils.DeflateRect(rect, Padding);