Пример #1
0
        public PropertyGridTable ()
        {
            Build();

            items = new List<TreeItem> ();
            pitems = new List<TreeItem> ();
            eitems = new List<EventItem> ();
            nulliter = new TreeIter ();
            sortgroup = true;

            var column1 = new TreeViewColumn ();
            column1.Sizing = TreeViewColumnSizing.Fixed;
            column1.FixedWidth = 100;
            column1.Resizable = true;
            column1.Title = "Name";

            var textCell1 = new CellRendererText ();
            textCell1.Underline = Pango.Underline.Single;
            column1.PackStart (textCell1, false);

            var textCell2 = new CellRendererText ();
            column1.PackStart (textCell2, false);

            var idCell = new CellRendererText ();
            idCell.Visible = false;
            column1.PackStart (idCell, false);

            treeview1.AppendColumn (column1);

            var column2 = new TreeViewColumn ();
            column2.Sizing = TreeViewColumnSizing.Fixed;
            column2.Resizable = true;
            column2.Title = "Value";

            var editTextCell = new CellRendererText ();

            editTextCell.Edited += delegate(object o, EditedArgs args) {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected (out model, out iter)) {

                    int id = Convert.ToInt32(model.GetValue(iter, 11));

                    for(int i = 0;i < eitems.Count;i++)
                    {
                        if(eitems[i].id == id)
                        {
                            if(eitems[i].eventHandler != null)
                            {
                                var fwidget = new FalseWidget(args.NewText);
                                eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                model.SetValue(iter, 4, args.NewText);
                                break;
                            }
                        }
                    }
                }
            };

            column2.PackStart (editTextCell, false);

            var editTextCell2 = new CellRendererText ();
            editTextCell2.Editable = true;
            editTextCell2.EditingStarted += delegate {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected (out model, out iter)) {

                    var dialog = new CollectionEditorDialog(model.GetValue(iter, 14).ToString(), window);
                    dialog.TransientFor = window;
                    if(dialog.Run() == (int)ResponseType.Ok)
                    {
                        int id = Convert.ToInt32(model.GetValue(iter, 11));

                        for(int i = 0;i < eitems.Count;i++)
                        {
                            if(eitems[i].id == id)
                            {
                                if(eitems[i].eventHandler != null)
                                {
                                    var fwidget = new FalseWidget(dialog.text);
                                    eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                    model.SetValue(iter, 14, dialog.text);
                                    break;
                                }
                            }
                        }
                    }
                }
            };
            column2.PackStart (editTextCell2, false);

            var editTextCell4 = new CellRendererText ();
            editTextCell4.Editable = true;
            editTextCell4.EditingStarted += delegate {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected (out model, out iter)) {

                    var dialog = new ColorPickerDialog(model.GetValue(iter, 15).ToString());
                    dialog.TransientFor = window;
                    if(dialog.Run() == (int)ResponseType.Ok)
                    {
                        int id = Convert.ToInt32(model.GetValue(iter, 11));

                        for(int i = 0;i < eitems.Count;i++)
                        {
                            if(eitems[i].id == id)
                            {
                                if(eitems[i].eventHandler != null)
                                {
                                    var fwidget = new FalseWidget(dialog.data);
                                    eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                    model.SetValue(iter, 15, dialog.data);
                                    break;
                                }
                            }
                        }
                    }
                }
            };
            column2.PackStart (editTextCell4, false);

            var editTextCell3 = new CellRendererText ();
            editTextCell3.Visible = false;
            column2.PackStart (editTextCell3, false);

            var comboCell = new CellRendererCombo ();
            comboCell.TextColumn = 0;
            comboCell.IsExpanded = true;
            comboCell.Editable = true;
            comboCell.HasEntry = false;
            comboCell.Edited += delegate(object o, EditedArgs args) {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected (out model, out iter)) {

                    int id = Convert.ToInt32(model.GetValue(iter, 11));

                    for(int i = 0;i < eitems.Count;i++)
                    {
                        if(eitems[i].id == id)
                        {
                            if(eitems[i].eventHandler != null && args.NewText != null && args.NewText != "")
                            {
                                var fwidget = new FalseWidget(args.NewText);
                                eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                model.SetValue(iter, 8, args.NewText);
                                break;
                            }
                        }
                    }
                }
            };

            column2.PackStart (comboCell , false);

            var editFilePathCell = new CellRendererText();
            editFilePathCell.Editable = true;
            editFilePathCell.EditingStarted += delegate(object o, EditingStartedArgs args) {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected (out model, out iter)) {

                    var dialog = new FileChooserDialog("Add Content Folder",
                        window,
                        FileChooserAction.SelectFolder,
                        "Cancel", ResponseType.Cancel,
                        "Open", ResponseType.Accept);
                    dialog.SetCurrentFolder (window._controller.GetFullPath(model.GetValue(iter, 17).ToString()));

                    int responseid = dialog.Run();
                    string fileName = dialog.Filename;
                    dialog.Destroy();

                    if(responseid == (int)ResponseType.Accept)
                    {
                        int id = Convert.ToInt32(model.GetValue(iter, 11));

                        for(int i = 0;i < eitems.Count;i++)
                        {
                            if(eitems[i].id == id)
                            {
                                if(eitems[i].eventHandler != null)
                                {
                                    string pl = ((PipelineController)window._controller).ProjectLocation;
                                    if (!pl.EndsWith(System.IO.Path.DirectorySeparatorChar.ToString()))
                                        pl += System.IO.Path.DirectorySeparatorChar;

                                    Uri folderUri = new Uri(pl);
                                    Uri pathUri = new Uri(fileName);

                                    string newpath = Uri.UnescapeDataString(folderUri.MakeRelativeUri(pathUri).ToString().Replace('/', System.IO.Path.DirectorySeparatorChar));

                                    var fwidget = new FalseWidget(newpath);
                                    eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                    model.SetValue(iter, 17, newpath);
                                    break;
                                }
                            }
                        }
                    }
                }
            };
            column2.PackStart (editFilePathCell, false);

            treeview1.AppendColumn (column2);

            column1.AddAttribute (textCell1, "text", 0);
            column1.AddAttribute (textCell1, "visible", 1);
            column1.AddAttribute (textCell2, "text", 2);
            column1.AddAttribute (textCell2, "visible", 3);
            column2.AddAttribute (editTextCell, "text", 4);
            column2.AddAttribute (editTextCell, "visible", 5);
            column2.AddAttribute (editTextCell, "editable", 6);
            column2.AddAttribute (comboCell, "model", 7);
            column2.AddAttribute (comboCell, "text", 8);
            column2.AddAttribute (comboCell, "editable", 9);
            column2.AddAttribute (comboCell, "visible", 10);
            column1.AddAttribute (idCell, "text", 11);
            column2.AddAttribute (editTextCell2, "text", 12);
            column2.AddAttribute (editTextCell2, "visible", 13);
            column2.AddAttribute (editTextCell3, "text", 14);
            column2.AddAttribute (editTextCell4, "text", 15);
            column2.AddAttribute (editTextCell4, "visible", 16);
            column2.AddAttribute (editFilePathCell, "text", 17);
            column2.AddAttribute (editFilePathCell, "visible", 18);

            listStore = new TreeStore (typeof (string), typeof(bool), typeof (string), typeof(bool), typeof (string), typeof(bool), typeof(bool), typeof(TreeStore), typeof(string), typeof(bool), typeof(bool), typeof(string), typeof(string), typeof(bool), typeof(string), typeof(string), typeof(bool), typeof(string), typeof(bool));
            treeview1.Model = listStore;
        }
Пример #2
0
        public PropertyGridTable()
        {
            Build();

            items     = new List <TreeItem> ();
            pitems    = new List <TreeItem> ();
            eitems    = new List <EventItem> ();
            nulliter  = new TreeIter();
            sortgroup = true;

            var column1 = new TreeViewColumn();

            column1.Sizing     = TreeViewColumnSizing.Fixed;
            column1.FixedWidth = 100;
            column1.Resizable  = true;
            column1.Title      = "Name";

            var textCell1 = new CellRendererText();

            textCell1.Underline = Pango.Underline.Single;
            column1.PackStart(textCell1, false);

            var textCell2 = new CellRendererText();

            column1.PackStart(textCell2, false);

            var idCell = new CellRendererText();

            idCell.Visible = false;
            column1.PackStart(idCell, false);

            treeview1.AppendColumn(column1);

            var column2 = new TreeViewColumn();

            column2.Sizing    = TreeViewColumnSizing.Fixed;
            column2.Resizable = true;
            column2.Title     = "Value";

            var editTextCell = new CellRendererText();

            editTextCell.Edited += delegate(object o, EditedArgs args) {
                TreeModel model;
                TreeIter  iter;

                if (treeview1.Selection.GetSelected(out model, out iter))
                {
                    int id = Convert.ToInt32(model.GetValue(iter, 11));

                    for (int i = 0; i < eitems.Count; i++)
                    {
                        if (eitems[i].id == id)
                        {
                            if (eitems[i].eventHandler != null)
                            {
                                var fwidget = new FalseWidget(args.NewText);
                                eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                model.SetValue(iter, 4, args.NewText);
                                break;
                            }
                        }
                    }
                }
            };

            column2.PackStart(editTextCell, false);

            var editTextCell2 = new CellRendererText();

            editTextCell2.Editable        = true;
            editTextCell2.EditingStarted += delegate {
                TreeModel model;
                TreeIter  iter;

                if (treeview1.Selection.GetSelected(out model, out iter))
                {
                    var dialog = new CollectionEditorDialog(model.GetValue(iter, 14).ToString());
                    dialog.TransientFor = window;
                    if (dialog.Run() == (int)ResponseType.Ok)
                    {
                        int id = Convert.ToInt32(model.GetValue(iter, 11));

                        for (int i = 0; i < eitems.Count; i++)
                        {
                            if (eitems[i].id == id)
                            {
                                if (eitems[i].eventHandler != null)
                                {
                                    var fwidget = new FalseWidget(dialog.text);
                                    eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                    model.SetValue(iter, 14, dialog.text);
                                    break;
                                }
                            }
                        }
                    }
                }
            };
            column2.PackStart(editTextCell2, false);

            var editTextCell4 = new CellRendererText();

            editTextCell4.Editable        = true;
            editTextCell4.EditingStarted += delegate {
                TreeModel model;
                TreeIter  iter;

                if (treeview1.Selection.GetSelected(out model, out iter))
                {
                    var dialog = new ColorPickerDialog(model.GetValue(iter, 15).ToString());
                    dialog.TransientFor = window;
                    if (dialog.Run() == (int)ResponseType.Ok)
                    {
                        int id = Convert.ToInt32(model.GetValue(iter, 11));

                        for (int i = 0; i < eitems.Count; i++)
                        {
                            if (eitems[i].id == id)
                            {
                                if (eitems[i].eventHandler != null)
                                {
                                    var fwidget = new FalseWidget(dialog.data);
                                    eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                    model.SetValue(iter, 15, dialog.data);
                                    break;
                                }
                            }
                        }
                    }
                }
            };
            column2.PackStart(editTextCell4, false);

            var editTextCell3 = new CellRendererText();

            editTextCell3.Visible = false;
            column2.PackStart(editTextCell3, false);

            var comboCell = new CellRendererCombo();

            comboCell.TextColumn = 0;
            comboCell.IsExpanded = true;
            comboCell.Editable   = true;
            comboCell.HasEntry   = false;
            comboCell.Edited    += delegate(object o, EditedArgs args) {
                TreeModel model;
                TreeIter  iter;

                if (treeview1.Selection.GetSelected(out model, out iter))
                {
                    int id = Convert.ToInt32(model.GetValue(iter, 11));

                    for (int i = 0; i < eitems.Count; i++)
                    {
                        if (eitems[i].id == id)
                        {
                            if (eitems[i].eventHandler != null && args.NewText != null && args.NewText != "")
                            {
                                var fwidget = new FalseWidget(args.NewText);
                                eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                model.SetValue(iter, 8, args.NewText);
                                break;
                            }
                        }
                    }
                }
            };

            column2.PackStart(comboCell, false);

            treeview1.AppendColumn(column2);

            column1.AddAttribute(textCell1, "text", 0);
            column1.AddAttribute(textCell1, "visible", 1);
            column1.AddAttribute(textCell2, "text", 2);
            column1.AddAttribute(textCell2, "visible", 3);
            column2.AddAttribute(editTextCell, "text", 4);
            column2.AddAttribute(editTextCell, "visible", 5);
            column2.AddAttribute(editTextCell, "editable", 6);
            column2.AddAttribute(comboCell, "model", 7);
            column2.AddAttribute(comboCell, "text", 8);
            column2.AddAttribute(comboCell, "editable", 9);
            column2.AddAttribute(comboCell, "visible", 10);
            column1.AddAttribute(idCell, "text", 11);
            column2.AddAttribute(editTextCell2, "text", 12);
            column2.AddAttribute(editTextCell2, "visible", 13);
            column2.AddAttribute(editTextCell3, "text", 14);
            column2.AddAttribute(editTextCell4, "text", 15);
            column2.AddAttribute(editTextCell4, "visible", 16);

            listStore       = new TreeStore(typeof(string), typeof(bool), typeof(string), typeof(bool), typeof(string), typeof(bool), typeof(bool), typeof(TreeStore), typeof(string), typeof(bool), typeof(bool), typeof(string), typeof(string), typeof(bool), typeof(string), typeof(string), typeof(bool));
            treeview1.Model = listStore;
        }
Пример #3
0
        public PropertyGridTable()
        {
            Build();

            items     = new List <TreeItem> ();
            pitems    = new List <TreeItem> ();
            eitems    = new List <EventItem> ();
            nulliter  = new TreeIter();
            sortgroup = true;

            var column1 = new TreeViewColumn();

            column1.Sizing     = TreeViewColumnSizing.Fixed;
            column1.FixedWidth = 100;
            column1.Resizable  = true;
            column1.Title      = "Name";

            var textCell1 = new CellRendererText();

            textCell1.Underline = Pango.Underline.Single;
            column1.PackStart(textCell1, false);

            var textCell2 = new CellRendererText();

            column1.PackStart(textCell2, false);

            var idCell = new CellRendererText();

            idCell.Visible = false;
            column1.PackStart(idCell, false);

            treeview1.AppendColumn(column1);

            var column2 = new TreeViewColumn();

            column2.Sizing    = TreeViewColumnSizing.Fixed;
            column2.Resizable = true;
            column2.Title     = "Value";

            var editTextCell = new CellRendererText();

            editTextCell.Edited += delegate(object o, EditedArgs args) {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected(out model, out iter))
                {
                    int id = Convert.ToInt32(model.GetValue(iter, 11));

                    for (int i = 0; i < eitems.Count; i++)
                    {
                        if (eitems[i].id == id)
                        {
                            if (eitems[i].eventHandler != null)
                            {
                                var fwidget = new FalseWidget(args.NewText);
                                eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                model.SetValue(iter, 4, args.NewText);
                                break;
                            }
                        }
                    }
                }
            };

            column2.PackStart(editTextCell, false);

            var editTextCell2 = new CellRendererText();
            editTextCell2.Editable        = true;
            editTextCell2.EditingStarted += delegate {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected(out model, out iter))
                {
                    var dialog = new CollectionEditorDialog(window, model.GetValue(iter, 14).ToString());
                    if (dialog.Run() == (int)ResponseType.Ok)
                    {
                        int id = Convert.ToInt32(model.GetValue(iter, 11));

                        for (int i = 0; i < eitems.Count; i++)
                        {
                            if (eitems[i].id == id)
                            {
                                if (eitems[i].eventHandler != null)
                                {
                                    var fwidget = new FalseWidget(dialog.text);
                                    eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                    model.SetValue(iter, 14, dialog.text);
                                    break;
                                }
                            }
                        }
                    }
                }
            };
            column2.PackStart(editTextCell2, false);

            var editTextCell4 = new CellRendererText();
            editTextCell4.Editable        = true;
            editTextCell4.EditingStarted += delegate {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected(out model, out iter))
                {
                    var col      = new Microsoft.Xna.Framework.Color();
                    int response = (int)ResponseType.Reject;

                    if (Global.GtkMajorVersion < 3 || (Global.GtkMajorVersion == 3 && Global.GtkMinorVersion < 3))
                    {
                        var dialog = new ColorSelectionDialog("Color Chooser");
                        dialog.TransientFor = window;
                        dialog.ColorSelection.HasPalette        = true;
                        dialog.ColorSelection.HasOpacityControl = true;

                        try
                        {
                            string[] cvalues = model.GetValue(iter, 15).ToString().Replace(":", " ").Replace("}", " ").Split(' ');

                            byte red   = (byte)Convert.ToInt16(cvalues [1]);
                            byte green = (byte)Convert.ToInt16(cvalues [3]);
                            byte blue  = (byte)Convert.ToInt16(cvalues [5]);
                            int  alpha = Convert.ToInt32(cvalues [7]);

                            dialog.ColorSelection.CurrentColor = new Gdk.Color(red, green, blue);
                            dialog.ColorSelection.CurrentAlpha = (ushort)(alpha * 257);
                        }
                        catch { }

                        response = dialog.Run();

                        col.R = (byte)Convert.ToInt32(dialog.ColorSelection.CurrentColor.Red);
                        col.G = (byte)Convert.ToInt32(dialog.ColorSelection.CurrentColor.Green);
                        col.B = (byte)Convert.ToInt32(dialog.ColorSelection.CurrentColor.Blue);
                        col.A = (byte)(dialog.ColorSelection.CurrentAlpha / 257);

                        dialog.Destroy();
                    }
                    else
                    {
                        #if LINUX
                        Gdk.RGBA rgba = new Gdk.RGBA();

                        try
                        {
                            string[] cvalues = model.GetValue(iter, 15).ToString().Replace(":", " ").Replace("}", " ").Split(' ');
                            rgba.Parse("rgba(" + cvalues [1] + "," + cvalues [3] + "," + cvalues [5] + "," + cvalues [7] + ")");
                        }
                        catch { }

                        var dialog = new ColorChooserDialog(window, "Color Chooser");
                        dialog.ColorChooser.CurrentRgba = rgba;
                        response = (int)dialog.Run();

                        rgba = dialog.ColorChooser.CurrentRgba;
                        dialog.Destroy();

                        string[] split = rgba.ToString().Split('(', ')')[1].Split(',');

                        col.R = (byte)Convert.ToInt32(split[0]);
                        col.G = (byte)Convert.ToInt32(split[1]);
                        col.B = (byte)Convert.ToInt32(split[2]);

                        if (split.Length == 4)
                        {
                            col.A = (byte)Convert.ToInt32(double.Parse(split[3]) * 255);
                        }
                        else
                        {
                            col.A = 255;
                        }
                        #endif
                    }

                    if (response == (int)ResponseType.Ok)
                    {
                        int id = Convert.ToInt32(model.GetValue(iter, 11));

                        for (int i = 0; i < eitems.Count; i++)
                        {
                            if (eitems[i].id == id)
                            {
                                if (eitems[i].eventHandler != null)
                                {
                                    var fwidget = new FalseWidget(col.ToString());
                                    eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                    model.SetValue(iter, 15, col.ToString());
                                    break;
                                }
                            }
                        }
                    }
                }
            };
            column2.PackStart(editTextCell4, false);

            var editTextCell3 = new CellRendererText();
            editTextCell3.Visible = false;
            column2.PackStart(editTextCell3, false);

            var comboCell = new CellRendererCombo();
            comboCell.TextColumn = 0;
            comboCell.IsExpanded = true;
            comboCell.Editable   = true;
            comboCell.HasEntry   = false;
            comboCell.Edited    += delegate(object o, EditedArgs args) {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected(out model, out iter))
                {
                    int id = Convert.ToInt32(model.GetValue(iter, 11));

                    for (int i = 0; i < eitems.Count; i++)
                    {
                        if (eitems[i].id == id)
                        {
                            if (eitems[i].eventHandler != null && args.NewText != null && args.NewText != "")
                            {
                                var fwidget = new FalseWidget(args.NewText);
                                eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                model.SetValue(iter, 8, args.NewText);
                                break;
                            }
                        }
                    }
                }
            };

            column2.PackStart(comboCell, false);

            var editFilePathCell = new CellRendererText();
            editFilePathCell.Editable        = true;
            editFilePathCell.EditingStarted += delegate(object o, EditingStartedArgs args) {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected(out model, out iter))
                {
                    var dialog     = new CustomFolderDialog(window, model.GetValue(iter, 17).ToString());
                    var responseid = dialog.Run();
                    var fileName   = dialog.FileName;
                    dialog.Destroy();

                    if (responseid != (int)ResponseType.Ok)
                    {
                        return;
                    }

                    int id = Convert.ToInt32(model.GetValue(iter, 11));

                    for (int i = 0; i < eitems.Count; i++)
                    {
                        if (eitems[i].id != id || eitems[i].eventHandler == null)
                        {
                            continue;
                        }

                        var fwidget = new FalseWidget(fileName);
                        eitems[i].eventHandler(fwidget, EventArgs.Empty);
                        model.SetValue(iter, 17, fileName);

                        break;
                    }
                }
            };
            column2.PackStart(editFilePathCell, false);

            treeview1.AppendColumn(column2);

            column1.AddAttribute(textCell1, "text", 0);
            column1.AddAttribute(textCell1, "visible", 1);
            column1.AddAttribute(textCell2, "text", 2);
            column1.AddAttribute(textCell2, "visible", 3);
            column2.AddAttribute(editTextCell, "text", 4);
            column2.AddAttribute(editTextCell, "visible", 5);
            column2.AddAttribute(editTextCell, "editable", 6);
            column2.AddAttribute(comboCell, "model", 7);
            column2.AddAttribute(comboCell, "text", 8);
            column2.AddAttribute(comboCell, "editable", 9);
            column2.AddAttribute(comboCell, "visible", 10);
            column1.AddAttribute(idCell, "text", 11);
            column2.AddAttribute(editTextCell2, "text", 12);
            column2.AddAttribute(editTextCell2, "visible", 13);
            column2.AddAttribute(editTextCell3, "text", 14);
            column2.AddAttribute(editTextCell4, "text", 15);
            column2.AddAttribute(editTextCell4, "visible", 16);
            column2.AddAttribute(editFilePathCell, "text", 17);
            column2.AddAttribute(editFilePathCell, "visible", 18);

            listStore       = new TreeStore(typeof(string), typeof(bool), typeof(string), typeof(bool), typeof(string), typeof(bool), typeof(bool), typeof(TreeStore), typeof(string), typeof(bool), typeof(bool), typeof(string), typeof(string), typeof(bool), typeof(string), typeof(string), typeof(bool), typeof(string), typeof(bool));
            treeview1.Model = listStore;
        }
Пример #4
0
        public PropertyGridTable ()
        {
            Build();

            items = new List<TreeItem> ();
            pitems = new List<TreeItem> ();
            eitems = new List<EventItem> ();
            nulliter = new TreeIter ();
            sortgroup = true;

            var column1 = new TreeViewColumn ();
            column1.Sizing = TreeViewColumnSizing.Fixed;
            column1.FixedWidth = 100;
            column1.Resizable = true;
            column1.Title = "Name";

            var textCell1 = new CellRendererText ();
            textCell1.Underline = Pango.Underline.Single;
            column1.PackStart (textCell1, false);

            var textCell2 = new CellRendererText ();
            column1.PackStart (textCell2, false);

            var idCell = new CellRendererText ();
            idCell.Visible = false;
            column1.PackStart (idCell, false);

            treeview1.AppendColumn (column1);

            var column2 = new TreeViewColumn ();
            column2.Sizing = TreeViewColumnSizing.Fixed;
            column2.Resizable = true;
            column2.Title = "Value";

            var editTextCell = new CellRendererText ();

            editTextCell.Edited += delegate(object o, EditedArgs args) {
                TreeModel model;
                TreeIter iter;

                if (treeview1.Selection.GetSelected (out model, out iter)) {

                    int id = Convert.ToInt32(model.GetValue(iter, 11));

                    for(int i = 0;i < eitems.Count;i++)
                    {
                        if(eitems[i].id == id)
                        {
                            if(eitems[i].eventHandler != null)
                            {
                                var fwidget = new FalseWidget(args.NewText);
                                eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                model.SetValue(iter, 4, args.NewText);
                                break;
                            }
                        }
                    }
                }
            };

            column2.PackStart (editTextCell, false);

            var editTextCell2 = new CellRendererText ();
            editTextCell2.Editable = true;
            editTextCell2.EditingStarted += delegate {
                TreeModel model;
                TreeIter iter;

                if (treeview1.Selection.GetSelected (out model, out iter)) {

                    var dialog = new CollectionEditorDialog(model.GetValue(iter, 14).ToString());
                    dialog.TransientFor = window;
                    if(dialog.Run() == (int)ResponseType.Ok)
                    {
                        int id = Convert.ToInt32(model.GetValue(iter, 11));

                        for(int i = 0;i < eitems.Count;i++)
                        {
                            if(eitems[i].id == id)
                            {
                                if(eitems[i].eventHandler != null)
                                {
                                    var fwidget = new FalseWidget(dialog.text);
                                    eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                    model.SetValue(iter, 14, dialog.text);
                                    break;
                                }
                            }
                        }
                    }
                }
            };
            column2.PackStart (editTextCell2, false);

            var editTextCell4 = new CellRendererText ();
            editTextCell4.Editable = true;
            editTextCell4.EditingStarted += delegate {
                TreeModel model;
                TreeIter iter;

                if (treeview1.Selection.GetSelected (out model, out iter)) {

                    var dialog = new ColorPickerDialog(model.GetValue(iter, 15).ToString());
                    dialog.TransientFor = window;
                    if(dialog.Run() == (int)ResponseType.Ok)
                    {
                        int id = Convert.ToInt32(model.GetValue(iter, 11));

                        for(int i = 0;i < eitems.Count;i++)
                        {
                            if(eitems[i].id == id)
                            {
                                if(eitems[i].eventHandler != null)
                                {
                                    var fwidget = new FalseWidget(dialog.data);
                                    eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                    model.SetValue(iter, 15, dialog.data);
                                    break;
                                }
                            }
                        }
                    }
                }
            };
            column2.PackStart (editTextCell4, false);

            var editTextCell3 = new CellRendererText ();
            editTextCell3.Visible = false;
            column2.PackStart (editTextCell3, false);

            var comboCell = new CellRendererCombo ();
            comboCell.TextColumn = 0;
            comboCell.IsExpanded = true;
            comboCell.Editable = true;
            comboCell.HasEntry = false;
            comboCell.Edited += delegate(object o, EditedArgs args) {
                TreeModel model;
                TreeIter iter;

                if (treeview1.Selection.GetSelected (out model, out iter)) {

                    int id = Convert.ToInt32(model.GetValue(iter, 11));

                    for(int i = 0;i < eitems.Count;i++)
                    {
                        if(eitems[i].id == id)
                        {
                            if(eitems[i].eventHandler != null && args.NewText != null && args.NewText != "")
                            {
                                var fwidget = new FalseWidget(args.NewText);
                                eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                model.SetValue(iter, 8, args.NewText);
                                break;
                            }
                        }
                    }
                }
            };

            column2.PackStart (comboCell , false);

            treeview1.AppendColumn (column2);

            column1.AddAttribute (textCell1, "text", 0);
            column1.AddAttribute (textCell1, "visible", 1);
            column1.AddAttribute (textCell2, "text", 2);
            column1.AddAttribute (textCell2, "visible", 3);
            column2.AddAttribute (editTextCell, "text", 4);
            column2.AddAttribute (editTextCell, "visible", 5);
            column2.AddAttribute (editTextCell, "editable", 6);
            column2.AddAttribute (comboCell, "model", 7);
            column2.AddAttribute (comboCell, "text", 8);
            column2.AddAttribute (comboCell, "editable", 9);
            column2.AddAttribute (comboCell, "visible", 10);
            column1.AddAttribute (idCell, "text", 11);
            column2.AddAttribute (editTextCell2, "text", 12);
            column2.AddAttribute (editTextCell2, "visible", 13);
            column2.AddAttribute (editTextCell3, "text", 14);
            column2.AddAttribute (editTextCell4, "text", 15);
            column2.AddAttribute (editTextCell4, "visible", 16);

            listStore = new TreeStore (typeof (string), typeof(bool), typeof (string), typeof(bool), typeof (string), typeof(bool), typeof(bool), typeof(TreeStore), typeof(string), typeof(bool), typeof(bool), typeof(string), typeof(string), typeof(bool), typeof(string), typeof(string), typeof(bool));
            treeview1.Model = listStore;
        }
Пример #5
0
        public PropertyGridTable()
        {
            Build();

            items     = new List <TreeItem> ();
            pitems    = new List <TreeItem> ();
            eitems    = new List <EventItem> ();
            nulliter  = new TreeIter();
            sortgroup = true;

            var column1 = new TreeViewColumn();

            column1.Sizing     = TreeViewColumnSizing.Fixed;
            column1.FixedWidth = 100;
            column1.Resizable  = true;
            column1.Title      = "Name";

            var textCell1 = new CellRendererText();

            textCell1.Underline = Pango.Underline.Single;
            column1.PackStart(textCell1, false);

            var textCell2 = new CellRendererText();

            column1.PackStart(textCell2, false);

            var idCell = new CellRendererText();

            idCell.Visible = false;
            column1.PackStart(idCell, false);

            treeview1.AppendColumn(column1);

            var column2 = new TreeViewColumn();

            column2.Sizing    = TreeViewColumnSizing.Fixed;
            column2.Resizable = true;
            column2.Title     = "Value";

            var editTextCell = new CellRendererText();

            editTextCell.Edited += delegate(object o, EditedArgs args) {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected(out model, out iter))
                {
                    int id = Convert.ToInt32(model.GetValue(iter, 11));

                    for (int i = 0; i < eitems.Count; i++)
                    {
                        if (eitems[i].id == id)
                        {
                            if (eitems[i].eventHandler != null)
                            {
                                var fwidget = new FalseWidget(args.NewText);
                                eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                model.SetValue(iter, 4, args.NewText);
                                break;
                            }
                        }
                    }
                }
            };

            column2.PackStart(editTextCell, false);

            var editTextCell2 = new CellRendererText();
            editTextCell2.Editable        = true;
            editTextCell2.EditingStarted += delegate {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected(out model, out iter))
                {
                    var dialog = new CollectionEditorDialog(model.GetValue(iter, 14).ToString(), window);
                    dialog.TransientFor = window;
                    if (dialog.Run() == (int)ResponseType.Ok)
                    {
                        int id = Convert.ToInt32(model.GetValue(iter, 11));

                        for (int i = 0; i < eitems.Count; i++)
                        {
                            if (eitems[i].id == id)
                            {
                                if (eitems[i].eventHandler != null)
                                {
                                    var fwidget = new FalseWidget(dialog.text);
                                    eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                    model.SetValue(iter, 14, dialog.text);
                                    break;
                                }
                            }
                        }
                    }
                }
            };
            column2.PackStart(editTextCell2, false);

            var editTextCell4 = new CellRendererText();
            editTextCell4.Editable        = true;
            editTextCell4.EditingStarted += delegate {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected(out model, out iter))
                {
                    var dialog = new ColorPickerDialog(model.GetValue(iter, 15).ToString());
                    dialog.TransientFor = window;
                    if (dialog.Run() == (int)ResponseType.Ok)
                    {
                        int id = Convert.ToInt32(model.GetValue(iter, 11));

                        for (int i = 0; i < eitems.Count; i++)
                        {
                            if (eitems[i].id == id)
                            {
                                if (eitems[i].eventHandler != null)
                                {
                                    var fwidget = new FalseWidget(dialog.data);
                                    eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                    model.SetValue(iter, 15, dialog.data);
                                    break;
                                }
                            }
                        }
                    }
                }
            };
            column2.PackStart(editTextCell4, false);

            var editTextCell3 = new CellRendererText();
            editTextCell3.Visible = false;
            column2.PackStart(editTextCell3, false);

            var comboCell = new CellRendererCombo();
            comboCell.TextColumn = 0;
            comboCell.IsExpanded = true;
            comboCell.Editable   = true;
            comboCell.HasEntry   = false;
            comboCell.Edited    += delegate(object o, EditedArgs args) {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected(out model, out iter))
                {
                    int id = Convert.ToInt32(model.GetValue(iter, 11));

                    for (int i = 0; i < eitems.Count; i++)
                    {
                        if (eitems[i].id == id)
                        {
                            if (eitems[i].eventHandler != null && args.NewText != null && args.NewText != "")
                            {
                                var fwidget = new FalseWidget(args.NewText);
                                eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                model.SetValue(iter, 8, args.NewText);
                                break;
                            }
                        }
                    }
                }
            };

            column2.PackStart(comboCell, false);

            var editFilePathCell = new CellRendererText();
            editFilePathCell.Editable        = true;
            editFilePathCell.EditingStarted += delegate(object o, EditingStartedArgs args) {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected(out model, out iter))
                {
                    var dialog = new FileChooserDialog("Add Content Folder",
                                                       window,
                                                       FileChooserAction.SelectFolder,
                                                       "Cancel", ResponseType.Cancel,
                                                       "Open", ResponseType.Accept);
                    dialog.SetCurrentFolder(window._controller.GetFullPath(model.GetValue(iter, 17).ToString()));

                    int    responseid = dialog.Run();
                    string fileName   = dialog.Filename;
                    dialog.Destroy();

                    if (responseid == (int)ResponseType.Accept)
                    {
                        int id = Convert.ToInt32(model.GetValue(iter, 11));

                        for (int i = 0; i < eitems.Count; i++)
                        {
                            if (eitems[i].id == id)
                            {
                                if (eitems[i].eventHandler != null)
                                {
                                    string pl = ((PipelineController)window._controller).ProjectLocation;
                                    if (!pl.EndsWith(System.IO.Path.DirectorySeparatorChar.ToString()))
                                    {
                                        pl += System.IO.Path.DirectorySeparatorChar;
                                    }

                                    Uri folderUri = new Uri(pl);
                                    Uri pathUri   = new Uri(fileName);

                                    string newpath = Uri.UnescapeDataString(folderUri.MakeRelativeUri(pathUri).ToString().Replace('/', System.IO.Path.DirectorySeparatorChar));

                                    var fwidget = new FalseWidget(newpath);
                                    eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                    model.SetValue(iter, 17, newpath);
                                    break;
                                }
                            }
                        }
                    }
                }
            };
            column2.PackStart(editFilePathCell, false);

            treeview1.AppendColumn(column2);

            column1.AddAttribute(textCell1, "text", 0);
            column1.AddAttribute(textCell1, "visible", 1);
            column1.AddAttribute(textCell2, "text", 2);
            column1.AddAttribute(textCell2, "visible", 3);
            column2.AddAttribute(editTextCell, "text", 4);
            column2.AddAttribute(editTextCell, "visible", 5);
            column2.AddAttribute(editTextCell, "editable", 6);
            column2.AddAttribute(comboCell, "model", 7);
            column2.AddAttribute(comboCell, "text", 8);
            column2.AddAttribute(comboCell, "editable", 9);
            column2.AddAttribute(comboCell, "visible", 10);
            column1.AddAttribute(idCell, "text", 11);
            column2.AddAttribute(editTextCell2, "text", 12);
            column2.AddAttribute(editTextCell2, "visible", 13);
            column2.AddAttribute(editTextCell3, "text", 14);
            column2.AddAttribute(editTextCell4, "text", 15);
            column2.AddAttribute(editTextCell4, "visible", 16);
            column2.AddAttribute(editFilePathCell, "text", 17);
            column2.AddAttribute(editFilePathCell, "visible", 18);

            listStore       = new TreeStore(typeof(string), typeof(bool), typeof(string), typeof(bool), typeof(string), typeof(bool), typeof(bool), typeof(TreeStore), typeof(string), typeof(bool), typeof(bool), typeof(string), typeof(string), typeof(bool), typeof(string), typeof(string), typeof(bool), typeof(string), typeof(bool));
            treeview1.Model = listStore;
        }
Пример #6
0
        public PropertyGridTable ()
        {
            Build();

            items = new List<TreeItem> ();
            pitems = new List<TreeItem> ();
            eitems = new List<EventItem> ();
            nulliter = new TreeIter ();
            sortgroup = true;

            var column1 = new TreeViewColumn ();
            column1.Sizing = TreeViewColumnSizing.Fixed;
            column1.FixedWidth = 100;
            column1.Resizable = true;
            column1.Title = "Name";

            var textCell1 = new CellRendererText ();
            textCell1.Underline = Pango.Underline.Single;
            column1.PackStart (textCell1, false);

            var textCell2 = new CellRendererText ();
            column1.PackStart (textCell2, false);

            var idCell = new CellRendererText ();
            idCell.Visible = false;
            column1.PackStart (idCell, false);

            treeview1.AppendColumn (column1);

            var column2 = new TreeViewColumn ();
            column2.Sizing = TreeViewColumnSizing.Fixed;
            column2.Resizable = true;
            column2.Title = "Value";

            var editTextCell = new CellRendererText ();

            editTextCell.Edited += delegate(object o, EditedArgs args) {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected (out model, out iter)) {

                    int id = Convert.ToInt32(model.GetValue(iter, 11));

                    for(int i = 0;i < eitems.Count;i++)
                    {
                        if(eitems[i].id == id)
                        {
                            if(eitems[i].eventHandler != null)
                            {
                                var fwidget = new FalseWidget(args.NewText);
                                eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                model.SetValue(iter, 4, args.NewText);
                                break;
                            }
                        }
                    }
                }
            };

            column2.PackStart (editTextCell, false);

            var editTextCell2 = new CellRendererText ();
            editTextCell2.Editable = true;
            editTextCell2.EditingStarted += delegate {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected (out model, out iter)) {

                    var dialog = new CollectionEditorDialog(window, model.GetValue(iter, 14).ToString());
                    if(dialog.Run() == (int)ResponseType.Ok)
                    {
                        int id = Convert.ToInt32(model.GetValue(iter, 11));

                        for(int i = 0;i < eitems.Count;i++)
                        {
                            if(eitems[i].id == id)
                            {
                                if(eitems[i].eventHandler != null)
                                {
                                    var fwidget = new FalseWidget(dialog.text);
                                    eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                    model.SetValue(iter, 14, dialog.text);
                                    break;
                                }
                            }
                        }
                    }
                }
            };
            column2.PackStart (editTextCell2, false);

            var editTextCell4 = new CellRendererText ();
            editTextCell4.Editable = true;
            editTextCell4.EditingStarted += delegate {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected (out model, out iter)) {
                    
                    var col = new Microsoft.Xna.Framework.Color ();
                    int response = (int)ResponseType.Reject;

                    if(Global.GtkMajorVersion < 3 || (Global.GtkMajorVersion == 3 && Global.GtkMinorVersion < 3))
                    {
                        var dialog = new ColorSelectionDialog("Color Chooser");
                        dialog.TransientFor = window;
                        dialog.ColorSelection.HasPalette = true;
                        dialog.ColorSelection.HasOpacityControl = true;

                        try
                        {
                            string[] cvalues = model.GetValue(iter, 15).ToString().Replace (":", " ").Replace("}", " ").Split (' ');

                            byte red = (byte)Convert.ToInt16 (cvalues [1]);
                            byte green = (byte)Convert.ToInt16 (cvalues [3]);
                            byte blue = (byte)Convert.ToInt16 (cvalues [5]);
                            int alpha = Convert.ToInt32(cvalues [7]);

                            dialog.ColorSelection.CurrentColor = new Gdk.Color (red, green, blue);
                            dialog.ColorSelection.CurrentAlpha = (ushort)(alpha * 257);
                        }
                        catch { }

                        response = dialog.Run();

                        col.R = (byte)Convert.ToInt32(dialog.ColorSelection.CurrentColor.Red);
                        col.G = (byte)Convert.ToInt32(dialog.ColorSelection.CurrentColor.Green);
                        col.B = (byte)Convert.ToInt32(dialog.ColorSelection.CurrentColor.Blue);
                        col.A = (byte)(dialog.ColorSelection.CurrentAlpha / 257);

                        dialog.Destroy();
                    }
                    else
                    {
                        #if LINUX
                        Gdk.RGBA rgba = new Gdk.RGBA();

                        try
                        {
                            string[] cvalues = model.GetValue(iter, 15).ToString().Replace (":", " ").Replace("}", " ").Split (' ');
                            rgba.Parse("rgba(" + cvalues [1] + "," + cvalues [3] + "," + cvalues [5] + "," + cvalues [7] + ")");
                        }
                        catch { }

                        var dialog = new ColorChooserDialog(window, "Color Chooser");
                        dialog.ColorChooser.CurrentRgba = rgba;
                        response = (int)dialog.Run();

                        rgba = dialog.ColorChooser.CurrentRgba;
                        dialog.Destroy();

                        string[] split = rgba.ToString().Split('(', ')')[1].Split(',');

                        col.R = (byte)Convert.ToInt32(split[0]);
                        col.G = (byte)Convert.ToInt32(split[1]);
                        col.B = (byte)Convert.ToInt32(split[2]);

                        if(split.Length == 4)
                            col.A = (byte)Convert.ToInt32(double.Parse(split[3]) * 255);
                        else
                            col.A = 255;
                        #endif
                    }

                    if(response == (int)ResponseType.Ok)
                    {
                        int id = Convert.ToInt32(model.GetValue(iter, 11));

                        for(int i = 0;i < eitems.Count;i++)
                        {
                            if(eitems[i].id == id)
                            {
                                if(eitems[i].eventHandler != null)
                                {
                                    var fwidget = new FalseWidget(col.ToString ());
                                    eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                    model.SetValue(iter, 15, col.ToString ());
                                    break;
                                }
                            }
                        }
                    }
                }
            };
            column2.PackStart (editTextCell4, false);

            var editTextCell3 = new CellRendererText ();
            editTextCell3.Visible = false;
            column2.PackStart (editTextCell3, false);

            var comboCell = new CellRendererCombo ();
            comboCell.TextColumn = 0;
            comboCell.IsExpanded = true;
            comboCell.Editable = true;
            comboCell.HasEntry = false;
            comboCell.Edited += delegate(object o, EditedArgs args) {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected (out model, out iter)) {

                    int id = Convert.ToInt32(model.GetValue(iter, 11));

                    for(int i = 0;i < eitems.Count;i++)
                    {
                        if(eitems[i].id == id)
                        {
                            if(eitems[i].eventHandler != null && args.NewText != null && args.NewText != "")
                            {
                                var fwidget = new FalseWidget(args.NewText);
                                eitems[i].eventHandler(fwidget, EventArgs.Empty);
                                model.SetValue(iter, 8, args.NewText);
                                break;
                            }
                        }
                    }
                }
            };

            column2.PackStart (comboCell , false);

            var editFilePathCell = new CellRendererText();
            editFilePathCell.Editable = true;
            editFilePathCell.EditingStarted += delegate(object o, EditingStartedArgs args) {
                #if GTK2
                TreeModel model;
                #elif GTK3
                ITreeModel model;
                #endif
                TreeIter iter;

                if (treeview1.Selection.GetSelected (out model, out iter)) {

                    var dialog = new CustomFolderDialog(window, model.GetValue(iter, 17).ToString());
                    var responseid = dialog.Run();
                    var fileName = dialog.FileName;
                    dialog.Destroy();

                    if(responseid != (int)ResponseType.Ok)
                        return;

                    int id = Convert.ToInt32(model.GetValue(iter, 11));

                    for(int i = 0;i < eitems.Count;i++)
                    {
                        if(eitems[i].id != id || eitems[i].eventHandler == null)
                            continue;

                        var fwidget = new FalseWidget(fileName);
                        eitems[i].eventHandler(fwidget, EventArgs.Empty);
                        model.SetValue(iter, 17, fileName);

                        break;
                    }
                }
            };
            column2.PackStart (editFilePathCell, false);

            treeview1.AppendColumn (column2);

            column1.AddAttribute (textCell1, "text", 0);
            column1.AddAttribute (textCell1, "visible", 1);
            column1.AddAttribute (textCell2, "text", 2);
            column1.AddAttribute (textCell2, "visible", 3);
            column2.AddAttribute (editTextCell, "text", 4);
            column2.AddAttribute (editTextCell, "visible", 5);
            column2.AddAttribute (editTextCell, "editable", 6);
            column2.AddAttribute (comboCell, "model", 7);
            column2.AddAttribute (comboCell, "text", 8);
            column2.AddAttribute (comboCell, "editable", 9);
            column2.AddAttribute (comboCell, "visible", 10);
            column1.AddAttribute (idCell, "text", 11);
            column2.AddAttribute (editTextCell2, "text", 12);
            column2.AddAttribute (editTextCell2, "visible", 13);
            column2.AddAttribute (editTextCell3, "text", 14);
            column2.AddAttribute (editTextCell4, "text", 15);
            column2.AddAttribute (editTextCell4, "visible", 16);
            column2.AddAttribute (editFilePathCell, "text", 17);
            column2.AddAttribute (editFilePathCell, "visible", 18);

            listStore = new TreeStore (typeof (string), typeof(bool), typeof (string), typeof(bool), typeof (string), typeof(bool), typeof(bool), typeof(TreeStore), typeof(string), typeof(bool), typeof(bool), typeof(string), typeof(string), typeof(bool), typeof(string), typeof(string), typeof(bool), typeof(string), typeof(bool));
            treeview1.Model = listStore;
        }