Example #1
0
 public override void Initialize()
 {
     itemInsert = new Gtk.MenuItem(Catalog.GetString("Insert checkbox"));
     itemInsert.Activated += OnMenuItemActivatedUnmarked;
     itemInsert.Show();
     AddPluginMenuItem(itemInsert);
     itemMarked = new Gtk.MenuItem(Catalog.GetString("Insert marked checkbox"));
     itemMarked.Activated += OnMenuItemActivatedMarked;
     itemMarked.Show();
     AddPluginMenuItem(itemMarked);
     itemXMarked = new Gtk.MenuItem(Catalog.GetString("Insert X marked checkbox"));
     itemXMarked.Activated += OnMenuItemActivatedXMarked;
     itemXMarked.Show();
     AddPluginMenuItem(itemXMarked);
     itemTick = new Gtk.MenuItem(Catalog.GetString("Insert tick"));
     itemTick.Activated += OnMenuItemActivatedTick;
     itemTick.Show();
     AddPluginMenuItem(itemTick);
     itemBallot = new Gtk.MenuItem(Catalog.GetString("Insert X ballot"));
     itemBallot.Activated += OnMenuItemActivatedBallotX;
     itemBallot.Show();
     AddPluginMenuItem(itemBallot);
     itemToggle = new Gtk.MenuItem(Catalog.GetString("Toggle checkmark"));
     itemToggle.Activated += OnMenuItemActivatedToggle;
     AddPluginMenuItem(itemToggle);
     Gtk.AccelGroup accel_group = new Gtk.AccelGroup();
     Window.AddAccelGroup(accel_group);
     itemToggle.AddAccelerator("activate", accel_group,
                               new AccelKey(Gdk.Key.m,
                                            Gdk.ModifierType.ControlMask,
                                            AccelFlags.Visible));
     itemToggle.Show();
 }
        public PlayListTreeView()
        {
            this.HeadersVisible = false;

            ls = new ListStore(typeof(PlayListPlay));
            this.Model = ls;

            menu = new Menu();
            MenuItem title = new MenuItem(Catalog.GetString("Edit Title"));
            title.Activated += new EventHandler(OnTitle);
            title.Show();
            MenuItem delete = new MenuItem(Catalog.GetString("Delete"));
            delete.Activated += new EventHandler(OnDelete);
            delete.Show();
            setRate = new MenuItem(Catalog.GetString("Apply current play rate"));
            setRate.Activated += new EventHandler(OnApplyRate);
            setRate.Show();
            menu.Append(title);
            menu.Append(setRate);
            menu.Append(delete);

            Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn();
            nameColumn.Title = Catalog.GetString("Name");
            Gtk.CellRendererText nameCell = new Gtk.CellRendererText();
            nameColumn.PackStart(nameCell, true);
            nameColumn.SetCellDataFunc(nameCell, new Gtk.TreeCellDataFunc(RenderName));
            this.AppendColumn(nameColumn);
        }
Example #3
0
	public static void MakeMenuItem (Gtk.Menu menu, string l, EventHandler e, bool enabled)
	{
		Gtk.MenuItem i = new Gtk.MenuItem (l);
		i.Activated += e;
                i.Sensitive = enabled;

		menu.Append (i);
		i.Show ();
	}
Example #4
0
    public static void MakeMenuItem(Gtk.Menu menu, string l, EventHandler e, bool enabled)
    {
        Gtk.MenuItem i = new Gtk.MenuItem(l);
        i.Activated += e;
        i.Sensitive  = enabled;

        menu.Append(i);
        i.Show();
    }
Example #5
0
		public void Initialize ()
		{
			MenuItem deleteItem = new MenuItem ("Remove");
			deleteItem.Activated += new EventHandler (deleteItem_OnActivated);
			deleteItem.Show ();
			contextMenu.Add (deleteItem);
			MenuItem propertiesItem = new MenuItem ("Properties");
			propertiesItem.Activated += new EventHandler (propertiesItem_OnActivated);
			propertiesItem.Show ();
			contextMenu.Add (propertiesItem);
		}
        public override void Initialize()
        {
            itemBack = new Gtk.MenuItem(Catalog.GetString("Back to previous version of this note."));
            itemBack.Activated += OnMenuBackActivated;
            itemBack.Show();
            AddPluginMenuItem(itemBack);

            itemFwd = new Gtk.MenuItem(Catalog.GetString("Forward to a later version of this note."));
            itemFwd.Activated += OnMenuFwdActivated;
            itemFwd.Show();
            AddPluginMenuItem(itemFwd);
        }
 protected override void InterfaceInitialize()
 {
     viewMenu = (Globals.ActionManager.GetWidget("/MainMenu/ViewMenu") as MenuItem).Submenu as Menu;
     menuItem = new MenuItem(Catalog.GetString("Mini mode"));
     menuItem.Activated += delegate {
         if (mini_mode == null)
             mini_mode =  new MiniMode();
         mini_mode.Show();
     };
     viewMenu.Insert(menuItem, 2);
     menuItem.Show();
 }
Example #8
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);
		}
Example #9
0
        public Gtk.MenuItem AddItem(string label, EventHandler ev)
        {
            Gtk.MenuItem item = new Gtk.MenuItem (label);
            Append (item);

            if (ev != null)
                item.Activated += ev;

            item.Show ();

            return item;
        }
Example #10
0
        public override void Initialize()
        {
            Assembly asm = Assembly.GetExecutingAssembly();
            string asm_dir = System.IO.Path.GetDirectoryName(asm.Location);

            // if there are no xsl files - copy all xsl file resources to folder
            string[] xslFiles = System.IO.Directory.GetFiles(asm_dir, "CopyAs-*.xsl");
            if (xslFiles.Length == 0) {
                // copy initial files to add-in dir
                foreach (string xslFile in initialXslFiles) {
                    Stream resource = asm.GetManifestResourceStream(xslFile);
                    Stream dest = new FileStream(Path.Combine(asm_dir, xslFile),
                            FileMode.OpenOrCreate, FileAccess.Write);

                    byte[] buf = new byte[4096];
                    while (true) {
                        int n = resource.Read(buf, 0, buf.Length);
                        if (n == 0) {
                            break;
                        }
                        dest.Write(buf, 0, n);
                    }
                    dest.Close();
                }
                // list copied files
                xslFiles = System.IO.Directory.GetFiles(asm_dir, "CopyAs-*.xsl");
            }

            Menu menu = new Menu();
            foreach (string xslFile in xslFiles) {
                if (mainItem == null) {
                    mainItem = new Gtk.MenuItem(Catalog.GetString("Copy as"));
                    mainItem.Show();
             					AddPluginMenuItem(mainItem);
                    mainItem.Submenu = menu;
                }
                string menuName = xslFile.Substring(xslFile.IndexOf("-") + 1);
                menuName = menuName.Substring(0, menuName.Length - 4);
                       		MenuItem subItem = new Gtk.MenuItem(Catalog.GetString(menuName));
                subItem.Show();
                            subItem.Activated += OnMenuItemActivated;
                menu.Append(subItem);

                string stylesheet_file = Path.Combine(asm_dir, xslFile);
                XslTransform xsl = new XslTransform();
                xsl.Load(stylesheet_file);
                transformByMenuItem.Add(subItem, xsl);
            }
        }
Example #11
0
        void IExtensionService.Initialize()
        {
            action_service = ServiceManager.Get<InterfaceActionService> ();

            viewMenu = (action_service.UIManager.GetWidget ("/MainMenu/ViewMenu") as MenuItem).Submenu as Menu;
            menuItem = new MenuItem (Catalog.GetString ("_Mini Mode"));
            menuItem.Activated += delegate {
                if (mini_mode == null) {
                    mini_mode = new MiniMode (ServiceManager.Get<GtkElementsService> ().PrimaryWindow);
                }

                ServiceManager.Get<GtkElementsService> ().PrimaryWindow = mini_mode;
                mini_mode.Enable ();
            };
            viewMenu.Insert (menuItem, 2);
            menuItem.Show ();
        }
Example #12
0
        public static void Create(Tag [] tags, Gtk.Menu menu)
        {
            Gtk.MenuItem item = new Gtk.MenuItem(String.Format(Catalog.GetPluralString("Find _With", "Find _With", tags.Length), tags.Length));

            Gtk.Menu submenu = GetSubmenu(tags);
            if (submenu == null)
            {
                item.Sensitive = false;
            }
            else
            {
                item.Submenu = submenu;
            }

            menu.Append(item);
            item.Show();
        }
Example #13
0
        public override void Initialize()
        {
            separator = new Gtk.SeparatorToolItem();
            separator.Show();

            record_button          = new Gtk.ToolButton(Gtk.Stock.MediaRecord);
            record_button.Clicked += OnRecordButtonClicked;
            record_button.Show();

            play_button          = new Gtk.ToolButton(Gtk.Stock.MediaPlay);
            play_button.Clicked += OnPlayButtonClicked;
            play_button.Show();

            stop_button          = new Gtk.ToolButton(Gtk.Stock.MediaStop);
            stop_button.Clicked += OnStopButtonClicked;
            stop_button.Show();

            delete_item            = new Gtk.MenuItem("Delete Voice Note");
            delete_item.Activated += OnDeleteItemActivated;
            delete_item.Show();

            initialize();
        }
Example #14
0
		public override void Initialize ()
		{
			separator = new Gtk.SeparatorToolItem ();
			separator.Show ();
			
			record_button = new Gtk.ToolButton (Gtk.Stock.MediaRecord);
			record_button.Clicked += OnRecordButtonClicked;
			record_button.Show ();

			play_button = new Gtk.ToolButton (Gtk.Stock.MediaPlay);
			play_button.Clicked += OnPlayButtonClicked;
			play_button.Show ();
			
			stop_button = new Gtk.ToolButton (Gtk.Stock.MediaStop);
			stop_button.Clicked += OnStopButtonClicked;
			stop_button.Show ();

			delete_item = new Gtk.MenuItem ("Delete Voice Note");
			delete_item.Activated += OnDeleteItemActivated;
			delete_item.Show ();
		
			initialize ();
		}
Example #15
0
        void MiniScreenSettings()
        {
            Console.WriteLine("Right Click");

            Gtk.Menu     menu_settings = new Gtk.Menu();
            Gtk.MenuItem menuitem1     = new Gtk.MenuItem(Mono.Unix.Catalog.GetString("MiniScreen Resolution"));
            menu_settings.Append(menuitem1);
            // Submenu 1
            Gtk.Menu     menu_dim    = new Gtk.Menu();
            Gtk.MenuItem menuitem1_0 = new Gtk.MenuItem("300 x 240 (5:4)");
            menu_dim.Append(menuitem1_0);
            menuitem1_0.Show();
            menuitem1.Submenu = menu_dim;

            Gtk.MenuItem menuitem1_1 = new Gtk.MenuItem("400 x 320 (5:4)");
            menu_dim.Append(menuitem1_1);
            menuitem1_1.Show();

            Gtk.MenuItem menuitem1_6 = new Gtk.MenuItem("400 x 235 (16:9)");
            menu_dim.Append(menuitem1_6);
            menuitem1_6.Show();

            Gtk.MenuItem menuitem1_7 = new Gtk.MenuItem("300 x 176 (16:9)");
            menu_dim.Append(menuitem1_7);
            menuitem1_7.Show();

            Gtk.MenuItem menuitem1_2 = new Gtk.MenuItem("300 x 225 (4:3)");
            menu_dim.Append(menuitem1_2);
            menuitem1_2.Show();

            Gtk.MenuItem menuitem1_3 = new Gtk.MenuItem("200 x 150 (4:3)");
            menu_dim.Append(menuitem1_3);
            menuitem1_3.Show();

            Gtk.MenuItem menuitem1_4 = new Gtk.MenuItem("300 x 166 (9:5)");
            menu_dim.Append(menuitem1_4);
            menuitem1_4.Show();

            Gtk.MenuItem menuitem1_5 = new Gtk.MenuItem("200 x 111 (9:5)");
            menu_dim.Append(menuitem1_5);
            menuitem1_5.Show();


            // Opcio refreshRate

            Gtk.MenuItem menuitemRefreshRate = new Gtk.MenuItem(Mono.Unix.Catalog.GetString("Set Refresh Rate"));
            menu_settings.Append(menuitemRefreshRate);

            Gtk.Menu     menu_ref_rate    = new Gtk.Menu();
            Gtk.MenuItem menuitem_ref_500 = new Gtk.MenuItem(Mono.Unix.Catalog.GetString("500 ms (high refresh rate)"));
            menu_ref_rate.Append(menuitem_ref_500);
            menuitem_ref_500.Show();
            menuitemRefreshRate.Submenu = menu_ref_rate;

            Gtk.MenuItem menuitem_ref_750 = new Gtk.MenuItem(Mono.Unix.Catalog.GetString("750 ms"));
            menu_ref_rate.Append(menuitem_ref_750);
            menuitem_ref_750.Show();

            Gtk.MenuItem menuitem_ref_1000 = new Gtk.MenuItem(Mono.Unix.Catalog.GetString("1000 ms"));
            menu_ref_rate.Append(menuitem_ref_1000);
            menuitem_ref_1000.Show();

            Gtk.MenuItem menuitem_ref_1500 = new Gtk.MenuItem(Mono.Unix.Catalog.GetString("1500 ms"));
            menu_ref_rate.Append(menuitem_ref_1500);
            menuitem_ref_1500.Show();

            Gtk.MenuItem menuitem_ref_2000 = new Gtk.MenuItem(Mono.Unix.Catalog.GetString("2000 ms (low refresh rate)"));
            menu_ref_rate.Append(menuitem_ref_2000);
            menuitem_ref_2000.Show();



            // Opció 2

            Gtk.MenuItem menuitem2 = new Gtk.MenuItem(Mono.Unix.Catalog.GetString("Set path color"));
            menu_settings.Append(menuitem2);


            // Opció 3 - Submenú posició


            Gtk.Menu     menu_position = new Gtk.Menu();
            Gtk.MenuItem menuitem3     = new Gtk.MenuItem(Mono.Unix.Catalog.GetString("Window position"));
            menu_settings.Append(menuitem3);

            // Submenu 3
            Gtk.MenuItem menuitem3_0 = new Gtk.MenuItem(Mono.Unix.Catalog.GetString("Left"));
            menu_position.Append(menuitem3_0);
            menuitem3_0.Show();
            menuitem3.Submenu = menu_position;

            Gtk.MenuItem menuitem3_1 = new Gtk.MenuItem(Mono.Unix.Catalog.GetString("Right"));
            menu_position.Append(menuitem3_1);
            menuitem3_1.Show();

            // Opció 4 - Eixir
            Gtk.ImageMenuItem menuitem4 = new Gtk.ImageMenuItem(Stock.Quit, grup);
            menuitem4.RenderIcon(Stock.Quit, IconSize.Menu, Mono.Unix.Catalog.GetString("Exit from MiniScreen"));
            menu_settings.Append(menuitem4);

            // Opció 5 - About


            //Gtk.MenuItem menuitem5=new Gtk.MenuItem(Mono.Unix.Catalog.GetString("About"));
            //Gtk.ImageMenuItem menuitem5=new Gtk.MenuItem((Mono.Unix.Catalog.GetString("About"));


            Gtk.ImageMenuItem menuitem5 = new Gtk.ImageMenuItem(Stock.About, grup);
            menuitem5.RenderIcon(Stock.About, IconSize.Menu, Mono.Unix.Catalog.GetString("About LliureX MiniScreen"));
            menu_settings.Append(menuitem5);

            menuitem1.Show();
            menuitemRefreshRate.Show();
            menuitem2.Show();
            menuitem3.Show();
            menuitem4.Show();
            menuitem5.ShowAll();
            menuitem5.Show();

            menu_settings.Popup();

            menuitem1_0.ButtonPressEvent += HandleMenuitem1ButtonPressEvent;
            menuitem1_1.ButtonPressEvent += HandleMenuitem1ButtonPressEvent;
            menuitem1_2.ButtonPressEvent += HandleMenuitem1ButtonPressEvent;
            menuitem1_3.ButtonPressEvent += HandleMenuitem1ButtonPressEvent;
            menuitem1_4.ButtonPressEvent += HandleMenuitem1ButtonPressEvent;
            menuitem1_5.ButtonPressEvent += HandleMenuitem1ButtonPressEvent;
            menuitem1_6.ButtonPressEvent += HandleMenuitem1ButtonPressEvent;
            menuitem1_7.ButtonPressEvent += HandleMenuitem1ButtonPressEvent;


            menuitem_ref_500.ButtonPressEvent  += HandleMenuitem_ref_500ButtonPressEvent;
            menuitem_ref_750.ButtonPressEvent  += HandleMenuitem_ref_750ButtonPressEvent;
            menuitem_ref_1000.ButtonPressEvent += HandleMenuitem_ref_1000ButtonPressEvent;
            menuitem_ref_1500.ButtonPressEvent += HandleMenuitem_ref_1500ButtonPressEvent;
            menuitem_ref_2000.ButtonPressEvent += HandleMenuitem_ref_2000ButtonPressEvent;



            menuitem2.ButtonPressEvent += HandleMenuitem2ButtonPressEvent;

            menuitem3_0.ButtonPressEvent += HandleMenuitem3_0ButtonPressEvent;
            menuitem3_1.ButtonPressEvent += HandleMenuitem3_1ButtonPressEvent;
            menuitem4.ButtonPressEvent   += HandleMenuitem4ButtonPressEvent;
            menuitem5.ButtonPressEvent   += HandleMenuitem5ButtonPressEvent;
        }
Example #16
0
 private void CreateMenu_simple(object o, Gtk.PopulatePopupArgs e)
 {
     try
     {
         Gtk.SeparatorMenuItem separator1 = new Gtk.SeparatorMenuItem();
         separator1.Show();
         e.Menu.Append(separator1);
         Gtk.Menu m0 = new Gtk.Menu();
         Gtk.MenuItem m1 = new Gtk.MenuItem("Transparency");
         m1.Submenu = m0;
         m1.Show();
         e.Menu.Append(m1);
         Gtk.MenuItem m2 = new Gtk.MenuItem("0%");
         m2.Activated += new EventHandler(toolStripMenuItem6_Click);
         Gtk.MenuItem m3 = new Gtk.MenuItem("20%");
         m3.Activated += new EventHandler(toolStripMenuItem5_Click);
         Gtk.MenuItem m4 = new Gtk.MenuItem("40%");
         m4.Activated += new EventHandler(toolStripMenuItem4_Click);
         Gtk.MenuItem m6 = new Gtk.MenuItem("80%");
         m6.Activated += new EventHandler(toolStripMenuItem2_Click);
         Gtk.MenuItem m5 = new Gtk.MenuItem("60%");
         m5.Activated += new EventHandler(toolStripMenuItem3_Click);
         Gtk.CheckMenuItem ma = new Gtk.CheckMenuItem("On top");
         ma.Active = OnTop;
         ma.Activated += new EventHandler(mx_Click);
         m0.Append(m2);
         m0.Append(m3);
         m0.Append(m4);
         m0.Append(m5);
         m0.Append(m6);
         m2.Show();
         m3.Show();
         m4.Show();
         m5.Show();
         m6.Show();
         ma.Show();
         e.Menu.Append(m1);
         e.Menu.Append(ma);
     }
     catch (Exception fail)
     {
         Core.handleException(fail);
     }
 }
Example #17
0
        private void DoPopUp()
        {
            Menu popup = new Menu();

            ImageMenuItem newItem = new ImageMenuItem (Stock.New, new Gtk.AccelGroup(IntPtr.Zero));
            newItem.Activated += new EventHandler (OnNewEntryActivate);
            newItem.Show ();
            popup.Append (newItem);

            MenuItem renameItem = new MenuItem ("Rename...");
            renameItem.Activated += new EventHandler (OnRenameActivate);
            renameItem.Show ();

            popup.Append (renameItem);

            MenuItem exportItem = new MenuItem ("Export...");
            exportItem.Activated += new EventHandler (OnExportActivate);
            exportItem.Show ();

            popup.Append (exportItem);

            ImageMenuItem deleteItem = new ImageMenuItem (Stock.Delete, new Gtk.AccelGroup(IntPtr.Zero));
            deleteItem.Activated += new EventHandler (OnDeleteActivate);
            deleteItem.Show ();

            popup.Append (deleteItem);

            popup.Popup(null, null, null, 3,
                    Gtk.Global.CurrentEventTime);
        }
Example #18
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);

            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 UpdateGlobalWarningLabel ()
		{
			KeyBindingConflict[] conflicts = currentBindings.CheckKeyBindingConflicts (IdeApp.CommandService.GetCommands ());
			if (conflicts.Length == 0) {
				globalWarningBox.Hide ();
				return;
			}
			globalWarningBox.Show ();
			conflicButton.MenuCreator = delegate {
				Menu menu = new Menu ();
				foreach (KeyBindingConflict conf in conflicts) {
					if (menu.Children.Length > 0) {
						SeparatorMenuItem it = new SeparatorMenuItem ();
						it.Show ();
						menu.Insert (it, -1);
					}
					foreach (Command cmd in conf.Commands) {
						string txt = currentBindings.GetBinding (cmd) + " - " + cmd.Text;
						MenuItem item = new MenuItem (txt);
						Command localCmd = cmd;
						item.Activated += delegate {
							SelectCommand (localCmd);
						};
						item.Show ();
						menu.Insert (item, -1);
					}
				}
				return menu;
			};
		}
Example #20
0
        public void AddExportEntry(string name, string shortName, Action<Project, IGUIToolkit> exportAction)
        {
            MenuItem parent = (MenuItem) this.UIManager.GetWidget("/menubar1/ToolsAction/ExportProjectAction1");

            MenuItem item = new MenuItem(name);
            item.Activated += (sender, e) => (exportAction(openedProject, guiToolKit));
            item.Show();
            (parent.Submenu as Menu).Append(item);
        }
Example #21
0
		private void MakeMenu()
		{
			Menu popupMenu = new Menu();
			UMLElement hoverElem = GetHoverElement (null);
			IList options = null;
			// if the user right-clicked on the diagram, ask the diagram for options
			if (hoverElem == null)
			{
				options = Diagram.GetContextMenuOptions ();
			}
			else
			{
				options = hoverElem.GetContextMenuOptions ();
			}
			if (options != null)
			{
				MenuItem item;
				foreach (ActionBase action in options)
				{
					action.SetCanvas (this);
					item = new MenuItem (action.Name);
					item.Activated += new EventHandler (action.SelectedHandler);
					popupMenu.Append (item);
					item.Show ();
				}
				popupMenu.Popup ();
			}
		}
Example #22
0
        private void Initialize()
        {
            view_menu = (interface_action_service.UIManager.GetWidget ("/MainMenu/ViewMenu") as MenuItem).Submenu as Menu;
            menu_item = new MenuItem (Catalog.GetString ("Media _Panel"));
            menu_item.Activated += delegate { PresentMediaPanel (); };
            view_menu.Insert (menu_item, 2);
            menu_item.Show ();

            // If Banshee is running from the MediaPanel client entry assembly,
            // the MediaPanel instance will have already been created.
            panel = MediaPanel.Instance;

            if (panel != null) {
                panel.BuildContents ();
                PresentMediaPanel ();
            }
        }
Example #23
0
 private void CreateMenu_simple(object o, Gtk.PopulatePopupArgs e)
 {
     try
     {
         Gtk.SeparatorMenuItem separator1 = new Gtk.SeparatorMenuItem();
         separator1.Show();
         e.Menu.Append(separator1);
         Gtk.CheckMenuItem sc = new CheckMenuItem(scroll.Text);
         sc.Active = scroll.Checked;
         sc.Show();
         e.Menu.Append(sc);
         Gtk.MenuItem m1 = new Gtk.MenuItem(remove.Text);
         m1.Activated += new EventHandler(Clear);
         m1.Show();
         sc.Activated += new EventHandler(Scroll);
         e.Menu.Append(m1);
     }
     catch (Exception fail)
     {
         Core.handleException(fail);
     }
 }
Example #24
0
		private void TypeSelectorButtonPressed (object o, GtkSharp.ButtonPressEventArgs args)
		{
			if (args.Event.type == Gdk.EventType.ButtonPress && args.Event.button == 3) {
				TreePath path = null;

				Console.WriteLine ("event: " + args.Event.x + "," + args.Event.y);

				if (typeView.GetPathAtPos ((int) args.Event.x, (int) args.Event.y, out path)) {
					TreeIter iter;
					if (typeStore.GetIter (out iter, path)) {
						if (SelectType ((string) typeStore.GetValue (iter, 1))) {
							Menu menu = new Menu ();
							MenuItem item = new MenuItem ("Show hierarchy");

							item.Activated += new EventHandler (TypeSelectorShowHierarchy);
							item.Show ();
							menu.Append (item);
							menu.Popup (null, null, null, IntPtr.Zero, args.Event.button, args.Event.time);
							args.RetVal = true;
						}
					}
				}
			}
			args.RetVal = false;
		}
Example #25
0
        public void ShowMenu(Node node, int rootX, int rootY, uint button)
        {
            if (node.MenuItems == null || !node.MenuItems.Any ())
                return;
            Menu menu = new Menu ();

            foreach (var item in node.MenuItems) {
                MenuItem menuItem = new MenuItem (item.Name);
                var tmp = item;
                menuItem.Activated += (sender, e) => {
                    node.OnMenuEntryActivated (tmp);
                };
                menu.Append (menuItem);
                menuItem.Show ();
            }

            menuPosition = new Gdk.Point (rootX, rootY);
            menu.Popup (null, null, PositionMenu, button, Global.CurrentEventTime);
        }
Example #26
0
		Gtk.Menu CreateContextMenu ()
		{
			CatalogEntry entry = SelectedEntry;
			if (entry == null)
				return null;

			Gtk.Menu result = new Gtk.Menu ();
			
			Gtk.MenuItem item = new Gtk.MenuItem ("Delete");
			item.Sensitive = entry.References.Length == 0;
			item.Activated += delegate {
				RemoveEntry (entry);
			};
			item.Show();
			result.Append (item);
			
			return result;
		}
Example #27
0
        void DoPopUp()
        {
            Menu popup = new Menu();
            MenuItem exportItem = new MenuItem ("Export...");
            exportItem.Activated += new EventHandler (OnExportActivate);
            exportItem.Show ();

            popup.Append (exportItem);

            popup.Popup(null, null, null, 3, Gtk.Global.CurrentEventTime);
        }
	private OptionMenu CreateConstraintsOptionMenu ()
	{
		Menu menu = new Menu ();

		int i = 0;
		foreach (SelectionConstraint c in constraints) {
			MenuItem menu_item = new MenuItem (c.Label);
			menu_item.Show ();
			constraint_table [menu_item] = i;
			menu_item.Activated += new EventHandler (HandleSelectionConstraintOptionMenuActivated);

			menu.Append (menu_item);
			i ++;
		}

		constraints_option_menu = new OptionMenu ();
		constraints_option_menu.Menu = menu;

		return constraints_option_menu;
	}
Example #29
0
	public Browser (string basedir, IEnumerable<string> sources, string engine)
	{
#if MACOS
		try {
			InitMacAppHandlers();
		} catch (Exception ex) {
			Console.Error.WriteLine ("Installing Mac AppleEvent handlers failed. Skipping.\n" + ex);
		}
#endif
	
		this.engine = engine;		
		ui = new Glade.XML (null, "browser.glade", "window1", null);
		ui.Autoconnect (this);

		MainWindow = (Gtk.Window) ui["window1"];
		MainWindow.DeleteEvent += new DeleteEventHandler (delete_event_cb);
                
		MainWindow.KeyPressEvent += new KeyPressEventHandler (keypress_event_cb);
		MainWindow.KeyReleaseEvent += new KeyReleaseEventHandler (keyrelease_event_cb);
                
		Stream icon = GetResourceImage ("monodoc.png");

		if (icon != null) {
			monodoc_pixbuf = new Gdk.Pixbuf (icon);
			MainWindow.Icon = monodoc_pixbuf;
		}

		//ellipsizing label for the title
		title_label = new ELabel ("");
		title_label.Xalign = 0;
		Pango.FontDescription fd = new Pango.FontDescription ();
		fd.Weight = Pango.Weight.Bold;
		title_label.ModifyFont (fd);
		title_label.Layout.FontDescription = fd;
		title_label_box.Add (title_label);
		title_label.Show ();
		
		//colour the bar according to the current style
		bar_style = bar_eb.Style.Copy ();
		bar_eb.Style = bar_style;
		MainWindow.StyleSet += new StyleSetHandler (BarStyleSet);
		BarStyleSet (null, null);

		help_tree = Driver.LoadTree (basedir, sources);
		tree_browser = new TreeBrowser (help_tree, reference_tree, this);
		
		// Bookmark Manager init;
		bookmark_manager = new BookmarkManager(this);
		
		//
		// Tab Notebook and first tab
		//
		tabs_nb = new Notebook(); //the Notebook that holds tabs
		tabs_nb.Scrollable = true;
		tabs_nb.SwitchPage += new SwitchPageHandler(ChangeTab);
		help_container.Add(tabs_nb);

		AddTab();
			
			
		if ((capabilities & Capabilities.Fonts) != 0) {
			// Add Menu entries for changing the font
			Menu aux = (Menu) view1.Submenu;
			MenuItem sep = new SeparatorMenuItem ();
			sep.Show ();
			aux.Append (sep);
			AccelGroup accel = new AccelGroup ();
			MainWindow.AddAccelGroup (accel);

			textLarger = new MenuItem ("_Larger text");
			textLarger.Activated += new EventHandler (TextLarger);
			textLarger.Show ();
			aux.Append (textLarger);
			AccelKey ak = new AccelKey (Gdk.Key.plus, Gdk.ModifierType.ControlMask, AccelFlags.Visible);
			textLarger.AddAccelerator ("activate", accel, ak);
		
			textSmaller = new MenuItem ("_Smaller text");
			textSmaller.Activated += new EventHandler (TextSmaller);
			textSmaller.Show ();
			aux.Append (textSmaller);
			ak = new AccelKey (Gdk.Key.minus, Gdk.ModifierType.ControlMask, AccelFlags.Visible);
			textSmaller.AddAccelerator ("activate", accel, ak);
	
			textNormal = new MenuItem ("_Original size");
			textNormal.Activated += new EventHandler (TextNormal);
			textNormal.Show ();
			aux.Append (textNormal);
			ak = new AccelKey (Gdk.Key.Key_0, Gdk.ModifierType.ControlMask, AccelFlags.Visible);
			textNormal.AddAccelerator ("activate", accel, ak);
		}

		// restore the editing setting
		editing1.Active = SettingsHandler.Settings.EnableEditing;

		comments1.Active = SettingsHandler.Settings.ShowComments;

		cut1.Sensitive = false;
		paste1.Sensitive = false;

		//
		// Other bits
		//
		search_index = help_tree.GetSearchIndex();
		if (search_index == null) {
			ppanel = new ProgressPanel ("<b>No Search index found</b>", "Generate", RootTree.MakeSearchIndex, CreateSearchPanel); 
			search_vbox.Add (ppanel);
			search_vbox.Show ();
		} else {
			CreateSearchPanel ();
		}
		bookList = new ArrayList ();

		index_browser = IndexBrowser.MakeIndexBrowser (this);
		MainWindow.ShowAll();
		
#if MACOS
		try {
			InstallMacMainMenu ();
			((MenuBar)ui["menubar1"]).Hide ();
		} catch (Exception ex) {
			Console.Error.WriteLine ("Installing Mac IGE Main Menu failed. Skipping.\n" + ex);
		}
#endif
	}
        public static Gtk.Menu CreateContextMenu(RemoveEntryFunc removeEntryFunc, ResourceEntry entry)
        {
            Gtk.Menu result = new Gtk.Menu ();
            Gtk.MenuItem item = new Gtk.MenuItem (GettextCatalog.GetString ("Delete"));
            item.Sensitive = true;
            item.Activated += delegate {
                removeEntryFunc (entry);
            };
            item.Show();
            result.Append (item);

            return result;
        }
Example #31
0
        public override void OnNoteOpened()
        {
            item = new Gtk.MenuItem (Catalog.GetString ("Insert Code Snippet"));
            item.Activated += OnMenuItemActivated;
            item.AddAccelerator ("activate", Window.AccelGroup,
                         (uint)Gdk.Key.d, Gdk.ModifierType.ControlMask,
                         Gtk.AccelFlags.Visible);
            item.Show ();
            AddPluginMenuItem (item);

            Window.Editor.DeleteFromCursor += OnDeleteRange;
            Window.Editor.Backspace += OnBackspace;
            Window.Editor.MoveCursor += OnMoveCursor;
            Window.Editor.FocusInEvent += OnFocusIn;
            Window.Editor.FocusOutEvent += OnFocusOut;

            checkCodeSnippet ();
            cs_changed = false;
        }
        public VisualizationDisplayWidget()
        {
            visualizationMenu = new Menu();
            noVisualizationsMenuItem = new MenuItem(
                AddinManager.CurrentLocalizer.GetString ("No visualizations installed"));
            noVisualizationsMenuItem.Sensitive = false;
            noVisualizationsMenuItem.Show();
            visualizationMenu.Add(noVisualizationsMenuItem);

            glWidget = new GLWidget();
            glWidget.DoubleBuffered = true;
            glWidget.Render += OnRender;
            glWidget.SizeAllocated += OnGlSizeAllocated;
            glWidget.Show();

            Add(glWidget);
            Show();

            playerData = new BansheePlayerData(ServiceManager.PlayerEngine.ActiveEngine);
            playerData.Active = false;

            glWidget.Realized += delegate {
                if (!loopRunning) {
                    loopRunning = true;
                    renderThread = new Thread(RenderLoop);
                    renderThread.Start();
                }

                ConnectVisualization();
            };

            glWidget.Unrealized += delegate {
                DisposeRenderer();
            };

            AddinManager.AddExtensionNodeHandler("/Banshee/OpenVP/Visualization", OnVisualizationChanged);

            InterfaceActionService ias = ServiceManager.Get<InterfaceActionService>();

            ias.GlobalActions.AddImportant(new ActionEntry(SELECT_VIS_ACTION,
                                                           null,
                                                           AddinManager.CurrentLocalizer.GetString ("Select visualization"),
                                                           null, null,
                                                           OnSelectVisualizationClicked));

            ias.GlobalActions.AddImportant(new ToggleActionEntry(LOW_RES_ACTION,
                                                                 null,
                                                                 AddinManager.CurrentLocalizer.GetString ("Low resolution"),
                                                                 null, null,
                                                                 OnHalfResolutionToggled, false));

            ias.GlobalActions.UpdateAction(SELECT_VIS_ACTION, false);
            ias.GlobalActions.UpdateAction(LOW_RES_ACTION, false);

            global_ui_id = ias.UIManager.AddUiFromResource("ActiveSourceUI.xml");
        }
Example #33
0
        public static void Create(Tag [] tags, Gtk.Menu menu)
        {
            Gtk.MenuItem item = new Gtk.MenuItem (String.Format (Catalog.GetPluralString ("Find _With", "Find _With", tags.Length), tags.Length));

            Gtk.Menu submenu = GetSubmenu (tags);
            if (submenu == null)
                item.Sensitive = false;
            else
                item.Submenu = submenu;

            menu.Append (item);
            item.Show ();
        }
Example #34
0
        /// <summary>
        /// Add a keybinding for this keybinder's AccelGroup.
        /// </summary>
        /// <param name="handler">
        /// A <see cref="EventHandler"/> for when the keybinding is
        /// activated.
        /// </param>
        /// <param name="key">
        /// A <see cref="System.UInt32"/> specifying the key that will
        /// be bound (see the Gdk.Key enumeration for common values).
        /// </param>
        /// <param name="modifiers">
        /// The <see cref="Gdk.ModifierType"/> to be used on key
        /// for this binding.
        /// </param>
        /// <param name="flags">
        /// The <see cref="Gtk.AccelFlags"/> for this binding.
        /// </param>
        public void AddAccelerator(EventHandler handler,
		                            uint key,
		                            Gdk.ModifierType modifiers,
		                            Gtk.AccelFlags flags)
        {
            Gtk.MenuItem foo = new Gtk.MenuItem ();
            foo.Activated += handler;
            foo.AddAccelerator ("activate",
                                accel_group,
                                key,
                                modifiers,
                                flags);
            foo.Show ();

            fake_menu.Append (foo);
        }