示例#1
0
        protected override bool OnButtonPressEvent(Gdk.EventButton ev)
        {
            IDesignArea designArea = GetDesignArea();

            designArea.SetSelection(null, null);
            return(true);
        }
示例#2
0
        public void StartEditing()
        {
            IDesignArea designArea = GetDesignArea();

            designArea.SetSelection(headerLabel, null);
            headerLabel.StartEditing();
        }
示例#3
0
        void Fill()
        {
            IDesignArea designArea = GetDesignArea();

            if (designArea == null)
            {
                return;
            }

            Wrapper.Action selAction = null;

            foreach (ActionMenuItem item in items)
            {
                if (designArea.IsSelected(item))
                {
                    selAction = item.Node.Action;
                }
                item.Node.Dispose();
                item.Detach();
                item.Destroy();
            }
            items.Clear();

            if (actionGroup != null)
            {
                Wrapper.Action[] sortedActions = new Wrapper.Action [actionGroup.Actions.Count];
                actionGroup.Actions.CopyTo(sortedActions, 0);
                Array.Sort(sortedActions, new ActionComparer());
                for (int n = 0; n < sortedActions.Length; n++)
                {
                    Wrapper.Action action = (Wrapper.Action)sortedActions [n];
                    ActionMenuItem item   = InsertAction(action, n);
                    if (selAction == action)
                    {
                        item.Select();
                    }
                }

                if (selAction == null)
                {
                    designArea.SetSelection(null, null);
                }

                headerLabel.Sensitive = true;
                PlaceAddLabel(actionGroup.Actions.Count);
            }
            else
            {
                HideAddLabel();
                headerLabel.Text      = Catalog.GetString("No selection");
                headerLabel.Sensitive = false;
            }
            ShowAll();
        }
示例#4
0
        public virtual void Select()
        {
            IDesignArea area = GetDesignArea();

            if (area.IsSelected(this))
            {
                return;
            }
            IObjectSelection sel = area.SetSelection(this, node.Action != null ? node.Action.GtkAction : null);

            sel.Drag     += HandleItemDrag;
            sel.Disposed += OnSelectionDisposed;
            GrabFocus();
        }
示例#5
0
        protected void UpdateSelectionStatus()
        {
            IDesignArea      area = GetDesignArea();
            IObjectSelection sel  = area.GetSelection();

            sel.Disposed -= OnSelectionDisposed;
            sel.Drag     -= HandleItemDrag;

            area.ResetSelection(this);

            sel           = area.SetSelection(this, this);
            sel.Drag     += HandleItemDrag;
            sel.Disposed += OnSelectionDisposed;
        }
示例#6
0
        public void StartEditing()
        {
            if (Child is Gtk.Label)
            {
                IDesignArea      d   = WidgetUtils.GetDesignArea(this);
                IObjectSelection sel = d.GetSelection(this);
                if (sel == null)
                {
                    sel = d.SetSelection(this, null);
                }

                sel.Disposed += SelectionDisposed;

                Remove(Child);
                Add(CreateEntry());
                ShowAll();
                Child.GrabFocus();
            }
        }
示例#7
0
        protected override bool OnButtonPressEvent(Gdk.EventButton ev)
        {
            IDesignArea d = WidgetUtils.GetDesignArea(this);

            if (d.IsSelected(this))
            {
                if (Child is Gtk.Label)
                {
                    StartEditing();
                    return(true);
                }
            }
            else
            {
                d.SetSelection(this, null);
                return(true);
            }
            return(false);
        }