Fixed bug Drag'n drop variables from left panel to debug panel disabled
authorLaurent Bessard
Thu, 17 Oct 2013 12:20:36 +0200
changeset 1369 9bd4c783c98d
parent 1368 e567e4bee11f
child 1370 ee795a8d4404
Fixed bug Drag'n drop variables from left panel to debug panel disabled
controls/PouInstanceVariablesPanel.py
--- a/controls/PouInstanceVariablesPanel.py	Wed Oct 16 23:54:44 2013 +0200
+++ b/controls/PouInstanceVariablesPanel.py	Thu Oct 17 12:20:36 2013 +0200
@@ -428,14 +428,15 @@
                         if callback is not None:
                             callback(item_infos)
                 
-                elif flags & CT.TREE_HITTEST_ONITEMLABEL and item_infos.var_class in ITEMS_VARIABLE:
-                    self.ParentWindow.EnsureTabVisible(
-                        self.ParentWindow.DebugVariablePanel)
-                    item_path = "%s.%s" % (instance_path, item_infos.name)
-                    data = wx.TextDataObject(str((item_path, "debug")))
-                    dragSource = wx.DropSource(self.VariablesList)
-                    dragSource.SetData(data)
-                    dragSource.DoDragDrop()
+                    elif (flags & CT.TREE_HITTEST_ONITEMLABEL and 
+                          item_infos.var_class in ITEMS_VARIABLE):
+                        self.ParentWindow.EnsureTabVisible(
+                            self.ParentWindow.DebugVariablePanel)
+                        item_path = "%s.%s" % (instance_path, item_infos.name)
+                        data = wx.TextDataObject(str((item_path, "debug")))
+                        dragSource = wx.DropSource(self.VariablesList)
+                        dragSource.SetData(data)
+                        dragSource.DoDragDrop()
         event.Skip()
 
     def OnVariablesListKeyDown(self, event):