public PrintProgressBar() { MinimumSize = new Vector2(0, 24); HAnchor = HAnchor.ParentLeftRight; BackgroundColor = ActiveTheme.Instance.SecondaryAccentColor; Margin = new BorderDouble(0); FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.LeftToRight); container.AnchorAll(); container.Padding = new BorderDouble(6, 0); printTimeElapsed = new TextWidget("", pointSize: 11); printTimeElapsed.Printer.DrawFromHintedCache = true; printTimeElapsed.AutoExpandBoundsToText = true; printTimeElapsed.VAnchor = Agg.UI.VAnchor.ParentCenter; printTimeRemaining = new TextWidget("", pointSize: 11); printTimeRemaining.Printer.DrawFromHintedCache = true; printTimeRemaining.AutoExpandBoundsToText = true; printTimeRemaining.VAnchor = Agg.UI.VAnchor.ParentCenter; GuiWidget spacer = new GuiWidget(); spacer.HAnchor = Agg.UI.HAnchor.ParentLeftRight; container.AddChild(printTimeElapsed); container.AddChild(spacer); container.AddChild(printTimeRemaining); AddChild(container); ClickWidget clickOverlay = new ClickWidget(); clickOverlay.AnchorAll(); clickOverlay.Click += onProgressBarClick; AddChild(clickOverlay); AddHandlers(); SetThemedColors(); UpdatePrintStatus(); UiThread.RunOnIdle(OnIdle); }
public PrintProgressBar(bool widgetIsExtended = true) { MinimumSize = new Vector2(0, 24); HAnchor = HAnchor.ParentLeftRight; BackgroundColor = ActiveTheme.Instance.SecondaryAccentColor; Margin = new BorderDouble(0); FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.LeftToRight); container.AnchorAll(); container.Padding = new BorderDouble(6, 0); printTimeElapsed = new TextWidget("", pointSize: 11); printTimeElapsed.Printer.DrawFromHintedCache = true; printTimeElapsed.AutoExpandBoundsToText = true; printTimeElapsed.VAnchor = Agg.UI.VAnchor.ParentCenter; printTimeRemaining = new TextWidget("", pointSize: 11); printTimeRemaining.Printer.DrawFromHintedCache = true; printTimeRemaining.AutoExpandBoundsToText = true; printTimeRemaining.VAnchor = Agg.UI.VAnchor.ParentCenter; GuiWidget spacer = new GuiWidget(); spacer.HAnchor = Agg.UI.HAnchor.ParentLeftRight; container.AddChild(printTimeElapsed); container.AddChild(spacer); container.AddChild(printTimeRemaining); AddChild(container); if (ActiveTheme.Instance.IsTouchScreen) { upImageBuffer = StaticData.Instance.LoadIcon("TouchScreen/arrow_up_32x24.png"); downImageBuffer = StaticData.Instance.LoadIcon("TouchScreen/arrow_down_32x24.png"); indicatorWidget = new ImageWidget(upImageBuffer); indicatorWidget.HAnchor = HAnchor.ParentCenter; indicatorWidget.VAnchor = VAnchor.ParentCenter; WidgetIsExtended = widgetIsExtended; GuiWidget indicatorOverlay = new GuiWidget(); indicatorOverlay.AnchorAll(); indicatorOverlay.AddChild(indicatorWidget); AddChild(indicatorOverlay); } ClickWidget clickOverlay = new ClickWidget(); clickOverlay.AnchorAll(); clickOverlay.Click += onProgressBarClick; AddChild(clickOverlay); AddHandlers(); SetThemedColors(); UpdatePrintStatus(); UiThread.RunOnIdle(OnIdle); }