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); } }
/// <summary>Create <see cref="FlowProgressPanel"/>.</summary> public FlowProgressPanel() { _height = 150; _overlay = new ProcessOverlay() { DisableHost = false, InvalidateHost = false, }; _overlay.RepaintRequired += (sender, e) => InvalidateSafe(); }
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); } }
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); } }
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); } }
public abstract void PaintMessage(ProcessOverlay processOverlay, Graphics graphics, Rectangle bounds, string status);
public abstract void Paint(ProcessOverlay processOverlay, Graphics graphics, Rectangle bounds);
/// <summary>Create <see cref="CustomListBox"/>.</summary> public CustomListBox() { _items = new CustomListBoxItemsCollection(this, null); _items.Changing += OnItemsChanging; _items.Changed += OnItemsChanged; _columns = new CustomListBoxColumnsCollection(this); _columns.Changed += OnColumnsChanged; _selectedItems = new CustomListBoxSelectedItemsCollection(this); _selectedItems.Changed += OnSelectedItemsChanged; _itemPlainList = new List<CustomListBoxItem>(); _processOverlay = new ProcessOverlay(this); _processOverlay.Renderer = Style.OverlayRenderer; _itemHover = new TrackingService<CustomListBoxItem>(OnItemHoverChanged); _itemFocus = new TrackingService<CustomListBoxItem>(OnItemFocusChanged); _headerHover = new TrackingService<CustomListBoxColumn>(OnHeaderHoverChanged); _headerDragHelper = new DragHelper(); _showRootTreeLines = true; _allowColumnReorder = true; _integralScroll = true; _lastClickedItemIndex = -1; _draggedHeaderIndex = -1; _columnHeaderHeight = DEFAULT_ITEM_HEIGHT; _itemHeight = DEFAULT_ITEM_HEIGHT; _renderer = Style.ListBoxRenderer; BackColor = Renderer.BackColor; ForeColor = Renderer.ForeColor; _tooltip = new ToolTip() { InitialDelay = 350, }; }
public ProcessOverlayControl() { InitializeComponent(); _overlay = new ProcessOverlay(this); }