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


C# ImageMenuItem.ShowAll方法代码示例

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


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

示例1: MakeTagMenuItem

 /*ImageMenuItem*/
 Gtk.MenuItem MakeTagMenuItem(Menu menu,Tag tag,bool force_enabled)
 {
     ImageMenuItem img_item = new ImageMenuItem(tag !=null ?tag.Name : "-" ) ;
     if(force_enabled ||( tag as Category).Children.Count == 0){
         img_item.Activated += delegate {
             foreach (Face face in this.SelectedFaces){
                 if(tag != null)
                     FaceSpotDb.Instance.Faces.SetTag(face,tag);
                 else
                     FaceSpotDb.Instance.Faces.DeclineTag(face,true);
             }
             EmitActionActivated();
         };
     }
     if(tag !=null && tag.Icon != null){
         img_item.Image = new Image(tag.Icon);
     }
     img_item.Sensitive = true;
     //this..
     img_item.TooltipText = tag != null ? tag.Name : "-";
     menu.Append (img_item);
     img_item.ShowAll ();
     return img_item;
 }
开发者ID:kanitw,项目名称:facespot,代码行数:25,代码来源:FaceIconViewPopupMenu.cs

示例2: Activate

	public void Activate (Widget toplevel, Gdk.EventButton eb) 
	{
		// FIXME this is a hack to handle the --view case for the time being.
		creator = toplevel;

		if (MainWindow.Toplevel == null)
			return;

		int count = MainWindow.Toplevel.SelectedIds ().Length;
		
		Gtk.Menu popup_menu = this;
		bool have_selection = count > 0;
		
		GtkUtil.MakeMenuItem (popup_menu, Catalog.GetString ("Copy Photo Location"), 
				      delegate { MainWindow.Toplevel.HandleCopyLocation (creator, null); }, have_selection);
		
		GtkUtil.MakeMenuSeparator (popup_menu);

		GtkUtil.MakeMenuItem (popup_menu, "f-spot-rotate-270",
				      delegate { MainWindow.Toplevel.HandleRotate270Command(creator, null); }, have_selection);
		GtkUtil.MakeMenuItem (popup_menu, "f-spot-rotate-90", 
				      delegate { MainWindow.Toplevel.HandleRotate90Command (creator, null); }, have_selection);

		GtkUtil.MakeMenuSeparator (popup_menu);

		OpenWithMenu owm = OpenWithMenu.AppendMenuTo (popup_menu, MainWindow.Toplevel.SelectedMimeTypes, true);
		owm.IgnoreApp = "f-spot";
		owm.ApplicationActivated += delegate (Gnome.Vfs.MimeApplication app) { MainWindow.Toplevel.HandleOpenWith (creator, app); };

		GtkUtil.MakeMenuItem (popup_menu, Catalog.GetString ("Remove From Catalog"), 
				      delegate { MainWindow.Toplevel.HandleRemoveCommand (creator, null); }, have_selection);
		GtkUtil.MakeMenuItem (popup_menu, Catalog.GetString ("Delete From Drive"),
				      delegate { MainWindow.Toplevel.HandleDeleteCommand (creator, null); }, have_selection);

		GtkUtil.MakeMenuSeparator (popup_menu);
		
		//
		// FIXME TagMenu is ugly.
		//
		ImageMenuItem attach_item = new ImageMenuItem (Catalog.GetString ("Attach Tag"));
        attach_item.Image = new Gtk.Image ("gtk-add", IconSize.Menu);
		TagMenu attach_menu = new TagMenu (attach_item, MainWindow.Toplevel.Database.Tags);
		attach_menu.NewTagHandler += delegate { MainWindow.Toplevel.HandleCreateTagAndAttach (creator, null); };
		attach_menu.TagSelected += MainWindow.Toplevel.HandleAttachTagMenuSelected;
		attach_item.ShowAll ();
		popup_menu.Append (attach_item);

		//
		// FIXME finish the IPhotoSelection stuff and move the activate handler into the class
		// this current method is way too complicated.
		//
		ImageMenuItem remove_item = new ImageMenuItem (Catalog.GetString ("Remove Tag"));
        remove_item.Image = new Gtk.Image ("gtk-remove", IconSize.Menu);
		PhotoTagMenu remove_menu = new PhotoTagMenu ();
		remove_menu.TagSelected += MainWindow.Toplevel.HandleRemoveTagMenuSelected;
		remove_item.Submenu = remove_menu;
		remove_item.Activated += MainWindow.Toplevel.HandleTagMenuActivate;
		remove_item.ShowAll ();
		popup_menu.Append (remove_item);

		if (eb != null)
			popup_menu.Popup (null, null, null, eb.Button, eb.Time);
		else 
			popup_menu.Popup (null, null, null, 0, Gtk.Global.CurrentEventTime);
	}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:65,代码来源:PhotoPopup.cs


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