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


C# Menu.ShowAll方法代码示例

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


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

示例1: IconPopupHandler

	void IconPopupHandler (object o, PopupMenuArgs args)
	{
		Menu popup = new Menu ();
		
		MenuItem item = new MenuItem ("About");
		item.Activated += new EventHandler (OnMenuAbout);
		popup.Append (item);
		
		item = new MenuItem ("Quit");
		item.Activated += new EventHandler (OnCloseButtonClicked);
		popup.Append (item);
		
		popup.ShowAll ();
		statusIcon.PresentMenu (popup, 3, Gtk.Global.CurrentEventTime);
//		popup.Popup ();
	}
开发者ID:dfr0,项目名称:moon,代码行数:16,代码来源:PanelWindow.cs

示例2: PopulateCategoryOptionMenu

		private void PopulateCategoryOptionMenu ()
		{
			categories = new ArrayList ();
			categories.Add (tag_store.RootCategory);
			PopulateCategories (categories, tag_store.RootCategory);

			Menu menu = new Menu ();

			foreach (Category category in categories)
				menu.Append (TagMenu.TagMenuItem.IndentedItem (category));

			category_option_menu.Sensitive = true;

			menu.ShowAll ();
			category_option_menu.Menu = menu;
		}
开发者ID:guadalinex-archive,项目名称:guadalinex-v6,代码行数:16,代码来源:TagCommands.cs

示例3: OnConfigListTreeviewButtonPressEvent

 protected void OnConfigListTreeviewButtonPressEvent(object o, ButtonPressEventArgs args)
 {
     if (args.Event.Button == 3)
     {
         Menu m = new Menu();
         MenuItem ViewInfo = new MenuItem("View Config Pack Information");
         ViewInfo.ButtonPressEvent += (sender, argss) =>
             {
                 TreeSelection selection = (o as TreeView).Selection;
                 TreeModel model;
                 TreeIter iter;
                 if(selection.GetSelected(out model, out iter))
                 {
                     var match = ConfigList.FirstOrDefault(x => x.FriendlyName.Equals(model.GetValue(iter, 0).ToString()));
                     ViewPackInfoWindow vpi = new ViewPackInfoWindow(ReadPackInformation(match));
                     vpi.Show();
                 }
             };
         m.Add(ViewInfo);
         m.ShowAll();
         m.Popup();
     }
 }
开发者ID:lighthouse64,项目名称:PGE-Project,代码行数:23,代码来源:MainWindow.cs

示例4: ShowPopupMenu

    private void ShowPopupMenu()
    {
        Menu popupMenu = new Menu();

        MenuItem editPathItem = new MenuItem("Edit Path");
        editPathItem.Activated += OnEditPath;
        editPathItem.Sensitive = currentObject is IPathObject;
        popupMenu.Append(editPathItem);

        MenuItem deletePathItem = new MenuItem("Delete Path");
        deletePathItem.Activated += OnDeletePath;
        deletePathItem.Sensitive = currentObject is IPathObject;
        popupMenu.Append(deletePathItem);

        MenuItem deleteItem = new ImageMenuItem(Stock.Delete, null);
        deleteItem.Activated += OnDelete;
        popupMenu.Append(deleteItem);

        popupMenu.ShowAll();
        popupMenu.Popup();
    }
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:21,代码来源:GameObjectListWidget.cs

示例5: OnTogglebuttonToggled

    protected void OnTogglebuttonToggled(object sender, System.EventArgs e)
    {
        if (addNewOperation_togglebutton.Active)
        {
            Menu menu = new Menu();
            int w, h;
            menu.GetSizeRequest(out w, out h);
            int menu_width = left_vbox.Allocation.Width;

            menu.SetSizeRequest(menu_width, h);

            Dictionary<MenuItem, Type> stage_operation_types = new Dictionary<MenuItem, Type>();

            for (int i = 0; i < mStageOperationTypes.Length; i++)
            {
                string name = StageOperationDescriptionAttribute.GetName(mStageOperationTypes[i]);
                if (name == null) name = mStageOperationTypes[i].Name;
                string description = StageOperationDescriptionAttribute.GetDescription(mStageOperationTypes[i]);

                MenuItem item = new MenuItem();

                VBox item_vbox = new VBox();
                item_vbox.BorderWidth = 4;
                item_vbox.Show();

                Label lbl_name = new Label();
                lbl_name.Text = name;
                lbl_name.Justify = Justification.Left;
                lbl_name.Xalign = 0;

                // Setting the name font
                double name_size_k = 1.1;
                Pango.FontDescription name_fd = FontHelpers.ScaleFontSize(lbl_name, name_size_k);
                name_fd.Weight = Pango.Weight.Bold;
                lbl_name.ModifyFont(name_fd);

                item_vbox.Add(lbl_name);
                lbl_name.Show();

                if (description != null && description != "")
                {
                    Label lbl_desc = new Label(description);
                    lbl_desc.LineWrapMode = Pango.WrapMode.Word;
                    lbl_desc.LineWrap = true;
                    lbl_desc.Wrap = true;

                    // Setting the description font
                    double desc_size_k = 0.9;
                    Pango.FontDescription desc_fd = FontHelpers.ScaleFontSize(lbl_desc, desc_size_k);
                    lbl_desc.ModifyFont(desc_fd);

                    item_vbox.Add(lbl_desc);
                    lbl_desc.Show();
                    item_vbox.SizeAllocated += delegate(object o, SizeAllocatedArgs args) {
                        lbl_desc.WidthRequest = args.Allocation.Width - 10;
                    };
                }

                item.Child = item_vbox;
                stage_operation_types.Add(item, mStageOperationTypes[i]);

                item.Activated += delegate(object s, EventArgs ea) {
                    mStage.CreateAndAddNewItem(stage_operation_types[(MenuItem)s]).Active = true;
                    GtkScrolledWindow.HscrollbarPolicy = PolicyType.Never;
                    GtkScrolledWindow.Vadjustment.Value = GtkScrolledWindow.Vadjustment.Upper;
                    ArrangeVBoxes();

                };

                menu.Append(item);
                item_vbox.CheckResize();
                //lbl_desc.WidthRequest = ww;
            }
            menu.Deactivated += delegate {
                addNewOperation_togglebutton.Active = false;
            };

            menu.ShowAll();
            menu.Popup(null, null, delegate (Menu m, out int x, out int y, out bool push_in) {
                int x1, y1, x0, y0;
                GdkWindow.GetOrigin(out x0, out y0);
                left_vbox.TranslateCoordinates(this, 0, 0, out x1, out y1);
                x = x0 + x1;
                y = y0 + y1;
                push_in = false;
            }, 0, 0);
        }
    }
开发者ID:bigfatbrowncat,项目名称:CatEye,代码行数:88,代码来源:StageEditorWindow.cs

示例6: InitMenu

    private void InitMenu()
    {
        popupMenu = new Menu();
          	MenuItem item = new MenuItem ( Catalog.GetString ("_Subscriptions"));
          	item.Activated += new EventHandler (this.OnSubscriptions);
          	popupMenu.Add (item);

          	MenuItem item2 = new MenuItem ( Catalog.GetString ("Show _Podcasts"));
          	item2.Activated += new EventHandler (this.OnShowPodcasts);
          	popupMenu.Add (item2);

        #if USING_IPOD
         	MenuItem item3 = new MenuItem ( Catalog.GetString ("_Update iPod"));
         	item3.Activated += new EventHandler (this.OnUpdateIPod);
         	popupMenu.Add (item3);
        #endif

          	ImageMenuItem aboutItem = new ImageMenuItem (Catalog.GetString ("_About"));
          	aboutItem.Image  = new Image (Gnome.Stock.About, IconSize.Menu);
          	popupMenu.Add (aboutItem);
          	ImageMenuItem menuPopup1 = new ImageMenuItem (Catalog.GetString ("_Quit"));
          	Image appimg = new Image (Gtk.Stock.Quit, IconSize.Menu );
          	menuPopup1.Image = appimg;
          	popupMenu.Add(menuPopup1);

          	menuPopup1.Activated += OnQuit;
          	aboutItem.Activated += OnAbout;
        popupMenu.ShowAll();
    }
开发者ID:BackupTheBerlios,项目名称:monopod-svn,代码行数:29,代码来源:Main.cs

示例7: ShowPopupMenu

    private void ShowPopupMenu()
    {
        Menu popupMenu = new Menu();

        MenuItem editPathItem = new MenuItem("Edit Path");
        editPathItem.Activated += OnEditPath;
        popupMenu.Append(editPathItem);

        MenuItem deletePathItem = new MenuItem("Delete Path");
        deletePathItem.Activated += OnDeletePath;
        popupMenu.Append(deletePathItem);

        MenuItem CheckIDsItem = new MenuItem("Check tile IDs");
        CheckIDsItem.Activated += OnCheckIDs;
        popupMenu.Append(CheckIDsItem);

        MenuItem deleteItem = new ImageMenuItem(Stock.Delete, null);
        deleteItem.Activated += OnDelete;
        popupMenu.Append(deleteItem);

        popupMenu.ShowAll();
        popupMenu.Popup();
    }
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:23,代码来源:LayerListWidget.cs

示例8: DragDataToCreateFileMenu

 /** DESCTRUCTIVE, BLOCKING */
 void DragDataToCreateFileMenu(string target, byte[] data)
 {
     Menu menu = new Menu();
     MenuItem newfile = new MenuItem("Create file from data");
     newfile.Activated += delegate {
       Helpers.TextPrompt ("Create file", "Filename for data",
     target + Helpers.DirSepS + "new_file", "Create",
     target.Length+1, target.Length+1, -1,
     delegate (string filename) {
       Helpers.NewFileWith(filename, data);
     });
     };
     menu.Append (newfile);
     menu.ShowAll ();
     menu.Popup ();
 }
开发者ID:kig,项目名称:filezoo,代码行数:17,代码来源:filezoo.cs

示例9: InitContextMenu

 private Menu InitContextMenu(IChartDrawable primitive)
 {
     string displayName = (primitive as DSView).DisplayName;
     var menu = new Menu();
     ImageMenuItem mi;
     mi = new ImageMenuItem(string.Format("Delete {0}", displayName));
     mi.Activated += OnDeleteMenuItemClick;
     menu.Append(mi);
     menu.Append(new SeparatorMenuItem());
     mi = new ImageMenuItem(string.Format("Properties {0}", displayName));
     mi.Activated += OnPropertiesMenuItemClick;
     menu.Append(mi);
     menu.ShowAll();
     return menu;
 }
开发者ID:28427328,项目名称:SQCharts,代码行数:15,代码来源:Pad.cs

示例10: 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

示例11: PopupMenu

    private void PopupMenu(int button)
    {
        if(selectedObjects.Count == 0)
            return;

        if(activeObject is ControlPoint)
            return;

        bool groupCloneable = true;	//foreach cycle to get required statistics
        foreach (IObject selectedObject in selectedObjects) {
            groupCloneable &= selectedObject is ICloneable;
        }

        Menu popupMenu = new Menu();

        MenuItem cloneItem = new MenuItem("Clone");
        cloneItem.Activated += OnClone;
        cloneItem.Sensitive = groupCloneable;
        popupMenu.Append(cloneItem);

        if(selectedObjects.Count == 1 && selectedObjects[0] is IPathObject) {
            IPathObject pathObject = (IPathObject) selectedObjects[0];

            MenuItem editPathItem = new MenuItem("Edit Path");
            editPathItem.Activated += OnEditPath;
            popupMenu.Append(editPathItem);

            if (pathObject.PathRemovable) {
                MenuItem deletePathItem = new MenuItem("Delete Path");
                deletePathItem.Sensitive = pathObject.Path != null;
                deletePathItem.Activated += OnDeletePath;
                popupMenu.Append(deletePathItem);
            }
        }

        MenuItem deleteItem = new ImageMenuItem(Stock.Delete, null);
        deleteItem.Activated += OnDelete;
        popupMenu.Append(deleteItem);

        popupMenu.ShowAll();
        popupMenu.Popup();
    }
开发者ID:Karkus476,项目名称:supertux-editor,代码行数:42,代码来源:ObjectSelectTool.cs

示例12: PopupMenu

    private void PopupMenu(int button)
    {
        if(! (activeObject is IGameObject))
            return;

        Menu popupMenu = new Menu();

        MenuItem cloneItem = new MenuItem("Clone");
        cloneItem.Activated += OnClone;
        cloneItem.Sensitive = activeObject is ICloneable;
        popupMenu.Append(cloneItem);

        if(activeObject is IPathObject) {
            MenuItem editPathItem = new MenuItem("Edit Path");
            editPathItem.Activated += OnEditPath;
            popupMenu.Append(editPathItem);
        }

        MenuItem deleteItem = new ImageMenuItem(Stock.Delete, null);
        deleteItem.Activated += OnDelete;
        popupMenu.Append(deleteItem);

        popupMenu.ShowAll();
        popupMenu.Popup();
    }
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:25,代码来源:ObjectsEditor.cs

示例13: ShowContextMenu

    private void ShowContextMenu()
    {
        Gtk.Menu contextMenu = new Menu();

        //AddContextMenuButton(contextMenu,"run",Lng.Translate("Run"));

        AddRunContextMenu(contextMenu);
        AddSortContextMenu(contextMenu);

        contextMenu.ShowAll();
        contextMenu.Popup();
        contextMenu.Dispose();
    }
开发者ID:petrj,项目名称:MP3Tagger,代码行数:13,代码来源:MainWindow.cs

示例14: DragURIMenu

 /** ASYNC */
 void DragURIMenu(string[] sources, string target)
 {
     Menu menu = new Menu();
     MenuItem move = new MenuItem("_Move");
     MenuItem copy = new MenuItem("_Copy");
     move.Activated += delegate { moveUris (sources, target); };
     copy.Activated += delegate { copyUris (sources, target); };
     menu.Append (move);
     menu.Append (copy);
     menu.ShowAll ();
     menu.Popup ();
 }
开发者ID:kig,项目名称:filezoo,代码行数:13,代码来源:filezoo.cs

示例15: DragDataToFileMenu

    /** DESCTRUCTIVE, BLOCKING */
    void DragDataToFileMenu(string targetFile, byte[] data)
    {
        Menu menu = new Menu();
        MenuItem newfile = new MenuItem("Create file from data");
        string target = Helpers.Dirname(targetFile);
        newfile.Activated += delegate {
          Helpers.TextPrompt ("Create file", "Filename for data",
        target + Helpers.DirSepS + "new_file", "Create",
        target.Length+1, target.Length+1, -1,
        delegate (string filename) {
          Helpers.NewFileWith(filename, data);
        });
        };
        MenuItem replace = new MenuItem(String.Format("_Replace contents of {0}", Helpers.Basename(targetFile)));
        replace.Activated += delegate { Helpers.ReplaceFileWith(targetFile, data); };
        MenuItem append = new MenuItem(String.Format("_Append to {0}", Helpers.Basename(targetFile)));
        append.Activated += delegate { Helpers.AppendToFile(targetFile, data); };

        menu.Append (newfile);
        menu.Append (new SeparatorMenuItem ());
        menu.Append (replace);
        menu.Append (append);
        menu.ShowAll ();
        menu.Popup ();
    }
开发者ID:kig,项目名称:filezoo,代码行数:26,代码来源:filezoo.cs


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