public void PaintSelection(SelectionRendererEventArgs info) { Rectangle inside=info.Bounds; inside.Inflate(1,1); inside.Width--; inside.Height--; Rectangle outside=info.Bounds; outside.Inflate(info.Width,info.Width); outside.Width--; outside.Height--; if(!info.BorderColor.IsEmpty) { using(Pen pen=new Pen(info.BorderColor,1)) { info.Graphics.DrawRectangle(pen,inside); info.Graphics.DrawRectangle(pen,outside); } } if(!info.FillColor.IsEmpty) { using(SolidBrush brush=new SolidBrush(info.FillColor)) { Region region=new Region(outside); region.Exclude(inside); info.Graphics.FillRegion(brush,region); } } }
public void PaintSelection(SelectionRendererEventArgs info) { if (info.SelectionBoxStyle == eSelectionStyle.HighlightCells) PaintHighlightCellsSelectionStyle(info); else if (info.SelectionBoxStyle == eSelectionStyle.FullRowSelect) PaintFullRowSelectSelectionStyle(info); else if (info.SelectionBoxStyle == eSelectionStyle.NodeMarker) PaintNodeMarkerSelectionStyle(info); }
private void PaintHighlightCellsSelectionStyle(SelectionRendererEventArgs info) { // Full row is just a rectangle with the background... Shape[] fullRowShapes = GetHighlightCellsShapes(info.TreeActive); Graphics g = info.Graphics; Rectangle bounds = info.Bounds; bounds.Width--; bounds.Height--; foreach (Shape shape in fullRowShapes) { shape.Paint(g, bounds); } }
public void PaintHotTracking(SelectionRendererEventArgs info) { // Full row is just a rectangle with the background... Shape[] fullRowShapes = GetHotTrackingShapes(); Graphics g = info.Graphics; Rectangle bounds = info.Bounds; bounds.Width--; bounds.Height--; foreach (Shape shape in fullRowShapes) { shape.Paint(g, bounds); } }
/// <summary> /// Raises RenderHotTracking event. /// </summary> /// <param name="e">Event data.</param> protected virtual void OnRenderHotTracking(SelectionRendererEventArgs e) { if (RenderHotTracking != null) RenderHotTracking(this, e); }
/// <summary> /// Draws hot-tracking marker for mouse over node. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you /// do not want default rendering to occur do not call the base implementation. You can call OnRenderHotTracking method so events can occur. /// </summary> /// <param name="e">Information provided for rendering.</param> public virtual void DrawHotTracking(SelectionRendererEventArgs e) { OnRenderHotTracking(e); }
/// <summary> /// Raises RenderSelection event. /// </summary> /// <param name="e">Event data.</param> protected virtual void OnRenderSelection(SelectionRendererEventArgs e) { if(RenderSelection!=null) RenderSelection(this, e); }
/// <summary> /// Draws selection for SelectedNode. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you /// do not want default rendering to occur do not call the base implementation. You can call OnRenderSelection method so events can occur. /// </summary> /// <param name="e">Information provided for rendering.</param> public virtual void DrawSelection(SelectionRendererEventArgs e) { OnRenderSelection(e); }
/// <summary> /// Draws selection for SelectedNode. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you /// do not want default rendering to occur do not call the base implementation. You can call OnRenderSelection method so events can occur. /// </summary> /// <param name="e">Information provided for rendering.</param> public override void DrawSelection(SelectionRendererEventArgs e) { m_SelectionDisplay.PaintSelection(e); base.DrawSelection(e); }
private void PaintNodeMarkerSelectionStyle(SelectionRendererEventArgs info) { Rectangle inside = info.Bounds; int borderWidth = 4; inside.Inflate(1, 1); inside.Width--; inside.Height--; Rectangle outside = info.Bounds; outside.Inflate(borderWidth, borderWidth); outside.Width--; outside.Height--; SelectionColorTable colorTable = info.TreeActive ? _SelectionColors.NodeMarker : _SelectionColors.NodeMarkerInactive; if (colorTable.Border != null) { Pen pen = colorTable.Border.CreatePen(); if (pen != null) { info.Graphics.DrawRectangle(pen, inside); info.Graphics.DrawRectangle(pen, outside); pen.Dispose(); } } if (colorTable.Fill != null) { Brush brush = colorTable.Fill.CreateBrush(outside); if (brush != null) { Region region = new Region(outside); region.Exclude(inside); info.Graphics.FillRegion(brush, region); brush.Dispose(); } } }