Ejemplo n.º 1
0
        public PinnedWatchWidget(MonoTextEditor editor, PinnedWatch watch)
        {
            objectValue = watch.Value;
            Editor      = editor;
            Watch       = watch;

            if (UseNewTreeView)
            {
                controller = new ObjectValueTreeViewController();
                controller.AllowEditing = true;

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

                controller.PinnedWatch = watch;
                valueTree = null;

                if (objectValue != null)
                {
                    controller.AddValue(objectValue);
                }
            }
            else
            {
                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);
                }

                treeView   = valueTree;
                controller = null;
            }

            treeView.ButtonPressEvent   += HandleValueTreeButtonPressEvent;
            treeView.ButtonReleaseEvent += HandleValueTreeButtonReleaseEvent;
            treeView.MotionNotifyEvent  += HandleValueTreeMotionNotifyEvent;
            treeView.SizeAllocated      += OnTreeSizeChanged;

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

            var fr = new Frame();

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

            ShowAll();

            DebuggingService.PausedEvent  += HandleDebuggingServicePausedEvent;
            DebuggingService.ResumedEvent += HandleDebuggingServiceResumedEvent;
        }
Ejemplo n.º 2
0
        public void SetObjectValue(ObjectValue value)
        {
            if (value == objectValue)
            {
                return;
            }

            controller.ClearAll();

            if (value != null)
            {
                controller.AddValue(value);
            }

            objectValue = value;
        }
Ejemplo n.º 3
0
        public PinnedWatchView(PinnedWatch watch, StackFrame frame)
        {
            this.watch = watch ?? throw new ArgumentNullException(nameof(watch));
            this.frame = frame;

            controller = new ObjectValueTreeViewController();
            controller.SetStackFrame(frame);
            controller.AllowEditing   = true;
            controller.AllowExpanding = false;

            treeView = controller.GetMacControl(ObjectValueTreeViewFlags.PinnedWatchFlags);

            controller.PinnedWatch = watch;

            if (watch.Value != null)
            {
                controller.AddValue(objectValue = watch.Value);
            }

            var rect = treeView.Frame;

            if (rect.Height < 1)
            {
                treeView.Frame = new CoreGraphics.CGRect(rect.X, rect.Y, rect.Width, 19);
            }

            AddSubview(treeView);
            Frame = treeView.Frame;

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

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

            DebuggingService.ResumedEvent += OnDebuggerResumed;
            DebuggingService.PausedEvent  += OnDebuggerPaused;
            treeView.Resized += OnTreeViewResized;

            AddTrackingArea(new NSTrackingArea(
Ejemplo n.º 4
0
        public PinnedWatchView(PinnedWatch watch, StackFrame frame)
        {
            HasVerticalScroller = true;
            AutohidesScrollers  = true;

            controller = new ObjectValueTreeViewController();
            controller.SetStackFrame(frame);
            controller.AllowEditing = true;

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

            controller.PinnedWatch = watch;

            if (watch.Value != null)
            {
                controller.AddValue(watch.Value);
            }

            var rect = treeView.Frame;

            if (rect.Height < 1)
            {
                treeView.Frame = new CoreGraphics.CGRect(rect.X, rect.Y, rect.Width, 19);
            }

            DocumentView = treeView;
            Frame        = treeView.Frame;

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

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

            DebuggingService.ResumedEvent += OnDebuggerResumed;
            DebuggingService.PausedEvent  += OnDebuggerPaused;
            treeView.Resized += OnTreeViewResized;
        }