Beispiel #1
0
        public void CreateMainMenu(Gtk.Menu menu)
        {
            menu.Append(Undo.CreateAcceleratedMenuItem(Gdk.Key.Z, Gdk.ModifierType.ControlMask));

            ImageMenuItem redo = Redo.CreateAcceleratedMenuItem(Gdk.Key.Z, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask);

            redo.AddAccelerator("activate", PintaCore.Actions.AccelGroup, new AccelKey(Gdk.Key.Y, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
            menu.Append(redo);

            menu.AppendSeparator();
            menu.Append(Cut.CreateAcceleratedMenuItem(Gdk.Key.X, Gdk.ModifierType.ControlMask));
            menu.Append(Copy.CreateAcceleratedMenuItem(Gdk.Key.C, Gdk.ModifierType.ControlMask));
            menu.Append(CopyMerged.CreateAcceleratedMenuItem(Gdk.Key.C, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
            menu.Append(Paste.CreateAcceleratedMenuItem(Gdk.Key.V, Gdk.ModifierType.ControlMask));
            menu.Append(PasteIntoNewLayer.CreateAcceleratedMenuItem(Gdk.Key.V, Gdk.ModifierType.ShiftMask | Gdk.ModifierType.ControlMask));
            menu.Append(PasteIntoNewImage.CreateAcceleratedMenuItem(Gdk.Key.V, Gdk.ModifierType.Mod1Mask | Gdk.ModifierType.ControlMask));

            menu.AppendSeparator();
            menu.Append(SelectAll.CreateAcceleratedMenuItem(Gdk.Key.A, Gdk.ModifierType.ControlMask));

            ImageMenuItem deslect = Deselect.CreateAcceleratedMenuItem(Gdk.Key.A, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask);

            deslect.AddAccelerator("activate", PintaCore.Actions.AccelGroup, new AccelKey(Gdk.Key.D, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
            menu.Append(deslect);

            menu.AppendSeparator();
            menu.Append(EraseSelection.CreateAcceleratedMenuItem(Gdk.Key.Delete, Gdk.ModifierType.None));
            menu.Append(FillSelection.CreateAcceleratedMenuItem(Gdk.Key.BackSpace, Gdk.ModifierType.None));
            menu.Append(InvertSelection.CreateAcceleratedMenuItem(Gdk.Key.I, Gdk.ModifierType.ControlMask));

            menu.AppendSeparator();
            Gtk.Action menu_action  = new Gtk.Action("Palette", Mono.Unix.Catalog.GetString("Palette"), null, null);
            Menu       palette_menu = (Menu)menu.AppendItem(menu_action.CreateSubMenuItem()).Submenu;

            palette_menu.Append(LoadPalette.CreateMenuItem());
            palette_menu.Append(SavePalette.CreateMenuItem());
            palette_menu.Append(ResetPalette.CreateMenuItem());
            palette_menu.Append(ResizePalette.CreateMenuItem());

            menu.AppendSeparator();
            menu.Append(AddinManager.CreateMenuItem());
        }