1147 if self.SetHighlight(HIGHLIGHT_NONE): |
1148 if self.SetHighlight(HIGHLIGHT_NONE): |
1148 self.SetCursor(wx.NullCursor) |
1149 self.SetCursor(wx.NullCursor) |
1149 self.ParentWindow.ForceRefresh() |
1150 self.ParentWindow.ForceRefresh() |
1150 |
1151 |
1151 def OnCanvasScroll(self, event): |
1152 def OnCanvasScroll(self, event): |
1152 if event.inaxes is not None: |
1153 if event.inaxes is not None and event.guiEvent.ControlDown(): |
1153 if self.GraphType == GRAPH_ORTHOGONAL: |
1154 if self.GraphType == GRAPH_ORTHOGONAL: |
1154 start_tick, end_tick = self.ParentWindow.GetRange() |
1155 start_tick, end_tick = self.ParentWindow.GetRange() |
1155 tick = (start_tick + end_tick) / 2. |
1156 tick = (start_tick + end_tick) / 2. |
1156 else: |
1157 else: |
1157 tick = event.xdata |
1158 tick = event.xdata |
1158 self.ParentWindow.ChangeRange(int(-event.step) / 3, tick) |
1159 self.ParentWindow.ChangeRange(int(-event.step) / 3, tick) |
|
1160 self.ParentWindow.VetoScrollEvent = True |
1159 |
1161 |
1160 def OnDragging(self, x, y): |
1162 def OnDragging(self, x, y): |
1161 width, height = self.GetSize() |
1163 width, height = self.GetSize() |
1162 bbox = self.GetAxesBoundingBox() |
1164 bbox = self.GetAxesBoundingBox() |
1163 if bbox.InsideXY(x, y) and not self.Is3DCanvas(): |
1165 if bbox.InsideXY(x, y) and not self.Is3DCanvas(): |
1453 self.Fixed = False |
1455 self.Fixed = False |
1454 self.CursorTick = None |
1456 self.CursorTick = None |
1455 self.DraggingAxesPanel = None |
1457 self.DraggingAxesPanel = None |
1456 self.DraggingAxesBoundingBox = None |
1458 self.DraggingAxesBoundingBox = None |
1457 self.DraggingAxesMousePos = None |
1459 self.DraggingAxesMousePos = None |
|
1460 self.VetoScrollEvent = False |
1458 self.VariableNameMask = [] |
1461 self.VariableNameMask = [] |
1459 |
1462 |
1460 self.GraphicPanels = [] |
1463 self.GraphicPanels = [] |
1461 |
1464 |
1462 graphics_button_sizer = wx.BoxSizer(wx.HORIZONTAL) |
1465 graphics_button_sizer = wx.BoxSizer(wx.HORIZONTAL) |
1511 self.GraphicsWindow.SetBackgroundColour(wx.WHITE) |
1514 self.GraphicsWindow.SetBackgroundColour(wx.WHITE) |
1512 self.GraphicsWindow.SetDropTarget(DebugVariableDropTarget(self)) |
1515 self.GraphicsWindow.SetDropTarget(DebugVariableDropTarget(self)) |
1513 self.GraphicsWindow.Bind(wx.EVT_ERASE_BACKGROUND, self.OnGraphicsWindowEraseBackground) |
1516 self.GraphicsWindow.Bind(wx.EVT_ERASE_BACKGROUND, self.OnGraphicsWindowEraseBackground) |
1514 self.GraphicsWindow.Bind(wx.EVT_PAINT, self.OnGraphicsWindowPaint) |
1517 self.GraphicsWindow.Bind(wx.EVT_PAINT, self.OnGraphicsWindowPaint) |
1515 self.GraphicsWindow.Bind(wx.EVT_SIZE, self.OnGraphicsWindowResize) |
1518 self.GraphicsWindow.Bind(wx.EVT_SIZE, self.OnGraphicsWindowResize) |
|
1519 self.GraphicsWindow.Bind(wx.EVT_MOUSEWHEEL, self.OnGraphicsWindowMouseWheel) |
|
1520 |
1516 main_sizer.AddWindow(self.GraphicsWindow, 1, flag=wx.GROW) |
1521 main_sizer.AddWindow(self.GraphicsWindow, 1, flag=wx.GROW) |
1517 |
1522 |
1518 self.GraphicsSizer = wx.BoxSizer(wx.VERTICAL) |
1523 self.GraphicsSizer = wx.BoxSizer(wx.VERTICAL) |
1519 self.GraphicsWindow.SetSizer(self.GraphicsSizer) |
1524 self.GraphicsWindow.SetSizer(self.GraphicsSizer) |
1520 |
1525 |