public ImageActions() { Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add ("Menu.Image.CanvasSize.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.CanvasSize.png"))); fact.Add ("Menu.Image.Crop.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Crop.png"))); fact.Add ("Menu.Image.Flatten.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Flatten.png"))); fact.Add ("Menu.Image.FlipHorizontal.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.FlipHorizontal.png"))); fact.Add ("Menu.Image.FlipVertical.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.FlipVertical.png"))); fact.Add ("Menu.Image.Resize.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Resize.png"))); fact.Add ("Menu.Image.Rotate180CW.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Rotate180CW.png"))); fact.Add ("Menu.Image.Rotate90CCW.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Rotate90CCW.png"))); fact.Add ("Menu.Image.Rotate90CW.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Rotate90CW.png"))); fact.AddDefault (); CropToSelection = new Gtk.Action ("CropToSelection", Catalog.GetString ("Crop to Selection"), null, "Menu.Image.Crop.png"); AutoCrop = new Gtk.Action ("AutoCrop", Catalog.GetString ("Auto Crop"), null, "Menu.Image.Crop.png"); Resize = new Gtk.Action ("Resize", Catalog.GetString ("Resize Image..."), null, "Menu.Image.Resize.png"); CanvasSize = new Gtk.Action ("CanvasSize", Catalog.GetString ("Resize Canvas..."), null, "Menu.Image.CanvasSize.png"); FlipHorizontal = new Gtk.Action ("FlipHorizontal", Catalog.GetString ("Flip Horizontal"), null, "Menu.Image.FlipHorizontal.png"); FlipVertical = new Gtk.Action ("FlipVertical", Catalog.GetString ("Flip Vertical"), null, "Menu.Image.FlipVertical.png"); RotateCW = new Gtk.Action ("RotateCW", Catalog.GetString ("Rotate 90° Clockwise"), null, "Menu.Image.Rotate90CW.png"); RotateCCW = new Gtk.Action ("RotateCCW", Catalog.GetString ("Rotate 90° Counter-Clockwise"), null, "Menu.Image.Rotate90CCW.png"); Rotate180 = new Gtk.Action ("Rotate180", Catalog.GetString ("Rotate 180°"), null, "Menu.Image.Rotate180CW.png"); Flatten = new Gtk.Action ("Flatten", Catalog.GetString ("Flatten"), null, "Menu.Image.Flatten.png"); CropToSelection.Sensitive = false; }
public LayerActions() { Gtk.IconFactory fact = new Gtk.IconFactory(); fact.Add("Menu.Layers.AddNewLayer.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.AddNewLayer.png"))); fact.Add("Menu.Layers.DeleteLayer.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.DeleteLayer.png"))); fact.Add("Menu.Layers.DuplicateLayer.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.DuplicateLayer.png"))); fact.Add("Menu.Layers.MergeLayerDown.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.MergeLayerDown.png"))); fact.Add("Menu.Layers.MoveLayerDown.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.MoveLayerDown.png"))); fact.Add("Menu.Layers.MoveLayerUp.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.MoveLayerUp.png"))); fact.Add("Menu.Layers.FlipHorizontal.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.FlipHorizontal.png"))); fact.Add("Menu.Layers.FlipVertical.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.FlipVertical.png"))); fact.Add("Menu.Layers.ImportFromFile.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.ImportFromFile.png"))); fact.Add("Menu.Layers.LayerProperties.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.LayerProperties.png"))); fact.Add("Menu.Layers.RotateZoom.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Layers.RotateZoom.png"))); fact.AddDefault(); AddNewLayer = new Gtk.Action("AddNewLayer", Catalog.GetString("Add New Layer"), null, "Menu.Layers.AddNewLayer.png"); DeleteLayer = new Gtk.Action("DeleteLayer", Catalog.GetString("Delete Layer"), null, "Menu.Layers.DeleteLayer.png"); DuplicateLayer = new Gtk.Action("DuplicateLayer", Catalog.GetString("Duplicate Layer"), null, "Menu.Layers.DuplicateLayer.png"); MergeLayerDown = new Gtk.Action("MergeLayerDown", Catalog.GetString("Merge Layer Down"), null, "Menu.Layers.MergeLayerDown.png"); ImportFromFile = new Gtk.Action("ImportFromFile", Catalog.GetString("Import from File..."), null, "Menu.Layers.ImportFromFile.png"); FlipHorizontal = new Gtk.Action("FlipHorizontal", Catalog.GetString("Flip Horizontal"), null, "Menu.Layers.FlipHorizontal.png"); FlipVertical = new Gtk.Action("FlipVertical", Catalog.GetString("Flip Vertical"), null, "Menu.Layers.FlipVertical.png"); RotateZoom = new Gtk.Action("RotateZoom", Catalog.GetString("Rotate / Zoom Layer..."), null, "Menu.Layers.RotateZoom.png"); MoveLayerUp = new Gtk.Action("MoveLayerUp", Catalog.GetString("Move Layer Up"), null, "Menu.Layers.MoveLayerUp.png"); MoveLayerDown = new Gtk.Action("MoveLayerDown", Catalog.GetString("Move Layer Down"), null, "Menu.Layers.MoveLayerDown.png"); Properties = new Gtk.Action("Properties", Catalog.GetString("Layer Properties..."), null, "Menu.Layers.LayerProperties.png"); RotateZoom.Sensitive = false; }
/// <summary> /// Register a new adjustment with Pinta, causing it to be added to the Adjustments menu. /// </summary> /// <param name="adjustment">The adjustment to register</param> /// <returns>The action created for this adjustment</returns> public Gtk.Action RegisterAdjustment(BaseEffect adjustment) { // Add icon to IconFactory Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add (adjustment.Icon, new Gtk.IconSet (PintaCore.Resources.GetIcon (adjustment.Icon))); fact.AddDefault (); // Create a gtk action for each adjustment Gtk.Action act = new Gtk.Action (adjustment.GetType ().Name, adjustment.Name + (adjustment.IsConfigurable ? Catalog.GetString ("...") : ""), string.Empty, adjustment.Icon); act.Activated += delegate (object sender, EventArgs e) { PintaCore.LivePreview.Start (adjustment); }; PintaCore.Actions.Adjustments.Actions.Add (act); // Create a menu item for each adjustment MenuItem menu_item; // If no key is specified, don't use an accelerated menu item if (adjustment.AdjustmentMenuKey == (Gdk.Key)0) menu_item = (MenuItem)act.CreateMenuItem (); else menu_item = act.CreateAcceleratedMenuItem (adjustment.AdjustmentMenuKey, adjustment.AdjustmentMenuKeyModifiers); ((Menu)((ImageMenuItem)PintaCore.Chrome.MainMenu.Children[5]).Submenu).AppendMenuItemSorted (menu_item); adjustments.Add (adjustment, act); adjustment_menuitems.Add (adjustment, menu_item); return act; }
/// <summary> /// Register a new adjustment with Pinta, causing it to be added to the Adjustments menu. /// </summary> /// <param name="adjustment">The adjustment to register</param> /// <returns>The action created for this adjustment</returns> public Gtk.Action RegisterAdjustment(BaseEffect adjustment) { // Add icon to IconFactory Gtk.IconFactory fact = new Gtk.IconFactory(); fact.Add(adjustment.Icon, new Gtk.IconSet(PintaCore.Resources.GetIcon(adjustment.Icon))); fact.AddDefault(); // Create a gtk action for each adjustment Gtk.Action act = new Gtk.Action(adjustment.GetType().Name, adjustment.Name + (adjustment.IsConfigurable ? Catalog.GetString("...") : ""), string.Empty, adjustment.Icon); act.Activated += delegate(object sender, EventArgs e) { PintaCore.LivePreview.Start(adjustment); }; PintaCore.Actions.Adjustments.Actions.Add(act); // Create a menu item for each adjustment MenuItem menu_item; // If no key is specified, don't use an accelerated menu item if (adjustment.AdjustmentMenuKey == (Gdk.Key) 0) { menu_item = (MenuItem)act.CreateMenuItem(); } else { menu_item = act.CreateAcceleratedMenuItem(adjustment.AdjustmentMenuKey, adjustment.AdjustmentMenuKeyModifiers); } ((Menu)((ImageMenuItem)PintaCore.Chrome.MainMenu.Children[5]).Submenu).AppendMenuItemSorted(menu_item); adjustments.Add(adjustment, act); adjustment_menuitems.Add(adjustment, menu_item); return(act); }
public ImageActions() { Gtk.IconFactory fact = new Gtk.IconFactory(); fact.Add("Menu.Image.CanvasSize.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.CanvasSize.png"))); fact.Add("Menu.Image.Crop.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.Crop.png"))); fact.Add("Menu.Image.Flatten.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.Flatten.png"))); fact.Add("Menu.Image.FlipHorizontal.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.FlipHorizontal.png"))); fact.Add("Menu.Image.FlipVertical.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.FlipVertical.png"))); fact.Add("Menu.Image.Resize.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.Resize.png"))); fact.Add("Menu.Image.Rotate180CW.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.Rotate180CW.png"))); fact.Add("Menu.Image.Rotate90CCW.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.Rotate90CCW.png"))); fact.Add("Menu.Image.Rotate90CW.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Image.Rotate90CW.png"))); fact.AddDefault(); CropToSelection = new Gtk.Action("CropToSelection", Catalog.GetString("Crop to Selection"), null, "Menu.Image.Crop.png"); AutoCrop = new Gtk.Action("AutoCrop", Catalog.GetString("Auto Crop"), null, "Menu.Image.Crop.png"); Resize = new Gtk.Action("Resize", Catalog.GetString("Resize Image..."), null, "Menu.Image.Resize.png"); CanvasSize = new Gtk.Action("CanvasSize", Catalog.GetString("Resize Canvas..."), null, "Menu.Image.CanvasSize.png"); FlipHorizontal = new Gtk.Action("FlipHorizontal", Catalog.GetString("Flip Horizontal"), null, "Menu.Image.FlipHorizontal.png"); FlipVertical = new Gtk.Action("FlipVertical", Catalog.GetString("Flip Vertical"), null, "Menu.Image.FlipVertical.png"); RotateCW = new Gtk.Action("RotateCW", Catalog.GetString("Rotate 90° Clockwise"), null, "Menu.Image.Rotate90CW.png"); RotateCCW = new Gtk.Action("RotateCCW", Catalog.GetString("Rotate 90° Counter-Clockwise"), null, "Menu.Image.Rotate90CCW.png"); Rotate180 = new Gtk.Action("Rotate180", Catalog.GetString("Rotate 180°"), null, "Menu.Image.Rotate180CW.png"); Flatten = new Gtk.Action("Flatten", Catalog.GetString("Flatten"), null, "Menu.Image.Flatten.png"); CropToSelection.Sensitive = false; }
public LayerActions() { Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add ("Menu.Layers.AddNewLayer.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.AddNewLayer.png"))); fact.Add ("Menu.Layers.DeleteLayer.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.DeleteLayer.png"))); fact.Add ("Menu.Layers.DuplicateLayer.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.DuplicateLayer.png"))); fact.Add ("Menu.Layers.MergeLayerDown.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.MergeLayerDown.png"))); fact.Add ("Menu.Layers.MoveLayerDown.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.MoveLayerDown.png"))); fact.Add ("Menu.Layers.MoveLayerUp.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.MoveLayerUp.png"))); fact.Add ("Menu.Layers.FlipHorizontal.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.FlipHorizontal.png"))); fact.Add ("Menu.Layers.FlipVertical.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.FlipVertical.png"))); fact.Add ("Menu.Layers.ImportFromFile.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.ImportFromFile.png"))); fact.Add ("Menu.Layers.LayerProperties.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.LayerProperties.png"))); fact.Add ("Menu.Layers.RotateZoom.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.RotateZoom.png"))); fact.AddDefault (); AddNewLayer = new Gtk.Action ("AddNewLayer", Catalog.GetString ("Add New Layer"), null, "Menu.Layers.AddNewLayer.png"); DeleteLayer = new Gtk.Action ("DeleteLayer", Catalog.GetString ("Delete Layer"), null, "Menu.Layers.DeleteLayer.png"); DuplicateLayer = new Gtk.Action ("DuplicateLayer", Catalog.GetString ("Duplicate Layer"), null, "Menu.Layers.DuplicateLayer.png"); MergeLayerDown = new Gtk.Action ("MergeLayerDown", Catalog.GetString ("Merge Layer Down"), null, "Menu.Layers.MergeLayerDown.png"); ImportFromFile = new Gtk.Action ("ImportFromFile", Catalog.GetString ("Import from File..."), null, "Menu.Layers.ImportFromFile.png"); FlipHorizontal = new Gtk.Action ("FlipHorizontal", Catalog.GetString ("Flip Horizontal"), null, "Menu.Layers.FlipHorizontal.png"); FlipVertical = new Gtk.Action ("FlipVertical", Catalog.GetString ("Flip Vertical"), null, "Menu.Layers.FlipVertical.png"); RotateZoom = new Gtk.Action ("RotateZoom", Catalog.GetString ("Rotate / Zoom"), null, "Menu.Layers.RotateZoom.png"); MoveLayerUp = new Gtk.Action ("MoveLayerUp", Catalog.GetString ("Move Layer Up"), null, "Menu.Layers.MoveLayerUp.png"); MoveLayerDown = new Gtk.Action ("MoveLayerDown", Catalog.GetString ("Move Layer Down"), null, "Menu.Layers.MoveLayerDown.png"); Properties = new Gtk.Action ("Properties", Catalog.GetString ("Layer Properties..."), null, "Menu.Layers.LayerProperties.png"); RotateZoom.Sensitive = false; }
/// Add New Pixbuf to Stock public static void AddToStock(string name, Gdk.Pixbuf pixbuf) { Gtk.IconFactory factory = new Gtk.IconFactory(); factory.AddDefault(); Gtk.IconSet iconset = new Gtk.IconSet(pixbuf); factory.Add(name, iconset); }
public EditActions() { Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add ("Menu.Edit.Deselect.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.Deselect.png"))); fact.Add ("Menu.Edit.EraseSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.EraseSelection.png"))); fact.Add ("Menu.Edit.FillSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.FillSelection.png"))); fact.Add ("Menu.Edit.InvertSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.InvertSelection.png"))); fact.Add ("Menu.Edit.SelectAll.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.SelectAll.png"))); fact.AddDefault (); Undo = new Gtk.Action ("Undo", Catalog.GetString ("Undo"), null, Stock.Undo); Redo = new Gtk.Action ("Redo", Catalog.GetString ("Redo"), null, Stock.Redo); Cut = new Gtk.Action ("Cut", Catalog.GetString ("Cut"), null, Stock.Cut); Copy = new Gtk.Action ("Copy", Catalog.GetString ("Copy"), null, Stock.Copy); Paste = new Gtk.Action ("Paste", Catalog.GetString ("Paste"), null, Stock.Paste); PasteSubmenu = new Gtk.Action("Paste into", Catalog.GetString("Paste into..."), null, Stock.Paste); PasteIntoNewImage = new Gtk.Action("PasteIntoNewImage", Catalog.GetString("New image"), null, Stock.New); PasteIntoNewLayer = new Gtk.Action("PasteIntoNewLayer", Catalog.GetString("New layer"), null, "Menu.Layers.AddNewLayer.png"); EraseSelection = new Gtk.Action ("EraseSelection", Catalog.GetString ("Erase Selection"), null, "Menu.Edit.EraseSelection.png"); FillSelection = new Gtk.Action ("FillSelection", Catalog.GetString ("Fill Selection"), null, "Menu.Edit.FillSelection.png"); InvertSelection = new Gtk.Action ("InvertSelection", Catalog.GetString ("Invert Selection"), null, "Menu.Edit.InvertSelection.png"); SelectAll = new Gtk.Action ("SelectAll", Catalog.GetString ("Select All"), null, Stock.SelectAll); Deselect = new Gtk.Action ("Deselect", Catalog.GetString ("Deselect"), null, "Menu.Edit.Deselect.png"); Undo.IsImportant = true; Undo.Sensitive = false; Redo.Sensitive = false; InvertSelection.Sensitive = false; Deselect.Sensitive = false; EraseSelection.Sensitive = false; FillSelection.Sensitive = false; }
/// <summary> /// Register a new adjustment with Pinta, causing it to be added to the Adjustments menu. /// </summary> /// <param name="adjustment">The adjustment to register</param> /// <returns>The action created for this adjustment</returns> public void RegisterAdjustment(BaseEffect adjustment) { // Add icon to IconFactory Gtk.IconFactory fact = new Gtk.IconFactory(); ObsoleteExtensions.AddToIconFactory(fact, adjustment.Icon, new Gtk.IconSet(PintaCore.Resources.GetIcon(adjustment.Icon))); ObsoleteExtensions.AddDefaultToIconFactory(fact); // Create a gtk action for each adjustment var act = new Command(adjustment.GetType().Name, adjustment.Name + (adjustment.IsConfigurable ? Translations.GetString("...") : ""), string.Empty, adjustment.Icon); act.Activated += (o, args) => { PintaCore.LivePreview.Start(adjustment); }; PintaCore.Actions.Adjustments.Actions.Add(act); // If no key is specified, don't use an accelerated menu item if (adjustment.AdjustmentMenuKey is null) { PintaCore.Chrome.Application.AddAction(act); } else { PintaCore.Chrome.Application.AddAccelAction(act, adjustment.AdjustmentMenuKeyModifiers + adjustment.AdjustmentMenuKey); } PintaCore.Chrome.AdjustmentsMenu.AppendMenuItemSorted(act.CreateMenuItem()); adjustments.Add(adjustment, act); }
public EditActions() { Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add ("Menu.Edit.Deselect.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.Deselect.png"))); fact.Add ("Menu.Edit.EraseSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.EraseSelection.png"))); fact.Add ("Menu.Edit.FillSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.FillSelection.png"))); fact.Add ("Menu.Edit.InvertSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.InvertSelection.png"))); fact.Add ("Menu.Edit.SelectAll.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.SelectAll.png"))); fact.AddDefault (); Undo = new Gtk.Action ("Undo", Mono.Unix.Catalog.GetString ("Undo"), null, "gtk-undo"); Redo = new Gtk.Action ("Redo", Mono.Unix.Catalog.GetString ("Redo"), null, "gtk-redo"); Cut = new Gtk.Action ("Cut", Mono.Unix.Catalog.GetString ("Cut"), null, "gtk-cut"); Copy = new Gtk.Action ("Copy", Mono.Unix.Catalog.GetString ("Copy"), null, "gtk-copy"); Paste = new Gtk.Action ("Paste", Mono.Unix.Catalog.GetString ("Paste"), null, "gtk-paste"); PasteIntoNewLayer = new Gtk.Action ("PasteIntoNewLayer", Mono.Unix.Catalog.GetString ("Paste Into New Layer"), null, "gtk-paste"); PasteIntoNewImage = new Gtk.Action ("PasteIntoNewImage", Mono.Unix.Catalog.GetString ("Paste Into New Image"), null, "gtk-paste"); EraseSelection = new Gtk.Action ("EraseSelection", Mono.Unix.Catalog.GetString ("Erase Selection"), null, "Menu.Edit.EraseSelection.png"); FillSelection = new Gtk.Action ("FillSelection", Mono.Unix.Catalog.GetString ("Fill Selection"), null, "Menu.Edit.FillSelection.png"); InvertSelection = new Gtk.Action ("InvertSelection", Mono.Unix.Catalog.GetString ("Invert Selection"), null, "Menu.Edit.InvertSelection.png"); SelectAll = new Gtk.Action ("SelectAll", Mono.Unix.Catalog.GetString ("Select All"), null, "Menu.Edit.SelectAll.png"); Deselect = new Gtk.Action ("Deselect", Mono.Unix.Catalog.GetString ("Deselect"), null, "Menu.Edit.Deselect.png"); Undo.Sensitive = false; Redo.Sensitive = false; PasteIntoNewImage.Sensitive = false; InvertSelection.Sensitive = false; Deselect.Sensitive = false; }
public ViewActions() { Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add ("Menu.View.ActualSize.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ActualSize.png"))); fact.Add ("Menu.View.Grid.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.Grid.png"))); fact.Add ("Menu.View.Rulers.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.Rulers.png"))); fact.Add ("Menu.View.ZoomIn.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomIn.png"))); fact.Add ("Menu.View.ZoomOut.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomOut.png"))); fact.Add ("Menu.View.ZoomToSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomToSelection.png"))); fact.Add ("Menu.View.ZoomToWindow.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomToWindow.png"))); fact.AddDefault (); ZoomIn = new Gtk.Action ("ZoomIn", Catalog.GetString ("Zoom In"), null, Stock.ZoomIn); ZoomOut = new Gtk.Action ("ZoomOut", Catalog.GetString ("Zoom Out"), null, Stock.ZoomOut); ZoomToWindow = new Gtk.Action ("ZoomToWindow", Catalog.GetString ("Zoom to Window"), null, Stock.ZoomFit); ZoomToSelection = new Gtk.Action ("ZoomToSelection", Catalog.GetString ("Zoom to Selection"), null, "Menu.View.ZoomToSelection.png"); ActualSize = new Gtk.Action ("ActualSize", Catalog.GetString ("Actual Size"), null, Stock.Zoom100); PixelGrid = new Gtk.ToggleAction ("PixelGrid", Catalog.GetString ("Pixel Grid"), null, "Menu.View.Grid.png"); Rulers = new Gtk.ToggleAction ("Rulers", Catalog.GetString ("Rulers"), null, "Menu.View.Rulers.png"); Pixels = new Gtk.Action ("Pixels", Catalog.GetString ("Pixels"), null, null); Inches = new Gtk.Action ("Inches", Catalog.GetString ("Inches"), null, null); Centimeters = new Gtk.Action ("Centimeters", Catalog.GetString ("Centimeters"), null, null); Fullscreen = new Gtk.Action ("Fullscreen", Catalog.GetString ("Fullscreen"), null, Stock.Fullscreen); ZoomComboBox = new ToolBarComboBox (75, 11, true, "3600%", "2400%", "1600%", "1200%", "800%", "700%", "600%", "500%", "400%", "300%", "200%", "100%", "66%", "50%", "33%", "25%", "16%", "12%", "8%", "5%", "Window"); UnitComboBox = new ToolBarComboBox (100, 0, false, Catalog.GetString ("Pixels"), Catalog.GetString ("Inches"), Catalog.GetString ("Centimeters")); }
public ViewActions() { Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add ("Menu.View.ActualSize.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ActualSize.png"))); fact.Add ("Menu.View.Grid.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.Grid.png"))); fact.Add ("Menu.View.Rulers.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.Rulers.png"))); fact.Add ("Menu.View.ZoomIn.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomIn.png"))); fact.Add ("Menu.View.ZoomOut.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomOut.png"))); fact.Add ("Menu.View.ZoomToSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomToSelection.png"))); fact.Add ("Menu.View.ZoomToWindow.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomToWindow.png"))); fact.AddDefault (); ZoomIn = new Gtk.Action ("ZoomIn", Catalog.GetString ("Zoom In"), null, Stock.ZoomIn); ZoomOut = new Gtk.Action ("ZoomOut", Catalog.GetString ("Zoom Out"), null, Stock.ZoomOut); ZoomToWindow = new Gtk.Action ("ZoomToWindow", Catalog.GetString ("Best Fit"), null, Stock.ZoomFit); ZoomToSelection = new Gtk.Action ("ZoomToSelection", Catalog.GetString ("Zoom to Selection"), null, "Menu.View.ZoomToSelection.png"); ActualSize = new Gtk.Action ("ActualSize", Catalog.GetString ("Normal Size"), null, Stock.Zoom100); ToolBar = new Gtk.ToggleAction ("Toolbar", Catalog.GetString ("Toolbar"), null, null); PixelGrid = new Gtk.ToggleAction ("PixelGrid", Catalog.GetString ("Pixel Grid"), null, "Menu.View.Grid.png"); Rulers = new Gtk.ToggleAction ("Rulers", Catalog.GetString ("Rulers"), null, "Menu.View.Rulers.png"); Pixels = new Gtk.RadioAction ("Pixels", Catalog.GetString ("Pixels"), null, null, 0); Inches = new Gtk.RadioAction ("Inches", Catalog.GetString ("Inches"), null, null, 1); Centimeters = new Gtk.RadioAction ("Centimeters", Catalog.GetString ("Centimeters"), null, null, 2); Fullscreen = new Gtk.Action ("Fullscreen", Catalog.GetString ("Fullscreen"), null, Stock.Fullscreen); ZoomCollection = new string[] { "3600%", "2400%", "1600%", "1200%", "800%", "700%", "600%", "500%", "400%", "300%", "200%", "175%", "150%", "125%", "100%", "66%", "50%", "33%", "25%", "16%", "12%", "8%", "5%", "Window" }; ZoomComboBox = new ToolBarComboBox (75, DefaultZoomIndex(), true, ZoomCollection); // Make sure these are the same group so only one will be selected at a time Inches.Group = Pixels.Group; Centimeters.Group = Pixels.Group; }
public ViewActions() { Gtk.IconFactory fact = new Gtk.IconFactory(); fact.Add("Menu.View.ActualSize.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ActualSize.png"))); fact.Add("Menu.View.Grid.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.Grid.png"))); fact.Add("Menu.View.Rulers.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.Rulers.png"))); fact.Add("Menu.View.ZoomIn.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ZoomIn.png"))); fact.Add("Menu.View.ZoomOut.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ZoomOut.png"))); fact.Add("Menu.View.ZoomToSelection.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ZoomToSelection.png"))); fact.Add("Menu.View.ZoomToWindow.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ZoomToWindow.png"))); fact.AddDefault(); ZoomIn = new Gtk.Action("ZoomIn", Catalog.GetString("Zoom In"), null, Stock.ZoomIn); ZoomOut = new Gtk.Action("ZoomOut", Catalog.GetString("Zoom Out"), null, Stock.ZoomOut); ZoomToWindow = new Gtk.Action("ZoomToWindow", Catalog.GetString("Best Fit"), null, Stock.ZoomFit); ZoomToSelection = new Gtk.Action("ZoomToSelection", Catalog.GetString("Zoom to Selection"), null, "Menu.View.ZoomToSelection.png"); ActualSize = new Gtk.Action("ActualSize", Catalog.GetString("Normal Size"), null, Stock.Zoom100); ToolBar = new Gtk.ToggleAction("Toolbar", Catalog.GetString("Toolbar"), null, null); PixelGrid = new Gtk.ToggleAction("PixelGrid", Catalog.GetString("Pixel Grid"), null, "Menu.View.Grid.png"); Rulers = new Gtk.ToggleAction("Rulers", Catalog.GetString("Rulers"), null, "Menu.View.Rulers.png"); Pixels = new Gtk.RadioAction("Pixels", Catalog.GetString("Pixels"), null, null, 0); Inches = new Gtk.RadioAction("Inches", Catalog.GetString("Inches"), null, null, 1); Centimeters = new Gtk.RadioAction("Centimeters", Catalog.GetString("Centimeters"), null, null, 2); Fullscreen = new Gtk.Action("Fullscreen", Catalog.GetString("Fullscreen"), null, Stock.Fullscreen); ZoomCollection = new string[] { ToPercent(36), ToPercent(24), ToPercent(16), ToPercent(12), ToPercent(8), ToPercent(7), ToPercent(6), ToPercent(5), ToPercent(4), ToPercent(3), ToPercent(2), ToPercent(1.75), ToPercent(1.5), ToPercent(1.25), ToPercent(1), ToPercent(0.66), ToPercent(0.5), ToPercent(0.33), ToPercent(0.25), ToPercent(0.16), ToPercent(0.12), ToPercent(0.08), ToPercent(0.05), Catalog.GetString("Window") }; ZoomComboBox = new ToolBarComboBox(90, DefaultZoomIndex(), true, ZoomCollection); // Make sure these are the same group so only one will be selected at a time Inches.Group = Pixels.Group; Centimeters.Group = Pixels.Group; // The toolbar is shown by default. ToolBar.Active = true; }
public ViewActions() { Gtk.IconFactory fact = new Gtk.IconFactory(); fact.Add("Menu.View.ActualSize.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ActualSize.png"))); fact.Add("Menu.View.Grid.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.Grid.png"))); fact.Add("Menu.View.Rulers.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.Rulers.png"))); fact.Add("Menu.View.ZoomIn.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ZoomIn.png"))); fact.Add("Menu.View.ZoomOut.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ZoomOut.png"))); fact.Add("Menu.View.ZoomToSelection.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ZoomToSelection.png"))); fact.Add("Menu.View.ZoomToWindow.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.View.ZoomToWindow.png"))); fact.AddDefault(); ZoomIn = new Gtk.Action("ZoomIn", Catalog.GetString("Zoom In"), null, Stock.ZoomIn); ZoomOut = new Gtk.Action("ZoomOut", Catalog.GetString("Zoom Out"), null, Stock.ZoomOut); ZoomToWindow = new Gtk.Action("ZoomToWindow", Catalog.GetString("Best Fit"), null, Stock.ZoomFit); ZoomToSelection = new Gtk.Action("ZoomToSelection", Catalog.GetString("Zoom to Selection"), null, "Menu.View.ZoomToSelection.png"); ActualSize = new Gtk.Action("ActualSize", Catalog.GetString("Normal Size"), null, Stock.Zoom100); ToolBar = new Gtk.ToggleAction("Toolbar", Catalog.GetString("Toolbar"), null, null); PixelGrid = new Gtk.ToggleAction("PixelGrid", Catalog.GetString("Pixel Grid"), null, "Menu.View.Grid.png"); Rulers = new Gtk.ToggleAction("Rulers", Catalog.GetString("Rulers"), null, "Menu.View.Rulers.png"); Pixels = new Gtk.RadioAction("Pixels", Catalog.GetString("Pixels"), null, null, 0); Inches = new Gtk.RadioAction("Inches", Catalog.GetString("Inches"), null, null, 1); Centimeters = new Gtk.RadioAction("Centimeters", Catalog.GetString("Centimeters"), null, null, 2); Fullscreen = new Gtk.Action("Fullscreen", Catalog.GetString("Fullscreen"), null, Stock.Fullscreen); ZoomCollection = new string[] { "3600%", "2400%", "1600%", "1200%", "800%", "700%", "600%", "500%", "400%", "300%", "200%", "175%", "150%", "125%", "100%", "66%", "50%", "33%", "25%", "16%", "12%", "8%", "5%", Catalog.GetString("Window") }; ZoomComboBox = new ToolBarComboBox(75, DefaultZoomIndex(), true, ZoomCollection); // Make sure these are the same group so only one will be selected at a time Inches.Group = Pixels.Group; Centimeters.Group = Pixels.Group; }
static TextTool() { Gtk.IconFactory fact = new Gtk.IconFactory(); fact.Add("ShapeTool.Outline.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("ShapeTool.Outline.png"))); fact.Add("ShapeTool.Fill.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("ShapeTool.Fill.png"))); fact.Add("ShapeTool.OutlineFill.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("ShapeTool.OutlineFill.png"))); fact.Add("TextTool.FillBackground.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("TextTool.FillBackground.png"))); fact.AddDefault(); }
static TextTool() { Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add ("ShapeTool.Outline.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("ShapeTool.Outline.png"))); fact.Add ("ShapeTool.Fill.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("ShapeTool.Fill.png"))); fact.Add ("ShapeTool.OutlineFill.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("ShapeTool.OutlineFill.png"))); fact.Add ("TextTool.FillBackground.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("TextTool.FillBackground.png"))); fact.AddDefault (); }
static BaseTool() { Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add ("Toolbar.AntiAliasingEnabledIcon.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Toolbar.AntiAliasingEnabledIcon.png"))); fact.Add ("Toolbar.AntiAliasingDisabledIcon.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Toolbar.AntiAliasingDisabledIcon.png"))); fact.Add ("Toolbar.BlendingEnabledIcon.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Toolbar.BlendingEnabledIcon.png"))); fact.Add ("Toolbar.BlendingOverwriteIcon.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Toolbar.BlendingOverwriteIcon.png"))); fact.Add ("Tools.FreeformShape.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Tools.FreeformShape.png"))); fact.AddDefault (); }
static BaseTool() { Gtk.IconFactory fact = new Gtk.IconFactory(); fact.Add("Toolbar.AntiAliasingEnabledIcon.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Toolbar.AntiAliasingEnabledIcon.png"))); fact.Add("Toolbar.AntiAliasingDisabledIcon.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Toolbar.AntiAliasingDisabledIcon.png"))); fact.Add("Toolbar.BlendingEnabledIcon.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Toolbar.BlendingEnabledIcon.png"))); fact.Add("Toolbar.BlendingOverwriteIcon.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Toolbar.BlendingOverwriteIcon.png"))); fact.Add("Tools.FreeformShape.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Tools.FreeformShape.png"))); fact.AddDefault(); }
public HelpActions() { Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add ("Menu.Help.Bug.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Help.Bug.png"))); fact.Add ("Menu.Help.Website.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Help.Website.png"))); fact.Add ("Menu.Help.Translate.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Help.Translate.png"))); fact.AddDefault (); Website = new Gtk.Action ("Website", Catalog.GetString ("Pinta Website"), null, "Menu.Help.Website.png"); Bugs = new Gtk.Action ("Bugs", Catalog.GetString ("File a Bug"), null, "Menu.Help.Bug.png"); Translate = new Gtk.Action ("Translate", Catalog.GetString ("Translate This Application"), null, "Menu.Help.Translate.png"); About = new Gtk.Action ("About", Catalog.GetString ("About"), null, Stock.About); }
static DemoApplicationWindow () { // Register our custom toolbar icons, for themability Gdk.Pixbuf pixbuf = Gdk.Pixbuf.LoadFromResource ("gtk-logo-rgb.gif"); Gdk.Pixbuf transparent = pixbuf.AddAlpha (true, 0xff, 0xff, 0xff); IconFactory factory = new IconFactory (); factory.Add ("demo-gtk-logo", new IconSet (transparent)); factory.AddDefault (); StockManager.Add (new StockItem ("demo-gtk-logo", "_GTK#", 0, 0, null)); }
public HelpActions() { Gtk.IconFactory fact = new Gtk.IconFactory(); fact.Add("Menu.Help.Bug.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Help.Bug.png"))); fact.Add("Menu.Help.Website.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Help.Website.png"))); fact.Add("Menu.Help.Translate.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Help.Translate.png"))); fact.AddDefault(); Website = new Gtk.Action("Website", Catalog.GetString("Pinta Website"), null, "Menu.Help.Website.png"); Bugs = new Gtk.Action("Bugs", Catalog.GetString("File a Bug"), null, "Menu.Help.Bug.png"); Translate = new Gtk.Action("Translate", Catalog.GetString("Translate This Application"), null, "Menu.Help.Translate.png"); About = new Gtk.Action("About", Catalog.GetString("About"), null, Stock.About); }
public EditActions() { Gtk.IconFactory fact = new Gtk.IconFactory(); fact.Add("Menu.Edit.Deselect.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.Deselect.png"))); fact.Add("Menu.Edit.EraseSelection.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.EraseSelection.png"))); fact.Add("Menu.Edit.FillSelection.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.FillSelection.png"))); fact.Add("Menu.Edit.InvertSelection.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.InvertSelection.png"))); fact.Add("Menu.Edit.SelectAll.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.SelectAll.png"))); fact.Add("Menu.Edit.Addins.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.Addins.png"))); fact.AddDefault(); Undo = new Gtk.Action("Undo", Catalog.GetString("Undo"), null, Stock.Undo); Redo = new Gtk.Action("Redo", Catalog.GetString("Redo"), null, Stock.Redo); Cut = new Gtk.Action("Cut", Catalog.GetString("Cut"), null, Stock.Cut); Copy = new Gtk.Action("Copy", Catalog.GetString("Copy"), null, Stock.Copy); CopyMerged = new Gtk.Action("CopyMerged", Catalog.GetString("Copy Merged"), null, Stock.Copy); Paste = new Gtk.Action("Paste", Catalog.GetString("Paste"), null, Stock.Paste); PasteIntoNewLayer = new Gtk.Action("PasteIntoNewLayer", Catalog.GetString("Paste Into New Layer"), null, Stock.Paste); PasteIntoNewImage = new Gtk.Action("PasteIntoNewImage", Catalog.GetString("Paste Into New Image"), null, Stock.Paste); EraseSelection = new Gtk.Action("EraseSelection", Catalog.GetString("Erase Selection"), null, "Menu.Edit.EraseSelection.png"); FillSelection = new Gtk.Action("FillSelection", Catalog.GetString("Fill Selection"), null, "Menu.Edit.FillSelection.png"); InvertSelection = new Gtk.Action("InvertSelection", Catalog.GetString("Invert Selection"), null, "Menu.Edit.InvertSelection.png"); SelectAll = new Gtk.Action("SelectAll", Catalog.GetString("Select All"), null, Stock.SelectAll); Deselect = new Gtk.Action("Deselect", Catalog.GetString("Deselect All"), null, "Menu.Edit.Deselect.png"); Record = new Gtk.Action("Record", Catalog.GetString("Start Session"), null, Stock.MediaRecord); LoadPalette = new Gtk.Action("LoadPalette", Catalog.GetString("Open..."), null, Stock.Open); SavePalette = new Gtk.Action("SavePalette", Catalog.GetString("Save As..."), null, Stock.Save); ResetPalette = new Gtk.Action("ResetPalette", Catalog.GetString("Reset to Default"), null, Stock.RevertToSaved); ResizePalette = new Gtk.Action("ResizePalette", Catalog.GetString("Set Number of Colors"), null, "Menu.Image.Resize.png"); Undo.IsImportant = true; Undo.Sensitive = false; Redo.Sensitive = false; InvertSelection.Sensitive = false; Deselect.Sensitive = false; Record.Sensitive = true; EraseSelection.Sensitive = false; FillSelection.Sensitive = false; //video init this._isRecording = false; //this._screenSize = Screen.PrimaryScreen.Bounds; this._frameCount = 0; this._width = SystemInformation.VirtualScreen.Width; this._height = SystemInformation.VirtualScreen.Height; this._stopWatch = new Stopwatch(); this._screenArea = Screen.PrimaryScreen.Bounds; this._writer = new VideoFileWriter(); }
void AddStockIcon(IconFactory factory, string stockId, string filename) { var pixbuf = new Pixbuf(Assembly.GetCallingAssembly(), filename); var source = new IconSource() { Pixbuf = pixbuf, SizeWildcarded = true, Size = IconSize.SmallToolbar}; var set = new IconSet(); set.AddSource(source); factory.Add(stockId, set); }
private void CreateDockAndPads(HBox container) { Gtk.IconFactory fact = new Gtk.IconFactory(); fact.Add("Tools.Pencil.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Tools.Pencil.png"))); fact.Add("Pinta.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Pinta.png"))); fact.AddDefault(); // Dock widget dock = new DockFrame(); dock.CompactGuiLevel = 5; // Toolbox pad //var toolboxpad = new ToolBoxPad (); //toolboxpad.Initialize (dock, show_pad); // Palette pad var palettepad = new ColorPalettePad(); palettepad.Initialize(dock, show_pad); // Canvas pad canvas_pad = new CanvasPad(); canvas_pad.Initialize(dock, show_pad); sw = canvas_pad.ScrolledWindow; // Layer pad var layers_pad = new LayersPad(); layers_pad.Initialize(dock, show_pad); // Open Images pad var open_images_pad = new OpenImagesPad(); open_images_pad.Initialize(dock, show_pad); // History pad var history_pad = new HistoryPad(); history_pad.Initialize(dock, show_pad); container.PackStart(dock, true, true, 0); dock.CreateLayout("Default", false); dock.CurrentLayout = "Default"; }
/// <summary> /// Register a new effect with Pinta, causing it to be added to the Effects menu. /// </summary> /// <param name="effect">The effect to register</param> /// <returns>The action created for this effect</returns> public void RegisterEffect(BaseEffect effect) { // Add icon to IconFactory Gtk.IconFactory fact = new Gtk.IconFactory(); ObsoleteExtensions.AddToIconFactory(fact, effect.Icon, new Gtk.IconSet(PintaCore.Resources.GetIcon(effect.Icon))); ObsoleteExtensions.AddDefaultToIconFactory(fact); // Create a gtk action and menu item for each effect var act = new Command(effect.GetType().Name, effect.Name + (effect.IsConfigurable ? Translations.GetString("...") : ""), string.Empty, effect.Icon); PintaCore.Chrome.Application.AddAction(act); act.Activated += (o, args) => { PintaCore.LivePreview.Start(effect); }; PintaCore.Actions.Effects.AddEffect(effect.EffectMenuCategory, act); effects.Add(effect, act); }
/// <summary> /// Register a new effect with Pinta, causing it to be added to the Effects menu. /// </summary> /// <param name="effect">The effect to register</param> /// <returns>The action created for this effect</returns> public Gtk.Action RegisterEffect(BaseEffect effect) { // Add icon to IconFactory Gtk.IconFactory fact = new Gtk.IconFactory(); fact.Add(effect.Icon, new Gtk.IconSet(PintaCore.Resources.GetIcon(effect.Icon))); fact.AddDefault(); // Create a gtk action and menu item for each effect Gtk.Action act = new Gtk.Action(effect.GetType().Name, effect.Name + (effect.IsConfigurable ? Catalog.GetString("...") : ""), string.Empty, effect.Icon); act.Activated += delegate(object sender, EventArgs e) { PintaCore.LivePreview.Start(effect); }; PintaCore.Actions.Effects.AddEffect(effect.EffectMenuCategory, act); effects.Add(effect, act); return(act); }
// create the tray icon public TrayIcon(Plugin plugin) : base() { this.plugin = plugin; int width, height; IconFactory factory = new IconFactory (); factory.LookupIconSize (IconSize.Menu, out width, out height); Gdk.Pixbuf icon = new Gdk.Pixbuf (null, "fuse-tray.png", width, height); this.Add (new Image (icon)); this.ButtonPressEvent += tray_click; this.EnterNotifyEvent += mouse_enter; this.LeaveNotifyEvent += mouse_leave; timer.Elapsed += timer_count; tray = new Egg.TrayIcon ("Fuse"); }
public static void Initialize() { Gtk.IconFactory factory = new Gtk.IconFactory(); factory.AddDefault(); // Stock Icons foreach (string name in stock_icons) { Gdk.Pixbuf pixbuf = new Gdk.Pixbuf(null, name + ".png"); Gtk.IconSet iconset = new Gtk.IconSet(pixbuf); factory.Add(name, iconset); } // Stock Images foreach (string name in stock_images_names) { stock_images.Add(name, new Gdk.Pixbuf(null, name + ".png")); } }
public EditActions() { Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add ("Menu.Edit.Deselect.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.Deselect.png"))); fact.Add ("Menu.Edit.EraseSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.EraseSelection.png"))); fact.Add ("Menu.Edit.FillSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.FillSelection.png"))); fact.Add ("Menu.Edit.InvertSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.InvertSelection.png"))); fact.Add ("Menu.Edit.SelectAll.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.SelectAll.png"))); fact.Add ("Menu.Edit.Addins.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.Addins.png"))); fact.AddDefault (); Undo = new Gtk.Action ("Undo", Catalog.GetString ("Undo"), null, Stock.Undo); Redo = new Gtk.Action ("Redo", Catalog.GetString ("Redo"), null, Stock.Redo); Cut = new Gtk.Action ("Cut", Catalog.GetString ("Cut"), null, Stock.Cut); Copy = new Gtk.Action ("Copy", Catalog.GetString ("Copy"), null, Stock.Copy); CopyMerged = new Gtk.Action ("CopyMerged", Catalog.GetString ("Copy Merged"), null, Stock.Copy); Paste = new Gtk.Action ("Paste", Catalog.GetString ("Paste"), null, Stock.Paste); PasteIntoNewLayer = new Gtk.Action ("PasteIntoNewLayer", Catalog.GetString ("Paste Into New Layer"), null, Stock.Paste); PasteIntoNewImage = new Gtk.Action ("PasteIntoNewImage", Catalog.GetString ("Paste Into New Image"), null, Stock.Paste); EraseSelection = new Gtk.Action ("EraseSelection", Catalog.GetString ("Delete Selection"), null, "Menu.Edit.EraseSelection.png"); FillSelection = new Gtk.Action ("FillSelection", Catalog.GetString ("Fill Selection"), null, "Menu.Edit.FillSelection.png"); InvertSelection = new Gtk.Action ("InvertSelection", Catalog.GetString ("Invert Selection"), null, "Menu.Edit.InvertSelection.png"); SelectAll = new Gtk.Action ("SelectAll", Catalog.GetString ("Select All"), null, Stock.SelectAll); Deselect = new Gtk.Action ("Deselect", Catalog.GetString ("Deselect All"), null, "Menu.Edit.Deselect.png"); LoadPalette = new Gtk.Action ("LoadPalette", Catalog.GetString ("Open..."), null, Stock.Open); SavePalette = new Gtk.Action ("SavePalette", Catalog.GetString ("Save As..."), null, Stock.Save); ResetPalette = new Gtk.Action ("ResetPalette", Catalog.GetString ("Reset to Default"), null, Stock.RevertToSaved); ResizePalette = new Gtk.Action ("ResizePalette", Catalog.GetString ("Set Number of Colors"), null, "Menu.Image.Resize.png"); AddinManager = new Gtk.Action ("AddinManager", Catalog.GetString ("Add-in Manager"), null, "Menu.Edit.Addins.png"); Undo.IsImportant = true; Undo.Sensitive = false; Redo.Sensitive = false; InvertSelection.Sensitive = false; Deselect.Sensitive = false; EraseSelection.Sensitive = false; FillSelection.Sensitive = false; }
public EditActions() { Gtk.IconFactory fact = new Gtk.IconFactory(); fact.Add("Menu.Edit.Deselect.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.Deselect.png"))); fact.Add("Menu.Edit.EraseSelection.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.EraseSelection.png"))); fact.Add("Menu.Edit.FillSelection.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.FillSelection.png"))); fact.Add("Menu.Edit.InvertSelection.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.InvertSelection.png"))); fact.Add("Menu.Edit.SelectAll.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.SelectAll.png"))); fact.Add("Menu.Edit.Addins.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Menu.Edit.Addins.png"))); fact.AddDefault(); Undo = new Gtk.Action("Undo", Catalog.GetString("Undo"), null, Stock.Undo); Redo = new Gtk.Action("Redo", Catalog.GetString("Redo"), null, Stock.Redo); Cut = new Gtk.Action("Cut", Catalog.GetString("Cut"), null, Stock.Cut); Copy = new Gtk.Action("Copy", Catalog.GetString("Copy"), null, Stock.Copy); CopyMerged = new Gtk.Action("CopyMerged", Catalog.GetString("Copy Merged"), null, Stock.Copy); Paste = new Gtk.Action("Paste", Catalog.GetString("Paste"), null, Stock.Paste); PasteIntoNewLayer = new Gtk.Action("PasteIntoNewLayer", Catalog.GetString("Paste Into New Layer"), null, Stock.Paste); PasteIntoNewImage = new Gtk.Action("PasteIntoNewImage", Catalog.GetString("Paste Into New Image"), null, Stock.Paste); EraseSelection = new Gtk.Action("EraseSelection", Catalog.GetString("Delete Selection"), null, "Menu.Edit.EraseSelection.png"); FillSelection = new Gtk.Action("FillSelection", Catalog.GetString("Fill Selection"), null, "Menu.Edit.FillSelection.png"); InvertSelection = new Gtk.Action("InvertSelection", Catalog.GetString("Invert Selection"), null, "Menu.Edit.InvertSelection.png"); SelectAll = new Gtk.Action("SelectAll", Catalog.GetString("Select All"), null, Stock.SelectAll); Deselect = new Gtk.Action("Deselect", Catalog.GetString("Deselect All"), null, "Menu.Edit.Deselect.png"); LoadPalette = new Gtk.Action("LoadPalette", Catalog.GetString("Open..."), null, Stock.Open); SavePalette = new Gtk.Action("SavePalette", Catalog.GetString("Save As..."), null, Stock.Save); ResetPalette = new Gtk.Action("ResetPalette", Catalog.GetString("Reset to Default"), null, Stock.RevertToSaved); ResizePalette = new Gtk.Action("ResizePalette", Catalog.GetString("Set Number of Colors"), null, "Menu.Image.Resize.png"); AddinManager = new Gtk.Action("AddinManager", Catalog.GetString("Add-in Manager"), null, "Menu.Edit.Addins.png"); Undo.IsImportant = true; Undo.Sensitive = false; Redo.Sensitive = false; InvertSelection.Sensitive = false; Deselect.Sensitive = false; EraseSelection.Sensitive = false; FillSelection.Sensitive = false; }
static void gtml_activate() { icons = new Gtk.IconFactory(); icons.AddDefault(); window = new Gtk.Window(PN); window.DeleteEvent += new DeleteEventHandler(Window_Delete); window.SetDefaultSize(800, 120); window.Decorated = true; grid = new Gtk.Grid(); grid.ColumnHomogeneous = true; Gtk.Image icon = new Gtk.Image(); icon.IconName = ("list-add-symbolic"); import_button = new Gtk.Button(icon); import_button.Clicked += new EventHandler(gtml_import_full); Gtk.Box naw = new Gtk.Box(Gtk.Orientation.Horizontal, 1); naw.PackStart(import_button, true, true, 1); naw.ShowAll(); stack = new Gtk.Notebook(); stack.EnablePopup = true; stack.GroupName = "Mozilla Programs"; stack.Scrollable = true; stack.SetActionWidget(naw, Gtk.PackType.End); stack.Hexpand = true; stack.Vexpand = true; grid.Attach(stack, 1, 1, 1, 1); gtml_reload(); window.Add(grid); window.ShowAll(); }
public EffectsActions() { IconFactory fact = new IconFactory (); fact.Add ("Menu.Effects.Artistic.InkSketch.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Artistic.InkSketch.png"))); fact.Add ("Menu.Effects.Artistic.OilPainting.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Artistic.OilPainting.png"))); fact.Add ("Menu.Effects.Artistic.PencilSketch.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Artistic.PencilSketch.png"))); fact.Add ("Menu.Effects.Blurs.Fragment.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.Fragment.png"))); fact.Add ("Menu.Effects.Blurs.GaussianBlur.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.GaussianBlur.png"))); fact.Add ("Menu.Effects.Blurs.MotionBlur.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.MotionBlur.png"))); fact.Add ("Menu.Effects.Blurs.RadialBlur.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.RadialBlur.png"))); fact.Add ("Menu.Effects.Blurs.SurfaceBlur.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.SurfaceBlur.png"))); fact.Add ("Menu.Effects.Blurs.Unfocus.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.Unfocus.png"))); fact.Add ("Menu.Effects.Blurs.ZoomBlur.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Blurs.ZoomBlur.png"))); fact.Add ("Menu.Effects.Photo.Glow.png", new IconSet (PintaCore.Resources.GetIcon ("Menu.Effects.Photo.Glow.png"))); fact.AddDefault (); // Submenus Artistic = new Gtk.Action ("Artistic", Mono.Unix.Catalog.GetString ("Artistic"), null, null); Blurs = new Gtk.Action ("Blurs", Mono.Unix.Catalog.GetString ("Blurs"), null, null); Distort = new Gtk.Action ("Distort", Mono.Unix.Catalog.GetString ("Distort"), null, null); Noise = new Gtk.Action ("Noise", Mono.Unix.Catalog.GetString ("Noise"), null, null); Photo = new Gtk.Action ("Photo", Mono.Unix.Catalog.GetString ("Photo"), null, null); Render = new Gtk.Action ("Render", Mono.Unix.Catalog.GetString ("Render"), null, null); Stylize = new Gtk.Action ("Stylize", Mono.Unix.Catalog.GetString ("Stylize"), null, null); Distort.Visible = false; Noise.Visible = false; Render.Visible = false; Stylize.Visible = false; // Menu items InkSketch = new Gtk.Action ("InkSketch", Mono.Unix.Catalog.GetString ("Ink Sketch..."), null, "Menu.Effects.Artistic.InkSketch.png"); OilPainting = new Gtk.Action ("OilPainting", Mono.Unix.Catalog.GetString ("Oil Painting..."), null, "Menu.Effects.Artistic.OilPainting.png"); PencilSketch = new Gtk.Action ("PencilSketch", Mono.Unix.Catalog.GetString ("Pencil Sketch..."), null, "Menu.Effects.Artistic.PencilSketch.png"); GaussianBlur = new Gtk.Action ("GaussianBlur", Mono.Unix.Catalog.GetString ("Gaussian Blur..."), null, "Menu.Effects.Blurs.GaussianBlur.png"); Glow = new Gtk.Action ("Glow", Mono.Unix.Catalog.GetString ("Glow..."), null, "Menu.Effects.Photo.Glow.png"); }
public static void Initialize () { Gtk.StockItem [] stock_items = { FromDef ("f-spot-adjust-colors", Catalog.GetString ("Adjust Colors"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-autocolor", Catalog.GetString ("Auto Color"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-browse", Catalog.GetString ("Browse"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-camera", Catalog.GetString ("Camera"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-crop", Catalog.GetString ("Crop"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-desaturate", Catalog.GetString ("Desaturate"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-edit-image", Catalog.GetString ("Edit Photo"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-fullscreen", Catalog.GetString ("Fullscreen"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-horizon", Catalog.GetString ("Straighten"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-loading", Catalog.GetString ("Loading"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-new-tag", Catalog.GetString ("Create New Tag"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-question-mark", Catalog.GetString ("Question"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-red-eye", Catalog.GetString ("Reduce Red-Eye"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-rotate-270", Catalog.GetString ("Rotate _Left"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-rotate-90", Catalog.GetString ("Rotate _Right"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-sepia", Catalog.GetString ("Sepia Tone"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-slideshow", Catalog.GetString ("Slideshow"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-soft-focus", Catalog.GetString ("Soft Focus"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-stock_near", Catalog.GetString ("Near"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-stock_far", Catalog.GetString ("Far"), 0, Gdk.ModifierType.ShiftMask, null), FromDef ("f-spot-view-restore", Catalog.GetString ("Restore View"), 0, Gdk.ModifierType.ShiftMask, null), }; IconFactory icon_factory = new IconFactory (); icon_factory.AddDefault (); foreach (Gtk.StockItem item in stock_items) { Pixbuf pixbuf = PixbufUtils.LoadFromAssembly (item.StockId + ".png"); IconSet icon_set = new IconSet (pixbuf); icon_factory.Add (item.StockId, icon_set); Gtk.StockManager.Add (item); } }
public FileActions() { Gtk.IconFactory fact = new Gtk.IconFactory(); fact.Add("PackageBuilderIcon", new Gtk.IconSet(Gdk.Pixbuf.LoadFromResource("TraceLab.UI.GTK.Resources.Icon_PkgBuilder16.png"))); fact.AddDefault(); New = new Gtk.Action("New", Catalog.GetString("New..."), null, Stock.New); Open = new Gtk.Action("Open", Catalog.GetString("Open..."), null, Stock.Open); Close = new Gtk.Action("Close", Catalog.GetString("Close"), null, Stock.Close); Save = new Gtk.Action("Save", Catalog.GetString("Save"), null, Stock.Save); SaveAs = new Gtk.Action("SaveAs", Catalog.GetString("Save As..."), null, Stock.SaveAs); Exit = new Gtk.Action("Exit", Catalog.GetString("Quit"), null, Stock.Quit); New = new Gtk.Action("New", Catalog.GetString("New..."), null, Stock.New); Settings = new Gtk.Action("Settings", Catalog.GetString("Settings..."), null, Stock.Properties); PackageBuilder = new Gtk.Action("Package Builder", Catalog.GetString("Package Builder"), "Launch Package Builder", "PackageBuilderIcon"); New.ShortLabel = Catalog.GetString("New"); Open.ShortLabel = Catalog.GetString("Open"); Open.IsImportant = true; Save.IsImportant = true; Close.Sensitive = false; }
public FileActions() { Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add ("PackageBuilderIcon", new Gtk.IconSet(Gdk.Pixbuf.LoadFromResource("TraceLab.UI.GTK.Resources.Icon_PkgBuilder16.png"))); fact.AddDefault (); New = new Gtk.Action("New", Catalog.GetString("New..."), null, Stock.New); Open = new Gtk.Action("Open", Catalog.GetString("Open..."), null, Stock.Open); Close = new Gtk.Action("Close", Catalog.GetString("Close"), null, Stock.Close); Save = new Gtk.Action("Save", Catalog.GetString("Save"), null, Stock.Save); SaveAs = new Gtk.Action("SaveAs", Catalog.GetString("Save As..."), null, Stock.SaveAs); Exit = new Gtk.Action("Exit", Catalog.GetString("Quit"), null, Stock.Quit); New = new Gtk.Action("New", Catalog.GetString("New..."), null, Stock.New); Settings = new Gtk.Action("Settings", Catalog.GetString("Settings..."), null, Stock.Properties); PackageBuilder = new Gtk.Action("Package Builder", Catalog.GetString("Package Builder"), "Launch Package Builder", "PackageBuilderIcon"); New.ShortLabel = Catalog.GetString("New"); Open.ShortLabel = Catalog.GetString("Open"); Open.IsImportant = true; Save.IsImportant = true; Close.Sensitive = false; }
/// <summary> /// Register a new effect with Pinta, causing it to be added to the Effects menu. /// </summary> /// <param name="effect">The effect to register</param> /// <returns>The action created for this effect</returns> public Gtk.Action RegisterEffect(BaseEffect effect) { // Add icon to IconFactory Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add (effect.Icon, new Gtk.IconSet (PintaCore.Resources.GetIcon (effect.Icon))); fact.AddDefault (); // Create a gtk action and menu item for each effect Gtk.Action act = new Gtk.Action (effect.GetType ().Name, effect.Name + (effect.IsConfigurable ? Catalog.GetString ("...") : ""), string.Empty, effect.Icon); act.Activated += delegate (object sender, EventArgs e) { PintaCore.LivePreview.Start (effect); }; PintaCore.Actions.Effects.AddEffect (effect.EffectMenuCategory, act); effects.Add (effect, act); return act; }
public static void Load(string themePath) { if (themePath == null) throw new ArgumentNullException("themePath"); if (themePath.Length == 0) throw new ArgumentException("Argument is empty", "themePath"); // gtk requires an absolute path if (!Path.IsPathRooted(themePath)) throw new ArgumentException("Path must be absolute", "themePath"); if (!Directory.Exists(themePath)) throw new DirectoryNotFoundException(string.Format("Path to theme \"{0}\" not found", themePath)); //IconSize[] iconSizes = (IconSize[])Enum.GetValues(typeof(IconSize)); // all icon sizes the app uses IconSize[] iconSizes = { IconSize.Menu, /* 16px */ IconSize.LargeToolbar, /* 24px */ IconSize.Button, /* 24px */ IconSize.Dialog /* 48px */ }; Dictionary<string, string> iconNames = GetAllIconNames(); IconFactory fac = new IconFactory(); foreach (KeyValuePair<string, string> namePair in iconNames) { string name = namePair.Key; string nameInCustomTheme = namePair.Value; IconSet iconSet = new IconSet(); bool setHasSources = false; foreach (Gtk.IconSize size in iconSizes) { int sz = IconUtils.GetIconSizeVal(size); string fullPath = Path.Combine(Path.Combine(themePath, sz.ToString()), nameInCustomTheme); if (!File.Exists(fullPath)) { if (Global.EnableDebugging) { Debug.WriteLine(string.Format("IconTheme: could not find custom icon for \"{0}\" (size = {1}), using system default", name, sz)); } continue; } IconSource source = new IconSource(); #if LOAD_PIXBUFS source.Pixbuf = new Gdk.Pixbuf(fullPath); #else source.Filename = fullPath; #endif source.Size = size; //source.IconName = name; source.SizeWildcarded = false; iconSet.AddSource(source); setHasSources = true; } if (setHasSources) fac.Add(name, iconSet); } fac.AddDefault(); // add icon factory to the apps default factories }
static void AddIcon(IconFactory stock, string stockid, string resource) { Gtk.IconSet iconset = stock.Lookup (stockid); if (iconset != null) return; iconset = new Gtk.IconSet (); Gdk.Pixbuf img = Gdk.Pixbuf.LoadFromResource (resource); IconSource source = new IconSource (); source.Pixbuf = img; iconset.AddSource (source); stock.Add (stockid, iconset); }
void BuildToolBar() { IconFactory icon_factory = new IconFactory (); AddIcon (icon_factory, "logic-games", "logic-games-32.png"); AddIcon (icon_factory, "math-games", "math-games-32.png"); AddIcon (icon_factory, "memory-games", "memory-games-32.png"); AddIcon (icon_factory, "verbal-games", "verbal-games-32.png"); AddIcon (icon_factory, "pause", "pause-32.png"); AddIcon (icon_factory, "resume", "resume-32.png"); AddIcon (icon_factory, "endgame", "endgame-32.png"); AddIcon (icon_factory, "allgames", "allgames-32.png"); icon_factory.AddDefault (); IconSize = Gtk.IconSize.Dnd; AllButton = new ToolButton ("allgames"); AllButton.TooltipText = Catalog.GetString ("Play all the games"); AllButton.Label = Catalog.GetString ("All"); Insert (AllButton, -1); LogicButton = new ToolButton ("logic-games"); LogicButton.TooltipText = Catalog.GetString ("Play games that challenge your reasoning and thinking"); LogicButton.Label = Catalog.GetString ("Logic"); Insert (LogicButton, -1); CalculationButton = new ToolButton ("math-games"); CalculationButton.Label = Catalog.GetString ("Calculation"); CalculationButton.TooltipText = Catalog.GetString ("Play games that challenge your mental calculation skills"); Insert (CalculationButton, -1); MemoryButton = new ToolButton ("memory-games"); MemoryButton.Label = Catalog.GetString ("Memory"); MemoryButton.TooltipText = Catalog.GetString ("Play games that challenge your short term memory"); Insert (MemoryButton, -1); VerbalButton = new ToolButton ("verbal-games"); VerbalButton.Label = Catalog.GetString ("Verbal"); VerbalButton.TooltipText = Catalog.GetString ("Play games that challenge your verbal aptitude"); Insert (VerbalButton, -1); PauseButton = new ToolButton ("pause"); PauseButton.Label = Catalog.GetString ("Pause"); PauseButton.TooltipText = Catalog.GetString ("Pause or resume the game"); Insert (PauseButton, -1); FinishButton = new ToolButton ("endgame"); FinishButton.TooltipText = Catalog.GetString ("End the game and show score"); FinishButton.Label = Catalog.GetString ("End"); Insert (FinishButton, -1); }
private void CreateDockAndPads(HBox container) { Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add ("Tools.Pencil.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Tools.Pencil.png"))); fact.Add ("Pinta.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Pinta.png"))); fact.AddDefault (); // Dock widget dock = new DockFrame (); dock.CompactGuiLevel = 5; // Toolbox pad //var toolboxpad = new ToolBoxPad (); //toolboxpad.Initialize (dock, show_pad); // Palette pad var palettepad = new ColorPalettePad (); palettepad.Initialize (dock, show_pad); // Canvas pad canvas_pad = new CanvasPad (); canvas_pad.Initialize (dock, show_pad); sw = canvas_pad.ScrolledWindow; // Layer pad var layers_pad = new LayersPad (); layers_pad.Initialize (dock, show_pad); // Open Images pad var open_images_pad = new OpenImagesPad (); open_images_pad.Initialize (dock, show_pad); // History pad var history_pad = new HistoryPad (); history_pad.Initialize (dock, show_pad); container.PackStart (dock, true, true, 0); dock.CreateLayout ("Default", false); dock.CurrentLayout = "Default"; }
private void LoadEffects() { // Load our adjustments foreach (BaseEffect effect in extensions.Effects.Where (t => t.EffectOrAdjustment == EffectAdjustment.Adjustment).OrderBy (t => t.Text)) { // Add icon to IconFactory Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add (effect.Icon, new Gtk.IconSet (PintaCore.Resources.GetIcon (effect.Icon))); fact.AddDefault (); // Create a gtk action for each adjustment Gtk.Action act = new Gtk.Action (effect.GetType ().Name, effect.Text, string.Empty, effect.Icon); PintaCore.Actions.Adjustments.Actions.Add (act); act.Activated += delegate (object sender, EventArgs e) { PintaCore.LivePreview.Start (extensions.Effects.Where (t => t.GetType ().Name == (sender as Gtk.Action).Name).First ()); }; // Create a menu item for each adjustment ((Menu)((ImageMenuItem)main_menu.Children[5]).Submenu).Append (act.CreateAcceleratedMenuItem (effect.AdjustmentMenuKey, effect.AdjustmentMenuKeyModifiers)); } // Load our effects foreach (BaseEffect effect in extensions.Effects.Where (t => t.EffectOrAdjustment == EffectAdjustment.Effect).OrderBy (t => string.Format ("{0}|{1}", t.EffectMenuCategory, t.Text))) { // Add icon to IconFactory Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add (effect.Icon, new Gtk.IconSet (PintaCore.Resources.GetIcon (effect.Icon))); fact.AddDefault (); // Create a gtk action and menu item for each effect Gtk.Action act = new Gtk.Action (effect.GetType ().Name, effect.Text, string.Empty, effect.Icon); PintaCore.Actions.Effects.AddEffect (effect.EffectMenuCategory, act); act.Activated += delegate (object sender, EventArgs e) { PintaCore.LivePreview.Start (extensions.Effects.Where (t => t.GetType ().Name == (sender as Gtk.Action).Name).First ()); }; } }
// ============================================ // PUBLIC Methods // ============================================ /// Initialize NyFolder Stock Icons (Only Main() Call This) public static void Initialize() { Gtk.IconFactory factory = new Gtk.IconFactory(); factory.AddDefault(); // Stock Icons foreach (string name in stock_icons) { Gdk.Pixbuf pixbuf = new Gdk.Pixbuf(null, name + ".png"); Gtk.IconSet iconset = new Gtk.IconSet(pixbuf); factory.Add(name, iconset); } // Stock Images stock_images = Hashtable.Synchronized(new Hashtable()); foreach (string name in stock_images_names) { stock_images.Add(name, new Gdk.Pixbuf(null, name + ".png")); } }
private void CreateDockAndPads(HBox container) { Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add ("Tools.Pencil.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Tools.Pencil.png"))); fact.Add ("Pinta.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Pinta.png"))); fact.AddDefault (); // Dock widget dock = new DockFrame (); dock.CompactGuiLevel = 5; // Toolbox pad var toolboxpad = new ToolBoxPad (); toolboxpad.Initialize (dock, show_pad); // Palette pad var palettepad = new ColorPalettePad (); palettepad.Initialize (dock, show_pad); // Canvas pad var canvas_pad = new CanvasPad (); canvas_pad.Initialize (dock, show_pad); sw = canvas_pad.ScrolledWindow; // Layer pad var layers_pad = new LayersPad (); layers_pad.Initialize (dock, show_pad); // History pad var history_pad = new HistoryPad (); history_pad.Initialize (dock, show_pad); container.PackStart (dock, true, true, 0); string layout_file = System.IO.Path.Combine (PintaCore.Settings.GetUserSettingsDirectory (), "layouts.xml"); if (System.IO.File.Exists (layout_file)) dock.LoadLayouts (layout_file); if (!dock.HasLayout ("Default")) dock.CreateLayout ("Default", false); dock.CurrentLayout = "Default"; }
private void CreateDockAndPads(HBox container) { // Create canvas Table mainTable = new Table (2, 2, false); sw = new ScrolledWindow () { Name = "sw", ShadowType = ShadowType.EtchedOut }; Viewport vp = new Viewport () { ShadowType = ShadowType.None }; canvas = new PintaCanvas () { Name = "canvas", CanDefault = true, CanFocus = true, Events = (Gdk.EventMask)16134 }; // Dock widget dock = new DockFrame (); dock.CompactGuiLevel = 5; Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add ("Tools.Pencil.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Tools.Pencil.png"))); fact.Add ("Pinta.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Pinta.png"))); fact.AddDefault (); // Toolbox pad DockItem toolbox_item = dock.AddItem ("Toolbox"); toolbox = new ToolBoxWidget () { Name = "toolbox" }; toolbox_item.Label = Catalog.GetString ("Tools"); toolbox_item.Content = toolbox; toolbox_item.Icon = PintaCore.Resources.GetIcon ("Tools.Pencil.png"); toolbox_item.Behavior |= DockItemBehavior.CantClose; toolbox_item.DefaultWidth = 65; Gtk.Action show_toolbox = show_pad.AppendAction ("Tools", Catalog.GetString ("Tools"), null, "Tools.Pencil.png"); show_toolbox.Activated += delegate { toolbox_item.Visible = true; }; // Palette pad DockItem palette_item = dock.AddItem ("Palette"); color = new ColorPaletteWidget () { Name = "color" }; palette_item.Label = Catalog.GetString ("Palette"); palette_item.Content = color; palette_item.Icon = PintaCore.Resources.GetIcon ("Pinta.png"); palette_item.DefaultLocation = "Toolbox/Bottom"; palette_item.Behavior |= DockItemBehavior.CantClose; palette_item.DefaultWidth = 65; Gtk.Action show_palette = show_pad.AppendAction ("Palette", Catalog.GetString ("Palette"), null, "Pinta.png"); show_palette.Activated += delegate { palette_item.Visible = true; }; // Canvas pad DockItem documentDockItem = dock.AddItem ("Canvas"); documentDockItem.Behavior = DockItemBehavior.Locked; documentDockItem.Expand = true; documentDockItem.DrawFrame = false; documentDockItem.Label = Catalog.GetString ("Documents"); documentDockItem.Content = mainTable; //rulers hruler = new HRuler (); hruler.Metric = MetricType.Pixels; mainTable.Attach (hruler, 1, 2, 0, 1, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink | AttachOptions.Fill, 0, 0); vruler = new VRuler (); vruler.Metric = MetricType.Pixels; mainTable.Attach (vruler, 0, 1, 1, 2, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink | AttachOptions.Fill, 0, 0); sw.Hadjustment.ValueChanged += delegate { UpdateRulerRange (); }; sw.Vadjustment.ValueChanged += delegate { UpdateRulerRange (); }; PintaCore.Workspace.CanvasSizeChanged += delegate { UpdateRulerRange (); }; canvas.MotionNotifyEvent += delegate (object o, MotionNotifyEventArgs args) { if (!PintaCore.Workspace.HasOpenDocuments) return; Cairo.PointD point = PintaCore.Workspace.WindowPointToCanvas (args.Event.X, args.Event.Y); hruler.Position = point.X; vruler.Position = point.Y; }; mainTable.Attach (sw, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0); sw.Add (vp); vp.Add (canvas); mainTable.ShowAll (); canvas.Show (); vp.Show (); HideRulers(); // Layer pad layers = new LayersListWidget (); DockItem layers_item = dock.AddItem ("Layers"); DockItemToolbar layers_tb = layers_item.GetToolbar (PositionType.Bottom); layers_item.Label = Catalog.GetString ("Layers"); layers_item.Content = layers; layers_item.Icon = PintaCore.Resources.GetIcon ("Menu.Layers.MergeLayerDown.png"); layers_tb.Add (PintaCore.Actions.Layers.AddNewLayer.CreateDockToolBarItem ()); layers_tb.Add (PintaCore.Actions.Layers.DeleteLayer.CreateDockToolBarItem ()); layers_tb.Add (PintaCore.Actions.Layers.DuplicateLayer.CreateDockToolBarItem ()); layers_tb.Add (PintaCore.Actions.Layers.MergeLayerDown.CreateDockToolBarItem ()); layers_tb.Add (PintaCore.Actions.Layers.MoveLayerUp.CreateDockToolBarItem ()); layers_tb.Add (PintaCore.Actions.Layers.MoveLayerDown.CreateDockToolBarItem ()); Gtk.Action show_layers = show_pad.AppendAction ("Layers", Catalog.GetString ("Layers"), null, "Menu.Layers.MergeLayerDown.png"); show_layers.Activated += delegate { layers_item.Visible = true; }; // History pad HistoryTreeView history = new HistoryTreeView (); DockItem history_item = dock.AddItem ("History"); DockItemToolbar history_tb = history_item.GetToolbar (PositionType.Bottom); history_item.Label = Catalog.GetString ("History"); history_item.DefaultLocation = "Layers/Bottom"; history_item.Content = history; history_item.Icon = PintaCore.Resources.GetIcon ("Menu.Layers.DuplicateLayer.png"); history_tb.Add (PintaCore.Actions.Edit.Undo.CreateDockToolBarItem ()); history_tb.Add (PintaCore.Actions.Edit.Redo.CreateDockToolBarItem ()); Gtk.Action show_history = show_pad.AppendAction ("History", Catalog.GetString ("History"), null, "Menu.Layers.DuplicateLayer.png"); show_history.Activated += delegate { history_item.Visible = true; }; container.PackStart (dock, true, true, 0); string layout_file = System.IO.Path.Combine (PintaCore.Settings.GetUserSettingsDirectory (), "layouts.xml"); if (System.IO.File.Exists (layout_file)) dock.LoadLayouts (layout_file); if (!dock.HasLayout ("Default")) dock.CreateLayout ("Default", false); dock.CurrentLayout = "Default"; }
void CreateStockIcons() { var factory = new IconFactory(); factory.AddDefault(); AddStockIcon(factory, "slice-tool-arrow", "stock-arrow.png"); }
private void CreateDockAndPads(HBox container) { Gtk.IconFactory fact = new Gtk.IconFactory(); fact.Add("Tools.Pencil.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Tools.Pencil.png"))); fact.Add("Pinta.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Pinta.png"))); fact.AddDefault(); // Dock widget dock = new DockFrame(); dock.CompactGuiLevel = 5; var style = new DockVisualStyle(); style.PadTitleLabelColor = Styles.PadLabelColor; style.PadBackgroundColor = Styles.PadBackground; style.InactivePadBackgroundColor = Styles.InactivePadBackground; style.TabStyle = DockTabStyle.Normal; style.ShowPadTitleIcon = false; dock.DefaultVisualStyle = style; // Toolbox pad var toolboxpad = new ToolBoxPad(); toolboxpad.Initialize(dock, show_pad); // Palette pad var palettepad = new ColorPalettePad(); palettepad.Initialize(dock, show_pad); // Canvas pad canvas_pad = new CanvasPad(); canvas_pad.Initialize(dock, show_pad); dock_container = canvas_pad.NotebookContainer; // Layer pad var layers_pad = new LayersPad(); layers_pad.Initialize(dock, show_pad); // Open Images pad var open_images_pad = new OpenImagesPad(); open_images_pad.Initialize(dock, show_pad); // History pad var history_pad = new HistoryPad(); history_pad.Initialize(dock, show_pad); container.PackStart(dock, true, true, 0); string layout_file = PintaCore.Settings.LayoutFilePath; if (System.IO.File.Exists(layout_file)) { try { dock.LoadLayouts(layout_file); } // If parsing layouts.xml fails for some reason, proceed to create the default layout. catch (Exception e) { System.Console.Error.WriteLine("Error reading " + PintaCore.Settings.LayoutFile + ": " + e.ToString()); } } if (!dock.HasLayout("Default")) { dock.CreateLayout("Default", false); } dock.CurrentLayout = "Default"; }
private void CreateDockAndPads(HBox container) { Gtk.IconFactory fact = new Gtk.IconFactory(); fact.Add("Tools.Pencil.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Tools.Pencil.png"))); fact.Add("Pinta.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Pinta.png"))); fact.AddDefault(); // Dock widget dock = new DockFrame(); dock.CompactGuiLevel = 5; // Toolbox pad var toolboxpad = new ToolBoxPad(); toolboxpad.Initialize(dock, show_pad); // Palette pad var palettepad = new ColorPalettePad(); palettepad.Initialize(dock, show_pad); // Canvas pad canvas_pad = new CanvasPad(); canvas_pad.Initialize(dock, show_pad); sw = canvas_pad.ScrolledWindow; // Layer pad var layers_pad = new LayersPad(); layers_pad.Initialize(dock, show_pad); // Open Images pad var open_images_pad = new OpenImagesPad(); open_images_pad.Initialize(dock, show_pad); // History pad var history_pad = new HistoryPad(); history_pad.Initialize(dock, show_pad); container.PackStart(dock, true, true, 0); string layout_file = System.IO.Path.Combine(PintaCore.Settings.GetUserSettingsDirectory(), "layouts.xml"); if (System.IO.File.Exists(layout_file)) { try { dock.LoadLayouts(layout_file); } // If parsing layouts.xml fails for some reason, proceed to create the default layout. catch (Exception e) { System.Console.Error.WriteLine("Error reading layouts.xml: " + e.ToString()); } } if (!dock.HasLayout("Default")) { dock.CreateLayout("Default", false); } dock.CurrentLayout = "Default"; }
private void AddToToolbar(BaseTemplate i) { var w1 = new IconFactory(); var w2 = new IconSet(new Pixbuf( Assembly.GetExecutingAssembly(), i.GetIcon())); w1.Add(i.Type + "_icon", w2); w1.AddDefault(); var act = new Gtk.Action("c_Create" + i.Type + "Action", null, "Create " + i.Type + " Project", null); act.Activated += (object sender, System.EventArgs e) => { this.PromptCreateProject(i.Type); }; var t = act.CreateToolItem(); (t as ToolButton).StockId = i.Type + "_icon"; this.c_Toolbar.Add(t); }
private void CreateDockAndPads(HBox container) { Gtk.IconFactory fact = new Gtk.IconFactory (); fact.Add ("Tools.Pencil.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Tools.Pencil.png"))); fact.Add ("Pinta.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Pinta.png"))); fact.AddDefault (); // Dock widget dock = new DockFrame (); dock.CompactGuiLevel = 5; // Toolbox pad var toolboxpad = new ToolBoxPad (); toolboxpad.Initialize (dock, show_pad); // Palette pad var palettepad = new ColorPalettePad (); palettepad.Initialize (dock, show_pad); // Canvas pad var canvas_pad = new CanvasPad (); canvas_pad.Initialize (dock, show_pad); sw = canvas_pad.ScrolledWindow; // Layer pad var layers_pad = new LayersPad (); layers_pad.Initialize (dock, show_pad); // History pad var history_pad = new HistoryPad (); history_pad.Initialize (dock, show_pad); // Open Images pad var open_images_pad = new OpenImagesPad (); open_images_pad.Initialize (dock, show_pad); container.PackStart (dock, true, true, 0); string layout_file = System.IO.Path.Combine (PintaCore.Settings.GetUserSettingsDirectory (), "layouts.xml"); if (System.IO.File.Exists(layout_file)) { try { dock.LoadLayouts(layout_file); } // If parsing layouts.xml fails for some reason, proceed to create the default layout. catch (Exception e) { System.Console.Error.WriteLine ("Error reading layouts.xml: " + e.ToString()); } } if (!dock.HasLayout ("Default")) dock.CreateLayout ("Default", false); dock.CurrentLayout = "Default"; }