private void OpenExportWindow()
 {
     if (exportWindowIsOpen == false)
     {
         exportingWindow         = new ExportLibraryItemWindow(this);
         this.exportWindowIsOpen = true;
         exportingWindow.Closed += new EventHandler(ExportLibraryItemWindow_Closed);
         exportingWindow.ShowAsSystemWindow();
     }
     else
     {
         if (exportingWindow != null)
         {
             exportingWindow.BringToFront();
         }
     }
 }
        public PrintLibraryListItem(PrintItemWrapper printItem)
        {
            this.printItem              = printItem;
            linkButtonFactory.fontSize  = 10;
            linkButtonFactory.textColor = RGBA_Bytes.White;

            WidgetTextColor       = RGBA_Bytes.Black;
            WidgetBackgroundColor = RGBA_Bytes.White;

            TextInfo textInfo = new CultureInfo("en-US", false).TextInfo;

            SetDisplayAttributes();

            FlowLayoutWidget mainContainer = new FlowLayoutWidget(FlowDirection.LeftToRight);

            mainContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
            {
                GuiWidget selectionCheckBoxContainer = new GuiWidget();
                selectionCheckBoxContainer.VAnchor = VAnchor.Max_FitToChildren_ParentHeight;
                selectionCheckBoxContainer.HAnchor = Agg.UI.HAnchor.FitToChildren;
                selectionCheckBoxContainer.Margin  = new BorderDouble(left: 6);
                selectionCheckBox         = new CheckBox("");
                selectionCheckBox.VAnchor = VAnchor.ParentCenter;
                selectionCheckBox.HAnchor = HAnchor.ParentCenter;
                selectionCheckBoxContainer.AddChild(selectionCheckBox);

                FlowLayoutWidget leftColumn = new FlowLayoutWidget(FlowDirection.TopToBottom);
                leftColumn.VAnchor |= VAnchor.ParentTop;


                FlowLayoutWidget middleColumn = new FlowLayoutWidget(FlowDirection.TopToBottom);
                middleColumn.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
                middleColumn.VAnchor = Agg.UI.VAnchor.ParentBottomTop;
                middleColumn.Padding = new BorderDouble(0, 6);
                middleColumn.Margin  = new BorderDouble(10, 0);
                {
                    string labelName = textInfo.ToTitleCase(printItem.Name);
                    labelName             = labelName.Replace('_', ' ');
                    partLabel             = new TextWidget(labelName, pointSize: 12);
                    partLabel.TextColor   = WidgetTextColor;
                    partLabel.MinimumSize = new Vector2(1, 16);
                    middleColumn.AddChild(partLabel);
                }

                FlowLayoutWidget rightColumn = new FlowLayoutWidget(FlowDirection.TopToBottom);
                rightColumn.VAnchor = Agg.UI.VAnchor.ParentBottomTop;

                buttonContainer         = new FlowLayoutWidget();
                buttonContainer.Margin  = new BorderDouble(0, 6);
                buttonContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
                {
                    addToQueueLink         = linkButtonFactory.Generate(new LocalizedString("Add to Queue").Translated);
                    addToQueueLink.Margin  = new BorderDouble(left: 0, right: 10);
                    addToQueueLink.VAnchor = VAnchor.ParentCenter;

                    addToQueueLink.Click += (sender, e) =>
                    {
                        PrintQueueItem queueItem = new PrintQueueItem(this.printItem.Name, this.printItem.FileLocation);
                        PrintQueueControl.Instance.AddChild(queueItem);
                    };

                    viewLink         = linkButtonFactory.Generate(new LocalizedString("View").Translated);
                    viewLink.Margin  = new BorderDouble(left: 0, right: 10);
                    viewLink.VAnchor = VAnchor.ParentCenter;

                    exportLink         = linkButtonFactory.Generate(new LocalizedString("Export").Translated);
                    exportLink.Margin  = new BorderDouble(left: 0, right: 10);
                    exportLink.VAnchor = VAnchor.ParentCenter;

                    exportLink.Click += (sender, e) =>
                    {
                        ExportLibraryItemWindow exportingWindow = new ExportLibraryItemWindow(this);
                        exportingWindow.ShowAsSystemWindow();
                    };

                    removeLink         = linkButtonFactory.Generate(new LocalizedString("Remove").Translated);
                    removeLink.Margin  = new BorderDouble(left: 10, right: 10);
                    removeLink.VAnchor = VAnchor.ParentCenter;

                    buttonContainer.AddChild(addToQueueLink);
                    buttonContainer.AddChild(viewLink);
                    buttonContainer.AddChild(exportLink);
                    buttonContainer.AddChild(removeLink);
                }
                middleColumn.AddChild(buttonContainer);
                //rightColumn.AddChild(buttonContainer);

                mainContainer.AddChild(selectionCheckBoxContainer);
                {
                    PartThumbnailWidget thumbnailWidget = new PartThumbnailWidget(printItem, "part_icon_transparent_40x40.png", "building_thumbnail_40x40.png", new Vector2(50, 50));
                    mainContainer.AddChild(thumbnailWidget);
                }
                mainContainer.AddChild(leftColumn);
                mainContainer.AddChild(middleColumn);
                mainContainer.AddChild(rightColumn);
            }
            this.AddChild(mainContainer);
            AddHandlers();
        }
		private void OpenExportWindow()
		{
			if (exportWindowIsOpen == false)
			{
				exportingWindow = new ExportLibraryItemWindow(this);
				this.exportWindowIsOpen = true;
				exportingWindow.Closed += new EventHandler(ExportLibraryItemWindow_Closed);
				exportingWindow.ShowAsSystemWindow ();
			}
			else 
			{
				if (exportingWindow != null)
				{
					exportingWindow.BringToFront ();
				}
			}

		}