/// <summary> /// Вызывает диалог создания директории /// </summary> public void MakeNewDirectoryDialog() { CreateFolderWindow cfw = new CreateFolderWindow(this.FilePanelSettings.Path); cfw.ShowDialog(); MakeNewDirectory(cfw.DirectoryName); cfw.Close(); }
private static void AddLibraryButtonElements() { textImageButtonFactory.normalTextColor = ActiveTheme.Instance.PrimaryTextColor; textImageButtonFactory.hoverTextColor = ActiveTheme.Instance.PrimaryTextColor; textImageButtonFactory.pressedTextColor = ActiveTheme.Instance.PrimaryTextColor; textImageButtonFactory.disabledTextColor = ActiveTheme.Instance.PrimaryTextColor; buttonPanel.RemoveAllChildren(); // the add button { addToLibraryButton = textImageButtonFactory.Generate(LocalizedString.Get("Add"), "icon_circle_plus.png"); addToLibraryButton.ToolTipText = "Add an .stl, .amf, .gcode or .zip file to the Library".Localize(); buttonPanel.AddChild(addToLibraryButton); addToLibraryButton.Margin = new BorderDouble(0, 0, 3, 0); addToLibraryButton.Click += (sender, e) => UiThread.RunOnIdle(importToLibraryloadFile_ClickOnIdle); } // the create folder button { Button createFolderButton = textImageButtonFactory.Generate(LocalizedString.Get("Create Folder")); createFolderButton.Name = "Create Folder Button"; buttonPanel.AddChild(createFolderButton); createFolderButton.Margin = new BorderDouble(0, 0, 3, 0); createFolderButton.Click += (sender, e) => { if (createFolderWindow == null) { createFolderWindow = new CreateFolderWindow((returnInfo) => { currentPrintLibraryWidget.libraryDataView.CurrentLibraryProvider.AddCollectionToLibrary(returnInfo.newName); }); createFolderWindow.Closed += (sender2, e2) => { createFolderWindow = null; }; } else { createFolderWindow.BringToFront(); } }; } //Add extra buttons (ex. from plugins) if available if (privateAddLibraryButton != null) { privateAddLibraryButton(buttonPanel); } }
private static void AddLibraryButtonElements() { textImageButtonFactory.normalTextColor = ActiveTheme.Instance.PrimaryTextColor; textImageButtonFactory.hoverTextColor = ActiveTheme.Instance.PrimaryTextColor; textImageButtonFactory.pressedTextColor = ActiveTheme.Instance.PrimaryTextColor; textImageButtonFactory.disabledTextColor = ActiveTheme.Instance.PrimaryTextColor; buttonPanel.RemoveAllChildren(); // the add button { addToLibraryButton = textImageButtonFactory.Generate(LocalizedString.Get("Add"), "icon_circle_plus.png"); buttonPanel.AddChild(addToLibraryButton); addToLibraryButton.Margin = new BorderDouble(0, 0, 3, 0); addToLibraryButton.Click += new EventHandler((sender, e) => UiThread.RunOnIdle(importToLibraryloadFile_ClickOnIdle)); } // the create folder button { Button createFolderButton = textImageButtonFactory.Generate(LocalizedString.Get("Create Folder")); buttonPanel.AddChild(createFolderButton); createFolderButton.Margin = new BorderDouble(0, 0, 3, 0); createFolderButton.Click += new EventHandler((sender, e) => { if (createFolderWindow == null) { createFolderWindow = new CreateFolderWindow(CreateNamedFolder); createFolderWindow.Closed += new EventHandler(CreateFolderWindow_Closed); } else { createFolderWindow.BringToFront(); } } ); } //Add extra buttons (ex. from plugins) if available if (privateAddLibraryButton != null) { privateAddLibraryButton(buttonPanel); } }
private void AddLibraryButtonElements() { textImageButtonFactory.normalTextColor = ActiveTheme.Instance.PrimaryTextColor; textImageButtonFactory.hoverTextColor = ActiveTheme.Instance.PrimaryTextColor; textImageButtonFactory.pressedTextColor = ActiveTheme.Instance.PrimaryTextColor; textImageButtonFactory.disabledTextColor = ActiveTheme.Instance.TabLabelUnselected; textImageButtonFactory.disabledFillColor = new RGBA_Bytes(); buttonPanel.RemoveAllChildren(); // the add button { addToLibraryButton = textImageButtonFactory.Generate(LocalizedString.Get("Add"), "icon_circle_plus.png"); addToLibraryButton.Enabled = false; // The library selector (the first library selected) is protected so we can't add to it. addToLibraryButton.ToolTipText = "Add an .stl, .amf, .gcode or .zip file to the Library".Localize(); addToLibraryButton.Name = "Library Add Button"; buttonPanel.AddChild(addToLibraryButton); addToLibraryButton.Margin = new BorderDouble(0, 0, 3, 0); addToLibraryButton.Click += (sender, e) => UiThread.RunOnIdle(importToLibraryloadFile_ClickOnIdle); } // the create folder button { createFolderButton = textImageButtonFactory.Generate(LocalizedString.Get("Create Folder")); createFolderButton.Enabled = false; // The library selector (the first library selected) is protected so we can't add to it. createFolderButton.Name = "Create Folder From Library Button"; buttonPanel.AddChild(createFolderButton); createFolderButton.Margin = new BorderDouble(0, 0, 3, 0); createFolderButton.Click += (sender, e) => { if (createFolderWindow == null) { createFolderWindow = new CreateFolderWindow((returnInfo) => { this.libraryDataView.CurrentLibraryProvider.AddCollectionToLibrary(returnInfo.newName); }); createFolderWindow.Closed += (sender2, e2) => { createFolderWindow = null; }; } else { createFolderWindow.BringToFront(); } }; } // add in the message widget { providerMessageWidget = new TextWidget("") { PointSize = 8, HAnchor = HAnchor.ParentRight, VAnchor = VAnchor.ParentBottom, TextColor = ActiveTheme.Instance.SecondaryTextColor, Margin = new BorderDouble(6), AutoExpandBoundsToText = true, }; providerMessageContainer = new GuiWidget() { VAnchor = VAnchor.FitToChildren | VAnchor.ParentTop, HAnchor = HAnchor.ParentLeftRight, Visible = false, }; providerMessageContainer.AddChild(providerMessageWidget); buttonPanel.AddChild(providerMessageContainer, -1); } }
private static void AddLibraryButtonElements() { textImageButtonFactory.normalTextColor = ActiveTheme.Instance.PrimaryTextColor; textImageButtonFactory.hoverTextColor = ActiveTheme.Instance.PrimaryTextColor; textImageButtonFactory.pressedTextColor = ActiveTheme.Instance.PrimaryTextColor; textImageButtonFactory.disabledTextColor = ActiveTheme.Instance.PrimaryTextColor; buttonPanel.RemoveAllChildren(); // the add button { addToLibraryButton = textImageButtonFactory.Generate(LocalizedString.Get("Add"), "icon_circle_plus.png"); addToLibraryButton.ToolTipText = "Add an .stl, .amf, .gcode or .zip file to the Library".Localize(); buttonPanel.AddChild(addToLibraryButton); addToLibraryButton.Margin = new BorderDouble(0, 0, 3, 0); addToLibraryButton.Click += (sender, e) => UiThread.RunOnIdle(importToLibraryloadFile_ClickOnIdle); } // the create folder button { Button createFolderButton = textImageButtonFactory.Generate(LocalizedString.Get("Create Folder")); buttonPanel.AddChild(createFolderButton); createFolderButton.Margin = new BorderDouble(0, 0, 3, 0); createFolderButton.Click += (sender, e) => { if (createFolderWindow == null) { createFolderWindow = new CreateFolderWindow((returnInfo) => { currentPrintLibraryWidget.libraryDataView.CurrentLibraryProvider.AddCollectionToLibrary(returnInfo.newName); }); createFolderWindow.Closed += (sender2, e2) => { createFolderWindow = null; }; } else { createFolderWindow.BringToFront(); } }; } //Add extra buttons (ex. from plugins) if available if (privateAddLibraryButton != null) { privateAddLibraryButton(buttonPanel); } }
private static void CreateFolderWindow_Closed(object sender, EventArgs e) { createFolderWindow = null; }
private static void CreateNamedFolder(CreateFolderWindow.CreateFolderReturnInfo returnInfo) { LibraryDataView.CurrentLibraryProvider.AddCollectionToLibrary(returnInfo.newName); }