示例#1
0
 public PlayerMenu()
 {
     playerMenu = new Menu ();
     addToPlaylistMenu = new MenuItem ("");
     playerMenu.Add (addToPlaylistMenu);
     exportToVideoFile = new MenuItem ("");
     exportToVideoFile.Add (exportToVideoFile);
 }
示例#2
0
文件: Gui.cs 项目: Baltasarq/Visor
        private void BuildMenu()
        {
            var accelGroup = new Gtk.AccelGroup();

            // File
            this.miFile = new Gtk.MenuItem( "_File" );
            this.mFile = new Gtk.Menu();
            this.miFile.Submenu = this.mFile;

            var opOpen = this.actOpen.CreateMenuItem();
            opOpen.AddAccelerator( "activate", accelGroup, new Gtk.AccelKey(
            Gdk.Key.o, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible) );

            var opQuit = this.actQuit.CreateMenuItem();
            opQuit.AddAccelerator( "activate", accelGroup, new Gtk.AccelKey(
            Gdk.Key.q, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible) );

            miFile.Add( opOpen );
            miFile.Add( this.actClose.CreateMenuItem() );
            miFile.Add( new Gtk.SeparatorMenuItem() );
            miFile.Add( opQuit );

            // View
            this.miView = new Gtk.MenuItem( "_View" );
            this.mView = new Gtk.Menu();
            this.miView.Submenu = this.mView;

            var opViewToolbar = this.actViewToolbar.CreateMenuItem();

            var opForward = this.actForward.CreateMenuItem();
            opForward.AddAccelerator( "activate", accelGroup, new Gtk.AccelKey(
                Gdk.Key.Page_Down, Gdk.ModifierType.None, Gtk.AccelFlags.Visible) );

            var opBackward = this.actBack.CreateMenuItem();
            opForward.AddAccelerator( "activate", accelGroup, new Gtk.AccelKey(
            Gdk.Key.Page_Up, Gdk.ModifierType.None, Gtk.AccelFlags.Visible) );

            var opRewind = this.actRewind.CreateMenuItem();
            opRewind.AddAccelerator( "activate", accelGroup, new Gtk.AccelKey(
            Gdk.Key.Page_Up, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible) );

            var opGotoLast = this.actGoToEnd.CreateMenuItem();
            opGotoLast.AddAccelerator( "activate", accelGroup, new Gtk.AccelKey(
            Gdk.Key.Page_Down, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible) );

            var opGo = this.actGoTo.CreateMenuItem();
            opGo.AddAccelerator( "activate", accelGroup, new Gtk.AccelKey(
            Gdk.Key.g, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible) );

            var opFind = this.actFind.CreateMenuItem();
            opFind.AddAccelerator( "activate", accelGroup, new Gtk.AccelKey(
            Gdk.Key.f, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible) );

            this.mView.Add( opViewToolbar );
            this.mView.Add( opForward );
            this.mView.Add( opBackward );
            this.mView.Add( opRewind );
            this.mView.Add( opGotoLast );
            this.mView.Add( opGo );
            this.mView.Add( new Gtk.SeparatorMenuItem() );
            this.mView.Add( opFind );

            // Help
            this.miHelp = new Gtk.MenuItem( "_Help" );
            this.mHelp = new Gtk.Menu();
            this.miHelp.Submenu = this.mHelp;
            this.mHelp.Add( this.actAbout.CreateMenuItem() );

            // Menu bar
            this.mbMenuBar = new Gtk.MenuBar();
            this.mbMenuBar.Add( miFile );
            this.mbMenuBar.Add( miView );
            this.mbMenuBar.Add( miHelp );
            this.AddAccelGroup( accelGroup );
        }