Esempio n. 1
0
        public GLib.Value GetColumnValue(ITreeGridItem item, int dataColumn, int row, Gtk.TreeIter iter)
        {
            if (dataColumn == RowDataColumn)
            {
                return(new GLib.Value(GetRowIndexOfPath(model.GetPath(iter))));
            }

            int column;

            if (ColumnMap.TryGetValue(dataColumn, out column))
            {
                var colHandler = (IGridColumnHandler)Widget.Columns[column].Handler;
                return(colHandler.GetValue(item, dataColumn, row));
            }
            return(new GLib.Value((string)null));
        }
Esempio n. 2
0
        int GetCount(Gtk.TreeIter parent, int upToIndex)
        {
            int rows  = upToIndex == -1 ? model.IterNChildren(parent) : upToIndex;
            int count = 0;

            for (int i = 0; i < rows; i++)
            {
                Gtk.TreeIter iter;
                if (model.IterNthChild(out iter, parent, i))
                {
                    var childPath = model.GetPath(iter);

                    if (Tree.GetRowExpanded(childPath))
                    {
                        count += GetCount(iter, -1);
                    }
                }
                count++;
            }
            return(count);
        }
Esempio n. 3
0
        int GetCount(Gtk.TreeIter parent, int upToIndex)
        {
            int rows  = upToIndex == -1 ? model.IterNChildren(parent) : upToIndex;
            int count = 0;
            var path  = model.GetPath(parent);

            path.AppendIndex(0);
            for (int i = 0; i < rows; i++)
            {
                Gtk.TreeIter iter;
                if (Tree.GetRowExpanded(path))
                {
                    if (model.IterNthChild(out iter, parent, i))
                    {
                        count += GetCount(iter, -1);
                    }
                }
                path.Next();
                count++;
            }
            return(count);
        }