diff --git a/ApplicationView/CompactTabView.cs b/ApplicationView/CompactTabView.cs index b14e26b50..366c43070 100644 --- a/ApplicationView/CompactTabView.cs +++ b/ApplicationView/CompactTabView.cs @@ -109,7 +109,8 @@ namespace MatterHackers.MatterControl this.AddTab(new SimpleTextTabWidget(HistoryTabPage, "History Tab", TabTextSize, ActiveTheme.Instance.SecondaryAccentColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes())); - GuiWidget manualPrinterControls = new ManualControlsWidget(); + + GuiWidget manualPrinterControls = new ManualPrinterControls(); part3DViewContainer = new GuiWidget(); part3DViewContainer.AnchorAll(); @@ -190,7 +191,7 @@ namespace MatterHackers.MatterControl void reloadControlsWidget() { - GuiWidget manualPrinterControls = new ManualControlsWidget(); + GuiWidget manualPrinterControls = new ManualPrinterControls(); //ScrollableWidget manualPrinterControlsWidget = new ScrollableWidget(true); //manualPrinterControlsWidget.ScrollArea.HAnchor |= Agg.UI.HAnchor.ParentLeftRight; diff --git a/ApplicationView/WidescreenPanel.cs b/ApplicationView/WidescreenPanel.cs index 39f77076a..3ad6391b3 100644 --- a/ApplicationView/WidescreenPanel.cs +++ b/ApplicationView/WidescreenPanel.cs @@ -406,7 +406,7 @@ namespace MatterHackers.MatterControl public void LoadSettingsOnPrinterChanged(object sender, EventArgs e) { ActiveSliceSettings.Instance.LoadAllSettings(); - ApplicationController.Instance.ReloadAdvancedControlsPanel(); + ApplicationController.Instance.ReloadAll(null, null); } } diff --git a/PartPreviewWindow/View3D/View3DAutoArange.cs b/PartPreviewWindow/View3D/View3DAutoArange.cs index 6de365865..bd840a8b0 100644 --- a/PartPreviewWindow/View3D/View3DAutoArange.cs +++ b/PartPreviewWindow/View3D/View3DAutoArange.cs @@ -40,7 +40,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { public partial class View3DWidget { - private void AutoArangePartsInBackground() + private void AutoArrangePartsInBackground() { if (MeshGroups.Count > 0) { diff --git a/PartPreviewWindow/View3D/View3DWidget.cs b/PartPreviewWindow/View3D/View3DWidget.cs index af28971a8..2da8cd579 100644 --- a/PartPreviewWindow/View3D/View3DWidget.cs +++ b/PartPreviewWindow/View3D/View3DWidget.cs @@ -29,6 +29,7 @@ either expressed or implied, of the FreeBSD Project. using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Globalization; @@ -773,6 +774,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { UnlockEditControls(); } + + SelectionChanged(this, null); } bool viewIsInEditModePreLock = false; @@ -967,7 +970,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow autoArrangeButton.Visible = false; autoArrangeButton.Click += (sender, e) => { - AutoArangePartsInBackground(); + AutoArrangePartsInBackground(); }; GuiWidget verticalSpacer = new GuiWidget(); @@ -1552,67 +1555,67 @@ namespace MatterHackers.MatterControl.PartPreviewWindow textImageButtonFactory.FixedWidth = 0; } + ObservableCollection extruderButtons = new ObservableCollection(); void AddMaterialControls(FlowLayoutWidget buttonPanel) { + extruderButtons.Clear(); + for (int extruderIndex = 0; extruderIndex < ActiveSliceSettings.Instance.ExtruderCount; extruderIndex++) { - FlowLayoutWidget extruderIndexContainer = new FlowLayoutWidget(FlowDirection.LeftToRight); - extruderIndexContainer.HAnchor = HAnchor.ParentLeftRight; - extruderIndexContainer.Padding = new BorderDouble(5); + FlowLayoutWidget colorSelectionContainer = new FlowLayoutWidget(FlowDirection.LeftToRight); + colorSelectionContainer.HAnchor = HAnchor.ParentLeftRight; + colorSelectionContainer.Padding = new BorderDouble(5); - string extruderLabelText = LocalizedString.Get("Extruder"); - string extruderLabelTextFull = "{0}:".FormatWith(extruderLabelText); - TextWidget extruderLabel = new TextWidget(extruderLabelText, textColor: ActiveTheme.Instance.PrimaryTextColor); - extruderIndexContainer.AddChild(extruderLabel); - extruderIndexContainer.AddChild(new HorizontalSpacer()); - - MHNumberEdit extruderControl = new MHNumberEdit(1, pixelWidth: 20, allowNegatives: false, allowDecimals: false, increment: 1, minValue: 1, maxValue: 2); - extruderControl.VAnchor = Agg.UI.VAnchor.ParentTop; - extruderIndexContainer.AddChild(extruderControl); - - extruderControl.ActuallNumberEdit.EditComplete += (sender, e) => + string colorLabelText = "Extruder {0}".Localize().FormatWith(extruderIndex + 1); + RadioButton extruderSelection = new RadioButton(colorLabelText, textColor: ActiveTheme.Instance.PrimaryTextColor); + extruderButtons.Add(extruderSelection); + extruderSelection.SiblingRadioButtonList = extruderButtons; + colorSelectionContainer.AddChild(extruderSelection); + colorSelectionContainer.AddChild(new HorizontalSpacer()); + int extruderIndexLocal = extruderIndex; + extruderSelection.Click += (sender, e) => { foreach (Mesh mesh in SelectedMeshGroup.Meshes) { MeshMaterialData material = MeshMaterialData.Get(mesh); - if(material.MaterialIndex != (int)extruderControl.ActuallNumberEdit.Value) + if (material.MaterialIndex != extruderIndexLocal-1) { - material.MaterialIndex = (int)extruderControl.ActuallNumberEdit.Value; + material.MaterialIndex = extruderIndexLocal+1; saveButtons.Visible = true; } } }; - SelectionChanged += (sender, e) => + this.SelectionChanged += (sender, e) => { Mesh mesh = SelectedMeshGroup.Meshes[0]; MeshMaterialData material = MeshMaterialData.Get(mesh); - if (extruderControl.ActuallNumberEdit.Value != material.MaterialIndex) + + for (int i = 0; i < extruderButtons.Count; i++) { - extruderControl.ActuallNumberEdit.Value = material.MaterialIndex; + if (material.MaterialIndex-1 == i) + { + ((RadioButton)extruderButtons[i]).Checked = true; + } } }; - buttonPanel.AddChild(extruderIndexContainer); - - for (int extruderIndex = 0; extruderIndex < ActiveSliceSettings.Instance.ExtruderCount; extruderIndex++) + GuiWidget colorSwatch = new GuiWidget(15,15); + colorSwatch.Draw += (sender, e) => { - AddMaterialColorSelect(extruderIndex, buttonPanel); - } + DrawEventArgs drawEvent = e as DrawEventArgs; + GuiWidget widget = sender as GuiWidget; + if(widget != null && drawEvent != null && drawEvent.graphics2D != null) + { + drawEvent.graphics2D.Rectangle(widget.LocalBounds, RGBA_Bytes.Black); + } + }; + colorSwatch.BackgroundColor = meshViewerWidget.GetMaterialColor(extruderIndex+1); + colorSelectionContainer.AddChild(colorSwatch); + + buttonPanel.AddChild(colorSelectionContainer); } } - private void AddMaterialColorSelect(int i, FlowLayoutWidget buttonPanel) - { - FlowLayoutWidget extruderIndexContainer = new FlowLayoutWidget(FlowDirection.LeftToRight); - extruderIndexContainer.HAnchor = HAnchor.ParentLeftRight; - extruderIndexContainer.Padding = new BorderDouble(5); - - string extruderLabelText = "Color {0}".Localize().FormatWith(i); - TextWidget extruderLabel = new TextWidget(extruderLabelText, textColor: ActiveTheme.Instance.PrimaryTextColor); - extruderIndexContainer.AddChild(extruderLabel); - extruderIndexContainer.AddChild(new HorizontalSpacer()); - } - private void AddHandlers() { expandViewOptions.CheckedStateChanged += expandViewOptions_CheckedStateChanged; diff --git a/PartPreviewWindow/ViewControls3D.cs b/PartPreviewWindow/ViewControls3D.cs index 6537842d2..c395767fb 100644 --- a/PartPreviewWindow/ViewControls3D.cs +++ b/PartPreviewWindow/ViewControls3D.cs @@ -130,8 +130,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { meshViewerWidget.TrackballTumbleWidget.RotationHelperCircleColor = ActiveTheme.Instance.PrimaryBackgroundColor; - meshViewerWidget.PartColor = RGBA_Bytes.White; - meshViewerWidget.SelectedPartColor = ActiveTheme.Instance.PrimaryAccentColor; + //meshViewerWidget.MaterialColor = RGBA_Bytes.White; + //meshViewerWidget.SelectedMaterialColor = ActiveTheme.Instance.PrimaryAccentColor; meshViewerWidget.BuildVolumeColor = new RGBA_Bytes(ActiveTheme.Instance.PrimaryAccentColor.Red0To255, ActiveTheme.Instance.PrimaryAccentColor.Green0To255, ActiveTheme.Instance.PrimaryAccentColor.Blue0To255, 50); } } diff --git a/StaticData/Translations/Master.txt b/StaticData/Translations/Master.txt index 76708ee4c..2152a834f 100644 --- a/StaticData/Translations/Master.txt +++ b/StaticData/Translations/Master.txt @@ -2744,3 +2744,9 @@ Translated:'Layer Height' must be less than or equal to the 'Nozzle Diameter'. English:Location: 'Advanced Controls' -> 'Slice Settings' -> 'Print' -> 'Layers/Perimeters' Translated:Location: 'Advanced Controls' -> 'Slice Settings' -> 'Print' -> 'Layers/Perimeters' +English:Color {0} +Translated:Color {0} + +English:Extruder {0} +Translated:Extruder {0} +