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