// constructor public CircledProgressBarObjectPainter(object paramObject) { RepositoryItemCircledProgressBar CurrentRepository = paramObject as RepositoryItemCircledProgressBar; currentAngle = CurrentRepository != null ? CurrentRepository.CustomBehavior.StartAngle : CircleStartAngle.Angle90; currentWidthHeightProportion = CurrentRepository != null ? CurrentRepository.CustomBehavior.MinWidthHeightProportion : 5; }
protected override void DrawContent(ControlGraphicsInfoArgs info) { ProgressBarBaseViewInfo vi = info.ViewInfo as ProgressBarBaseViewInfo; RepositoryItemCircledProgressBar item = (RepositoryItemCircledProgressBar)vi.Item; ObjectPainter.DrawObject(info.Cache, vi.ProgressPainter, vi.ProgressInfo); info.Graphics.DrawEllipse(new Pen(item.Appearance.BackColor), CalcProportionalBorderRectangle(info.Bounds, item.CustomBehavior.MinWidthHeightProportion)); DrawCircledProgressBarString(info); }
public override void Assign(RepositoryItem item) { base.Assign(item); RepositoryItemCircledProgressBar currentRepository = (item as RepositoryItemCircledProgressBar); this.CustomBehavior.MinWidthHeightProportion = currentRepository.CustomBehavior.MinWidthHeightProportion; this.CustomBehavior.ShowTextEllipse = currentRepository.CustomBehavior.ShowTextEllipse; this.CustomBehavior.StartAngle = currentRepository.CustomBehavior.StartAngle; this.CustomBehavior.TextEllipseColor = currentRepository.CustomBehavior.TextEllipseColor; }
protected override void DrawBorder(ControlGraphicsInfoArgs info) { ProgressBarBaseViewInfo vi = info.ViewInfo as ProgressBarBaseViewInfo; RepositoryItemCircledProgressBar item = (RepositoryItemCircledProgressBar)vi.Item; if (item.OwnerEdit != null && item.OwnerEdit.InplaceType == DevExpress.XtraEditors.Controls.InplaceType.Standalone) { info.Graphics.FillRectangle(new SolidBrush(item.OwnerEdit.Parent.BackColor), info.Bounds); } }
protected void DrawEllipseAroundTheText(ControlGraphicsInfoArgs info) { CircledProgressBarViewInfo vi = info.ViewInfo as CircledProgressBarViewInfo; RepositoryItemCircledProgressBar item = (RepositoryItemCircledProgressBar)vi.Item; if (item.CustomBehavior.ShowTextEllipse) { SizeF currentTextSize = info.Graphics.MeasureString(vi.DisplayText, vi.Appearance.Font); if ((vi.ContentRect.Height - currentTextSize.Height) > 20) { int iRectForCaptionHeight = (int)currentTextSize.Height + 15; int iRectForCaptionWidth = vi.ContentRect.Width / (vi.ContentRect.Height / iRectForCaptionHeight); int iRectForCaptionX = vi.ContentRect.X + vi.ContentRect.Width / 2 - iRectForCaptionHeight / 2; int iRectForCaptionY = vi.ContentRect.Y + vi.ContentRect.Height / 2 - iRectForCaptionHeight / 2; info.Graphics.FillEllipse(new SolidBrush(item.CustomBehavior.TextEllipseColor), new Rectangle(iRectForCaptionX, iRectForCaptionY, iRectForCaptionHeight, iRectForCaptionHeight)); } } }
// static constructor static CircledProgressBar() { RepositoryItemCircledProgressBar.RegisterCircledProgressBar(); }