# HG changeset patch # User Laurent Bessard # Date 1355185182 -3600 # Node ID 6b2958f04f30c862612632f35f7375dfffd81719 # Parent 3cd39bc7dbad7ea9308cbb9ae8745911114db2a6 Adding drag'n drop of debug variable from DebugVariable grid and PouInstance variable list diff -r 3cd39bc7dbad -r 6b2958f04f30 controls/DebugVariablePanel.py --- a/controls/DebugVariablePanel.py Tue Dec 11 01:17:52 2012 +0100 +++ b/controls/DebugVariablePanel.py Tue Dec 11 01:19:42 2012 +0100 @@ -457,7 +457,7 @@ def OnVariablesGridCellLeftClick(self, event): if event.GetCol() == 0: row = event.GetRow() - data = wx.TextDataObject(str(self.Table.GetValueByName(row, "Variable"))) + data = wx.TextDataObject(str((self.Table.GetValueByName(row, "Variable"), "debug"))) dragSource = wx.DropSource(self.VariablesGrid) dragSource.SetData(data) dragSource.DoDragDrop() diff -r 3cd39bc7dbad -r 6b2958f04f30 controls/PouInstanceVariablesPanel.py --- a/controls/PouInstanceVariablesPanel.py Tue Dec 11 01:17:52 2012 +0100 +++ b/controls/PouInstanceVariablesPanel.py Tue Dec 11 01:19:42 2012 +0100 @@ -329,6 +329,17 @@ def OnVariablesListLeftDown(self, event): if self.InstanceChoice.GetSelection() == -1: wx.CallAfter(self.ShowInstanceChoicePopup) + else: + instance_path = self.InstanceChoice.GetStringSelection() + item, flags = self.VariablesList.HitTest(event.GetPosition()) + if item is not None and flags & CT.TREE_HITTEST_ONITEMLABEL: + item_infos = self.VariablesList.GetPyData(item) + if item_infos is not None and item_infos["class"] in ITEMS_VARIABLE: + 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 OnInstanceChoiceLeftDown(self, event):