equal
deleted
inserted
replaced
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 buttons.append(debug_button) |
178 buttons.append(debug_button) |
178 |
179 |
179 button_num = len(buttons) |
180 button_num = len(buttons) |
180 if button_num > 0: |
181 if button_num > 0: |
181 panel.SetSize(wx.Size(button_num * 32, 28)) |
182 panel.SetSize(wx.Size(button_num * 32, 28)) |
277 var_path, |
278 var_path, |
278 self.Controller.ComputePouName(infos["type"])) |
279 self.Controller.ComputePouName(infos["type"])) |
279 event.Skip() |
280 event.Skip() |
280 return DebugButtonCallback |
281 return DebugButtonCallback |
281 |
282 |
|
283 def GenDebugButtonRightClickCallback(self, infos): |
|
284 def DebugButtonCallback(event): |
|
285 if self.InstanceChoice.GetSelection() != -1: |
|
286 if infos["class"] in ITEMS_VARIABLE: |
|
287 self.ParentWindow.AddDebugVariable( |
|
288 "%s.%s" % (self.InstanceChoice.GetStringSelection(), |
|
289 infos["name"]), |
|
290 force=True, |
|
291 graph=True) |
|
292 event.Skip() |
|
293 return DebugButtonCallback |
|
294 |
282 def GenGraphButtonCallback(self, infos): |
295 def GenGraphButtonCallback(self, infos): |
283 def GraphButtonCallback(event): |
296 def GraphButtonCallback(event): |
284 if self.InstanceChoice.GetSelection() != -1: |
297 if self.InstanceChoice.GetSelection() != -1: |
285 if infos["class"] in ITEMS_VARIABLE: |
298 if infos["class"] in ITEMS_VARIABLE: |
286 var_path = "%s.%s" % (self.InstanceChoice.GetStringSelection(), |
299 var_path = "%s.%s" % (self.InstanceChoice.GetStringSelection(), |