Inheritance: Gtk.ToolItem
        void Refresh()
        {
            Widget      wrapper = Stetic.Wrapper.Widget.Lookup(this);
            IDesignArea area    = wrapper.GetDesignArea();

            if (area == null)
            {
                return;
            }

            ActionTreeNode selNode = null;

            foreach (Gtk.Widget w in Children)
            {
                CustomToolbarItem it = w as CustomToolbarItem;
                if (it != null && area.IsSelected(it.ActionToolItem))
                {
                    selNode = it.ActionToolItem.Node;
                    area.ResetSelection(it.ActionToolItem);
                }
                Remove(w);
                w.Destroy();
            }

            FillMenu(actionTree);

            if (selNode != null)
            {
                ActionToolItem mi = FindMenuItem(selNode);
                if (mi != null)
                {
                    mi.Select();
                }
            }
        }
        void AddItem(ActionToolItem aitem, int pos)
        {
            aitem.KeyPressEvent += OnItemKeyPress;

            CustomToolbarItem it = new CustomToolbarItem();

            it.ActionToolItem = aitem;
            it.Child          = aitem;
            it.ShowAll();
            Insert(it, pos);
        }
        public void Unselect()
        {
            // Unselects any selected item
            Widget      wrapper = Stetic.Wrapper.Widget.Lookup(this);
            IDesignArea area    = wrapper.GetDesignArea();

            if (area != null)
            {
                foreach (Gtk.Widget w in Children)
                {
                    CustomToolbarItem it = w as CustomToolbarItem;
                    if (it != null)
                    {
                        area.ResetSelection(it.ActionToolItem);
                    }
                }
            }
        }
Example #4
0
		void AddItem (ActionToolItem aitem, int pos)
		{
			aitem.KeyPressEvent += OnItemKeyPress;
			
			CustomToolbarItem it = new CustomToolbarItem ();
			it.ActionToolItem = aitem;
			it.Child = aitem;
			it.ShowAll ();
			Insert (it, pos);
		}