2014-01-29 19:09:30 -08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
|
|
using MatterHackers.Agg;
|
|
|
|
|
|
using MatterHackers.Agg.UI;
|
2014-02-18 12:51:11 -08:00
|
|
|
|
using MatterHackers.Localizations;
|
2014-01-29 19:09:30 -08:00
|
|
|
|
|
|
|
|
|
|
namespace MatterHackers.MatterControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public class ExportToFolderFeedbackWindow : SystemWindow
|
|
|
|
|
|
{
|
|
|
|
|
|
int totalParts;
|
|
|
|
|
|
int count = 0;
|
|
|
|
|
|
FlowLayoutWidget feedback = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
|
|
|
|
|
TextWidget nextLine;
|
|
|
|
|
|
|
|
|
|
|
|
public ExportToFolderFeedbackWindow(int totalParts, string firstPartName, RGBA_Bytes backgroundColor)
|
|
|
|
|
|
: base(300, 500)
|
|
|
|
|
|
{
|
|
|
|
|
|
BackgroundColor = backgroundColor;
|
2014-03-11 15:24:47 -07:00
|
|
|
|
string exportingToFolderTitle = LocalizedString.Get("MatterControl");
|
|
|
|
|
|
string exportingToFolderTitleFull = LocalizedString.Get("Exporting to Folder");
|
2014-02-18 12:51:11 -08:00
|
|
|
|
Title = string.Format("{0} - {1}", exportingToFolderTitle, exportingToFolderTitleFull);
|
2014-01-29 19:09:30 -08:00
|
|
|
|
this.totalParts = totalParts;
|
|
|
|
|
|
|
|
|
|
|
|
feedback.Padding = new BorderDouble(5, 5);
|
|
|
|
|
|
feedback.AnchorAll();
|
|
|
|
|
|
AddChild(feedback);
|
|
|
|
|
|
|
|
|
|
|
|
nextLine = CreateNextLine("");
|
|
|
|
|
|
feedback.AddChild(nextLine);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TextWidget CreateNextLine(string startText)
|
|
|
|
|
|
{
|
2014-11-04 13:40:16 -08:00
|
|
|
|
TextWidget nextLine = new TextWidget(startText, textColor: ActiveTheme.Instance.PrimaryTextColor);
|
2014-01-29 19:09:30 -08:00
|
|
|
|
nextLine.Margin = new BorderDouble(0, 2);
|
|
|
|
|
|
nextLine.HAnchor = Agg.UI.HAnchor.ParentLeft;
|
|
|
|
|
|
nextLine.AutoExpandBoundsToText = true;
|
|
|
|
|
|
return nextLine;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void StartingNextPart(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
count++;
|
|
|
|
|
|
StringEventArgs stringEvent = e as StringEventArgs;
|
|
|
|
|
|
if (stringEvent != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
string partDescription = string.Format("{0}/{1} '{2}'", count, totalParts, stringEvent.Data);
|
|
|
|
|
|
nextLine.Text = partDescription;
|
|
|
|
|
|
nextLine = CreateNextLine("");
|
|
|
|
|
|
feedback.AddChild(nextLine);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void DoneSaving(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
StringEventArgs stringEvent = e as StringEventArgs;
|
|
|
|
|
|
if (stringEvent != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
nextLine.Text = "";
|
|
|
|
|
|
feedback.AddChild(CreateNextLine(string.Format("total cm3 = {0}", stringEvent.Data)));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void UpdatePartStatus(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
StringEventArgs stringEvent = e as StringEventArgs;
|
|
|
|
|
|
if (stringEvent != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
nextLine.Text = " " + stringEvent.Data;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|