示例#1
0
 public void CreateMainMenu(Gtk.Menu menu)
 {
     menu.Append(New.CreateAcceleratedMenuItem(Gdk.Key.N, Gdk.ModifierType.ControlMask));
     menu.Append(NewScreenshot.CreateMenuItem());
     menu.Append(Open.CreateAcceleratedMenuItem(Gdk.Key.O, Gdk.ModifierType.ControlMask));
     menu.Append(OpenRecent.CreateMenuItem());
     menu.AppendSeparator();
     menu.Append(Save.CreateAcceleratedMenuItem(Gdk.Key.S, Gdk.ModifierType.ControlMask));
     menu.Append(SaveAs.CreateAcceleratedMenuItem(Gdk.Key.S, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
     menu.AppendSeparator();
     menu.Append(Print.CreateAcceleratedMenuItem(Gdk.Key.P, Gdk.ModifierType.ControlMask));
     menu.AppendSeparator();
     menu.Append(Close.CreateAcceleratedMenuItem(Gdk.Key.W, Gdk.ModifierType.ControlMask));
     menu.Append(Exit.CreateAcceleratedMenuItem(Gdk.Key.Q, Gdk.ModifierType.ControlMask));
 }
示例#2
0
        public void CreateMainMenu(Gtk.Menu menu)
        {
            menu.Append(New.CreateAcceleratedMenuItem(Gdk.Key.N, Gdk.ModifierType.ControlMask));
            menu.Append(NewScreenshot.CreateMenuItem());
            menu.Append(Open.CreateAcceleratedMenuItem(Gdk.Key.O, Gdk.ModifierType.ControlMask));
            menu.Append(OpenRecent.CreateMenuItem());
            menu.AppendSeparator();
            menu.Append(Save.CreateAcceleratedMenuItem(Gdk.Key.S, Gdk.ModifierType.ControlMask));
            menu.Append(SaveAs.CreateAcceleratedMenuItem(Gdk.Key.S, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
            menu.AppendSeparator();
            // Printing is disabled for now until it is fully functional.
#if false
            menu.Append(Print.CreateAcceleratedMenuItem(Gdk.Key.P, Gdk.ModifierType.ControlMask));
            menu.AppendSeparator();
#endif
            menu.Append(Close.CreateAcceleratedMenuItem(Gdk.Key.W, Gdk.ModifierType.ControlMask));
            menu.Append(Exit.CreateAcceleratedMenuItem(Gdk.Key.Q, Gdk.ModifierType.ControlMask));
        }
示例#3
0
        public void RegisterActions(Gtk.Application app, GLib.Menu menu)
        {
            app.AddAccelAction(New, "<Primary>N");
            menu.AppendItem(New.CreateMenuItem());

            app.AddAction(NewScreenshot);
            menu.AppendItem(NewScreenshot.CreateMenuItem());

            app.AddAccelAction(Open, "<Primary>O");
            menu.AppendItem(Open.CreateMenuItem());

            var save_section = new GLib.Menu();

            menu.AppendSection(null, save_section);

            app.AddAccelAction(Save, "<Primary>S");
            save_section.AppendItem(Save.CreateMenuItem());

            app.AddAccelAction(SaveAs, "<Primary><Shift>S");
            save_section.AppendItem(SaveAs.CreateMenuItem());

            var close_section = new GLib.Menu();

            menu.AppendSection(null, close_section);

            app.AddAccelAction(Close, "<Primary>W");
            close_section.AppendItem(Close.CreateMenuItem());

            // This is part of the application menu on macOS.
            if (PintaCore.System.OperatingSystem != OS.Mac)
            {
                var exit = PintaCore.Actions.App.Exit;
                app.AddAccelAction(exit, "<Primary>Q");
                close_section.AppendItem(exit.CreateMenuItem());
            }

            // Printing is disabled for now until it is fully functional.
#if false
            menu.Append(Print.CreateAcceleratedMenuItem(Gdk.Key.P, Gdk.ModifierType.ControlMask));
            menu.AppendSeparator();
#endif
        }