157 references to LayoutUtils
System.Windows.Forms (157)
winforms\Managed\System\WinForms\ArrangedElement.cs (2)
78
value =
LayoutUtils
.ClampNegativePaddingToZero(value);
88
value =
LayoutUtils
.ClampNegativePaddingToZero(value);
winforms\Managed\System\WinForms\Button.cs (2)
119
return AutoSizeMode == AutoSizeMode.GrowAndShrink ? prefSize :
LayoutUtils
.UnionSizes(prefSize, Size);
139
return AutoSizeMode == AutoSizeMode.GrowAndShrink ? paddedSize :
LayoutUtils
.UnionSizes(paddedSize, Size);
winforms\Managed\System\WinForms\ButtonBase.cs (1)
962
return
LayoutUtils
.UnionSizes(prefSize + Padding.Size, MinimumSize);
winforms\Managed\System\WinForms\ButtonInternal\ButtonBaseAdapter.cs (29)
626
if ((Control.TextAlign &
LayoutUtils
.AnyCenter) == 0) {
1027
action[combineCheck] = checkAlign == ContentAlignment.MiddleCenter || !
LayoutUtils
.IsHorizontalAlignment(checkAlign);
1028
action[combineImageText] = !
LayoutUtils
.IsHorizontalRelation(textImageRelation);
1085
action[combineCheck] = checkAlign == ContentAlignment.MiddleCenter || !
LayoutUtils
.IsVerticalAlignment(checkAlign);
1086
action[combineImageText] = !
LayoutUtils
.IsVerticalRelation(textImageRelation);
1127
layout.focus =
LayoutUtils
.InflateRect(layout.focus, this.padding);
1205
if ((align &
LayoutUtils
.AnyRight) != 0) {
1208
else if ((align &
LayoutUtils
.AnyCenter) != 0) {
1212
if ((align &
LayoutUtils
.AnyBottom) != 0) {
1215
else if ((align &
LayoutUtils
.AnyTop) != 0) {
1295
return _imageAlignToRelation[
LayoutUtils
.ContentAlignmentToIndex(alignment)];
1299
return
LayoutUtils
.GetOppositeTextImageRelation(ImageAlignToRelation(alignment));
1325
layout.imageBounds =
LayoutUtils
.Align(size, maxBounds, imageAlign);
1326
layout.textBounds =
LayoutUtils
.Align(textSize, maxBounds, textAlign);
1330
Size maxTextSize =
LayoutUtils
.SubAlignedRegion(maxBounds.Size, imageSize, textImageRelation);
1335
Size combinedSize =
LayoutUtils
.AddAlignedRegion(textSize, imageSize, textImageRelation);
1336
maxCombinedBounds.Size =
LayoutUtils
.UnionSizes(maxCombinedBounds.Size, combinedSize);
1337
Rectangle combinedBounds =
LayoutUtils
.Align(combinedSize, maxCombinedBounds, ContentAlignment.MiddleCenter);
1349
LayoutUtils
.SplitRegion(maxCombinedBounds, imageSize, (AnchorStyles) textImageRelation, out layout.imageBounds, out layout.textBounds);
1352
LayoutUtils
.SplitRegion(maxCombinedBounds, textSize, (AnchorStyles)
LayoutUtils
.GetOppositeTextImageRelation(textImageRelation), out layout.textBounds, out layout.imageBounds);
1355
LayoutUtils
.SplitRegion(combinedBounds, imageSize, (AnchorStyles) textImageRelation, out layout.imageBounds, out layout.textBounds);
1356
LayoutUtils
.ExpandRegionsToFillBounds(maxCombinedBounds, (AnchorStyles) textImageRelation, ref layout.imageBounds, ref layout.textBounds);
1360
layout.imageBounds =
LayoutUtils
.Align(imageSize, layout.imageBounds, imageAlign);
1361
layout.textBounds =
LayoutUtils
.Align(textSize, layout.textBounds, textAlign);
1441
proposedSize =
LayoutUtils
.FlipSizeIf(verticalText, proposedSize);
1456
return
LayoutUtils
.FlipSizeIf(verticalText, textSize);
1510
layout.client =
LayoutUtils
.DeflateRect(clientRectangle, padding);
1536
layout.client =
LayoutUtils
.DeflateRect(Control.ClientRectangle, Control.Padding);
winforms\Managed\System\WinForms\ButtonInternal\ButtonPopupAdapter.cs (2)
150
Debug.Assert(layout.GetPreferredSizeCore(
LayoutUtils
.MaxSize)
151
== PaintPopupLayout(e, /* up = */ true, 2).GetPreferredSizeCore(
LayoutUtils
.MaxSize),
winforms\Managed\System\WinForms\ButtonInternal\ButtonStandardAdapter.cs (2)
225
Debug.Assert(layout.GetPreferredSizeCore(
LayoutUtils
.MaxSize) == PaintLayout(e, /* up = */ true).GetPreferredSizeCore(
LayoutUtils
.MaxSize),
winforms\Managed\System\WinForms\ButtonInternal\CheckBoxPopupAdapter.cs (2)
109
Debug.Assert(layout.GetPreferredSizeCore(
LayoutUtils
.MaxSize)
110
== PaintPopupLayout(e, /* up = */ false).GetPreferredSizeCore(
LayoutUtils
.MaxSize),
winforms\Managed\System\WinForms\ButtonInternal\CheckBoxStandardAdapter.cs (1)
48
if (layout.options.textAlign !=
LayoutUtils
.AnyLeft && layout.options.useCompatibleTextRendering && layout.options.font.Italic) {
winforms\Managed\System\WinForms\ComboBox.cs (3)
936
Size textSize = TextRenderer.MeasureText(
LayoutUtils
.TestString, this.Font, new Size(Int16.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine);
946
Size textSize = TextRenderer.MeasureText(
LayoutUtils
.TestString, this.Font, new Size(Int16.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine);
5982
if (!
LayoutUtils
.IsZeroWidthOrHeight(whiteFillRect)) {
winforms\Managed\System\WinForms\Control.cs (12)
2785
proposedSize =
LayoutUtils
.ConvertZeroToUnbounded(proposedSize);
2795
if(!cachedSize.IsEmpty && (proposedSize ==
LayoutUtils
.MaxSize)) {
2830
if(GetState2(STATE2_USEPREFERREDSIZECACHE) && proposedSize ==
LayoutUtils
.MaxSize) {
3267
value =
LayoutUtils
.ClampNegativePaddingToZero(value);
6457
Size maximumSize =
LayoutUtils
.ConvertZeroToUnbounded(MaximumSize);
6461
newBounds.Size =
LayoutUtils
.IntersectSizes(new Size(proposedWidth,proposedHeight), maximumSize);
6462
newBounds.Size =
LayoutUtils
.UnionSizes(newBounds.Size, MinimumSize);
11538
minSize = ScaleSize(
LayoutUtils
.UnionSizes(Size.Empty, minSize), // make sure we dont go below 0.
11544
maxSize = ScaleSize(
LayoutUtils
.UnionSizes(Size.Empty, maxSize), // make sure we dont go below 0.
11552
Size maximumSize =
LayoutUtils
.ConvertZeroToUnbounded(maxSize);
11553
Size scaledSize =
LayoutUtils
.IntersectSizes(rawScaledBounds.Size, maximumSize);
11554
scaledSize =
LayoutUtils
.UnionSizes(scaledSize, minSize);
winforms\Managed\System\WinForms\DomainUpDown.cs (1)
606
int width =
LayoutUtils
.OldGetLargestStringSizeInCollection(Font, Items).Width;
winforms\Managed\System\WinForms\Form.cs (2)
4816
Size adjustedSize = AutoSizeMode == AutoSizeMode.GrowAndShrink ? prefSize :
LayoutUtils
.UnionSizes(prefSize, Size);
7157
Size minTrack = (AutoSize && formStateEx[FormStateExInModalSizingLoop] == 1) ?
LayoutUtils
.UnionSizes(minAutoSize, MinimumSize) : MinimumSize;
winforms\Managed\System\WinForms\Label.cs (5)
78
LayoutUtils
.MeasureTextCache textMeasurementCache;
761
internal
LayoutUtils
.MeasureTextCache MeasureTextCache {
764
textMeasurementCache = new
LayoutUtils
.MeasureTextCache();
1288
proposedConstraints =
LayoutUtils
.UnionSizes(proposedConstraints,Size.Empty);
1517
Rectangle face =
LayoutUtils
.DeflateRect(ClientRectangle, Padding);
winforms\Managed\System\WinForms\Layout\CommonProperties.cs (5)
157
if (found && rectangle !=
LayoutUtils
.MaxRectangle) {
252
value =
LayoutUtils
.ClampNegativePaddingToZero(value);
299
element.Properties.SetRectangle(_specifiedBoundsProperty,
LayoutUtils
.MaxRectangle);
320
element.Properties.SetSize(_preferredSizeCacheProperty,
LayoutUtils
.InvalidSize);
351
if (found && (size !=
LayoutUtils
.InvalidSize)) {
winforms\Managed\System\WinForms\Layout\DockAndAnchorLayout.cs (4)
39
Size proposedConstraints =
LayoutUtils
.MaxSize;
59
Size newSize =
LayoutUtils
.UnionSizes(bounds.Size, prefSize);
527
preferredSize =
LayoutUtils
.UnionSizes(preferredSizeForDocking, preferredSizeForAnchoring);
831
Rectangle elementSpace =
LayoutUtils
.InflateRect(GetCachedBounds(element), margin);
winforms\Managed\System\WinForms\Layout\FlowLayout.cs (21)
143
return
LayoutUtils
.FlipSizeIf(flowDirection == FlowDirection.TopDown || GetFlowDirection(container) == FlowDirection.BottomUp, layoutSize);
195
elementConstraints =
LayoutUtils
.UnionSizes(new Size(1, 1), elementConstraints);
224
cellBounds =
LayoutUtils
.DeflateRect(cellBounds, elementProxy.Margin);
227
containerProxy.Bounds =
LayoutUtils
.AlignAndStretch(prefSize, cellBounds, anchorStyles);
397
_displayRect =
LayoutUtils
.FlipRectangleIf(IsVertical, value);
527
AnchorStyles anchorStyles =
LayoutUtils
.GetUnifiedAnchor(Element);
528
bool isStretch = (anchorStyles &
LayoutUtils
.VerticalAnchorStyles) ==
LayoutUtils
.VerticalAnchorStyles; //whether the control stretches to fill in the whole space
534
return
LayoutUtils
.VerticalAnchorStyles;
567
if ((
LayoutUtils
.VerticalAnchorStyles & styles) ==
LayoutUtils
.VerticalAnchorStyles) {
603
AnchorStyles anchorStyles =
LayoutUtils
.GetUnifiedAnchor(Element);
604
bool isStretch = (anchorStyles &
LayoutUtils
.HorizontalAnchorStyles) ==
LayoutUtils
.HorizontalAnchorStyles; //whether the control stretches to fill in the whole space
608
return
LayoutUtils
.VerticalAnchorStyles;
621
set { base.Bounds =
LayoutUtils
.FlipRectangle(value); }
625
get { return
LayoutUtils
.FlipPadding(base.Margin); }
629
get { return
LayoutUtils
.FlipSize(base.MinimumSize); }
633
get { return
LayoutUtils
.FlipSize(base.SpecifiedSize); }
637
return
LayoutUtils
.FlipSize(base.GetPreferredSize(
LayoutUtils
.FlipSize(proposedSize)));
winforms\Managed\System\WinForms\Layout\LayoutUtils.cs (4)
531
private Size unconstrainedPreferredSize =
LayoutUtils
.InvalidSize;
541
unconstrainedPreferredSize =
LayoutUtils
.InvalidSize;
614
if (unconstrainedPreferredSize ==
LayoutUtils
.InvalidSize) {
619
unconstrainedPreferredSize = TextRenderer.MeasureText(text, font,
LayoutUtils
.MaxSize, flags);
winforms\Managed\System\WinForms\Layout\TableLayout.cs (5)
1226
cellBounds =
LayoutUtils
.DeflateRect(cellBounds, elementMargin);
1232
AnchorStyles anchorStyles =
LayoutUtils
.GetUnifiedAnchor(element);
1234
Rectangle elementBounds =
LayoutUtils
.AlignAndStretch(GetElementSize(element, cellBounds.Size), cellBounds, anchorStyles);
2091
if (
LayoutUtils
.IsIntersectHorizontally(elementBounds1, elementBounds2)) {
2104
if (
LayoutUtils
.IsIntersectVertically(elementBounds1, elementBounds2)) {
winforms\Managed\System\WinForms\LinkLabel.cs (1)
199
return
LayoutUtils
.DeflateRect(ClientRectangle, Padding);
winforms\Managed\System\WinForms\ListBox.cs (1)
1360
Size textSize =
LayoutUtils
.OldGetLargestStringSizeInCollection(Font, strings);
winforms\Managed\System\WinForms\PictureBox.cs (1)
439
Rectangle result =
LayoutUtils
.DeflateRect(ClientRectangle, Padding);
winforms\Managed\System\WinForms\ScrollableControl.cs (1)
276
return
LayoutUtils
.DeflateRect(rect, Padding);
winforms\Managed\System\WinForms\TabPage.cs (1)
704
Rectangle inflateRect =
LayoutUtils
.InflateRect(DisplayRectangle, Padding);
winforms\Managed\System\WinForms\ToolStrip.cs (10)
2527
maxSize =
LayoutUtils
.IntersectSizes(maxSize, proposedConstraints);
2562
maxSize =
LayoutUtils
.FlipSize( toolStrip.DefaultSize);
3653
if (!
LayoutUtils
.IsZeroWidthOrHeight(bitmapSize)) {
3700
if (
LayoutUtils
.IsZeroWidthOrHeight(clippingRect)) {
3707
if (!
LayoutUtils
.AreWidthAndHeightLarger(bitmapSize, itemSize)) {
4049
bounds =
LayoutUtils
.InflateRect(bounds, GripMargin);
4331
size =
LayoutUtils
.UnionSizes(size, toolStripOverflowButton.Bounds.Size);
4334
size =
LayoutUtils
.UnionSizes(size, toolStripGrip.Bounds.Size);
4396
biggestItemSize =
LayoutUtils
.UnionSizes(biggestItemSize, item.Bounds.Size);
4454
biggestItemSize =
LayoutUtils
.UnionSizes(biggestItemSize, item.Bounds.Size);
winforms\Managed\System\WinForms\ToolStripControlHost.cs (3)
812
Size size =
LayoutUtils
.DeflateRect(this.Bounds, this.Padding).Size;
813
Rectangle bounds =
LayoutUtils
.Align(size, this.Bounds, ControlAlign);
821
bounds =
LayoutUtils
.Align(control.Size, this.Bounds, ControlAlign);
winforms\Managed\System\WinForms\ToolStripDropDownMenu.cs (7)
142
rect =
LayoutUtils
.InflateRect(rect, new Padding(0, this.Padding.Top, 0, this.Padding.Bottom));
417
checkRectangle =
LayoutUtils
.Align(maxCheckSize, new Rectangle(nextPoint.X, nextPoint.Y, maxCheckSize.Width, maxItemSize.Height), ContentAlignment.MiddleCenter);
422
imageRectangle =
LayoutUtils
.Align(maxImageSize, new Rectangle(nextPoint.X, nextPoint.Y, maxImageSize.Width, maxItemSize.Height), ContentAlignment.MiddleCenter);
433
checkRectangle =
LayoutUtils
.Align(maxCheckSize, new Rectangle(nextPoint.X, nextPoint.Y, checkAndImageMarginWidth, maxItemSize.Height), ContentAlignment.MiddleCenter);
452
checkRectangle =
LayoutUtils
.Align(
LayoutUtils
.UnionSizes(maxCheckSize,maxImageSize), new Rectangle(nextPoint.X, nextPoint.Y, checkAndImageMarginWidth-1, maxItemSize.Height), ContentAlignment.MiddleCenter);
510
textRectangle.Y =
LayoutUtils
.VAlign(textRectangle.Size, new Rectangle(Point.Empty, maxItemSize), ContentAlignment.MiddleCenter).Y;
winforms\Managed\System\WinForms\ToolStripGrip.cs (2)
25
private static Size DragSize =
LayoutUtils
.MaxSize;
159
if (DragSize ==
LayoutUtils
.MaxSize) {
winforms\Managed\System\WinForms\ToolStripItem.cs (6)
603
Rectangle content =
LayoutUtils
.InflateRect(InternalLayout.ContentRectangle, this.Padding);
604
content.Size =
LayoutUtils
.UnionSizes(Size.Empty, content.Size);
2716
constrainingSize =
LayoutUtils
.ConvertZeroToUnbounded(constrainingSize);
4781
Size cachedSize =
LayoutUtils
.InvalidSize;
4782
Size cachedProposedConstraints =
LayoutUtils
.InvalidSize;
4786
if (cachedSize !=
LayoutUtils
.InvalidSize
winforms\Managed\System\WinForms\ToolStripMenuItem.cs (2)
1483
arrowRect.Y =
LayoutUtils
.VAlign(arrowRect.Size, ownerItem.ClientBounds, ContentAlignment.MiddleCenter).Y;
1525
imageRect.Y =
LayoutUtils
.VAlign(imageRect.Size, ownerItem.ClientBounds, ContentAlignment.MiddleCenter).Y;
winforms\Managed\System\WinForms\ToolStripOverflow.cs (1)
156
biggestItemSize =
LayoutUtils
.UnionSizes(biggestItemSize, item.Bounds.Size);
winforms\Managed\System\WinForms\ToolStripPanel.cs (4)
207
return
LayoutUtils
.InflateRect(this.ClientRectangle, DragMargin);
249
scaledRowMargin =
LayoutUtils
.FlipPadding(scaledRowMargin);
1204
Rectangle bounds =
LayoutUtils
.InflateRect(row.Bounds, row.Margin);
1279
if (!
LayoutUtils
.IsZeroWidthOrHeight(intersection)) {
winforms\Managed\System\WinForms\ToolStripPanelCell.cs (3)
28
private Size maxSize =
LayoutUtils
.MaxSize;
159
maxSize=
LayoutUtils
.MaxSize;
189
maxSize=
LayoutUtils
.MaxSize;
winforms\Managed\System\WinForms\ToolStripPanelRow.cs (2)
942
if ((!ToolStripPanel.Visible ||
LayoutUtils
.IsZeroWidthOrHeight(raftingDisplayRectangle)) && (ToolStripPanel.ParentInternal != null)){
1453
if ((!ToolStripPanel.Visible ||
LayoutUtils
.IsZeroWidthOrHeight(raftingDisplayRectangle)) && (ToolStripPanel.ParentInternal != null)){
winforms\Managed\System\WinForms\ToolStripProfessionalRenderer.cs (5)
266
buttonBounds =
LayoutUtils
.DeflateRect(buttonBounds, deflatePadding);
506
bounds =
LayoutUtils
.DeflateRect(bounds, scaledDropDownMenuItemPaintPadding);
984
if (!
LayoutUtils
.IsZeroWidthOrHeight(gradientBounds)) {
993
if (!
LayoutUtils
.IsZeroWidthOrHeight(gradientBounds)) {
1067
overflowBoundsFill =
LayoutUtils
.RTLTranslate(overflowBoundsFill, bounds);
winforms\Managed\System\WinForms\ToolStripRenderer.cs (2)
936
Size textSize =
LayoutUtils
.FlipSize(textRect.Size);
1027
if (!
LayoutUtils
.IsZeroWidthOrHeight(sizeGripBounds)) {
winforms\Managed\System\WinForms\ToolStripSplitStackLayout.cs (2)
367
Rectangle bounds =
LayoutUtils
.VAlign(item.Size, displayRectangle, AnchorStyles.None);
492
Rectangle bounds =
LayoutUtils
.HAlign(item.Size, displayRectangle, AnchorStyles.None);