~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/PinnedWatchWidget.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
{
39
39
        public class PinnedWatchWidget : Gtk.EventBox
40
40
        {
41
 
                PinnedWatch watch;
42
41
                ObjectValueTreeView valueTree;
 
42
                ObjectValue objectValue;
 
43
 
 
44
                TextEditor Editor {
 
45
                        get; set;
 
46
                }
43
47
                
44
48
                public PinnedWatch Watch {
45
 
                        get { return this.watch; }
 
49
                        get; private set;
46
50
                }
47
51
                
48
52
                public ObjectValue ObjectValue {
50
54
                                return objectValue;
51
55
                        }
52
56
                        set {
53
 
                                valueTree.ClearValues ();
54
 
                                this.objectValue = value;
55
 
                                if (objectValue != null)
56
 
                                        valueTree.AddValue (objectValue);
57
 
                        }
58
 
                }
59
 
                
60
 
                ObjectValue objectValue;
61
 
                
62
 
                TextEditorContainer container;
63
 
                
64
 
                TextEditor Editor {
65
 
                        get {
66
 
                                return container.TextEditorWidget;
67
 
                        }
68
 
                }
69
 
                
70
 
                public PinnedWatchWidget (TextEditorContainer container, PinnedWatch watch)
 
57
                                if (objectValue != null && value != null) {
 
58
                                        valueTree.ReplaceValue (objectValue, value);
 
59
                                } else {
 
60
                                        valueTree.ClearValues ();
 
61
                                        if (value != null)
 
62
                                                valueTree.AddValue (value);
 
63
                                }
 
64
 
 
65
                                objectValue = value;
 
66
                        }
 
67
                }
 
68
                
 
69
                public PinnedWatchWidget (TextEditor editor, PinnedWatch watch)
71
70
                {
72
 
                        this.container = container;
73
 
                        this.watch = watch;
74
 
                        this.objectValue = watch.Value;
 
71
                        objectValue = watch.Value;
 
72
                        Editor = editor;
 
73
                        Watch = watch;
 
74
 
75
75
                        valueTree = new ObjectValueTreeView ();
76
76
                        valueTree.AllowAdding = false;
77
77
                        valueTree.AllowEditing = true;
79
79
                        valueTree.HeadersVisible = false;
80
80
                        valueTree.CompactView = true;
81
81
                        valueTree.PinnedWatch = watch;
82
 
                        if (watch.Value != null)
83
 
                                valueTree.AddValue (watch.Value);
 
82
                        if (objectValue != null)
 
83
                                valueTree.AddValue (objectValue);
84
84
                        
85
85
                        valueTree.ButtonPressEvent += HandleValueTreeButtonPressEvent;
86
86
                        valueTree.ButtonReleaseEvent += HandleValueTreeButtonReleaseEvent;
101
101
 
102
102
                void HandleDebuggingServiceResumedEvent (object sender, EventArgs e)
103
103
                {
 
104
                        valueTree.ChangeCheckpoint ();
104
105
                        valueTree.AllowEditing = false;
105
106
                        valueTree.AllowExpanding = false;
106
 
                        valueTree.CollapseAll ();
107
 
                        valueTree.ChangeCheckpoint ();
108
107
                }
109
108
 
110
109
                void HandleDebuggingServicePausedEvent (object sender, EventArgs e)
111
110
                {
112
 
                        valueTree.AllowEditing = true;
113
111
                        valueTree.AllowExpanding = true;
 
112
                        valueTree.AllowEditing = true;
114
113
                }
115
114
 
116
115
                void HandleEditorOptionsChanged (object sender, EventArgs e)
154
153
                        Gdk.Rectangle rect = valueTree.GetCellArea (path, col);
155
154
                        if (!mousePressed && valueTree.Columns[0] == col && cx >= rect.Left) {
156
155
                                mousePressed = true;
157
 
                                container.MoveToTop (this);
 
156
                                Editor.MoveToTop (this);
158
157
//                              Gdk.Pointer.Grab (this.GdkWindow, true, Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.PointerMotionMask | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask, null, null, Gtk.Global.CurrentEventTime);
159
158
//                              Gtk.Grab.Add (this);
160
159
                        }
175
174
                void HandleValueTreeMotionNotifyEvent (object o, Gtk.MotionNotifyEventArgs args)
176
175
                {
177
176
                        if (mousePressed) {
178
 
                                watch.OffsetX += (int)(args.Event.XRoot - originX);
179
 
                                watch.OffsetY += (int)(args.Event.YRoot - originY);
 
177
                                Watch.OffsetX += (int)(args.Event.XRoot - originX);
 
178
                                Watch.OffsetY += (int)(args.Event.YRoot - originY);
180
179
                                
181
180
                                originX = args.Event.XRoot;
182
181
                                originY = args.Event.YRoot;