/// <summary> /// Initializes a new instance of the RowStyle class with default settings /// </summary> public RowStyle() { this.backColor = Color.Empty; this.foreColor = Color.Empty; this.font = null; this.alignment = RowAlignment.Center; }
/// <summary> /// Initializes a new instance of the RowStyle class with default settings. /// </summary> public RowStyle() { this.isPropertySet = new Dictionary<AllProperties, bool>(); this.backColor = Color.Empty; this.foreColor = Color.Empty; this.font = null; this.alignment = RowAlignment.Center; }
/// <summary> /// Returns a Rectangle that specifies the size and location of the Color /// rectangle /// </summary> /// <param name="rowAlignment">The alignment of the Cells Row</param> /// <param name="columnAlignment">The alignment of the Cells Column</param> /// <returns>A Rectangle that specifies the size and location of the Color /// rectangle</returns> protected Rectangle CalcColorRect(RowAlignment rowAlignment, ColumnAlignment columnAlignment) { Rectangle rect = this.ClientRectangle; rect.X += 2; rect.Y += 2; rect.Height -= 6; rect.Width = 16; return rect; }
/// <summary> /// Gets the Rectangle that specifies the Size and Location of /// the check box contained in the current Cell /// </summary> /// <returns>A Rectangle that specifies the Size and Location of /// the check box contained in the current Cell</returns> protected Rectangle CalcCheckRect(RowAlignment rowAlignment, ColumnAlignment columnAlignment) { Rectangle checkRect = new Rectangle(this.ClientRectangle.Location, this.CheckSize); if (checkRect.Height > this.ClientRectangle.Height) { checkRect.Height = this.ClientRectangle.Height; checkRect.Width = checkRect.Height; } switch (rowAlignment) { case RowAlignment.Center: { checkRect.Y += (this.ClientRectangle.Height - checkRect.Height) / 2; break; } case RowAlignment.Bottom: { checkRect.Y = this.ClientRectangle.Bottom - checkRect.Height; break; } } if (!this.DrawText) { if (columnAlignment == ColumnAlignment.Center) { checkRect.X += (this.ClientRectangle.Width - checkRect.Width) / 2; } else if (columnAlignment == ColumnAlignment.Right) { checkRect.X = this.ClientRectangle.Right - checkRect.Width; } } return checkRect; }
/// <summary> /// Gets the Rectangle that specifies the Size and Location of /// the control contained in the current Cell /// </summary> /// <returns>A Rectangle that specifies the Size and Location of /// the control contained in the current Cell</returns> protected Rectangle CalcControlRect(RowAlignment rowAlignment, ColumnAlignment columnAlignment) { Rectangle controlRect = new Rectangle(this.ClientRectangle.Location, this.ControlSize); if (controlRect.Height > this.ClientRectangle.Height) { controlRect.Height = this.ClientRectangle.Height; controlRect.Width = controlRect.Height; } switch (rowAlignment) { case RowAlignment.Center: { controlRect.Y += (this.ClientRectangle.Height - controlRect.Height) / 2; break; } case RowAlignment.Bottom: { controlRect.Y = this.ClientRectangle.Bottom - controlRect.Height; break; } } if (columnAlignment == ColumnAlignment.Center) { controlRect.X += (this.ClientRectangle.Width - controlRect.Width) / 2; } else if (columnAlignment == ColumnAlignment.Right) { controlRect.X = this.ClientRectangle.Right - controlRect.Width; } return(controlRect); }
/// <summary> /// Gets the Rectangle that specifies the Size and Location of /// the Image contained in the current Cell /// </summary> /// <param name="image">The Image to be drawn</param> /// <param name="sizeMode">An ImageSizeMode that specifies how the /// specified Image is scaled</param> /// <param name="rowAlignment">The alignment of the current Cell's row</param> /// <param name="columnAlignment">The alignment of the current Cell's Column</param> /// <returns>A Rectangle that specifies the Size and Location of /// the Image contained in the current Cell</returns> protected Rectangle CalcImageRect(Image image, ImageSizeMode sizeMode, RowAlignment rowAlignment, ColumnAlignment columnAlignment) { if (this.DrawText) { sizeMode = ImageSizeMode.ScaledToFit; } Rectangle imageRect = this.ClientRectangle; if (sizeMode == ImageSizeMode.Normal) { if (image.Width < imageRect.Width) { imageRect.Width = image.Width; } if (image.Height < imageRect.Height) { imageRect.Height = image.Height; } } else if (sizeMode == ImageSizeMode.ScaledToFit) { if (image.Width >= imageRect.Width || image.Height >= imageRect.Height) { double hScale = ((double)imageRect.Width) / ((double)image.Width); double vScale = ((double)imageRect.Height) / ((double)image.Height); double scale = Math.Min(hScale, vScale); imageRect.Width = (int)(((double)image.Width) * scale); imageRect.Height = (int)(((double)image.Height) * scale); } else { imageRect.Width = image.Width; imageRect.Height = image.Height; } } else if (sizeMode == ImageSizeMode.NoClip) { imageRect.Width = image.Width; imageRect.Height = image.Height; } if (rowAlignment == RowAlignment.Center) { imageRect.Y += (this.ClientRectangle.Height - imageRect.Height) / 2; } else if (rowAlignment == RowAlignment.Bottom) { imageRect.Y = this.ClientRectangle.Bottom - imageRect.Height; } if (!this.DrawText) { if (columnAlignment == ColumnAlignment.Center) { imageRect.X += (this.ClientRectangle.Width - imageRect.Width) / 2; } else if (columnAlignment == ColumnAlignment.Right) { imageRect.X = this.ClientRectangle.Width - imageRect.Width; } } return(imageRect); }
/// <summary> /// Initializes a new instance of the CellStyle class with default settings and a specific LineAlignment /// </summary> /// <param name="lineAlignment"></param> public CellStyle(RowAlignment lineAlignment) : this() { this.LineAlignment = lineAlignment; }
Rectangle CalcCheckRect(RowAlignment rowAlignment, ColumnAlignment columnAlignment) { return CalcCheckRectangle(); }
/// <summary> /// Initializes a new instance of the CellStyle class with default settings and a specific LineAlignment /// </summary> /// <param name="lineAlignment"></param> public CellStyle(RowAlignment lineAlignment) : this() { this.LineAlignment = lineAlignment; }
/// <summary> /// Gets the Rectangle that specifies the Size and Location of /// the Image contained in the current Cell /// </summary> /// <param name="image">The Image to be drawn</param> /// <param name="sizeMode">An ImageSizeMode that specifies how the /// specified Image is scaled</param> /// <param name="rowAlignment">The alignment of the current Cell's row</param> /// <param name="columnAlignment">The alignment of the current Cell's Column</param> /// <returns>A Rectangle that specifies the Size and Location of /// the Image contained in the current Cell</returns> protected Rectangle CalcImageRect(Image image, ImageSizeMode sizeMode, RowAlignment rowAlignment, ColumnAlignment columnAlignment) { if (this.DrawText) { sizeMode = ImageSizeMode.ScaledToFit; } Rectangle imageRect = this.ClientRectangle; if (sizeMode == ImageSizeMode.Normal) { if (image.Width < imageRect.Width) { imageRect.Width = image.Width; } if (image.Height < imageRect.Height) { imageRect.Height = image.Height; } } else if (sizeMode == ImageSizeMode.ScaledToFit) { if (image.Width >= imageRect.Width || image.Height >= imageRect.Height) { double hScale = ((double) imageRect.Width) / ((double) image.Width); double vScale = ((double) imageRect.Height) / ((double) image.Height); double scale = Math.Min(hScale, vScale); imageRect.Width = (int) (((double) image.Width) * scale); imageRect.Height = (int) (((double) image.Height) * scale); } else { imageRect.Width = image.Width; imageRect.Height = image.Height; } } if (rowAlignment == RowAlignment.Center) { imageRect.Y += (this.ClientRectangle.Height - imageRect.Height) / 2; } else if (rowAlignment == RowAlignment.Bottom) { imageRect.Y = this.ClientRectangle.Bottom - imageRect.Height; } if (!this.DrawText) { if (columnAlignment == ColumnAlignment.Center) { imageRect.X += (this.ClientRectangle.Width - imageRect.Width) / 2; } else if (columnAlignment == ColumnAlignment.Right) { imageRect.X = this.ClientRectangle.Width - imageRect.Width; } } return imageRect; }
internal void method_79(RowAlignment A_0) { this.method_86(0xfaa, A_0); }
internal void method_74(RowAlignment A_0) { this.method_77(0xfaa, A_0); }