示例#1
0
        public override void Paint(ProcessOverlay processOverlay, Graphics graphics, Rectangle bounds)
        {
            const int spacing = 10;

            using (var brush = new SolidBrush(Color.FromArgb(BackgroundAlpha, ColorTable.Background)))
            {
                graphics.FillRectangle(brush, bounds);
            }
            var font = processOverlay.Font;
            var tw   = GitterApplication.TextRenderer.MeasureText(
                graphics, processOverlay.Title, font, bounds.Width, TitleStringFormat).Width;
            var oldMode = graphics.SmoothingMode;

            graphics.SmoothingMode = SmoothingMode.HighQuality;
            DrawIndeterminateProgress(graphics, bounds.X + (bounds.Width - tw) / 2 - 14 - 5, bounds.Y + (bounds.Height - 14) / 2, 14, 14);
            graphics.SmoothingMode = oldMode;
            var titleRect = new Rectangle(bounds.X + (bounds.Width - tw) / 2, bounds.Y, bounds.Width - spacing * 2 - 5 - 14, bounds.Height);

            if (!string.IsNullOrWhiteSpace(processOverlay.Title))
            {
                GitterApplication.TextRenderer.DrawText(
                    graphics, processOverlay.Title, font, ColorTable.Text, titleRect, TitleStringFormat);
            }
            if (!string.IsNullOrWhiteSpace(processOverlay.Message))
            {
                GitterApplication.TextRenderer.DrawText(
                    graphics, processOverlay.Message, font, ColorTable.Text, bounds, StringFormat);
            }
        }
示例#2
0
 /// <summary>Create <see cref="FlowProgressPanel"/>.</summary>
 public FlowProgressPanel()
 {
     _height  = 150;
     _overlay = new ProcessOverlay()
     {
         DisableHost    = false,
         InvalidateHost = false,
     };
     _overlay.RepaintRequired += (sender, e) => InvalidateSafe();
 }
示例#3
0
 public override void PaintMessage(ProcessOverlay processOverlay, Graphics graphics, Rectangle bounds, string status)
 {
     using (var brush = new SolidBrush(Color.FromArgb(BackgroundAlpha, ColorTable.Background)))
     {
         graphics.FillRectangle(brush, bounds);
     }
     if (!string.IsNullOrWhiteSpace(status))
     {
         GitterApplication.TextRenderer.DrawText(
             graphics, status, processOverlay.Font, ColorTable.Text, bounds, StringFormat);
     }
 }
示例#4
0
 public override void PaintMessage(ProcessOverlay processOverlay, Graphics graphics, Rectangle bounds, string status)
 {
     using (var path = GraphicsUtility.GetRoundedRectangle(bounds, processOverlay.Rounding))
     {
         var oldMode = graphics.SmoothingMode;
         graphics.SmoothingMode = SmoothingMode.HighQuality;
         using (var brush = new SolidBrush(BackgroundColor))
         {
             graphics.FillPath(brush, path);
         }
         using (var pen = new Pen(BorderColor, 2.0f))
         {
             graphics.DrawPath(pen, path);
         }
         graphics.SmoothingMode = oldMode;
     }
     if (!string.IsNullOrWhiteSpace(status))
     {
         GitterApplication.TextRenderer.DrawText(
             graphics, status, processOverlay.Font, FontBrush, bounds, StringFormat);
     }
 }
示例#5
0
        public override void Paint(ProcessOverlay processOverlay, Graphics graphics, Rectangle bounds)
        {
            var font    = processOverlay.Font;
            var oldMode = graphics.SmoothingMode;

            graphics.SmoothingMode = SmoothingMode.HighQuality;
            const int spacing = 10;

            using (var path = GraphicsUtility.GetRoundedRectangle(bounds, processOverlay.Rounding))
            {
                using (var brush = new SolidBrush(BackgroundColor))
                {
                    graphics.FillPath(brush, path);
                }
                using (var pen = new Pen(BorderColor, 2.0f))
                {
                    graphics.DrawPath(pen, path);
                }
            }
            var tw = GitterApplication.TextRenderer.MeasureText(
                graphics, processOverlay.Title, font, bounds.Width, TitleStringFormat).Width;

            DrawIndeterminateProgress(graphics, bounds.X + (bounds.Width - tw) / 2 - 14 - 5, bounds.Y + (bounds.Height - 14) / 2, 14, 14);
            var titleRect = new Rectangle(bounds.X + (bounds.Width - tw) / 2, bounds.Y, bounds.Width - spacing * 2 - 5 - 14, bounds.Height);

            graphics.SmoothingMode = oldMode;
            if (!string.IsNullOrWhiteSpace(processOverlay.Title))
            {
                GitterApplication.TextRenderer.DrawText(
                    graphics, processOverlay.Title, font, FontBrush, titleRect, TitleStringFormat);
            }
            if (!string.IsNullOrWhiteSpace(processOverlay.Message))
            {
                GitterApplication.TextRenderer.DrawText(
                    graphics, processOverlay.Message, font, FontBrush, bounds, StringFormat);
            }
        }
示例#6
0
        public ProcessOverlayControl()
        {
            InitializeComponent();

            _overlay = new ProcessOverlay(this);
        }
示例#7
0
 public abstract void PaintMessage(ProcessOverlay processOverlay, Graphics graphics, Rectangle bounds, string status);
示例#8
0
 public abstract void Paint(ProcessOverlay processOverlay, Graphics graphics, Rectangle bounds);