protected override void PaintOverride(Paint.IGraphics screenRadGraphics, Rectangle clipRectangle, float angle, SizeF scale, bool useRelativeTransformation) { base.PaintOverride(screenRadGraphics, clipRectangle, angle, scale, useRelativeTransformation); if (base.Visibility != ElementVisibility.Visible || this.Parent == null) { return; } WizardPageHeaderElement pageHeader = this.Parent as WizardPageHeaderElement; if (pageHeader == null) { return; } RadWizardElement owner = pageHeader.Owner; if (DWMAPI.IsCompositionEnabled && !this.IsDesignMode && owner != null && owner.OwnerControl != null && owner.Mode == WizardMode.Aero && owner.EnableAeroStyle) { TelerikPaintHelper.DrawGlowingText( (Graphics)screenRadGraphics.UnderlayGraphics, this.Text, this.Font, this.ControlBoundingRectangle, this.ForeColor, TextFormatFlags.EndEllipsis | TextFormatFlags.SingleLine | TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter); } }
protected override void DrawHorizontalLineWithoutText(Paint.IGraphics graphics) { Graphics g = (Graphics)graphics.UnderlayGraphics; using (Pen pen = new Pen(this.HorizontalLineColor, this.HorizontalLineWidth)) { g.DrawLine(pen, this.toggleElement.Size.Width, this.Size.Height / 2, this.Size.Width, this.Size.Height / 2); } }
protected override void DrawHorizontalLine(Paint.IGraphics graphics) { SizeF size = this.layoutManagerPart.RightPart.DesiredSize; int x = (int)this.toggleElement.DesiredSize.Width; int y = this.Size.Height / 2; int x2 = 0; int y2 = y; ContentAlignment textAlignment = this.GetTextAlignment(); if (textAlignment == ContentAlignment.MiddleLeft || textAlignment == ContentAlignment.TopLeft || textAlignment == ContentAlignment.BottomLeft) { x += (int)size.Width + 10; x2 = this.Size.Width - 2; } else if (textAlignment == ContentAlignment.MiddleRight || textAlignment == ContentAlignment.TopRight || textAlignment == ContentAlignment.BottomRight) { x += 1; x2 = this.Size.Width - 2 - (int)size.Width - 10; } else if (textAlignment == ContentAlignment.MiddleCenter || textAlignment == ContentAlignment.TopCenter || textAlignment == ContentAlignment.BottomCenter) { x += 1; x2 = this.Size.Width / 2 - (int)size.Width / 2 - 10; } if (x < x2) { Graphics g = (Graphics)graphics.UnderlayGraphics; using (Pen pen = new Pen(this.HorizontalLineColor, this.HorizontalLineWidth)) { g.DrawLine(pen, x, y, x2, y2); if (this.TextAlignment == ContentAlignment.MiddleCenter || this.TextAlignment == ContentAlignment.TopCenter || this.TextAlignment == ContentAlignment.BottomCenter) { x = (this.Size.Width / 2) + (int)size.Width / 2 + 10 + (int)this.toggleElement.DesiredSize.Width; x2 = this.Size.Width - 2; g.DrawLine(pen, x, y, x2, y2); } } } }
protected override void PaintChildren(Paint.IGraphics graphics, Rectangle clipRectange, float angle, SizeF scale, bool useRelativeTransformation) { if (this.Shape != null) { GraphicsPath path = Shape.GetElementShape(this); Graphics g = graphics.UnderlayGraphics as Graphics; if (g != null) { g.Clip = new Region(path); } } base.PaintChildren(graphics, clipRectange, angle, scale, useRelativeTransformation); }