/// <summary> /// Returns the copy of the style. /// </summary> /// <returns>Copy of the style.</returns> public void CopyTo(RowHeaderVisualStyle copy) { base.CopyTo(copy); if (_ActiveRowIndicatorColor.IsEmpty == false) copy.ActiveRowIndicatorColor = _ActiveRowIndicatorColor; if (_ActiveRowBackground != null) copy.ActiveRowBackground = _ActiveRowBackground.Copy(); if (_DirtyMarkerBackground != null) copy.DirtyMarkerBackground = _DirtyMarkerBackground.Copy(); copy.ActiveRowImage = _ActiveRowImage; copy.ActiveRowImageIndex = _ActiveRowImageIndex; copy.EditingRowImage = _EditingRowImage; copy.EditingRowImageIndex = _EditingRowImageIndex; copy.InfoRowImage = _InfoRowImage; copy.InfoRowImageIndex = _InfoRowImageIndex; }
/// <summary> /// Applies the style to instance of this style. /// </summary> /// <param name="style">Style to apply.</param> public void ApplyStyle(RowHeaderVisualStyle style) { if (style != null) { base.ApplyStyle(style); if (style._ActiveRowIndicatorColor.IsEmpty == false) _ActiveRowIndicatorColor = style._ActiveRowIndicatorColor; if (style._ActiveRowBackground != null && style._ActiveRowBackground.IsEmpty == false) _ActiveRowBackground = style._ActiveRowBackground.Copy(); if (style._DirtyMarkerBackground != null && style._DirtyMarkerBackground.IsEmpty == false) _DirtyMarkerBackground = style._DirtyMarkerBackground.Copy(); if (style.ActiveRowImageIndex >= 0) { _ActiveRowImage = null; _ActiveRowImageIndex = style.ActiveRowImageIndex; } if (style.ActiveRowImage != null) { _ActiveRowImage = style.ActiveRowImage; _ActiveRowImageIndex = -1; } if (style.EditingRowImageIndex >= 0) { _EditingRowImage = null; _EditingRowImageIndex = style.EditingRowImageIndex; } if (style.EditingRowImage != null) { _EditingRowImage = style.EditingRowImage; _EditingRowImageIndex = -1; } if (style.InfoRowImageIndex >= 0) { _InfoRowImage = null; _InfoRowImageIndex = style.InfoRowImageIndex; } if (style.InfoRowImage != null) { _InfoRowImage = style.InfoRowImage; _InfoRowImageIndex = -1; } } }
/// <summary> /// Returns the copy of the style. /// </summary> /// <returns>Copy of the style.</returns> public new RowHeaderVisualStyle Copy() { RowHeaderVisualStyle copy = new RowHeaderVisualStyle(); CopyTo(copy); return (copy); }
///<summary> /// GridGetRowHeaderStyleEventArgs ///</summary> ///<param name="gridPanel"></param> ///<param name="row"></param> ///<param name="styleType"></param> ///<param name="style"></param> public GridGetRowHeaderStyleEventArgs( GridPanel gridPanel, GridContainer row, StyleType styleType, RowHeaderVisualStyle style) : base(gridPanel, row) { _StyleType = styleType; _Style = style; }
/// <summary> /// Handles invocation of GetRowHeader events /// </summary> internal void DoGetRowHeaderStyleEvent( GridContainer gridRow, StyleType eStyle, ref RowHeaderVisualStyle style) { if (GetRowHeaderStyle != null) { GridGetRowHeaderStyleEventArgs ev = new GridGetRowHeaderStyleEventArgs(gridRow.GridPanel, gridRow, eStyle, style); GetRowHeaderStyle(this, ev); style = ev.Style; } }
private RowVisualStyle GetMouseOverRowStyle(ColorFactory factory) { RowVisualStyle rowStyle = new RowVisualStyle(); rowStyle.Background = new Background(Color.White); RowHeaderVisualStyle style = new RowHeaderVisualStyle(); style.Background = new Background(Color.Plum); style.ActiveRowBackground = new Background(Color.Blue); Background bg = new Background(); BackColorBlend bcb = new BackColorBlend(); bcb.Colors = new Color[3]; bcb.Colors[0] = factory.GetColor(0xFFE575); bcb.Colors[1] = factory.GetColor(0xFFE575); bcb.Colors[2] = factory.GetColor(0xF2CD66); bcb.Positions = new float[3]; bcb.Positions[0] = 0f; bcb.Positions[1] = .75f; bcb.Positions[2] = 1f; bg.BackColorBlend = bcb; bg.GradientAngle = 0; style.Background = bg; style.TextColor = factory.GetColor(0x444444); bg = new Background(); bcb = new BackColorBlend(); bcb.Colors = new Color[3]; bcb.Colors[0] = Color.FromArgb(254 - 20, 240 - 20, 214 - 20); bcb.Colors[1] = Color.FromArgb(254 - 30, 199 - 30, 104 - 30); bcb.Colors[2] = Color.FromArgb(229 - 30, 133 - 30, 0); bcb.Positions = new float[3]; bcb.Positions[0] = 0f; bcb.Positions[1] = .75f; bcb.Positions[2] = 1f; bg.BackColorBlend = bcb; bg.GradientAngle = 0; style.ActiveRowBackground = bg; rowStyle.RowHeaderStyle = style; return (rowStyle); }
private RowVisualStyle GetSelectedMouseOverRowStyle(DefaultVisualStyles visualStyle, ColorFactory factory) { RowVisualStyle rowStyle = new RowVisualStyle(); rowStyle.Background = GetDefaultSelectedBackground(factory); RowHeaderVisualStyle style = new RowHeaderVisualStyle(); style.Background = new Background(factory.GetColor(0xBABABA)); style.ActiveRowBackground = new Background(factory.GetColor(0xBABABA)); style.TextColor = factory.GetColor(0x444444); rowStyle.RowHeaderStyle = style; visualStyle.RowStyles[StyleType.Selected] = rowStyle; rowStyle = new RowVisualStyle(); rowStyle.Background = GetSelectedColumnMouseOverBackground(factory); style = new RowHeaderVisualStyle(); style.Background = new Background(factory.GetColor(0xFFEB91)); style.ActiveRowBackground = new Background(factory.GetColor(0xB7DBFF)); rowStyle.RowHeaderStyle = style; return (rowStyle); }
private RowVisualStyle GetDefaultRowStyle(ColorFactory factory) { RowVisualStyle rowStyle = new RowVisualStyle(); rowStyle.Background = new Background(factory.GetColor(Color.White)); RowHeaderVisualStyle style = new RowHeaderVisualStyle(); style.Font = SystemFonts.DefaultFont; style.TextColor = factory.GetColor(0x1E395B); Background bg = new Background(); BackColorBlend bcb = new BackColorBlend(); bcb.Colors = new Color[3]; bcb.Colors[0] = factory.GetColor(0x6A6A6A); bcb.Colors[1] = factory.GetColor(0x6A6A6A); bcb.Colors[2] = factory.GetColor(0x5E5E5E); bcb.Positions = new float[3]; bcb.Positions[0] = 0f; bcb.Positions[1] = .75f; bcb.Positions[2] = 1f; bg.BackColorBlend = bcb; bg.GradientAngle = 0; style.Background = bg; style.TextColor = factory.GetColor(0xE2E2E2); bg = new Background(factory.GetColor(0x6A6A6A)); style.ActiveRowBackground = bg; style.DirtyMarkerBackground = new Background(factory.GetColor(0xAE054F), factory.GetColor(0xE75E94), BackFillType.VerticalCenter); style.BorderHighlightColor = GetBorderHighlight(factory); rowStyle.RowHeaderStyle = style; return (rowStyle); }
private RowVisualStyle GetSelectedMouseOverRowStyle(DefaultVisualStyles visualStyle, ColorFactory factory) { MetroPartColors metroColors = _MetroPartColors; RowVisualStyle rowStyle = new RowVisualStyle(); rowStyle.Background = GetDefaultSelectedBackground(factory); RowHeaderVisualStyle style = new RowHeaderVisualStyle(); style.Background = new Background(metroColors.BaseColor); style.ActiveRowBackground = new Background(metroColors.BaseColor); rowStyle.RowHeaderStyle = style; visualStyle.RowStyles[StyleType.Selected] = rowStyle; rowStyle = new RowVisualStyle(); rowStyle.Background = GetSelectedColumnMouseOverBackground(); style = new RowHeaderVisualStyle(); style.Background = new Background(metroColors.BaseColor); style.ActiveRowBackground = new Background(metroColors.BaseColor); rowStyle.RowHeaderStyle = style; return (rowStyle); }
private RowVisualStyle GetMouseOverRowStyle() { MetroPartColors metroColors = _MetroPartColors; RowVisualStyle rowStyle = new RowVisualStyle(); rowStyle.Background = new Background(metroColors.CanvasColor); RowHeaderVisualStyle style = new RowHeaderVisualStyle(); style.Background = new Background(metroColors.CanvasColorLighterShade); style.ActiveRowBackground = new Background(metroColors.CanvasColorLightShade); Background bg = new Background(metroColors.CanvasColorLightShade); style.Background = bg; bg = new Background(metroColors.BaseColor); style.ActiveRowBackground = bg; rowStyle.RowHeaderStyle = style; return (rowStyle); }
private RowVisualStyle GetDefaultRowStyle() { MetroPartColors metroColors = _MetroPartColors; RowVisualStyle rowStyle = new RowVisualStyle(); rowStyle.Background = new Background(metroColors.CanvasColor); RowHeaderVisualStyle style = new RowHeaderVisualStyle(); style.Font = SystemFonts.DefaultFont; style.TextColor = metroColors.TextColor; Background bg = new Background(metroColors.CanvasColorLighterShade); style.Background = bg; bg = new Background(metroColors.BaseColor); style.ActiveRowBackground = bg; style.DirtyMarkerBackground = new Background(metroColors.BaseColorDarker); style.BorderHighlightColor = GetBorderHighlight(); rowStyle.RowHeaderStyle = style; return (rowStyle); }
private void RenderGridIndex(Graphics g, GridContainer row, RowHeaderVisualStyle style, Rectangle r) { string text = (row.GridIndex + row.GridPanel.RowHeaderIndexOffset).ToString(); Font font = style.Font ?? SystemFonts.DefaultFont; r.Inflate(-2, 0); TextDrawing.DrawString(g, text, font, style.TextColor, r, style.GetTextFormatFlags()); return; }