Show controls rather than a picture

- Issue MatterHackers/MCCentral#5406
Make the end of leveling and probe calibration show the actual
controls rather than a picture
This commit is contained in:
John Lewin 2019-04-30 20:43:52 -07:00
parent 922becba20
commit b91f40c136
2 changed files with 35 additions and 6 deletions

View file

@ -29,10 +29,13 @@ either expressed or implied, of the FreeBSD Project.
using System; using System;
using System.IO; using System.IO;
using MatterHackers.Agg;
using MatterHackers.Agg.Platform; using MatterHackers.Agg.Platform;
using MatterHackers.Agg.UI; using MatterHackers.Agg.UI;
using MatterHackers.Localizations; using MatterHackers.Localizations;
using MatterHackers.MatterControl.CustomWidgets;
using MatterHackers.MatterControl.PrinterCommunication; using MatterHackers.MatterControl.PrinterCommunication;
using MatterHackers.MatterControl.PrinterControls;
using MatterHackers.MatterControl.SlicerConfiguration; using MatterHackers.MatterControl.SlicerConfiguration;
namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
@ -50,10 +53,21 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
+ " 2. Look for the calibration section (pictured below)".Localize() + "\n"; + " 2. Look for the calibration section (pictured below)".Localize() + "\n";
contentRow.AddChild(this.CreateTextField(calibrated)); contentRow.AddChild(this.CreateTextField(calibrated));
contentRow.AddChild(new ImageWidget(AggContext.StaticData.LoadImage(Path.Combine("Images", "probe.png"))) // Create and display a widget for reference
var exampleWidget = CalibrationControls.CreateSection(printer, theme);
exampleWidget.Width = 500;
exampleWidget.Selectable = false;
exampleWidget.HAnchor = HAnchor.Center | HAnchor.Absolute;
// Disable borders on all SettingsRow children in control panels
foreach (var settingsRow in exampleWidget.ContentPanel.Descendants<SettingsRow>())
{ {
HAnchor = HAnchor.Center settingsRow.BorderColor = Color.Transparent;
}); }
theme.ApplyBoxStyle(exampleWidget);
contentRow.AddChild(exampleWidget);
contentRow.AddChild(this.CreateTextField("Click 'Done' to close this window.".Localize())); contentRow.AddChild(this.CreateTextField("Click 'Done' to close this window.".Localize()));

View file

@ -31,10 +31,13 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using MatterHackers.Agg;
using MatterHackers.Agg.Platform; using MatterHackers.Agg.Platform;
using MatterHackers.Agg.UI; using MatterHackers.Agg.UI;
using MatterHackers.Localizations; using MatterHackers.Localizations;
using MatterHackers.MatterControl.CustomWidgets;
using MatterHackers.MatterControl.PrinterCommunication; using MatterHackers.MatterControl.PrinterCommunication;
using MatterHackers.MatterControl.PrinterControls;
using MatterHackers.MatterControl.SlicerConfiguration; using MatterHackers.MatterControl.SlicerConfiguration;
using MatterHackers.VectorMath; using MatterHackers.VectorMath;
@ -56,11 +59,23 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
+ " 1. Select the 'Controls' tab on the right" + "\n" + " 1. Select the 'Controls' tab on the right" + "\n"
+ " 2. Look for the calibration section (pictured below)".Localize() + "\n"; + " 2. Look for the calibration section (pictured below)".Localize() + "\n";
contentRow.AddChild(this.CreateTextField(calibrated)); contentRow.AddChild(this.CreateTextField(calibrated));
contentRow.BackgroundColor = theme.MinimalShade;
contentRow.AddChild(new ImageWidget(AggContext.StaticData.LoadImage(Path.Combine("Images", "leveling.png"))) // Create and display a widget for reference
var exampleWidget = CalibrationControls.CreateSection(printer, theme);
exampleWidget.Width = 500;
exampleWidget.Selectable = false;
exampleWidget.HAnchor = HAnchor.Center | HAnchor.Absolute;
// Disable borders on all SettingsRow children in control panels
foreach (var settingsRow in exampleWidget.ContentPanel.Descendants<SettingsRow>())
{ {
HAnchor = HAnchor.Center settingsRow.BorderColor = Color.Transparent;
}); }
theme.ApplyBoxStyle(exampleWidget);
contentRow.AddChild(exampleWidget);
contentRow.AddChild(this.CreateTextField("Click 'Done' to close this window.".Localize())); contentRow.AddChild(this.CreateTextField("Click 'Done' to close this window.".Localize()));