Closed zarekvane closed 2 years ago
Maybe I have already known the reason for the second problem.
such as function OnVariableTool
:
def OnVariableTool(self, event):
self.ResetToolToggle(ID_PLCOPENEDITOREDITORTOOLBARVARIABLE)
selected = self.TabsOpened.GetSelection()
if selected != -1:
self.TabsOpened.GetPage(selected).SetMode(MODE_VARIABLE)
ResetToolToggle
is to set the toggle of relative toolbar item to False. It prevents the next event. I guess the original code may be to prevent users from accidentally clicking on the toolbar button before the add dialog box pops up. But he forgot to reset the value to True when the dialog closed. After some basic tests, I found that this code is unnecessary.
There are two main problem:
problem 1 (fixed)
EditorToolBar can't be shown.
problem 2 (not fixed)
EVT_MENU event is triggered only once and there is not responding when I click the EditorToolBar item the second time, meanwhile, it throws some Exceptions. This seems to be the bug of wxpython4?