Пример #1
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;
        }
Пример #2
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;
        }