public PinnedWatchWidget (TextEditor editor, PinnedWatch watch)
		{
			objectValue = watch.Value;
			Editor = editor;
			Watch = watch;

			valueTree = new ObjectValueTreeView ();
			valueTree.AllowAdding = false;
			valueTree.AllowEditing = true;
			valueTree.AllowPinning = true;
			valueTree.HeadersVisible = false;
			valueTree.CompactView = true;
			valueTree.PinnedWatch = watch;
			if (objectValue != null)
				valueTree.AddValue (objectValue);
			
			valueTree.ButtonPressEvent += HandleValueTreeButtonPressEvent;
			valueTree.ButtonReleaseEvent += HandleValueTreeButtonReleaseEvent;
			valueTree.MotionNotifyEvent += HandleValueTreeMotionNotifyEvent;
			
			Gtk.Frame fr = new Gtk.Frame ();
			fr.ShadowType = Gtk.ShadowType.Out;
			fr.Add (valueTree);
			Add (fr);
			HandleEditorOptionsChanged (null, null);
			ShowAll ();
			//unpin.Hide ();
			Editor.EditorOptionsChanged += HandleEditorOptionsChanged;
			
			DebuggingService.PausedEvent += HandleDebuggingServicePausedEvent;
			DebuggingService.ResumedEvent += HandleDebuggingServiceResumedEvent;
		}
示例#2
0
        public static void SetLiveUpdateMode(PinnedWatch watch, bool liveUpdate)
        {
            if (watch.LiveUpdate == liveUpdate)
            {
                return;
            }

            watch.LiveUpdate = liveUpdate;
            if (liveUpdate)
            {
                var bp = new Breakpoint(watch.File, watch.Line);
                bp.TraceExpression   = "{" + watch.Expression + "}";
                bp.HitAction         = HitAction.PrintExpression;
                bp.NonUserBreakpoint = true;
                lock (breakpoints)
                    breakpoints.Add(bp);
                pinnedWatches.Bind(watch, bp);
            }
            else
            {
                pinnedWatches.Bind(watch, null);
                lock (breakpoints)
                    breakpoints.Remove(watch.BoundTracer);
            }
        }
        void CreatePinnedWatch(TreeIter it)
        {
            string exp = GetFullExpression(it);

            PinnedWatch watch = new PinnedWatch();

            if (PinnedWatch != null)
            {
                CollapseAll();
                watch.File    = PinnedWatch.File;
                watch.Line    = PinnedWatch.Line;
                watch.OffsetX = PinnedWatch.OffsetX;
                watch.OffsetY = PinnedWatch.OffsetY + SizeRequest().Height + 5;
            }
            else
            {
                watch.File    = PinnedWatchFile;
                watch.Line    = PinnedWatchLine;
                watch.OffsetX = -1;                 // means that the watch should be placed at the line coordinates defined by watch.Line
                watch.OffsetY = -1;
            }
            watch.Expression = exp;
            DebuggingService.PinnedWatches.Add(watch);
            if (PinStatusChanged != null)
            {
                PinStatusChanged(this, EventArgs.Empty);
            }
        }
示例#4
0
//		PinWindow pinWindow;
//		TreeIter currentPinIter;
		
		public DebugValueWindow (Mono.TextEditor.TextEditor editor, int offset, StackFrame frame, ObjectValue value, PinnedWatch watch): base (Gtk.WindowType.Toplevel)
		{
			this.TypeHint = WindowTypeHint.PopupMenu;
			this.AllowShrink = false;
			this.AllowGrow = false;
			this.Decorated = false;

			TransientFor = (Gtk.Window) editor.Toplevel;
			
			// Avoid getting the focus when the window is shown. We'll get it when the mouse enters the window
			AcceptFocus = false;
			
			sw = new ScrolledWindow ();
			sw.HscrollbarPolicy = PolicyType.Never;
			sw.VscrollbarPolicy = PolicyType.Never;
			
			tree = new ObjectValueTreeView ();
			sw.Add (tree);
			ContentBox.Add (sw);
			
			tree.Frame = frame;
			tree.CompactView = true;
			tree.AllowAdding = false;
			tree.AllowEditing = true;
			tree.HeadersVisible = false;
			tree.AllowPinning = true;
			tree.RootPinAlwaysVisible = true;
			tree.PinnedWatch = watch;
			DocumentLocation location = editor.Document.OffsetToLocation (offset);
			tree.PinnedWatchLine = location.Line;
			tree.PinnedWatchFile = ((ExtensibleTextEditor)editor).View.ContentName;
			
			tree.AddValue (value);
			tree.Selection.UnselectAll ();
			tree.SizeAllocated += OnTreeSizeChanged;
			tree.PinStatusChanged += delegate {
				Destroy ();
			};
			
//			tree.MotionNotifyEvent += HandleTreeMotionNotifyEvent;
			
			sw.ShowAll ();
			
//			pinWindow = new PinWindow (this);
//			pinWindow.SetPinned (false);
//			pinWindow.ButtonPressEvent += HandlePinWindowButtonPressEvent;
			
			tree.StartEditing += delegate {
				Modal = true;
			};
			
			tree.EndEditing += delegate {
				Modal = false;
			};

			ShowArrow = true;
			Theme.CornerRadius = 3;
		}
示例#5
0
        internal Breakpoint CreateLiveUpdateBreakpoint(PinnedWatch watch)
        {
            var bp = new Breakpoint(watch.File, watch.Line);

            bp.TraceExpression   = "{" + watch.Expression + "}";
            bp.HitAction         = HitAction.PrintExpression;
            bp.NonUserBreakpoint = true;
            return(bp);
        }
		public void Remove (PinnedWatch watch)
		{
			lock (watches) {
				if (watch.Store != this)
					return;
				watch.Store = null;
				watches.Remove (watch);
			}
			OnWatchRemoved (watch);
			OnChanged ();
		}
		public void Add (PinnedWatch watch)
		{
			lock (watches) {
				if (watch.Store != null)
					throw new InvalidOperationException ("Watch already belongs to another store");
				watch.Store = this;
				watches.Add (watch);
			}
			OnWatchAdded (watch);
			OnChanged ();
		}
示例#8
0
 public void Add(PinnedWatch watch)
 {
     lock (watches) {
         if (watch.Store != null)
         {
             throw new InvalidOperationException("Watch already belongs to another store");
         }
         watch.Store = this;
         watches.Add(watch);
     }
     OnWatchAdded(watch);
     OnChanged();
 }
示例#9
0
 public void Remove(PinnedWatch watch)
 {
     lock (watches) {
         if (watch.Store != this)
         {
             return;
         }
         watch.Store = null;
         watches.Remove(watch);
     }
     OnWatchRemoved(watch);
     OnChanged();
 }
示例#10
0
		internal void Bind (PinnedWatch watch, Breakpoint be)
		{
			lock (watches) {
				if (be == null) {
					if (watch.BoundTracer != null)
						liveWatches.Remove (watch.BoundTracer);
					watch.LiveUpdate = false;
				} else {
					watch.BoundTracer = be;
					liveWatches [be] = watch;
					watch.LiveUpdate = true;
				}
			}
		}
		public DebugValueWindow (TextEditor editor, int offset, StackFrame frame, ObjectValue value, PinnedWatch watch) : base (Gtk.WindowType.Toplevel)
		{
			this.TypeHint = WindowTypeHint.PopupMenu;
			this.AllowShrink = false;
			this.AllowGrow = false;
			this.Decorated = false;

			TransientFor = (Gtk.Window) ((Gtk.Widget)editor).Toplevel;
			// Avoid getting the focus when the window is shown. We'll get it when the mouse enters the window
			AcceptFocus = false;

			sw = new ScrolledWindow ();
			sw.HscrollbarPolicy = PolicyType.Never;
			sw.VscrollbarPolicy = PolicyType.Never;

			tree = new ObjectValueTreeView ();
			sw.Add (tree);
			ContentBox.Add (sw);

			tree.Frame = frame;
			tree.CompactView = true;
			tree.AllowAdding = false;
			tree.AllowEditing = true;
			tree.HeadersVisible = false;
			tree.AllowPinning = true;
			tree.RootPinAlwaysVisible = true;
			tree.PinnedWatch = watch;
			var location = editor.OffsetToLocation (offset);
			tree.PinnedWatchLine = location.Line;
			tree.PinnedWatchFile = editor.FileName;

			tree.AddValue (value);
			tree.Selection.UnselectAll ();
			tree.SizeAllocated += OnTreeSizeChanged;
			tree.PinStatusChanged += OnPinStatusChanged;

			sw.ShowAll ();

			tree.StartEditing += OnStartEditing;
			tree.EndEditing += OnEndEditing;

			ShowArrow = true;
			Theme.CornerRadius = 3;
		}
		public DebugValueWindow (Mono.TextEditor.TextEditor editor, int offset, StackFrame frame, ObjectValue value, PinnedWatch watch)
		{
			TransientFor = (Gtk.Window) editor.Toplevel;
			
			// Avoid getting the focus when the window is shown. We'll get it when the mouse enters the window
			AcceptFocus = false;
			
			sw = new ScrolledWindow ();
			sw.HscrollbarPolicy = PolicyType.Never;
			sw.VscrollbarPolicy = PolicyType.Never;
			
			tree = new ObjectValueTreeView ();
			sw.Add (tree);
			Add (sw);
			
			tree.Frame = frame;
			tree.CompactView = true;
			tree.AllowAdding = false;
			tree.AllowEditing = true;
			tree.HeadersVisible = false;
			tree.AllowPinning = true;
			tree.PinnedWatch = watch;
			DocumentLocation location = editor.Document.OffsetToLocation (offset);
			tree.PinnedWatchLine = location.Line + 1;
			tree.PinnedWatchFile = ((ExtensibleTextEditor)editor).View.ContentName;
			
			tree.AddValue (value);
			tree.Selection.UnselectAll ();
			tree.SizeAllocated += OnTreeSizeChanged;
			tree.PinStatusChanged += delegate {
				Destroy ();
			};
			
			sw.ShowAll ();
			
			tree.StartEditing += delegate {
				Modal = true;
			};
			
			tree.EndEditing += delegate {
				Modal = false;
			};
		}
示例#13
0
 internal void Bind(PinnedWatch watch, Breakpoint be)
 {
     lock (watches) {
         if (be == null)
         {
             if (watch.BoundTracer != null)
             {
                 liveWatches.Remove(watch.BoundTracer);
             }
             watch.LiveUpdate = false;
         }
         else
         {
             watch.BoundTracer = be;
             liveWatches [be]  = watch;
             watch.LiveUpdate  = true;
         }
     }
 }
示例#14
0
 void OnWatchRemoved(PinnedWatch watch)
 {
     if (batchUpdate > 0)
     {
         if (batchRemoved == null)
         {
             batchRemoved = new List <PinnedWatch> ();
         }
         if (!batchRemoved.Contains(watch))
         {
             batchRemoved.Add(watch);
         }
         return;
     }
     if (WatchRemoved != null)
     {
         WatchRemoved(this, new PinnedWatchEventArgs(watch));
     }
 }
示例#15
0
 void OnWatchChanged(PinnedWatch watch)
 {
     if (batchUpdate > 0)
     {
         if (batchChanged == null)
         {
             batchChanged = new List <PinnedWatch> ();
         }
         if (!batchChanged.Contains(watch))
         {
             batchChanged.Add(watch);
         }
         return;
     }
     Runtime.RunInMainThread(() => {
         if (WatchChanged != null)
         {
             WatchChanged(this, new PinnedWatchEventArgs(watch));
         }
     });
 }
 void OnWatchChanged(PinnedWatch watch)
 {
     if (batchUpdate > 0)
     {
         if (batchChanged == null)
         {
             batchChanged = new List <PinnedWatch> ();
         }
         if (!batchChanged.Contains(watch))
         {
             batchChanged.Add(watch);
         }
         return;
     }
     DispatchService.GuiDispatch(() => {
         if (WatchChanged != null)
         {
             WatchChanged(this, new PinnedWatchEventArgs(watch));
         }
     });
 }
示例#17
0
		public PinnedWatchWidget (TextEditor editor, PinnedWatch watch)
		{
			objectValue = watch.Value;
			Editor = editor;
			Watch = watch;

			valueTree = new ObjectValueTreeView ();
			valueTree.AllowAdding = false;
			valueTree.AllowEditing = true;
			valueTree.AllowPinning = true;
			valueTree.HeadersVisible = false;
			valueTree.CompactView = true;
			valueTree.PinnedWatch = watch;
			if (objectValue != null)
				valueTree.AddValue (objectValue);
			
			valueTree.ButtonPressEvent += HandleValueTreeButtonPressEvent;
			valueTree.ButtonReleaseEvent += HandleValueTreeButtonReleaseEvent;
			valueTree.MotionNotifyEvent += HandleValueTreeMotionNotifyEvent;
			valueTree.SizeAllocated += OnTreeSizeChanged;

			sw = new ScrolledWindow ();
			sw.HscrollbarPolicy = PolicyType.Never;
			sw.VscrollbarPolicy = PolicyType.Never;
			sw.Add (valueTree);

			Frame fr = new Frame ();
			fr.ShadowType = ShadowType.Out;
			fr.Add (sw);
			Add (fr);

			ShowAll ();
			
			DebuggingService.PausedEvent += HandleDebuggingServicePausedEvent;
			DebuggingService.ResumedEvent += HandleDebuggingServiceResumedEvent;
		}
示例#18
0
		public PinnedWatchEventArgs (PinnedWatch watch)
		{
			this.watch = watch;
		}
		void OnWatchChanged (PinnedWatch watch)
		{
			if (batchUpdate > 0) {
				if (batchChanged == null)
					batchChanged = new List<PinnedWatch> ();
				if (!batchChanged.Contains (watch))
					batchChanged.Add (watch);
				return;
			}
			Runtime.RunInMainThread (() => {
				if (WatchChanged != null)
					WatchChanged (this, new PinnedWatchEventArgs (watch));
			});
		}
示例#20
0
 public PinnedWatchEventArgs(PinnedWatch watch)
 {
     this.watch = watch;
 }
示例#21
0
 internal void NotifyWatchChanged(PinnedWatch watch)
 {
     OnWatchChanged(watch);
     OnChanged();
 }
示例#22
0
        public DebugValueWindow(Gtk.Window transientFor, PinnedWatchLocation location, StackFrame frame, ObjectValue value, PinnedWatch watch) : base(Gtk.WindowType.Toplevel)
        {
            TypeHint    = WindowTypeHint.PopupMenu;
            AllowShrink = false;
            AllowGrow   = false;
            Decorated   = false;

            TransientFor = transientFor;
            // Avoid getting the focus when the window is shown. We'll get it when the mouse enters the window
            AcceptFocus = false;

            sw = new ScrolledWindow {
                HscrollbarPolicy = PolicyType.Never,
                VscrollbarPolicy = PolicyType.Never
            };

            UpdateTreeStyle(Theme.BackgroundColor);

            if (useNewTreeView)
            {
                controller = new ObjectValueTreeViewController();
                controller.SetStackFrame(frame);
                controller.AllowEditing        = true;
                controller.PinnedWatch         = watch;
                controller.PinnedWatchLocation = location;

                treeView = controller.GetGtkControl(headersVisible: false, allowPinning: true, compactView: true, rootPinVisible: true);

                if (treeView is IObjectValueTreeView ovtv)
                {
                    ovtv.StartEditing += OnStartEditing;
                    ovtv.EndEditing   += OnEndEditing;
                    ovtv.NodePinned   += OnPinStatusChanged;
                }

                controller.AddValue(value);
            }
            else
            {
                objValueTreeView = new ObjectValueTreeView();
                objValueTreeView.RootPinAlwaysVisible = true;
                objValueTreeView.HeadersVisible       = false;
                objValueTreeView.AllowEditing         = true;
                objValueTreeView.AllowPinning         = true;
                objValueTreeView.CompactView          = true;
                objValueTreeView.PinnedWatch          = watch;
                objValueTreeView.PinnedWatchLocation  = location;
                objValueTreeView.Frame = frame;

                objValueTreeView.AddValue(value);

                objValueTreeView.PinStatusChanged += OnPinStatusChanged;
                objValueTreeView.StartEditing     += OnStartEditing;
                objValueTreeView.EndEditing       += OnEndEditing;

                treeView = objValueTreeView;
            }

            treeView.Name = innerTreeName;
            treeView.Selection.UnselectAll();
            treeView.SizeAllocated += OnTreeSizeChanged;

            sw.Add(treeView);
            ContentBox.Add(sw);
            sw.ShowAll();

            ShowArrow          = true;
            Theme.CornerRadius = 3;
            PreviewWindowManager.WindowClosed += PreviewWindowManager_WindowClosed;
        }
        public MacDebuggerTooltipWindow(PinnedWatchLocation location, StackFrame frame, ObjectValue value, PinnedWatch watch)
        {
            Animates = false;
            Behavior = NSPopoverBehavior.Semitransient;

            controller = new ObjectValueTreeViewController();
            controller.SetStackFrame(frame);
            controller.AllowEditing        = true;
            controller.PinnedWatch         = watch;
            controller.PinnedWatchLocation = location;

            treeView = controller.GetMacControl(ObjectValueTreeViewFlags.TooltipFlags);
            treeView.UIElementName = "Tooltip";
            treeView.NodePinned   += OnPinStatusChanged;
            treeView.StartEditing += OnStartEditing;
            treeView.EndEditing   += OnEndEditing;
            controller.AddValue(value);

            scrollView = new NSScrollView {
                HasVerticalScroller = true,
                AutohidesScrollers  = true,
                DocumentView        = treeView,
                Frame = treeView.Frame
            };

            ContentViewController = new NSViewController {
                View = scrollView
            };

            widthConstraint        = scrollView.WidthAnchor.ConstraintEqualToConstant(treeView.Frame.Width);
            widthConstraint.Active = true;

            heightConstraint        = scrollView.HeightAnchor.ConstraintEqualToConstant(treeView.Frame.Height);
            heightConstraint.Active = true;

            treeView.Resized += OnTreeViewResized;
        }
示例#24
0
		void OnWatchRemoved (PinnedWatch watch)
		{
			if (batchUpdate > 0) {
				if (batchRemoved == null)
					batchRemoved = new List<PinnedWatch> ();
				if (!batchRemoved.Contains (watch))
					batchRemoved.Add (watch);
				return;
			}
			if (WatchRemoved != null)
				WatchRemoved (this, new PinnedWatchEventArgs (watch));
		}
示例#25
0
		void OnWatchChanged (PinnedWatch watch)
		{
			if (batchUpdate > 0) {
				if (batchChanged == null)
					batchChanged = new List<PinnedWatch> ();
				if (!batchChanged.Contains (watch))
					batchChanged.Add (watch);
				return;
			}
			DispatchService.GuiDispatch (() => {
				if (WatchChanged != null)
					WatchChanged (this, new PinnedWatchEventArgs (watch));
			});
		}
示例#26
0
		internal void NotifyWatchChanged (PinnedWatch watch)
		{
			OnWatchChanged (watch);
			OnChanged ();
		}
示例#27
0
		void AddWatch (PinnedWatch w)
		{
			DocumentLine line = widget.TextEditor.Document.GetLine (w.Line);
			if (line == null)
				return;
			PinnedWatchInfo wi = new PinnedWatchInfo ();
			wi.Line = line;
			if (w.OffsetX < 0) {
				w.OffsetY = (int)widget.TextEditor.LineToY (w.Line);
				int lw, lh;
				widget.TextEditor.TextViewMargin.GetLayout (line).Layout.GetPixelSize (out lw, out lh);
				w.OffsetX = (int)widget.TextEditor.TextViewMargin.XOffset + lw + 4;
			}
			wi.Widget = new PinnedWatchWidget (widget.TextEditorContainer, w);
			
//			wi.Marker = new DebugValueMarker (widget.TextEditor, line, w);
			wi.Watch = w;
			pinnedWatches.Add (wi);
//			if (w.Value != null)
//				wi.Marker.AddValue (w.Value);

			widget.TextEditorContainer.AddTopLevelWidget (wi.Widget, w.OffsetX, w.OffsetY);
			
//			widget.TextEditor.QueueDraw ();
		}
示例#28
0
		public static void SetLiveUpdateMode (PinnedWatch watch, bool liveUpdate)
		{
			if (watch.LiveUpdate == liveUpdate)
				return;
			
			watch.LiveUpdate = liveUpdate;
			if (liveUpdate) {
				Breakpoint bp = new Breakpoint (watch.File, watch.Line);
				bp.TraceExpression = "{" + watch.Expression + "}";
				bp.HitAction = HitAction.PrintExpression;
				breakpoints.Add (bp);
				pinnedWatches.Bind (watch, bp);
			} else {
				pinnedWatches.Bind (watch, null);
				breakpoints.Remove (watch.BoundTracer);
			}
		}
示例#29
0
        public DebugValueWindow(Gtk.Window transientFor, string pinnedWatchFileName, int pinnedWatchLine, StackFrame frame, ObjectValue value, PinnedWatch watch) : base(Gtk.WindowType.Toplevel)
        {
            this.TypeHint    = WindowTypeHint.PopupMenu;
            this.AllowShrink = false;
            this.AllowGrow   = false;
            this.Decorated   = false;

            TransientFor = transientFor;
            // Avoid getting the focus when the window is shown. We'll get it when the mouse enters the window
            AcceptFocus = false;

            sw = new ScrolledWindow();
            sw.HscrollbarPolicy = PolicyType.Never;
            sw.VscrollbarPolicy = PolicyType.Never;

            UpdateTreeStyle(Theme.BackgroundColor);
            Tree      = new ObjectValueTreeView();
            Tree.Name = innerTreeName;

            sw.Add(Tree);
            ContentBox.Add(sw);

            Tree.Frame                = frame;
            Tree.CompactView          = true;
            Tree.AllowAdding          = false;
            Tree.AllowEditing         = true;
            Tree.HeadersVisible       = false;
            Tree.AllowPinning         = true;
            Tree.RootPinAlwaysVisible = true;
            Tree.PinnedWatch          = watch;
            Tree.PinnedWatchLine      = pinnedWatchLine;
            Tree.PinnedWatchFile      = pinnedWatchFileName;

            Tree.AddValue(value);
            Tree.Selection.UnselectAll();
            Tree.SizeAllocated    += OnTreeSizeChanged;
            Tree.PinStatusChanged += OnPinStatusChanged;

            sw.ShowAll();

            Tree.StartEditing += OnStartEditing;
            Tree.EndEditing   += OnEndEditing;

            ShowArrow          = true;
            Theme.CornerRadius = 3;
            PreviewWindowManager.WindowClosed += PreviewWindowManager_WindowClosed;
        }