public static void PaintCell(NodeCellRendererEventArgs ci) { if(ci.Cell.CheckBoxVisible) CellDisplay.PaintCellCheckBox(ci); if(!ci.Cell.Images.LargestImageSize.IsEmpty) CellDisplay.PaintCellImage(ci); CellDisplay.PaintText(ci); }
public static void PaintCellCheckBox(NodeCellRendererEventArgs ci) { if(!ci.Cell.CheckBoxVisible) return; Rectangle r=ci.Cell.CheckBoxBoundsRelative; r.Offset(ci.CellOffset); System.Windows.Forms.ButtonState state=System.Windows.Forms.ButtonState.Normal; if(ci.Cell.Checked) state=System.Windows.Forms.ButtonState.Checked; System.Windows.Forms.ControlPaint.DrawCheckBox(ci.Graphics,r,state); }
public static void PaintCellImage(NodeCellRendererEventArgs ci) { if(ci.Cell.Images.LargestImageSize.IsEmpty) return; Rectangle r=ci.Cell.ImageBoundsRelative; r.Offset(ci.CellOffset); Image image = CellDisplay.GetCellImage(ci.Cell); if(image!=null) { ci.Graphics.DrawImage(image,r.X+(r.Width-image.Width)/2, r.Y+(r.Height-image.Height)/2); } }
public static void PaintText(NodeCellRendererEventArgs ci) { Cell cell=ci.Cell; if(cell.HostedControl==null && (cell.Text=="" || ci.Style.TextColor.IsEmpty) || cell.TextContentBounds.IsEmpty ) return; Rectangle bounds=ci.Cell.TextContentBounds; bounds.Offset(ci.CellOffset); if(cell.HostedControl!=null) { // if(ci.Graphics.Transform!=null) // { // Point[] p=new Point[] {new Point(bounds.X, bounds.Y), new Point(bounds.Right, bounds.Bottom)}; // ci.Graphics.Transform.TransformPoints(p); // bounds = new Rectangle(p[0].X, p[0].Y, p[1].X-p[0].X, p[1].Y-p[0].Y); // } // if(cell.HostedControl.Bounds!=bounds) // { // cell.IgnoreHostedControlSizeChange = true; // cell.HostedControl.Bounds=bounds; // cell.IgnoreHostedControlSizeChange = false; // } if(!cell.HostedControl.Visible) cell.HostedControl.Visible = true; return; } Font font=ci.Style.Font; bounds.Inflate(1,1); if (cell.TextMarkupBody == null) TextDrawing.DrawString(ci.Graphics , cell.Text, font, ci.Style.TextColor, bounds, ci.Style.TextFormat); else { TextMarkup.MarkupDrawContext d = new TextMarkup.MarkupDrawContext(ci.Graphics, font, ci.Style.TextColor, false); d.HotKeyPrefixVisible = !((ci.Style.TextFormat & eTextFormat.HidePrefix) == eTextFormat.HidePrefix); Rectangle mr = new Rectangle(bounds.X, bounds.Y + (bounds.Height - cell.TextMarkupBody.Bounds.Height) / 2, cell.TextMarkupBody.Bounds.Width, cell.TextMarkupBody.Bounds.Height); mr.Offset((bounds.Width - mr.Width) / 2, 0); cell.TextMarkupBody.Bounds = mr; cell.TextMarkupBody.Render(d); } }
/// <summary> /// Draws cell text. 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 OnRenderCellText method so events can occur. /// </summary> /// <param name="e">Information provided for rendering.</param> public override void DrawCellText(NodeCellRendererEventArgs e) { CellDisplay.PaintText(e); base.DrawCellText(e); }
/// <summary> /// Draws cell image. 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 OnRenderCellImage method so events can occur. /// </summary> /// <param name="e">Information provided for rendering.</param> public override void DrawCellImage(NodeCellRendererEventArgs e) { CellDisplay.PaintCellImage(e); base.DrawCellImage(e); }
/// <summary> /// Draws cell background. 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 OnRenderCellBackground method so events can occur. /// </summary> /// <param name="e">Information provided for rendering.</param> public override void DrawCellBackground(NodeCellRendererEventArgs e) { ElementStyleDisplayInfo di=GetElementStyleDisplayInfo(e.Style,e.Graphics,DisplayHelp.GetDrawRectangle(e.CellBounds)); ElementStyleDisplay.Paint(di); base.DrawCellBackground(e); }
/// <summary> /// Raises RenderCellImage event. /// </summary> /// <param name="e">Event arguments</param> protected virtual void OnRenderCellText(NodeCellRendererEventArgs e) { if(RenderCellText!=null) RenderCellText(this, e); }
/// <summary> /// Raises RenderCellImage event. /// </summary> /// <param name="e">Event arguments</param> protected virtual void OnRenderCellImage(NodeCellRendererEventArgs e) { if(RenderCellImage!=null) RenderCellImage(this, e); }
/// <summary> /// Draws cell text. 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 OnRenderCellText method so events can occur. /// </summary> /// <param name="e">Information provided for rendering.</param> public virtual void DrawCellText(NodeCellRendererEventArgs e) { OnRenderCellText(e); }
/// <summary> /// Draws cell image. 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 OnRenderCellImage method so events can occur. /// </summary> /// <param name="e">Information provided for rendering.</param> public virtual void DrawCellImage(NodeCellRendererEventArgs e) { OnRenderCellImage(e); }
/// <summary> /// Raises RenderCellCheckBox event. /// </summary> /// <param name="e">Event arguments</param> protected virtual void OnRenderCellCheckBox(NodeCellRendererEventArgs e) { if(RenderCellCheckBox!=null) RenderCellCheckBox(this, e); }
/// <summary> /// Draws cell check box. 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 OnRenderCellCheckBox method so events can occur. /// </summary> /// <param name="e">Information provided for rendering.</param> public virtual void DrawCellCheckBox(NodeCellRendererEventArgs e) { OnRenderCellCheckBox(e); }
/// <summary> /// Raises RenderCellBackground event. /// </summary> /// <param name="e">Event arguments</param> protected virtual void OnRenderCellBackground(NodeCellRendererEventArgs e) { if(RenderCellBackground!=null) RenderCellBackground(this, e); }
/// <summary> /// Draws cell background. 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 OnRenderCellBackground method so events can occur. /// </summary> /// <param name="e">Information provided for rendering.</param> public virtual void DrawCellBackground(NodeCellRendererEventArgs e) { OnRenderCellBackground(e); }