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


C# Gtk.ImageMenuItem类代码示例

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


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

示例1: MenuBarController

        public MenuBarController()
        {
            MenuBar mb = new MenuBar();

            Menu filemenu = new Menu();
            MenuItem file = new MenuItem("File");
            file.Submenu = filemenu;

            ImageMenuItem importDirectoryMenuItem = new ImageMenuItem("Import Directory");
            importDirectoryMenuItem.Activated += ImportDirectoryMenuItemOnActivated;
            filemenu.Append(importDirectoryMenuItem);

            ImageMenuItem open = new ImageMenuItem(Stock.Open);
            filemenu.Append(open);

            SeparatorMenuItem sep = new SeparatorMenuItem();
            filemenu.Append(sep);

            ImageMenuItem exit = new ImageMenuItem(Stock.Quit);

            exit.Activated += (sender, args) => Application.Quit();
            filemenu.Append(exit);

            mb.Append(file);
            View = mb;
        }
开发者ID:gclark916,项目名称:Howler,代码行数:26,代码来源:MenuBarController.cs

示例2: TIcon

        public TIcon(CInterfaceGateway in_krnGateway, Gtk.Window mwindow)
        {
            krnGateway = in_krnGateway;
            mainwindow = mwindow;

             	menu = new Gtk.Menu ();
               		EventBox eb = new EventBox ();
            eb.ButtonPressEvent += new ButtonPressEventHandler (TIconClicked);
            eb.Add (new Gtk.Image (new Gdk.Pixbuf (null, "lPhant.png")));

            MenuItem it_show = new MenuItem ("Show");
            it_show.Activated += new EventHandler (TIconShow);

            MenuItem it_options = new MenuItem ("Options");
            it_options.Activated += new EventHandler (TIconOptions);

            ImageMenuItem it_quit = new ImageMenuItem("Quit");
            it_quit.Activated += new EventHandler (TIconQuit);

            menu.Append (it_show);
            menu.Append (it_options);
            menu.Append (it_quit);

               	   t = new TrayIcon ("eLePhantGTK");
               	   t.Add (eb);
               	   t.ShowAll ();
        }
开发者ID:sonicwang1989,项目名称:lphant,代码行数:27,代码来源:TIcon.cs

示例3: CreateImageMenuItem

 private ImageMenuItem CreateImageMenuItem(Color color, string name)
 {
     ImageMenuItem item = new ImageMenuItem(name);
     item.Activated += ColorActivated;
     item.Image = new ColorBlockWidget(color);
     return item;
 }
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:7,代码来源:ColorToolButton.cs

示例4: HandleTrayIconPopupMenu

        static void HandleTrayIconPopupMenu(object o, PopupMenuArgs args)
        {
            Menu popupMenu = new Menu ();
            ImageMenuItem menuItemQuit = new ImageMenuItem ("Quit");

            ImageMenuItem menuItemEnabled;
            if(Preferences.Enabled)
            {
                menuItemEnabled = new ImageMenuItem ("Disable");
                menuItemEnabled.Image = new Gtk.Image (Gtk.Stock.Yes, IconSize.Menu);
            }
            else
            {
                // hopefully prevent any major mem leaks

                menuItemEnabled = new ImageMenuItem ("Enable");
                menuItemEnabled.Image = new Gtk.Image(Gtk.Stock.Yes, IconSize.Menu);
            }

            menuItemQuit.Image = new Gtk.Image (Gtk.Stock.Quit, IconSize.Menu);
            popupMenu.Add(menuItemQuit);
            popupMenu.Add(menuItemEnabled);

            menuItemQuit.Activated += delegate(object sender, EventArgs e) {
                Application.Quit();
            };
            menuItemEnabled.Activated += HandleMenuItemEnabledActivated;

            popupMenu.ShowAll();
            popupMenu.Popup();
        }
开发者ID:skyronic,项目名称:Screenlapse,代码行数:31,代码来源:Main.cs

示例5: CreateMenus

		Gtk.MenuBar CreateMenus ()
		{
			AccelGroup group = new AccelGroup ();
			MenuBar bar = new MenuBar ();
			
			Menu file_menu = new Menu ();
			MenuItem file_menu_item = new MenuItem ("_File");
			file_menu_item.Submenu = file_menu;
			
			ImageMenuItem file_exit = new ImageMenuItem (Gtk.Stock.Quit, group);
			file_exit.Activated += new EventHandler (exit_cb);
			file_menu.Append (file_exit);
			bar.Append (file_menu_item);

			Menu help_menu = new Menu ();
			ImageMenuItem help_menu_item = new ImageMenuItem (Gtk.Stock.Help, group);
			help_menu_item.Submenu = help_menu;
			
			ImageMenuItem file_help = new ImageMenuItem (Gnome.Stock.About, group);
			file_help.Activated += new EventHandler (about_cb);
			help_menu.Append (file_help);
			bar.Append (help_menu_item);
			bar.ShowAll ();

			return bar;
		}
开发者ID:directhex,项目名称:xamarin-gnome-sharp2,代码行数:26,代码来源:GnomeHelloWorld.cs

示例6: VideoContextMenu

        // create the context menu
        public VideoContextMenu()
            : base()
        {
            MenuItem aspect_ratio = new MenuItem ("Aspect Ratio");
            ImageMenuItem fullscreen = new ImageMenuItem (Stock.Fullscreen, null);

            Menu aspect_menu = new Menu ();
            aspect_auto = new RadioMenuItem ("Auto");
            aspect_4x3 = new RadioMenuItem (aspect_auto, "4:3");
            aspect_16x9 = new RadioMenuItem (aspect_auto, "16:9");
            aspect_16x10 = new RadioMenuItem (aspect_auto, "16:10");

            aspect_menu.Add (aspect_auto);
            aspect_menu.Add (aspect_4x3);
            aspect_menu.Add (aspect_16x9);
            aspect_menu.Add (aspect_16x10);

            aspect_ratio.Submenu = aspect_menu;

            this.Add (aspect_ratio);

            showVisualisations ();

            this.Add (new SeparatorMenuItem ());
            this.Add (fullscreen);

            fullscreen.Activated += fullscreen_activated;

            aspect_auto.ButtonReleaseEvent += aspect_auto_toggled;
            aspect_4x3.ButtonReleaseEvent += aspect_4x3_toggled;
            aspect_16x9.ButtonReleaseEvent += aspect_16x9_toggled;
            aspect_16x10.ButtonReleaseEvent += aspect_16x10_toggled;

            toggle_aspect_value ();
        }
开发者ID:gsterjov,项目名称:fusemc,代码行数:36,代码来源:VideoContextMenu.cs

示例7: AddImageItem

 public ImageMenuItem AddImageItem(string stock_id, EventHandler handler)
 {
     ImageMenuItem item = new ImageMenuItem(stock_id, null);
     item.Activated += handler;
     Append(item);
     return(item);
 }
开发者ID:BackupTheBerlios,项目名称:niry-sharp-svn,代码行数:7,代码来源:PopupMenu.cs

示例8: MainWindow

        public MainWindow()
        {
            Build ();

            popupMenu = new Menu ();

            ImageMenuItem explore = new ImageMenuItem ("Explore");
            explore.Image = new Image (Stock.Open, IconSize.Menu);
            explore.Activated += Open;
            popupMenu.Add (explore);

            ImageMenuItem quit = new ImageMenuItem ("Exit");
            quit.Image = new Image (Stock.Quit, IconSize.Menu);
            quit.Activated += (object sender, EventArgs e) => {
                Application.Quit ();
            };
            popupMenu.Add (quit);

            statusIcon = new StatusIcon ();
            statusIcon.Pixbuf = c.Icon.Bitmap.ToPixbuf ();
            statusIcon.Activate += Open;
            statusIcon.PopupMenu += (object o, PopupMenuArgs args) => {
                popupMenu.ShowAll ();
                popupMenu.Popup ();
            };
            statusIcon.Tooltip = c.Icon.Tooltip;
            statusIcon.Visible = true;
        }
开发者ID:TimePath,项目名称:major,代码行数:28,代码来源:MainWindow.cs

示例9: AddImageMenuButton

        public static ImageMenuItem AddImageMenuButton(string title, string imgName, Gtk.Menu parent,EventHandler OnMenuClicked)
        {
            var sep = System.IO.Path.DirectorySeparatorChar;
            var menuItem = new ImageMenuItem(title);

            if (imgName != null)
            {
                var picFileName = SupportMethods.AppPath + sep + "Icons" + sep + imgName;
                if (System.IO.File.Exists(picFileName))
                {
                    menuItem.Image = new Gtk.Image(picFileName);
                }
            }

            if (OnMenuClicked != null)
            {
                menuItem.Activated+= OnMenuClicked;
            }

            if (parent != null)
            {
                parent.Add(menuItem);
            }

            return menuItem;
        }
开发者ID:petrj,项目名称:MediaConvertGUI,代码行数:26,代码来源:Dialogs.cs

示例10: AddImageMenuItem

 public ImageMenuItem AddImageMenuItem(string label, Image image)
 {
     ImageMenuItem item = new ImageMenuItem(label);
     item.Image = image;
     Append(item);
     return item;
 }
开发者ID:Jeff-Lewis,项目名称:opentf,代码行数:7,代码来源:MenuBase.cs

示例11: DockNotebook

		public DockNotebook ()
		{
			pagesCol = new ReadOnlyCollection<IDockNotebookTab> (pages);
			AddEvents ((Int32)(EventMask.AllEventsMask));

			tabStrip = new TabStrip (this);

			PackStart (tabStrip, false, false, 0);

			contentBox = new EventBox ();
			PackStart (contentBox, true, true, 0);

			ShowAll ();

			tabStrip.DropDownButton.Sensitive = false;

			tabStrip.DropDownButton.MenuCreator = delegate {
				Gtk.Menu menu = new Menu ();
				foreach (var tab in pages) {
					var mi = new Gtk.ImageMenuItem ("");
					menu.Insert (mi, -1);
					var label = (Gtk.AccelLabel) mi.Child;
					if (tab.Markup != null)
						label.Markup = tab.Markup;
					else
						label.Text = tab.Text;
					var locTab = tab;
					mi.Activated += delegate {
						CurrentTab = locTab;
					};
				}
				menu.ShowAll ();
				return menu;
			};
		}
开发者ID:alexrp,项目名称:monodevelop,代码行数:35,代码来源:DockNotebook.cs

示例12: Next

        public ImageMenuItem Next()
        {
            ImageMenuItem next 	= new ImageMenuItem("Next");
            next.Image 			= new Gtk.Image(Gtk.Stock.MediaNext, IconSize.Menu);;
            next.Activated 		+= delegate { _parent.oXbmc.Controls.Next(); };

            return next;
        }
开发者ID:Bram77,项目名称:xbmcontrol-evo,代码行数:8,代码来源:MenuItems.cs

示例13: Next

        public ImageMenuItem Next()
        {
            ImageMenuItem next 	= new ImageMenuItem("Next");
            next.Image 			= new Gtk.Image(new Pixbuf(_parent.appDir + "/Interface/" + _parent.theme + "/buttons/next_16.png"));
            next.Activated 		+= delegate { _parent.oXbmc.Controls.Next(); };

            return next;
        }
开发者ID:Bram77,项目名称:xbmcontrol-evo,代码行数:8,代码来源:MenuItems.cs

示例14: Enque

        public ImageMenuItem Enque(string caller, string identifier)
        {
            ImageMenuItem enque		= new ImageMenuItem("Enque");
            enque.Image 			= new Gtk.Image(new Pixbuf(_parent.appDir + "/Interface/" + _parent.theme + "/buttons/add_16.png"));
            enque.Activated 		+= delegate { _parent.oControls.AddToPlaylist(caller, identifier, false); };

            return enque;
        }
开发者ID:Bram77,项目名称:xbmcontrol-evo,代码行数:8,代码来源:MenuItems.cs

示例15: Configuration

        public ImageMenuItem Configuration()
        {
            ImageMenuItem config 	= new ImageMenuItem("Configuration");
            config.Image 			= new Gtk.Image(new Pixbuf(_parent.appDir + "/Interface/" + _parent.theme + "/buttons/configure_16.png"));
            config.Activated 		+= delegate { Application.Quit(); };

            return config;
        }
开发者ID:Bram77,项目名称:xbmcontrol-evo,代码行数:8,代码来源:MenuItems.cs


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