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