private void Workspace_DocumentClosed(object sender, DocumentEventArgs e) { foreach (MenuItem item in ((Menu)window_menu.Submenu)) if (item.Name == e.Document.Guid.ToString ()) { ((Menu)window_menu.Submenu).Remove (item); break; } if (!PintaCore.Workspace.HasOpenDocuments) { PintaCore.Actions.File.Close.Sensitive = false; PintaCore.Actions.File.Save.Sensitive = false; PintaCore.Actions.File.SaveAs.Sensitive = false; PintaCore.Actions.Edit.Copy.Sensitive = false; PintaCore.Actions.Edit.Cut.Sensitive = false; PintaCore.Actions.Edit.Paste.Sensitive = false; PintaCore.Actions.Edit.PasteIntoNewLayer.Sensitive = false; PintaCore.Actions.Edit.SelectAll.Sensitive = false; PintaCore.Actions.View.ActualSize.Sensitive = false; PintaCore.Actions.View.ZoomIn.Sensitive = false; PintaCore.Actions.View.ZoomOut.Sensitive = false; PintaCore.Actions.View.ZoomToSelection.Sensitive = false; PintaCore.Actions.View.ZoomToWindow.Sensitive = false; PintaCore.Actions.View.ZoomComboBox.Sensitive = false; PintaCore.Actions.Image.CanvasSize.Sensitive = false; PintaCore.Actions.Image.Resize.Sensitive = false; PintaCore.Actions.Image.FlipHorizontal.Sensitive = false; PintaCore.Actions.Image.FlipVertical.Sensitive = false; PintaCore.Actions.Image.Rotate180.Sensitive = false; PintaCore.Actions.Image.RotateCCW.Sensitive = false; PintaCore.Actions.Image.RotateCW.Sensitive = false; PintaCore.Actions.Layers.AddNewLayer.Sensitive = false; PintaCore.Actions.Layers.DuplicateLayer.Sensitive = false; PintaCore.Actions.Layers.FlipHorizontal.Sensitive = false; PintaCore.Actions.Layers.FlipVertical.Sensitive = false; PintaCore.Actions.Layers.ImportFromFile.Sensitive = false; PintaCore.Actions.Layers.Properties.Sensitive = false; PintaCore.Actions.Layers.RotateZoom.Sensitive = false; PintaCore.Actions.Adjustments.ToggleActionsSensitive (false); PintaCore.Actions.Effects.ToggleActionsSensitive (false); } }
private void Workspace_DocumentCreated(object sender, DocumentEventArgs e) { MenuItem mi = (MenuItem)new Gtk.Action ("effects", e.Document.Filename).CreateMenuItem (); mi.Name = e.Document.Guid.ToString (); mi.Activated += delegate { PintaCore.Workspace.SetActiveDocument (e.Document); }; ((Menu)window_menu.Submenu).AppendItem (mi); PintaCore.Actions.File.Close.Sensitive = true; PintaCore.Actions.File.Save.Sensitive = true; PintaCore.Actions.File.SaveAs.Sensitive = true; PintaCore.Actions.Edit.Copy.Sensitive = true; PintaCore.Actions.Edit.Cut.Sensitive = true; PintaCore.Actions.Edit.Paste.Sensitive = true; PintaCore.Actions.Edit.PasteIntoNewLayer.Sensitive = true; PintaCore.Actions.Edit.SelectAll.Sensitive = true; PintaCore.Actions.View.ActualSize.Sensitive = true; PintaCore.Actions.View.ZoomIn.Sensitive = true; PintaCore.Actions.View.ZoomOut.Sensitive = true; PintaCore.Actions.View.ZoomToSelection.Sensitive = true; PintaCore.Actions.View.ZoomToWindow.Sensitive = true; PintaCore.Actions.View.ZoomComboBox.Sensitive = true; PintaCore.Actions.Image.CanvasSize.Sensitive = true; PintaCore.Actions.Image.Resize.Sensitive = true; PintaCore.Actions.Image.FlipHorizontal.Sensitive = true; PintaCore.Actions.Image.FlipVertical.Sensitive = true; PintaCore.Actions.Image.Rotate180.Sensitive = true; PintaCore.Actions.Image.RotateCCW.Sensitive = true; PintaCore.Actions.Image.RotateCW.Sensitive = true; PintaCore.Actions.Layers.AddNewLayer.Sensitive = true; PintaCore.Actions.Layers.DuplicateLayer.Sensitive = true; PintaCore.Actions.Layers.FlipHorizontal.Sensitive = true; PintaCore.Actions.Layers.FlipVertical.Sensitive = true; PintaCore.Actions.Layers.ImportFromFile.Sensitive = true; PintaCore.Actions.Layers.Properties.Sensitive = true; PintaCore.Actions.Layers.RotateZoom.Sensitive = true; PintaCore.Actions.Adjustments.ToggleActionsSensitive (true); PintaCore.Actions.Effects.ToggleActionsSensitive (true); }
protected internal void OnDocumentOpened(DocumentEventArgs e) { if (DocumentOpened != null) DocumentOpened (this, e); }
private void Workspace_DocumentCreated(object sender, DocumentEventArgs e) { PintaCore.Actions.Window.AddDocument (e.Document); PintaCore.Actions.File.Close.Sensitive = true; PintaCore.Actions.File.Save.Sensitive = true; PintaCore.Actions.File.SaveAs.Sensitive = true; PintaCore.Actions.File.Print.Sensitive = true; PintaCore.Actions.Edit.Copy.Sensitive = true; PintaCore.Actions.Edit.CopyMerged.Sensitive = true; PintaCore.Actions.Edit.Cut.Sensitive = true; PintaCore.Actions.Edit.PasteIntoNewLayer.Sensitive = true; PintaCore.Actions.Edit.SelectAll.Sensitive = true; PintaCore.Actions.View.ActualSize.Sensitive = true; PintaCore.Actions.View.ZoomIn.Sensitive = true; PintaCore.Actions.View.ZoomOut.Sensitive = true; PintaCore.Actions.View.ZoomToSelection.Sensitive = true; PintaCore.Actions.View.ZoomToWindow.Sensitive = true; PintaCore.Actions.View.ZoomComboBox.Sensitive = true; PintaCore.Actions.Image.AutoCrop.Sensitive = true; PintaCore.Actions.Image.CanvasSize.Sensitive = true; PintaCore.Actions.Image.Resize.Sensitive = true; PintaCore.Actions.Image.FlipHorizontal.Sensitive = true; PintaCore.Actions.Image.FlipVertical.Sensitive = true; PintaCore.Actions.Image.Rotate180.Sensitive = true; PintaCore.Actions.Image.RotateCCW.Sensitive = true; PintaCore.Actions.Image.RotateCW.Sensitive = true; PintaCore.Actions.Layers.AddNewLayer.Sensitive = true; PintaCore.Actions.Layers.DuplicateLayer.Sensitive = true; PintaCore.Actions.Layers.FlipHorizontal.Sensitive = true; PintaCore.Actions.Layers.FlipVertical.Sensitive = true; PintaCore.Actions.Layers.ImportFromFile.Sensitive = true; PintaCore.Actions.Layers.Properties.Sensitive = true; PintaCore.Actions.Layers.RotateZoom.Sensitive = true; PintaCore.Actions.Adjustments.ToggleActionsSensitive (true); PintaCore.Actions.Effects.ToggleActionsSensitive (true); PintaCore.Actions.Window.SaveAll.Sensitive = true; PintaCore.Actions.Window.CloseAll.Sensitive = true; }
private void Workspace_DocumentClosed(object sender, DocumentEventArgs e) { PintaCore.Actions.Window.RemoveDocument (e.Document); if (!PintaCore.Workspace.HasOpenDocuments) { ToggleActions (false); } }
private void Workspace_DocumentCreated(object sender, DocumentEventArgs e) { PintaCore.Actions.Window.AddDocument (e.Document); ToggleActions (true); }
/// <summary> /// Rebuilds the list of documents after a document is opened or closed /// </summary> private void HandleDocumentOpenedOrClosed(object sender, DocumentEventArgs e) { RebuildDocumentList (); }
/// <summary> /// Rebuilds the list of documents after a document is opened or closed /// </summary> private void HandleDocumentOpenedOrClosed(object sender, DocumentEventArgs e) { store.Clear (); foreach (Document doc in PintaCore.Workspace.OpenDocuments) { store.AppendValues (doc.Filename, close_icon); } }
protected internal void OnDocumentCreated (DocumentEventArgs e) { e.Document.SelectionChanged += (sender, args) => { OnSelectionChanged (); }; if (DocumentCreated != null) DocumentCreated (this, e); }
private void Workspace_DocumentCreated (object sender, DocumentEventArgs e) { var doc = e.Document; // Find the currently active container for our new tab var container = DockNotebookManager.ActiveNotebookContainer ?? dock_container; var selected_index = container.TabControl.CurrentTabIndex; var canvas = new CanvasWindow (doc) { RulersVisible = PintaCore.Actions.View.Rulers.Active, RulerMetric = GetCurrentRulerMetric () }; var my_content = new DocumentViewContent (doc, canvas); // Insert our tab to the right of the currently selected tab container.TabControl.InsertTab (my_content, selected_index + 1); doc.Workspace.Canvas = canvas.Canvas; // Zoom to window only on first show (if we do it always, it will be called on every resize) canvas.SizeAllocated += (o, e2) => { if (!canvas.HasBeenShown) ZoomToWindow_Activated (o, e); canvas.HasBeenShown = true; }; PintaCore.Actions.View.Rulers.Toggled += (o, e2) => { canvas.RulersVisible = ((ToggleAction)o).Active; }; PintaCore.Actions.View.Pixels.Activated += (o, e2) => { canvas.RulerMetric = MetricType.Pixels; }; PintaCore.Actions.View.Inches.Activated += (o, e2) => { canvas.RulerMetric = MetricType.Inches; }; PintaCore.Actions.View.Centimeters.Activated += (o, e2) => { canvas.RulerMetric = MetricType.Centimeters; }; }
private void Workspace_DocumentClosed (object sender, DocumentEventArgs e) { var tab = FindTabWithCanvas ((PintaCanvas)e.Document.Workspace.Canvas); if (tab != null) dock_container.CloseTab (tab); }