Exemple #1
0
        protected void DrawCircledProgressBarString(ControlGraphicsInfoArgs info)
        {
            ProgressBarBaseViewInfo vi   = info.ViewInfo as ProgressBarBaseViewInfo;
            Brush             emptyBrush = vi.ProgressAppearance.GetForeBrush(info.Cache);
            Brush             fillBrush  = vi.ProgressAppearance.GetFore2Brush(info.Cache);
            GraphicsClipState clip       = info.Cache.ClipInfo.SaveAndSetClip(info.Bounds);

            try
            {
                if (vi.ProgressInfo.ProgressBounds.Width == 0)
                {
                    info.Cache.DrawString(vi.DisplayText, vi.PaintAppearance.Font, emptyBrush, vi.ContentRect, vi.StrFormat);
                    return;
                }
                info.Cache.ClipInfo.ExcludeClip(vi.ProgressInfo.ProgressBounds);
                DrawEllipseAroundTheText(info);
                info.Cache.DrawString(vi.DisplayText, vi.PaintAppearance.Font, emptyBrush, vi.ContentRect, vi.StrFormat);
                info.Cache.ClipInfo.SetClip(vi.ProgressInfo.ProgressBounds);
                DrawEllipseAroundTheText(info);
                info.Cache.DrawString(vi.DisplayText, vi.PaintAppearance.Font, emptyBrush, vi.ContentRect, vi.StrFormat);
            }
            finally
            {
                info.Cache.ClipInfo.RestoreClipRelease(clip);
            }
        }
        void gridView1_CustomDrawGroupRow(object sender, RowObjectCustomDrawEventArgs e)
        {
            GridGroupRowInfo info      = (GridGroupRowInfo)e.Info;
            string           groupText = info.GroupText;

            info.GroupText = "[#image]";

            //default drawing
            _GridPainter.ElementsPainter.GroupRow.DrawGroupRowBackground(e.Info);
            ObjectPainter.DrawObject(e.Cache, _GridPainter.ElementsPainter.GroupRow, e.Info);
            info.GroupText = groupText;

            //draw caption
            Rectangle bounds = info.ButtonBounds;

            bounds.X     = bounds.Right + 20;
            bounds.Width = info.Bounds.Right - bounds.Right - progressBarWidth;
            bounds.Offset(progressBarWidth, 0);
            info.CreateEditorInfo(bounds, info.Appearance.GetForeColor());
            ObjectPainter.DrawObject(e.Cache, info.CreatePainter(), info.EditorInfo);

            //draw progressbar
            bounds       = info.ButtonBounds;
            bounds.X     = bounds.Right + 5;
            bounds.Width = progressBarWidth;
            bounds.Inflate(0, 2);
            ProgressBarBaseViewInfo vi   = CreateViewInfo(bounds, (float)0.50, e.Graphics);
            ControlGraphicsInfoArgs args = new ControlGraphicsInfoArgs(vi, e.Cache, bounds);

            _PBPainter.Draw(args);
            e.Handled = true;
        }
Exemple #3
0
        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 ProgressBarBaseViewInfo CreateViewInfo(Rectangle bounds, float percent, Graphics g)
        {
            ProgressBarBaseViewInfo vi = new ProgressBarBaseViewInfo(_RI);

            vi.Bounds = bounds;
            vi.ProgressInfo.Percent = percent;
            vi.CalcViewInfo(g);
            return(vi);
        }
Exemple #5
0
        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);
            }
        }
Exemple #6
0
        protected override bool IsDrawBorderLast(ControlGraphicsInfoArgs info)
        {
            ProgressBarBaseViewInfo vi = info.ViewInfo as ProgressBarBaseViewInfo;

            if (vi.BorderPainter is WindowsXPProgressBarBorderPainter)
            {
                return(false);
            }
            if (vi.ProgressPainter is CircledProgressBarObjectPainter)
            {
                return(false);
            }
            return(true);
        }