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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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;
		}
Ejemplo n.º 5
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;
		}