controls/PouInstanceVariablesPanel.py
changeset 1217 b64dcc1a011f
parent 1214 2ef048b5383c
child 1222 775b48a2be3b
equal deleted inserted replaced
1216:598ff0043ad3 1217:b64dcc1a011f
   172                 if var_infos["debug"] and self.Debug:
   172                 if var_infos["debug"] and self.Debug:
   173                     debug_button = wx.lib.buttons.GenBitmapButton(panel, 
   173                     debug_button = wx.lib.buttons.GenBitmapButton(panel, 
   174                           bitmap=GetBitmap("debug_instance"), 
   174                           bitmap=GetBitmap("debug_instance"), 
   175                           size=wx.Size(28, 28), style=wx.NO_BORDER)
   175                           size=wx.Size(28, 28), style=wx.NO_BORDER)
   176                     self.Bind(wx.EVT_BUTTON, self.GenDebugButtonCallback(var_infos), debug_button)
   176                     self.Bind(wx.EVT_BUTTON, self.GenDebugButtonCallback(var_infos), debug_button)
   177                     debug_button.Bind(wx.EVT_RIGHT_UP, self.GenDebugButtonRightClickCallback(var_infos))
   177                     debug_button.Bind(wx.EVT_LEFT_DCLICK, self.GenDebugButtonDClickCallback(var_infos))
   178                     buttons.append(debug_button)
   178                     buttons.append(debug_button)
   179                 
   179                 
   180                 button_num = len(buttons)
   180                 button_num = len(buttons)
   181                 if button_num > 0:
   181                 if button_num > 0:
   182                     panel.SetSize(wx.Size(button_num * 32, 28))
   182                     panel.SetSize(wx.Size(button_num * 32, 28))
   278                         var_path,
   278                         var_path,
   279                         self.Controller.ComputePouName(infos["type"]))
   279                         self.Controller.ComputePouName(infos["type"]))
   280             event.Skip()
   280             event.Skip()
   281         return DebugButtonCallback
   281         return DebugButtonCallback
   282     
   282     
   283     def GenDebugButtonRightClickCallback(self, infos):
   283     def GenDebugButtonDClickCallback(self, infos):
   284         def DebugButtonCallback(event):
   284         def DebugButtonDClickCallback(event):
   285             if self.InstanceChoice.GetSelection() != -1:
   285             if self.InstanceChoice.GetSelection() != -1:
   286                 if infos["class"] in ITEMS_VARIABLE:
   286                 if infos["class"] in ITEMS_VARIABLE:
   287                     self.ParentWindow.AddDebugVariable(
   287                     self.ParentWindow.AddDebugVariable(
   288                         "%s.%s" % (self.InstanceChoice.GetStringSelection(), 
   288                         "%s.%s" % (self.InstanceChoice.GetStringSelection(), 
   289                                    infos["name"]), 
   289                                    infos["name"]), 
   290                         force=True,
   290                         force=True,
   291                         graph=True)
   291                         graph=True)
   292             event.Skip()
   292             event.Skip()
   293         return DebugButtonCallback
   293         return DebugButtonDClickCallback
   294     
   294     
   295     def GenGraphButtonCallback(self, infos):
   295     def GenGraphButtonCallback(self, infos):
   296         def GraphButtonCallback(event):
   296         def GraphButtonCallback(event):
   297             if self.InstanceChoice.GetSelection() != -1:
   297             if self.InstanceChoice.GetSelection() != -1:
   298                 if infos["class"] in ITEMS_VARIABLE:
   298                 if infos["class"] in ITEMS_VARIABLE: