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


C# Menu.ShowAll方法代码示例

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


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

示例1: ParseTreeWindow

 public ParseTreeWindow(RuntimeThread runtimeThread) : base("Parse Tree")
 {
     runtimeThread.Runtime.ParseTrace.ParsedEvent += OnParsed;
     
     SetDefaultSize(250, 300);
     SkipPagerHint = true;
     SkipTaskbarHint = true;
     
     scroller = new ScrolledWindow();
     scroller.BorderWidth = 5;
     scroller.ShadowType = ShadowType.In;
     Add(scroller);
     
     store = new TreeStore(typeof(string), typeof(object));
     
     view = new TreeView(store);
     column = view.AppendColumn(null, new CellRendererText(), "text", VALUE_TEXT);
     view.HeadersVisible = false;
     view.RowActivated += OnTreeRowActivated;
     view.ButtonPressEvent += OnTreeButtonPress;
     scroller.Add(view);
     
     MenuBuilder menuBuilder = new MenuBuilder();
     menu = menuBuilder.StartMenu();
     menuBuilder.Add("Show source", OnMenuShowSource);
     menuBuilder.Add("Show object", OnMenuShowObject);
     menu.ShowAll();
 }
开发者ID:KevinKelley,项目名称:katahdin,代码行数:28,代码来源:ParseTreeWindow.cs

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

示例3: EquipmentReceptionView

        public EquipmentReceptionView()
        {
            this.Build();

            ytreeEquipment.ColumnsConfig = Gamma.GtkWidgets.ColumnsConfigFactory.Create<ReceptionEquipmentItemNode> ()
                .AddColumn ("Номенклатура").AddTextRenderer (node => node.Name)
                .AddColumn ("Серийный номер").AddTextRenderer (node => node.Serial)
                .AddColumn ("Кол-во")
                .AddToggleRenderer (node => node.Returned, false)
                .AddNumericRenderer (node => node.Amount, false)
                .AddColumn("Номер заявки на сервис")
                .AddTextRenderer(
                    node => node.ServiceClaim != null
                    ? node.ServiceClaim.Id.ToString()
                    : "")
                .AddColumn("")
                .Finish ();

            ytreeEquipment.Selection.Changed += YtreeEquipment_Selection_Changed;
            ytreeEquipment.ItemsDataSource = ReceptionEquipmentList;

            //Создаем меню в кнопке выбора СН
            var menu = new Menu();
            menuitemRegisterSerial = new MenuItem("Зарегистрировать новый СН");
            menuitemRegisterSerial.Activated += MenuitemRegisterSerial_Activated;
            menu.Add(menuitemRegisterSerial);
            menuitemSelectFromClient = new MenuItem("Выбрать по клиенту");
            menuitemSelectFromClient.Activated += MenuitemSelectFromClient_Activated;
            menu.Add(menuitemSelectFromClient);
            var menuitemSelectFromUnused = new MenuItem("Незадействованные СН");
            menuitemSelectFromUnused.Activated += MenuitemSelectFromUnused_Activated;
            menu.Add(menuitemSelectFromUnused);
            menu.ShowAll();
            buttonSelectSerial.Menu = menu;
        }
开发者ID:QualitySolution,项目名称:Vodovoz,代码行数:35,代码来源:EquipmentReceptionView.cs

示例4: GrammarWindow

 public GrammarWindow(RuntimeThread runtimeThread) : base("Grammar")
 {
     runtimeThread.Runtime.Grammar.Trace.PatternDefinedEvent += OnGrammarPatternDefined;
     runtimeThread.Runtime.Grammar.Trace.PatternChangedEvent += OnGrammarPatternChanged;
     
     SetDefaultSize(250, 300);
     SkipPagerHint = true;
     SkipTaskbarHint = true;
     
     scroller = new ScrolledWindow();
     scroller.BorderWidth = 5;
     scroller.ShadowType = ShadowType.In;
     Add(scroller);
     
     store = new TreeStore(typeof(string), typeof(Source));
     
     // FIXME - only want to sort top level
     
     //TreeModelSort storeSort = new TreeModelSort(store);
     //storeSort.SetSortColumnId(0, SortType.Ascending);
     
     view = new TreeView(store);
     
     view.AppendColumn(null, new CellRendererText(), "text", VALUE_TEXT);
     view.HeadersVisible = false;
     view.RowActivated += OnTreeRowActivated;
     view.ButtonPressEvent += OnTreeButtonPress;
     scroller.Add(view);
     
     MenuBuilder menuBuilder = new MenuBuilder();
     menu = menuBuilder.StartMenu();
     menuBuilder.Add("Show source", OnMenuShowSource);
     menuBuilder.Add("Show object", OnMenuShowObject);
     menu.ShowAll();
 }
开发者ID:KevinKelley,项目名称:katahdin,代码行数:35,代码来源:GrammarWindow.cs

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

示例6: ChatPageMenu

 public ChatPageMenu(ChatSubpageBase page)
 {
     m_Page = page;
     m_Menu = new Menu();
     var closeItem = new ImageMenuItem(Stock.Close, null);
     closeItem.Activated += HandleCloseItemActivated;
     m_Menu.Append(closeItem);
     m_Menu.ShowAll();
 }
开发者ID:codebutler,项目名称:meshwork,代码行数:9,代码来源:ChatPageMenu.cs

示例7: CreateDirectoryMenu

        private void CreateDirectoryMenu(string directoryPath, string mediaType)
        {
            Menu cmMediaDirectory 			= new Menu();
            cmMediaDirectory.WidthRequest 	= 150;

            cmMediaDirectory.Add(_parent.oMenuItems.PlayDirectory(directoryPath, mediaType));
            cmMediaDirectory.Add(_parent.oMenuItems.EnqueDirectory(directoryPath, mediaType));
            cmMediaDirectory.Add(_parent.oMenuItems.Seperator());
            cmMediaDirectory.Add(_parent.oMenuItems.CollapseAll());

            cmMediaDirectory.ShowAll();
            cmMediaDirectory.Popup();
        }
开发者ID:Bram77,项目名称:xbmcontrol-evo,代码行数:13,代码来源:ContextMenu.cs

示例8: FileMaskEntry

        //(string name, bool isFolder) : base (false, 6)
        public FileMaskEntry(List<string> mask, object parent,Gtk.Window parentWindow)
            : base(false, 6)
        {
            windowParent =parentWindow;

            text = new Entry ();
            this.parent= parent;
            browse = Button.NewWithMnemonic (MainClass.Languages.Translate("browse"));

            text.Changed += new EventHandler (OnTextChanged);
            browse.Clicked += new EventHandler (OnButtonClicked);

            PackStart (text, true, true, 0);

            PackEnd (browse, false, false, 0);

            Gdk.Pixbuf default_pixbuf = null;
            string file = System.IO.Path.Combine(MainClass.Paths.ResDir, "stock-menu.png");

            popupCondition = new Gtk.Menu();

            if (System.IO.File.Exists(file)) {
                default_pixbuf = new Gdk.Pixbuf(file);

                Gtk.Button btnClose = new Gtk.Button(new Gtk.Image(default_pixbuf));
                btnClose.TooltipText = MainClass.Languages.Translate("insert_path_mask");
                btnClose.Relief = Gtk.ReliefStyle.None;
                btnClose.CanFocus = false;
                btnClose.WidthRequest = btnClose.HeightRequest = 22;

                popupCondition.AttachToWidget(btnClose,new Gtk.MenuDetachFunc(DetachWidget));

                btnClose.Clicked += delegate {
                    popupCondition.Popup(null,null, new Gtk.MenuPositionFunc (GetPosition) ,3,Gtk.Global.CurrentEventTime);
                };
                PackEnd (btnClose, false, false, 0);
            }

            if (mask != null)
                foreach (string cd in mask) {

                    AddMenuItem(cd);
                }
            popupCondition.ShowAll();

            this.ShowAll();
        }
开发者ID:moscrif,项目名称:ide,代码行数:48,代码来源:FileMaskEntry.cs

示例9: ConstrucRecentExperimentsMenuButton

        private MenuButton ConstrucRecentExperimentsMenuButton()
        {
            Menu recentExperimentsMenu = new Menu();

            foreach (RecentExperimentReference recentExp in m_applicationContext.Application.RecentExperiments) 
            {
                RecentExperimentMenuItem item = new RecentExperimentMenuItem(recentExp);
                item.Image = new Image(s_traceLabIcon);
                item.ExposeEvent += GtkMenuHelper.DrawImageMenuItemImage; 
                item.Activated += OpenExperiment;
                recentExperimentsMenu.Append(item);
            }

            recentExperimentsMenu.ShowAll();
            MenuButton recentExperimentButton = new MenuButton(new Image(Stock.Open, IconSize.SmallToolbar), recentExperimentsMenu, true);
            recentExperimentButton.TooltipText = "Select recent opened experiment";
            return recentExperimentButton;
        }
开发者ID:CoEST,项目名称:TraceLab,代码行数:18,代码来源:ActionManager.cs

示例10: OnTrayIconPopup

        // Create the popup menu, on right click.
        static void OnTrayIconPopup(object o, EventArgs args)
        {
            Menu popupMenu = new Menu();

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

            // Quit the application when quit has been clicked.
            menuItemQuit.Activated += delegate
            {
                Application.Quit();
            };

            popupMenu.ShowAll();
            popupMenu.Popup();
            popupMenu.TakeFocus = true;
            popupMenu.Title = "Graal RC";
        }
开发者ID:Guthius,项目名称:gs2emu-googlecode,代码行数:21,代码来源:Program.cs

示例11: UserMenu

        public UserMenu(Network network, Node node)
        {
            m_Menu = new Menu();

            m_MessageMenuItem = new MenuItem("_Message");
            m_MessageMenuItem.Activated += on_m_MessageMenuItem_activate;
            m_Menu.Append(m_MessageMenuItem);

            m_GetInfoMenuItem = new MenuItem("View _Info");
            m_GetInfoMenuItem.Activated += on_m_GetInfoMenuItem_activate;
            m_Menu.Append(m_GetInfoMenuItem);

            m_InviteChatMenuRoom = new MenuItem("In_vite to Chat...");
            m_InviteChatMenuRoom.Activated += on_m_InviteChatMenuRoom_activate;
            m_Menu.Append(m_InviteChatMenuRoom);

            m_Menu.Append(new SeparatorMenuItem());

            m_ConnectMenuItem = new MenuItem("C_onnect");
            m_ConnectMenuItem.Activated += on_mnuUsersConnectTo_activate;
            m_Menu.Append(m_ConnectMenuItem);

            m_Menu.Append(new SeparatorMenuItem());

            m_BrowseMenuItem = new MenuItem("_Browse");
            m_BrowseMenuItem.Activated += on_m_BrowseMenuItem_activate;
            m_Menu.Append(m_BrowseMenuItem);

            m_SendFileMenuItem = new MenuItem("Send _File...");
            m_SendFileMenuItem.Activated += on_m_SendFileMenuItem_activate;
            m_Menu.Append(m_SendFileMenuItem);

            m_TrustMenuItem = new MenuItem("_Trust");
            m_TrustMenuItem.Activated += on_m_TrustMenuItem_activate;
            m_Menu.Append(m_TrustMenuItem);

            m_Menu.ShowAll();

            this.selectedNode = node;
            this.network = network;
        }
开发者ID:codebutler,项目名称:meshwork,代码行数:41,代码来源:UserMenu.cs

示例12: CreateDefaultMenu

        private void CreateDefaultMenu()
        {
            Menu cmDefault 			= new Menu();
            cmDefault.WidthRequest 	= 200;

            cmDefault.Add(_parent.oMenuItems.Previous());
            cmDefault.Add(_parent.oMenuItems.PlayPause());
            cmDefault.Add(_parent.oMenuItems.Stop());
            cmDefault.Add(_parent.oMenuItems.Next());
            cmDefault.Add(_parent.oMenuItems.Seperator());
            cmDefault.Add(_parent.oMenuItems.VolumeUp());
            cmDefault.Add(_parent.oMenuItems.VolumeDown());
            cmDefault.Add(_parent.oMenuItems.Mute());
            cmDefault.Add(_parent.oMenuItems.Seperator());
            cmDefault.Add(_parent.oMenuItems.Configuration());
            cmDefault.Add(_parent.oMenuItems.Seperator());
            cmDefault.Add(_parent.oMenuItems.Quit());

            cmDefault.ShowAll();
            cmDefault.Popup();
        }
开发者ID:Bram77,项目名称:xbmcontrol-evo,代码行数:21,代码来源:ContextMenu.cs

示例13: OnTrayIconPopup

        // Create the popup menu, on right click.
        static void OnTrayIconPopup(object o, EventArgs args)
        {
            Menu popupMenu = new Menu();
            ImageMenuItem menuItemQuit = new ImageMenuItem ("Quit");
            Gtk.Image appimg = new Gtk.Image(Stock.Quit, IconSize.Menu);
            menuItemQuit.Image = appimg;

            var machines = machineService.GetAllMachines ()
                .GroupBy (x => x.GroupName);
            foreach (var item in machines) {
                if (item.Key == null)
                    continue;

                MenuItem parentItem = new MenuItem (item.Key);
                Menu subMenu = new Menu ();
                foreach (Machine machine in item) {
            //					ImageMenuItem menuItem = new ImageMenuItem (machine.FileName);
            //					menuItem.Image = new Gtk.Image (Stock.Connect, IconSize.Menu);
                    MenuItem menuItem = new MenuItem (machine.RemoteType + " - " + machine.FileName);
                    menuItem.Activated += (object sender, EventArgs e) => {
                        if (machine.RemoteType == RemoteType.RDP) {
                            machineService.LaunchRDP(machine, settings);
                        } else if (machine.RemoteType == RemoteType.SSH) {
                            machineService.LaunchSSH(machine, settings);
                        } else if (machine.RemoteType == RemoteType.VNC) {
                            machineService.LaunchVNC(machine, settings);
                        }
                    };
                    subMenu.Add (menuItem);
                }
                parentItem.Submenu = subMenu;
                popupMenu.Add (parentItem);
            }

            popupMenu.Add(menuItemQuit);

            menuItemQuit.Activated += delegate { Application.Quit(); };
            popupMenu.ShowAll();
            popupMenu.Popup();
        }
开发者ID:meanbunny,项目名称:remote-access,代码行数:41,代码来源:Program.cs

示例14: CreateMediaMenu

        private void CreateMediaMenu(string caller, string identifier)
        {
            Menu cmMedia			= new Menu();
            cmMedia.WidthRequest 	= 150;

            cmMedia.Add(_parent.oMenuItems.Play(caller, identifier));
            cmMedia.Add(_parent.oMenuItems.Enque(caller, identifier));

            if (caller != "album")
            {
                cmMedia.Add(_parent.oMenuItems.Seperator());
                cmMedia.Add(_parent.oMenuItems.CollapseAll());
            }

            if (caller == "file")
            {
                cmMedia.Add(_parent.oMenuItems.Seperator());
                cmMedia.Add(_parent.oMenuItems.ShowSongInfo("sharebrowser"));
            }

            cmMedia.ShowAll();
            cmMedia.Popup();
        }
开发者ID:Bram77,项目名称:xbmcontrol-evo,代码行数:23,代码来源:ContextMenu.cs

示例15: OnImageClick

        // handler for mouse click
        private void OnImageClick(object o, ButtonPressEventArgs args)
        {
            if (args.Event.Button == 3) //right click
               		{
                Menu popupMenu = new Menu (); // creates the menu
              		ImageMenuItem menuPopup1 = new ImageMenuItem ("Quit");
              		Image appimg = new Image (Stock.Quit, IconSize.Menu);
              		menuPopup1.Image = appimg; // sets the menu item's image
              		popupMenu.Add (menuPopup1); // adds the menu item to the menu

              		menuPopup1.Activated += new EventHandler (this.OnPopupClick); // event when the user clicks the icon
                popupMenu.ShowAll (); // shows everything
                // pops up the actual menu when the user right clicks
              		popupMenu.Popup (null, null, null, IntPtr.Zero, args.Event.Button, args.Event.Time);
               		}
               		else
               		{
               			Menu mainPopupMenu = new Menu ();

               			ImageMenuItem menuPopupReload = new ImageMenuItem ("Reload");
               			ImageMenuItem menuPopupAbout = new ImageMenuItem ("About");

               			Image reloadimg = new Image (Stock.Refresh, IconSize.Menu);
               			Image aboutimg = new Image (Stock.About, IconSize.Menu);

               			menuPopupReload.Image = reloadimg;
               			menuPopupAbout.Image = aboutimg;

               			mainPopupMenu.Add (menuPopupReload);
               			mainPopupMenu.Add (menuPopupAbout);

               			menuPopupReload.Activated += new EventHandler (this.OnPopupReloadClick);
               			menuPopupAbout.Activated += new EventHandler (this.OnPopupAboutClick);
               			mainPopupMenu.ShowAll ();
               			mainPopupMenu.Popup (null, null, null, IntPtr.Zero, args.Event.Button, args.Event.Time);
               		}
        }
开发者ID:klessou,项目名称:monognomeart,代码行数:38,代码来源:Tray.cs


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