Fixed instances treecontrol display
authorEdouard Tisserant
Sat, 19 May 2012 12:40:53 +0200
changeset 686 3216bf5f711d
parent 685 ecd2226716d8
child 687 629680fb0582
Fixed instances treecontrol display
controls/PouInstanceVariablesPanel.py
--- a/controls/PouInstanceVariablesPanel.py	Sat May 19 11:19:54 2012 +0200
+++ b/controls/PouInstanceVariablesPanel.py	Sat May 19 12:40:53 2012 +0200
@@ -65,8 +65,11 @@
                        CT.TR_SINGLE|
                        CT.TR_HAS_VARIABLE_ROW_HEIGHT|
                        CT.TR_HIDE_ROOT|
-                       CT.TR_LINES_AT_ROOT|
-                       CT.TR_NO_LINES)
+                       CT.TR_NO_LINES|
+                       CT.TR_ALIGN_WINDOWS_RIGHT)
+        self.VariablesList.SetIndent(0)
+        self.VariablesList.SetSpacing(5)
+        self.VariablesList.DoSelectItem = lambda *x,**y:True
         self.VariablesList.Bind(CT.EVT_TREE_ITEM_ACTIVATED,
                 self.OnVariablesListItemActivated)
         
@@ -271,7 +274,7 @@
     def OnVariablesListItemActivated(self, event):
         if self.InstanceChoice.GetSelection() != -1:
             instance_path = self.InstanceChoice.GetStringSelection()
-            selected_item = self.VariablesList.GetSelection()
+            selected_item = event.GetItem()
             if selected_item is not None and selected_item.IsOk():
                 item_infos = self.VariablesList.GetPyData(selected_item)
                 if item_infos["class"] not in ITEMS_VARIABLE:
@@ -286,4 +289,4 @@
                     wx.CallAfter(self.ParentWindow.SelectProjectTreeItem, tagname)
         event.Skip()
     
-    
\ No newline at end of file
+