protected virtual void OnPopulatePopup (object sender, PopulatePopupArgs args) { CommandEntrySet cset = IdeApp.CommandService.CreateCommandEntrySet ("/MonoDevelop/Database/ContextMenu/SqlEditor"); if (cset.Count > 0) { cset.AddItem (Command.Separator); IdeApp.CommandService.InsertOptions (args.Menu, cset, 0); } }
void TextViewPopulatePopup (object o, PopulatePopupArgs args) { MenuItem item = new MenuItem (GettextCatalog.GetString ("Clear")); SeparatorMenuItem sep = new SeparatorMenuItem (); item.Activated += ClearActivated; item.Show (); sep.Show (); args.Menu.Add (sep); args.Menu.Add (item); }
void OnPopulatePopup(object o, PopulatePopupArgs args) { Gtk.MenuItem spacer = new Gtk.SeparatorMenuItem (); spacer.Show (); Gtk.CheckMenuItem edit = new Gtk.CheckMenuItem ( Catalog.GetString ("Edit Code Snippet")); MarkupLabel (edit); edit.Activated += OnEditActivate; edit.Show (); Gtk.ImageMenuItem lang_select = new Gtk.ImageMenuItem ( Catalog.GetString ("Select Language")); lang_select.Image = new Gtk.Image (Gtk.Stock.Find, Gtk.IconSize.Menu); lang_select .Show (); Gtk.Menu langs_menu = new Gtk.Menu (); //default language should be setted Gtk.RadioMenuItem pre_item = new Gtk.RadioMenuItem (Language); MarkupLabel (pre_item); pre_item.Active = true; langs_menu.Append (pre_item); pre_item.Activated += OnLanguageSelected; pre_item.Show (); string [] langs = manager.LanguageIds; ArrayList lang_array = new ArrayList (langs); lang_array.Sort (); foreach (String lang in lang_array) { if (lang.Equals (Language)) continue; Gtk.RadioMenuItem tmp = new Gtk.RadioMenuItem ( pre_item.Group, Catalog.GetString (lang)); MarkupLabel (tmp); langs_menu.Append (tmp); tmp.Activated += OnLanguageSelected; tmp.Show (); pre_item = tmp; } lang_select.Submenu = langs_menu; args.Menu.Prepend (spacer); args.Menu.Prepend (edit); args.Menu.Prepend (lang_select); }
void TextViewPopulatePopup(object o, PopulatePopupArgs args) { MenuItem item = new MenuItem (GettextCatalog.GetString ("Clear")); SeparatorMenuItem sep = new SeparatorMenuItem (); item.Activated += ClearActivated; item.Show (); sep.Show (); args.Menu.Add (sep); args.Menu.Add (item); foreach (var menu_command in menuCommands) { var tmp = new MenuItem(menu_command.Item1); tmp.Activated += menu_command.Item2; tmp.Show(); args.Menu.Add(tmp); } }
void OnPopulatePopup(object o, PopulatePopupArgs args) { Localization.LocalizeMenu(args.Menu); foreach(Widget w in args.Menu.Children) if((w is SeparatorMenuItem) || !w.Sensitive) w.Visible = false; }
void TextViewPopulatePopup(object o, PopulatePopupArgs args) { //ReplaceGtkIconsByOwnOnes(args.Menu); SeparatorMenuItem sep = new SeparatorMenuItem(); sep.Show(); args.Menu.Add(sep); TaggedLocalizedImageMenuItem newitem = new TaggedLocalizedImageMenuItem("Clear"); newitem.Image = Docking.Tools.ResourceLoader_Docking.LoadImage("Broom-16.png"); newitem.Activated += (object sender, EventArgs e) => Clear(); newitem.ShowAll(); args.Menu.Add(newitem); Localization.LocalizeMenu(args.Menu); }
void HandlePopulatePopup(object sender, PopulatePopupArgs args) { AddMenuItems (args.Menu); args.RetVal = true; }