Improving setup connection wizard
issue: MatterHackers/MCCentral#4453 Add images to connection wizard
This commit is contained in:
parent
837f3310ee
commit
8c1c0bcff4
5 changed files with 33 additions and 12 deletions
|
|
@ -228,11 +228,13 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
|||
{
|
||||
OnBeforeSelect(null);
|
||||
|
||||
// if the current selection (before change) is !null than clear its background color
|
||||
if (_selectedNode != null)
|
||||
{
|
||||
_selectedNode.HighlightRegion.BackgroundColor = Color.Transparent;
|
||||
}
|
||||
|
||||
// change the selection
|
||||
_selectedNode = value;
|
||||
|
||||
if (_selectedNode != null)
|
||||
|
|
|
|||
|
|
@ -28,8 +28,11 @@ either expressed or implied, of the FreeBSD Project.
|
|||
*/
|
||||
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.Agg.Image;
|
||||
using MatterHackers.Agg.Platform;
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.Localizations;
|
||||
using System.IO;
|
||||
|
||||
namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
||||
{
|
||||
|
|
@ -72,6 +75,14 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
};
|
||||
container.AddChild(printerMessageThree);
|
||||
|
||||
var removeImage = AggContext.StaticData.LoadImage(Path.Combine("Images", "remove usb.png"));
|
||||
removeImage.SetRecieveBlender(new BlenderPreMultBGRA());
|
||||
container.AddChild(new ImageWidget(removeImage)
|
||||
{
|
||||
HAnchor = HAnchor.Center,
|
||||
Margin = new BorderDouble(0, 10),
|
||||
});
|
||||
|
||||
GuiWidget vSpacer = new GuiWidget();
|
||||
vSpacer.VAnchor = VAnchor.Stretch;
|
||||
container.AddChild(vSpacer);
|
||||
|
|
|
|||
|
|
@ -28,8 +28,11 @@ either expressed or implied, of the FreeBSD Project.
|
|||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.Agg.Image;
|
||||
using MatterHackers.Agg.Platform;
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.Localizations;
|
||||
using MatterHackers.MatterControl.PrinterCommunication;
|
||||
|
|
@ -82,9 +85,16 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
}
|
||||
};
|
||||
|
||||
var backButton = theme.CreateDialogButton("<< Back".Localize());
|
||||
backButton.Click += (s, e) =>
|
||||
{
|
||||
DialogWindow.ChangeToPage(new SetupStepComPortOne(printer));
|
||||
};
|
||||
|
||||
printer.Connection.CommunicationStateChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents);
|
||||
|
||||
this.AddPageAction(nextButton);
|
||||
this.AddPageAction(backButton);
|
||||
this.AddPageAction(connectButton);
|
||||
}
|
||||
|
||||
|
|
@ -114,7 +124,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
printerMessageOne.HAnchor = HAnchor.Stretch;
|
||||
printerMessageOne.Margin = elementMargin;
|
||||
|
||||
string printerMessageFourBeg = "Connect printer and power on".Localize();
|
||||
string printerMessageFourBeg = "Connect printer (make sure it is on)".Localize();
|
||||
string printerMessageFourFull = string.Format("1.) {0}.", printerMessageFourBeg);
|
||||
TextWidget printerMessageFour = new TextWidget(printerMessageFourFull, 0, 0, 12);
|
||||
printerMessageFour.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
|
|
@ -132,16 +142,6 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
GuiWidget vSpacer = new GuiWidget();
|
||||
vSpacer.VAnchor = VAnchor.Stretch;
|
||||
|
||||
var manualLink = new LinkLabel("Manual Configuration".Localize(), theme)
|
||||
{
|
||||
Margin = new BorderDouble(0, 5),
|
||||
TextColor = theme.Colors.PrimaryTextColor
|
||||
};
|
||||
manualLink.Click += (s, e) => UiThread.RunOnIdle(() =>
|
||||
{
|
||||
DialogWindow.ChangeToPage(new SetupStepComPortManual(printer));
|
||||
});
|
||||
|
||||
printerErrorMessage = new TextWidget("", 0, 0, 10)
|
||||
{
|
||||
AutoExpandBoundsToText = true,
|
||||
|
|
@ -153,8 +153,16 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
container.AddChild(printerMessageOne);
|
||||
container.AddChild(printerMessageFour);
|
||||
container.AddChild(printerErrorMessage);
|
||||
|
||||
var removeImage = AggContext.StaticData.LoadImage(Path.Combine("Images", "insert usb.png"));
|
||||
removeImage.SetRecieveBlender(new BlenderPreMultBGRA());
|
||||
container.AddChild(new ImageWidget(removeImage)
|
||||
{
|
||||
HAnchor = HAnchor.Center,
|
||||
Margin = new BorderDouble(0, 10),
|
||||
});
|
||||
|
||||
container.AddChild(vSpacer);
|
||||
container.AddChild(manualLink);
|
||||
|
||||
container.HAnchor = HAnchor.Stretch;
|
||||
return container;
|
||||
|
|
|
|||
BIN
StaticData/Images/insert usb.png
Normal file
BIN
StaticData/Images/insert usb.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.5 KiB |
BIN
StaticData/Images/remove usb.png
Normal file
BIN
StaticData/Images/remove usb.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
Loading…
Add table
Add a link
Reference in a new issue