protected override bool OnButtonPressEvent(Gdk.EventButton ev) { IDesignArea designArea = GetDesignArea(); designArea.SetSelection(null, null); return(true); }
public void StartEditing() { IDesignArea designArea = GetDesignArea(); designArea.SetSelection(headerLabel, null); headerLabel.StartEditing(); }
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(); }
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(); }
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; }
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(); } }
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); }