當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。