当前位置: 首页>>代码示例>>C#>>正文


C# Menu.Attach方法代码示例

本文整理汇总了C#中Gtk.Menu.Attach方法的典型用法代码示例。如果您正苦于以下问题:C# Menu.Attach方法的具体用法?C# Menu.Attach怎么用?C# Menu.Attach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk.Menu的用法示例。


在下文中一共展示了Menu.Attach方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: on_treeview_load_button_release_event

    private void on_treeview_load_button_release_event(object o, ButtonReleaseEventArgs args)
    {
        Gdk.EventButton e = args.Event;
        if (e.Button == 3) {
            Menu myMenu = new Menu ();
            Gtk.MenuItem myItem;

            myItem = new MenuItem (Catalog.GetString("Delete selected"));
            myItem.Activated += on_delete_selected_row_clicked;
            myMenu.Attach( myItem, 0, 1, 0, 1 );

            myMenu.Popup();
            myMenu.ShowAll();
        }
    }
开发者ID:GNOME,项目名称:chronojump,代码行数:15,代码来源:executeAuto.cs

示例2: treeviewRunsIntervalContextMenu

    private void treeviewRunsIntervalContextMenu(RunInterval myRun)
    {
        Menu myMenu = new Menu ();
        Gtk.MenuItem myItem;

        /*
        myItem = new MenuItem ( Catalog.GetString("Play Video") + " " +
                myRun.Type + " (" + myRun.PersonName + ")");
        if(File.Exists(Util.GetVideoFileName(currentSession.UniqueID,
                Constants.TestTypes.RUN_I, myTreeViewRunsInterval.EventSelectedID))) {
            myItem.Activated += on_video_play_selected_run_interval_clicked;
            myItem.Sensitive = true;
        } else
            myItem.Sensitive = false;
        myMenu.Attach( myItem, 0, 1, 0, 1 );
        */

        myItem = new MenuItem ( Catalog.GetString("Edit selected") + " " + myRun.Type + " (" + myRun.PersonName + ")");
        myItem.Activated += on_edit_selected_run_interval_clicked;
        myMenu.Attach( myItem, 0, 1, 0, 1 );

        myItem = new MenuItem ( Catalog.GetString("Repair selected") + " " + myRun.Type + " (" + myRun.PersonName + ")");
        myItem.Activated += on_repair_selected_run_interval_clicked;
        myMenu.Attach( myItem, 0, 1, 1, 2 );

        Gtk.SeparatorMenuItem mySep = new SeparatorMenuItem();
        myMenu.Attach( mySep, 0, 1, 2, 3 );

        myItem = new MenuItem ( Catalog.GetString("Delete selected") + " " + myRun.Type + " (" + myRun.PersonName + ")");
        myItem.Activated += on_delete_selected_run_interval_clicked;
        myMenu.Attach( myItem, 0, 1, 3, 4 );

        myMenu.Popup();
        myMenu.ShowAll();
    }
开发者ID:dineshkummarc,项目名称:chronojump,代码行数:35,代码来源:chronojump.cs

示例3: treeviewPersonsContextMenu

    private void treeviewPersonsContextMenu(Person myPerson)
    {
        Menu myMenu = new Menu ();
        Gtk.MenuItem myItem;

        myItem = new MenuItem ( Catalog.GetString("Edit") + " " + myPerson.Name);
        myItem.Activated += on_edit_current_person_clicked;
        myMenu.Attach( myItem, 0, 1, 0, 1 );

        myItem = new MenuItem ( Catalog.GetString("Show all tests of") + " " + myPerson.Name);
        myItem.Activated += on_show_all_person_events_activate;
        myMenu.Attach( myItem, 0, 1, 1, 2 );

        Gtk.SeparatorMenuItem mySep = new SeparatorMenuItem();
        myMenu.Attach( mySep, 0, 1, 2, 3 );

        myItem = new MenuItem ( string.Format(Catalog.GetString("Delete {0} from this session"),myPerson.Name));
        myItem.Activated += on_delete_current_person_from_session_clicked;
        myMenu.Attach( myItem, 0, 1, 3, 4 );

        myMenu.Popup();
        myMenu.ShowAll();
    }
开发者ID:dineshkummarc,项目名称:chronojump,代码行数:23,代码来源:chronojump.cs

示例4: treeviewMultiChronopicContextMenu

    private void treeviewMultiChronopicContextMenu(MultiChronopic mc)
    {
        Menu myMenu = new Menu ();
        Gtk.MenuItem myItem;

        /*
        myItem = new MenuItem ( Catalog.GetString("Play Video") + " " +
                mc.Type + " (" + mc.PersonName + ")");
        if(File.Exists(Util.GetVideoFileName(currentSession.UniqueID,
                Constants.TestTypes.MULTICHRONOPIC, myTreeViewMultiChronopic.EventSelectedID))) {
            myItem.Activated += on_video_play_selected_multi_chronopic_clicked;
            myItem.Sensitive = true;
        } else
            myItem.Sensitive = false;
        myMenu.Attach( myItem, 0, 1, 0, 1 );
        */

        myItem = new MenuItem ( Catalog.GetString("Edit selected") + " " + mc.Type + " (" + mc.PersonName + ")");
        myItem.Activated += on_edit_selected_multi_chronopic_clicked;
        myMenu.Attach( myItem, 0, 1, 0, 1 );

        /*
        myItem = new MenuItem ( Catalog.GetString("Repair selected") + " " + mc.Type + " (" + mc.PersonName + ")");
        myItem.Activated += on_repair_selected_multi_chronopic_clicked;
        myMenu.Attach( myItem, 0, 1, 2, 3 );
        */

        Gtk.SeparatorMenuItem mySep = new SeparatorMenuItem();
        myMenu.Attach( mySep, 0, 1, 1, 2 );

        myItem = new MenuItem ( Catalog.GetString("Delete selected") + " " + mc.Type + " (" + mc.PersonName + ")");
        myItem.Activated += on_delete_selected_multi_chronopic_clicked;
        myMenu.Attach( myItem, 0, 1, 2, 3 );

        myMenu.Popup();
        myMenu.ShowAll();
    }
开发者ID:dineshkummarc,项目名称:chronojump,代码行数:37,代码来源:chronojump.cs

示例5: treeviewJumpsContextMenu

    private void treeviewJumpsContextMenu(Jump myJump)
    {
        Menu myMenu = new Menu ();
        Gtk.MenuItem myItem;

        /*
        myItem = new MenuItem ( Catalog.GetString("Play Video") + " " +
                myJump.Type + " (" + myJump.PersonName + ")");
        if(File.Exists(Util.GetVideoFileName(currentSession.UniqueID,
                Constants.TestTypes.JUMP, myTreeViewJumps.EventSelectedID))) {
            myItem.Activated += on_video_play_selected_jump_clicked;
            myItem.Sensitive = true;
        } else
            myItem.Sensitive = false;
        myMenu.Attach( myItem, 0, 1, 0, 1 );
        */

        myItem = new MenuItem ( Catalog.GetString("Edit selected") + " " + myJump.Type + " (" + myJump.PersonName + ")");
        myItem.Activated += on_edit_selected_jump_clicked;
        myMenu.Attach( myItem, 0, 1, 0, 1 );

        Gtk.SeparatorMenuItem mySep = new SeparatorMenuItem();
        myMenu.Attach( mySep, 0, 1, 1, 2 );

        myItem = new MenuItem ( Catalog.GetString("Delete selected") + " " + myJump.Type + " (" + myJump.PersonName + ")");
        myItem.Activated += on_delete_selected_jump_clicked;
        myMenu.Attach( myItem, 0, 1, 2, 3 );

        myMenu.Popup();
        myMenu.ShowAll();
    }
开发者ID:dineshkummarc,项目名称:chronojump,代码行数:31,代码来源:chronojump.cs

示例6: treeviewContextMenu

    private void treeviewContextMenu()
    {
        menuCtx = new Menu ();
        Gtk.MenuItem myItem;

        if(genericWinContextMenu == Constants.ContextMenu.EDITDELETE) {
            myItem = new MenuItem ( Catalog.GetString("Edit selected") );
            myItem.Activated += on_edit_selected_clicked;
            menuCtx.Attach( myItem, 0, 1, 0, 1 );

            myItem = new MenuItem ( Catalog.GetString("Delete selected") );
            myItem.Activated += on_delete_selected_clicked;
            menuCtx.Attach( myItem, 0, 1, 1, 2 );
        }
        else if(genericWinContextMenu == Constants.ContextMenu.DELETE) {
            myItem = new MenuItem ( Catalog.GetString("Delete selected") );
            myItem.Activated += on_delete_selected_clicked;
            menuCtx.Attach( myItem, 0, 1, 0, 1 );
        } else {
            //don't show nothing if there are no options
            menuCtx.Popdown();
            return;
        }

        menuCtx.Popup();
        menuCtx.ShowAll();
    }
开发者ID:GNOME,项目名称:chronojump,代码行数:27,代码来源:genericWindow.cs


注:本文中的Gtk.Menu.Attach方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。