Here are the examples of the csharp api class BrightIdeasSoftware.BaseRenderer.CalculatePrimaryCheckBoxSize(System.Drawing.Graphics) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
4 Examples
0
1. Example
Project: MapViewer
Source File: Renderers.cs
Source File: Renderers.cs
protected virtual Rectangle StandardGetEditRectangle(Graphics g, Rectangle cellBounds, Size preferredSize) { Size contentSize = this.CalculateContentSize(g, cellBounds); int contentWidth = this.Column.CellEditUseWholeCellEffective ? cellBounds.Width : contentSize.Width; Rectangle editControlBounds = this.CalculatePaddedAlignedBounds(g, cellBounds, new Size(contentWidth, preferredSize.Height)); Size checkBoxSize = this.CalculatePrimaryCheckBoxSize(g); int imageWidth = this.CalculateImageWidth(g, this.GetImageSelector()); int width = checkBoxSize.Width + imageWidth; // Indent the primary column by the required amount if (this.ListItem.IndentCount > 0) { int indentWidth = this.ListView.SmallImageSize.Width * this.ListItem.IndentCount; width += indentWidth; } editControlBounds.X += width; editControlBounds.Width -= width; if (editControlBounds.Width < 50) editControlBounds.Width = 50; if (editControlBounds.Right > cellBounds.Right) editControlBounds.Width = cellBounds.Right - editControlBounds.Left; return editControlBounds; }
0
2. Example
Project: Bulk-Crap-Uninstaller
Source File: Renderers.cs
Source File: Renderers.cs
protected virtual Rectangle StandardGetEditRectangle(Graphics g, Rectangle cellBounds, Size preferredSize) { Size contentSize = this.CalculateContentSize(g, cellBounds); int contentWidth = this.Column.CellEditUseWholeCellEffective ? cellBounds.Width : contentSize.Width; Rectangle editControlBounds = this.CalculatePaddedAlignedBounds(g, cellBounds, new Size(contentWidth, preferredSize.Height)); Size checkBoxSize = this.CalculatePrimaryCheckBoxSize(g); int imageWidth = this.CalculateImageWidth(g, this.GetImageSelector()); int width = checkBoxSize.Width + imageWidth; // Indent the primary column by the required amount if (this.ListItem.IndentCount > 0) { int indentWidth = this.ListView.SmallImageSize.Width * this.ListItem.IndentCount; width += indentWidth; } editControlBounds.X += width; editControlBounds.Width -= width; if (editControlBounds.Width < 50) editControlBounds.Width = 50; if (editControlBounds.Right > cellBounds.Right) editControlBounds.Width = cellBounds.Right - editControlBounds.Left; return editControlBounds; }
0
3. Example
Project: MapViewer
Source File: Renderers.cs
Source File: Renderers.cs
protected virtual Size CalculateContentSize(Graphics g, Rectangle r) { Size checkBoxSize = this.CalculatePrimaryCheckBoxSize(g); Size imageSize = this.CalculateImageSize(g, this.GetImageSelector()); Size textSize = this.CalculateTextSize(g, this.GetText(), r.Width - (checkBoxSize.Width + imageSize.Width)); // If the combined width is greater than the whole cell, we just use the cell itself int width = Math.Min(r.Width, checkBoxSize.Width + imageSize.Width + textSize.Width); int componentMaxHeight = Math.Max(checkBoxSize.Height, Math.Max(imageSize.Height, textSize.Height)); int height = Math.Min(r.Height, componentMaxHeight); return new Size(width, height); }
0
4. Example
Project: Bulk-Crap-Uninstaller
Source File: Renderers.cs
Source File: Renderers.cs
protected virtual Size CalculateContentSize(Graphics g, Rectangle r) { Size checkBoxSize = this.CalculatePrimaryCheckBoxSize(g); Size imageSize = this.CalculateImageSize(g, this.GetImageSelector()); Size textSize = this.CalculateTextSize(g, this.GetText(), r.Width - (checkBoxSize.Width + imageSize.Width)); // If the combined width is greater than the whole cell, we just use the cell itself int width = Math.Min(r.Width, checkBoxSize.Width + imageSize.Width + textSize.Width); int componentMaxHeight = Math.Max(checkBoxSize.Height, Math.Max(imageSize.Height, textSize.Height)); int height = Math.Min(r.Height, componentMaxHeight); return new Size(width, height); }