/// <summary> /// Raises the <see cref="Paint"/> event. /// </summary> /// <param name="e">Event arguments.</param> protected virtual void OnPaint(CellPaintEventArgs e) { #pragma warning disable 618 if (Paint != null) { Paint(this, (DrawableCellPaintEventArgs)e); } #pragma warning restore 618 }
/// <summary> /// Raises the <see cref="PropertyCellType.OnPaint"/> event. /// </summary> /// <param name="args">Cell paint arguments.</param> protected override void OnPaint(CellPaintEventArgs args) { var type = GetType(args.Item); if (type != null) { type.OnPaint(args); } base.OnPaint(args); }
/// <summary> /// Paints the cell when <see cref="CustomCell.SupportsControlView"/> is false. /// </summary> /// <remarks> /// For platforms like GTK and WinForms which don't support using a custom control per cell, this will be called /// to paint the content of the cell when it is not in edit mode. /// </remarks> /// <param name="args">Cell paint arguments.</param> public override void OnPaint(CellPaintEventArgs args) { if (ItemBinding == null) { return; } var value = ItemBinding.GetValue(args.Item); args.DrawCenteredText(Convert.ToString(value)); }
/// <summary> /// Paints the cell when <see cref="CustomCell.SupportsControlView"/> is false. /// </summary> /// <remarks> /// For platforms like GTK and WinForms which don't support using a custom control per cell, this will be called /// to paint the content of the cell when it is not in edit mode. /// </remarks> /// <param name="args">Cell paint arguments.</param> public override void OnPaint(CellPaintEventArgs args) { if (ItemBinding == null) { return; } var value = ItemBinding.GetValue(args.Item); args.DrawCenteredText(string.Format("{0:d}", value)); }
/// <summary> /// Paints the cell when <see cref="CustomCell.SupportsControlView"/> is false. /// </summary> /// <remarks> /// For platforms like GTK and WinForms which don't support using a custom control per cell, this will be called /// to paint the content of the cell when it is not in edit mode. /// </remarks> /// <param name="args">Cell paint arguments.</param> public override void OnPaint(CellPaintEventArgs args) { if (ItemBinding == null) { return; } var value = ItemBinding.GetValue(args.Item); var color = args.IsSelected ? SystemColors.HighlightText : SystemColors.ControlText; args.Graphics.DrawText(SystemFonts.Default(), color, args.ClipRectangle.Location, Convert.ToString(value)); }
/// <summary> /// Paints the cell when <see cref="CustomCell.SupportsControlView"/> is false. /// </summary> /// <remarks> /// For platforms like GTK and WinForms which don't support using a custom control per cell, this will be called /// to paint the content of the cell when it is not in edit mode. /// </remarks> /// <param name="args">Cell paint arguments.</param> public override void OnPaint(CellPaintEventArgs args) { if (ItemBinding == null) { return; } var value = ItemBinding.GetValue(args.Item); var color = args.IsSelected ? SystemColors.HighlightText : SystemColors.ControlText; args.Graphics.DrawText(SystemFonts.Default(), color, args.ClipRectangle.Location, value.ToHex(ShowAlpha)); var rect = args.ClipRectangle; rect.Left = rect.Right - 35; args.Graphics.FillRectangle(value, rect); }
/// <summary> /// Paints the cell when <see cref="CustomCell.SupportsControlView"/> is false. /// </summary> /// <remarks> /// For platforms like GTK and WinForms which don't support using a custom control per cell, this will be called /// to paint the content of the cell when it is not in edit mode. /// </remarks> /// <param name="args">Cell paint arguments.</param> public override void OnPaint(CellPaintEventArgs args) { if (ItemBinding == null) { return; } var value = ItemBinding.GetValue(args.Item); const int size = 35; var rect = args.ClipRectangle; rect.Right -= size; args.DrawCenteredText(value.ToHex(ShowAlpha), rect: rect); rect = args.ClipRectangle; rect.Left = rect.Right - size; args.Graphics.FillRectangle(value, rect); }
/// <summary> /// Paints the cell when <see cref="CustomCell.SupportsControlView"/> is false. /// </summary> /// <remarks> /// For platforms like GTK and WinForms which don't support using a custom control per cell, this will be called /// to paint the content of the cell when it is not in edit mode. /// </remarks> /// <param name="args">Cell paint arguments.</param> public abstract void OnPaint(CellPaintEventArgs args);
/// <summary> /// Paints the cell when viewing for platforms that don't support custom controls for non-editing cells (E.g. Gtk, WinForms). /// </summary> /// <param name="args">Arguments to paint the cell</param> public abstract void PaintCell(CellPaintEventArgs args);
protected override void OnPaint(CellPaintEventArgs args) { var item = (MyGridItem)args.Item; if (!args.IsEditing) args.Graphics.DrawText(SystemFonts.Default(), Colors.Black, args.ClipRectangle.Location, item.Text); //args.Graphics.DrawLine(Colors.Blue, args.ClipRectangle.TopLeft, args.ClipRectangle.BottomRight); }
/// <summary> /// Raises the paint event. /// </summary> public void OnPaint(CustomCell widget, CellPaintEventArgs args) { using (widget.Platform.Context) widget.OnPaint(args); }
/// <summary> /// Raises the <see cref="Paint"/> event. /// </summary> /// <param name="args">Cell paint arguments.</param> protected virtual void OnPaint(CellPaintEventArgs args) { Properties.TriggerEvent(PaintEvent, this, args); }
/// <summary> /// Raises the paint event. /// </summary> public void OnPaint(CustomCell widget, CellPaintEventArgs args) { widget.Platform.Invoke(() => widget.OnPaint(args)); }
/// <summary> /// Raises the <see cref="Paint"/> event. /// </summary> /// <param name="e">Event arguments.</param> protected virtual void OnPaint(CellPaintEventArgs e) { #pragma warning disable 618 if (Paint != null) Paint(this, (DrawableCellPaintEventArgs)e); #pragma warning restore 618 }