private void OpenExportWindow() { if (exportingWindowIsOpen == false) { exportingWindow = new ExportQueueItemWindow(this); this.exportingWindowIsOpen = true; exportingWindow.Closed += new EventHandler(ExportQueueItemWindow_Closed); exportingWindow.ShowAsSystemWindow(); } else { if (exportingWindow != null) { exportingWindow.BringToFront(); } } }
private void OpenExportWindow() { if(exportingWindowIsOpen == false) { exportingWindow = new ExportQueueItemWindow (this); this.exportingWindowIsOpen = true; exportingWindow.Closed += new EventHandler (ExportQueueItemWindow_Closed); exportingWindow.ShowAsSystemWindow(); } else { if (exportingWindow != null) { exportingWindow.BringToFront (); } } }
private void CreateEditControls() { editControls = new FlowLayoutWidget(); editControls.Margin = new BorderDouble(right: 10); editControls.VAnchor = Agg.UI.VAnchor.FitToChildren | Agg.UI.VAnchor.ParentCenter; { FlowLayoutWidget layoutLeftToRight = new FlowLayoutWidget(); linkButtonFactory.margin = new BorderDouble(3); // view button { Button viewLink = linkButtonFactory.Generate(new LocalizedString("View").Translated); viewLink.Click += (sender, e) => { string pathAndFile = PrintItemWrapper.FileLocation; if (File.Exists(pathAndFile)) { new PartPreviewMainWindow(PrintItemWrapper); } else { ShowCantFindFileMessage(PrintItemWrapper); } }; layoutLeftToRight.AddChild(viewLink); } // copy button { Button copyLink = linkButtonFactory.Generate(new LocalizedString("Copy").Translated); copyLink.Click += (sender, e) => { CreateCopyInQueue(); }; layoutLeftToRight.AddChild(copyLink); } // add to library button { if (this.PrintItemWrapper.PrintItem.PrintItemCollectionID == PrintLibraryListControl.Instance.LibraryCollection.Id) { //rightColumnOptions.AddChild(new TextWidget("Libary Item")); } } // the export menu { Button exportLink = linkButtonFactory.Generate(new LocalizedString("Export").Translated); exportLink.Click += (sender, e) => { ExportQueueItemWindow exportingWindow = new ExportQueueItemWindow(this); exportingWindow.ShowAsSystemWindow(); }; layoutLeftToRight.AddChild(exportLink); } // spacer { layoutLeftToRight.AddChild(new GuiWidget(10, 10)); } // delete button { Button deleteLink = linkButtonFactory.Generate(new LocalizedString("Remove").Translated); deleteLink.Click += (sender, e) => { DeletePartFromQueue(); }; layoutLeftToRight.AddChild(deleteLink); } // push off to the right the rest spacer { GuiWidget spaceFiller = new GuiWidget(10, 10); //layoutLeftToRight.AddChild(spaceFiller); } // up and down buttons { FlowLayoutWidget topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom); // move up one button { Button moveUp = linkButtonFactory.Generate(" ^ "); moveUp.Click += (sender, e) => { int thisIndexInQueue = PrintQueueControl.Instance.GetIndex(PrintItemWrapper); PrintQueueControl.Instance.SwapItemsDurringUiAction(thisIndexInQueue, thisIndexInQueue - 1); }; topToBottom.AddChild(moveUp); } // move down one button { Button moveDown = linkButtonFactory.Generate(" v "); moveDown.Click += (sender, e) => { int thisIndexInQueue = PrintQueueControl.Instance.GetIndex(PrintItemWrapper); PrintQueueControl.Instance.SwapItemsDurringUiAction(thisIndexInQueue, thisIndexInQueue + 1); }; topToBottom.AddChild(moveDown); } // don't add this yet as we don't have icons for it and it should probably be drag and drop anyway //layoutLeftToRight.AddChild(topToBottom); } // now add the layout to the edit controls bar editControls.AddChild(layoutLeftToRight); } }