154 references to LayoutUtils
System.Windows.Forms (154)
System\Windows\Forms\Control.cs (12)
2148proposedSize = LayoutUtils.ConvertZeroToUnbounded(proposedSize); 2158if (!cachedSize.IsEmpty && (proposedSize == LayoutUtils.s_maxSize)) 2181if (GetExtendedState(ExtendedStates.UserPreferredSizeCache) && proposedSize == LayoutUtils.s_maxSize) 2548value = LayoutUtils.ClampNegativePaddingToZero(value); 5310Size maximumSize = LayoutUtils.ConvertZeroToUnbounded(MaximumSize); 5314Size = LayoutUtils.IntersectSizes(new Size(proposedWidth, proposedHeight), maximumSize) 5316newBounds.Size = LayoutUtils.UnionSizes(newBounds.Size, MinimumSize); 10027minSize = ScaleSize(LayoutUtils.UnionSizes(Size.Empty, minSize), // make sure we don't go below 0. 10035maxSize = ScaleSize(LayoutUtils.UnionSizes(Size.Empty, maxSize), // make sure we don't go below 0. 10042Size maximumSize = LayoutUtils.ConvertZeroToUnbounded(maxSize); 10043Size scaledSize = LayoutUtils.IntersectSizes(rawScaledBounds.Size, maximumSize); 10044scaledSize = 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)
810Size textSize = TextRenderer.MeasureText(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine); 821Size 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; 633internal LayoutUtils.MeasureTextCache MeasureTextCache 634=> _textMeasurementCache ??= new LayoutUtils.MeasureTextCache(); 1066proposedConstraints = LayoutUtils.UnionSizes(proposedConstraints, Size.Empty); 1262Rectangle 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)
2410maxSize = LayoutUtils.IntersectSizes(maxSize, proposedConstraints); 2446maxSize = LayoutUtils.FlipSize(toolStrip.DefaultSize); 3583if (!LayoutUtils.IsZeroWidthOrHeight(bitmapSize)) 3634if (LayoutUtils.IsZeroWidthOrHeight(clippingRect)) 3642if (!LayoutUtils.AreWidthAndHeightLarger(bitmapSize, itemSize)) 4012bounds = LayoutUtils.InflateRect(bounds, GripMargin); 4331size = LayoutUtils.UnionSizes(size, _toolStripOverflowButton.Bounds.Size); 4336size = LayoutUtils.UnionSizes(size, _toolStripGrip.Bounds.Size); 4406biggestItemSize = LayoutUtils.UnionSizes(biggestItemSize, item.Bounds.Size); 4466biggestItemSize = 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)
573Rectangle content = LayoutUtils.InflateRect(InternalLayout.ContentRectangle, Padding); 574content.Size = LayoutUtils.UnionSizes(Size.Empty, content.Size); 2365constrainingSize = 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); 1030Rectangle bounds = LayoutUtils.InflateRect(row.Bounds, row.Margin); 1102if (!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)
4406Size adjustedSize = AutoSizeMode == AutoSizeMode.GrowAndShrink ? prefSize : LayoutUtils.UnionSizes(prefSize, Size); 6989Size 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); 1135Rectangle 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); 1487if (LayoutUtils.IsIntersectHorizontally(elementBounds1, elementBounds2)) 1504if (LayoutUtils.IsIntersectVertically(elementBounds1, elementBounds2))
System\Windows\Forms\Scrolling\ScrollableControl.cs (1)
210return LayoutUtils.DeflateRect(rect, Padding);