public ThirdPanelTabView(ButtonBase.ButtonEventHandler AdvancedControlsButton_Click = null, EventHandler onMouseEnterBoundsPrintQueueLink = null, EventHandler onMouseLeaveBoundsPrintQueueLink = null) { this.AdvancedControlsButton_Click = AdvancedControlsButton_Click; this.onMouseEnterBoundsPrintQueueLink = onMouseEnterBoundsPrintQueueLink; this.onMouseLeaveBoundsPrintQueueLink = onMouseLeaveBoundsPrintQueueLink; advancedControls2 = CreateNewAdvancedControls(AdvancedControlsButton_Click, onMouseEnterBoundsPrintQueueLink, onMouseLeaveBoundsPrintQueueLink); AddChild(advancedControls2); WidescreenPanel.PreChangePannels.RegisterEvent(SaveCurrentPanelIndex, ref unregisterEvents); ApplicationWidget.Instance.ReloadAdvancedControlsPanelTrigger.RegisterEvent(ReloadAdvancedControlsPanelTrigger, ref unregisterEvents); AnchorAll(); }
private TabControl CreateNewAdvancedControls(ButtonBase.ButtonEventHandler AdvancedControlsButton_Click, EventHandler onMouseEnterBoundsPrintQueueLink, EventHandler onMouseLeaveBoundsPrintQueueLink) { TabControl advancedControls = new TabControl(); BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor; advancedControls.TabBar.BorderColor = ActiveTheme.Instance.SecondaryTextColor; advancedControls.TabBar.Margin = new BorderDouble(0, 0); advancedControls.TabBar.Padding = new BorderDouble(0, 2); int textSize = 16; if (AdvancedControlsButton_Click != null) { // this means we are in compact view and so we will make the tabs text a bit smaller textSize = 14; TextImageButtonFactory advancedControlsButtonFactory = new TextImageButtonFactory(); advancedControlsButtonFactory.invertImageLocation = false; advancedControlsLinkButton = advancedControlsButtonFactory.Generate(LocalizedString.Get("Print\nQueue"), "icon_arrow_left_32x32.png"); advancedControlsLinkButton.Margin = new BorderDouble(right: 3); advancedControlsLinkButton.VAnchor = VAnchor.ParentBottom; advancedControlsLinkButton.Cursor = Cursors.Hand; advancedControlsLinkButton.Click += new ButtonBase.ButtonEventHandler(AdvancedControlsButton_Click); advancedControlsLinkButton.MouseEnterBounds += new EventHandler(onMouseEnterBoundsPrintQueueLink); advancedControlsLinkButton.MouseLeaveBounds += new EventHandler(onMouseLeaveBoundsPrintQueueLink); advancedControls.TabBar.AddChild(advancedControlsLinkButton); } GuiWidget hSpacer = new GuiWidget(); hSpacer.HAnchor = HAnchor.ParentLeftRight; advancedControls.TabBar.AddChild(hSpacer); GuiWidget manualPrinterControls = new ManualPrinterControls(); ScrollableWidget manualPrinterControlsScrollArea = new ScrollableWidget(true); manualPrinterControlsScrollArea.ScrollArea.HAnchor |= Agg.UI.HAnchor.ParentLeftRight; manualPrinterControlsScrollArea.AnchorAll(); manualPrinterControlsScrollArea.AddChild(manualPrinterControls); RGBA_Bytes unselectedTextColor = ActiveTheme.Instance.TabLabelUnselected; //Add the tab contents for 'Advanced Controls' string printerControlsLabel = LocalizedString.Get("Controls").ToUpper(); advancedControls.AddTab(new SimpleTextTabWidget(new TabPage(manualPrinterControlsScrollArea, printerControlsLabel), "Controls Tab", textSize, ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes())); string sliceSettingsLabel = LocalizedString.Get("Slice Settings").ToUpper(); sliceSettingsWidget = new SliceSettingsWidget(sliceSettingsUiState); advancedControls.AddTab(new SimpleTextTabWidget(new TabPage(sliceSettingsWidget, sliceSettingsLabel), "Slice Settings Tab", textSize, ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes())); string configurationLabel = LocalizedString.Get("Configuration").ToUpper(); ScrollableWidget configurationControls = new PrinterConfigurationPage(); advancedControls.AddTab(new SimpleTextTabWidget(new TabPage(configurationControls, configurationLabel), "Configuration Tab", textSize, ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes())); advancedControls.SelectedTabIndex = lastAdvanceControlsIndex; return advancedControls; }