void button_Clicked(object obj, EventArgs args)
        {
            IconSelectorMenu menu = new IconSelectorMenu(project);

            menu.IconSelected += OnStockSelected;
            menu.ShowAll();
            menu.Popup(null, null, new Gtk.MenuPositionFunc(OnDropMenuPosition), 3, Gtk.Global.CurrentEventTime);
        }
        void OnSelectIcon(object s, Gtk.ButtonPressEventArgs args)
        {
            Gtk.Menu menu = new Gtk.Menu();

            Gtk.CheckMenuItem item = new Gtk.CheckMenuItem(Catalog.GetString("Action"));
            item.DrawAsRadio = true;
            item.Active      = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Action);
            item.Activated  += OnSetActionType;
            menu.Insert(item, -1);

            item             = new Gtk.CheckMenuItem(Catalog.GetString("Radio Action"));
            item.DrawAsRadio = true;
            item.Active      = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Radio);
            item.Activated  += OnSetRadioType;
            menu.Insert(item, -1);

            item             = new Gtk.CheckMenuItem(Catalog.GetString("Toggle Action"));
            item.DrawAsRadio = true;
            item.Active      = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Toggle);
            item.Activated  += OnSetToggleType;
            menu.Insert(item, -1);

            menu.Insert(new Gtk.SeparatorMenuItem(), -1);

            Gtk.MenuItem itIcons = new Gtk.MenuItem(Catalog.GetString("Select Icon"));
            menu.Insert(itIcons, -1);
            IconSelectorMenu menuIcons = new IconSelectorMenu(GetProject());

            menuIcons.IconSelected += OnStockSelected;
            itIcons.Submenu         = menuIcons;

            Gtk.MenuItem it = new Gtk.MenuItem(Catalog.GetString("Clear Icon"));
            it.Sensitive  = (node.Action.GtkAction.StockId != null);
            it.Activated += OnClearIcon;
            menu.Insert(it, -1);

            menu.ShowAll();

            uint but = args != null ? args.Event.Button : 1;

            menu.Popup(null, null, new Gtk.MenuPositionFunc(OnDropMenuPosition), but, Gtk.Global.CurrentEventTime);

            // Make sure we get the focus after closing the menu, so we can keep browsing buttons
            // using the keyboard.
            menu.Hidden += delegate(object sender, EventArgs a)
            {
                GrabFocus();
            };

            if (args != null)
            {
                args.RetVal = false;
            }
        }
Example #3
0
        void OnSelectIcon(object sender, Gtk.ButtonPressEventArgs e)
        {
            Gtk.Menu menu = new Gtk.Menu();

            Gtk.CheckMenuItem item = new Gtk.CheckMenuItem(Catalog.GetString("Action"));
            item.DrawAsRadio = true;
            item.Active      = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Action);
            item.Activated  += OnSetActionType;
            menu.Insert(item, -1);

            item             = new Gtk.CheckMenuItem(Catalog.GetString("Radio Action"));
            item.DrawAsRadio = true;
            item.Active      = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Radio);
            item.Activated  += OnSetRadioType;
            menu.Insert(item, -1);

            item             = new Gtk.CheckMenuItem(Catalog.GetString("Toggle Action"));
            item.DrawAsRadio = true;
            item.Active      = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Toggle);
            item.Activated  += OnSetToggleType;
            menu.Insert(item, -1);

            menu.Insert(new Gtk.SeparatorMenuItem(), -1);

            Gtk.MenuItem itIcons = new Gtk.MenuItem(Catalog.GetString("Select Icon"));
            menu.Insert(itIcons, -1);
            IconSelectorMenu menuIcons = new IconSelectorMenu(GetProject());

            menuIcons.IconSelected += OnStockSelected;
            itIcons.Submenu         = menuIcons;

            Gtk.MenuItem it = new Gtk.MenuItem(Catalog.GetString("Clear Icon"));
            it.Sensitive  = (node.Action.GtkAction.StockId != null);
            it.Activated += OnClearIcon;
            menu.Insert(it, -1);

            menu.ShowAll();
            menu.Popup(null, null, new Gtk.MenuPositionFunc(OnDropMenuPosition), 3, Gtk.Global.CurrentEventTime);
            e.RetVal = false;
        }
		void OnSelectIcon (object s, Gtk.ButtonPressEventArgs args)
		{
			Gtk.Menu menu = new Gtk.Menu ();
			
			Gtk.CheckMenuItem item = new Gtk.CheckMenuItem (Catalog.GetString ("Action"));
			item.DrawAsRadio = true;
			item.Active = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Action);
			item.Activated += OnSetActionType;
			menu.Insert (item, -1);
			
			item = new Gtk.CheckMenuItem (Catalog.GetString ("Radio Action"));
			item.DrawAsRadio = true;
			item.Active = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Radio);
			item.Activated += OnSetRadioType;
			menu.Insert (item, -1);
			
			item = new Gtk.CheckMenuItem (Catalog.GetString ("Toggle Action"));
			item.DrawAsRadio = true;
			item.Active = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Toggle);
			item.Activated += OnSetToggleType;
			menu.Insert (item, -1);
			
			menu.Insert (new Gtk.SeparatorMenuItem (), -1);
			
			Gtk.MenuItem itIcons = new Gtk.MenuItem (Catalog.GetString ("Select Icon"));
			menu.Insert (itIcons, -1);
			IconSelectorMenu menuIcons = new IconSelectorMenu (GetProject ());
			menuIcons.IconSelected += OnStockSelected;
			itIcons.Submenu = menuIcons;
			
			Gtk.MenuItem it = new Gtk.MenuItem (Catalog.GetString ("Clear Icon"));
			it.Sensitive = (node.Action.GtkAction.StockId != null);
			it.Activated += OnClearIcon;
			menu.Insert (it, -1);
			
			menu.ShowAll ();

			uint but = args != null ? args.Event.Button : 1;
			menu.Popup (null, null, new Gtk.MenuPositionFunc (OnDropMenuPosition), but, Gtk.Global.CurrentEventTime);
			
			// Make sure we get the focus after closing the menu, so we can keep browsing buttons
			// using the keyboard.
			menu.Hidden += delegate (object sender, EventArgs a) {
				GrabFocus ();
			};
			
			if (args != null)
				args.RetVal = false;
		}
Example #5
0
		void OnSelectIcon (object sender, Gtk.ButtonPressEventArgs e)
		{
			Gtk.Menu menu = new Gtk.Menu ();
			
			Gtk.CheckMenuItem item = new Gtk.CheckMenuItem (Catalog.GetString ("Action"));
			item.DrawAsRadio = true;
			item.Active = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Action);
			item.Activated += OnSetActionType;
			menu.Insert (item, -1);
			
			item = new Gtk.CheckMenuItem (Catalog.GetString ("Radio Action"));
			item.DrawAsRadio = true;
			item.Active = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Radio);
			item.Activated += OnSetRadioType;
			menu.Insert (item, -1);
			
			item = new Gtk.CheckMenuItem (Catalog.GetString ("Toggle Action"));
			item.DrawAsRadio = true;
			item.Active = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Toggle);
			item.Activated += OnSetToggleType;
			menu.Insert (item, -1);
			
			menu.Insert (new Gtk.SeparatorMenuItem (), -1);
			
			Gtk.MenuItem itIcons = new Gtk.MenuItem (Catalog.GetString ("Select Icon"));
			menu.Insert (itIcons, -1);
			IconSelectorMenu menuIcons = new IconSelectorMenu (GetProject ());
			menuIcons.IconSelected += OnStockSelected;
			itIcons.Submenu = menuIcons;
			
			Gtk.MenuItem it = new Gtk.MenuItem (Catalog.GetString ("Clear Icon"));
			it.Sensitive = (node.Action.GtkAction.StockId != null);
			it.Activated += OnClearIcon;
			menu.Insert (it, -1);
			
			menu.ShowAll ();
			menu.Popup (null, null, new Gtk.MenuPositionFunc (OnDropMenuPosition), 3, Gtk.Global.CurrentEventTime);
			e.RetVal = false;
		}
Example #6
0
 void button_Clicked(object obj, EventArgs args)
 {
     IconSelectorMenu menu = new IconSelectorMenu (project);
     menu.IconSelected += OnStockSelected;
     menu.ShowAll ();
     menu.Popup (null, null, new Gtk.MenuPositionFunc (OnDropMenuPosition), 3, Gtk.Global.CurrentEventTime);
 }