controls/PouInstanceVariablesPanel.py
changeset 1277 358db9d64aa1
parent 1238 24577755485d
child 1281 47131e3388f4
equal deleted inserted replaced
1276:29bfd39e8e7a 1277:358db9d64aa1
    50                 self.ParentButton)
    50                 self.ParentButton)
    51         
    51         
    52         self.InstanceChoice = wx.ComboBox(self, size=wx.Size(0, 0), style=wx.CB_READONLY)
    52         self.InstanceChoice = wx.ComboBox(self, size=wx.Size(0, 0), style=wx.CB_READONLY)
    53         self.Bind(wx.EVT_COMBOBOX, self.OnInstanceChoiceChanged,
    53         self.Bind(wx.EVT_COMBOBOX, self.OnInstanceChoiceChanged,
    54                 self.InstanceChoice)
    54                 self.InstanceChoice)
    55         self.InstanceChoice.Bind(wx.EVT_LEFT_DOWN, self.OnInstanceChoiceLeftDown)
       
    56         
    55         
    57         self.DebugButton = wx.lib.buttons.GenBitmapButton(self, 
    56         self.DebugButton = wx.lib.buttons.GenBitmapButton(self, 
    58               bitmap=GetBitmap("debug_instance"), size=wx.Size(28, 28), style=wx.NO_BORDER)
    57               bitmap=GetBitmap("debug_instance"), size=wx.Size(28, 28), style=wx.NO_BORDER)
    59         self.DebugButton.SetToolTipString(_("Debug instance"))
    58         self.DebugButton.SetToolTipString(_("Debug instance"))
    60         self.Bind(wx.EVT_BUTTON, self.OnDebugButtonClick, 
    59         self.Bind(wx.EVT_BUTTON, self.OnDebugButtonClick, 
   363                 if tagname is not None:
   362                 if tagname is not None:
   364                     if instance_path != "":
   363                     if instance_path != "":
   365                         item_path = "%s.%s" % (instance_path, item_infos["name"])
   364                         item_path = "%s.%s" % (instance_path, item_infos["name"])
   366                     else:
   365                     else:
   367                         item_path = None
   366                         item_path = None
   368                     wx.CallAfter(self.SetPouType, tagname, item_path)
   367                     self.SetPouType(tagname, item_path)
   369                     wx.CallAfter(self.ParentWindow.SelectProjectTreeItem, tagname)
   368                     self.ParentWindow.SelectProjectTreeItem(tagname)
   370         event.Skip()
   369         event.Skip()
   371     
   370     
   372     def OnVariablesListLeftDown(self, event):
   371     def OnVariablesListLeftDown(self, event):
   373         if self.InstanceChoice.GetSelection() == -1:
   372         if self.InstanceChoice.GetSelection() == -1:
   374             wx.CallAfter(self.ShowInstanceChoicePopup)
   373             wx.CallAfter(self.ShowInstanceChoicePopup)
   389 
   388 
   390     def OnVariablesListKeyDown(self, event):
   389     def OnVariablesListKeyDown(self, event):
   391         keycode = event.GetKeyCode()
   390         keycode = event.GetKeyCode()
   392         if keycode != wx.WXK_LEFT:
   391         if keycode != wx.WXK_LEFT:
   393             event.Skip()
   392             event.Skip()
   394         
   393 
   395     def OnInstanceChoiceLeftDown(self, event):
       
   396         event.Skip()