RemoveColumns() public static méthode

public static RemoveColumns ( Gtk tv ) : Gtk.TreeView
tv Gtk
Résultat Gtk.TreeView
    private void createTreeView()
    {
        UtilGtk.RemoveColumns(treeview_select);

        treeview_select.HeadersVisible = true;
        int count = 0;

        treeview_select.AppendColumn(Catalog.GetString("Name"), new CellRendererText(), "text", count++);
        treeview_select.AppendColumn(Catalog.GetString("Description"), new CellRendererText(), "text", count++);

        treeview_select.Selection.Changed += onTVSelectionChanged;

        store = getStore();
        treeview_select.Model = store;

        Pixbuf pixbuf;

        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + Constants.FileNameImport);
        image_import.Pixbuf = pixbuf;
        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + Constants.FileNameExport);
        image_export.Pixbuf = pixbuf;
        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + "stock_delete.png");
        image_delete.Pixbuf = pixbuf;
    }
Exemple #2
0
    private void createTreeView_runs_interval_sprint(Gtk.TreeView tv)
    {
        LogB.Information("SPRINT create START");
        UtilGtk.RemoveColumns(tv);
        button_sprint.Sensitive            = false;
        image_sprint.Sensitive             = false;
        button_sprint_save_image.Sensitive = false;

        tv.HeadersVisible = true;

        int count = 0;

        tv.AppendColumn(Catalog.GetString("Type"), new CellRendererText(), "text", count++);
        tv.AppendColumn("ID", new CellRendererText(), "text", count++);
        tv.AppendColumn(Catalog.GetString("Distances"), new CellRendererText(), "text", count++);
        tv.AppendColumn(Catalog.GetString("Split times"), new CellRendererText(), "text", count++);
        tv.AppendColumn(Catalog.GetString("Total time"), new CellRendererText(), "text", count++);

        storeSprint = new TreeStore(
            typeof(string), typeof(string), typeof(string),
            typeof(string), typeof(string));
        tv.Model = storeSprint;

        if (currentSession == null || currentPerson == null)
        {
            return;
        }

        tv.Selection.Changed -= onTreeviewSprintSelectionEntry;
        tv.Selection.Changed += onTreeviewSprintSelectionEntry;

        List <object> runITypes = SqliteRunIntervalType.SelectRunIntervalTypesNew("", false);

        string [] runsArray = SqliteRunInterval.SelectRuns(
            false, currentSession.UniqueID, currentPerson.UniqueID, "");

        foreach (string line in runsArray)
        {
            //[] lineSplit has run params
            string [] lineSplit = line.Split(new char[] { ':' });

            //get intervalTimes
            string intervalTimesString = lineSplit[8];

            string positions = getSprintPositions(
                Convert.ToDouble(lineSplit[7]),                         //distanceInterval. == -1 means variable distances
                intervalTimesString,
                runIntervalTypeDistances(lineSplit[4], runITypes)       //distancesString
                );
            if (positions == "")
            {
                continue;
            }

            string splitTimes = getSplitTimes(intervalTimesString);

            string [] lineParams =
            {
                lineSplit[4],
                lineSplit[1],
                positions,
                splitTimes,
                Util.TrimDecimals(lineSplit[6], preferences.digitsNumber)
            };
            storeSprint.AppendValues(lineParams);
        }
        LogB.Information("SPRINT create END");
    }