Bug with RightUp refresh element fixed
authorlbessard
Wed, 16 Apr 2008 10:26:33 +0200
changeset 206 f7c85a5939dc
parent 205 f12ad5b87f99
child 207 b1144bb36605
Bug with RightUp refresh element fixed
Viewer.py
--- a/Viewer.py	Wed Apr 16 10:25:52 2008 +0200
+++ b/Viewer.py	Wed Apr 16 10:26:33 2008 +0200
@@ -994,35 +994,41 @@
     def OnNoModifierMenu(self, event):
         if self.SelectedElement and self.IsBlock(self.SelectedElement):
             self.SelectedElement.SetConnectorNegated(False)
+            self.SelectedElement.Refresh()
             self.RefreshBuffer()
         event.Skip()
     
     def OnNegatedMenu(self, event):
         if self.SelectedElement and self.IsBlock(self.SelectedElement):
             self.SelectedElement.SetConnectorNegated(True)
+            self.SelectedElement.Refresh()
             self.RefreshBuffer()
         event.Skip()
 
     def OnRisingEdgeMenu(self, event):
         if self.SelectedElement and self.IsBlock(self.SelectedElement):
             self.SelectedElement.SetConnectorEdge("rising")
+            self.SelectedElement.Refresh()
             self.RefreshBuffer()
         event.Skip()
 
     def OnFallingEdgeMenu(self, event):
         if self.SelectedElement and self.IsBlock(self.SelectedElement):
             self.SelectedElement.SetConnectorEdge("falling")
+            self.SelectedElement.Refresh()
             self.RefreshBuffer()
         event.Skip()
 
     def OnAddSegmentMenu(self, event):
         if self.SelectedElement and self.IsWire(self.SelectedElement):
             self.SelectedElement.AddSegment()
+            self.SelectedElement.Refresh()
         event.Skip()
 
     def OnDeleteSegmentMenu(self, event):
         if self.SelectedElement and self.IsWire(self.SelectedElement):
             self.SelectedElement.DeleteSegment()
+            self.SelectedElement.Refresh()
         event.Skip()
 
     def OnAddBranchMenu(self, event):
@@ -1047,6 +1053,7 @@
             self.SelectedElement.Delete()
             self.SelectedElement = None
             self.RefreshBuffer()
+            self.Refresh(False)
         event.Skip()
 
     def OnClearExecutionOrderMenu(self, event):
@@ -1213,7 +1220,6 @@
             else:
                 self.SelectedElement.OnLeftUp(event, dc, self.Scaling)
                 wx.CallAfter(self.SetCursor, wx.NullCursor)
-                self.SelectedElement.Refresh()
         if self.Mode != MODE_SELECTION and not self.SavedMode:
             wx.CallAfter(self.ParentWindow.ResetCurrentMode)
         event.Skip()
@@ -1237,7 +1243,6 @@
         if self.SelectedElement:
             self.SelectedElement.OnRightUp(event, dc, self.Scaling)
             wx.CallAfter(self.SetCursor, wx.NullCursor)
-            self.SelectedElement.Refresh()
         else:
             self.PopupDefaultMenu(False)
         event.Skip()