2015-04-08 15:20:10 -07:00
|
|
|
|
using MatterHackers.Agg;
|
2014-01-29 19:09:30 -08:00
|
|
|
|
using MatterHackers.Agg.UI;
|
|
|
|
|
|
using MatterHackers.MatterControl.ActionBar;
|
2015-04-08 15:20:10 -07:00
|
|
|
|
using MatterHackers.MatterControl.PrintQueue;
|
|
|
|
|
|
using System;
|
2014-01-29 19:09:30 -08:00
|
|
|
|
|
|
|
|
|
|
namespace MatterHackers.MatterControl
|
|
|
|
|
|
{
|
2015-04-08 15:20:10 -07:00
|
|
|
|
public class ActionBarPlus : FlowLayoutWidget
|
|
|
|
|
|
{
|
|
|
|
|
|
private QueueDataView queueDataView;
|
|
|
|
|
|
|
|
|
|
|
|
public ActionBarPlus(QueueDataView queueDataView)
|
|
|
|
|
|
: base(FlowDirection.TopToBottom)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.queueDataView = queueDataView;
|
|
|
|
|
|
this.Create();
|
|
|
|
|
|
}
|
2014-04-15 18:13:27 -07:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
private event EventHandler unregisterEvents;
|
2014-01-29 19:09:30 -08:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
public void Create()
|
|
|
|
|
|
{
|
|
|
|
|
|
// Set Display Attributes
|
|
|
|
|
|
this.HAnchor = HAnchor.ParentLeftRight;
|
|
|
|
|
|
this.BackgroundColor = ActiveTheme.Instance.PrimaryAccentColor;
|
2014-01-29 19:09:30 -08:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
// Add Child Elements
|
|
|
|
|
|
if (ActiveTheme.Instance.DisplayMode == ActiveTheme.ApplicationDisplayType.Responsive)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.AddChild(new ActionBar.PrinterActionRow());
|
|
|
|
|
|
}
|
|
|
|
|
|
this.AddChild(new PrintStatusRow(queueDataView));
|
|
|
|
|
|
this.Padding = new BorderDouble(bottom: 6);
|
2014-01-29 19:09:30 -08:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
// Add Handlers
|
|
|
|
|
|
ActiveTheme.Instance.ThemeChanged.RegisterEvent(ThemeChanged, ref unregisterEvents);
|
|
|
|
|
|
}
|
2014-08-08 10:25:44 -07:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
public void ThemeChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.BackgroundColor = ActiveTheme.Instance.PrimaryAccentColor;
|
|
|
|
|
|
this.Invalidate();
|
|
|
|
|
|
}
|
2014-01-29 19:09:30 -08:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
public override void OnClosed(EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (unregisterEvents != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
unregisterEvents(this, null);
|
|
|
|
|
|
}
|
|
|
|
|
|
base.OnClosed(e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2014-01-29 19:09:30 -08:00
|
|
|
|
}
|