Gtk.Widget IOutlinedDocument.GetOutlineWidget()
        {
            if (outlineTreeView != null)
            {
                return(outlineTreeView);
            }

            outlineTreeStore          = new Gtk.TreeStore(typeof(string), typeof(Gdk.Color), typeof(Mono.TextTemplating.ISegment));
            outlineTreeView           = new MonoDevelop.Ide.Gui.Components.PadTreeView(outlineTreeStore);
            outlineTreeView.Realized += delegate { RefillOutlineStore(); };

            outlineTreeView.TextRenderer.Xpad = 0;
            outlineTreeView.TextRenderer.Ypad = 0;
            outlineTreeView.AppendColumn("Node", outlineTreeView.TextRenderer, "text", 0, "foreground-gdk", 1);

            outlineTreeView.HeadersVisible = false;

            outlineTreeView.Selection.Changed += delegate {
                Gtk.TreeIter iter;
                if (!outlineTreeView.Selection.GetSelected(out iter))
                {
                    return;
                }
                SelectSegment((Mono.TextTemplating.ISegment)outlineTreeStore.GetValue(iter, 2));
            };

            RefillOutlineStore();
            var sw = new MonoDevelop.Components.CompactScrolledWindow();;

            sw.Add(outlineTreeView);
            sw.ShowAll();
            return(sw);
        }
Exemplo n.º 2
0
        public TestResultsPad()
        {
            testService.TestSuiteChanged += new EventHandler(OnTestSuiteChanged);

            panel = new VBox();

            // Results notebook

            book = new HPaned();
            panel.PackStart(book, true, true, 0);
            panel.FocusChain = new Gtk.Widget [] { book };

            // Failures tree
            failuresTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView();
            failuresTreeView.HeadersVisible = false;
            failuresStore = new TreeStore(typeof(Pixbuf), typeof(string), typeof(object), typeof(string), typeof(int));
            var pr = new CellRendererPixbuf();
            CellRendererText tr  = new CellRendererText();
            TreeViewColumn   col = new TreeViewColumn();

            col.PackStart(pr, false);
            col.AddAttribute(pr, "pixbuf", 0);
            col.PackStart(tr, false);
            col.AddAttribute(tr, "markup", 1);
            failuresTreeView.AppendColumn(col);
            failuresTreeView.Model = failuresStore;

            var sw = new MonoDevelop.Components.CompactScrolledWindow();

            sw.ShadowType = ShadowType.None;
            sw.Add(failuresTreeView);
            book.Pack1(sw, true, true);

            outputView          = new MonoDevelop.Ide.Gui.Components.LogView.LogTextView();
            outputView.Editable = false;
            bold        = new TextTag("bold");
            bold.Weight = Pango.Weight.Bold;
            outputView.Buffer.TagTable.Add(bold);
            sw            = new MonoDevelop.Components.CompactScrolledWindow();
            sw.ShadowType = ShadowType.None;
            sw.Add(outputView);
            book.Pack2(sw, true, true);
            outputViewScrolled = sw;

            failuresTreeView.RowActivated      += OnRowActivated;
            failuresTreeView.Selection.Changed += OnRowSelected;
            failuresTreeView.DoPopupMenu        = delegate(EventButton evt) {
                IdeApp.CommandService.ShowContextMenu(failuresTreeView, evt,
                                                      "/MonoDevelop/NUnit/ContextMenu/TestResultsPad");
            };

            Control.ShowAll();

            outputViewScrolled.Hide();
        }
Exemplo n.º 3
0
        Gtk.Widget IOutlinedDocument.GetOutlineWidget()
        {
            if (outlineTreeView != null)
            {
                return(outlineTreeView);
            }

            outlineTreeStore = new Gtk.TreeStore(typeof(object));
            outlineTreeView  = new MonoDevelop.Ide.Gui.Components.PadTreeView(outlineTreeStore);

            System.Reflection.PropertyInfo prop = typeof(Gtk.TreeView).GetProperty("EnableTreeLines");
            if (prop != null)
            {
                prop.SetValue(outlineTreeView, true, null);
            }

            outlineTreeView.Realized += delegate { refillOutlineStore(); };

            InitializeOutlineColumns(outlineTreeView);

            outlineTreeView.HeadersVisible = false;

            outlineTreeView.Selection.Changed += delegate {
                Gtk.TreeIter iter;
                if (!outlineTreeView.Selection.GetSelected(out iter))
                {
                    return;
                }
                OutlineSelectionChanged(outlineTreeStore.GetValue(iter, 0));
            };

            refillOutlineStore();

            var sw = new MonoDevelop.Components.CompactScrolledWindow();

            sw.Add(outlineTreeView);
            sw.ShowAll();
            return(sw);
        }
Exemplo n.º 4
0
        Widget IOutlinedDocument.GetOutlineWidget()
        {
            if (outlineView != null)
            {
                return(outlineView);
            }

            if (outlineStore == null)
            {
                throw new Exception("The treestore should be built, before initializing the TreeView of the DocumentOutline");
            }

            outlineView = new MonoDevelop.Ide.Gui.Components.PadTreeView(outlineStore);
            System.Reflection.PropertyInfo prop = typeof(Gtk.TreeView).GetProperty("EnableTreeLines");
            if (prop != null)
            {
                prop.SetValue(outlineView, true, null);
            }
            outlineView.TextRenderer.Xpad = 0;
            outlineView.TextRenderer.Ypad = 0;
            outlineView.ExpandAll();
            outlineView.AppendColumn("Node", outlineView.TextRenderer, new Gtk.TreeCellDataFunc(OutlineTreeDataFunc));
            outlineView.HeadersVisible     = false;
            outlineView.Selection.Changed += delegate {
                Gtk.TreeIter iter = Gtk.TreeIter.Zero;
                outlineView.Selection.GetSelected(out iter);
                DocumentOutlineSelectionChanged(outlineStore.GetValue(iter, 0) as XNode);
            };

            var sw = new MonoDevelop.Components.CompactScrolledWindow();

            sw.Add(outlineView);
            sw.ShowAll();

            return(sw);
        }
Exemplo n.º 5
0
		Gtk.Widget IOutlinedDocument.GetOutlineWidget ()
		{
			if (outlineTreeView != null)
				return outlineTreeView;
			
			outlineTreeStore = new Gtk.TreeStore (typeof(string), typeof (Gdk.Color), typeof (Mono.TextTemplating.ISegment));
			outlineTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView (outlineTreeStore);
			outlineTreeView.Realized += delegate { RefillOutlineStore (); };
			
			outlineTreeView.TextRenderer.Xpad = 0;
			outlineTreeView.TextRenderer.Ypad = 0;
			outlineTreeView.AppendColumn ("Node", outlineTreeView.TextRenderer, "text", 0, "foreground-gdk", 1);
			
			outlineTreeView.HeadersVisible = false;
			
			outlineTreeView.Selection.Changed += delegate {
				Gtk.TreeIter iter;
				if (!outlineTreeView.Selection.GetSelected (out iter))
					return;
				SelectSegment ((Mono.TextTemplating.ISegment )outlineTreeStore.GetValue (iter, 2));
			};
			
			RefillOutlineStore ();
			var sw = new MonoDevelop.Components.CompactScrolledWindow ();;
			sw.Add (outlineTreeView);
			sw.ShowAll ();
			return sw;
		}
Exemplo n.º 6
0
		public TestResultsPad ()
		{
			testService.TestSuiteChanged += new EventHandler (OnTestSuiteChanged);
			
			panel = new VBox ();
			
			// Results notebook
			
			book = new HPaned ();
			panel.PackStart (book, true, true, 0);
			panel.FocusChain = new Gtk.Widget [] { book };
			
			// Failures tree
			failuresTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView ();
			failuresTreeView.HeadersVisible = false;
			failuresStore = new TreeStore (typeof(Pixbuf), typeof(string), typeof(object), typeof(string), typeof(int));
			var pr = new CellRendererPixbuf ();
			CellRendererText tr = new CellRendererText ();
			TreeViewColumn col = new TreeViewColumn ();
			col.PackStart (pr, false);
			col.AddAttribute (pr, "pixbuf", 0);
			col.PackStart (tr, false);
			col.AddAttribute (tr, "markup", 1);
			failuresTreeView.AppendColumn (col);
			failuresTreeView.Model = failuresStore;
		
			var sw = new MonoDevelop.Components.CompactScrolledWindow ();
			sw.ShadowType = ShadowType.None;
			sw.Add (failuresTreeView);
			book.Pack1 (sw, true, true);
			
			outputView = new TextView ();
			outputView.Editable = false;
			bold = new TextTag ("bold");
			bold.Weight = Pango.Weight.Bold;
			outputView.Buffer.TagTable.Add (bold);
			sw = new MonoDevelop.Components.CompactScrolledWindow ();
			sw.ShadowType = ShadowType.None;
			sw.Add (outputView);
			book.Pack2 (sw, true, true);
			outputViewScrolled = sw;
			
			failuresTreeView.RowActivated += OnRowActivated;
			failuresTreeView.Selection.Changed += OnRowSelected;
			failuresTreeView.DoPopupMenu = delegate (EventButton evt) {
				IdeApp.CommandService.ShowContextMenu (failuresTreeView, evt,
					"/MonoDevelop/NUnit/ContextMenu/TestResultsPad");
			};
			
			Control.ShowAll ();
			
			outputViewScrolled.Hide ();
		}
Exemplo n.º 7
0
		Widget IOutlinedDocument.GetOutlineWidget ()
		{
			if (outlineView != null)
				return outlineView;
				
			if (outlineStore == null)
				throw new Exception ("The treestore should be built, before initializing the TreeView of the DocumentOutline");
			
			outlineView = new MonoDevelop.Ide.Gui.Components.PadTreeView (outlineStore);
			System.Reflection.PropertyInfo prop = typeof(Gtk.TreeView).GetProperty ("EnableTreeLines");
			if (prop != null)
				prop.SetValue (outlineView, true, null);
			outlineView.TextRenderer.Xpad = 0;
			outlineView.TextRenderer.Ypad = 0;
			outlineView.ExpandAll ();
			outlineView.AppendColumn ("Node", outlineView.TextRenderer, new Gtk.TreeCellDataFunc (OutlineTreeDataFunc));
			outlineView.HeadersVisible = false;
			outlineView.Selection.Changed += delegate {
				Gtk.TreeIter iter = Gtk.TreeIter.Zero;
				outlineView.Selection.GetSelected (out iter);
				DocumentOutlineSelectionChanged (outlineStore.GetValue (iter, 0) as XNode);
			};
			
			var sw = new MonoDevelop.Components.CompactScrolledWindow ();
			sw.Add (outlineView);
			sw.ShowAll ();
				
			return sw;
		}
		Gtk.Widget IOutlinedDocument.GetOutlineWidget ()
		{
			if (outlineTreeView != null)
				return outlineTreeView;
			
			outlineTreeStore = new Gtk.TreeStore (typeof (object));
			outlineTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView (outlineTreeStore);
			
			System.Reflection.PropertyInfo prop = typeof (Gtk.TreeView).GetProperty ("EnableTreeLines");
			if (prop != null)
				prop.SetValue (outlineTreeView, true, null);
			
			outlineTreeView.Realized += delegate { refillOutlineStore (); };
			
			InitializeOutlineColumns (outlineTreeView);
			
			outlineTreeView.HeadersVisible = false;
			
			outlineTreeView.Selection.Changed += delegate {
				Gtk.TreeIter iter;
				if (!outlineTreeView.Selection.GetSelected (out iter))
					return;
				OutlineSelectionChanged (outlineTreeStore.GetValue (iter, 0));
			};
			
			refillOutlineStore ();
			
			var sw = new MonoDevelop.Components.CompactScrolledWindow ();
			sw.Add (outlineTreeView);
			sw.ShowAll ();
			return sw;
		}