public void Remove(TreePosition pos) { IterPos tpos = (IterPos)pos; Gtk.TreeIter it = tpos.Iter; Tree.Remove(ref it); }
public TreePosition InsertAfter(TreePosition pos) { IterPos tpos = (IterPos)pos; var p = Tree.InsertNodeAfter(tpos.Iter); return(new IterPos(p)); }
public void Remove(TreePosition pos) { version++; IterPos tpos = GetIterPos(pos); Gtk.TreeIter it = tpos.Iter; Tree.Remove(ref it); }
public TreePosition InsertAfter(TreePosition pos) { version++; IterPos tpos = GetIterPos(pos); var p = Tree.InsertNodeAfter(tpos.Iter); return(new IterPos(version, p)); }
public void SetValue(TreePosition pos, int column, object value) { IterPos tpos = GetIterPos(pos); SetValue(tpos.Iter, column, value); if (NodeChanged != null) { NodeChanged(this, new TreeNodeEventArgs(pos)); } }
void HandleRowActivated(object o, Gtk.RowActivatedArgs args) { Gtk.TreeIter it; if (Widget.Model.GetIter(out it, args.Path)) { CurrentEventRow = new IterPos(-1, it); ApplicationContext.InvokeUserCode(delegate { EventSink.OnRowActivated(new IterPos(-1, it)); }); } }
IterPos GetIterPos(TreePosition pos) { IterPos tpos = (IterPos)pos; if (tpos != null && tpos.Version != version) { tpos.LastChildIndex = -1; tpos.ChildrenCount = -1; } return(tpos); }
public TreePosition GetNext(TreePosition pos) { IterPos tpos = GetIterPos(pos); Gtk.TreeIter it = tpos.Iter; if (!Tree.IterNext(ref it)) { return(null); } return(new IterPos(version, it)); }
public TreePosition GetParent(TreePosition pos) { IterPos tpos = (IterPos)pos; Gtk.TreeIter it; if (!Tree.IterParent(out it, tpos.Iter)) { return(null); } return(new IterPos(it)); }
public TreePosition GetNext(TreePosition pos) { IterPos tpos = (IterPos)pos; Gtk.TreeIter it = tpos.Iter; if (!Tree.IterNext(ref it)) { return(null); } return(new IterPos(it)); }
public TreePosition GetParent(TreePosition pos) { IterPos tpos = GetIterPos(pos); Gtk.TreeIter it; if (!Tree.IterParent(out it, tpos.Iter)) { return(null); } return(new IterPos(version, it)); }
public TreePosition GetChild(TreePosition pos, int index) { IterPos tpos = (IterPos)pos; if (tpos.LastChildIndex == index) { return(new IterPos(tpos.LastChildIter)); } if (index == 0) { Gtk.TreeIter it; if (Tree.GetIterFirst(out it)) { tpos.LastChildIter = it; tpos.LastChildIndex = 0; return(new IterPos(it)); } else { return(null); } } if (tpos.LastChildIndex == -1 || tpos.LastChildIndex > index) { Gtk.TreeIter it; if (Tree.IterNthChild(out it, index)) { tpos.LastChildIter = it; tpos.LastChildIndex = index; return(new IterPos(it)); } else { return(null); } } // tpos.LastChildIndex < index Gtk.TreeIter iter = tpos.LastChildIter; for (int n = tpos.LastChildIndex; n < index; n++) { if (!Tree.IterNext(ref iter)) { return(null); } } tpos.LastChildIter = iter; tpos.LastChildIndex = index; return(new IterPos(iter)); }
public TreePosition InsertAfter(TreePosition pos) { version++; IterPos tpos = GetIterPos(pos); var p = Tree.InsertNodeAfter(tpos.Iter); var node = new IterPos(version, p); if (NodeInserted != null) { NodeInserted(this, new TreeNodeEventArgs(node)); } return(node); }
public TreePosition AddChild(TreePosition pos) { IterPos tpos = (IterPos)pos; Gtk.TreeIter it; if (pos == null) { it = Tree.AppendNode(); } else { it = Tree.AppendNode(tpos.Iter); } return(new IterPos(it)); }
public void Remove(TreePosition pos) { version++; IterPos tpos = GetIterPos(pos); Gtk.TreeIter it = tpos.Iter; var delPath = Tree.GetPath(it); var eventArgs = new TreeNodeChildEventArgs(GetParent(tpos), delPath.Indices[delPath.Indices.Length - 1], pos); Tree.Remove(ref it); if (NodeDeleted != null) { NodeDeleted(this, eventArgs); } }
public int GetChildrenCount(TreePosition pos) { if (pos == null) { return(Tree.IterNChildren()); } IterPos tpos = GetIterPos(pos); if (tpos.ChildrenCount != -1) { return(tpos.ChildrenCount); } return(tpos.ChildrenCount = Tree.IterNChildren(tpos.Iter)); }
public TreePosition AddChild(TreePosition pos) { version++; IterPos tpos = GetIterPos(pos); Gtk.TreeIter it; if (pos == null) { it = Tree.AppendNode(); } else { it = Tree.AppendNode(tpos.Iter); } return(new IterPos(version, it)); }
public int GetChildrenCount(TreePosition pos) { IterPos tpos = (IterPos)pos; if (tpos.ChildrenCount != -1) { return(tpos.ChildrenCount); } if (pos == null) { tpos.ChildrenCount = Tree.IterNChildren(); } else { tpos.ChildrenCount = Tree.IterNChildren(tpos.Iter); } return(tpos.ChildrenCount); }
public TreePosition GetPrevious(TreePosition pos) { IterPos tpos = GetIterPos(pos); Gtk.TreePath path = Tree.GetPath(tpos.Iter); int [] indices = path.Indices; if (indices.Length < 1 || indices [indices.Length - 1] == 0) { return(null); } indices [indices.Length - 1]--; Gtk.TreePath previousPath = new Gtk.TreePath(indices); Gtk.TreeIter previous; if (!Tree.GetIter(out previous, previousPath)) { return(null); } return(new IterPos(version, previous)); }
public TreePosition AddChild(TreePosition pos) { version++; IterPos tpos = GetIterPos(pos); Gtk.TreeIter it; if (pos == null) { it = Tree.AppendNode(); } else { it = Tree.AppendNode(tpos.Iter); } var node = new IterPos(version, it); if (NodeInserted != null) { NodeInserted(this, new TreeNodeEventArgs(node)); } return(node); }
public bool GetDropTargetRow(double x, double y, out RowDropPosition pos, out TreePosition nodePosition) { Gtk.TreeViewDropPosition tpos; Gtk.TreePath path; if (!Widget.GetDestRowAtPos((int)x, (int)y, out path, out tpos)) { pos = RowDropPosition.Into; nodePosition = null; return(false); } Gtk.TreeIter it; Widget.Model.GetIter(out it, path); nodePosition = new IterPos(-1, it); switch (tpos) { case Gtk.TreeViewDropPosition.After: pos = RowDropPosition.After; break; case Gtk.TreeViewDropPosition.Before: pos = RowDropPosition.Before; break; default: pos = RowDropPosition.Into; break; } return(true); }
public bool GetDropTargetRow(double x, double y, out RowDropPosition pos, out TreePosition nodePosition) { Gtk.TreeViewDropPosition tpos; Gtk.TreePath path; if (!Widget.GetDestRowAtPos ((int)x, (int)y, out path, out tpos)) { pos = RowDropPosition.Into; nodePosition = null; return false; } Gtk.TreeIter it; Widget.Model.GetIter (out it, path); nodePosition = new IterPos (-1, it); switch (tpos) { case Gtk.TreeViewDropPosition.After: pos = RowDropPosition.After; break; case Gtk.TreeViewDropPosition.Before: pos = RowDropPosition.Before; break; default: pos = RowDropPosition.Into; break; } return true; }
public TreePosition AddChild(TreePosition pos) { version++; IterPos tpos = GetIterPos (pos); Gtk.TreeIter it; if (pos == null) it = Tree.AppendNode (); else it = Tree.AppendNode (tpos.Iter); var node = new IterPos (version, it); if (NodeInserted != null) NodeInserted (this, new TreeNodeEventArgs (node)); return node; }
public TreePosition InsertBefore(TreePosition pos) { version++; IterPos tpos = GetIterPos (pos); var p = Tree.InsertNodeBefore (tpos.Iter); var node = new IterPos (version, p); if (NodeInserted != null) NodeInserted (this, new TreeNodeEventArgs (node)); return node; }
void HandleTestExpandRow(object o, Gtk.TestExpandRowArgs args) { Gtk.TreeIter it; if (Widget.Model.GetIter (out it, args.Path)) { CurrentEventRow = new IterPos (-1, it); ApplicationContext.InvokeUserCode (delegate { EventSink.OnRowExpanding (new IterPos (-1, it)); }); } }
public void SetValue(TreePosition pos, int column, object value) { IterPos tpos = GetIterPos(pos); SetValue(tpos.Iter, column, value); }
public object GetValue(TreePosition pos, int column) { IterPos tpos = GetIterPos(pos); return(GetValue(tpos.Iter, column)); }