# HG changeset patch
# User Laurent Bessard
# Date 1382005236 -7200
# Node ID 9bd4c783c98dcdc68e50d195f11e00df6f4cea1c
# Parent  e567e4bee11f83835fac9a20e59fd7efc7f8945f
Fixed bug Drag'n drop variables from left panel to debug panel disabled

diff -r e567e4bee11f -r 9bd4c783c98d 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):