Ejemplo n.º 1
0
        private void CreateTags(TextBuffer buffer)
        {
            Gdk.RGBA black = new Gdk.RGBA();
            black.Parse("#000000");
            Gdk.RGBA white = new Gdk.RGBA();
            white.Parse("#ffffff");

            TextTag tag = new TextTag("off")
            {
                Weight         = Pango.Weight.Normal,
                BackgroundRgba = black,
                ForegroundRgba = white
            };

            buffer.TagTable.Add(tag);

            tag = new TextTag("on")
            {
                Weight         = Pango.Weight.Normal,
                BackgroundRgba = white,
                ForegroundRgba = black
            };
            buffer.TagTable.Add(tag);
        }
Ejemplo n.º 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) {
                #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;
        }
Ejemplo n.º 3
0
        public DebuggerWindow(string title) : base(title)
        {
            Gdk.RGBA black = new Gdk.RGBA();
            black.Parse("#000000");

            this.SetSizeRequest(640, 480);

            var hPaned = new HPaned();

            #region Disassembly Text View Setup

            disassemblyTextView = new TextView(disassemblyBuffer)
            {
                Editable  = false,
                Monospace = true
            };
            CreateTags(disassemblyBuffer);

            scrollWindow = new ScrolledWindow
            {
                BorderWidth = 5,
                ShadowType  = ShadowType.In
            };
            scrollWindow.Add(disassemblyTextView);

            hPaned.Pack1(scrollWindow, true, false);

            #endregion

            var box = new Box(Orientation.Vertical, 6);

            var buttonBox   = new Box(Orientation.Horizontal, 6);
            var pauseButton = new Button();
            pauseButton.Clicked += delegate(object obj, EventArgs args)
            {
                Program.DebugControl(Program.DebugOptions.Pause);
            };
            pauseButton.Label = "Pause";

            var stepButton = new Button();
            stepButton.Clicked += delegate(object obj, EventArgs args)
            {
                Program.DebugControl(Program.DebugOptions.Step);
            };
            stepButton.Label = "Step";
            var playButton = new Button();
            playButton.Clicked += delegate(object obj, EventArgs args)
            {
                Program.DebugControl(Program.DebugOptions.Play);
            };
            playButton.Label = "Play";
            var resetButton = new Button();
            resetButton.Clicked += delegate(object obj, EventArgs args)
            {
                Program.Reset();
            };

            resetButton.Label = "Reset";
            buttonBox.PackStart(pauseButton, false, true, 2);
            buttonBox.PackStart(stepButton, false, true, 2);
            buttonBox.PackStart(playButton, false, true, 2);
            buttonBox.PackStart(resetButton, false, true, 2);

            box.PackStart(buttonBox, false, false, 2);

            var watchLabel = new Label("Watch");

            box.PackStart(watchLabel, false, false, 2);

            watchTextView = new TextView(watchBuffer)
            {
                Editable  = false,
                Monospace = true
            };
            CreateTags(watchBuffer);

            box.PackStart(watchTextView, true, true, 2);

            hPaned.Pack2(box, false, false);

            Add(hPaned);
        }
Ejemplo n.º 4
0
        private void CreateTags(TextBuffer buffer)
        {
            Gdk.RGBA white = new Gdk.RGBA();
            white.Parse("#ffffff");

            Gdk.RGBA commentColour = new Gdk.RGBA();
            commentColour.Parse("#5b814c");

            Gdk.RGBA opCodeColour = new Gdk.RGBA();
            opCodeColour.Parse("#81331e");

            Gdk.RGBA keywordColour = new Gdk.RGBA();
            keywordColour.Parse("#F92672");
            Gdk.RGBA variableColour = new Gdk.RGBA();
            variableColour.Parse("#A6E22E");
            Gdk.RGBA constantColour = new Gdk.RGBA();
            constantColour.Parse("#AE81FF");
            Gdk.RGBA addressFgColour = new Gdk.RGBA();
            addressFgColour.Parse("#8F908A");
            Gdk.RGBA addressBgColour = new Gdk.RGBA();
            addressBgColour.Parse("#2F3129");
            Gdk.RGBA backgroundColour = new Gdk.RGBA();
            backgroundColour.Parse("#272822");

            TextTag tag = new TextTag("keyword")
            {
                Weight         = Pango.Weight.Normal,
                ForegroundRgba = keywordColour,
                BackgroundRgba = backgroundColour
            };

            buffer.TagTable.Add(tag);

            tag = new TextTag("variable")
            {
                Weight         = Pango.Weight.Normal,
                ForegroundRgba = variableColour,
                BackgroundRgba = backgroundColour
            };
            buffer.TagTable.Add(tag);

            tag = new TextTag("constant")
            {
                Weight         = Pango.Weight.Normal,
                ForegroundRgba = constantColour,
                BackgroundRgba = backgroundColour
            };
            buffer.TagTable.Add(tag);

            tag = new TextTag("address")
            {
                Weight         = Pango.Weight.Bold,
                ForegroundRgba = addressFgColour,
                BackgroundRgba = addressBgColour
            };
            buffer.TagTable.Add(tag);

            tag = new TextTag("opCode")
            {
                Weight         = Pango.Weight.Normal,
                ForegroundRgba = opCodeColour,
                BackgroundRgba = addressBgColour
            };
            buffer.TagTable.Add(tag);

            tag = new TextTag("white")
            {
                Weight         = Pango.Weight.Normal,
                ForegroundRgba = white,
                BackgroundRgba = backgroundColour
            };
            buffer.TagTable.Add(tag);


            tag = new TextTag("comment")
            {
                Weight         = Pango.Weight.Normal,
                Style          = Pango.Style.Italic,
                ForegroundRgba = commentColour,
                BackgroundRgba = backgroundColour
            };
            buffer.TagTable.Add(tag);
        }
Ejemplo n.º 5
0
        private void CreateAbout()
        {
            Gdk.RGBA white = new Gdk.RGBA();
            white.Parse("#ffffff");

            Gdk.RGBA highlight = new Gdk.RGBA();
            highlight.Parse("#a8bbcf");

            Pango.FontDescription font = StyleContext.GetFont(StateFlags.Normal);
            font.Size = 9 * 1024;

            CssProvider css_provider = new CssProvider();
            string      image_path = new string [] { SparkleUI.AssetsPath, "pixmaps", "about.png" }.Combine();

            css_provider.LoadFromData("GtkWindow {" +
                                      "background-image: url('" + image_path + "');" +
                                      "background-repeat: no-repeat;" +
                                      "background-position: left bottom;" +
                                      "}");

            StyleContext.AddProvider(css_provider, 800);

            VBox layout_vertical = new VBox(false, 0);
            HBox links_layout    = new HBox(false, 16);


            Label version = new Label()
            {
                Text   = "version " + Controller.RunningVersion,
                Xalign = 0, Xpad = 0
            };

            version.OverrideFont(font);
            version.OverrideColor(StateFlags.Normal, white);


            this.updates = new Label("Checking for updates…")
            {
                Xalign = 0, Xpad = 0
            };

            this.updates.OverrideFont(font);
            this.updates.OverrideColor(StateFlags.Normal, highlight);


            Label copyright = new Label()
            {
                Markup = string.Format("Copyright © 2010–{0} Hylke Bons and others.", DateTime.Now.Year),
                Xalign = 0, Xpad = 0
            };

            copyright.OverrideFont(font);
            copyright.OverrideColor(StateFlags.Normal, white);


            TextView   license        = new TextView();
            TextBuffer license_buffer = license.Buffer;

            license.WrapMode  = WrapMode.Word;
            license.Sensitive = false;

            license_buffer.Text = "SparkleShare is Open Source and you’re free to use, change, " +
                                  "and share it under the GNU GPLv3.";

            license.OverrideBackgroundColor(StateFlags.Normal, new Gdk.RGBA()
            {
                Alpha = 0
            });
            license.OverrideFont(font);
            license.OverrideColor(StateFlags.Normal, white);


            SparkleLink website_link        = new SparkleLink("Website", Controller.WebsiteLinkAddress);
            SparkleLink credits_link        = new SparkleLink("Credits", Controller.CreditsLinkAddress);
            SparkleLink report_problem_link = new SparkleLink("Report a problem", Controller.ReportProblemLinkAddress);
            SparkleLink debug_log_link      = new SparkleLink("Debug log", Controller.DebugLogLinkAddress);


            layout_vertical.PackStart(new Label(""), true, true, 0);
            layout_vertical.PackStart(version, false, false, 0);
            layout_vertical.PackStart(this.updates, false, false, 0);
            layout_vertical.PackStart(copyright, false, false, 6);
            layout_vertical.PackStart(license, false, false, 6);
            layout_vertical.PackStart(links_layout, false, false, 16);

            links_layout.PackStart(website_link, false, false, 0);
            links_layout.PackStart(credits_link, false, false, 0);
            links_layout.PackStart(report_problem_link, false, false, 0);
            links_layout.PackStart(debug_log_link, false, false, 0);

            HBox layout_horizontal = new HBox(false, 0);

            layout_horizontal.PackStart(new Label(""), false, false, 149);
            layout_horizontal.PackStart(layout_vertical, false, false, 0);

            Add(layout_horizontal);
        }
Ejemplo n.º 6
0
        private void CreateAbout ()
        {
            Gdk.RGBA white = new Gdk.RGBA ();
            white.Parse ("#ffffff");

            Gdk.RGBA highlight = new Gdk.RGBA ();
            highlight.Parse ("#a8bbcf");

            Pango.FontDescription font = StyleContext.GetFont (StateFlags.Normal);
            font.Size = 9 * 1024;

            CssProvider css_provider = new CssProvider ();
            string image_path        = new string [] { SparkleUI.AssetsPath, "pixmaps", "about.png" }.Combine ();

            css_provider.LoadFromData ("GtkWindow {" +
                "background-image: url('" + image_path + "');" +
                "background-repeat: no-repeat;" +
                "background-position: left bottom;" +
                "}");
            
            StyleContext.AddProvider (css_provider, 800);

            VBox layout_vertical = new VBox (false, 0);            
            HBox links_layout = new HBox (false, 16);


            Label version = new Label () {
                Text   = "version " + Controller.RunningVersion,
                Xalign = 0, Xpad   = 0
            };

            version.OverrideFont (font);
            version.OverrideColor (StateFlags.Normal, white);


            this.updates = new Label ("Checking for updates…") {
                Xalign = 0, Xpad = 0
            };

            this.updates.OverrideFont (font);
            this.updates.OverrideColor (StateFlags.Normal, highlight);


            Label copyright = new Label () {
                Markup = string.Format ("Copyright © 2010–{0} Hylke Bons and others.", DateTime.Now.Year),
                Xalign = 0, Xpad   = 0
            };

            copyright.OverrideFont (font);
            copyright.OverrideColor (StateFlags.Normal, white);


            TextView license          = new TextView ();
            TextBuffer license_buffer = license.Buffer;
            license.WrapMode          = WrapMode.Word;
            license.Sensitive         = false;

            license_buffer.Text = "SparkleShare is Open Source and you’re free to use, change, " +
                "and share it under the GNU GPLv3.";

            license.OverrideBackgroundColor (StateFlags.Normal, new Gdk.RGBA () { Alpha = 0 });
            license.OverrideFont (font);
            license.OverrideColor (StateFlags.Normal, white);

            
            SparkleLink website_link        = new SparkleLink ("Website", Controller.WebsiteLinkAddress);
            SparkleLink credits_link        = new SparkleLink ("Credits", Controller.CreditsLinkAddress);
            SparkleLink report_problem_link = new SparkleLink ("Report a problem", Controller.ReportProblemLinkAddress);
            SparkleLink debug_log_link      = new SparkleLink ("Debug log", Controller.DebugLogLinkAddress);


            layout_vertical.PackStart (new Label (""), true, true, 0);            
            layout_vertical.PackStart (version, false, false, 0);
            layout_vertical.PackStart (this.updates, false, false, 0);
            layout_vertical.PackStart (copyright, false, false, 6);
            layout_vertical.PackStart (license, false, false, 6);
            layout_vertical.PackStart (links_layout, false, false, 16);

            links_layout.PackStart (website_link, false, false, 0);
            links_layout.PackStart (credits_link, false, false, 0);
            links_layout.PackStart (report_problem_link, false, false, 0);
            links_layout.PackStart (debug_log_link, false, false, 0);
            
            HBox layout_horizontal = new HBox (false, 0);
            layout_horizontal.PackStart (new Label (""), false, false, 149);
            layout_horizontal.PackStart (layout_vertical, false, false, 0);

            Add (layout_horizontal);
        }
Ejemplo n.º 7
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;
        }