# HG changeset patch # User laurent # Date 1328638345 -3600 # Node ID e9295622ce9b44f146cd9ff0c714f3cb836fd68b # Parent c32c169b8f63ae90db242527d57487997f637009 Fix bug with ToolTip staying on screen when compiling project with shortcut and mouse over a block diff -r c32c169b8f63 -r e9295622ce9b Viewer.py --- a/Viewer.py Thu Feb 02 16:12:26 2012 +0100 +++ b/Viewer.py Tue Feb 07 19:12:25 2012 +0100 @@ -540,7 +540,7 @@ self.Editor.Bind(wx.EVT_MOUSEWHEEL, self.OnMouseWheelWindow) self.Editor.Bind(wx.EVT_SIZE, self.OnMoveWindow) self.Editor.Bind(wx.EVT_MOUSE_EVENTS, self.OnViewerMouseEvent) - + def __del__(self): DebugViewer.__del__(self) self.RefreshHighlightsTimer.Stop() @@ -910,6 +910,10 @@ def RefreshView(self, variablepanel=True, selection=None): EditorPanel.RefreshView(self, variablepanel) + if self.ToolTipElement is not None: + self.ToolTipElement.ClearToolTip() + self.ToolTipElement = None + self.Inhibit(True) self.current_id = 0 # Start by reseting Viewer @@ -1423,7 +1427,7 @@ tooltip_pos.y += 10 self.ToolTipElement.CreateToolTip(tooltip_pos) event.Skip() - + def OnViewerLeftDown(self, event): if self.Mode == MODE_SELECTION: dc = self.GetLogicalDC() diff -r c32c169b8f63 -r e9295622ce9b graphics/LD_Objects.py --- a/graphics/LD_Objects.py Thu Feb 02 16:12:26 2012 +0100 +++ b/graphics/LD_Objects.py Tue Feb 07 19:12:25 2012 +0100 @@ -152,7 +152,7 @@ for connect in self.Connectors: connect_pos = connect.GetRelPosition() connect.SetPosition(wx.Point(connect_pos.x, connect_pos.y - miny)) - self.Connectors.sort(lambda x, y: x.Pos.y.__cmp__(y.Pos.y)) + self.Connectors.sort(lambda x, y: cmp(x.Pos.y, y.Pos.y)) maxy = 0 for connect in self.Connectors: connect_pos = connect.GetRelPosition() diff -r c32c169b8f63 -r e9295622ce9b graphics/SFC_Objects.py --- a/graphics/SFC_Objects.py Thu Feb 02 16:12:26 2012 +0100 +++ b/graphics/SFC_Objects.py Tue Feb 07 19:12:25 2012 +0100 @@ -1222,8 +1222,8 @@ for output in self.Outputs: output_pos = output.GetRelPosition() output.SetPosition(wx.Point(output_pos.x - minx, output_pos.y)) - self.Inputs.sort(lambda x, y: x.Pos.x.__cmp__(y.Pos.x)) - self.Outputs.sort(lambda x, y: x.Pos.x.__cmp__(y.Pos.x)) + self.Inputs.sort(lambda x, y: cmp(x.Pos.x, y.Pos.x)) + self.Outputs.sort(lambda x, y: cmp(x.Pos.x, y.Pos.x)) self.Pos.x += minx self.Size[0] = maxx - minx connector.MoveConnected()