154 references to LayoutUtils
System.Windows.Forms (154)
System\Windows\Forms\Control.cs (12)
2057proposedSize = LayoutUtils.ConvertZeroToUnbounded(proposedSize); 2067if (!cachedSize.IsEmpty && (proposedSize == LayoutUtils.s_maxSize)) 2090if (GetExtendedState(ExtendedStates.UserPreferredSizeCache) && proposedSize == LayoutUtils.s_maxSize) 2442value = LayoutUtils.ClampNegativePaddingToZero(value); 5154Size maximumSize = LayoutUtils.ConvertZeroToUnbounded(MaximumSize); 5158Size = LayoutUtils.IntersectSizes(new Size(proposedWidth, proposedHeight), maximumSize) 5160newBounds.Size = LayoutUtils.UnionSizes(newBounds.Size, MinimumSize); 9725minSize = ScaleSize(LayoutUtils.UnionSizes(Size.Empty, minSize), // make sure we don't go below 0. 9733maxSize = ScaleSize(LayoutUtils.UnionSizes(Size.Empty, maxSize), // make sure we don't go below 0. 9740Size maximumSize = LayoutUtils.ConvertZeroToUnbounded(maxSize); 9741Size scaledSize = LayoutUtils.IntersectSizes(rawScaledBounds.Size, maximumSize); 9742scaledSize = 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)
2328maxSize = LayoutUtils.IntersectSizes(maxSize, proposedConstraints); 2364maxSize = LayoutUtils.FlipSize(toolStrip.DefaultSize); 3471if (!LayoutUtils.IsZeroWidthOrHeight(bitmapSize)) 3522if (LayoutUtils.IsZeroWidthOrHeight(clippingRect)) 3530if (!LayoutUtils.AreWidthAndHeightLarger(bitmapSize, itemSize)) 3901bounds = LayoutUtils.InflateRect(bounds, GripMargin); 4220size = LayoutUtils.UnionSizes(size, _toolStripOverflowButton.Bounds.Size); 4225size = 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); 2347constrainingSize = 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); 1027Rectangle bounds = LayoutUtils.InflateRect(row.Bounds, row.Margin); 1099if (!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)
522int 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)
154&& rectangle != LayoutUtils.s_maxRectangle) 258value = LayoutUtils.ClampNegativePaddingToZero(value); 333element.Properties.AddValue(s_specifiedBoundsProperty, LayoutUtils.s_maxRectangle); 352element.Properties.AddValue(s_preferredSizeCacheProperty, LayoutUtils.s_invalidSize); 378/// value of <see cref="LayoutUtils.s_maxSize"/> (or <see cref="Size.Empty"/> too). 382if (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); 196elementConstraints = LayoutUtils.UnionSizes(new Size(1, 1), elementConstraints); 229cellBounds = LayoutUtils.DeflateRect(cellBounds, elementProxy.Margin); 232containerProxy.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)
1261cellBounds = LayoutUtils.DeflateRect(cellBounds, elementMargin); 1267AnchorStyles anchorStyles = LayoutUtils.GetUnifiedAnchor(element); 1269Rectangle elementBounds = LayoutUtils.AlignAndStretch(GetElementSize(element, cellBounds.Size), cellBounds, anchorStyles); 1484if (LayoutUtils.IsIntersectHorizontally(elementBounds1, elementBounds2)) 1501if (LayoutUtils.IsIntersectVertically(elementBounds1, elementBounds2))
System\Windows\Forms\Scrolling\ScrollableControl.cs (1)
210return LayoutUtils.DeflateRect(rect, Padding);