controls/PouInstanceVariablesPanel.py
changeset 1768 691083b5682a
parent 1754 63f4af6bf6d9
child 1782 5b6ad7a7fd9d
equal deleted inserted replaced
1767:c74815729afd 1768:691083b5682a
   122 
   122 
   123 class PouInstanceVariablesPanel(wx.Panel):
   123 class PouInstanceVariablesPanel(wx.Panel):
   124 
   124 
   125     def __init__(self, parent, window, controller, debug):
   125     def __init__(self, parent, window, controller, debug):
   126         wx.Panel.__init__(self, name='PouInstanceTreePanel',
   126         wx.Panel.__init__(self, name='PouInstanceTreePanel',
   127                 parent=parent, pos=wx.Point(0, 0),
   127                           parent=parent, pos=wx.Point(0, 0),
   128                 size=wx.Size(0, 0), style=wx.TAB_TRAVERSAL)
   128                           size=wx.Size(0, 0), style=wx.TAB_TRAVERSAL)
   129 
   129 
   130         self.ParentButton = wx.lib.buttons.GenBitmapButton(self,
   130         self.ParentButton = wx.lib.buttons.GenBitmapButton(
   131               bitmap=GetBitmap("top"), size=wx.Size(28, 28), style=wx.NO_BORDER)
   131             self, bitmap=GetBitmap("top"), size=wx.Size(28, 28), style=wx.NO_BORDER)
   132         self.ParentButton.SetToolTipString(_("Parent instance"))
   132         self.ParentButton.SetToolTipString(_("Parent instance"))
   133         self.Bind(wx.EVT_BUTTON, self.OnParentButtonClick,
   133         self.Bind(wx.EVT_BUTTON, self.OnParentButtonClick,
   134                 self.ParentButton)
   134                   self.ParentButton)
   135 
   135 
   136         self.InstanceChoice = wx.ComboBox(self, size=wx.Size(0, 0), style=wx.CB_READONLY)
   136         self.InstanceChoice = wx.ComboBox(self, size=wx.Size(0, 0), style=wx.CB_READONLY)
   137         self.Bind(wx.EVT_COMBOBOX, self.OnInstanceChoiceChanged,
   137         self.Bind(wx.EVT_COMBOBOX, self.OnInstanceChoiceChanged,
   138                 self.InstanceChoice)
   138                   self.InstanceChoice)
   139 
   139 
   140         self.DebugButton = wx.lib.buttons.GenBitmapButton(self,
   140         self.DebugButton = wx.lib.buttons.GenBitmapButton(
   141               bitmap=GetBitmap("debug_instance"), size=wx.Size(28, 28), style=wx.NO_BORDER)
   141             self, bitmap=GetBitmap("debug_instance"), size=wx.Size(28, 28), style=wx.NO_BORDER)
   142         self.DebugButton.SetToolTipString(_("Debug instance"))
   142         self.DebugButton.SetToolTipString(_("Debug instance"))
   143         self.Bind(wx.EVT_BUTTON, self.OnDebugButtonClick,
   143         self.Bind(wx.EVT_BUTTON, self.OnDebugButtonClick,
   144                 self.DebugButton)
   144                   self.DebugButton)
   145 
   145 
   146         self.VariablesList = CustomTreeCtrlWithRightImage(self,
   146         self.VariablesList = CustomTreeCtrlWithRightImage(
   147               style=wx.SUNKEN_BORDER,
   147             self,
   148               agwStyle=CT.TR_NO_BUTTONS |
   148             style=wx.SUNKEN_BORDER,
   149                        CT.TR_SINGLE |
   149             agwStyle=(CT.TR_NO_BUTTONS |
   150                        CT.TR_HAS_VARIABLE_ROW_HEIGHT |
   150                       CT.TR_SINGLE |
   151                        CT.TR_HIDE_ROOT |
   151                       CT.TR_HAS_VARIABLE_ROW_HEIGHT |
   152                        CT.TR_NO_LINES |
   152                       CT.TR_HIDE_ROOT |
   153                        getattr(CT, "TR_ALIGN_WINDOWS_RIGHT", CT.TR_ALIGN_WINDOWS))
   153                       CT.TR_NO_LINES |
       
   154                       getattr(CT, "TR_ALIGN_WINDOWS_RIGHT", CT.TR_ALIGN_WINDOWS)))
   154         self.VariablesList.SetIndent(0)
   155         self.VariablesList.SetIndent(0)
   155         self.VariablesList.SetSpacing(5)
   156         self.VariablesList.SetSpacing(5)
   156         self.VariablesList.DoSelectItem = lambda *x, **y: True
   157         self.VariablesList.DoSelectItem = lambda *x, **y: True
   157         self.VariablesList.Bind(CT.EVT_TREE_ITEM_ACTIVATED,
   158         self.VariablesList.Bind(CT.EVT_TREE_ITEM_ACTIVATED,
   158                 self.OnVariablesListItemActivated)
   159                                 self.OnVariablesListItemActivated)
   159         self.VariablesList.Bind(wx.EVT_LEFT_DOWN, self.OnVariablesListLeftDown)
   160         self.VariablesList.Bind(wx.EVT_LEFT_DOWN, self.OnVariablesListLeftDown)
   160         self.VariablesList.Bind(wx.EVT_KEY_DOWN, self.OnVariablesListKeyDown)
   161         self.VariablesList.Bind(wx.EVT_KEY_DOWN, self.OnVariablesListKeyDown)
   161 
   162 
   162         self.TreeRightImageList = wx.ImageList(24, 24)
   163         self.TreeRightImageList = wx.ImageList(24, 24)
   163         self.EditImage = self.TreeRightImageList.Add(GetBitmap("edit"))
   164         self.EditImage = self.TreeRightImageList.Add(GetBitmap("edit"))