equal
deleted
inserted
replaced
163 self.SetDropTarget(DebugVariableTextDropTarget(self, window)) |
163 self.SetDropTarget(DebugVariableTextDropTarget(self, window)) |
164 |
164 |
165 # Bind events |
165 # Bind events |
166 self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown) |
166 self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown) |
167 self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp) |
167 self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp) |
|
168 self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDClick) |
168 self.Bind(wx.EVT_ENTER_WINDOW, self.OnEnter) |
169 self.Bind(wx.EVT_ENTER_WINDOW, self.OnEnter) |
169 self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeave) |
170 self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeave) |
170 self.Bind(wx.EVT_SIZE, self.OnResize) |
171 self.Bind(wx.EVT_SIZE, self.OnResize) |
171 self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) |
172 self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) |
172 self.Bind(wx.EVT_PAINT, self.OnPaint) |
173 self.Bind(wx.EVT_PAINT, self.OnPaint) |
242 # Test if mouse has been pressed in this bounding box. In that case |
243 # Test if mouse has been pressed in this bounding box. In that case |
243 # start a move drag'n drop of item variable |
244 # start a move drag'n drop of item variable |
244 x, y = event.GetPosition() |
245 x, y = event.GetPosition() |
245 item_path_bbox = wx.Rect(20, (height - h) / 2, w, h) |
246 item_path_bbox = wx.Rect(20, (height - h) / 2, w, h) |
246 if item_path_bbox.InsideXY(x, y): |
247 if item_path_bbox.InsideXY(x, y): |
|
248 self.ShowButtons(False) |
247 data = wx.TextDataObject(str((item.GetVariable(), "debug", "move"))) |
249 data = wx.TextDataObject(str((item.GetVariable(), "debug", "move"))) |
248 dragSource = wx.DropSource(self) |
250 dragSource = wx.DropSource(self) |
249 dragSource.SetData(data) |
251 dragSource.SetData(data) |
250 dragSource.DoDragDrop() |
252 dragSource.DoDragDrop() |
251 |
253 |
261 # Execute callback on button under mouse pointer if it exists |
263 # Execute callback on button under mouse pointer if it exists |
262 x, y = event.GetPosition() |
264 x, y = event.GetPosition() |
263 wx.CallAfter(self.HandleButton, x, y) |
265 wx.CallAfter(self.HandleButton, x, y) |
264 event.Skip() |
266 event.Skip() |
265 |
267 |
|
268 def OnLeftDClick(self, event): |
|
269 """ |
|
270 Function called when mouse left button is double clicked |
|
271 @param event: wx.MouseEvent |
|
272 """ |
|
273 # Only numeric variables can be toggled to graph canvas |
|
274 if self.ItemsDict.values()[0].IsNumVariable(): |
|
275 self.ParentWindow.ToggleViewerType(self) |
|
276 |
266 def OnPaint(self, event): |
277 def OnPaint(self, event): |
267 """ |
278 """ |
268 Function called when redrawing Viewer content is needed |
279 Function called when redrawing Viewer content is needed |
269 @param event: wx.PaintEvent |
280 @param event: wx.PaintEvent |
270 """ |
281 """ |