public override void Paint(StiComponent component, StiPaintEventArgs e) { DrawingContext dc = e.Context as DrawingContext; RectangleD rectD = component.GetPaintRectangle(true, false); Rect rect = new Rect(rectD.Left, rectD.Top, rectD.Width, rectD.Height); if (rect.Width > 0 && rect.Height > 0) { MyCustomComponent customComponent = component as MyCustomComponent; #region Fill rectangle PaintBackground(customComponent, dc, rect); #endregion #region Markers if (customComponent.HighlightState == StiHighlightState.Hide && customComponent.Border.Side != StiBorderSides.All) { PaintMarkers(customComponent, dc, rect); } #endregion //Own drawing #region Border base.PaintBorder(customComponent, dc, rect, true, true); #endregion } PaintEvents(component, dc, rect); PaintConditions(component, dc, rect); PaintInteraction(component, dc); }
/// <summary> /// Rendering of the component without events. /// </summary> /// <param name="renderedComponent">Rendered component.</param> /// <param name="outContainer">Panel in which rendering will be done.</param> /// <returns>Is rendering finished or not.</returns> protected override bool RenderComponent(ref StiComponent renderedComponent, StiContainer outContainer) { MyCustomComponent component = (MyCustomComponent)this.Clone(); component.InvokeEvents(); outContainer.Components.Add(component); renderedComponent = component; return(true); }
public virtual void PaintBackground(MyCustomComponent customComponent, Graphics g, RectangleD rect) { if (customComponent.Brush is StiSolidBrush && ((StiSolidBrush)customComponent.Brush).Color == Color.Transparent && customComponent.Report.Info.FillComponent && customComponent.IsDesigning) { Color color = Color.FromArgb(150, Color.White); StiDrawing.FillRectangle(g, color, rect.Left, rect.Top, rect.Width, rect.Height); } else { StiDrawing.FillRectangle(g, customComponent.Brush, rect); } }
public virtual void PaintBackground(MyCustomComponent customComponent, DrawingContext dc, Rect rect) { if (customComponent.Brush is StiSolidBrush && ((StiSolidBrush)customComponent.Brush).Color == System.Drawing.Color.Transparent && customComponent.Report.Info.FillComponent && customComponent.IsDesigning) { Color color = Colors.White; color.A = 150; Brush brush = new SolidColorBrush(color); dc.DrawRectangle(brush, null, rect); } else { dc.DrawRectangle(StiBrushHelper.BrushToWpfBrush(customComponent.Brush), null, rect); } }
public override void Paint(StiComponent component, StiPaintEventArgs e) { Graphics g = e.Graphics; RectangleD rect = component.GetPaintRectangle(); if (rect.Width > 0 && rect.Height > 0 && (e.ClipRectangle.IsEmpty || rect.IntersectsWith(e.ClipRectangle))) { MyCustomComponent customComponent = component as MyCustomComponent; #region Fill rectangle PaintBackground(customComponent, g, rect); #endregion #region Markers if (customComponent.HighlightState == StiHighlightState.Hide && customComponent.Border.Side != StiBorderSides.All) { PaintMarkers(customComponent, g, rect); } #endregion RectangleD borderRect = rect; //Own drawing #region Border base.PaintBorder(customComponent, g, borderRect); #endregion } PaintEvents(component, e.Graphics, rect); PaintConditions(component, e.Graphics, rect); PaintQuickButtons(component, e.Graphics); PaintInteraction(component, e.Graphics); }
public override StiComponent InternalRender(StiComponent masterComp) { MyCustomComponent renderedComponent = base.InternalRender(masterComp) as MyCustomComponent; return(renderedComponent); }