Merged more of wx.NewID_abuse_fix branch
authorEdouard Tisserant
Thu, 28 Mar 2019 09:19:30 +0100
changeset 2568 c73fd7467669
parent 2565 b5ce86166880 (diff)
parent 2567 eb9392511989 (current diff)
child 2570 1df8262b7d15
Merged more of wx.NewID_abuse_fix branch
editors/Viewer.py
--- a/Beremiz.py	Wed Mar 27 14:10:39 2019 +0100
+++ b/Beremiz.py	Thu Mar 28 09:19:30 2019 +0100
@@ -33,20 +33,6 @@
 import wx
 from wx.lib.agw.advancedsplash import AdvancedSplash, AS_NOTIMEOUT, AS_CENTER_ON_SCREEN
 
-import traceback
-from pprint import pprint
-orig_NewId = wx.NewId
-log_newid = {}
-def NewId(*a,**k):
-    res = orig_NewId(*a,**k)
-    bt = '|'.join([':'.join([f,str(l)]) for f,l,_0,_1 in traceback.extract_stack()[-2:-1]])
-    log_newid[bt] = log_newid.get(bt, 0) + 1
-    worst = log_newid.items()
-    worst.sort(key=lambda x:x[1])
-    pprint(worst)
-    return res
-wx.NewId = NewId
-
 import util.paths as paths
 
 
--- a/editors/Viewer.py	Wed Mar 27 14:10:39 2019 +0100
+++ b/editors/Viewer.py	Thu Mar 28 09:19:30 2019 +0100
@@ -1605,9 +1605,9 @@
         iec_path = self.GetElementIECPath(self.SelectedElement)
         if iec_path is not None:
             menu = wx.Menu(title='')
-            item = menu.Append(wx.ANY_ID, help='', kind=wx.ITEM_NORMAL, text=_("Force value"))
+            item = menu.Append(wx.ID_ANY, help='', kind=wx.ITEM_NORMAL, text=_("Force value"))
             self.Bind(wx.EVT_MENU, self.GetForceVariableMenuFunction(iec_path.upper(), self.SelectedElement), item)
-            ritem = menu.Append(wx.ANY_ID, help='', kind=wx.ITEM_NORMAL, text=_("Release value"))
+            ritem = menu.Append(wx.ID_ANY, help='', kind=wx.ITEM_NORMAL, text=_("Release value"))
             self.Bind(wx.EVT_MENU, self.GetReleaseVariableMenuFunction(iec_path.upper()), ritem)
             if self.SelectedElement.IsForced():
                 ritem.Enable(True)